query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f445e6750306be492868d8e6038a00ec
Logic to Check if Logged iN or Not
[ { "docid": "7f2cb2c37715bfdeea5b0eaeb28f6628", "score": "0.0", "text": "function PrivateRoute({ component: Component, user, ...rest }) {\n return (\n <Route\n {...rest}\n render={(props) => auth.isAuthenticated() === true\n ? <Component user={user} {...props} />\n : <Redirect to={{ pathname: '/login', state: { from: props.location } }} />}\n />\n )\n}", "title": "" } ]
[ { "docid": "ef231c22ea5286a24c6bf86a7ee3d336", "score": "0.6195749", "text": "function isLogin() {\n const loginCount = configuration.ARENGU_PROFILE_LOGIN_COUNT || 2;\n return context.stats.loginsCount > parseInt(loginCount, 10);\n }", "title": "" }, { "docid": "aafc0f1190b661d41644689436e88b60", "score": "0.61856645", "text": "queryLoginStatus() {\n // If there are any additional checks for being logged in, they go here.\n return this.state.uname !== '';\n }", "title": "" }, { "docid": "6a4ddec98ae056e55c788274b5dfd2a3", "score": "0.60507345", "text": "isLogged() {\n return RT_API.current_user.ID !== 0\n }", "title": "" }, { "docid": "84ef76e5c3235e1f6641ab26cade48a1", "score": "0.6024749", "text": "loggedIn() {\r\n // Checks if there is a saved token and it's still valid\r\n const token = this.getToken() // GEtting token from localstorage\r\n return !!token && !this.isTokenExpired(token) // handwaiving here\r\n }", "title": "" }, { "docid": "a3348e3002ed8c30b12674e99997b729", "score": "0.6002847", "text": "loggedIn(){\n const token = this.getToken()\n\n return !!token && !this.isTokenExpired(token)\n }", "title": "" }, { "docid": "2a37888c2dfacb8b02e509c5597aa2fe", "score": "0.5963629", "text": "loggedIn() {\n const token = this.getToken();\n return !!token && !this.isTokenExpired(token); \n }", "title": "" }, { "docid": "271c15492de377c4f4750d96706cb7f1", "score": "0.5879683", "text": "loggedIn() {\r\n // Checks if there is a saved token and it's still valid\r\n const token = this.getToken();\r\n return !!token && !this.isTokenExpired(token);\r\n }", "title": "" }, { "docid": "0ea36e558d2d8155468c3ba6dc7bd940", "score": "0.58553493", "text": "function log_auth_state() {\n const stars = '***********************************************';\n if (config.session.secret === 'nodejs_idm' || config.password_encryption.key === 'nodejs_idm') {\n debug(stars);\n debug('WARNING: The current encryption keys match the defaults found in the plaintext');\n debug(' template file - please update for a production instance');\n debug(stars);\n }\n\n if (config.session.secret === 'nodejs_idm' || config.password_encryption === 'nodejs_idm') {\n debug(stars);\n debug('WARNING: Encryption keys must be changed if you are using the IDM in a production Environment');\n debug(' These keys should be set using Docker Secrets');\n debug(stars);\n }\n\n if (config.database.password === 'idm' || config.database.name === 'root') {\n debug(stars);\n debug('WARNING: It is recommended that you reconfigure the IDM database access not to use default values');\n debug(' These keys should be set using Docker Secrets');\n debug(stars);\n }\n}", "title": "" }, { "docid": "7d0e9ded9d2b15014de4a940d02044d2", "score": "0.5849722", "text": "loggedIn() {\n // checks if there is a saved token and it's still valid\n const idToken = this.getToken();\n return idToken && !this.isTokenExpired(idToken);\n }", "title": "" }, { "docid": "9f2278fceb54505d8a60f38feaa5002a", "score": "0.58481354", "text": "loggedIn(){\n const token = this.getToken()\n return !!token\n }", "title": "" }, { "docid": "434dc24be3670163de0565cc9126ef00", "score": "0.5750732", "text": "function loggedIn() {\n if (document.cookie != undefined) {\n return document.cookie.split('=')[0] == 'esi-isk';\n }\n return false;\n}", "title": "" }, { "docid": "0486c7052c61b4251c061c2099370adb", "score": "0.57436997", "text": "function checkLoggedStatus() {\n //debugger;\n //set the present url to a localstorage\n\t//if sessionID and applicantID are not set then redirect to loginpage\n\treturn window.localStorage.getItem('sessionID') === null && USERID === null ? false : true;\n}", "title": "" }, { "docid": "f1acac11e5a822bf9fabf68b3e49422a", "score": "0.57380193", "text": "isUserLoggedIn(state) {\n\t\t\treturn typeof state.user.id != 'undefined';\n\t\t}", "title": "" }, { "docid": "f62867b0abcbe02a5bb8aec72add6236", "score": "0.5736724", "text": "isLoggedIn (state) {\n return !!state.authToken\n }", "title": "" }, { "docid": "223a22d261c37c73edf2ed212ca97a17", "score": "0.56819695", "text": "loggedIn(state) {\n return !!state.currentUser;\n }", "title": "" }, { "docid": "1a1f9067dfddc74db5ef84dbd670661d", "score": "0.5652956", "text": "function _isLoggedIn(userId) {\n return loginStatus[userId] == 1;\n }", "title": "" }, { "docid": "6a060e3f39b043d49374fc305504f939", "score": "0.5644761", "text": "isLoggedOn () {\n return this.localStorageService.get('accountData') !== null\n }", "title": "" }, { "docid": "3021d0f8277292d6caa813ebd992c5f5", "score": "0.56433886", "text": "function isLogged(){\n return auth.$getAuth();\n }", "title": "" }, { "docid": "d06b3e44dfdecb25d79325c67d6736c5", "score": "0.5633124", "text": "_loggedIn() {\n // Is worker in part of an active group (experiment)?\n // This is okay even if batch is not active\n if (Partitioner.getUserGroup(this.userId)) {\n Meteor._debug(`${this.userId} is reconnecting to an existing group`);\n return;\n }\n\n // Is the worker reconnecting to an exit survey?\n let user = Meteor.users.findOne(this.userId);\n let state = user && user.turkserver && user.turkserver.state;\n if (state === \"exitsurvey\") {\n Meteor._debug(`${this.userId} is reconnecting to the exit survey`);\n }\n\n // Nothing else needs to be done;\n // a fresh login OR a reconnect will check for lobby state properly.\n }", "title": "" }, { "docid": "8d9133ba85661c03cf4b0e789be76221", "score": "0.5631302", "text": "function getIsLogin() {return isLogin;}", "title": "" }, { "docid": "c4c34d57af5cc4885062cc65e0224739", "score": "0.5595215", "text": "isNearlyIdentity(digits) {\n const snapped = this.clone().snap(digits);\n return snapped.isIdentity();\n }", "title": "" }, { "docid": "f93c50e3694a4aa906b4684e2ca8a1fb", "score": "0.5592023", "text": "function isLogged(){\n return localStorage.token !== undefined;\n}", "title": "" }, { "docid": "ca70f0305c0f6338cb5d7cffe19f43a0", "score": "0.5590665", "text": "function isLoggedIn() {\n var uc = getLocal('usercookie');\n if (uc !== '' && uc !== null) {\n console.log(uc);\n console.log(uc.username);\n // check hash against server, here\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "2c7e177258b2a1d00418b40a8e469b5d", "score": "0.5567933", "text": "get isLoggedIn() {\n const token = this.getToken();\n return !!token && !isTokenExpired(token);\n }", "title": "" }, { "docid": "18d21afe7681f1a816ab8cf61b80396d", "score": "0.5558274", "text": "function LMSAPI_isLoggedIn() {\n logger.write(logger.INTERNAL,\"lms.isLoggedIn()\");\n var userid = this.getValue(\"cmi.core.student_id\");\n\treturn this.mode != this.MODE_LOGGED_OUT && userid != null && userid != \"\";\n}", "title": "" }, { "docid": "a986e014bac07eb694b9063e7eece41a", "score": "0.5557592", "text": "function u_wasloggedin()\r\n{\r\n\treturn localStorage.wasloggedin;\r\n}", "title": "" }, { "docid": "9c2e2e976d9ad9b666dfb472a41c2cb8", "score": "0.5544295", "text": "function isLogged() {\n return getUserData().then(function(user){\n return true;\n }, function(error){ \n return false;\n });\n }", "title": "" }, { "docid": "f05191ae22291698e52887ba9a987bde", "score": "0.55440146", "text": "function isLogged() {\n const isLogged = localStorage.getItem('credentials') ? true : false;\n return isLogged;\n}", "title": "" }, { "docid": "f178b1820b75d093dcd95debc3f66722", "score": "0.55408686", "text": "function isLoggedIn() {\n if (HelpCenter.user.role != \"anonymous\") {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "dfb1a563825d11c16072d52c1ecaa3be", "score": "0.551656", "text": "function signInStateCheck() {\n const lastToken = token;\n const newSignIn = signedIn();\n if (token !== lastToken) TraX.socket.emit('newtoken', token);\n if (TraX.isSignedIn !== newSignIn) {\n TraX.isSignedIn = newSignIn;\n if (TraX.isSignedIn) {\n driverName = gapi.auth2.getAuthInstance()\n .currentUser.get()\n .getBasicProfile()\n .getName();\n driverId = gapi.auth2.getAuthInstance()\n .currentUser.get()\n .getBasicProfile()\n .getId();\n triggerEvent('signin');\n } else {\n driverName = '';\n driverId = 0;\n triggerEvent('signout');\n }\n\n TraX.requestFriendsList();\n if (TraX.debugMode) console.log('Sign in state change detected');\n }\n }", "title": "" }, { "docid": "9d6bc3b067e9d7bdf9de97cc1a588642", "score": "0.5494859", "text": "isLoggedIn(whenYes, whenNo) {\n if (sessionManager.get(\"userID\")) {\n whenYes();\n } else {\n whenNo();\n }\n }", "title": "" }, { "docid": "dca651ca7ffa21d2592494af25579de7", "score": "0.54747784", "text": "isLogged() {\n // Check if already logged in less than 5 minutes ago\n if(!this.loginRequired || (this._login.status && (Date.now() - this._login.lastLogin) < 300000)) {\n return Promise.resolve(true);\n }\n\n // If not logged in or more than 5 minutes ago, we presume that we are not logged anymore and we need to check again\n this._login.status = false;\n\n return this._request({ url: this._endpoints.loginCheck, method: 'GET' }).then((body) => {\n if(!this._checkLoginSuccess(body)) {\n return Promise.resolve(false);\n }\n\n this._login.status = true;\n this._login.lastLogin = Date.now();\n\n return true;\n });\n }", "title": "" }, { "docid": "a9fb73375eabcb82f4db1c7b21e36b86", "score": "0.5465531", "text": "isAuthenticated(state) { \n\t\t\t return state.idToken !== null\n\t\t }", "title": "" }, { "docid": "b21e783183f106bf8990eef924c66ed9", "score": "0.54601103", "text": "function isLogin(){\n\n const token = window.localStorage.getItem('loginToken');\n\n if(token){\n const {exp} = jwtDecode(token);\n // *1000 for having the two datetime in ms\n if( exp*1000 > new Date().getTime() ){\n return true;\n }\n return false;\n }\n return false;\n}", "title": "" }, { "docid": "baf1507da1989d00755594d834558c0e", "score": "0.54519886", "text": "isLoggedIn() {\n return _isObject(this.user) &&\n _isNumber(this.user.id) && this.user.id !== GUEST_USER_ID\n }", "title": "" }, { "docid": "8b25d1275141da305644970689395d60", "score": "0.54272777", "text": "function isLogged(req) {\n return req.session && req.session.userId == conf.admin.id;\n }", "title": "" }, { "docid": "5886f183f3d85587bb0fcd648c2c8cb9", "score": "0.54174876", "text": "function userIsLoggedIn() {\n\treturn !(sessionStorage['playerid'] == undefined);\n}", "title": "" }, { "docid": "58316aa07953a59a77ca640888af96fe", "score": "0.54108506", "text": "static isLoggedIn() {\n if (localStorage.getItem(\"loggedin\") === \"true\") {\n // console.log(\"HILOGGEDIN\");\n return true;\n } else {\n // console.log(\"HINOTLOGGEDIN\");\n return false;\n }\n }", "title": "" }, { "docid": "ad1b433196ed300f1d90018c38ea9fae", "score": "0.54105633", "text": "function idXSLoggedIn() {\r\n\t\tjQuery.ajax({\r\n\t\t\turl: \"/UspsToolsRestServices/rest/idCrossSell/secure/idxsSignedUp\",\r\n\t\t\ttype: \"GET\",\r\n\t\t\tcache: false,\r\n\t\t\theaders: {\r\n\t\t\t\t\"Content-Type\": \"application/json;charset=utf-8\"\r\n\t\t\t},\r\n\t\t\tdataType: \"json\",\r\n\t\t\tsuccess: function (resp) {\r\n\r\n\t\t\t\tvar idEnrolled = resp.IDEnrolled;\r\n\r\n\t\t\t\tvar isLoggedInUser = resp.ValidLoginSession;\r\n\t\t\t\ttrackingApp.isIDRegUser = isLoggedInUser;\r\n\r\n\t\t\t\tvar isEligible = idEnrolled.IDAddressEligible;\r\n\t\t\t\tvar hasBeenAsked = idEnrolled.IDHasBeenAsked;\r\n\t\t\t\tvar accountType = resp.AccountType;\r\n\t\t\t\tvar isAccountIDEleg = idEnrolled.IDEligible;\r\n\t\t\t\tvar isUserInID = idEnrolled.IDGroup;\r\n\r\n\t\t\t\tif (isEligible == \"false\" || hasBeenAsked == \"Y\" || accountType == \"BUSINESS\" || isAccountIDEleg == \"N\" || isUserInID == \"GRANT\") {\r\n\t\t\t\t\ttrackingApp.isIDready = true;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\terror: function (jqXHR, exception) {\r\n\t\t\t\tconsole.log(\"ERROR: ID Cross Sell - Defaulting to OFF\")\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "a42dd7210a2c1ee0717b8250494682f0", "score": "0.5404216", "text": "function loggedIn() {\n return Virtru.Auth.isLoggedIn({ email: getUser() });\n}", "title": "" }, { "docid": "203f5c424f6769e7bb4afc9f92bbdb70", "score": "0.5400154", "text": "function isLogin(user) { // banned?\n if (user && user.id) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "f6eaa223d307e7311811f246a1553548", "score": "0.53989375", "text": "function isLogged() {\n var token;\n if (localStorage.getItem(token) == \"encargado\" || localStorage.getItem(token) == \"admin\")\n return true;\n else {\n return false;\n }\n}", "title": "" }, { "docid": "fb189ceffe431f73b68f6af33f164d28", "score": "0.5395692", "text": "isLoggedIn(){\n if (this.token === '' || this.id === '') return false;\n if(this.expires){\n let dt = new Date();\n if (dt < this.expires) return true;\n }\n this.token = '';\n return false;\n }", "title": "" }, { "docid": "9fd58bfb978e4de481c65d8faa3cc78d", "score": "0.538566", "text": "function ngcheckLoggedIn(){\r\n\tif(typeof(authenticateUserCheck) !== \"undefined\" && authenticateUserCheck =='true')\r\n\t\treturn true;\r\n\telse \r\n\t\treturn false;\r\n}", "title": "" }, { "docid": "1b2aebd9df81090785a3cbfffc1b0ef1", "score": "0.5382811", "text": "function isLoggedIn() {\n return _loggedIn;\n}", "title": "" }, { "docid": "ce06f3c7d6580b4499d63c5d59908d6d", "score": "0.53686607", "text": "isLoggedIn() {\r\n return this.cacheEngine.has(this.accessTokenCacheKey);\r\n }", "title": "" }, { "docid": "785c77e283579332a87495686938c306", "score": "0.5357929", "text": "isLoggedIn(whenYes, whenNo) {\n if (sessionManager.get(\"username\")) {\n whenYes();\n } else {\n whenNo();\n }\n }", "title": "" }, { "docid": "7a57de87186b52dbbff6f3a05ffabe56", "score": "0.5343198", "text": "function ifLogInIsNeed(){\n\tif(getCookie(\"jugaPlayUserRemember\")==\"true\"){// Si el usuario esta logeado\n\t\tif(getCookie(\"jugaPlayUserFacebook\")==\"true\"){\n\t\t\tcheckLogInFacebook();\n\t\t}else{\n\t\t\tmesajeToServerWithDataLogInSaved(JSON.stringify({ \"user\": { \"email\": getCookie(\"juga-Play-User\"), \"password\":getCookie(\"juga-Play-Pass\") } }));\n\t\t}\n\t}else{\n\t\tlogOutFromJugaPlay();\n\t}\n}", "title": "" }, { "docid": "560b94b3b4e444304e2f679326f4243b", "score": "0.53237844", "text": "isLoggedIn(whenYes, whenNo) {\n if (sessionManager.get(\"id\")) {\n whenYes();\n } else {\n whenNo();\n }\n }", "title": "" }, { "docid": "18b2f73fa4304286916d006df4ced57c", "score": "0.530299", "text": "function isLoggedIn() {\n return true\n}", "title": "" }, { "docid": "40a58db08362b4bcfbdd89cd8e9889f1", "score": "0.53029406", "text": "function setIsLogin(flag) {isLogin=flag;}", "title": "" }, { "docid": "1ac6021f739daddc4e4ee013f1328017", "score": "0.5291761", "text": "function getUserLoginStatus() {\n return isUserLoggedIn;\n}", "title": "" }, { "docid": "c6e593ebff6c918f2bbfd76cf4ba7d28", "score": "0.52884084", "text": "isLoggedIn(state, getters) {\n return getters.currentJWT && getters.currentAccount;\n }", "title": "" }, { "docid": "3fe3348c15d464d3a9ea67194fe9f8b7", "score": "0.52858263", "text": "function checkLogins() {\n if (localStorage.hasOwnProperty('nextbid_login')) {\n let loginCredentials = JSON.parse(localStorage.getItem(\"nextbid_login\"));\n if (loginCredentials.username !== undefined && loginCredentials.password !== undefined && loginCredentials.userType !== undefined) {\n if (loginCredentials.userType === \"customer\") {\n showMenu(\"customer\");\n return;\n }\n\n if (loginCredentials.userType === \"seller\") {\n showMenu(\"seller\");\n return;\n }\n }\n }\n\n if (window.location.href !== baseUrl + 'user-login.html') {\n window.location.href = baseUrl + 'user-login.html';\n }\n showMenu(undefined);\n}", "title": "" }, { "docid": "42a302292de2c0909cdc18bb8f13af9f", "score": "0.52856237", "text": "isUserLoggedIn() {\n let user = localStorage.getItem(USERNAME_ATTRIBUTE_NAME)\n if (user === null) return false\n return true\n }", "title": "" }, { "docid": "296d784bb39a901a04e90b96d09d0194", "score": "0.52596295", "text": "onLog() {}", "title": "" }, { "docid": "e7ecc46ae0f19f3f60ca4517c832a476", "score": "0.52592146", "text": "isAuth() {\n this.authHttpRequest(this._user.sessionToken).subscribe(result => {\n if (result.status[0] >= 200 && result.status[0] < 400) {\n this.loggedIn = true;\n }\n else {\n this.loggedIn = false;\n }\n }).unsubscribe();\n return this.loggedIn.valueOf();\n }", "title": "" }, { "docid": "7ef0850e195332c6466528660baa793c", "score": "0.5247051", "text": "function notLoggedInCheck()\n{\n //Instantiate access token\n var token = sessionStorage.getItem('token');\n\n //check if the access token is empty\n if(!token)\n {\n //redirect to the login page\n window.location = '../../login';\n }\n\n if(payloadClaim(token, \"user_role\") == \"Bursar\")\n {\n $('.cashier').remove();\n $('.bursar').slideDown();\n }\n\n if(payloadClaim(token, \"user_role\") == \"Cashier\")\n {\n $('.bursar').remove();\n $('.cashier').slideDown();\n }\n}", "title": "" }, { "docid": "ad32386e5485e70494eaa9af63de42a5", "score": "0.5238555", "text": "function isLogin(session) {\r\n return session.isLogin == true;\r\n}", "title": "" }, { "docid": "4902fd72c445974f7aef9dbf1083c2e6", "score": "0.5233288", "text": "function userLogedIn() {\n showLogOut();\n}", "title": "" }, { "docid": "349aa6a8a2f4ca0cdf2185119402a65d", "score": "0.5227888", "text": "function checkUserLogin(){\n}", "title": "" }, { "docid": "825891264f5a2168fedf39ebb102e5af", "score": "0.5207758", "text": "function is_logged(){\n var token = localStorage.getItem('token');\n if(token == null){\n $('#register-form').removeClass('hidden');\n $('#login-form').removeClass('hidden');\n $('#logout').addClass('hidden'); \n return false;\n }\n return true;\n }", "title": "" }, { "docid": "3cd493f6324bec3dff6bcf358299ed38", "score": "0.52040976", "text": "isLogged () {\n const memberToken = localStorage.getItem('memberToken')\n\n if (memberToken) {\n // eslint-disable-next-line\n return Api.get(url + 'is_logged' + '?memberToken=' + memberToken)\n .then(res => {\n return {\n member: res.data.member,\n isLogged: true\n }\n })\n .catch(err => {\n localStorage.removeItem('memberToken')\n return { isLogged: false }\n })\n } else {\n return { isLogged: false }\n }\n }", "title": "" }, { "docid": "390b620b12a849cdd60503108f3a75ac", "score": "0.5200425", "text": "function displayLiffData() {\n document.getElementById('isInClient').textContent = liff.isInClient();\n document.getElementById('isLoggedIn').textContent = liff.isLoggedIn();\n console.log(\"1 displayLiffData\" + liff.isLoggedIn());\n console.log(\"2 displayLiffData\" + liff.isInClient());\n console.log(\"displayLiffData\");\n}", "title": "" }, { "docid": "ec4e41a5bd6a2f4bd18a53bf9dc86463", "score": "0.51956266", "text": "function loggedIn() {\n return (accessToken != null && refreshToken != null);\n}", "title": "" }, { "docid": "59894eb2864d434cea43e6811c0ce32c", "score": "0.51899624", "text": "function CheckValidLogout(enteredUsername){\r\n for(let x of users){\r\n if((enteredUsername==x.username) && (x.isonline == true)){\r\n let currentuser=get_user(enteredUsername)\r\n currentuser.isonline = false;\r\n return 1;\r\n }\r\n }\r\n return 0;\r\n}", "title": "" }, { "docid": "a4007ac50c95af54f494ea5c11c902a2", "score": "0.5182217", "text": "function checkForLogin(){\n if (getCookie(\"email\") == null){\n computeLogout();\n }\n else {\n computeLogin();\n }\n}", "title": "" }, { "docid": "d03e66c81fa8372bcfc2cd3a74e22556", "score": "0.5181889", "text": "function ifProtected(state){\n\tvar whiteList = ['landing', 'signup', 'login'];\n\treturn whiteList.indexOf(state) === -1;\n}", "title": "" }, { "docid": "8f68b89b64fdbc20dd07eeb0b0d421c8", "score": "0.5174706", "text": "isLoggedIn() {\n return this.Auth.getAuthData();\n }", "title": "" }, { "docid": "7add5c12e6b338627058a4fb4eff4e76", "score": "0.5173816", "text": "isUserLoggedIn() {\n let user = sessionStorage.getItem(USER_NAME_SESSION_ATTRIBUTE_NAME)\n if (user === null) return false\n return true\n }", "title": "" }, { "docid": "bb8f41799fecc78077a91b411494f204", "score": "0.51654804", "text": "function checkControlStatus(){\n\tvar loggedIn = user.isLoggedIn();\n\twindowHook = loggedIn;\n\ttray.toggleTray(loggedIn);\n}", "title": "" }, { "docid": "6007a0ef5a811f0339fb61f73be29646", "score": "0.5155206", "text": "function shouldLogin(state) {\n const user = state.user;\n if (!user) {\n return true;\n }\n if (user.isFetching) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "d30f15585ce80b0fe61b8e71a6afeeb5", "score": "0.5151487", "text": "function checkIfLogEnabled(event) {\n return !(event.description && event.description.match(/[Nn][Oo]_[Jj][Ii][Rr][Aa]_[Ll][Oo][Gg]/)) && !event.summary.match(/[Nn][Oo]_[Jj][Ii][Rr][Aa]_[Ll][Oo][Gg]/);\n }", "title": "" }, { "docid": "006030672b37bb49c06dad2f19548eb3", "score": "0.5142904", "text": "function checkLoginState() {\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n //console.log(response.authResponse.userID); //GETS USER ID, USE THIS TO IDENTIFY USERS OF TIMEMAP\n });\n}", "title": "" }, { "docid": "7627b2636103455cbbbcba8871869469", "score": "0.5142136", "text": "function handleLoginStatus() {\n\tconsole.log(tempStorage.getItem('loginFlag'));\n\tif (tempStorage.getItem('loginFlag') == 'TRUE' && tempStorage.getItem('username') != '') {\n\t\tconsole.log('already logged in, redirecting...');\n\t\tredirectUserPage();\n\t} else {\n\t\tconsole.log('rendering login details');\n\t\trenderLoginDetails();\n\t}\n}", "title": "" }, { "docid": "0a1df3c5b710661055009854772e2494", "score": "0.51416785", "text": "function isClienteLogado(){\n \n var keypass = ClienteAuthStore.getKeypass(); \n\n if (keypass != null && keypass != 'undefined' && keypass != '') {\n $rootScope.SESSION_CLI_ON = true;\n $rootScope.SESSION_CLI = ClienteAuthStore.get();\n\n return true;\n } else {\n\n $rootScope.SESSION_CLI_ON = false;\n\n return false;\n }\n\n return false;\n }", "title": "" }, { "docid": "fd9b62b7f1bc5dc6600bbd0ec0d682be", "score": "0.51280564", "text": "isSignedIn() {\n return !!this._authData.accountId;\n }", "title": "" }, { "docid": "0c700c89b63328071553abb256fa3d4e", "score": "0.5127508", "text": "function isLoggedIn()\n\t\t{\n\t\t\t// get the cookie\n\t\t\tvar l_cookie_value = MetaWrap.Cookie.Get(g_cookie_name);\n\n\t\t\t// empty cookie is the same as no cookie.\n\t\t\tif (l_cookie_value == \"\")\n\t\t\t{\n\t\t\t\tl_cookie_value = null;\n\t\t\t}\n\n\t\t\t// no cookie, no love\n\t\t\treturn (l_cookie_value != null);\n\t\t}", "title": "" }, { "docid": "c9ead8ea3bd9a09289655ea7c9495ca9", "score": "0.51240724", "text": "function loggedIn() {\n return md.loggedIn;\n }", "title": "" }, { "docid": "060abb875145d0c096a272d2fbb91e91", "score": "0.51230276", "text": "function checkAuth() {\n $scope.AuthData = Auth.AuthData;\n if(!$scope.AuthData.hasOwnProperty('uid')){\n Auth.getAuthState().then(\n function(AuthData){\n console.log(\"is this user ID? \" + AuthData);\n $scope.AuthData = AuthData;\n \n handleLoggedIn();\n },\n function(notLoggedIn){\n handleLoggedOut();\n }\n )\n } else {\n handleLoggedIn();\n \n };\n }", "title": "" }, { "docid": "5339a9ef691e35440481cae07f8e2fad", "score": "0.511168", "text": "loggedIn() {\n return !!localStorage.token;\n }", "title": "" }, { "docid": "f951e6440917a2a8c9facc1bd9b0370c", "score": "0.5110249", "text": "async function checkIfUserIsLoggedIn() {\n try {\n const user = await AsyncStorage.getItem('user')\n if(!user) return 0\n return 1\n } catch (error) {\n return 0\n }\n}", "title": "" }, { "docid": "a9feda33f830851dd2ef1bb0b5fc1f07", "score": "0.51050854", "text": "async isLogin(context) {\n return await userService.isLogin(context)\n }", "title": "" }, { "docid": "0b56a67d6f747315c270e57c8a714c91", "score": "0.51036584", "text": "isLoggedIn() {\n return localStorage.getItem(\"user\") != null;\n }", "title": "" }, { "docid": "0b56a67d6f747315c270e57c8a714c91", "score": "0.51036584", "text": "isLoggedIn() {\n return localStorage.getItem(\"user\") != null;\n }", "title": "" }, { "docid": "d969a9132d317cc6ae406b38e70747a8", "score": "0.51001054", "text": "function userIsLoggedIn(){\n if (readCookie('masterid')){ return true }\n}", "title": "" }, { "docid": "6dbcaa6129ee629804df628700bc91ab", "score": "0.50886136", "text": "get logged() \n {\n return this.store.getItem('token') !== null;\n }", "title": "" }, { "docid": "8d995fc757de3498944d4d5807a95ff4", "score": "0.50874203", "text": "isLoggedIn() {\n return this.csrfToken !== null;\n }", "title": "" }, { "docid": "e1843c113ded0bb3f952bb051439fced", "score": "0.50867945", "text": "get isLoggedIn() {\n const user = JSON.parse(sessionStorage.getItem('currentUser'));\n return (user !== null && user.emailVerified !== false) ? true : false;\n }", "title": "" }, { "docid": "60524d7d62132a2c849ec90192e3c2f0", "score": "0.5083674", "text": "function isLoggedIn(callback){\n var isLogReq, isLogRes;\n var isLogResJson;\n if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari\n isLogReq = new XMLHttpRequest();\n }\n else {// code for IE6, IE5\n isLogReq = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n isLogReq.onreadystatechange = function () {\n if (isLogReq.readyState == 4 && isLogReq.status == 200) {\n isLogRes=isLogReq.response;\n isLogResJson = JSON && JSON.parse(isLogRes) || $.parseJSON(isLogRes);\n\n if(isLogResJson.result == \"success\"){\n callback(true);\n } else {\n callback(false);\n }\n }\n }\n isLogReq.open('POST','/IsLoggedIn.action',true);\n isLogReq.send();\n return false;\n}", "title": "" }, { "docid": "ba5ebe0158f59d35a97838371f410520", "score": "0.5076507", "text": "isAuth(state) {\n return !!state.user\n }", "title": "" }, { "docid": "0aa8ca8a8d769aa8ff5643ffa3ba2cbb", "score": "0.507258", "text": "function checkLoggedIn(){\n\t\t\tisLoggedInService.isLoggedIn().then(checkIsLoggedInSuccess, checkIsLoggedInFailed);\n \t\t\tfunction checkIsLoggedInSuccess(response) {\n if (response.isLoggedIn === true) {\n self.isLoggedIn = true;\n } else {\n forceLogInModalService.openForceLogInModal();\n }\n \t\t\t}\n \t\t\tfunction checkIsLoggedInFailed(errResponse) {\n console.error('Fail to check if the user is logged in or not.');\n }\n\t\t}", "title": "" }, { "docid": "08f4adc4930f00c1fe107bdfd6297b6b", "score": "0.5072343", "text": "function handleLogin(outcome) {\n setUserLogged(outcome);\n console.log(`the outcome of the signin was ${outcome}`);\n }", "title": "" }, { "docid": "bb33422c05e4e5f8a9c81fb5242176cd", "score": "0.50721115", "text": "function checkSession() {\n if (desktop.outCount > 64) {\n m_gameStatus = gameStatus.nohu;\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "8ede95b13914ab770d2248857e2222a0", "score": "0.5070789", "text": "function tryToLog() {\n\tvar userN = $('#Login').find('input[name=\"UserNameLog\"]').val();\n\tvar userP = $('#Login').find('input[name=\"PasswordLog\"]').val();\n\tif (userN == \"\" || userP == \"\" || userN == null || userP == null) {\n\t\talert(\"please fill the missing fileds\");\n\t\t$('#Login').find('input[name=\"UserNameLog\"]').val(\"\");\n\t\t$('#Login').find('input[name=\"PasswordLog\"]').val(\"\");\n\t\treturn false;\n\t} else {\n\t\tfor (var i = 0; i < List.length; i++) {\n\t\t\tif (List[i].userName == userN && List[i].password == userP) {\n\t\t\t\t$('#gameDetails').find('output[name=\"displayUserName\"]').val(userN);\n\t\t\t\tshowPreferences();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\talert(\"please enter correct User-name/Password\");\n\t\t$('#Login').find('input[name=\"UserNameLog\"]').val(\"\");\n\t\t$('#Login').find('input[name=\"PasswordLog\"]').val(\"\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "108c62881b5eb9bda1eb4b91b5389213", "score": "0.50692236", "text": "function check_if_logged() {\n ajax_req(php_redir, \"\", check_succ, check_err);\n}", "title": "" }, { "docid": "dee6e7cfd2524b3ddb30150c7df8f698", "score": "0.5068783", "text": "isLoggedIn() {\n return localStorage.getItem('user') != null\n }", "title": "" }, { "docid": "dee6e7cfd2524b3ddb30150c7df8f698", "score": "0.5068783", "text": "isLoggedIn() {\n return localStorage.getItem('user') != null\n }", "title": "" }, { "docid": "2da09266e16be4b7b05aa4d1bc08f295", "score": "0.5068243", "text": "async checkIfUserIsLogged() {\n const createProductBtn = document.querySelector('.create-product-btn');\n try {\n this.publish(this.events.START_LOADING);\n const userIsLogged = await dataService.isUserLogged();\n if (userIsLogged) {\n createProductBtn.classList.remove('hidden');\n this.myAccountButtons(userIsLogged);\n } else {\n this.myAccountButtons(userIsLogged);\n }\n } catch (error) {\n this.publish(this.events.ERROR, error);\n } finally {\n this.publish(this.events.FINISH_LOADING);\n }\n }", "title": "" }, { "docid": "867c596f78886e8dad0102b421de0883", "score": "0.50533134", "text": "getLoggedInStatus() {\n return (this.props.isUserLoggedIn || isUserLoggedIn);\n }", "title": "" }, { "docid": "f9732a99bdebc4c657fcaed9fc64bd6e", "score": "0.5052999", "text": "function checkAuth() {\n if (!authed) {\n let authWindow = new BrowserWindow({\n width: 800,\n height: 600,\n webPreferences: {\n nodeIntegration: true\n },\n autoHideMenuBar: true,\n titleBarStyle: \"hiddenInset\"\n });\n\n authWindow.loadURL('http://kb.wisc.edu/housing/internal/');\n console.log(\"\\nLog in with NetID to access KB\");\n\n // Check if kb page loaded after login\n authWindow.webContents.on('page-title-updated', function () {\n if (authed == false && (authWindow.getURL() == \"https://kb.wisc.edu/housing/internal/\")) {\n console.log(\"KB access authorized\");\n authed = true;\n authWindow.close();\n flow.emit('authed');\n }\n });\n } else {\n flow.emit('authed');\n }\n }", "title": "" } ]
48964ae9db9bf51a95c34cda9ed8a228
Wait for all DOM nodes to load...
[ { "docid": "91a3aa85ad7621989e914f1f098133d9", "score": "0.0", "text": "function main() {\n\n // Nothing is really done here in this function, except the calling of the \n // 'returnFirstEvenNumber' function to do the heavy lifting (ugh, heavy lifting!!)\n \n returnFirstEvenNumber();\n\n}", "title": "" } ]
[ { "docid": "770c86348b87284019a57807f08afcee", "score": "0.708468", "text": "ensureReadyForElements() {}", "title": "" }, { "docid": "a1f04cf02fd93a8959d73ead6d91f990", "score": "0.666275", "text": "function windowLoadHandler() {\n\tvar allNodes = document.body.childNodes;\n\tfor (var i=0; i<allNodes.length; i++){\n\t\tvar n = allNodes[i];\n\t\ttraverse( n );\n\t}\n}", "title": "" }, { "docid": "dfe17cc98c040de36eff77455eec1e62", "score": "0.64890265", "text": "function forceLoadAll() {\n checkLazyElements(true);\n }", "title": "" }, { "docid": "dfe17cc98c040de36eff77455eec1e62", "score": "0.64890265", "text": "function forceLoadAll() {\n checkLazyElements(true);\n }", "title": "" }, { "docid": "1a2b603d85824a5be070f8eec6674a04", "score": "0.64713496", "text": "function forceLoadAll() {\n\t checkLazyElements(true);\n\t }", "title": "" }, { "docid": "9944d7304e67b545b9825ab4bb5c2615", "score": "0.6455806", "text": "function dom_loaded_handler() {\n // function flag since we only want to execute this once\n if (dom_loaded_handler.done) { return; }\n dom_loaded_handler.done = true;\n\n DOM_LOADED = true;\n ENQUEUE_REQUESTS = false;\n\n _.each(instances, function(inst) {\n inst._dom_loaded();\n });\n }", "title": "" }, { "docid": "9944d7304e67b545b9825ab4bb5c2615", "score": "0.6455806", "text": "function dom_loaded_handler() {\n // function flag since we only want to execute this once\n if (dom_loaded_handler.done) { return; }\n dom_loaded_handler.done = true;\n\n DOM_LOADED = true;\n ENQUEUE_REQUESTS = false;\n\n _.each(instances, function(inst) {\n inst._dom_loaded();\n });\n }", "title": "" }, { "docid": "9944d7304e67b545b9825ab4bb5c2615", "score": "0.6455806", "text": "function dom_loaded_handler() {\n // function flag since we only want to execute this once\n if (dom_loaded_handler.done) { return; }\n dom_loaded_handler.done = true;\n\n DOM_LOADED = true;\n ENQUEUE_REQUESTS = false;\n\n _.each(instances, function(inst) {\n inst._dom_loaded();\n });\n }", "title": "" }, { "docid": "a25169c88e301be6eb235208d68348fc", "score": "0.6454438", "text": "function fullyLoaded() {\n return new Promise((resolve, reject) => {\n addEventListener('load', () => setTimeout(resolve, 2000))\n });\n}", "title": "" }, { "docid": "9e0c1018ddf4af6dce8f394ad35dc63d", "score": "0.6373955", "text": "function waitTillCssLoaded()\n {\n var styleSheets = document.styleSheets;\n var numStyleSheets = styleSheets.length;\n\n // Don't bother checking if the count has not changed from the last poll\n if (cssLastCheckSheetCount == numStyleSheets)\n {\n return;\n }\n cssLastCheckSheetCount = numStyleSheets;\n // Loop through all the nodes that we are still waiting to finish loading\n for (var i = 0; i < loadingCssLinks.length; ++i)\n {\n var obj = loadingCssLinks[i];\n var nonLoadedNode = obj[\"node\"];\n\n for (var j = 0; j < numStyleSheets; ++j)\n {\n var linkNode = styleSheets[j].ownerNode;\n // See if this style sheet is for the node we are waiting to be loaded.\n if (nonLoadedNode == linkNode)\n {\n // When the style sheet appears in the styleSheets collection,\n // it has finished loading\n var dfd = obj[\"deferred\"];\n dfd.resolve(linkNode);\n\n // Remove the item from the array\n loadingCssLinks.splice(i--, 1);\n // TODO this either needs to be removed or needs to be promoted to a formal debug message; do not use amx.log\n amx.log.debug(\"CSS resource loaded: \" + obj[\"path\"]);\n\n if (loadingCssLinks.length == 0)\n {\n // We are not waiting on any more nodes\n window.clearInterval(cssLoadingCheckInterval);\n cssLoadingCheckInterval = null;\n return;\n }\n\n break;\n }\n }\n }\n\n var timeWaiting = new Date().getMilliseconds() - cssLoadingWaitStarted;\n // Since the code is not notified of CSS files that failed to load, only way for a maximum\n // of 5 seconds for all CSS files to load and then throw an error\n if (timeWaiting >= 5000)\n {\n for (var index = 0, size = loadingCssLinks.length; i < size; ++i)\n {\n var obj = loadingCssLinks[index];\n // Notify the listener that the resource failed to load\n obj[\"deferred\"].reject();\n adf.mf.log.logInfoResource(\"AMXInfoBundle\", adf.mf.log.level.SEVERE,\n \"amx.includeCss\",\n \"MSG_FAILED_TO_LOAD\", obj[\"path\"]);\n }\n loadingCssLinks = [];\n window.clearInterval(cssLoadingCheckInterval);\n cssLoadingCheckInterval = null;\n }\n }", "title": "" }, { "docid": "a12b2c984cfc8d6e45a27be7f969f679", "score": "0.6354497", "text": "function waitForFullLoad() {\n\tsetTimeout(function() {\n\t\ttry {\n\t\t\t// getting frames using their names does not work anymore??? it just randomly stopped working\n\t\t\t// tocFrame = window.frames.HelpFrame.frames.NavFrame.frames.ViewsFrame.frames.toc.frames.tocViewFrame;\n\t\t\ttocFrame = window.frames[2].frames[0].frames[0].frames[0].frames[1];\n\t\t\t\n\t\t\tregisterMutationListener()\n\t\t} catch (e) { // something in the chain does not exist yet\n\t\t\t//ignore errors and try again next time\n\t\t\twaitForFullLoad()\n\t\t}\n\t}, 1000)\n}", "title": "" }, { "docid": "900bbc93015b73efe7d27c74c1c357f2", "score": "0.6352824", "text": "function startEvents() {\n // here we can put any function we want to be executed only when all of the page elements will downloaded.\n}", "title": "" }, { "docid": "0c028f2ee5d86a0c3b2f5f5e6ce5a8bb", "score": "0.6342091", "text": "function wait() {\n\tif (UID === null) {\n\t\tsetTimeout(function() {\n\t\t\twait();\n\t\t}, 500);\n\t} else {\n\t\tloadPage();\n\t}\n}", "title": "" }, { "docid": "ab975685735ca038428b684ac310ec32", "score": "0.6337772", "text": "function waitsElement(e, op) {\n var isLoaded = function (rs) { return rs == 'complete'; };\n if (e === document.body) {\n if (isLoaded(document.readyState))\n return op();\n else\n document.addEventListener('DOMContentLoaded', op);\n }\n else {\n e.addEventListener('load', op);\n }\n }", "title": "" }, { "docid": "b17225c39d3887eb05219a426142c2ab", "score": "0.63210297", "text": "async function domIsReady () {\n // already loaded\n if (['interactive', 'complete'].includes(document.readyState)) {\n return\n }\n // wait for load\n await new Promise(resolve => window.addEventListener('DOMContentLoaded', resolve, { once: true }))\n}", "title": "" }, { "docid": "f23899c92fba2e093b89ad825998b9f4", "score": "0.6300316", "text": "function domReady() {\r\n // Make sure body exists, at least, in case IE gets a little overzealous (jQuery ticket #5443).\r\n if (!doc.body) {\r\n // let's not get nasty by setting a timeout too small.. (loop mania guaranteed if assets are queued)\r\n win.clearTimeout(api.readyTimeout);\r\n api.readyTimeout = win.setTimeout(domReady, 50);\r\n return;\r\n }\r\n\r\n if (!isDomReady) {\r\n isDomReady = true;\r\n each(domWaiters, function (fn) {\r\n one(fn);\r\n });\r\n }\r\n }", "title": "" }, { "docid": "0ca1ecdbccde45acb11d278136e160f0", "score": "0.628185", "text": "_waitForBody(){\n\t\treturn new Promise(resolve => {\n\t\t\tif(document.body) resolve();\n\t\t\telse{\n\t\t\t\tlet observer = new MutationObserver(function() {\n\t\t\t\t\tif (document.body) {\n\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tobserver.observe(document.documentElement, {childList: true});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "51b8ffdfb0293162bc481e797e1c719c", "score": "0.62681824", "text": "loadAll() \n {\n //------------------------------------------------------------------------------\n // Safety Check\n if (!this.isReady()) {\n return false;\n } \n //------------------------------------------------------------------------------\n // Detect All Waiting Widgets\n var collection = $(\".splash-widget-loader\");\n if(!collection.length) {\n return;\n }\n //------------------------------------------------------------------------------\n // Walk on All Waiting Widgets\n collection.each(function(){\n $.SplashWidgets.widgets.load(this);\n });\n }", "title": "" }, { "docid": "299e288785c1d2453dd7c84cf5c08e22", "score": "0.6263494", "text": "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if (!doc.body) {\n return setTimeout(domReady, 1);\n }\n // Remember that the DOM is ready\n isReady = true;\n // If there are functions bound, to execute\n domReadyCallback();\n // Execute all of them\n }\n} // /ready()", "title": "" }, { "docid": "afbd7205b544ada8503d6932eee682d9", "score": "0.62157345", "text": "async function waitForElements() {\n while(searchProvider.getResultElements().length === 0) {\n await new Promise(r => setTimeout(r, 500));\n }\n return searchProvider.getResultElements();\n}", "title": "" }, { "docid": "be57714367f2632a89e7629327a1abc0", "score": "0.62034637", "text": "function wait() {\r\n\tif (UID === null) {\r\n\t\tsetTimeout(function() {\r\n\t\t\twait();\r\n\t\t}, 500);\r\n\t} else {\r\n\t\tloadPage();\r\n\t}\r\n}", "title": "" }, { "docid": "dbc7e607799fac0ca3acdc10b7def1dc", "score": "0.6198535", "text": "function checkLoad(callback, itemNode, name) { // itemNode passed in for debugging\n if (!validPointer(itemNode)) {\n return;\n }\n\n var len = itemNode.childElementCount;\n if (window.onLoad || itemNode.childElementCount > 1) {\n // Page has loaded, call the callback, which either equips or unequips.\n var children = itemNode.childElementCount;\n console.log('Get Naked finished loading the \"' + name +'\" node, has ' + children + ' children.');\n callback(name);\n } else {\n setTimeout(function() {\n checkLoad(callback, itemNode, name);\n }, 1000);\n }\n }", "title": "" }, { "docid": "c4e9ee5466adc5f484f4d20d2734a0ec", "score": "0.6173574", "text": "function scripts_waitForResourceCallback() {\n\tvar selector = arguments[0];\n\tvar cb = arguments[arguments.length - 1];\n\n\tvar state = document.readyState;\n\tvar start = Date.now();\n\tvar TIMEOUT = 10000;\n\n\tfunction poll() {\n\t\tvar el = document.querySelector(selector);\n\t\tif (el == null) {\n\t\t\tlet ms = Date.now() - start;\n\t\t\tif (ms > TIMEOUT) {\n\t\t\t\tcb({ error: new Error(`Resource wait timeout: ${selector} in ${TIMEOUT}ms`) });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetTimeout(poll, 150);\n\t\t\treturn;\n\t\t}\n\t\twaitResource(el);\n\t}\n\tfunction waitResource(el) {\n\t\tif (el.completed === true) {\n\t\t\tcb({ element: el });\n\t\t\treturn;\n\t\t}\n\n\t\tif (el.tagName === 'SCRIPT') {\n\t\t\tel.async = false;\n\t\t\tel.defer = false;\n\t\t\tsetTimeout(function () {\n\t\t\t\tcb({ element: el });\n\t\t\t}, 50);\n\t\t\treturn;\n\t\t}\n\n\t\tel.addEventListener('load', function () {\n\t\t\tcb({ element: el });\n\t\t\treturn;\n\t\t});\n\t\tel.addEventListener('error', function () {\n\t\t\tcb({ element: el });\n\t\t\treturn;\n\t\t});\n\t}\n\n\tpoll();\n}", "title": "" }, { "docid": "c0281d18f5e179102c4d725c4ba8fd9c", "score": "0.61733294", "text": "function loadElements() {\n domCs = $('#cs');\n domCh = $('#ch');\n domAh = $('#ah');\n domDrift = $('#drift');\n domRh = $('#rh');\n domMsg = $('#abortedmsg');\n domAborted = $('#aborted');\n domGps = $('#gpsh');\n domLeft = $(\".left_alt\");\n domWorning = $(\"#worning\");\n}", "title": "" }, { "docid": "8a9197a04cc2bb38c082da71fc45d6b0", "score": "0.61730254", "text": "waitForPageToLoad() {\n this.welcomePageUnderConstructTitle.waitForElementToRender();\n this.welcomePageTitle.waitForElementToRender();\n this.welcomePageCarousel.waitForElementToRender();\n }", "title": "" }, { "docid": "30fbe0059a128e04c995375105bc0a4a", "score": "0.61699116", "text": "function verifyDomLoad() {\n\t if (flagDomLoaded) { return; }\n\t try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early\n\t var t = doc.getElementsByTagName(\"body\")[0].appendChild(doc.createElement(\"span\"));\n\t \n\t t.parentNode.removeChild(t);\n\t }\n\t catch (e) { return; }\n\t flagDomLoaded = true;\n\t var dl = domLoadFunctions.length;\n\t for (var i = 0; i < dl; i++) {\n\t domLoadFunctions[i]();\n\t }\n\t}", "title": "" }, { "docid": "b5f0d20a3e34f47a0a97d1104dd23f75", "score": "0.6148039", "text": "function theDomHasLoaded(e) {\n\n}", "title": "" }, { "docid": "6ee4b2702d9f2ef0c884faaeb660dff1", "score": "0.6143071", "text": "function domReady() {\n\t\t// Make sure that the DOM is not already loaded\n\t\tif(!isReady) {\n\t\t\t// Remember that the DOM is ready\n\t\t\tisReady = true;\n \n\t if(readyList) {\n\t for(var fn = 0; fn < readyList.length; fn++) {\n\t readyList[fn].call(window, []);\n\t }\n \n\t readyList = [];\n\t }\n\t\t}\n\t}", "title": "" }, { "docid": "b6c3f60ec93d6698394a54c497874ba8", "score": "0.6095959", "text": "function fireReady() {\n if (!isDomReady) {\n isDomReady = true;\n each(domWaiters, function(fn) {\n one(fn);\n });\n }\n }", "title": "" }, { "docid": "b784ab30d6d14c9bc51090660bd713cf", "score": "0.60852236", "text": "function waitLoaded() {\n if (wait == 10) {\n return;\n }\n if (isLoaded) {\n window.setTimeout(injectTabs, 5);\n return;\n }\n wait++;\n window.setTimeout(waitLoaded, 300);\n}", "title": "" }, { "docid": "fdb9a54e5db35d7e9de13c2622a7b214", "score": "0.6061492", "text": "function waitDataLoaded(){\n waitsFor(function(){\n return !loadingData && (findColCheckboxes().length > 0);\n }, \"The page should be rendered.\", 500);\n }", "title": "" }, { "docid": "d2915d410770a738dd85b98d312ab72f", "score": "0.60445935", "text": "function onElemLoad(selector, callback) {\r\n if (document.querySelector(selector)) callback();\r\n else setTimeout(() => { onElemLoad(selector, callback) }, 100);\r\n }", "title": "" }, { "docid": "0fd416466309ac5d96a1b069bfd71e42", "score": "0.6039521", "text": "function initiateAllWaitingAceElements() {\n var i;\n var len;\n\n i = 0;\n len = arrAceLoadCallbacks.length;\n while (i < len) {\n arrAceLoadCallbacks[i]();\n i += 1;\n }\n }", "title": "" }, { "docid": "4d802a932ee36eb4a632e2820afd7278", "score": "0.6020039", "text": "function waitForWebKitLinkLoaded() {\n\t\t\t\twait(function() {\n\t\t\t\t\tvar styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner;\n\n\t\t\t\t\twhile (i--) {\n\t\t\t\t\t\tstyleSheet = styleSheets[i];\n\t\t\t\t\t\towner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;\n\t\t\t\t\t\tif (owner && owner.id === link.id) {\n\t\t\t\t\t\t\tpassed();\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, waitForWebKitLinkLoaded);\n\t\t\t}", "title": "" }, { "docid": "d789230230cb4f01904d90b26e035c9c", "score": "0.60000867", "text": "function onDomLoaded() {\n\t\tsimpli5.dispatch('domready');\n\t\tsimpli5.mold(document.body);\n\t\tsimpli5.dispatch('molded');\n\t\tsimpli5.checkLoading();\n\t}", "title": "" }, { "docid": "216073744e742e9cf787730baf955653", "score": "0.597452", "text": "function readyStateChange() {\n var pendingScript;\n while (pendingScripts[0] && pendingScripts[0].readyState === 'loaded') {\n pendingScript = pendingScripts.shift();\n pendingScript.onreadystatechange = null;\n // using appendChild() fails in some cases in old IE, so use insertBefore() instead\n lastScript.parentNode.insertBefore(pendingScript, lastScript);\n incrementLoadCount();\n }\n }", "title": "" }, { "docid": "24312e1345456b4bddc3231bdf87b89c", "score": "0.5969109", "text": "function waitLoad(){\n if (false&&!__.state.isViewLoaded()) {\n setTimeout(waitLoad,500);\n return;\n }\n next();\n __.INITIALIZED=true;\n delete __.INITIALIZING;\n console.log('__.inits._init_() completed');\n //$('body').css('opacity','1');\n $('body').addClass('fadein');\n 'onLoad'._bc&&'onLoad'._bc();\n }", "title": "" }, { "docid": "b35af48dfbe521d8cd3c2a32c953bb89", "score": "0.59665775", "text": "function waitForAddedNode(params) \n\t{\n\t\tnew MutationObserver(function(mutations) \n\t\t{\n\t\t\tvar el = document.getElementById(params.id);\n\t\t\tif (el) \n\t\t\t{\n\t\t\t\tthis.disconnect();\n\t\t\t\tpopUpMenu();\n\t\t\t\tparams.done(el);\n\t\t\t}\n\t\t}).observe(params.parent || document, {\n\t\t\tsubtree: !!params.recursive,\n\t\t\tchildList: true,\n\t\t});\n\t}", "title": "" }, { "docid": "11a1a6abc6f3e3fa2e297ca7295a95cd", "score": "0.59450656", "text": "function onload() {\n return new Promise(function(resolve) {\n if (document.readyState === 'complete') { return resolve(); }\n request.addEventListener('load', resolve);\n });\n}", "title": "" }, { "docid": "b01be18b993542cd510f24e0cecd0665", "score": "0.58866334", "text": "function waitForFinishLoading() {\n // _debug('exec waitForFinishLoading');\n if (document.querySelector('.flickr-dots')) {\n // still waiting ...\n } else {\n window.clearInterval(watcher_laoding);\n addUrlCopyIconOnStreamPage(); // add copy icons to re-loaded images\n watcher_dots = window.setInterval(checkFlickrIsLoading, 500);\n }\n }", "title": "" }, { "docid": "6d701b6bb7a042e0bb4b3f1bde233cdb", "score": "0.58629894", "text": "function checkPreviewHtmlLoaded(elements) {\n let haveElements = Array.isArray(elements) && elements.length === 1;\n if (haveElements) {\n haveElements = elements[0].styles.display.includes('block');\n }\n if (!haveElements || elements[0].attributes.loaded !== '') {\n return pending(caller, `Waiting for ${previewTag} to load.`);\n }\n return;\n }", "title": "" }, { "docid": "6d701b6bb7a042e0bb4b3f1bde233cdb", "score": "0.58629894", "text": "function checkPreviewHtmlLoaded(elements) {\n let haveElements = Array.isArray(elements) && elements.length === 1;\n if (haveElements) {\n haveElements = elements[0].styles.display.includes('block');\n }\n if (!haveElements || elements[0].attributes.loaded !== '') {\n return pending(caller, `Waiting for ${previewTag} to load.`);\n }\n return;\n }", "title": "" }, { "docid": "4191b97cc987cf039475212a2ffe307e", "score": "0.58558464", "text": "get isDocumentLoaded() { return document.readyState == \"complete\"; }", "title": "" }, { "docid": "5608e8306d2d2735e41c9ed22f06ce57", "score": "0.58498436", "text": "function waitForWebKitLinkLoaded() {\n wait(function () {\n var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner;\n\n while (i--) {\n styleSheet = styleSheets[i];\n owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;\n if (owner && owner.id === link.id) {\n passed();\n return true;\n }\n }\n }, waitForWebKitLinkLoaded);\n }", "title": "" }, { "docid": "70d8d31ddf0b1cb8b0a5f781233f935d", "score": "0.584085", "text": "function ready(fn) {\n\t\t\t\t\t\tif (!isReady) {\n\n\t\t\t\t\t\t\t// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n\t\t\t\t\t\t\tif (!doc.body) {\n\t\t\t\t\t\t\t\treturn defer(ready);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Remember that the DOM is ready\n\t\t\t\t\t\t\tisReady = true;\n\n\t\t\t\t\t\t\t// Execute all callbacks\n\t\t\t\t\t\t\twhile (fn = callbacks.shift()) {\n\t\t\t\t\t\t\t\tdefer(fn);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "title": "" }, { "docid": "eacf38e496932777bf950f6b1a0ee0b2", "score": "0.58363384", "text": "function waitUntilFinishedLoading(){\n // Get the data\n $scope.countries = dataManager.getAllCountries();\n // Check if its there\n if ($scope.countries.length != 0){\n // Activate the slider when jquery has loaded\n defer(createWaveSlider);\n // Then we filter the countries to display\n filterCountriesByWave();\n }\n else{\n // Recusivly call this function until we have the correct data\n setTimeout(function() { waitUntilFinishedLoading() }, 50);\n }\n }", "title": "" }, { "docid": "ee76e0efe443839d89912cd43bcb1b1a", "score": "0.5832076", "text": "function xmlwait() {\n\n $.when.apply($, $.map(graph_data.week_XML, function (d) {\n var wrapDeferred = $.Deferred();\n d.always(function () {\n wrapDeferred.resolve();\n });\n return wrapDeferred.promise();\n })).done(function () {\n $('#progresstext').html(\"Parsing XML...\");\n $(\"#graph_loading\").css(\"width\", \"5%\");\n setTimeout(parseXML, 500);\n });\n}", "title": "" }, { "docid": "aeed3c039ec1aeb5cc3a44d5f1806f81", "score": "0.5785639", "text": "waitForDOMReady() {\n if (!this.$ || this.$.isReady) {\n (0, _runloop.schedule)('actions', this, 'domReady');\n } else {\n this.$().ready((0, _runloop.bind)(this, 'domReady'));\n }\n }", "title": "" }, { "docid": "aeed3c039ec1aeb5cc3a44d5f1806f81", "score": "0.5785639", "text": "waitForDOMReady() {\n if (!this.$ || this.$.isReady) {\n (0, _runloop.schedule)('actions', this, 'domReady');\n } else {\n this.$().ready((0, _runloop.bind)(this, 'domReady'));\n }\n }", "title": "" }, { "docid": "7eba7823ea6173e09e58ede2a6c161b3", "score": "0.5774838", "text": "function ready(cb) {\n if (doc.body) {\n return cb();\n }\n setTimeout(function () {\n ready(cb);\n });\n }", "title": "" }, { "docid": "7f4e035724a7cce0f73854332faa9e77", "score": "0.5756435", "text": "function whenDocumentReady() {\n if ( documentReadyPromise ) return documentReadyPromise\n\n return ( documentReadyPromise = new Promise( function ( res, rej ) {\n if ( document.readyState != \"loading\" )\n return res()\n\n document.addEventListener( \"DOMContentLoaded\", function( ev ) {\n clearTimeout( id )\n res()\n } )\n\n var id = setTimeout( function () {\n console.error( 'timeout waiting for document ready' )\n rej()\n }, 20000 )\n } ) )\n }", "title": "" }, { "docid": "7f4e035724a7cce0f73854332faa9e77", "score": "0.5756435", "text": "function whenDocumentReady() {\n if ( documentReadyPromise ) return documentReadyPromise\n\n return ( documentReadyPromise = new Promise( function ( res, rej ) {\n if ( document.readyState != \"loading\" )\n return res()\n\n document.addEventListener( \"DOMContentLoaded\", function( ev ) {\n clearTimeout( id )\n res()\n } )\n\n var id = setTimeout( function () {\n console.error( 'timeout waiting for document ready' )\n rej()\n }, 20000 )\n } ) )\n }", "title": "" }, { "docid": "f1fb8079e71bc201984e258e755f430f", "score": "0.57311743", "text": "function wait (components) {\n for (var c = 0, component; c < components.length; c++) {\n component = components[c];\n\n if (typeof window[component] === 'undefined') {\n // A component is still not available. Wait again ...\n return window.setTimeout(function () {\n wait(components);\n }, 25);\n }\n }\n\n return init(); // Finally all components are loaded. Start initialisation ...\n }", "title": "" }, { "docid": "4129ea69233c91f69cbf88293d83da5a", "score": "0.57307935", "text": "function onReady() {\n\t\tvar fn;\n\n\t\tif (isDOMReady) {\n\t\t\tdocument.detachEvent('onreadystatechange', onReady);\n\t\t\treturn;\n\t\t}\n\n\t\tif (document.readyState === 'complete') {\n\t\t\tdocument.detachEvent('onreadystatechange', onReady);\n\n\t\t\tif (!document.body) {\n\t\t\t\tsetTimeout(onReady, 13);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tisDOMReady = true;\n\t\t\twhile ((fn = readyList.shift())) {\n\t\t\t\tfn.call(document);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "d6358c4b457553d100528f2c0a77a481", "score": "0.57201475", "text": "async function getDoms() {\n const json = {\n limit: 20,\n threshold: 100,\n };\n const method = 'post';\n const res = await fetch('https://adobeioruntime.net/api/v1/web/helix/helix-services/run-query@v2/most-visited', { method, json });\n if (!res.ok) {\n await res.text();\n assert.fail('test setup failed to gather test urls');\n }\n base_urls = (await res.json()).results;\n // construct array of promises from fetch\n changes = base_urls.map((obj) => {\n // eslint-disable-next-line camelcase\n const { req_url, changed } = newURL(obj);\n\n // fetch page before change and page after change; and construct DOM\n bases.push(fetch(req_url).then(getText));\n return fetch(changed).then(getText);\n });\n bases = await Promise.all(bases);\n changes = await Promise.all(changes);\n}", "title": "" }, { "docid": "929a5448ff1bdbd42ef4e5d8dab7c275", "score": "0.5704984", "text": "waitOnLoading() {\n\t\treturn new Promise((resolve) => {\n\t\t\tif (this.isComponentLoaded == true)\n\t\t\t\tresolve();\n\t\t\telse\n\t\t\t\tthis.addEventListener('component-loaded', resolve);\n\t\t});\n\t}", "title": "" }, { "docid": "7efd4cc88f95ab98318fb8239abc08c1", "score": "0.5696071", "text": "function domContentLoaded() {\n if (doc.addEventListener) {\n doc.removeEventListener(\"DOMContentLoaded\", domContentLoaded, false);\n } else {\n // we're here because readyState !== \"loading\" in oldIE\n // which is good enough for us to call the dom ready!\n doc.detachEvent(\"onreadystatechange\", domContentLoaded);\n }\n domReady();\n}", "title": "" }, { "docid": "95f5d72723c4ad01e359a1e303a2de88", "score": "0.5693247", "text": "function contentLoaded(callback) {\n var addEventListener = doc['addEventListener'];\n var done = false, top = true,\n add = addEventListener ? 'addEventListener' : 'attachEvent',\n rem = addEventListener ? 'removeEventListener' : 'detachEvent',\n pre = addEventListener ? '' : 'on',\n\n init = function(e) {\n if (e.type == 'readystatechange' && doc.readyState != 'complete') {\n return;\n }\n (e.type == 'load' ? win : doc)[rem](pre + e.type, init, false);\n if (!done && (done = true)) { callback.call(win, e.type || e); }\n },\n\n poll = function() {\n try {\n root.doScroll('left');\n } catch(e) {\n win.setTimeout(poll, 50);\n return;\n }\n init('poll');\n };\n\n if (doc.readyState == 'complete') {\n callback.call(win, 'lazy');\n } else {\n if (doc.createEventObject && root.doScroll) {\n try { top = !win.frameElement; } catch(e) { }\n if (top) { poll(); }\n }\n doc[add](pre + 'DOMContentLoaded', init, false);\n doc[add](pre + 'readystatechange', init, false);\n win[add](pre + 'load', init, false);\n }\n }", "title": "" }, { "docid": "17e889f44f9649243f03b07089824245", "score": "0.5684338", "text": "function onload () {\n\t\t\tdocument.removeEventListener(\"DOMNodeInserted\", nodeInserted, false); // remove listener for performance\n\t\t\tnodeInserted(); // protent there was a node inserted\n\t\t}", "title": "" }, { "docid": "ef34650317e5a979210db79ca4d15a1f", "score": "0.5683207", "text": "function collectElems() {\r\n var dom = (!state.dom.length ? collectDom() : state.dom);\r\n Array.prototype.forEach.call(dom, bindElem);\r\n }", "title": "" }, { "docid": "4ed2f78041db6dcc82ec866ac38f6f1d", "score": "0.5681711", "text": "function checkIfReady() {\n\n\t\t\tfor (var file in auto_load)\n\t\t\t\tif (!isLoaded(file))\n\t\t\t\t\t// Not ready yet.\n\t\t\t\t\treturn;\n\n\t\t\t// Good to go.\n\t\t\ttriggerReadyEvent();\n\n\t\t}", "title": "" }, { "docid": "b828efaea00e4753a615110e7de5466e", "score": "0.5680591", "text": "function contentLoaded(n,t){var l=\"complete\",s=\"readystatechange\",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?\"addEventListener\":\"attachEvent\",v=i.addEventListener?\"removeEventListener\":\"detachEvent\",f=i.addEventListener?\"\":\"on\",r=function(e){(e.type!=s||i.readyState==l)&&((e.type==\"load\"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll(\"left\")}catch(n){setTimeout(o,50);return}r(\"poll\")};if(i.readyState==l)t.call(n,\"lazy\");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+\"DOMContentLoaded\",r,u),i[e](f+s,r,u),n[e](f+\"load\",r,u)}}", "title": "" }, { "docid": "b828efaea00e4753a615110e7de5466e", "score": "0.5680591", "text": "function contentLoaded(n,t){var l=\"complete\",s=\"readystatechange\",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?\"addEventListener\":\"attachEvent\",v=i.addEventListener?\"removeEventListener\":\"detachEvent\",f=i.addEventListener?\"\":\"on\",r=function(e){(e.type!=s||i.readyState==l)&&((e.type==\"load\"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll(\"left\")}catch(n){setTimeout(o,50);return}r(\"poll\")};if(i.readyState==l)t.call(n,\"lazy\");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+\"DOMContentLoaded\",r,u),i[e](f+s,r,u),n[e](f+\"load\",r,u)}}", "title": "" }, { "docid": "b828efaea00e4753a615110e7de5466e", "score": "0.5680591", "text": "function contentLoaded(n,t){var l=\"complete\",s=\"readystatechange\",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?\"addEventListener\":\"attachEvent\",v=i.addEventListener?\"removeEventListener\":\"detachEvent\",f=i.addEventListener?\"\":\"on\",r=function(e){(e.type!=s||i.readyState==l)&&((e.type==\"load\"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll(\"left\")}catch(n){setTimeout(o,50);return}r(\"poll\")};if(i.readyState==l)t.call(n,\"lazy\");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+\"DOMContentLoaded\",r,u),i[e](f+s,r,u),n[e](f+\"load\",r,u)}}", "title": "" }, { "docid": "b828efaea00e4753a615110e7de5466e", "score": "0.5680591", "text": "function contentLoaded(n,t){var l=\"complete\",s=\"readystatechange\",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?\"addEventListener\":\"attachEvent\",v=i.addEventListener?\"removeEventListener\":\"detachEvent\",f=i.addEventListener?\"\":\"on\",r=function(e){(e.type!=s||i.readyState==l)&&((e.type==\"load\"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll(\"left\")}catch(n){setTimeout(o,50);return}r(\"poll\")};if(i.readyState==l)t.call(n,\"lazy\");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+\"DOMContentLoaded\",r,u),i[e](f+s,r,u),n[e](f+\"load\",r,u)}}", "title": "" }, { "docid": "b828efaea00e4753a615110e7de5466e", "score": "0.5680591", "text": "function contentLoaded(n,t){var l=\"complete\",s=\"readystatechange\",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?\"addEventListener\":\"attachEvent\",v=i.addEventListener?\"removeEventListener\":\"detachEvent\",f=i.addEventListener?\"\":\"on\",r=function(e){(e.type!=s||i.readyState==l)&&((e.type==\"load\"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll(\"left\")}catch(n){setTimeout(o,50);return}r(\"poll\")};if(i.readyState==l)t.call(n,\"lazy\");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+\"DOMContentLoaded\",r,u),i[e](f+s,r,u),n[e](f+\"load\",r,u)}}", "title": "" }, { "docid": "abffc4fbce4595d84ace3fecfda4ceef", "score": "0.56672233", "text": "function contentLoaded(n, t) {\n var l = \"complete\",\n s = \"readystatechange\",\n u = !1,\n h = u,\n c = !0,\n i = n.document,\n a = i.documentElement,\n e = i.addEventListener ? \"addEventListener\" : \"attachEvent\",\n v = i.addEventListener ? \"removeEventListener\" : \"detachEvent\",\n f = i.addEventListener ? \"\" : \"on\",\n r = function(e) {\n (e.type != s || i.readyState == l) && ((e.type == \"load\" ? n : i)[v](f + e.type, r, u), !h && (h = !0) && t.call(n, null))\n },\n o = function() {\n try {\n a.doScroll(\"left\")\n } catch (n) {\n setTimeout(o, 50);\n return\n }\n r(\"poll\")\n };\n if (i.readyState == l) t.call(n, \"lazy\");\n else {\n if (i.createEventObject && a.doScroll) {\n try {\n c = !n.frameElement\n } catch (y) {}\n c && o()\n }\n i[e](f + \"DOMContentLoaded\", r, u), i[e](f + s, r, u), n[e](f + \"load\", r, u)\n }\n }", "title": "" }, { "docid": "8107e9fc46ccc8fa1a7f3b0cafcd44bb", "score": "0.56590486", "text": "function localRefreshAll() {\n const now = Number(new Date());\n nodes.forEach((node) => {\n domRefresh(node, now);\n });\n}", "title": "" }, { "docid": "52c4d88bb096c755dadab62b9e7fe016", "score": "0.5658521", "text": "function GM_wait() {\r\n\t\tif(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }\r\n \t else { $ = unsafeWindow.jQuery; markupLinks(); }\r\n\t}", "title": "" }, { "docid": "64efd66c91bd6f4fadaf3bd43cec88a9", "score": "0.56514394", "text": "function loadElements() {\r\n dom = document;\r\n dom.getElementById('search').addEventListener('click', expertSuggestions, false);\r\n dom.getElementById('reset').addEventListener('click', reset, false);\r\n}", "title": "" }, { "docid": "33dcbaa4ec22917be32fe059e3174135", "score": "0.5639167", "text": "function ready( fn ) {\n\t if ( !isReady ) {\n\t \n\t // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n\t if ( !doc.body ) {\n\t return defer( ready );\n\t }\n\t \n\t // Remember that the DOM is ready\n\t isReady = true;\n\t \n\t // Execute all callbacks\n\t while ( fn = callbacks.shift() ) {\n\t defer( fn );\n\t }\n\t }\n\t }", "title": "" }, { "docid": "33dcbaa4ec22917be32fe059e3174135", "score": "0.5639167", "text": "function ready( fn ) {\n\t if ( !isReady ) {\n\t \n\t // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n\t if ( !doc.body ) {\n\t return defer( ready );\n\t }\n\t \n\t // Remember that the DOM is ready\n\t isReady = true;\n\t \n\t // Execute all callbacks\n\t while ( fn = callbacks.shift() ) {\n\t defer( fn );\n\t }\n\t }\n\t }", "title": "" }, { "docid": "33dcbaa4ec22917be32fe059e3174135", "score": "0.5639167", "text": "function ready( fn ) {\n\t if ( !isReady ) {\n\t \n\t // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n\t if ( !doc.body ) {\n\t return defer( ready );\n\t }\n\t \n\t // Remember that the DOM is ready\n\t isReady = true;\n\t \n\t // Execute all callbacks\n\t while ( fn = callbacks.shift() ) {\n\t defer( fn );\n\t }\n\t }\n\t }", "title": "" }, { "docid": "f77bb2d3fa5a51ae249aca51bbda9998", "score": "0.5634819", "text": "function loadElements() {\n\t\t\tfor (i = 0; i < jsonLoaded[\"items\"].length; i++) {\n\t\t\t\tconsole.log(jsonLoaded[\"items\"][i]);\n\t\t\t\tif (jsonLoaded[\"items\"][i][\"element\"] == 'h1' || jsonLoaded[\"items\"][i][\"element\"] == 'h2' || jsonLoaded[\"items\"][i][\"element\"] == 'h3' || jsonLoaded[\"items\"][i][\"element\"] == 'h4' || jsonLoaded[\"items\"][i][\"element\"] == 'h5') {\n\t\t\t\t\taddLabel(jsonLoaded[\"items\"][i][\"element\"], jsonLoaded[\"items\"][i]);\n\t\t\t\t} else {\n\t\t\t\t\taddItemXY(jsonLoaded[\"items\"][i]);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fc13e56026451f84adbce5384a85f1ad", "score": "0.56199265", "text": "function onload() {\n doDone();\n }", "title": "" }, { "docid": "1b125557ea68137a855c52f80ed586db", "score": "0.5617788", "text": "function onready () {\n if (--pending === 0 && onload)\n onload();\n }", "title": "" }, { "docid": "53dbe5f6bc167148319813465a8e469a", "score": "0.5598998", "text": "function contentLoaded(fn) {\n\t\tvar done = false, top = true, win = window,\n\t\tdoc = win.document, root = doc.documentElement,\n\t\tadd = doc.addEventListener ? 'addEventListener' : 'attachEvent',\n\t\trem = doc.addEventListener ? 'removeEventListener' : 'detachEvent',\n\t\tpre = doc.addEventListener ? '' : 'on',\n\t\tinit = function(e) {\n\t\t\tif (e.type == 'readystatechange' && doc.readyState != 'complete') return;\n\t\t\t(e.type == 'load' ? win : doc)[rem](pre + e.type, init, false);\n\t\t\tif (!done && (done = true)) fn.call(win, e.type || e);\n\t\t},\n\t\tpoll = function() {\n\t\t\ttry { root.doScroll('left'); } catch(e) { setTimeout(poll, 50); return; }\n\t\t\tinit('poll');\n\t\t};\n\t\tif (doc.readyState == 'complete') fn.call(win, 'lazy');\n\t\telse {\n\t\t\tif (doc.createEventObject && root.doScroll) {\n\t\t\t\ttry { top = !win.frameElement; } catch(e) { }\n\t\t\t\tif (top) poll();\n\t\t\t}\n\t\t\tdoc[add](pre + 'DOMContentLoaded', init, false);\n\t\t\tdoc[add](pre + 'readystatechange', init, false);\n\t\t\twin[add](pre + 'load', init, false);\n\t\t}\n\t}", "title": "" }, { "docid": "5f0803b84c62a0d8fd8ebe5ba34dfe46", "score": "0.55963963", "text": "function DOMContentLoadedInit() {\r\n // quit if this function has already been called\r\n if (window.DOMContentLoadedInitDone) return;\r\n\r\n // flag this function so we don't do the same thing twice\r\n window.DOMContentLoadedInitDone = true;\r\n\r\n // iterates through array of registered functions \r\n var exceptions = new Array();\r\n for (var i=0; i<window.onDOMLoadEvents.length; i++) {\r\n var func = window.onDOMLoadEvents[i];\r\n try {\r\n func();\r\n } catch(e) {\r\n // continue running init functions but save exceptions for later\r\n exceptions[exceptions.length] = e;\r\n }\r\n }\r\n for (var i=0; i<exceptions.length; i++) {\r\n throw exceptions[i];\r\n }\r\n}", "title": "" }, { "docid": "71112c0e4dc34e18967e87354acc33fe", "score": "0.55944186", "text": "function ready( fn ) {\r\n if ( !isReady ) {\r\n \r\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\r\n if ( ! ( window.document.body && window.Gooi_Globals_Loader_Complete ) ) {\r\n return defer( ready );\r\n }\r\n \r\n // Remember that the DOM is ready\r\n isReady = true;\r\n \r\n // Execute all callbacks\r\n while ( fn = callbacks.shift() ) {\r\n defer( fn );\r\n }\r\n } \r\n }", "title": "" }, { "docid": "64f7648f2159afb413d71decf80b24b6", "score": "0.5592206", "text": "function getDocumentReadyComplete() {\r\n var document = Api.getInstance().document;\r\n return new Promise(function (resolve) {\r\n if (document && document.readyState !== 'complete') {\r\n var handler_1 = function () {\r\n if (document.readyState === 'complete') {\r\n document.removeEventListener('readystatechange', handler_1);\r\n resolve();\r\n }\r\n };\r\n document.addEventListener('readystatechange', handler_1);\r\n }\r\n else {\r\n resolve();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "64f7648f2159afb413d71decf80b24b6", "score": "0.5592206", "text": "function getDocumentReadyComplete() {\r\n var document = Api.getInstance().document;\r\n return new Promise(function (resolve) {\r\n if (document && document.readyState !== 'complete') {\r\n var handler_1 = function () {\r\n if (document.readyState === 'complete') {\r\n document.removeEventListener('readystatechange', handler_1);\r\n resolve();\r\n }\r\n };\r\n document.addEventListener('readystatechange', handler_1);\r\n }\r\n else {\r\n resolve();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "64f7648f2159afb413d71decf80b24b6", "score": "0.5592206", "text": "function getDocumentReadyComplete() {\r\n var document = Api.getInstance().document;\r\n return new Promise(function (resolve) {\r\n if (document && document.readyState !== 'complete') {\r\n var handler_1 = function () {\r\n if (document.readyState === 'complete') {\r\n document.removeEventListener('readystatechange', handler_1);\r\n resolve();\r\n }\r\n };\r\n document.addEventListener('readystatechange', handler_1);\r\n }\r\n else {\r\n resolve();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "64f7648f2159afb413d71decf80b24b6", "score": "0.5592206", "text": "function getDocumentReadyComplete() {\r\n var document = Api.getInstance().document;\r\n return new Promise(function (resolve) {\r\n if (document && document.readyState !== 'complete') {\r\n var handler_1 = function () {\r\n if (document.readyState === 'complete') {\r\n document.removeEventListener('readystatechange', handler_1);\r\n resolve();\r\n }\r\n };\r\n document.addEventListener('readystatechange', handler_1);\r\n }\r\n else {\r\n resolve();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "cfca6f64a2193e5d821f3c7c986fe1bb", "score": "0.5580422", "text": "function XMLDocument_onload() {\r\n\t\tloadHandler(this);\r\n\t}", "title": "" }, { "docid": "19f3e294fa747bdf984f1828d3a93746", "score": "0.55794024", "text": "function completed(){ // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\nif(document.addEventListener || event.type === \"load\" || document.readyState === \"complete\"){detach();jQuery.ready();}}", "title": "" }, { "docid": "547e0e994e301354e66cf4e3b0debda2", "score": "0.5575506", "text": "function completed() {\n // readyState === 'complete' is good enough for us to call the dom ready in oldIE\n if ( document.addEventListener || event.type === 'load' || document.readyState === 'complete' ) {\n detach();\n callback();\n }\n }", "title": "" }, { "docid": "3417e9140e7d9332f4b1e59cad714756", "score": "0.5574706", "text": "isLoaded() {\n this.I.waitForElement(this.options.isLoaded.element, 5);\n this.I.seeInCurrentUrl(this.options.isLoaded.urlPart);\n\n // If there is an overlay, wait for it\n this.I.waitForInvisible('#overlay', 10);\n }", "title": "" }, { "docid": "57e824e0a61706b738a9ccf7b2ec60f3", "score": "0.55464953", "text": "function getDocumentReadyComplete() {\n var document = Api.getInstance().document;\n return new Promise(function (resolve) {\n if (document && document.readyState !== 'complete') {\n var handler_1 = function () {\n if (document.readyState === 'complete') {\n document.removeEventListener('readystatechange', handler_1);\n resolve();\n }\n };\n document.addEventListener('readystatechange', handler_1);\n } else {\n resolve();\n }\n });\n}", "title": "" }, { "docid": "238470e09553d8ee6eca63f69dbb8e2c", "score": "0.5545753", "text": "function getDocumentReadyComplete() {\n var document = Api.getInstance().document;\n return new Promise(function (resolve) {\n if (document && document.readyState !== 'complete') {\n var handler_1 = function () {\n if (document.readyState === 'complete') {\n document.removeEventListener('readystatechange', handler_1);\n resolve();\n }\n };\n\n document.addEventListener('readystatechange', handler_1);\n } else {\n resolve();\n }\n });\n}", "title": "" }, { "docid": "d2e707b561182848a7a8cfded0de81b6", "score": "0.55436593", "text": "function getDocumentReadyComplete() {\n var document = Api.getInstance().document;\n return new Promise(function (resolve) {\n if (document && document.readyState !== 'complete') {\n var handler_1 = function () {\n if (document.readyState === 'complete') {\n document.removeEventListener('readystatechange', handler_1);\n resolve();\n }\n };\n document.addEventListener('readystatechange', handler_1);\n }\n else {\n resolve();\n }\n });\n}", "title": "" }, { "docid": "d2e707b561182848a7a8cfded0de81b6", "score": "0.55436593", "text": "function getDocumentReadyComplete() {\n var document = Api.getInstance().document;\n return new Promise(function (resolve) {\n if (document && document.readyState !== 'complete') {\n var handler_1 = function () {\n if (document.readyState === 'complete') {\n document.removeEventListener('readystatechange', handler_1);\n resolve();\n }\n };\n document.addEventListener('readystatechange', handler_1);\n }\n else {\n resolve();\n }\n });\n}", "title": "" }, { "docid": "d2e707b561182848a7a8cfded0de81b6", "score": "0.55436593", "text": "function getDocumentReadyComplete() {\n var document = Api.getInstance().document;\n return new Promise(function (resolve) {\n if (document && document.readyState !== 'complete') {\n var handler_1 = function () {\n if (document.readyState === 'complete') {\n document.removeEventListener('readystatechange', handler_1);\n resolve();\n }\n };\n document.addEventListener('readystatechange', handler_1);\n }\n else {\n resolve();\n }\n });\n}", "title": "" }, { "docid": "599f3e42652efed3ea62b2f683cc5004", "score": "0.5543023", "text": "async function startingFunctionOnPageLoad() {\n const personsData = await getStarwarsPersons();\n document.getElementById('root').innerHTML = '';\n\n for (i=0; i < personsData.length; i++) {\n profileHTML(personsData[i])\n };\n\n for (i=0; i < personsData.length; i++) {\n const url = personsData[i].url;\n document.getElementById(personsData[i].name).addEventListener(\"click\", () => navigateToPersonInfo(url));\n \n };\n\n\n\n //LOGIC manulate my DOM\n}", "title": "" }, { "docid": "2f4addc91185686621f491dfd33e2fc1", "score": "0.55397993", "text": "function completed() {\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if ( document.addEventListener || event.type === \"load\" || document.readyState === \"complete\" ) {\n detach();\n jQuery.ready();\n }\n}", "title": "" }, { "docid": "6a50162bfeefe159e1774889a2bc8307", "score": "0.55386794", "text": "function h(){\n// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n(da.addEventListener||\"load\"===a.event.type||\"complete\"===da.readyState)&&(g(),na.ready())}", "title": "" }, { "docid": "bbee105564e473d6e37fc16fc32b46cc", "score": "0.5534893", "text": "function ready( cb ){\n if( document.body ){\n return cb();\n }\n setTimeout(function(){\n ready( cb );\n });\n }", "title": "" }, { "docid": "e892e77ca3fcdcd506ecd233be130153", "score": "0.553386", "text": "function ready( cb ){\n\t\t\tif( doc.body ){\n\t\t\t\treturn cb();\n\t\t\t}\n\t\t\tsetTimeout(function(){\n\t\t\t\tready( cb );\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "7c55883f8d95718f9b8327eb30b955ae", "score": "0.5533473", "text": "function imagesLoaded(parentNode) {\n const imgElements = [...parentNode.querySelectorAll(\"img\")];\n for (let i = 0; i < imgElements.length; i += 1) {\n const img = imgElements[i];\n if (!img.complete) {\n return false;\n }\n\n }\n return true;\n}", "title": "" }, { "docid": "1037127dcb7e9b13d28b15854748437b", "score": "0.5531684", "text": "function _DOMContentLoaded() {\n\t_document.removeEventListener('DOMContentLoaded', _DOMContentLoaded);\n\n\tif(noDocumentReadyState)_document.readyState = \"interactive\";\n\n\tif(_emulate_scrollX_scrollY)_emulate_scrollX_scrollY();\n\n\tif(!(\"classList\" in _document.body.firstChild)) {\n\t\tif(DEBUG && console) {\n\t\t\tconsole.error(\"Cannot handle htc behavior. Maybe *.htc file not allowed or not exists\");\n\t\t}\n\t\t//TODO:: no htc available, do for(var node in document.all) __ielt8__element_init__(node)\n\t}\n}", "title": "" }, { "docid": "9dbe78c1873ede6c8e8b878c6534371f", "score": "0.552012", "text": "function ready(cb) {\n if (document.readyState != \"loading\") {\n cb();\n } else {\n document.addEventListener(\"DOMContentLoaded\", cb);\n }\n}", "title": "" }, { "docid": "0f3857dddc839fc47c6366a975a99c73", "score": "0.5515562", "text": "function OrgHtmlManagerLoadCheck()\n{\n org_html_manager.init();\n}", "title": "" } ]
776c85a50ca351784c7ea24ca04dcde6
overwrite a method from the parent class
[ { "docid": "c3d957055fd7db61fbd3859ae37a80e7", "score": "0.0", "text": "brake() {\n // calls the brake method from the parent class\n super.brake(2);\n }", "title": "" } ]
[ { "docid": "ba3f45bf3c8538208d4ec2cedc1c507a", "score": "0.6533812", "text": "function Function.prototype.Override(fnBase, stMethod)\n{\n\tthis.prototype[fnBase.StName() + \"_\" + stMethod] = fnBase.prototype[stMethod];\n}", "title": "" }, { "docid": "90b353dcf59b8cb4df5268585131f276", "score": "0.63928354", "text": "reset() {\n // extend and override\n }", "title": "" }, { "docid": "75814006cf851788cf6a99da7785701c", "score": "0.62569237", "text": "function example4() {\n\n function Machine(power) {\n this._power = power;\n\n this._isEnabled = false;\n this.enable = function () {\n this._isEnabled = true;\n };\n this.disable = function () {\n this._isEnabled = false;\n };\n }\n\n //1. Overriding method (bad potentially)\n\n function CoffeeMachine(power, capacity) {\n Machine.apply(this, arguments);\n\n this.enable = function () {\n //totally new enable\n };\n }\n\n /* 2. Extending the parent method (better)\n a. Save parent method in variable\n b. define new function (as Overriding method)\n c. call previously saved method with Descendant context passing \n */\n\n function Fridge(power, capacity) {\n Machine.apply(this, arguments);\n\n var parentEnable = this.enable; //a\n\n this.enable = function () {\n // b\n parentEnable.call(this); // c\n\n // new extended stuff\n };\n }\n\n var cm = new CoffeeMachine(1000);\n}", "title": "" }, { "docid": "94abcfed32f9d15828f97f3a232499b1", "score": "0.6239899", "text": "function overridenWrapper() {\n return overriddenFunction.apply(obj, arguments);\n }", "title": "" }, { "docid": "d0701f73be0c2da0b30ddad1c01b22f5", "score": "0.6206149", "text": "function subclass() {}", "title": "" }, { "docid": "ce4618775f59ddb625b0b468ed9db345", "score": "0.61831945", "text": "heyy(){\n return super.hello() + 'and I am a cool guy'; // super, a way to reach back to the class it extends from to get methods\n }", "title": "" }, { "docid": "eb9bbdc3a7b6bc24e993f4486fd1ebcb", "score": "0.6100654", "text": "function overrideMethod(target, methodName, funcSource) {\n var superFunc = target[methodName] || function () { };\n var superFuncBound = function () {\n return superFunc.apply(target, arguments);\n };\n target[methodName] = funcSource(superFuncBound);\n }", "title": "" }, { "docid": "b9901cb4afe9132b02c864d01f0a1c69", "score": "0.60568404", "text": "function replaceExistingMethod(obj, name, newMethod) {\n let originalMethod = obj[name] && obj[name].bind(obj);\n obj[name] = newMethod(originalMethod || noop);\n}", "title": "" }, { "docid": "bf0bd70ce4b35722f4f0990d3c9405bf", "score": "0.6028527", "text": "function Parent() {\n\tParent.prototype.parentMethod = function parentMethod() {}\n}", "title": "" }, { "docid": "458cfa36114b77b5078681665de7f353", "score": "0.59856856", "text": "enable() {\n throw new Error('Implement in child class');\n }", "title": "" }, { "docid": "bc5d12ae1503bfc1b395454165ac91e4", "score": "0.5950153", "text": "function wrapMethod(name) {\n var original = document[name];\n Document.prototype[name] = function() {\n return wrap(original.apply(this.impl, arguments));\n };\n }", "title": "" }, { "docid": "e74c64fb0256d0d94d966f74cc51d8a5", "score": "0.5949356", "text": "function _super(superClass, method, args) {\n return superClass.prototype[method].apply(this, args);\n }", "title": "" }, { "docid": "13d3431af2a1f72f9f59ab6f262f1a3b", "score": "0.59452164", "text": "function inheritance() { }", "title": "" }, { "docid": "6ae91b8af7aa0c78f15fab70e4b6b4de", "score": "0.59438187", "text": "function _super(instance, method, args) {\n return instance._super.prototype[method].apply(instance, args);\n }", "title": "" }, { "docid": "67eb58c95dddf9977addb16c56419fde", "score": "0.593933", "text": "function inheritance() {}", "title": "" }, { "docid": "8fc757ce5af3766a1d7cb101035c4e12", "score": "0.5938872", "text": "function _override(object, methodName, callback) {\r\n object[methodName] = callback(object[methodName])\r\n }", "title": "" }, { "docid": "ed6f6e4fa2d29059cfc751597366233d", "score": "0.5936069", "text": "function override(object, methodName, callback)\n{\n object[methodName] = callback(object[methodName]);\n}", "title": "" }, { "docid": "cc6a6317404bd9963581f4e8b747c515", "score": "0.5928086", "text": "function newOverride(src,dest){\r\n var oo = objectOverride;\r\n return oo(src,oo(dest,{}));\r\n }", "title": "" }, { "docid": "874e228e71d6098a60cf311bcae03aee", "score": "0.5911921", "text": "sayHi() {\r\n // call parent method\r\n super.say(`Hello ${this.name}`); // (*)\r\n }", "title": "" }, { "docid": "a8adb31e0f4977842a9bb00fd3c58d13", "score": "0.58907014", "text": "connect() {\n throw new Error(\"function must be overwritten in subclass\");\n }", "title": "" }, { "docid": "77990f8ddfce4cbfd499ce317addbf7d", "score": "0.58891004", "text": "disable() {\n throw new Error('Implement in child class');\n }", "title": "" }, { "docid": "42482baab3fae145d660a277775125ae", "score": "0.58887285", "text": "override(html) {\n log.info('overriding', arguments);\n this.parent.html(html);\n }", "title": "" }, { "docid": "ce13584e93ec943adc516d3735ffccb5", "score": "0.5869424", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\teach(arguments, function (arg, i) {\n\t\t\t\t\t\targs[i] = arg;\n\t\t\t\t\t});\n\t\t\t\t\treturn oldFn.apply(self, args);\n\t\t\t\t}", "title": "" }, { "docid": "c312bf31949484befbd9a80e52620619", "score": "0.5864137", "text": "log() { return 'overridden'; }", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5850757", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5850757", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "929ab624c55dcced7580ec0f7d8bea19", "score": "0.5850757", "text": "function super_fn() {\n\t\t\t\t\tif (!oldFn) { return }\n\t\t\t\t\teach(arguments, function(arg, i) {\n\t\t\t\t\t\targs[i] = arg\n\t\t\t\t\t})\n\t\t\t\t\treturn oldFn.apply(self, args)\n\t\t\t\t}", "title": "" }, { "docid": "3f4db4cf7533eae208d2b0519591f5b1", "score": "0.58312625", "text": "reset() {\n for (let i = 0; i < this.overrides_.length; i++) {\n const override = this.overrides_[i];\n override.parent[override.functionName] = override.originalFunction;\n }\n }", "title": "" }, { "docid": "980f65c2d5a16e4e0cb0ddf045e65745", "score": "0.5790358", "text": "eat() {\n super.eat();\n }", "title": "" }, { "docid": "980f65c2d5a16e4e0cb0ddf045e65745", "score": "0.5790358", "text": "eat() {\n super.eat();\n }", "title": "" }, { "docid": "961db32c41deef3c6622a6d5f4c7b556", "score": "0.57894206", "text": "function inherit(new_class,original_class)\r\n\t{\r\n\t\tfor (var i in original_class.prototype)\r\n\t\t\tnew_class[i] = original_class.prototype[i];\r\n\t}", "title": "" }, { "docid": "0f76e411d1d946f6b995bcbe8d21e8ba", "score": "0.57392156", "text": "function extend(Child, Parent){ //extend class\n Child.prototype = Object.create(Parent.prototype);\n Child.prototype.constructor = Child;\n}", "title": "" }, { "docid": "119ad55067a73108a2af4b746d3a8cd7", "score": "0.5729912", "text": "function method(obj, key, method) {\n var _super = obj[key]\n if (_super && 'function' === typeof method\n // Check to make sure we don't create circular dependencies.\n && (!_super.valueOf || _super.valueOf() != method.valueOf())\n && /\\b_super\\b/.test(method)) {\n // Ensure we're using the underlying function (if `method` was already wrapped)\n var originalMethod = method.valueOf()\n // Override the method\n method = function () {\n var prev = this._super || function () {}\n var result\n this._super = _super\n try {\n result = originalMethod.apply(this, arguments)\n } finally {\n this._super = prev\n }\n return result\n }\n method.valueOf = function (type) {\n return (type = 'object')? method : originalMethod\n }\n method.toString = function () {\n return String(originalMethod)\n }\n }\n obj[key] = method\n }", "title": "" }, { "docid": "2f83124dd1e6ffd476e099b77d8f2081", "score": "0.57230175", "text": "function SuperclassBare() {}", "title": "" }, { "docid": "ce928308e59dc2300722a4d945dc3828", "score": "0.572047", "text": "function plainMethod(fn) {\n return overridable(true, innocuous(fn));\n }", "title": "" }, { "docid": "d6198a09668915e15a7c88eef05d0a4d", "score": "0.5711497", "text": "function Super() {}", "title": "" }, { "docid": "69adb960a3c4fe21493d90632aca857d", "score": "0.57001984", "text": "function example7 () {\n \n let animal = {\n walk() {\n console.log(`I'am walking`);\n }\n }\n\n let rabbit = {\n __proto__: animal, // 1 \n\n walk() {\n super.walk() // 2\n },\n\n //3\n // walk: function() {\n // super.walk() // Error\n // }\n\n\n //4\n walk1() {\n setTimeout(() => super.walk())\n }\n\n }\n rabbit.walk()\n rabbit.walk1()\n}", "title": "" }, { "docid": "21fe37d000e3600df5eda7883c509dfe", "score": "0.56938535", "text": "function augment(receivingClass, givingClass) {\n if (arguments[2]) { // If there are any methods set, only augment that\n for (var i = 2, len = arguments.length; i < len; i++) {\n receivingClass.prototype[arguments[i]] = givingClass.prototype[arguments[i]];\n }\n } else { // Otherwise Give all methods\n for (methodName in givingClass.prototype) {\n if (!receivingClass.prototype[methodName]) { // Make sure it doesn't override anything\n receivingClass.prototype[methodName] = givingClass.prototype[methodName]\n }\n }\n }\n\n}", "title": "" }, { "docid": "94cc09b0c710a0f880cefc35f6066e92", "score": "0.56809163", "text": "function patch(prototype, name, fn) {\n\n let original = prototype[name];\n\n prototype[name] = function (... args) {\n return fn.call(this, original, ... args);\n };\n\n}", "title": "" }, { "docid": "1c366281d856980c2130daafc189e2fd", "score": "0.56612706", "text": "function Parent(){}", "title": "" }, { "docid": "e531478a9760290cde16b4f34b82c139", "score": "0.56276906", "text": "function noopFunct() {\n // Placeholder function meant to be overridden.\n}", "title": "" }, { "docid": "f37d57a9c2e27f4580bac24175e7bb72", "score": "0.5625491", "text": "function extend2(child,parent) {\n var p = parent.prototype;\n var c = child.prototype;\n //kopiujemy wszystkie pola z rodzica do child\n for (var i in p) {\n c[i] = p[i];\n }\n c.xess = p; //wskaznik child do rodzica\n}", "title": "" }, { "docid": "59a74a9bb1930ecab67618dc344fa171", "score": "0.55906147", "text": "function augment( receivingClass, givingClass ) {\n if ( arguments[2] ) {\n for (var i=2, len=arguments.length; i<len; i++) {\n receivingClass.prototype[arguments[i]] = givingClass.prototype[arguments[i]];\n }\n }\n else {\n for ( var methodName in givingClass.prototype ) {\n if ( !receivingClass.prototype[methodName] ) {\n receivingClass.prototype[methodName] = givingClass.prototype[methodName];\n }\n }\n }\n}", "title": "" }, { "docid": "68526034daf44def93955f23526e72ff", "score": "0.5588831", "text": "function around (obj, method, fn) {\n let old = obj[method];\n\n obj[method] = function () {\n let args = new Array(arguments.length)\n for (let i = 0; i < args.length; i++) args[i] = arguments[i]\n return fn.call(this, old, args)\n }\n}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.5571588", "text": "function Parent() {}", "title": "" }, { "docid": "0af742e55420f9d9e6033a56128f6cdd", "score": "0.5532135", "text": "function extend(Child, Parent){\n //create inheritance\n Child.prototype = Object.create(Parent.prototype)\n //reset constructor\n Child.prototype.constructor = Child\n}", "title": "" }, { "docid": "0af742e55420f9d9e6033a56128f6cdd", "score": "0.5532135", "text": "function extend(Child, Parent){\n //create inheritance\n Child.prototype = Object.create(Parent.prototype)\n //reset constructor\n Child.prototype.constructor = Child\n}", "title": "" }, { "docid": "b4f94e2f43466f1222e2b268fe894379", "score": "0.55302066", "text": "initCustomFunctions() {/*To be overridden in sub class as needed*/\n }", "title": "" }, { "docid": "d700ee088f8ba2319101b21dc360b888", "score": "0.5526433", "text": "specificSetValue(v) {\n throw (\"Override this\");\n }", "title": "" }, { "docid": "99dfdeebbd9c47e270cef142253e21b6", "score": "0.5526115", "text": "function VF_UM703_RELOAD_OVERRIDE()\n{\n objNewLook.ReloadOverride();\n}", "title": "" }, { "docid": "b41fc6116af0e0a25e84708e65367fd9", "score": "0.55234015", "text": "function superCall(context, methodName) {\n\t var args = zrUtil.slice(arguments, 2);\n\t return this.superClass.prototype[methodName].apply(context, args);\n\t }", "title": "" }, { "docid": "e7c1e16e88ff9ac18b6ea3a689d9ce06", "score": "0.55111814", "text": "function MyClass(){\n\n this.run = function(){\n\n }\n this.run.SuperMethod = true;\n}", "title": "" }, { "docid": "16443da96d3eab4c59577c79fbaf5467", "score": "0.55090785", "text": "function resetIncomingMessageOverridedMethods(message) {\n\tif (message.pause !== IncomingMessage_pause) {\n\t\tmessage._orig_pause = message.pause;\n\t\tmessage.pause = IncomingMessage_pause;\n\t}\n\tif (message.resume !== IncomingMessage_resume) {\n\t\tmessage._orig_resume = message.resume;\n\t\tmessage.resume = IncomingMessage_resume;\n\t}\n\tif (message.on !== IncomingMessage_on) {\n\t\tmessage._orig_on = message.on;\n\t\tmessage.on = IncomingMessage_on;\n\t\tmessage.addListener = IncomingMessage_on;\n\t}\n}", "title": "" }, { "docid": "31cc7045fd179f76f7d28280fef53753", "score": "0.55055153", "text": "function around(obj, method, fn) {\n var old = obj[method]\n\n obj[method] = function () {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) args[i] = arguments[i]\n return fn.call(this, old, args)\n }\n}", "title": "" }, { "docid": "0dec92f8364a3c055a754504a9c694dd", "score": "0.5492456", "text": "deregister () {\n throw new Error('Deregister method must be defined in a subclass')\n }", "title": "" }, { "docid": "e94cc4548606fd558ed79c2e744ef314", "score": "0.54921836", "text": "function augment(receivingClass, givingClass) {\n //only provide certain methods (of course we can use spread oprator here.)\n if (arguments[2]) {\n for (var i = 2, len = arguments.length; i < len; i++) {\n receivingClass.prototype[arguments[i]] = givingClass.prototype[arguments[i]];\n }\n }\n // provide all methods\n else {\n for (var methodName in givingClass.prototype) {\n if (!Object.hasOwnProperty.call(receivingClass.prototype, methodName)) {\n receivingClass.prototype[methodName] = givingClass.prototype[methodName];\n }\n }\n }\n}", "title": "" }, { "docid": "262b53c0429115cd4ceed8307cc77682", "score": "0.5490349", "text": "function around(obj, method, fn) {\n\n var old = obj[method]\n\n obj[method] = function () {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) args[i] = arguments[i]\n return fn.call(this, old, args)\n }\n}", "title": "" }, { "docid": "990643c436d83c08347400dbcb600b8a", "score": "0.5477418", "text": "function _add_methods_with_super(new_obj, methods) {\n for(var m in methods) {\n var super_method = new_obj[m];\n if(super_method) methods[m].super_method = super_method;\n new_obj[m] = methods[m];\n }\n}", "title": "" }, { "docid": "81704f7b20886da6292da61a03e1551d", "score": "0.54757273", "text": "function around(obj, method, fn) {\n var old = obj[method];\n\n obj[method] = function() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) args[i] = arguments[i];\n return fn.call(this, old, args);\n };\n}", "title": "" }, { "docid": "645f5d8dd076d71bd40d13858eddd072", "score": "0.5462866", "text": "function addSuper (name, fn, _super){\n\t\treturn function() {\n\t\t\tvar tmp = this._super;\n\n\t\t\t// Add a new ._super() method that is the same method\n\t\t\t// but on the super-class\n\t\t\tthis._super = _super[name];\n\n\t\t\t// The method only need to be bound temporarily, so we\n\t\t\t// remove it when we're done executing\n\t\t\tvar ret = fn.apply(this, arguments);\n\t\t\tthis._super = tmp;\n\n\t\t\treturn ret;\n\t\t};\n\t}", "title": "" }, { "docid": "e50229e7d63a9d0ffd6651cf2cceef72", "score": "0.5452867", "text": "function superClass( sup ) {\n\t\treturn function( instance, method, args ) {\n\t\t\treturn sup.prototype[ method ].apply( instance, args );\n\t\t};\n\t}", "title": "" }, { "docid": "881124d30ad187a1e7458fc64bff1016", "score": "0.5446432", "text": "function visitNode(node, ctx, program) {\n // If a class element implements an abstract member but does not have the\n // `override` keyword, create a lint failure.\n if (ts.isClassElement(node) && !hasOverrideModifier(node) &&\n matchesParentAbstractElement(node, program)) {\n ctx.addFailureAtNode(node, FAILURE_MESSAGE, lib_1.Replacement.appendText(node.getStart(), \"override \"));\n }\n ts.forEachChild(node, function (node) { return visitNode(node, ctx, program); });\n }", "title": "" }, { "docid": "5700841e4f403d535deeec5b75cea8e3", "score": "0.5445234", "text": "function around(obj, method, fn) {\n\tvar old = obj[method]\n\n\tobj[method] = function () {\n\t\tvar args = new Array(arguments.length)\n\t\tfor (var i = 0; i < args.length; i++) args[i] = arguments[i]\n\t\treturn fn.call(this, old, args)\n\t}\n}", "title": "" }, { "docid": "009766624a16c688b947f08010e52767", "score": "0.542805", "text": "function superCall(context, methodName) {\n var args = zrUtil.slice(arguments, 2);\n return this.superClass.prototype[methodName].apply(context, args);\n}", "title": "" }, { "docid": "009766624a16c688b947f08010e52767", "score": "0.542805", "text": "function superCall(context, methodName) {\n var args = zrUtil.slice(arguments, 2);\n return this.superClass.prototype[methodName].apply(context, args);\n}", "title": "" }, { "docid": "ab66053f0d635caaf3c142c66ef7261d", "score": "0.5427469", "text": "function extend(Child, Parent) { \n\tvar p = Parent.prototype; \n\tvar c = Child.prototype; \n\tfor (var i in p) { \n\t\t c[i] = p[i]; \n\t} \n\tc.uber = p;\n}", "title": "" }, { "docid": "7e196deb4d21c4069c9ce8873eb2a614", "score": "0.54239017", "text": "childFunction() {\n // by using super, we can call the parent method\n const message = super.parentFunction();\n console.log(message);\n }", "title": "" }, { "docid": "7a6ef819286d8bc92b319985be086af1", "score": "0.5419178", "text": "function tameMethodCustom(baseFunc, dontCheckLength) {\n var expectedLength = baseFunc.length - 1; // remove 'privates' arg\n return Props.markPropMaker(function(env) {\n var prop = env.prop;\n var ampFn = env.amplifying(baseFunc);\n function argCheckingWrapper() {\n if (arguments.length !== expectedLength) {\n throw new Error(env + ' takes ' + expectedLength +\n ' args, not ' + arguments.length);\n }\n return ampFn.apply(this, arguments);\n }\n return {\n enumerable: true,\n value: dontCheckLength ? ampFn : argCheckingWrapper\n };\n });\n }", "title": "" }, { "docid": "ebe8556973018fc42127dc52f09cd114", "score": "0.5417224", "text": "increaseExperience(){\n throw new Error(`You have to implement method ${this.increaseExperience.name} in all subclasses of Unit class`);\n }", "title": "" }, { "docid": "5f52268fae76e9f4ee5b7b9a5b9154aa", "score": "0.5412956", "text": "function before (obj, method, fn) {\n let old = obj[method];\n\n obj[method] = function () {\n fn.call(this);\n old.apply(this, arguments)\n }\n}", "title": "" }, { "docid": "8070cd3f3f12f7ce0d00f6f56dbbcf78", "score": "0.5392826", "text": "_setBaseMethods() {\n const that = this\n\n that.suffix = 'Request'\n\n that.instanceSource = {\n method: [\n 'OPTIONS',\n 'GET',\n 'HEAD',\n 'POST',\n 'PUT',\n 'DELETE',\n 'PATCH'\n ]\n }\n\n for (let key in that.instanceSource) {\n that.instanceSource[key].forEach((method, index) => {\n that[method.toLowerCase() + that.suffix] = (requestObject) => that._defaultRequest(method, requestObject)\n })\n }\n }", "title": "" }, { "docid": "1d6c5cdc5c24b578f16ba95b4b516c53", "score": "0.5389073", "text": "function superCall(context, methodName) {\n var args = zrUtil.slice(arguments, 2);\n return this.superClass.prototype[methodName].apply(context, args);\n }", "title": "" }, { "docid": "1d6c5cdc5c24b578f16ba95b4b516c53", "score": "0.5389073", "text": "function superCall(context, methodName) {\n var args = zrUtil.slice(arguments, 2);\n return this.superClass.prototype[methodName].apply(context, args);\n }", "title": "" }, { "docid": "1d6c5cdc5c24b578f16ba95b4b516c53", "score": "0.5389073", "text": "function superCall(context, methodName) {\n var args = zrUtil.slice(arguments, 2);\n return this.superClass.prototype[methodName].apply(context, args);\n }", "title": "" }, { "docid": "1d6c5cdc5c24b578f16ba95b4b516c53", "score": "0.5389073", "text": "function superCall(context, methodName) {\n var args = zrUtil.slice(arguments, 2);\n return this.superClass.prototype[methodName].apply(context, args);\n }", "title": "" }, { "docid": "60564106adf8191ab70e99d8fcf799c7", "score": "0.5387489", "text": "internalUpdate() {\n throw new MethodNotImplementedError(this);\n }", "title": "" }, { "docid": "8750454a2cf5380b431e1d001661db77", "score": "0.5353617", "text": "function extend(prototype, api) {\n if (prototype && api) {\n // use only own properties of 'api'\n Object.getOwnPropertyNames(api).forEach(function(n) {\n // acquire property descriptor\n var pd = Object.getOwnPropertyDescriptor(api, n);\n if (pd) {\n // clone property via descriptor\n Object.defineProperty(prototype, n, pd);\n // cache name-of-method for 'super' engine\n if (typeof pd.value == 'function') {\n // hint the 'super' engine\n prototype[n].nom = n;\n }\n // TODO(sjmiles): sharing a function only works if the function \n // only ever has one name\n }\n });\n }\n return prototype;\n }", "title": "" }, { "docid": "1b1f6e91e4744e048d3490ad5a08202a", "score": "0.5348034", "text": "decorateInternal() {}", "title": "" }, { "docid": "504489a067db43a196e7069b5c4bdca6", "score": "0.5346607", "text": "function argument(recivingClass,givingClass) {\n\tif(arguments[2]){\n\t\tfor(var i = 2,len = arguments.length; i<len; i++){\n\t\t\trecivingClass.prototype[arguments[i]] = givingClass.prototype[arguments[i]];\n\t\t}\n\t}else{\n\t//all methods\n\t\tfor(methodName in givingClass.prototype){\n\t\t\tif(!recivingClass.prototype[methodName]){\n\t\t\t\trecivingClass.prototype[methodName] = givingClass.prototype[methodName];\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e6ca496bbe94710527d72b59b1a54021", "score": "0.53462315", "text": "function inheritsFrom(child, parent) {\n\tchild.prototype = Object.create(parent.prototype);\n}", "title": "" }, { "docid": "b26f2b4ead7cc5c6d272e25d580792fb", "score": "0.5329432", "text": "function extending(childImpl, baseImpl) {\n var prop;\n for (prop in baseImpl)\n if (!childImpl.hasOwnProperty(prop) && prop !== init)\n childImpl[prop] = baseImpl[prop];\n }", "title": "" }, { "docid": "2ce895763d889398e2dff67c4cadc164", "score": "0.53248644", "text": "function Man( Base ) {\n return class Man extends Base {\n constructor() {\n super()\n }\n\n update() {\n // Could check existence before calling\n super()\n console.log( 'man update' )\n }\n }\n}", "title": "" }, { "docid": "2f9c1ba7613e012db9a72e13e7da9509", "score": "0.5313014", "text": "setPrototypeOf() { throwTypeError('setting prototype') }", "title": "" }, { "docid": "02979b533dc78a1629d5fdd0e9a61a61", "score": "0.53112644", "text": "remove(){ throw 'Remove not overridden'}", "title": "" }, { "docid": "49e6ec68ce7cb2c6c3b157348ec57ddb", "score": "0.5305215", "text": "function extend(Child, Parent){\n Child.prototype = Object.create(Parent.prototype); \n Child.prototype.constructor = Child;\n}", "title": "" }, { "docid": "cbd063942af69fd307e94d9663a5e59f", "score": "0.5294272", "text": "function apply_methods(Class, methods, descriptor) {\n Object.keys(descriptor).forEach(function (method) {\n methods[method] = descriptor[method];\n\n if (typeof(descriptor[method]) !== \"function\") {\n throw new TypeError(\n \"extend: Method `\" + method + \"` is not a function\"\n );\n }\n\n Object.defineProperty(Class.prototype, method, {\n \"configurable\" : true,\n \"value\" : descriptor[method]\n });\n });\n }", "title": "" }, { "docid": "1a1678938300374afab56822ff368a17", "score": "0.5288905", "text": "update(selection) {\n throw new Error(\"Don't call the base class method\")\n\n }", "title": "" }, { "docid": "37fad5cd941c2eb30c60dc79c2ea0321", "score": "0.52807534", "text": "function superCall(context, methodName) {\n var args = slice(arguments, 2);\n return this.superClass.prototype[methodName].apply(context, args);\n}", "title": "" }, { "docid": "9a4b397cc17f1c2b19e86c7e7f8bcc65", "score": "0.5275164", "text": "function initialize(method){\n\t\t//Recursivly execute parent methods.\n\t\tif(method.parent instanceof Function){\n\t\t\tinitialize.apply(this,[method.parent]);\n\t\t\tthis.super = cloneCopy(this,\n\t\t\t\tsuperCopy(this,this.constructor)\n\t\t\t);\n\t\t}\n\t\tmethod.apply(this, arguments);\n\t}", "title": "" }, { "docid": "52c46aedf2358a6b50d97130f2c6e2b0", "score": "0.52682483", "text": "function override() {\n\n\t//store translation data in object array\n\ttranslate = {\n\t\t'入力情報が不正です': \"Entered Information is not correct.\"\n\t}\n\n\t//backup the alert box function to reuse it (if you want to program your own fancy alery box then go for it, you could probably even use jQuery UI or the chrome built in desktop notifications API, because alert boxes are lame)\n\twindow.alertback = window.alert\n\t\n\t//redefine the alert function to pass text into the backup of the original alert function after it's translated\n\twindow.alert = function alert(x) {\n\t alertback(translate[x]);\n\t};\n\n}", "title": "" }, { "docid": "77fd962ca8115f6b5ab26cfa5c591141", "score": "0.5260179", "text": "function before(obj, method, fn) {\n var old = obj[method];\n\n obj[method] = function() {\n fn.call(this);\n old.apply(this, arguments);\n };\n}", "title": "" }, { "docid": "77fd962ca8115f6b5ab26cfa5c591141", "score": "0.5260179", "text": "function before(obj, method, fn) {\n var old = obj[method];\n\n obj[method] = function() {\n fn.call(this);\n old.apply(this, arguments);\n };\n}", "title": "" }, { "docid": "2bb14a9cae6e40366697522195e88141", "score": "0.52498245", "text": "function before(obj, method, fn) {\n\tvar old = obj[method]\n\n\tobj[method] = function () {\n\t\tfn.call(this)\n\t\told.apply(this, arguments)\n\t}\n}", "title": "" }, { "docid": "347caf699753167dcf3f43a3da4f9d83", "score": "0.5246628", "text": "function extendComponent(parent, methods) {\n for (var name_1 in methods) {\n if (methods.hasOwnProperty(name_1)) {\n // tslint:disable-next-line:no-any\n parent[name_1] = Object(_appendFunction__WEBPACK_IMPORTED_MODULE_0__[\"appendFunction\"])(parent, parent[name_1], methods[name_1]);\n }\n }\n}", "title": "" }, { "docid": "dba2fb324130500a68024d138b3fb121", "score": "0.52438074", "text": "function before(obj, method, fn) {\n var old = obj[method];\n\n obj[method] = function () {\n fn.call(this);\n old.apply(this, arguments);\n };\n}", "title": "" }, { "docid": "dba2fb324130500a68024d138b3fb121", "score": "0.52438074", "text": "function before(obj, method, fn) {\n var old = obj[method];\n\n obj[method] = function () {\n fn.call(this);\n old.apply(this, arguments);\n };\n}", "title": "" }, { "docid": "6b9d1cce5b47f0e2f48f5494719c3fe1", "score": "0.52414066", "text": "function before(obj, method, fn) {\n\n var old = obj[method];\n\n obj[method] = function () {\n fn.call(this);\n old.apply(this, arguments);\n };\n}", "title": "" }, { "docid": "8302c4c550beae85bbe2ac65ffb813f5", "score": "0.52295", "text": "function extendComponent(parent, methods) {\n for (var name_1 in methods) {\n if (methods.hasOwnProperty(name_1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parent[name_1] = Object(_appendFunction__WEBPACK_IMPORTED_MODULE_0__[\"appendFunction\"])(parent, parent[name_1], methods[name_1]);\n }\n }\n}", "title": "" }, { "docid": "312ed130571e4283661c8d83c92b5f02", "score": "0.5223498", "text": "function clazz$methods(methods) {\r\n if (!methods) {\r\n return instance$methods.call(this, false, true);\r\n }\r\n var name, parentProto = this.parent().prototype,\r\n m;\r\n this.base = instance$noop;\r\n for (name in methods) {\r\n if (!methods.hasOwnProperty(name)) continue;\r\n \r\n if (!parentProto[name]) {\r\n /*\r\n m = methods[name];\r\n if (name == 'init') {\r\n //init method MUST do nothing and just return this\r\n //if no argument provide\r\n this.prototype.init = (function(method) {\r\n return function() {\r\n //if (arguments.length === 0) {\r\n // return this;\r\n //}\r\n return method.apply(this, arguments);\r\n };\r\n })(m);\r\n } else {\r\n //if parent class does not define method with this name\r\n //just added it to prototype(instance method)\r\n this.prototype[name] = m;\r\n }\r\n */\r\n this.prototype[name] = methods[name];\r\n continue;\r\n }\r\n \r\n //if parent already defined a method with the same name\r\n //we need to wrap provided function to make call to\r\n //this.base() possible by replace this.base to\r\n //parent method on the fly\r\n if (name != 'init') {\r\n this.prototype[name] = (function(name, method) {\r\n return function() {\r\n //bakcup existing property named base\r\n var t = this.base,\r\n r;\r\n \r\n //make this.base to parent's method\r\n //so you can call this.base() in your method\r\n this.base = parentProto[name];\r\n \r\n //call the method\r\n /*! you probably wanto step into this method call when you debugging */\r\n r = method.apply(this, arguments);\r\n \r\n //restore base property\r\n if (typeof t != 'undefined') {\r\n this.base = t;\r\n } else {\r\n this.base = null;\r\n delete this.base;\r\n }\r\n return r;\r\n };\r\n }(name, methods[name]));\r\n } else {\r\n this.prototype.init = (function(method) {\r\n return function() {\r\n //if (arguments.length === 0) {\r\n // return this;\r\n //}\r\n var t = this.base,\r\n r;\r\n this.base = parentProto.init;\r\n r = method.apply(this, arguments); //step into...\r\n this.base = t;\r\n return r;\r\n };\r\n })(methods.init);\r\n }\r\n }\r\n return this;\r\n }", "title": "" }, { "docid": "ba5db6cb92e8cf53a6cd8fa91580649a", "score": "0.5222017", "text": "function _registerNewMethodNames (newClass, parentClass, fullClassName) {\r\n var skipnames = [\"config\", \"$parentClass\"];\r\n var proto = newClass.prototype;\n for (var name in proto) {\n if (skipnames.indexOf(name) > -1)\n continue;\n if (proto.hasOwnProperty(name)) {\n var val = proto[name];\n\n if (typeof val == 'function' ) {\n val.$owner = parentClass;\n val.$name = name;\n val.$fullClassName = fullClassName;\r\n }\n } // if\n } // for\r\n }", "title": "" }, { "docid": "79e40c4cb80efbb73a0bb9a90b35f020", "score": "0.52125484", "text": "function wrap(inherits, key, method, publicStatic) {\n return function () {\n if (!hOP.call(this, SUPER)) {\n // define it once in order to use\n // fast assignment every other time\n define(this, SUPER, null, publicStatic);\n }\n var\n previous = this[SUPER],\n current = (this[SUPER] = inherits[key]),\n result = method.apply(this, arguments)\n ;\n this[SUPER] = previous;\n return result;\n };\n }", "title": "" } ]
409dd6ab2b6047e732749bde650fe361
import Cart from "./pages/Cart" import Photos from "./pages/Photos"
[ { "docid": "b0cf6b65dacb8910ebf4bb759c34d8aa", "score": "0.0", "text": "function App() {\n return (\n <div>\n <Switch>\n <Route exact path=\"/\">\n <Login />\n </Route>\n <Route exact path=\"/me\">\n <Header />\n <Me />\n </Route>\n <Route exact path=\"/group\">\n <Header />\n <Group />\n </Route>\n <Route exact path=\"/doctor\">\n <Header />\n <Doctor />\n </Route>\n </Switch>\n </div>\n )\n}", "title": "" } ]
[ { "docid": "173e5e559373bd6bc08a32ffcb333e00", "score": "0.64323497", "text": "function App() {\n return (\n // <Home/>\n // <ProductList />\n // <ProductDetails />\n <Carts />\n );\n}", "title": "" }, { "docid": "3b45b9f59bd6fcb8f7d45257abace0e3", "score": "0.6070919", "text": "_changePage(page) {\n switch (page) {\n case ('dashboard-page'):\n {\n import('./dashboard-page.js');\n break;\n }\n case ('login-page'):\n {\n import('./login-page.js');\n break;\n }\n case ('fund-transfer'):\n {\n import('./fund-transfer.js');\n break;\n }\n }\n }", "title": "" }, { "docid": "6d4ce30358a398f90bd63a14e1b84a24", "score": "0.58962756", "text": "function App() {\n return (\n <Fragment>\n <Navbar></Navbar>\n <Sidebar></Sidebar>\n <SideCart></SideCart>\n <Switch>\n <Route exact path=\"/\" component={HomePage}></Route>\n <Route exact path=\"/about\" component={AboutPage}></Route>\n <Route exact path=\"/cart\" component={CartPage}></Route>\n <Route exact path=\"/contact\" component={ContactPage}></Route>\n <Route exact path=\"/products\" component={ProductPage}></Route>\n <Route exact path=\"/product/:id\" component={SingleProductPage}></Route>\n <Route component={DefaultPage}></Route>\n </Switch>\n <Footer></Footer>\n </Fragment>\n );\n}", "title": "" }, { "docid": "2f841f75e44b8946f0c52058d841d7a4", "score": "0.58807784", "text": "render() {\n return(\n <Page title ='Ink Tank Shopify App'/>\n //PUT REACT COMPONENTS HERE THAT YOU WANT TO BE RENDERED ON THE PAGE \n \n )\n }", "title": "" }, { "docid": "03a82d3a3f4c6c3e2a0ac82b9a7359ef", "score": "0.5792099", "text": "function App() {\n return (\n <div>\n <StockPageHeader></StockPageHeader>\n <StockPageContent></StockPageContent>\n </div> \n );\n}", "title": "" }, { "docid": "d19d65227c166a53784bed795c9be737", "score": "0.5737946", "text": "function App() {\n \n return (\n <div>\n <Navbar />\n <Router>\n <Switch>\n {/* paths fot the pages */}\n <Route path=\"/\" exact >\n <Homebody />\n </Route>\n <Route path=\"/adminpage\" exact>\n <Adminpage />\n </Route>\n <Route path=\"/adminlogin\" exact >\n <Adminlogin />\n </Route>\n <Route path=\"/addproduct\" exact>\n <Addproduct />\n </Route>\n <Route path=\"/editproduct\" exact>\n <EditProduct />\n </Route>\n <Route path=\"/userlogin\" exact>\n <Userlogin />\n </Route>\n <Route path=\"/usersignup\" exact>\n <Usersignup />\n </Route>\n <Route path=\"/userprofile\">\n <Userprofile/>\n </Route>\n <Route path=\"/products\">\n <Productpage/>\n </Route>\n <Route path=\"/singleproduct\">\n <SingleproductPage/>\n </Route>\n <Route path=\"/orders\">\n <Orderpage />\n </Route>\n <Route path=\"/cart\">\n <Cartpage />\n </Route>\n <Route path=\"/checkout\">\n <Checkoutpage />\n </Route>\n <Route path=\"/adminsingle\">\n <Adminsingle />\n </Route>\n </Switch>\n </Router>\n </div>\n );\n}", "title": "" }, { "docid": "cedceaa3612b31002dc97b968b25eeb8", "score": "0.5697597", "text": "function Home() {\n return (\n <div>\n <Slide />\n <Slidepagos />\n </div>\n );\n}", "title": "" }, { "docid": "3a7ac80e9ca548451e3f9bd082ca6848", "score": "0.56920105", "text": "function App() {\n return (\n <div>\n\n\n <DataPage/>\n {/*<GridPractise/>*/}\n </div>\n );\n}", "title": "" }, { "docid": "5184301e0ecfb11a01efd247750aeced", "score": "0.56511086", "text": "function App() {\n return (\n <div className=\"App\">\n <Header />\n <SimpleCart />\n <Categories />\n <ActiveCategory />\n <Products />\n <Footer />\n </div>\n );\n}", "title": "" }, { "docid": "d530214a30995cb5bca4a548f6bb1036", "score": "0.5644562", "text": "function App() {\n return <Home/>\n // return <Payment/>\n}", "title": "" }, { "docid": "8ec834d0315d69856a9da4425547fa71", "score": "0.55733746", "text": "function template() {\n return (\n <div className=\"profile-sell\">\n\t<h1><img src={require(\"./IMG_4259.JPG\")} alt=\"Omar's Profile pic\"/> <br /> <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Omar Q. </h1>\n\t<BrowserRouter>\n <div className=\"container\">\n <ul>\n\t\t<li>Meeting locations:</li>\n <p>Pierson Courtyard</p>\n\t\t<li>&nbsp;</li>\n\t\t<li>Selling:</li>\n\t\t<p><Link to=\"/components/Food/Bread\">Bread</Link>, <Link to=\"/components/Food/Eggs\">Eggs</Link></p>\n\t\t<li>&nbsp;</li> \n\t\t<li>Most sold items:</li>\n\t\t<p>Bread, Spices, Mac & Cheese </p>\n\t\t<li>&nbsp;</li>\n\t\t<li>Favorite recipe:</li>\n\t\t<p>Filet Mignon</p>\n </ul>\n <Switch>\n <Route path=\"/components/Food/Bread\" component={Bread}/>\n <Route path=\"/components/Food/Eggs\" component={Eggs}/>\n </Switch>\n </div>\n </BrowserRouter>\n </div>\n );\n}", "title": "" }, { "docid": "1a3882fb517a7571c57e15ea2c2b52d9", "score": "0.5537743", "text": "function App() {\n return (\n <Router>\n <div className=\"App\">\n <Header />\n <Cart />\n <Route />\n <BackToTop />\n <Footer />\n </div>\n </Router>\n );\n}", "title": "" }, { "docid": "73c89d645344070facbf00b5b56b0156", "score": "0.5531034", "text": "function Home() {\n return (\n <>\n {/* <DogeIndex/> */}\n {/* <DogeIndex/> */}\n {/* <Cards /> */}\n <HeroSection />\n {/* <Pictures /> */}\n {/* <Images /> */}\n \n </>\n );\n}", "title": "" }, { "docid": "a70222906f09272e501fc33995a11541", "score": "0.55305374", "text": "function App() {\n return (\n <>\n <Carouselmain />\n </>\n\n // <>\n // <Blogmain />\n // </>\n\n // <>\n // <Full />\n // </>\n );\n}", "title": "" }, { "docid": "77f146c0e1376822a26d9e0d99bd240d", "score": "0.5507531", "text": "function App() {\n return (\n <Router basename={settingsGH_pages}>\n <div className=\"app\">\n <Switch>\n \n <Route exact path=\"/cart\" component={Cart} />\n\n <Route exact path=\"/\" component={MainScreen} />\n\n <Route component={Page404} />\n\n </Switch>\n \n </div>\n </Router>\n );\n}", "title": "" }, { "docid": "3c66b5afc9d5e3307efde7f1b29f03e7", "score": "0.5504754", "text": "function App() {\n return (\n <div className=\"App\">\n <Router>\n <Main path=\"/product\" />\n {/* <AllProduct path=\"/\" /> \n <Details path=\"/product/:id\" /> */}\n {/* <Card path=\"/\" /> */}\n <Edit path=\"/product/edit/:id\" />\n </Router>\n </div>\n );\n}", "title": "" }, { "docid": "1e4912a15f28c5be447bf82bcf88392d", "score": "0.5487948", "text": "function App(){\n return <div>\n <h4>hey, 美女</h4>\n {/* <img src={goods1} />\n <img src={homeIcon} />\n <img src={require('./assets/home_active.png').default} />\n <img src=\"/goods3.jpg\" /> */}\n <TodoList/>\n </div>\n}", "title": "" }, { "docid": "45e1b8cf50e333d1af23148c4e16a543", "score": "0.5478918", "text": "renderLoggedIn() {\n return (\n <div>\n <ListPage />\n </div>\n )\n }", "title": "" }, { "docid": "84597963227ae95d800cd9d43de731a6", "score": "0.5468264", "text": "component() {\n return import(/* webpackChunkName: \"about\" */ './views/Poland.vue');\n }", "title": "" }, { "docid": "a18379f34e660b623c404ed55f7adc7d", "score": "0.54642767", "text": "function Header({ cart }) {\n return (\n <Container>\n <Link to=\"/\">Loja</Link>\n\n <Cart to=\"/cart\">\n <div>\n <strong>Meu carrinho</strong>\n <span>{cart.length} itens</span>\n </div>\n <MdShoppingBasket size={36} color=\"FFF\" />\n </Cart>\n </Container>\n );\n}", "title": "" }, { "docid": "1e18130a343f1a400983fe97ca4f146f", "score": "0.5450142", "text": "function App() {\n return (\n <BrowserRouter>\n <Layout>\n <Switch>\n <Route exact path=\"/shopping-list\">\n <ShoppingList />\n </Route>\n\n <Route exact path=\"/login\">\n <Login />\n </Route>\n\n <Route exact path=\"/\">\n <HomePage />\n </Route>\n\n <Route exact path=\"/recipes/new-recipe\">\n <NewRecipe />\n </Route>\n\n {/* <Route exact path=\"/recipe/XXXXXXX\">\n <SingleRecipe />\n </Route> */}\n\n <Route exact path=\"/recipes\">\n <RecipesList />\n </Route>\n </Switch>\n </Layout>\n </BrowserRouter>\n );\n}", "title": "" }, { "docid": "0df8d3c38dafd715d9b8e8a1d8b915fa", "score": "0.5447318", "text": "function Index() {\n return (\n <div>\n <Manage_menu />\n <Foot />\n </div>\n );\n}", "title": "" }, { "docid": "7736a2d7631bddb2709df6688b0925d2", "score": "0.5446285", "text": "function Home() {\n\n return (\n\n <div>\n <SearchContainer />\n <LibraryContainer />\n </div>\n\n );\n\n}", "title": "" }, { "docid": "0cab363aaca80c6c880a941e4acab7c5", "score": "0.54459727", "text": "function App() {\n return (\n <div className=\"App\">\n <Router>\n <Route exact path=\"/\" component={Pic} />\n </Router>\n </div>\n );\n}", "title": "" }, { "docid": "6f71531f41451e7a9796f7d79d8ac97c", "score": "0.54296356", "text": "function PagesModule() {\n}", "title": "" }, { "docid": "4f0b24561b2f28bd2652695178ea407d", "score": "0.54244405", "text": "loadPhotoPage() {\n this.props.navigation.navigate(\"Picture\");\n }", "title": "" }, { "docid": "d9b710c9ae6cae177408270c844f81fd", "score": "0.5403922", "text": "function StorePage(props) {\n return (\n <div>\n <br />\n <div className=\"head\">Store page</div>\n <ul id=\"mainColumns\" className=\"flex-container\">\n <div>Shirts</div>\n {listShirt.map((item, i) => {\n return (\n <li key={i} className=\"Store_Card\">\n <div>\n <a className=\"a\" href=\"/cart\">\n {\" \"}\n <StoreCard item={item} logo={props.logo}>\n {/* <Link to=\"/cart\" /> */}\n </StoreCard>\n </a>\n\n <br />\n </div>\n </li>\n );\n })}\n </ul>\n\n <ul id=\"mainColumns\" className=\"flex-container\">\n <div>Hats</div>\n {listHat.map((item, i) => {\n return (\n <li key={i} className=\"Store_Card\">\n <div>\n <a className=\"a\" href=\"/cart\">\n <StoreCard\n item={item}\n logo={props.logo}></StoreCard>\n </a>\n <br />\n </div>\n </li>\n );\n })}\n </ul>\n\n <ul id=\"mainColumns\" className=\"flex-container\">\n <div>Office</div>\n {listOffice.map((item, i) => {\n return (\n <li key={i} className=\"Store_Card\">\n <div>\n <a className=\"a\" href=\"/cart\">\n <StoreCard\n item={item}\n logo={props.logo}></StoreCard>\n </a>\n <br />\n </div>\n </li>\n );\n })}\n </ul>\n\n <ul id=\"mainColumns\" className=\"flex-container\">\n <div>Bottles</div>\n {listBottle.map((item, i) => {\n return (\n <li key={i} className=\"Store_Card\">\n <div>\n <a className=\"a\" href=\"/cart\">\n <StoreCard\n item={item}\n logo={props.logo}></StoreCard>\n </a>\n <br />\n </div>\n </li>\n );\n })}\n </ul>\n <Route path=\"/cart\" component={ShoppingCart}></Route>\n {/* <img src={blackShirt} /> */}\n </div>\n );\n}", "title": "" }, { "docid": "0f2952c04293efcdd4f80d53facc4d9b", "score": "0.53851616", "text": "function App() {\n \n return <Provider store={store}>\n\n <div className=\"App\">\n <MyNavbar/>\n <FilmsGridWrapper/>\n </div>\n </Provider>\n ;\n}", "title": "" }, { "docid": "187ebe01f202f9c282acd890306a6419", "score": "0.5364329", "text": "function Home(props) {\r\n // <img src='' alt='img' className={ styles.iconStyle } />\r\n return (\r\n <div>\r\n <CheckToken />\r\n <Header />\r\n <ListUnits />\r\n\r\n <Link to='/addnew'>\r\n <div className={ styles.boxstyle2 }>\r\n \r\n <p>Add new garden +</p>\r\n </div></Link>\r\n \r\n \r\n </div>\r\n )\r\n}", "title": "" }, { "docid": "0c60e9b36238e33e71a0ccf5ce27841a", "score": "0.53623134", "text": "render() {\n return (\n <div>\n <Router>\n <div className=\"App\">\n <header><Header /></header>\n <Route extact path=\"/portfolio\" component={PortfolioHome} />\n <Route extact path=\"/admin\" component={AdminHome} />\n \n </div>\n </Router>\n </div>\n );\n }", "title": "" }, { "docid": "0a05b33448f6abc5c4e3f528a893b7b7", "score": "0.5361679", "text": "function Useapp() {\r\n return (<Router>\r\n\r\n <Switch>\r\n <Route exact path='/' component={App} />\r\n <Route path='/page2' component={Fetching_Tsx} />\r\n <Route path='/page3' component={Page3} />\r\n \r\n </Switch>\r\n </Router>\r\n \r\n );\r\n}", "title": "" }, { "docid": "8ff7a4ea4eea9f7972ac761c49930ad2", "score": "0.5352309", "text": "function App() {\n return (\n \n <div className=\"App\">\n <Header/>\n <Popular />\n <ServiceHome/>\n {/* <Search/> */}\n {/* <Register/> */}\n {/* <barbershopDetail/> */}\n </div>\n \n );\n}", "title": "" }, { "docid": "700fe242b009a1f986ac4c1783042091", "score": "0.5346391", "text": "function App() {\n return (\n <Router>\n <Header />\n <Books />\n <Switch>\n <Route exact path=\"/\" component={Home} />\n <Route exact path=\"/.pages/Search/\" component={Books} />\n <Route exact path=\"/.pages/Saved/\" component={SavedBooks} />\n </Switch>\n </Router>\n );\n}", "title": "" }, { "docid": "1ff79839a66fbb1c1b4643a01fd02f6f", "score": "0.534451", "text": "function App() {\n return (\n\n <div> \n {/* <Example/> \n\n <NavBar/> \n\n <main role=\"main\" class = \"container\"> \n\n <Counters/> \n\n </main> \n\n <Demo/> \n\n <Counter1/>\n\n <Table/> \n\n <LoginPage/> */}\n \n <Movies/> \n\n </div>\n \n );\n }", "title": "" }, { "docid": "1401f8b4af507e35f4e827dfa394b4f2", "score": "0.53421926", "text": "function App() {\n\treturn (\n\t\t<div>\n\t\t\t<div>\n\t\t\t\t<Header />\n\t\t\t</div>\n\t\t\t<Switch>\n\t\t\t\t<Route path=\"/cart\">\n\t\t\t\t\t<Cart />\n\t\t\t\t</Route>\n\t\t\t\t<Route path=\"/photos\">\n\t\t\t\t\t<Photos />\n\t\t\t\t</Route>\n\t\t\t</Switch>\n\t\t</div>\n\t);\n}", "title": "" }, { "docid": "1a7b3a2eb2c81c8491f4c1f01d78c738", "score": "0.53411204", "text": "function App() {\n return (\n <div className=\"App\">\n <QuestionIndexPage/>\n <QuestionShowPage/>\n </div>\n )\n}", "title": "" }, { "docid": "ec896c0d5cfddf6a6af0743b5adcf035", "score": "0.534026", "text": "function App() {\n return (\n <div className=\"App\">\n <ReduxPage />\n {/* <ReduxHookPage /> */}\n {/* <HooksPage /> */}\n </div>\n );\n}", "title": "" }, { "docid": "94c9303fa06e47c186107c93f14e557e", "score": "0.533047", "text": "function Pages() {\n return (\n <main role=\"application\">\n\n {/* Home */}\n <Match\n pattern=\"/\"\n exactly\n component={Home}\n />\n\n {/* Pagina de About */}\n <Match\n pattern=\"/about\"\n exactly\n component={About}\n />\n\n {/* Error 404 */}\n <Miss component={Error404} />\n </main>\n );\n}", "title": "" }, { "docid": "c883368108c913dbc76d8e8d4c1475e1", "score": "0.53277963", "text": "render() {\n return (\n <div>\n <Navbar />\n <Homepage />\n <WhatWeDo />\n <AboutBusinet />\n <Accordian />\n </div>\n );\n }", "title": "" }, { "docid": "a6139d9bdee1319dbd3bb2c996d6e21b", "score": "0.5295678", "text": "render() {\n return (\n <div className=\"App\">\n <div>\n <Router>\n <Link to=\"/projects\">Current Projects</Link>\n </Router>\n </div>\n <Router>\n <Link to=\"/admin\">Admin Page</Link>\n </Router>\n <div className=\"App-header\">\n <h1>Patrick Zarkha</h1>\n <img src='images/goat_small.jpg' className=\"image\" alt=\"broken\" />\n <Router>\n <div>\n <Route path=\"/projects\" component={ProjectPage} />\n <Route path=\"/admin\" component={AdminPage} />\n </div>\n </Router>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "d70422c4009aa4af7da8f6af7dcf9b64", "score": "0.5280368", "text": "function configurePage() {\n // For a module to properly reloaded, require the module and access the default value.\n // const Index = require('./views/Index').default;\n\n // render(<Index />, document.getElementById('appMountPoint'));\n render(AppRouter, document.getElementById('appMountPoint'));\n}", "title": "" }, { "docid": "cd0f923a5210fa04b8d4b602282ee455", "score": "0.5273738", "text": "function App() {\n return (\n <div className=\"App\">\n <div className=\"container\">\n <h1 className=\"title\">UNSPLASH API</h1>\n <SearchPhoto/>\n </div>\n \n\n </div>\n );\n}", "title": "" }, { "docid": "fb5b21229d35bd7c5d3ecc4e7888a108", "score": "0.5271354", "text": "function App() {\n return (\n <div>\n <Header></Header>\n <BrowserRouter>\n <Switch>\n <Route exact path = \"/\">\n <Products></Products>\n </Route>\n <Route exact path = \"/shop\">\n <Products></Products>\n </Route>\n <Route exact path = \"/Review\">\n <CartReview></CartReview>\n </Route>\n <Route exact path = \"/Inventory\">\n <Products></Products>\n </Route>\n <Route exact path = '/product/:productKey'>\n <ProductDetails></ProductDetails>\n </Route>\n <Route exact path = \"*\">\n <NotFound></NotFound>\n </Route>\n </Switch>\n </BrowserRouter> \n </div>\n // For now we have to put every route in the switch\n );\n}", "title": "" }, { "docid": "451dfcef8fc9b594869068dfb366ee3a", "score": "0.52677697", "text": "function App(){\n //define JSX\n return (\n <div>\n <Header></Header>\n <Content></Content>\n <Footer></Footer>\n\n \n </div>\n\n //to render this app inside the initial index.js you \n //need to export and import\n )\n}", "title": "" }, { "docid": "efd3f1b4c4ef23783500a90c9e668070", "score": "0.52578884", "text": "function App() {\n return (\n <div className=\"App\">\n <Provider store={store}>\n {/* <Information /> */}\n <Router>\n <Navbar/>\n <Switch>\n <Route path='/products'>\n <AllProducts/>\n </Route>\n <Route path='/basket'>\n <Payment/>\n </Route>\n <Route path='/finalPayment'>\n <FinalPayment/>\n </Route>\n <Route path='/'>\n <AllProducts/>\n </Route>\n </Switch>\n </Router>\n \n \n </Provider>\n \n \n </div>\n );\n}", "title": "" }, { "docid": "203dfaedf67625cb59ffff1fd2e55c6c", "score": "0.5255815", "text": "showCardDetail(...args) {\n return renderPage(\n importWithRetry(() =>\n import(\n /* webpackChunkName: \"board-page\" */\n './boardPage'\n ),\n ).then(({ BoardPage }) => BoardPage.showCardDetail.call(this, ...args)),\n );\n }", "title": "" }, { "docid": "09cbb2e78cafdd7b268904bf40149798", "score": "0.52473134", "text": "function Landing() {\r\n return (\r\n <main className=\"page\">\r\n <div className=\"title \">\r\n <h1 className=\"title__principal \">Ana López</h1>\r\n <h2 className=\"title__sub\">Desarrolladora Front-end</h2>\r\n </div>\r\n <Link to=\"/Home\" className=\"box-button\">\r\n {/* <img className=\"project__img\" src={ordenador} alt=\"Landing del proyecto\" /> */}\r\n <button className=\"start-button\">Ver portfolio</button>\r\n </Link >\r\n </main>\r\n );\r\n}", "title": "" }, { "docid": "10a089298cce4133ddf221bf26ecdeb5", "score": "0.5244232", "text": "renderLoggedInPath() {\n return (\n <section className='header-logged-in-profile'>\n <Reviews />\n </section>\n )\n }", "title": "" }, { "docid": "00b921743746091c0fc088fc6a429ed7", "score": "0.5225005", "text": "function MainPage() {\n return (\n <div>\n <Slider />\n <TestimonialsWrapper />\n <DestinationWrapper />\n <ProgramWrapper />\n <HighlightsWrapper />\n <Newsletter />\n <Contact />\n <PartnersWrapper />\n {/* <Footer /> */}\n </div>\n\n );\n}", "title": "" }, { "docid": "fe892db201d072a57001d3f9bc931b4d", "score": "0.5220828", "text": "render() {\n return (\n <>\n <div className=\"App\">\n <header>\n <h1>Let's Watch A Movie</h1>\n </header>\n <nav href=\"\">Genres</nav>\n </div>\n\n\n {/* Page Router */}\n <Router>\n <Route exact path='/' component={Movies} />\n <Route path='/details' component={Details} />\n <Route path='/genres' component ={Genres}/>\n </Router>\n </>\n );\n }", "title": "" }, { "docid": "baff9301b6b39ca539a8d4d5f1b6eba8", "score": "0.5219465", "text": "function Home() {\n return (\n <>\n <LandingPage />\n <ContactPage />\n <Footer />\n </>\n );\n}", "title": "" }, { "docid": "b17ed26a49f878f17acf903466fa1978", "score": "0.5213895", "text": "function App() {\n return (\n <MainTopAlbumsView/>\n );\n}", "title": "" }, { "docid": "5538577b9c917ae71bb0d229392ab292", "score": "0.5205884", "text": "function App() {\r\n\r\n return (\r\n <div className=\"App\">\r\n <Suspense fallback={<></>}>\r\n <ConnectedRouter history={history}>\r\n <Switch>\r\n <Route exact path=\"/\">\r\n <Header />\r\n <ProductCarousel />\r\n <Offers />\r\n <Bigdeals />\r\n <ProductListItem />\r\n <Stylegallery />\r\n {/* <Brands /> */}\r\n <Footer />\r\n </Route>\r\n <Route exact path=\"/cart\" component={MyBag} />\r\n <PrivateRoute exact path=\"/profile\" component={Profile} />\r\n <PrivateRoute exact path=\"/wishlist\" component={WishList} />\r\n <PrivateRoute exact path=\"/orders\" component={Orders} />\r\n <PrivateRoute exact path=\"/address\" component={SavedAddress} />\r\n <PrivateRoute exact path=\"/shipping\" component={ShippingAddress} />\r\n <PrivateRoute exact path=\"/order-details/:id\" component={OrderDetails} />\r\n <PrivateRoute exact path=\"/orderplaced\" component={Orderplaced} />\r\n <Route exact path=\"/payment\" component={Payment} />\r\n <Route exact path=\"/customer/login\" component={Login} />\r\n <Route path='/product/:product_name/:id' component={ProductDetail} />\r\n\r\n <Route exact path=\"/shop/:id\" component={Shop} />\r\n <Route exact path=\"/search/:id\" component={Shop} />\r\n <Route exact path=\"/reset-password/:id\" component={ResetPassword} />\r\n <Route path=\"*\" render={() => <Redirect to='/' />} />\r\n\r\n </Switch>\r\n </ConnectedRouter>\r\n </Suspense>\r\n </div>\r\n );\r\n}", "title": "" }, { "docid": "a7a11e40c26cf3852b693e53b9e6711f", "score": "0.52054477", "text": "function App() {\n return (\n <div className=\"App\">\n this.is app page\n <hr />\n {/* 起步 */}\n {/* <StartPage /> */}\n <hr />\n {/* 组件复合 */}\n {/* <ComponentPage /> */}\n <hr />\n {/* Redux */}\n {/* <ReduxPage /> */}\n {/* Context */}\n <ContextPage />\n <hr />\n {/* PureComponent */}\n {/* <PurePage /> */}\n <hr />\n {/* Router */}\n {/* <RouterPage /> */}\n <hr />\n {/* useMemo */}\n {/* <UseMemoPage /> */}\n {/* <TestPage /> */}\n </div>\n )\n}", "title": "" }, { "docid": "fd04dd1794c854d688c8b3462e189afa", "score": "0.5205186", "text": "function App() {\n return (\n <>\n <MainNavBar />\n <Switch>\n <Route path='/' exact>\n <MainPage />\n </Route>\n <Route path='/archvie'>\n <ArchivePage />\n </Route>\n <Route path='/recipe'>\n <RecipePage />\n </Route>\n <Route path='/user'>\n <UserPage />\n </Route>\n </Switch>\n </>\n );\n}", "title": "" }, { "docid": "4f539efa007c4f0f350f0a7fddaf5d6d", "score": "0.5194651", "text": "function AlbumsPage(props) {\n\n return (\n <ContentPage \n what=\"albums\"\n selection={initial_selection} \n compare={compareAlbums}\n searchSpotify={searchSpotifyAlbums}\n searchLastFm={searchLastFmAlbums}\n clearSpotify={clearSpotifyAlbums}\n importSpotify={importSpotifyAlbums}\n getSpotify={getSpotifyAlbums}\n getLastFm={getLastFmAlbums} />\n )\n}", "title": "" }, { "docid": "08b93e9c4c35846f4d0d00fc048c955c", "score": "0.5175392", "text": "function App() {\n return (\n\n <BrowserRouter>\n <Switch>\n <Route exact path=\"/\">\n <Page />\n </Route>\n \n \n </Switch>\n </BrowserRouter>\n\n );\n}", "title": "" }, { "docid": "fc3ef04c9a469853fedc39b8b7de80c3", "score": "0.5169739", "text": "function App() {\n return (\n <Router>\n <Navbar />\n \n <div className=\"container\">\n <br/>\n <Route path=\"/addfiles\" exact component={addFiles} />\n <Route path=\"/\" exact component={searchFiles} />\n <Route path = \"/advancesearch\" exact component={Author} />\n <Route path = \"/savedsearches\" exact component={Saved} />\n <Route path = \"/savesearch\" exact component={Save} />\n <Route path = \"/fileupload\" exact component={FileUpload} />\n </div>\n <Footer />\n\n </Router>\n );\n}", "title": "" }, { "docid": "fc5de2876accde7cc6a5f19382a54084", "score": "0.5165837", "text": "function Home() {\n return (\n <div className=\"home-div\">\n <h1>Home Page</h1>\n <Grid container spacing={5} align=\"center\">\n <Grid item sm={6}>\n <Card img={bagimg} title=\"Tote Bags\" description=\"Product Description Product Description Product Description Product Description Product Description Product Description\"/>\n </Grid>\n <Grid item sm={6}>\n <Card img={stickerimg} title=\"Stickers\" description=\"Product Description Product Description Product Description Product Description Product Description Product Description\"/>\n </Grid>\n <Grid item sm={6}>\n <Card img={doormatimg} title=\"Door Mats\" description=\"Product Description Product Description Product Description Product Description Product Description Product Description\"/>\n </Grid>\n \n </Grid>\n \n </div>\n )\n}", "title": "" }, { "docid": "5cb26c0e449b77801be321ca7a3f6ec2", "score": "0.5157579", "text": "function App() {\n return (\n <Layout>\n <Switch>\n <Route path='/' exact={true}>\n <HomePage />\n </Route>\n <Route path='/catalog'>\n <CatalogPage/>\n </Route>\n <Route path='/resources'>\n <Resources/>\n </Route>\n <Route path='/about'>\n <AboutPage/>\n </Route>\n <Route path='/contact'>\n <ContactPage/>\n </Route>\n <Route path='/addtocatalog' exact>\n <AddToCatalogPage/>\n </Route>\n </Switch>\n </Layout>\n )\n}", "title": "" }, { "docid": "c34e442c7d5bfa5e9ea6bb4ef0342a04", "score": "0.5153354", "text": "function App() {\n return (\n <Router>\n <Switch>\n <Route exact path='/accueil' render={(props) => <MainPage {...props} toPage='accueil' />} />\n <Route exact path='/discographie' render={(props) => <Discographie {...props} toPage='discographie'/>} />\n {/* <Route exact path='/disco2' render={(props) => <Disco2 {...props} toPage='discographie'/>} /> */}\n <Route exact path='/concerts' render={(props) => <ConcertsPage {...props} toPage='concerts'/>}/>\n <Route exact path='/actualites' render={(props) => <ActualitesPage {...props} toPage='actualites'/>}/>\n <Route exact path='/apropos' render={(props) => <Apropos {...props} toPage='apropos'/>}/>\n <Route exact path='/' render={(props) => (<MainPage {...props} toPage='accueil'/>)}/>\n <Route exact path='/404' render={(props) => <NotFoundPage {...props} />}/>\n <Redirect to='/404'/>\n </Switch>\n </Router>\n );\n}", "title": "" }, { "docid": "dfd338bcf8e6d88cc81df656f3fe3353", "score": "0.51519084", "text": "function App() {\n return (\n <div className=\"App\">\n <Homepage />\n {/* <LoginPage /> */}\n </div>\n );\n}", "title": "" }, { "docid": "ccca40edb2c0c5907d178d8af4f3c11f", "score": "0.5145897", "text": "function App() {\n\treturn (\n\t\t<div className=\"App\">\n\t\t\t<LandingPage />\n\t\t\t{/* <PartList /> */}\n\t\t</div>\n\t)\n}", "title": "" }, { "docid": "488b6a133847c90ec59dbf8cb04558b2", "score": "0.5141706", "text": "function App() {\n \n return (\n\n <>\n\n\n<header>\n <Header></Header>\n</header>\n\n \n \n\n<main>\n\n\n <Switch>\n <Route exact path=\"/\" component={ProductCard} />\n <Route path=\"/signin\" component={Signin} />\n <Route path=\"/register\" component={RegisterScreen} />\n <Route path=\"/orders\" component={Orders} />\n <Route path=\"/product/:id\" component={ProductScreen} />\n <Route path=\"/cart/:id?\" component={CartScreen} />\n <Route path=\"/shipping\" component={ShippingAddressScreen} />\n <Route path=\"/payment\" component={PaymentMethodScreen} />\n <Route path=\"/placeorder\" component={PlaceOrderScreen} />\n <Route path=\"/order/:id\" component={OrderScreen} />\n <Route path=\"/orderhistory\" component={OrderHistoryScreen} />\n <PrivateRoute path=\"/profile\" component={ProfileScreen} />\n \n </Switch>\n </main>\n \n <div className=\"footer\">\n \n <div className=\"ft\">\n Conditions of Use & Sale | Privacy Notice | Copyright &copy; 2020 , @monTron | All right reserved\n <hr id=\"hr\"/>\n <div>Made with <i class=\"fa fa-heart\"/> by Snehta</div>\n </div>\n \n </div>\n \n \n </>\n\n );\n}", "title": "" }, { "docid": "cbec3280cc17e52cadd0830b24e8fa20", "score": "0.51416403", "text": "function gallery() {\n return (\n <section>\n <h1 style={{ fontSize: \"50px\", paddingTop: \"100px\" }}>Gallery page</h1>\n </section>\n );\n}", "title": "" }, { "docid": "2312c02aa0411e92aafcd7073332e1dd", "score": "0.5137806", "text": "function Home() {\n return (\n <div>\n <App3 />\n </div>\n );\n}", "title": "" }, { "docid": "0d21ec110a80560d95d6b590c156b3bc", "score": "0.51270705", "text": "function App() {\n return (\n <div>\n {/* <Click /> */}\n {/* <PageOne /> */}\n {/* <SignsToogle /> */}\n <Methods />\n </div>\n );\n}", "title": "" }, { "docid": "c480e82e3b97285db812937cffec409d", "score": "0.5121387", "text": "function DeveloperPage() {\n\n // Объект запроса в URL\n // let query = useQuery()\n\n\n // Раздел с работой\n // let portfolioWork = <ToolsSection />\n // let portfolioWork = <p>Work</p>\n\n /*switch (query.get(\"work\")) {\n case 'tools': portfolioWork = <ToolsSection />; break;\n case 'experience': portfolioWork = <ExperienceSection />; break;\n case 'kflex':\n case 'friko':\n case 'volcano':\n case 'rusheat':\n case 'teplomash': portfolioWork = <WorkSection type={query.get(\"work\")} page='developer' />; break;\n case 'readings': portfolioWork = <WorkSection type={query.get(\"work\")} page='developer' />; break;\n case 'table': portfolioWork = <WorkSection type={query.get(\"work\")} page='developer' />; break;\n case 'todo': portfolioWork = <WorkSection type={query.get(\"work\")} page='developer' />; break;\n case 'another': portfolioWork = <AnotherWorksSection />; break;\n }*/\n\n /*return (\n <>\n <AboutIntro pageType='develop' />\n\n <AboutDetails pageType='develop' />\n <PortfolioGrid>\n <PortfolioMenu pageType='develop' />\n {portfolioWork}\n </PortfolioGrid>\n </>\n )*/\n}", "title": "" }, { "docid": "6d860551f0590089e192f69b2cc496a3", "score": "0.5119756", "text": "function App() {\n return (\n <Router>\n <Switch>\n <Route exact path='/' component={Home} />\n <Route exact path='/login' component={SigninPage} /> \n </Switch>\n </Router>\n \n );\n}", "title": "" }, { "docid": "30947bbbff5f3c87ad067bf94dfd7ebd", "score": "0.51187074", "text": "function HomePage() {\n return (\n <>\n <h1>I am in a home page</h1>\n </>\n );\n }", "title": "" }, { "docid": "c486fdabd6265debed46fa9febac64b8", "score": "0.5118601", "text": "function Header() {\n\n let head = 'Header2';\n\n return (\n <div className=\"header-bg\">\n <img src={require(`../images/${head}.jpg`)} alt=\"limes\"/>\n </div>);\n}", "title": "" }, { "docid": "543746e69573867579fd95e532f04051", "score": "0.51162946", "text": "render(){\n return(\n <div className=\"PageOneMainDiv\">\n <h1>Page One</h1>\n </div>\n )\n }", "title": "" }, { "docid": "11854f67a46a8116ac1f611463fa0dd4", "score": "0.51161265", "text": "function loadPage() {\n loadCart();\n loadTotal();\n }", "title": "" }, { "docid": "9f18e2513804dc1e850e4f8c167bfebd", "score": "0.5112893", "text": "function loadComponent(page) {\n // '@' is aliased to src/pages\n return () => import(`pages/${page}.vue`);\n}", "title": "" }, { "docid": "dc0c746cf20e38390ee08f5d2e1dc184", "score": "0.5109064", "text": "function goToCart() {\n window.location.href = \"cart.html\";\n }", "title": "" }, { "docid": "d5a5f686b0bc81582d99511c2a42841a", "score": "0.51048666", "text": "function DefaultPage (props) {\n return(\n <div>\n <h3>\n Default Nested Page\n </h3>\n </div>\n )\n}", "title": "" }, { "docid": "d2c2d834f249a74e551e329e6b312482", "score": "0.50994164", "text": "function AdminPage() {\n return(\n <div className=\"AdminPage\">\n <h1>Admin Page</h1>\n </div>\n )\n}", "title": "" }, { "docid": "c611836dabd0bfc0c0866aae2937a5ce", "score": "0.50973994", "text": "componentDidMount() {\n // ! use url to load sketch files\n // let url = window.location.href\n // let slash_index = url.lastIndexOf(\"/\");\n // let fileName = url.slice(slash_index + 1);\n // console.log(fileName)\n // import Sketch from (\"components/Sketches/\" + fileName);\n }", "title": "" }, { "docid": "622ad991ad2d5e5d4d22651448d6a97e", "score": "0.50943214", "text": "function LoginPage() {\n \n return (\n <Container>\n <h1>Welcome to Stock Exchange!</h1>\n <Login />\n <a href=\"./user\">\n <button >Test </button></a>\n </Container>\n\n );\n}", "title": "" }, { "docid": "eaa8f7514f8e0af70d8dd88349d5a33c", "score": "0.50934136", "text": "function App() {\n return (\n <div className='App'>\n <Navbar/>\n <Message/>\n {/* <FileUpload/> */}\n </div>\n );\n}", "title": "" }, { "docid": "dd508dc34c3af5f90a6aa1d75c08bfcf", "score": "0.50910753", "text": "function Home() {\n return <>\n <Hero />\n <About />\n <HowItWorks />\n <Products />\n {/* <Contact /> */}\n </>\n}", "title": "" }, { "docid": "693a9c0c4116f75f950a61bb3cd520b8", "score": "0.50891435", "text": "function App() {\n return (\n <div className='app'>\n {/* React Browser Router */}\n <Router>\n <div>\n {/* i separated Link router components (in Header.js < HeaderNav.js < Navbar.js)\n from Switch and Route router component (in PageSwitcher.js) */}\n <Header />\n <PageSwitcher />\n </div>\n </Router>\n <Footer />\n </div>\n )\n}", "title": "" }, { "docid": "59af3b3aa9bb0387dcc02e5e76475776", "score": "0.5088611", "text": "render() {\n return(\n\n <h1>this is the Base for all pages</h1>\n )\n }", "title": "" }, { "docid": "80d7fea9f864e225caf3a612ad87d9c1", "score": "0.5073323", "text": "function initPage() {\n getProducts();\n showBasket();\n}", "title": "" }, { "docid": "b05440b34c93143543229d2dcc28d1e3", "score": "0.5068584", "text": "function loadCart() {\n cart = JSON.parse(localStorage.getItem('shopping-cart')) || [];\n promo = JSON.parse(localStorage.getItem('promo')) || {};\n}", "title": "" }, { "docid": "f75d47be8a67e24a931c8874092541b5", "score": "0.50679153", "text": "render() {\n return (\n <div>\n <Nav />\n <div className=\"container\">\n\n <Route exact path=\"/\" render={()=>(\n <div>\n <Home />\n </div>\n )}/>\n\n <Route exact path=\"/portfolio\" render={()=>(\n <div>\n <Portfolio />\n </div>\n )}/>\n\n <Route exact path=\"/contact\" render={()=>(\n <div>\n <Contact />\n </div>\n )}/>\n\n </div>\n <Footer />\n </div>\n );\n }", "title": "" }, { "docid": "2e2541b47ede5990ac5925e94f1aaccd", "score": "0.5065622", "text": "function App() {\n return (\n <>\n <Dashboard/>\n {/* <SignUp/> */}\n {/* <SignIn/> */}\n </>\n );\n}", "title": "" }, { "docid": "d9076b4bb4515f04373564839ad4dbea", "score": "0.50628334", "text": "function App() {\n return (\n <div className=\"App\">\n \n <AddUsers/>\n <ShowAllUsers/>\n{/* <AddCash/> */}\n </div>\n );\n}", "title": "" }, { "docid": "ba19bc74b2036b3ab7cdf9c12f56d825", "score": "0.5062788", "text": "function App() {\n return (\n <div className={styles.App}>\n <Navbar />\n <Splash />\n <About />\n <Portfolio />\n <Experience />\n <Footer />\n </div>\n );\n}", "title": "" }, { "docid": "396a0fbef67b78ece854aa543184fbc8", "score": "0.50603795", "text": "function App() {\n return (\n <Browser>\n <Switch>\n <Route exact path='/' component={Home}/>\n <Route exact path='/contact' component={Contact}/>\n <Route exact path='/about' component={About}/>\n <Navigation/>\n <Mycarousal/>\n \n </Switch>\n </Browser>\n );\n}", "title": "" }, { "docid": "15abec9e70edf6985bc20f5be69f5988", "score": "0.5049963", "text": "function App() {\n return (\n <Box p={2}>\n <Grid className=\"App\" container spacing={3}>\n <Grid item sm>\n <Shop />\n </Grid>\n <Divider orientation=\"vertical\" flexItem />\n <Grid item sm>\n <Cart />\n </Grid>\n </Grid>\n </Box>\n );\n}", "title": "" }, { "docid": "6289a388906d6dbdbe429f54a1cc46f9", "score": "0.50487906", "text": "index(req, res) {\n res.render(\"customer/cart\");\n }", "title": "" }, { "docid": "448be62b585bf69df3780911724a2a0a", "score": "0.5047415", "text": "function App() {\n\n \n\n return (\n <Router >\n <Switch>\n <Route path=\"/\" exact>\n <LoginPage />\n </Route>\n <Route path=\"/register\" exact>\n <RegisterPage />\n </Route>\n <Route path=\"/contacts/:id\" exact>\n <ContactsPage />\n </Route>\n <Redirect to=\"/\" />\n </Switch>\n </Router>\n );\n}", "title": "" }, { "docid": "f50784373086b0d77ebac8eb5c7ca253", "score": "0.50454795", "text": "function App() {\n return (\n <div className=\"App\">\n \n <BrowserRouter>\n <Header />\n <Switch>\n <Route exact path='/' component={HomePage} />\n <Route path='/shop' component={ShopPage} />\n <Route path=\"/sign-in\" component={SignInAndSignUpPage}/>\n </Switch>\n {/* <BrowserRouter>\n <Route exact path=\"/\" component = {Homepage}/>\n <Route path=\"/hats\" component = {Hats}/>\n <Route path=\"/jackets\" component={Jackets}/>\n <Route path=\"/sneakers\" component = {Sneakers}/>\n <Route path=\"/womens\" component={Womens}/>\n <Route path=\"/mens\" component = {Mens}/>\n\n </BrowserRouter> */}\n </BrowserRouter>\n </div>\n );\n}", "title": "" }, { "docid": "708af95c64542089280254b525ec8731", "score": "0.504514", "text": "function App() {\n return (\n <div className=\"App\">\n <Switch>\n <Route path='/my-cart' component={Cart} />\n <Route path='/checkout' component={Checkout} />\n <Route path='/item/:id' component={Item} />\n <Route path='/my-items' component={SellingItem} />\n <Route path='/order-summary/:orderID' component={Summary} />\n <Route path=\"/\" component={Home} /> \n <Route path=\"/test\" component={Test} /> \n </Switch> \n </div>\n );\n}", "title": "" }, { "docid": "ba5e3e0da2baa208ea4df27a2568cfbc", "score": "0.504071", "text": "function App() {\n \n return (\n <div className=\"App\">\n <header>\n <h1>Images</h1>\n </header>\n <div>\n <img src={item} alt=\"Logo\" />\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "31eaa51721637c19a11be892a07e3a2d", "score": "0.5039997", "text": "render() {\n return (\n <div>\n <Head>\n <script type=\"text/javascript\" src=\"/static/LandingPage.js\"></script>\n </Head>\n \n <LandingPage />\n </div>\n );\n }", "title": "" }, { "docid": "5d55ef764c9a708cdd2b8944e1127d14", "score": "0.5037047", "text": "function loadComponents() {\n const components = require.context('../src', true, /.stories.js$/)\n components.keys().forEach(filename => components(filename))\n}", "title": "" }, { "docid": "89a3a3386c8c81ac031c7475810035ee", "score": "0.50337595", "text": "function App() {\n return (\n <React.Fragment>\n < Header />\n <BannerSection />\n <ContentSection />\n <Services />\n < Projects />\n <Testimonials />\n < Footer />\n \n </React.Fragment>\n );\n}", "title": "" }, { "docid": "0b721efe45c477e1a22ff5983b12cb1e", "score": "0.50318676", "text": "function Projects() {\n return (\n <div>\n <Dropdowns />\n {/* <Carousel /> */}\n </div>\n )\n}", "title": "" }, { "docid": "eeb1feb2c713853a9171d5f97cc72567", "score": "0.5031237", "text": "function ReviewsPage() {\n return (\n <div>\n <AddReview />\n <Reviews />\n </div>\n );\n}", "title": "" } ]
68b463151c4d1d2af24d23effb67e920
End Helper Functions Begin Main Functions
[ { "docid": "dcda0066646eba439017685efb15302a", "score": "0.0", "text": "function textSection1() {\r\n const t = `The full name is ${messi.fullName} an ${messi.nationality} ${messi.positions} soccer player. He was born in ${messi.dateOfBirth} as the third child of 4. His father Jorge Messi was a steel factory manager and his mother was working in a magnet manufacturing workshop.\r\n His career started with ${messi.youthClubs[0]} in the duration ${messi.youthClubsDurations[0]} then moved to ${messi.youthClubs[0]} starting from ${messi.youthClubsDurations[1]}.\r\n If we dug up a little further through Lionel's personality, we will find that is calm and concentrating in the field. Not only just in the field, but also outside of the football field, which means he cares so much about the style of management of the club he plays for.\r\n Until this very moment, ${messi.fullName} still plays for ${messi.youthClubs[1]}. However, his future with the club is a mystery in the moment due to the instabilty of the club's management.`;\r\n //Text to be added to section 1\r\n addTextToSection(t,0); \r\n}//This function is used to add the data of the first section about the player from the js file to the html file.", "title": "" } ]
[ { "docid": "7dc00daa25e4a2bf54bb6406181b507b", "score": "0.64103127", "text": "function _main() {\n try {\n // the modules own main routine\n //_logCalls();\n\n // enable a global accessability from window\n window.tools = {} || window.tools;\n window.tools._log = _log;\n window.tools._addNavigation = _addNavigation;\n } catch (error) {\n console.log(error);\n }\n\n }", "title": "" }, { "docid": "c8eb13277c443e55ecfbdc4d32776610", "score": "0.64050126", "text": "function Main()\n {\n \n }", "title": "" }, { "docid": "befdecdf4a7bf48d9420b7d26c55916d", "score": "0.63246423", "text": "function _____SHARED_functions_____(){}", "title": "" }, { "docid": "2689f54f42c42c3bc83e44d2bf7653db", "score": "0.62806064", "text": "function Helper() {}", "title": "" }, { "docid": "91266f84eac23f0e8ea2a971ccc6aee2", "score": "0.6222327", "text": "function main(){\n\n\n}", "title": "" }, { "docid": "26f76ccfd01f639adc0ed12b027dcfd6", "score": "0.6193371", "text": "function Utils(){}", "title": "" }, { "docid": "e7f12cd925e40ff66d9b38a1c988d604", "score": "0.6191904", "text": "function main(){\n\t\t//check ob die url/seite die richtige ist\n//\t\tif(checkRightLocation()) {\n\n\t\tcleanPage();\n\t\taddFavoriteTitle();\n\t\taddEmptyTable();\n\t\taddHeader();\n\t\tvar favoritesCall = Utils.getFavorites(addFavorites);\t\t\t\n\t\t\t\t\t\t\n\t//\t} else {\n\t//\t\talert(wrongPageErrorMessage);\n\t//\t}\n\t}", "title": "" }, { "docid": "ceb3ab2a13a15b84371e068984913a68", "score": "0.60672826", "text": "function Utils() {}", "title": "" }, { "docid": "ceb3ab2a13a15b84371e068984913a68", "score": "0.60672826", "text": "function Utils() {}", "title": "" }, { "docid": "ac3e3213acd821fe4fc17810dc378f35", "score": "0.604277", "text": "function main(){\n\t\n}", "title": "" }, { "docid": "07ba8c9d0c5f307293185c830355a3e6", "score": "0.60072565", "text": "function MainScript() {\n debug('');\n audit('MainScript', '======START======');\n // processFile( // UNIQUE INSTITUTION\n // './ABAI_RAW/UNIQUE.csv',\n // 'A Spicy Boy', parseUniqueInstitution, UNIQUE_INSTITUTIONS\n // );\n processFile( // INSTITUTION\n './ABAI_RAW/unique.csv',//abaiBatchRecord[ 'custrecord_institue_fileid' ),\n ABAI_TABLES.INSTITUTION, parseInstitution, ABAI_INSTITUTION,\n );\n // debug(JSON.stringify(ABAI_INSTITUTION));\n file.writeFileSync('./RC_RAW/' + 'fuckthisgarbage' + '.json', JSON.stringify(ABAI_INSTITUTION) );\n processFile( // DEPARTMENT ID\n './ABAI_RAW/NetSuiteInstitution-Department.csv',//abaiBatchRecord[ 'custrecord_institue_fileid' ),\n 'depo', parseDepo, ABAI_DEPARTMENT,\n );\n // debug(JSON.stringify(ABAI_INSTITUTION));\n file.writeFileSync('./RC_RAW/' + 'fuckthisgarbageDepartment' + '.json', JSON.stringify(ABAI_DEPARTMENT) );\n // debug('Matched: ' + matchedInstitutions + ' : ' + unMatchedInstitutions)\n processFile( // INSTITUTION ADDRESS\n './ABAI_RAW/institution_address.csv',//abaiBatchRecord['custrecord_institueaddr_fileid'),\n ABAI_TABLES.INSTITUTION_ADDRESS, parseInstitutionAddress, ABAI_INSTITUTION_ADDRESS\n );\n file.writeFileSync('./RC_RAW/' + 'garbageIA' + '.json', JSON.stringify(ABAI_INSTITUTION_ADDRESS) );\n processFile( // COORDINATOR\n './ABAI_RAW/coordinator.csv',//abaiBatchRecord['custrecord_coordinaor_fileid'),\n ABAI_TABLES.COORDINATOR, parseCoordinator, ABAI_COORDINATOR\n );\n file.writeFileSync('./RC_RAW/' + 'garbagecoord' + '.json', JSON.stringify(ABAI_COORDINATOR) );\n processFile( // COURSE SEQUENCE\n './ABAI_RAW/course_sequence.csv',//abaiBatchRecord['custrecord_coursesseq_fileid'),\n ABAI_TABLES.COURSE_SEQUENCE, parseCourseSequence, ABAI_COURSE_SEQUENCE\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCS' + '.json', JSON.stringify(ABAI_COURSE_SEQUENCE) );\n processFile( // COURSE\n './ABAI_RAW/course.csv',//abaiBatchRecord['custrecord_course_fileid'),\n ABAI_TABLES.COURSE, parseCourse, ABAI_COURSE\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCourse' + '.json', JSON.stringify(ABAI_COURSE) );\n processFile( // AP WAIVER\n './ABAI_RAW/ap_waiver.csv', //abaiBatchRecord['custrecord_apwaiver_fileid'),\n ABAI_TABLES.APWAIVER, parseApWaiver, ABAI_AP_WAIVER\n );\n file.writeFileSync('./RC_RAW/' + 'garbageWaiver' + '.json', JSON.stringify(ABAI_AP_WAIVER) );\n processFile( // INSTRUCTOR GROUP\n './ABAI_RAW/instructor_group.csv',//abaiBatchRecord['custrecord_instructorgrp_fileid'),\n ABAI_TABLES.INSTRUCTOR_GROUP, parseInstructor, ABAI_INSTRUCTOR\n );\n processFile( // COURSE SEQUENCE ASSIGNMENT\n './ABAI_RAW/course_sequence_course_assignment.csv',//abaiBatchRecord['custrecord_courseseq_crsass_fileid'),\n ABAI_TABLES.COURSE_ASSIGNEMNT, parseAssignment, ABAI_ASSIGNMENT\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCSA' + '.json', JSON.stringify(ABAI_ASSIGNMENT) );\n file.writeFileSync('./RC_RAW/' + 'garbageCSA2' + '.json', JSON.stringify(ABAI_XREF.CourseToCourseSequence) );\n processFile( // ALT COURSE ID\n './ABAI_RAW/alternative_courseID.csv', //abaiBatchRecord['custrecord_alt_courseid_fileid'),\n ABAI_TABLES.ALT_COURSE_ID, parseAltCourseId, ABAI_ALT_ID\n );\n file.writeFileSync('./RC_RAW/' + 'altCourse' + '.json', JSON.stringify(ABAI_ALT_ID) );\n processFile( // CONTENT HOURS\n './ABAI_RAW/content_hours.csv',//abaiBatchRecord['custrecord_cont_hours_fileid'),\n ABAI_TABLES.CONTENT_HOURS, parseContentHours, ABAI_CONTENT_HOURS\n );\n file.writeFileSync('./RC_RAW/' + 'CHGarbage' + '.json', JSON.stringify(ABAI_CONTENT_HOURS) );\n processFile( // ALLOCATION HOURS\n './ABAI_RAW/content_area_hours_allocation.csv', //abaiBatchRecord['custrecord_cont_hsallocat_fileid'),\n ABAI_TABLES.ALLOCATION, parseAllocation, ABAI_ALLOCATION_HOURS\n );\n file.writeFileSync('./RC_RAW/' + 'garbageAllocation' + '.json', JSON.stringify(ABAI_ALLOCATION_HOURS) );\n audit('MainScript', 'FILE LOAD COMPLETE');\n file.writeFileSync('./RC_RAW/' + 'xref_sequence' + '.json', JSON.stringify(ABAI_XREF.CourseToCourseSequence));\n\n\n audit('MainScript', '=======END=======');\n}", "title": "" }, { "docid": "2b20716b78e14b9050bfccc79260f998", "score": "0.59690505", "text": "function Main() {\n console.log(`%c Main Function`, \"color: grey; font-size: 14px; font-weight: bold;\");\n buildInterface();\n interfaceLogic();\n }", "title": "" }, { "docid": "d344324003d4f7a8fdad3ae3bc458fcb", "score": "0.5965207", "text": "function AeUtil() {}", "title": "" }, { "docid": "6fc65c51b79d978cc25856357295bfee", "score": "0.59408885", "text": "function mainFunc() {\n\n\tif (debug) GM_log('entering MainFunc. getEquip:'+GM_getValue('getEquip',false)+' collectSlotInfo:'+GM_getValue('collectSlotInfo','potato')+' collectStripInfo:'+GM_getValue('collectStripInfo',false)+' stripping:'+GM_getValue('stripping',false)+' dressing:'+GM_getValue('dressing', false));\n\tif (GM_getValue('collectSlotInfo',false) ){\n\t\tif (debug)GM_log('collecting slot info');\n\t\tgoToInfo(equipSlot,noEquipSlot);\n\t}\n\telse if (GM_getValue('getEquip',false) ){\n\t\tif (debug)GM_log('collecting equip info');\n\t\tgoToInfo(collectEquipInfo,noEquipInfo);\n\t}\n\t// if we're going to strip, collect info.\n\telse if (GM_getValue('collectStripInfo',false)) {\n\t\tif (debug)GM_log('collecting strip info');\n\t\tgoToInfo(collectStripInfo,noEquipStrip);\n\t}\n\t// if we're stripping, get naked.\n\telse if (GM_getValue('stripping',false)) {\n\t\tif (debug)GM_log('stripping');\n\t\tstrip();\n\t}\n\t// if we're getting dressed then dress!\n\telse if (GM_getValue('dressing', false)) {\n\t\tif (debug)GM_log('dressing');\n\t\tdress();\n\t}\n\t// if we're not here for any reason, then we might have just ended stripping/dressing or something. Once more for paranoia!\n\telse {\n\t\tcancelBox();\n\t}\n\t\n}", "title": "" }, { "docid": "08eeacde59206108369fd7b8716d90b0", "score": "0.592192", "text": "function main() {\n\t\t\thtmlModule = new htmlUtil(); // View creation / HTML logic\n\t\t\tarrModule = new arrMethods(); // Array Method shortcuts\n\t\t\tmsg = htmlModule.msg; // Logging\n\t\t\tmsg.set(\"Starting Module\");\n\n\t\t\t// Setup Form.\n\t\t\ttempForm();\n\t\t}", "title": "" }, { "docid": "ba306679924767c37b03cfdb5a4054a2", "score": "0.5919264", "text": "function main(){\n//CODE//\n}", "title": "" }, { "docid": "953feb16936923d752a55762e7370ba7", "score": "0.5888808", "text": "function main(){\r\n}", "title": "" }, { "docid": "94148ddab6844950bbc231991dc195c3", "score": "0.5876029", "text": "function main() {\n addHeadings();\n styleTutorialsAndArticles();\n separateAllTutorials();\n}", "title": "" }, { "docid": "2301a28a638379b2b40ab201571c3aef", "score": "0.58739823", "text": "function main() {\r\n initFlags();\r\n fixMarkup();\r\n changeLayout();\r\n initConfiguration();\r\n}", "title": "" }, { "docid": "dbb757b7e59046ce4a7f2378fbc54453", "score": "0.5867048", "text": "mainLogic() {\n this.apexParser = new ApexParser(this.accessModifiers,this.sourceDirectory);\n const filesArray = this.getClassFilesFromPackageDirectories();\n\n //Create a new array of ClassModels\n const classModels = this.getClassModelsFromFiles(filesArray);\n const mapGroupNameToClassGroup = this.createMapGroupNameToClassGroup(classModels, this.sourceDirectory);\n\n const projectDetail = this.fm.parseHTMLFile(this.bannerFilePath);\n const homeContents = this.fm.parseHTMLFile(this.homefilepath);\n this.fm.createDoc(mapGroupNameToClassGroup, classModels, projectDetail, homeContents, this.hostedSourceUrl);\n console.log('ApexDoc has completed!');\n }", "title": "" }, { "docid": "173943efbd24a624d8edf96d82d48ec5", "score": "0.5835535", "text": "function helper() {\n console.log(\"helper in helper-slcsp.js\");\n}", "title": "" }, { "docid": "0a3946053c61ac379fc1dc66adb075c3", "score": "0.5766149", "text": "function Util() {}", "title": "" }, { "docid": "4f3cafc6b0d3e7be81e0158c38214b3d", "score": "0.5740909", "text": "function main() {\n landingPageEffects();\n introSlideShow();\n}", "title": "" }, { "docid": "f22321c3eea2a8059e273003cc99a789", "score": "0.5738373", "text": "function helper() {\n debug(\"helper in helper-slcsp.js\");\n}", "title": "" }, { "docid": "6838d901887d7221e48b4c7e801d8a05", "score": "0.57357645", "text": "function Start() {\n console.log(\n \"%cChecking the functions...\",\n \"background: green; color: white; font-size: 14px;\"\n );\n\n let success = addTextToIntro();\n if (success) {\n console.log(\n \"%cSuccessfully added paragraphs to Intro\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Intro does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success1 = addTextToFolegandros();\n if (success1) {\n console.log(\n \"%cSuccessfully added paragraphs to Folegandros\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Folegandros does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success2 = addTextToAlonissos();\n if (success2) {\n console.log(\n \"%cSuccessfully added paragraphs to Alonissos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Alonissos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success3 = addTextToSpetses();\n if (success3) {\n console.log(\n \"%cSuccessfully added paragraphs to Spetses\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Spetses does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success4 = addTextToAmorgos();\n if (success4) {\n console.log(\n \"%cSuccessfully added paragraphs to Amorgos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Amorgos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success5 = addTextToSyros();\n if (success5) {\n console.log(\n \"%cSuccessfully added paragraphs to Syros\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Syros does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success6 = addTextToMilos();\n if (success6) {\n console.log(\n \"%cSuccessfully added paragraphs to Milos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Milos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success7 = addTextToHydra();\n if (success7) {\n console.log(\n \"%cSuccessfully added paragraphs to Hydra\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Hydra does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success8 = addTextToIthaca();\n if (success8) {\n console.log(\n \"%cSuccessfully added paragraphs to Ithaca\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Ithaca does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success9 = addTextToGavdos();\n if (success9) {\n console.log(\n \"%cSuccessfully added paragraphs to Gavdos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Gavdos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n }", "title": "" }, { "docid": "79fe01b498d0ebe632054dbdb9c50e5d", "score": "0.57241476", "text": "function main() {\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\tif (gvMethod === \"MAP\") {\n\t\t\t\t//Perform The Mapping between In and Out\n\t\t\t\ttry {\n\t\t\t\t\t_mapInToOut();\n\t\t\t\t} catch (errorObj) {\n\t\t\t\t\tgvStatus = \"Error during mapping IN to OUT:\" + errorObj.message;\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\t\tresult: gvErrorMessage,\n\t\t\t\t\t\tstatus: gvStatus,\n\t\t\t\t\t\ttableUpdates: gvTableUpdate\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// \t\t} else if ($.request.method === $.net.http.GET) {\n\t\t// \t\t\t//Read Entries from the Table\n\t\t// \t\t\ttry {\n\t\t// \t\t\t\t_getEntries();\n\t\t// \t\t\t} catch (errorObj) {\n\t\t// \t\t\t\t$.response.status = 200;\n\t\t// \t\t\t\t$.response.setBody(JSON.stringify({\n\t\t// \t\t\t\t\tmessage: \"API Called\",\n\t\t// \t\t\t\t\tresult: gvErrorMessage\n\t\t// \t\t\t\t}));\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t}", "title": "" }, { "docid": "d4ecb7f9a48ce32052911e152e8c6fde", "score": "0.57239074", "text": "function FAADataHelper() {\n}", "title": "" }, { "docid": "c2c43fbe5d3f77d1fa47bfc72bf92834", "score": "0.57173973", "text": "function Scdr() {\r\n}", "title": "" }, { "docid": "91f6edb8227f56faab93a90518d89338", "score": "0.5716609", "text": "function main() {\n initBurgerMenu();\n setScrollAnimationTargets(); // init homepage nav\n\n if ($('#home').length === 1) {\n initHomepageNav();\n } else {\n console.log('not home');\n } // init lightboxes\n\n\n initVideoLightbox();\n initTCsLightbox();\n}", "title": "" }, { "docid": "6741c621c1fa93857aee2b94abc59a98", "score": "0.5715039", "text": "function Main() {\n buildinterface();\n interfaceLogic();\n }", "title": "" }, { "docid": "04cc796a1a2b9422786b7134e33fa6ef", "score": "0.56904763", "text": "static private internal function m121() {}", "title": "" }, { "docid": "787eb064ebc764aef2df6363c6a22b50", "score": "0.5678643", "text": "function main() {\n handleStartQuiz();\n handleSubmitAnswer();\n handleNextQuestion();\n handleRetryQuiz();\n generateWelcomePageTemplate();\n \n \n}", "title": "" }, { "docid": "589c022082689080acea11c5d022d032", "score": "0.56542885", "text": "function main() {\n\n\t$(\"#nav-search-btn\").on(\"click\", function(e) {\n\t\te.preventDefault();\n\t\tif ($(\"#ex1\").val()) {\n\t\t\t$(\".search\").empty();\n\t\t\t$(\".search\").show();\n\t\t\t$(\".notSearch\").hide();\n\t\t\tlet userQuery = $(\"#ex1\").val().toLowerCase();\n\t\t\tsearchEndPoint(userQuery);\n\t\t}\n\t});\n\n\t$(\"#reportSearch\").on(\"click\", function(e) {\n\t\tconsole.log(\"Reportar\");\n\t\tlet reported = $('.rightSearch').attr('id');\n\t\tgetReported(reported);\n\t});\n\n\t$(\".searches-container\").on(\"click\", function(e) {\t\t\n\t\twindow.scroll({\n\t\t\ttop: 0, \n\t\t\tleft: 0, \n\t\t\tbehavior: 'smooth'\n\t\t});\n\t\tdisplaySearch(e.target.id);\n\t});\n}", "title": "" }, { "docid": "e705c4cdea659d396618fc5fa0514577", "score": "0.56311506", "text": "function _main() {\n window.tools = {} || window.tools;\n window.tools.log = _log;\n }", "title": "" }, { "docid": "dcf623cc5f42bd8b68c11b50b5cfb3fb", "score": "0.56265235", "text": "function bootlegMiddle() {\n ;\n}", "title": "" }, { "docid": "e286df4f5759663e4caf07d7b2c1afd4", "score": "0.5624418", "text": "function main() {\r\n handleStartQuiz();\r\n render();\r\n handleAnswerSubmission();\r\n handleNextQuestion();\r\n resultsPage();\r\n handleRestartQuiz();\r\n}", "title": "" }, { "docid": "b8f9bd80fcdf58d7747aa48918c6d6ab", "score": "0.5624064", "text": "function main() {\n showScore();\n nextQuestion();\n getFeedback();\n startQuiz();\n render();\n}", "title": "" }, { "docid": "93d4ef341c33be3466ef178c9af49e8d", "score": "0.56187946", "text": "function Tools(){}", "title": "" }, { "docid": "675df8094425c0c428de007cd1d07123", "score": "0.56144756", "text": "function main(){\n galleries = getGalleries();\n // localStorage.setItem('g', JSON.stringify(galleries) )\n // addNavItems(galleries);\n // handleView(galleries);\n }", "title": "" }, { "docid": "882db1cb5617132557ccc561a690af08", "score": "0.5607432", "text": "function main() {\n verb(\"BetaBoards!\")\n\n var s = style()\n\n if (isTopic()) {\n iid = getPage()\n cid = iid\n\n initEvents()\n remNextButton()\n postNums()\n floatQR()\n hideUserlists()\n\n quotePyramid(s)\n\n ignore()\n\n beepAudio()\n\n addIgnoredIds(document.querySelectorAll(\".ignored\"))\n\n var f = function(){\n pageUpdate()\n\n loop = setTimeout(f, time)\n }\n\n var bp = readify('beta-init-load', 2)\n , lp = isLastPage([0, 2, 5, 10, NaN][bp])\n\n verb(\"bp \" + bp + \", lp: \" + lp)\n\n if (lp || bp === 4) loop = setTimeout(f, time)\n\n } else if (isPage(\"post\")) {\n addPostEvent()\n\n } else if (isPage(\"msg\")) {\n try {\n addPostEvent()\n } catch(e) {\n addQuickMsgEvent()\n }\n\n } else if (isForum()) {\n hideUserlists()\n\n var f = function(){\n forumUpdate()\n\n loop = setTimeout(f, time)\n }\n\n loop = setTimeout(f, time)\n\n } else if (isHome()) {\n optionsUI()\n ignoreUI()\n\n // Hint events\n addHintEvents()\n\n }\n}", "title": "" }, { "docid": "d0dcac3ce08d7b60495aa869931e7a3a", "score": "0.5605585", "text": "function TMP(){return;}", "title": "" }, { "docid": "d0dcac3ce08d7b60495aa869931e7a3a", "score": "0.5605585", "text": "function TMP(){return;}", "title": "" }, { "docid": "8b20aeff02af61f1be184f033efd622d", "score": "0.55904204", "text": "function main() {\n\n}", "title": "" }, { "docid": "54bc66ece2be1da4b7ab03549f3e1f94", "score": "0.55902475", "text": "function Kutility() {\n\n}", "title": "" }, { "docid": "54bc66ece2be1da4b7ab03549f3e1f94", "score": "0.55902475", "text": "function Kutility() {\n\n}", "title": "" }, { "docid": "db66385e924f3ecfd874ab027b11bbaa", "score": "0.55871266", "text": "function Common(){}", "title": "" }, { "docid": "1fce6d0357bc9be26056b9ccd2893c4a", "score": "0.5580808", "text": "function main() {\n if (debug) console.log(`Main ran in ${window.name}`)\n // Whenever this is ran, an unload event (i.e. when the user loads a whatIf report)\n // triggers the collection of data needed to do a query for course information.\n // This isn't a listener because getting listeners to work inside iframes is hard.\n function setupWhatIfDataListener() {\n $(getWindow('frSelection')).on(\"unload\", fetchWhatIfData)\n }\n\n // It's ran 10 times per second because again, listeners on iframes are hard.\n // This means the app would break if the user managed to get through the\n // DegreeWorks WhatIf form in a 10th of a second.\n setInterval(setupWhatIfDataListener, 100);\n console.log(window.name)\n if (window.name === \"frBody\") {\n addModal();\n }\n if (window.name === \"frLeft\") {\n let button = addButton(`DegweeWorks Planner`, getDegreeInfo, null, \"genPossible\")\n // addNumberField('Min courses/semester', 'minCourses', 4)\n // addNumberField('Max courses/semester', 'maxCourses', 4);\n }\n }", "title": "" }, { "docid": "1f258ac4290b3b8e651cdd77539a4d33", "score": "0.5573764", "text": "function Main(){\n \n getLiveGames();\n \n}", "title": "" }, { "docid": "8df8f0d86666552ee7c7c4691e1e8785", "score": "0.5550121", "text": "function Expt() {\r\n}", "title": "" }, { "docid": "eae401a4f72b7d6a08d6f8c6abe8bc5b", "score": "0.5549733", "text": "function main() {\n\n\t//======================================\n\t//THE FOLLOWING SHOULD ALL BE SINGLETONS\n\t//======================================\n\n\t//A service to get data and set data from localStorage API\n\tlet todoService = new TodoService();\n\t//The todoApp Data model\n\tlet todoAppData = new TodoAppData(todoService.getLists());\n\t//A class that helps create DOM elements imperatively\n\tlet todoViewFactory = new TodoViewFactory();\n\t//Helps controll the view of the application\n\tlet todoViewSetter = new TodoViewSetter(todoViewFactory);\n\n\t//initializes the view\n\ttodoViewSetter\n\t\t.setListsMenu(todoAppData.lists)\n\t\t.setSelectedList(todoAppData.selectedList);\n\n\t//sets event listeners\n\tsetListeners(todoAppData, todoViewSetter, todoService);\n}", "title": "" }, { "docid": "b8389477da6d1cf0e0c163fa8dac7faf", "score": "0.55483156", "text": "function main() {\n\n(function () {\n 'use strict';\n\n //Page Loader\n //<![CDATA[\n $(window).load(function() { // makes sure the whole site is loaded\n $('#status').fadeOut(); // will first fade out the loading animation\n $('#preloader').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website.\n $('body').delay(350).css({'overflow':'visible'});\n });\n //]]>\n \n // Contact form toggle hide/show\n $(document).ready(function(){\n $(\"#show\").click(function(){\n $(\"#contact\").slideToggle(\"slow,swing\");\n });\n\n $('.mature').click(function(e){\n \n $('#myModal').attr('destination', String(e.target.hash));\n\n $('#myModal').modal('show');\n return false;\n });\n\n $('.continue').on('click', function() {\n $($('#myModal').attr('destination')).modal('show');\n });\n\n $('.quit').on('click', function() {\n \n });\n\n });\n\n // Wow animation\n new WOW().init();\n\n // Header/Vision carousel slider\n $('.carousel').carousel({\n interval: false\n });\n\n\n // jQuery for page scrolling feature - requires jQuery Easing plugin\n $(function() {\n $('a.page-scroll').bind('click', function(event) {\n var $anchor = $(this);\n $('html, body').stop().animate({\n scrollTop: $($anchor.attr('href')).offset().top - 70\n }, 900, 'easeInOutExpo');\n event.preventDefault();\n });\n });\n\n // Highlight the top nav as scrolling occurs\n $('body').scrollspy({\n target: '.navbar-fixed-top' ,\n offset: 75\n });\n\n\n \n\n}());\n\n}", "title": "" }, { "docid": "43ff965c3063f616a30e394ca4639fe9", "score": "0.552742", "text": "function DWRUtil() { }", "title": "" }, { "docid": "7de6613623477ffebfb4e2cf7872c695", "score": "0.5518775", "text": "function main() {\n renderList();\n newItem();\n checkItem();\n deleteItem();\n\n}", "title": "" }, { "docid": "ac71b6533dc6f9681d04903fc1b9d2a8", "score": "0.5515222", "text": "function TMP() {\n return;\n }", "title": "" }, { "docid": "35a30094d09b9207ce3b67b9c903a08d", "score": "0.550628", "text": "function Common() {\n\n}", "title": "" }, { "docid": "5bf60795c25ac504c6ba0585e4253ec4", "score": "0.5500366", "text": "function main() {\r\n $('#header > div.ads-header').remove();\r\n\r\n $('#contendor > div.iframe').remove();\r\n $('#contendor > div.banners').remove();\r\n\r\n $('#contenido > div.contenedor-banner-item').remove();\r\n\r\n $('#sidebar > div').each(function(i, e){\r\n\r\n if ($(this).text() == 'Anuncios')\r\n {\r\n $(this).next().next().remove();\r\n $(this).next().remove();\r\n $(this).remove();\r\n }\r\n\r\n });\r\n\r\n $('#footer').remove();\r\n\r\n if (location.pathname.indexOf('/peliculas') >= 0)\r\n {\r\n $('#contenido > div[style*=\"float: right;\"]').remove();\r\n $('#contenido > h2').eq(1).remove();\r\n $('#contenido > div.texto-pelicula').eq(0).remove();\r\n $('#contenido > div.texto-ver').remove();\r\n }\r\n\r\n if (location.pathname.indexOf('/modulos') >= 0)\r\n {\r\n $('div[id*=\"imagecont\"]').eq(0).remove();\r\n $('div[id*=\"embedcont\"]').eq(0).css('visibility', 'visible');\r\n }\r\n}", "title": "" }, { "docid": "0b40371e59a4882d700b812135c77ea2", "score": "0.5496996", "text": "function main() {\n getAllDancers()\n getSingleDancer(1).then(renderDancer)\n likeUnlike()\n feedbackForm()\n}", "title": "" }, { "docid": "810635130b37fb66415c710368e5e0a6", "score": "0.5481051", "text": "function MainScript_RC() {\n LOG_TITLE = 'RC_ProcessData';\n debug('');\n debug('======SCH_RC_ProcessData START======');\n\n // With that done, check changes\n processAbaiToRcRecord( RC_TABLES.INSTITUTION, ABAI_INSTITUTION,\n RC_INSTITUTIONS, getRcInstitutionData, translateInstitution\n );\n // processAbaiToRcRecord( RC_TABLES.INSTITUTION_ADDRESS, ABAI_INSTITUTION_ADDRESS,\n // RC_INSTITUTION_ADDRESS, getRcInstitutionAddressData, translateInstitutionAddress\n // );\n processAbaiToRcRecord( RC_TABLES.COORDINATOR, ABAI_COORDINATOR, RC_COORDINATOR, getRcCoordinatorData, skip);\n processAbaiToRcRecord( RC_TABLES.DEPARTMENT, ABAI_COURSE_SEQUENCE,\n RC_DEPARTMENTS, getRcDepartmentData, translateDepartment\n );\n processAbaiToRcRecord( RC_TABLES.COURSE, ABAI_COURSE,\n RC_COURSE, getRcCourseData, translateCourse\n );\n // Do a better course analysis\n processAbaiToRcRecord(RC_TABLES.COURSE_adv, ABAI_ASSIGNMENT,\n RC_COURSE_BY_ASSGN, getBetterRcCourseData, skip\n );\n saveAdvancedFile();\n processAbaiToRcRecord( RC_TABLES.CONTENT_HOURS, ABAI_CONTENT_HOURS,\n RC_CONTENT_HOURS, getRcContentHoursData, translateContentHour\n );\n processAbaiToRcRecord( RC_TABLES.ALLOCATION_HOURS,ABAI_ALLOCATION_HOURS,\n RC_ALLOCATION_HOURS, getRcAllocationHoursData, translateAllocationHour\n );\n file.writeFileSync('./RC_RAW/' + 'mixtape' + '.csv', likeActualGarbageWhyDoIDoTheseThingsItDoesntMakeSense );\n\n // idkcheckitoutorsomething(executeSavedSearch( SavedSearch.INSTITUTION ));\n processFinalRecord();\n audit('fuckups', fuckups)\n debug('=======SCH_RC_ProcessData END========');\n}", "title": "" }, { "docid": "36d5e2e5de439336f38b3b12fdf77bde", "score": "0.54795265", "text": "function Utils() {\n}", "title": "" }, { "docid": "bc4ca0de1ab1cb81d879577bb3fcfd9d", "score": "0.54694957", "text": "function headerFunctions() {\n\tuiLoop();\n}", "title": "" }, { "docid": "32abf9f3eda32297acd9515885a830de", "score": "0.54693675", "text": "function ourReusableFunction() {\n\tconsole.log(\"Heyya, world\");\n}", "title": "" }, { "docid": "92e0eb19f4e94aca3296cc9e7a20e99e", "score": "0.5462263", "text": "function main() {\n doCbaam()\n doEcb()\n updateGraphFile()\n}", "title": "" }, { "docid": "ae42da5572d282e53663585097ad3ea3", "score": "0.54618645", "text": "function HelperFunctions() {\n const fObj = {};\n\n fObj.getRandomNumBetween = function (min, max){\n // src: https://stackoverflow.com/a/7228322\n return Math.floor(Math.random() * (max - min + 1) + min);\n }\n\n fObj.shuffleArray = function (array) {\n // src: https://medium.com/@nitinpatel_20236/how-to-shuffle-correctly-shuffle-an-array-in-javascript-15ea3f84bfb\n for(let i = array.length - 1; i > 0; i--){\n const j = Math.floor(Math.random() * i)\n const temp = array[i]\n array[i] = array[j]\n array[j] = temp\n }\n }\n\n fObj.generateTasksIds = function (iTaskCount) {\n let iTaskIds = [];\n for (let i=1; i<=iTaskCount; i++) {iTaskIds.push(i);}\n return iTaskIds;\n }\n\n fObj.generateResources = function (iResourcesSrc) {\n return iResourcesSrc.map(resourcesSrcItem => {\n // resourcesSrcItem = [<name,perf,cost>]\n return createResource(resourcesSrcItem[0],resourcesSrcItem[1],resourcesSrcItem[2]);\n });\n }\n\n function createResource(name, perf, cost) {\n const resObj = {};\n resObj.name = name;\n resObj.perf = perf;\n resObj.cost = cost;\n resObj.greeting = function() {\n alert('Hi! I\\'m ' + resObj.name + '.');\n };\n return resObj;\n }\n return fObj;\n }", "title": "" }, { "docid": "2f8ee2d48eb18737e173a5df204b6e04", "score": "0.5443333", "text": "function wa(){}", "title": "" }, { "docid": "6b27bef00d7aa9a6d94452e8383d1e86", "score": "0.54331625", "text": "function fm(){}", "title": "" }, { "docid": "987ef107b5f00ec0557090ad5cd29e9a", "score": "0.5422904", "text": "function mainLoop(){\n\t\tvar sections = splitIntoSections();\n\n\n\n\t}", "title": "" }, { "docid": "9ff62c6164cae7dbfeaee910152dd417", "score": "0.5420054", "text": "function main() {\n // Break\n var h1 = document.createElement('h1');\n h1.innerText = 'End of js_css_chooser.js';\n h1.style = 'clear: both;';\n document.body.prepend(h1);\n\n // Font\n prependDiv('font_test');\n prependDiv('font_solarized');\n prependDiv('font_cursive_hard');\n prependDiv('font_cursive_soft');\n prependDiv('font_safe');\n\n // Break\n var h1 = document.createElement('h1');\n h1.innerText = 'Font';\n h1.style = 'clear: both;';\n document.body.prepend(h1);\n\n // Css\n prependDiv('layout');\n prependDiv('color_light');\n prependDiv('color_dark');\n\n // Break\n var h1 = document.createElement('h1');\n h1.innerText = 'Color';\n h1.style = 'clear: both;';\n document.body.prepend(h1);\n}", "title": "" }, { "docid": "dbffa507227bbec42fd1fdcae315834f", "score": "0.54166687", "text": "function MainFunction()\n{\n 'use strict';\n\n Steps(7);\n\n}", "title": "" }, { "docid": "6a53288b9998e9f6282a9e8e3045bb39", "score": "0.5416465", "text": "function main() {\n $('.generator-options-item').click(toggleDropdownButton);\n $('.generator-optimizer-item').click(selectOptimizerButton);\n $('#generator-nutr-button').click(updateNutrOptions);\n $('#generator-opt-button').click(updateOptimizeId);\n $('#add-ingredient').click(addIngredient);\n $('#cancel-recipe-input').click(clearRecipeInputs);\n $('#add-recipe-form').submit(checkInputs);\n $('#edit-profile-form').submit(checkEditProfileInputs);\n $('#generator-form').submit(checkGeneratorInputs);\n}", "title": "" }, { "docid": "7e64c375f219156ee55fc1241c30aeba", "score": "0.54079205", "text": "function mainComplete() {\n\t\tconsole.log('it is all loaded up');\n\t\t//Demo.main.initialize();\n\t}", "title": "" }, { "docid": "d97e0c8038a9e2c8eef7cb2c0258adbf", "score": "0.53946096", "text": "function mainFunction(){\r\n\r\n\tdisplayDescription(0);\r\n\r\n\tkeyObj.keyCheck=1;\r\n\r\n\tif (openCounter===1){\r\n\t\tparamNumber = Math.abs(randomize(-0.5,0.5));\r\n\t}\r\n\telse{\r\n\t\tif (paramNumber===1){\r\n\t\t\tparamNumber=0;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tparamNumber=1;\r\n\t\t}\r\n\t}\r\n\r\n\tif (paramNumber===1){\r\n\t\tstimuliCurrentInfo.taskNumber++;\r\n\t\tstimuliCurrentInfo.seriesNumber++;\r\n\t}\r\n\r\n\tdisplayTask();\r\n\r\n\ttaskTimer();\r\n\r\n}", "title": "" }, { "docid": "b22f6475e255db13f339e3c59a71caa0", "score": "0.5392511", "text": "function main() {\n $(function() {\n // When document has loaded we attach FastClick to\n // eliminate the 300 ms delay on click events.\n FastClick.attach(document.body)\n\n // Event listener for Back button.\n $('.app-back').on('click', function() {\n history.back()\n })\n })\n\n // Event handler called when Cordova plugins have loaded.\n document.addEventListener(\n 'deviceready',\n onDeviceReady,\n false)\n window.onbeforeunload = function(e) {\n rfduinoble.close();\n };\n google.charts.load('current', {\n 'packages': ['corechart', 'controls', 'charteditor']\n });\n //google.setOnLoadCallback(drawChart);\n // google.setOnLoadCallback(function() {\n // genSampleData(generateSamples)\n // });\n }", "title": "" }, { "docid": "98affbfbefd47bb1f0074995e614c7f4", "score": "0.539176", "text": "function main() {\n}", "title": "" }, { "docid": "4ae4151db0ce702f8648a63e2f27b777", "score": "0.5385976", "text": "async main() {\n try {\n // gets the input file name by command line\n const input = argv._[constants.FIRST_ITEM];\n // checks if it was received\n this.checkInputParameter(input);\n\n logger.debug('In about to start reading the input file. Environment: %s', env);\n\n // calls AreaCodeService to read the input, validate it and create the output file\n await areaCodeService.countNumbersByAreaCode(input);\n logger.info('Output file generated successfully with the results...');\n } catch (e) {\n logger.error(e);\n }\n }", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.53835255", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.53835255", "text": "function TMP(){}", "title": "" }, { "docid": "cb1d5f5e08d4ec368808aabc6ec178c4", "score": "0.5381305", "text": "function main() {\r\n\t// Init the myGM functions.\r\n\tmyGM.init();\r\n\r\n\t// If the script was already executed, do nothing.\r\n\tif(myGM.$('#' + myGM.prefix + 'alreadyExecutedScript'))\treturn;\r\n\r\n\t// Add the hint, that the script was already executed.\r\n\tvar alreadyExecuted\t\t= myGM.addElement('input', myGM.$('#container'), 'alreadyExecutedScript');\r\n\talreadyExecuted.type\t= 'hidden';\r\n\r\n\t// Init the language.\r\n\tLanguage.init();\r\n\r\n\t// Init the script.\r\n\tGeneral.init();\r\n\r\n\t// Call the function to check for updates.\r\n\tUpdater.init();\r\n\r\n\t// Call the function to enhance the view.\r\n\tEnhancedView.init();\r\n}", "title": "" }, { "docid": "124536c0a777861b8513d4211adceef8", "score": "0.53751796", "text": "function indexPage() {\n logIn();\n signUp();\n signInAuth();\n signUpAuth();\n runDemo();\n}", "title": "" }, { "docid": "62410a0ea9f19c31162281c60ac0f5ba", "score": "0.5369268", "text": "function main() {\n getIpLocation();\n setHandlers();\n }", "title": "" }, { "docid": "53cb5b11086809c484e61c5692161780", "score": "0.53662235", "text": "function Func_s() {\n}", "title": "" }, { "docid": "b81d7941bb30a127bc65e098a389e18d", "score": "0.5364534", "text": "function main() {\r\n handleStartQuiz();\r\n handleSubmitAnswer();\r\n handleNextQuestion();\r\n handleRestartQuiz();\r\n render();\r\n}", "title": "" }, { "docid": "30988018d7ca82643cb43efd64ebc3c9", "score": "0.5358918", "text": "function main() {\n NodeList.prototype.forEach = HTMLCollection.prototype.forEach = Array.prototype.forEach\n\n slideEls = document.querySelectorAll('.presentation > div')\n\n // Specific slide tech\n $('pre, code').each(function(i, block) {\n hljs.highlightBlock(block)\n });\n\n // Set up\n getSlideNumberFromUrlFragment()\n document.querySelector('.presentation').classList.add('visible')\n showSlide(true, true)\n onSlideEnter(slideEls[currentSlideNumber], true)\n\n document.body.addEventListener('keydown', onKeyDown)\n document.body.focus()\n}", "title": "" }, { "docid": "1873557bb1e74833d42afd9a6cda3dfd", "score": "0.535793", "text": "function Common() {}", "title": "" }, { "docid": "a28a1c45a5178ec82808ada54889f32a", "score": "0.53549874", "text": "function run_all_scripts_data()\n\n{\n \n \n runDemo_test();\n runDemo_tiscali();\n runDemo_gnocca();\n \n// runDemo_test_events();\n// runDemo_test_events_2();\n// runDemo_tiscali_events ();\n}", "title": "" }, { "docid": "38ebcdfea244ee5cf55d597a9c3816aa", "score": "0.5354874", "text": "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "title": "" }, { "docid": "38ebcdfea244ee5cf55d597a9c3816aa", "score": "0.5354874", "text": "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "title": "" }, { "docid": "44dfde9906fa1c183245d889a94dcfc2", "score": "0.5354347", "text": "private internal function m248() {}", "title": "" }, { "docid": "b23bbd026455dcf3402a9cc878ecf8f7", "score": "0.5353254", "text": "function gather() {\n base();\n hootsuite();\n socialpilot();\n socialoomph();\n agorapulse();\n communit();\n crowdfire();\n loomly();\n planable();\n missinglettr();\n viraltag();\n}", "title": "" }, { "docid": "c301db80f57f5c663128dd4b3a29ffae", "score": "0.5351838", "text": "function Start() {\n\n}//fin function Start()", "title": "" }, { "docid": "8d1f70b1add4fcf400db7e071b31880d", "score": "0.5346917", "text": "function main() {\r\n renderPage();\r\n startQuiz();\r\n submitAnswer();\r\n resumeQuiz();\r\n restartQuiz();\r\n}", "title": "" }, { "docid": "38aa8342a499e4f700f545076c798aaf", "score": "0.5335254", "text": "async function main() {\n\n const articleId = getArticleId();\n console.log(articleId);\n\tconst teddy = await getArticleContent(articleId);\n console.log(teddy);\n displayArticle(teddy);\n testOptions(teddy);\n}", "title": "" }, { "docid": "f2e7ad7821fd23b6c968811c27640804", "score": "0.5333825", "text": "function Fundamentals() {\n\n }", "title": "" }, { "docid": "650ff554859977bab92401016e1b7806", "score": "0.5332905", "text": "private public function m246() {}", "title": "" }, { "docid": "008bc55818941b54f865fe8382aec2fb", "score": "0.53291285", "text": "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.GET) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"GET is not supported, perform a POST to add Entries\"\n\t\t\t}));\n\t\t} else {\n\t\t\t//Perform Table Entry to be created in Table\n\t\t\ttry {\n\t\t\t\tif (gvGuid) {\n\t\t\t\t\t_createEntries();\n\t\t\t\t}\n\t\t\t} catch (errorObj) {\n\t\t\t\tgvTableUpdate = \"Error during table insert:\" + errorObj.message;\n\t\t\t}\n\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tTableUpdateStatus: gvTableUpdate\n\t\t\t}));\n\t\t}\n\t}", "title": "" }, { "docid": "18a3aac3962c490bcb0c64eecc70a32e", "score": "0.53229535", "text": "function Efw() {\n}", "title": "" }, { "docid": "fc8b3994e7130d108f3f1718d3c331e0", "score": "0.53229016", "text": "function MAINAPP() {\n do {\n userType = prompt(\n \"\\u00A1Bienvenido a Skylab Airlines! \\u00BFDeseas realizar funciones de USER o ADMIN?\",\n \"USER,ADMIN\"\n );\n salida(userType, MAINAPP);\n userType = userType.toUpperCase();\n } while (userType !== \"USER\" && userType !== \"ADMIN\");\n\n if (userType === \"USER\") {\n USER();\n } else if (userType === \"ADMIN\") {\n ADMIN();\n } else {\n alert(\"No te he entendido. Volvamos a empezar.\");\n MAINAPP();\n }\n}", "title": "" }, { "docid": "e3c3c34a8afd2802cf7b2a7dd5a98fb9", "score": "0.53175735", "text": "function main() {\n\t\thtmlModule = new htmlUtil(); // View creation / HTML logic\n\t\tarrModule = new arrMethods(); // Array Method shortcuts\n\t\tmsg = htmlModule.msg; // Logging\n\t\tmsg.set(\"Starting Module\");\n\t\thtmlModule.outputToContentDiv(\"Primes by Sieve of Erathosthenes.\");\n\t\t// Setup Form.\n\t\tvar numArray = sieveModule(1000);\n\t\tfor (var i = 0; i < numArray.length; i++) {\n\t\t\tif (numArray[i] == 1) {\n\t\t\t\thtmlModule.outputToContentDiv(\"Prime: \" + i);\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "f04f09101ef5fd7451321e2cb1990018", "score": "0.5316388", "text": "function FrontEnd(){\n}", "title": "" }, { "docid": "811781f35a9428cb7129f39025f7ad35", "score": "0.5314049", "text": "function mainProcess() {\n\n selText = $('#srchtxt').val().trim();\n $('#srchtxt').val(\"\");\n locationURL = geocodeQueryBuild(selText);\n callgeocodeAPI(locationURL);\n }", "title": "" }, { "docid": "142c037afa9a40365da79263e2ee84cb", "score": "0.5306078", "text": "function loadFunction(){\n\tvalidateLogin();\n\tgetImg();\n\tgetTags();\n\tgetUploader()\n\tgetComments();\n\tupdateViewCount();\n\t\n}", "title": "" }, { "docid": "e252cc92f78e87b1e97bf4b6ec026714", "score": "0.5296668", "text": "function Intialize() {\n return;\n}", "title": "" } ]
af902cfe9c4d7f35cb5246b960d46aed
Create the responsive boxes for the clicky pictures.
[ { "docid": "65ad57c8c4c78030975d0e4d9e0cdbfa", "score": "0.0", "text": "function SWCard(props) {\n return (\n <div className=\"card\">\n <div className=\"img-container\" onClick={() => props.select(props.id)}>\n <img alt={props.name} src={props.image} />\n </div>\n </div>\n );\n}", "title": "" } ]
[ { "docid": "8676f53376d829123f9c2e88cb2e840b", "score": "0.6192381", "text": "function box() {\n\n // PICTURE CUBES\n\n let randomPicture = () => {\n let picturesArray = ['https://i.imgur.com/HoCPcs3.jpg', 'https://i.imgur.com/qqw2RMP.jpg', 'https://i.imgur.com/bHVpOJJ.png', 'https://i.imgur.com/B8ghWwB.png', 'https://i.imgur.com/GR4gAn1.png', 'https://i.imgur.com/SYzLz4I.png', 'https://i.imgur.com/10nCGHC.png', 'https://i.imgur.com/KnhScDN.png', 'https://i.imgur.com/uUQbDed.png', 'https://i.imgur.com/gFSNReh.png', 'https://i.imgur.com/lOnHUiY.jpg', 'https://i.imgur.com/CnKFVbx.png', 'https://i.imgur.com/laWg0PR.png', 'https://i.imgur.com/bmjglz0.png', 'https://i.imgur.com/uM8qIQd.png', 'https://i.imgur.com/Zh7Vq4C.png', 'https://i.imgur.com/op7YiDU.jpg', 'https://i.imgur.com/89BgiRx.jpg', 'https://i.imgur.com/VkFE7DW.jpg', 'https://i.imgur.com/KzNF8BQ.jpg', 'https://i.imgur.com/iNJ3dkP.jpg', 'https://i.imgur.com/ZazbtLr.png', 'https://i.imgur.com/y4zFvs3.jpg', 'https://i.imgur.com/M3XUWe2.jpg', 'https://i.imgur.com/HxikqTB.jpg', 'https://i.imgur.com/kUfbR3Z.jpg', 'https://i.imgur.com/AdvEOav.jpg', 'https://i.imgur.com/MbkPmiS.jpg', 'https://i.imgur.com/vUqeF7o.jpg', 'https://i.imgur.com/6Z9ZXc2.jpg', 'https://i.imgur.com/Eg4FsjV.jpg', 'https://i.imgur.com/gkUXeIX.jpg', 'https://i.imgur.com/NamrJJL.jpg', 'https://i.imgur.com/Scd2Ti1.jpg', 'https://i.imgur.com/w1qdXCp.jpg', 'https://i.imgur.com/4Ks9BBx.jpg', 'https://i.imgur.com/GgLKP2t.jpg', 'https://i.imgur.com/5aEKXM2.jpg', 'https://i.imgur.com/Yo4Gmc9.jpg', 'https://i.imgur.com/yenVsxW.jpg', 'https://i.imgur.com/ez3u7ex.jpg', 'https://i.imgur.com/wkZeD6a.jpg', 'https://i.imgur.com/FcEaStg.png', 'https://i.imgur.com/m9WthAG.png', 'https://i.imgur.com/jNKQXiX.png', 'https://i.imgur.com/Dl7aVTc.jpg', 'https://i.imgur.com/fFcRIvv.png', 'https://i.imgur.com/1rzhH1I.png', 'https://i.imgur.com/NXrFmTD.png', 'https://i.imgur.com/KbCjL94.png', 'https://i.imgur.com/jKgnXGC.png', 'https://i.imgur.com/R1thJbU.png', 'https://i.imgur.com/oxsw7D0.png', 'https://i.imgur.com/zzieKec.jpg', 'https://i.imgur.com/DjiUPn1.jpg', 'https://i.imgur.com/AcJN0vN.jpg', 'https://i.imgur.com/iILk5HC.jpg', 'https://i.imgur.com/8jSU8AT.jpg', 'https://i.imgur.com/8gdA2iz.jpg', 'https://i.imgur.com/YqYi3lm.jpg', 'https://i.imgur.com/Haibb8N.jpg', 'https://i.imgur.com/3xExYnT.jpg', 'https://i.imgur.com/kUVNwdT.jpg', 'https://i.imgur.com/47dVmlu.jpg', 'https://i.imgur.com/ssqqIta.jpg', 'https://i.imgur.com/Ha03TIS.jpg', 'https://i.imgur.com/nECWzpe.jpg', 'https://i.imgur.com/Em6hCL8.jpg', 'https://i.imgur.com/3dghcwr.jpg', 'https://i.imgur.com/Wgit6EE.jpg', 'https://i.imgur.com/uwRInuh.jpg', 'https://i.imgur.com/gHkLcJR.jpg', 'https://i.imgur.com/RLv5U8D.jpg', 'https://i.imgur.com/riSicyA.jpg', 'https://i.imgur.com/Oo6Lapt.jpg', 'https://i.imgur.com/yhkwzVz.jpg', 'https://i.imgur.com/rgTOQCI.jpg', 'https://i.imgur.com/MLUR4QH.jpg', 'https://i.imgur.com/CL20bbx.jpg', 'https://i.imgur.com/AXkb1Hr.jpg', 'https://i.imgur.com/R1WWNOQ.png', 'https://i.imgur.com/pnqv1MG.jpg', 'https://i.imgur.com/xevJVYT.jpg', 'https://i.imgur.com/CeHUkNY.jpg', 'https://i.imgur.com/dDPKlkW.jpg', 'https://i.imgur.com/cpxBOgd.jpg', 'https://i.imgur.com/tT1rHcz.jpg', 'https://i.imgur.com/va62Tv7.jpg', 'https://i.imgur.com/HMjXSdo.jpg', 'https://i.imgur.com/0vNAGpX.jpg', 'https://i.imgur.com/qGB3lLM.jpg', 'https://i.imgur.com/UW6A8w6.jpg', 'https://i.imgur.com/D8fL7HP.jpg', 'https://i.imgur.com/OMYk5bF.jpg', 'https://i.imgur.com/FTXQReR.jpg', 'https://i.imgur.com/WeqTlZp.jpg', 'https://i.imgur.com/9PVLuOu.jpg', 'https://i.imgur.com/cZPvAzt.jpg', 'https://i.imgur.com/Jr21qJu.jpg', 'https://i.imgur.com/kObKcxS.jpg', 'https://i.imgur.com/joPD2bc.jpg', 'https://i.imgur.com/xTjejHs.png', 'https://i.imgur.com/BGxJJDa.png', 'https://i.imgur.com/ZnTSD8f.png', 'https://i.imgur.com/FbSBGfp.png', 'https://i.imgur.com/pLidDHj.png', 'https://i.imgur.com/tj3ba33.png', 'https://i.imgur.com/LcL3Tb8.png', 'https://i.imgur.com/aXpuhMP.png', 'https://i.imgur.com/1pjk1HS.png', 'https://i.imgur.com/CSe79bO.png', 'https://i.imgur.com/D4BWVxd.png', 'https://i.imgur.com/PCyESXj.png', 'https://i.imgur.com/OMtTKMl.png', 'https://i.imgur.com/BoHR1Dh.png', 'https://i.imgur.com/8bBWBM1.png', 'https://i.imgur.com/Ae7FeXa.png', 'https://i.imgur.com/Q27JAwq.png', 'https://i.imgur.com/mkypv2A.png', 'https://i.imgur.com/nBCTRg9.png', 'https://i.imgur.com/cRU3oat.png', 'https://i.imgur.com/y66tEwv.png', 'https://i.imgur.com/cZ8JXwy.png']\n let randomPicture = Math.floor(Math.random() * picturesArray.length);\n return picturesArray[randomPicture];\n }\n\n const loader = new THREE.TextureLoader();\n\n let geometry = new THREE.BoxGeometry(10, 10, 10);\n let material = [\n new THREE.MeshBasicMaterial({map: loader.load(randomPicture())}),\n new THREE.MeshBasicMaterial({map: loader.load(randomPicture())}),\n new THREE.MeshBasicMaterial({map: loader.load(randomPicture())}),\n new THREE.MeshBasicMaterial({map: loader.load(randomPicture())}),\n new THREE.MeshBasicMaterial({map: loader.load(randomPicture())}),\n new THREE.MeshBasicMaterial({map: loader.load(randomPicture())})\n ];\n let boxes = new THREE.Mesh(geometry, material);\n\n let [x, y, z] = Array(3).fill().map(() => THREE.MathUtils.randFloatSpread(250));\n boxes.position.set(x, y, z);\n\n scene.add( boxes );\n\n boxes.callback = function() {}\n\n\n\n // UFOS\n\n const ufoTexture = new THREE.TextureLoader().load(\"https://i.imgur.com/PsyG6xg.jpg\");\n\n let points = [];\n for (let i = 0; i < 10; i++) {\n points.push(new THREE.Vector2(Math.sin(i * 0.4) * 5 + 2.5, (i - 2.5) * .33));\n }\n \n let ufoGeometry = new THREE.LatheGeometry(points);\n let ufoMaterial = new THREE.MeshPhongMaterial({ map: ufoTexture });\n let ufos = new THREE.Mesh(ufoGeometry, ufoMaterial);\n\n let ufoPositionX = boxes.position.x \n let ufoPositionY = boxes.position.y + 11\n let ufoPositionxZ = boxes.position.z\n \n ufos.position.set(ufoPositionX, ufoPositionY, ufoPositionxZ);\n\n scene.add(ufos);\n\n ufos.callback = function() {}\n\n\n\n // ROTATION FOR CUBES AND UFOS\n\n function rotate() {\n \n requestAnimationFrame( rotate );\n\n let numbersArray = [0.01, 0.009, 0.008, 0.007, 0.006, 0.005, 0.004, 0.003, 0.002, 0.001];\n\n let random = Math.floor(Math.random() * numbersArray.length);\n let randomNumberX = numbersArray[random];\n let randomNumberY = numbersArray[random];\n let randomNumberZ = numbersArray[random];\n \n boxes.rotation.x += randomNumberX\n boxes.rotation.y += randomNumberY\n boxes.rotation.z += randomNumberZ\n\n ufos.rotation.y += 0.1;\n\n }\n\n rotate();\n\n\n\n // SPOT LIGHT FOR GREEN UNDERGLOW ON UFOS\n\n const spotLight = new THREE.SpotLight( 0x00ff00 );\n\n spotLight.position.set( boxes.position.x, boxes.position.y, boxes.position.z );\n\n spotLight.target = ufos;\n\n spotLight.power = 1.5;\n\n scene.add( spotLight );\n \n }", "title": "" }, { "docid": "ecaed25008c91cc3640bad5630e70b0a", "score": "0.61604524", "text": "function gridSetup() {\n var box_count = $('.grid-num').val();\n var box_face = ((700 / box_count) - 1) + 'px';\n for (var i = 0; i < box_count; i++) {\n for (var j = 0; j < box_count; j++) {\n $('.wrapper').append('<div class=\"square\"></div>');\n }\n }\n $('.square').css({\n 'height': box_face,\n 'width': box_face\n });\n $('div').filter('.selected').click();\n }", "title": "" }, { "docid": "b01c45076e1f412bbddf86a60aadc5c5", "score": "0.6150483", "text": "function makeSquareThumbnails() {\n var thumbnailWidth = $('.product-thumb').css('width')\n $('.product-thumb').css('height', thumbnailWidth)\n }", "title": "" }, { "docid": "b17f1b662113951631f2ab72ea432e2f", "score": "0.6021339", "text": "function createBoxes(){\r\n\tfor(var i = 0; i<100; i++){\r\n\t\t//Random dodeljivanje slika u boksove. Math.floor zaokruzuje vrednost na manji broj (5.6 je 5)!\r\n\t\t//Math.random pomnozim sa brojem podataka u areju kako bi dobio brojeve od 0 do 100 i na osnovu njih ubacivao slike u boksove\r\n\t\tvar random = Math.floor(Math.random()*imagesArray.length);\r\n\t\tcontainer.append('<div class=\"box\"><div class=\"back\"><i class=\"fa fa-'+imagesArray[random]+' fa-3x\"></i></div><div class=\"front\"></div></div>');\r\n\t\timagesArray.splice(random, 1);\r\n\t}\r\n}", "title": "" }, { "docid": "3d33b680e62a646352d9e1f800014020", "score": "0.5846928", "text": "function createGrid() {\r\n\tfor(let i=0; i<images.length; i++) {\r\n\t\tlet image = document.createElement(\"img\");\r\n\t\timage.setAttribute(\"src\",\"./resources/images/tray.png\");\r\n\t\timage.setAttribute(\"data-id\",i);\r\n\t\timage.style.backgroundColor = \"#ff1938\";\r\n\t\timage.addEventListener('click',cardFlipper);\r\n\t\tdocument.getElementById(\"grid-container\").appendChild(image);\r\n\t}\r\n}", "title": "" }, { "docid": "1aa2b10e620941395ec780de0fcb43ed", "score": "0.58435124", "text": "function e() {\n var boxarts = [\n {\n width: 200,\n height: 200,\n url: \"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\"\n },\n {\n width: 150,\n height: 200,\n url: \"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\"\n },\n {\n width: 300,\n height: 200,\n url: \"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\"\n },\n {\n width: 425,\n height: 150,\n url: \"http://cdn-0.nflximg.com/images/2891/Fracture425.jpg\"\n }\n ];\n\n return boxarts\n .reduce(function(acc, curr) {\n if (acc.width * acc.height > curr.width * curr.height) {\n return acc;\n } else {\n return curr;\n }\n })\n .map(function(boxart) {\n return boxart.url;\n });\n}", "title": "" }, { "docid": "6d0aa056a1ecd445f4d9a0fb5527b863", "score": "0.5765638", "text": "function sizeEverything() {\n dimensions = coverDimensions(16, 9, window.innerWidth, window.innerHeight), $el.css({\n position: \"absolute\",\n width: dimensions.width,\n \"padding-top\": dimensions.height,\n top: .5 * (window.innerHeight - dimensions.height),\n left: .5 * (window.innerWidth - dimensions.width),\n \"max-width\": \"none\"\n }), $wrap.css({\n position: \"relative\",\n overflow: \"hidden\",\n width: window.innerWidth,\n height: window.innerHeight\n })\n}", "title": "" }, { "docid": "9d88b22206faccbbc8b270856d017b5c", "score": "0.57589996", "text": "function resize_boxart(maxht, maxwt, minht, minwt) {\n var imgs = document.getElementsByClassName('boxart');\n\n var resize_image = function(img, newht, newwt) {\n img.height = newht;\n img.width = newwt;\n };\n \n for (var i = 0; i < imgs.length; i++) {\n var img = imgs[i];\n if (img.height > maxht || img.width > maxwt) {\n // Use Ratios to constraint proportions.\n var old_ratio = img.height / img.width;\n var min_ratio = minht / minwt;\n // If it can scale perfectly.\n if (old_ratio === min_ratio) {\n resize_image(img, minht, minwt);\n } \n else {\n var newdim = [img.height, img.width];\n newdim[0] = minht; // Sort out the height first\n // ratio = ht / wt => wt = ht / ratio.\n newdim[1] = newdim[0] / old_ratio;\n // Do we still have to sort out the width?\n if (newdim[1] > maxwt) {\n newdim[1] = minwt;\n newdim[0] = newdim[1] * old_ratio;\n }\n resize_image(img, newdim[0], newdim[1]);\n }\n }\n }\n}", "title": "" }, { "docid": "b0f007986350a957ab77b89ce5fe6fcf", "score": "0.57546055", "text": "function buildGrid() {\n setGridDimensions(getGapValue());\n for (let i = 0; i < gridSize**2; i++) {\n let newBox = document.createElement(\"div\");\n newBox.classList.add(\"box\");\n canvas.appendChild(newBox);\n }\n addBoxListeners();\n}", "title": "" }, { "docid": "65da61163684d80412e13efc907f59b9", "score": "0.5749897", "text": "function calcBoxes() {\r\n for (var i = 0; i < 17; i++) {\r\n var boxWidth = canvas.width / 4;\r\n var boxHeight = canvas.height / 5;\r\n var boxX = (i % 4) * boxWidth;\r\n var boxY = Math.trunc(i / 4) * boxHeight;\r\n\r\n if (i == 16)\r\n boxWidth = canvas.width;\r\n \r\n boxes[i] = {\r\n num: i + 10,\r\n width: boxWidth,\r\n height: boxHeight,\r\n x: boxX,\r\n y: boxY\r\n }\r\n }\r\n}", "title": "" }, { "docid": "dbd6a6ecd779b5383fb468e4b2df161b", "score": "0.5739668", "text": "function sizing() {\n var bwidth; //box width\n var bpx; //box pixels width\n\tvar bwend; //ending string of box with in css\n setTimeout(function () {\n //flexable box width\n var cw = parseInt($(\".container\").width(), 10);\n if ((cw / 250) >= 4) {\n $(\".container > .num > div\").css(\"width\", \"25%\");\n bwend = \"%\";\n bwidth = 25;\n\t\t\tboxPerRow = 4;\n } else {\n $(\".container > .num > div\").css(\"width\", cw / Math.floor(cw / 250) + \"px\");\n bwend = \"px\";\n bwidth = cw / Math.floor(cw / 250);\n\t\t\tboxPerRow = (100 / bwidth);\n }\n $(\".container > .num > div\").css(\"height\", $(\".container > .num > div .box img.bkgrnd\").css(\"height\"));\n }, 0);\n setTimeout(function () {\n $(\".featured\").css(\"width\", bwidth * 2 + bwend);\n $(\".featured\").css(\"height\", $(\".container > .num > div\").height() * 2 + \"px\");\n\t\t//doneloading = true;\n }, 0);\n\n}", "title": "" }, { "docid": "2e0f38a60efea5abb97495b9a48298d3", "score": "0.57304025", "text": "function createBoxImage() {\n if(mediaQuery.matches) {\n if(!boxCreated) {\n document.querySelector('.container').appendChild(boxImage);\n boxCreated = true;\n }\n } else {\n if(boxCreated) {\n document.querySelector('#box-img').remove();\n boxCreated = false;\n }\n }\n}", "title": "" }, { "docid": "0793217f43f8cf9a5c8e498ede0f31d6", "score": "0.5713182", "text": "function createBox()\n\t{\n\t\t// Temporary card\n\t\tthat.add('image', {\n\t\t\tx: that.x,\n\t\t\ty: that.y,\n\t\t\timage: 'STBlankCard',\n\t\t\tdepth: 1,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\t// Card 1\n\t\ttop = that.add('image', {\n\t\t\tx: that.x,\n\t\t\ty: that.y,\n\t\t\turl: that.url,\n\t\t\tw: fw.assetWidth(style.bottomImage),\n\t\t\th: style.cardHeight,\n\t\t\ttype: that.id + 'grp',\n\t\t\tfuncTest: 'card_top',\n\t\t\tdepth: 1,\n\t\t\thidden: true,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\tbottom = that.add('image', {\n\t\t\timage: style.bottomImage,\n\t\t\ttype: that.id + 'grp',\n\t\t\thidden: true,\n\t\t\tfuncTest: 'card_bottom',\n\t\t\tcursor: 'pointer'},\n {\n wid: top,\n my: 'top left',\n at: 'bottom left',\n ofs: '0 0'\n });\n\t}", "title": "" }, { "docid": "97285b09910bb2f7b1ba7a86f3efe9bd", "score": "0.57102746", "text": "function createGalleryControls()\n{\n let allTopSeachImages = searchGalleryTop.querySelectorAll('img');\n let allBotSeachImages = searchGalleryBottom.querySelectorAll('img');\n let top3Y = searchGalleryTop.getBoundingClientRect().bottom -100;\n let bot3Y = searchGalleryBottom.getBoundingClientRect().top+ 100;\n for(let i = 0; i < 3; i++)\n {\n let number = document.createElement('h1');\n let botNumber = document.createElement('h1');\n number.innerHTML = i+1;\n number.classList.add('elementNumber');\n botNumber.innerHTML = i+4;\n botNumber.classList.add('elementNumber');\n // number.style.marginLeft = '20%';\n\n\n //top 3, bottom = galery top bottom, left = image\n //bottom 3, top = galery bottom top, left = image\n let test = allTopSeachImages[i].getBoundingClientRect().left;\n number.style.left = allTopSeachImages[i].getBoundingClientRect().left+'px';\n botNumber.style.left = allBotSeachImages[i].getBoundingClientRect().left+'px';\n number.style.top = top3Y+'px';\n botNumber.style.top = bot3Y+'px';\n\n document.querySelector('#imageNumbers').appendChild(number);\n document.querySelector('#imageNumbers').appendChild(botNumber);\n\n imageSelect.querySelectorAll('h1')[0].style.position = 'absolute';\n imageSelect.querySelectorAll('h1')[1].style.position = 'absolute';\n imageSelect.querySelectorAll('h1')[0].style.top = '70vh';\n imageSelect.querySelectorAll('h1')[1].style.top = '70vh';\n imageSelect.querySelectorAll('h1')[1].style.right = '0';\n\n // });\n // allBotSeachImages[i].src = srcBot;\n }\n}", "title": "" }, { "docid": "b7c227cc34881fb45710d2a46c7c712e", "score": "0.5699074", "text": "function createOnPage() {\n new image ('bag', 'Bag');\n new image ('banana', 'Banana');\n new image ('boots', 'Boots');\n new image ('bathroom', 'Bathroom');\n new image ('boots', 'Boots');\n new image ('breakfast', 'Breakfast');\n new image ('bubblegum', 'BubbleGum');\n new image ('chair', 'Chair');\n new image ('cthulhu', 'Cthulhu');\n new image ('dog-duck', 'Dog Duck');\n new image ('dragon', 'Dragon');\n new image ('pen', 'Pen');\n new image ('pet-sweep', 'Pet Sweep');\n new image ('scissors', 'Scissors');\n new image ('shark', 'Shark');\n new image ('sweep', 'Sweep');\n new image ('tauntaun', 'TaunTaun');\n new image ('unicorn', 'Unicorn');\n new image ('usb', 'USB');\n new image ('water-can', 'Water Can');\n new image ('wine-glass', 'Wine Glass');\n }", "title": "" }, { "docid": "945286b41930e6b2b5df85c7353efafc", "score": "0.56662333", "text": "function exc18() {\n\tvar boxarts = [\n\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\" },\n\t\t{ width: 300, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" },\n\t\t{ width: 425, height: 150, url: \"http://cdn-0.nflximg.com/images/2891/Fracture425.jpg\" }\n\t];\n\n\t// You should return an array containing only the URL of the largest box art. Remember that reduce always returns an array with one item.\n\treturn boxarts\n\t.reduce((acc, value) =>\n\t(acc.width * acc.height) > (value.width * value.height) ? acc : value)\n\t.map(({ url }) => url);\n}", "title": "" }, { "docid": "76a41c4a18ab6c7bf8fb271712a23c40", "score": "0.56489", "text": "function setWidthHeight() {\n var innerBox = $('.inner-box');\n var iw = innerBox.outerWidth();\n var ih = (iw * 295) / 784;\n innerBox.outerHeight(ih);\n\n var num;\n $('.border-box').each(function () {\n if($(this).attr('resize') != 'true') {\n console.log(123);\n num = '.img-handle-' + $(this).data('value');\n num = $(num);\n num1 = '.position-box-' + $(this).data('value');\n var type = $(this).data('type');\n var cate = $(this).data('category');\n switch (type){\n case 4:\n var text = num;\n iw = parseInt(text.outerWidth()) + parseInt(20);\n ih = parseInt(text.outerHeight()) + parseInt(20);\n num.height(ih - 20);\n num.width(iw - 20);\n num.css('margin', '10px');\n break;\n case 3:\n var el = num.find('.img-box-set').first();\n var image = new Image();\n image.src = el.attr(\"src\");\n iw = image.naturalWidth;\n ih = image.naturalHeight;\n console.log(32);\n if(cate == 1){\n iw= num.css('width');\n ih = num.css('height');\n } else {\n if(iw > 100){\n ih = ih * 100/iw;\n iw = 100;\n }else{\n ih = 100;\n iw = 100;\n }\n }\n num.height(ih);\n num.width(iw);\n break;\n case 2 :\n if(cate == 1){\n iw= num.css('width');\n ih = num.css('height');\n }\n if(cate == 0){\n iw = 580;\n ih= 218;\n }\n num.height(ih);\n num.width(iw);\n break;\n default :\n iw = innerBox.outerWidth();\n ih = innerBox.outerHeight();\n num.height(ih);\n num.width(iw);\n }\n $(this).height(ih);\n $(this).width(iw);\n }\n });\n}", "title": "" }, { "docid": "a1cd3b0535fe66477011f4a43e15de3c", "score": "0.5646258", "text": "function createBox(size)\r\n{\r\n\tfor(var i=0; i<size; i++)\r\n\t{\r\n\t\t$(\".row\").append(\"<div class='box'></div>\");\r\n\t\tif(i === (size-1))\r\n\t\t{\r\n\t\t\t$(\".box:nth-child(\"+size+\")\").addClass(\"last-box\").after(\"<div class='clr'></div>\");\r\n\t\t}\r\n\t}\r\n\t$(\".box\").append(\"<img />\")\r\n}", "title": "" }, { "docid": "ffac9f335e0923a6fa4360fbbc3fb0b2", "score": "0.562475", "text": "function setThumbs() {\n for (let i = 0; i < 12; i++) {\n $(\".project-section.left\").append(\n '<div class=\"project-thumbnail-container\">' +\n '<img draggable=\"false\" (dragstart)=\"false;\" class=\"project-thumbnail unselectable\" />' +\n '</div>');\n }\n\n $(\".project-thumbnail-container\").css({opacity: 0});\n\n $(\".project-thumbnail\").each(function(idx) {\n $(this)\n .data(\"index\", idx)\n .attr({src: projects[idx].thumb});\n });\n }", "title": "" }, { "docid": "d7a3ac84c5b41f9c144b08c0da7d89aa", "score": "0.56155866", "text": "function cutBox() {\n // const clearArray = [];\n\n for(let i = 0; i < width*width; i++)\n {\n let newDiv = document.createElement('div');\n newDiv.setAttribute('id', i);\n box.append(newDiv);\n\n }\n}", "title": "" }, { "docid": "dbbb8a431ccc2074d9af8424ebe29420", "score": "0.5613592", "text": "function make_grid(){\n $(\".wall\").html(\"\");\n // console.log($(window).height());\n\t\t\t//console.log($(window).width());\n\t\t\tvar min_col=230;\t\t\t\t\t\t\t\t\t\t//minimum column 11px megalitero apo auto poy theloume\n\n\t\t\tvar main_cont=$(window).width()-240;\t\t\t//platos parathiroy xoris to menu (220px)\n\t\t\tn_cols=parseInt(main_cont/min_col);\t\t//arithmos sthlwn\n\t\t\t//console.log(\"main content\"+main_cont);\n\t\t\t//console.log(\"sthles\"+main_cont/min_col ,parseInt(main_cont/min_col), \"kathe mia \" );\n\t\t\t\t\t\t//platos sthlhs\n\t\t\tif(n_cols>=4)\n\t\t\t{\n\t\t\t\tcol_width=main_cont/n_cols-6;\n\t\t\t}\n\t\t\telse if(n_cols==3)\n\t\t\t{\n\t\t\t\tcol_width=main_cont/n_cols-8;\n\n\t\t\t}\n\t\t\telse if(n_cols==2)\n\t\t\t{\n\t\t\t\tcol_width=main_cont/n_cols-11;\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\tcol_width=main_cont/n_cols-22;\n\n\t\t\t}\n\n\n\n\t\t\t//console.log(col_width);\n\n\t\t\tfor(i=1; i<=n_cols; i++)\n\t\t\t{\n\n\t\t\tvar div=jQuery('<div/>', {\n \t\t\t\tclass: 'col'+i+' col',\n \t\t\t\t}).appendTo(\".wall\");\n\n\n\t\t\t}\n //kathorismos platous expanded menu\n if(n_cols==1){\n $(\".expanded\").css(\"width\",col_width-40);\n }\n else{\n $(\".expanded\").css(\"width\",2*col_width-40);\n }\n}", "title": "" }, { "docid": "e8f12d430172333eecd9bf0dfc975966", "score": "0.56092435", "text": "function resizeBoxes() {\n\n // set scaleRatio to some value. The larger this is,\n // the smaller this box will be\n const scaleRatio = 100;\n\n // calculate a scale value that will change the box sizes based on either\n // the height or the width of the window--whichever is larger!\n let scale = Math.max(window.innerWidth / scaleRatio, window.innerHeight / scaleRatio);\n\n // print out the calculated scale value to the console\n console.log(`scale: ${scale}`);\n\n // loop through each box\n for(let i = 0; i < boxes.length; i++) {\n let currBox = boxes[i];\n\n // set the width and height of the box to be the same value. This\n // makes them squares no matter what the size of the window is.\n currBox.style.width = `${scale}em`;\n currBox.style.height = `${scale}em`;\n currBox.style.fontSize = `${scale*1.5}px`;\n currBox.innerHTML = `current size: ${scale}em, font size: ${Math.floor(scale*1.5)}px`;\n \n /* Note:\n *\n You can multiply that scale value by whatever you want to\n to change the aspect ratio to whatever you want:\n \n currBox.style.width = `${scale}em`;\n currBox.style.height = `${scale*2}em`;\n *\n */\n }\n}", "title": "" }, { "docid": "7138d0f19489ace011246a37cecafe34", "score": "0.5607851", "text": "function makeSizer() \n {\n /* let image = document.createElement(\"iframe\");\n image.setAttribute(\"id\", \"tempId\");\n image.setAttribute(\"src\", iframeUrl);\n image.setAttribute(\"width\", iwidth);\n image.classList.add(\"bordered\");*/\n\n\n\n /* find placeholder element - that's where the resizable image will go */\n let elem = document.getElementById(placeholder);\n\n /* create flexbox button container */\n let sizer = document.createElement(\"sizerbutton-container\");\n\n /* create + and - buttons and hide buttons and set their click events */\n let buttonPlus = document.createElement(\"sizer-button\");\n buttonPlus.appendChild(document.createTextNode('+'));\n buttonPlus.addEventListener(\"click\", function () { biggerImage(\"tempId\") });\n\n let buttonMinus = document.createElement(\"sizer-button\");\n buttonMinus.appendChild(document.createTextNode('-'));\n buttonMinus.addEventListener(\"click\", function () { smallerImage(\"tempId\") });\n\n let hideButton = document.createElement(\"sizer-button\");\n hideButton.appendChild(document.createTextNode('HIDE'));\n hideButton.addEventListener(\"click\", function () { Hide(\"tempId\")});\n elem.appendChild(sizer);\n photoBox.appendChild(image);\n}", "title": "" }, { "docid": "1829b9f6c0de1c28ae2c5cd887931deb", "score": "0.5582211", "text": "function sizeOfBoxes() {\r\n var boxspecs = boxCoordinator();\r\n var width = 100 / boxspecs.columns;\r\n var height = 100 / boxspecs.rows;\r\n console.log(boxspecs);\r\n $(\"div.box-group\")\r\n .children()\r\n .each(function(i, val) {\r\n $(this).css(\"width\", width.toString() + \"%\");\r\n $(this).css(\"height\", height.toString() + \"%\");\r\n $(this).removeClass(\"hidden\");\r\n if (boxspecs.hidenbox > 0 && boxspecs.showbox < i + 1) {\r\n $(this).addClass(\"hidden\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "c9e5a496a594cbc65e4b966dc4334a39", "score": "0.5576507", "text": "function initImgs() \n{\n\t// Div and image definitions\n\tvar divDef = \"<div class = 'w3-row' style = 'margin:auto;width: 90%'>\";\n\tvar divEnd = \"</div>\";\n\tvar imgDivDef = \"<div class = 'w3-col w3-quarter'>\";\n\tvar imgDivEnd = \"</div>\";\n\tvar imgStyle = \"style = 'width:100%; padding: 7px' onClick = onClickPreview(this)>\";\n\n\t// Get the DOM element we are going to fill\n\tvar imgContainer = document.getElementById(\"imgContainer\");\n\n\t// We will be makin rows of kNumColumns\n\t// rows = imgDb.length / kNumColumns\n\tvar rowCnt = imgDb.length / kNumColumns;\n\n\t// Check if we have an extra incomplete row\n\tvar rowRemaind = imgDb.length % kNumColumns;\n\t\n\t// For each row ...\n\tvar lastId = -1;\n\tif(rowCnt > 0)\n\t{\n\t\tvar remHack = rowCnt - 1;\n\t\tif(rowRemaind == 0) remHack = rowCnt;\n\t\tfor(var r = 0; r < remHack; r++)\n\t\t{\n\t\t\timgContainer.innerHTML += divDef;\n\n\t\t\t// For each image ...\n\t\t\tfor(var i = 0; i < kNumColumns; i++)\n\t\t\t{\n\t\t\t\tlastId = (i + kNumColumns * r);\n\t\t\t\tvar imgId = \"id = '\" + lastId + \"'\";\n\t\t\t\tvar img = \"<img class = 'pImg' src = '\" + imgDb[lastId][0] + \"'\" + imgId + imgStyle;\n\t\t\t\timgContainer.innerHTML += imgDivDef + img + imgDivEnd;\n\t\t\t\tspawnImgs++;\n\t\t\t}\n\n\t\t\timgContainer.innerHTML += divEnd;\n\t\t}\n\t}\n\n\t// Remainder ...\n\tif(rowRemaind > 0)\n\t{\n\t\timgContainer.innerHTML += divDef;\n\t\tfor(var i = 0; i < rowRemaind; i++)\n\t\t{\n\t\t\tlastId = lastId + 1;\n\t\t\tvar imgId = \"id = '\" + lastId + \"'\";\n\t\t\tvar img = \"<img src = '\" + imgDb[lastId][0] + \"'\" + imgId + imgStyle;\n\t\t\timgContainer.innerHTML += imgDivDef + img + imgDivEnd;\n\t\t\tspawnImgs++;\n\t\t}\n\t\timgContainer.innerHTML += divEnd;\n\t}\n}", "title": "" }, { "docid": "a01e4dd3f4ccfac32c7af8bfb89652f0", "score": "0.55621254", "text": "function showCakes() {\n console.log(\"showCakes()\");\n cakes.forEach((cake) => {\n\n //creating div container\n var cakeContainer = document.createElement(\"div\");\n cakeContainer.classList.add(\"cake-container\");\n document.querySelector(\".container\").append(cakeContainer);\n\n //adding 1rst column (bakery)\n var cakeBakery = document.createElement(\"h2\");\n cakeBakery.classList.add(\"bakery\");\n cakeBakery.innerText = cake.fields.bakery;\n cakeContainer.append(cakeBakery);\n\n //adding 2nd column (from)\n var cakeFrom = document.createElement(\"p\");\n cakeFrom.classList.add(\"from\");\n cakeFrom.innerText = cake.fields.from;\n cakeContainer.append(cakeFrom);\n\n //adding 3rd column(pix) for images using \"img\" and src \n var cakePix = document.createElement(\"img\");\n cakePix.classList.add(\"pix\");\n cakePix.src = cake.fields.pix[0].url;\n cakeContainer.append(cakePix);\n\n // add event listener\n // when user clicks on cake container\n //img and description will appear or disappear\n cakeContainer.addEventListener(\"click\", function(){\n cakeFrom.classList.toggle(\"active\");\n cakePix.classList.toggle(\"active\");\n })\n\n });\n }", "title": "" }, { "docid": "502f7457046f6c1f84cb97fc5144eac9", "score": "0.5554737", "text": "function exc15() {\n\tvar boxarts = [\n\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\" },\n\t\t{ width: 300, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" },\n\t\t{ width: 425, height: 150, url: \"http://cdn-0.nflximg.com/images/2891/Fracture425.jpg\" }\n\t],\n\tcurrentSize,\n\tmaxSize = -1,\n\tlargestBoxart;\n\n\tboxarts.forEach(({ width, height, url }) => {\n\t\tcurrentSize = width * height;\n\t\tif (currentSize > maxSize) {\n\t\t\tmaxSize = currentSize;\n\t\t\tlargestBoxart = { width, height, url };\n\t\t}\n\t})\n\n\treturn largestBoxart;\n}", "title": "" }, { "docid": "b8b3c3aa73f1b6899d70c057b9e3c3db", "score": "0.55468094", "text": "function addClareFlow(x,y,size) {\n\tvar flow = new MultiWidgets.ItemFlowWidget();\n\tflow.setLocation(x,y); // readjust later\n\tfor (var i=1; i<=20; i++) {\n\tvar imgItem = new MultiWidgets.ImageWidget();\n\tvar path = \"Media/Clare_journal/image\" + i + \".jpg\";\n\tif (imgItem.load(path)) {\n\t\timgItem.addOperator(new MultiWidgets.StayInsideParentOperator());\n \t \timgItem.resizeToFit(new Nimble.SizeF(size,size));\n\n\t\tflow.addItem(imgItem);\n\t\t}\n\t}\n\troot.addChild(flow);\n\tflow.raiseToTop();\n\n\treturn flow;\n}", "title": "" }, { "docid": "7b965abfe38829809ce4a754150cc37a", "score": "0.55396265", "text": "function main_loop(){\n\t\t\n\t\t//img_divs = $('#contentPane .O-F-X[data-content-url]'); //OLD\n\t\t//img_divs = $('#contentPane .H-y-qa[data-content-url]'); //OLD\n img_divs = $(SEL.img_divs); //$('#contentPane .F-y-Ia[data-content-url]'); //NEW\n\t\t\n\t\t//console.log(img_divs);\n\t\t\n\t\timg_count = img_divs.length;\n\t\t\t\n\t\timg_divs.each(function(){\n\t\t\tvar t = $(this);\n\t\t\t//var img_url = t.attr('data-content-url');\n\t\t\tvar img = t.find('img:first'); //#new\n\t\t\tvar imgs_container = img.parent().parent().parent(); //#new\n\t\t\tvar img_url = img.attr('src'); //#new\n\t\t\tvar url_hash;\n\t\t\tif( !t.hasClass('gpp__hide_images_tagged') && !isThumbnail(t) ){\n\t\t\t\t//Process new images\n\t\t\t\turl_hash = md5(img_url);\n\t\t\t\tt.addClass('gpp__hide_images_tagged');\n\t\t\t\t//t.after('<div id=\"gpp__hide_images_button_' + i + '\" style=\"margin:7px 9px; height: 5px;width: 91%;\" class=\"gpp__hide_images Ah Ft h-na-o-z\"><span role=\"button\" tabindex=\"0\"><span style=\"margin-top:-5px\" class=\"\" title=\"Hidden image\"></span><span style=\"font-size:9px; margin:-3px 0 0 20px;position:absolute\"><a>SHOW / HIDE</a></span></span></div>'); //OLD\n\t\t\t\tvar ish_wrap = t.parent().parent().parent().parent().parent().parent().parent().parent().find(SEL.img_show_hide_wrap);\n\t\t\t\tish_wrap.append('<div id=\"gpp__hide_images_button_' + i + '\" style=\"background:url(' + chrome.extension.getURL('icon.camera.png') + ') no-repeat; margin:-19px 137px; height:auto;width: 88px;background-position-y:0px; height:1.2em; float:left;background-color:whiteSmoke\" class=\"gpp__hide_images\"><span role=\"button\" tabindex=\"0\"><span style=\"margin-top:0px\" class=\"\" title=\"Hidden image\"></span><span style=\"font-size:9px; padding-top:2px; margin:0px 0 0 22px;position:absolute\"><a>SHOW / HIDE</a></span></span></div>'); //NEW Lr9 Hw i-wa-m-v\n\n\t\t\t\t//var img = t;\n\t\t\t\tvar button = ish_wrap.find('#gpp__hide_images_button_' + i + ':first');\n\t\t\t\tbutton.hover(function(){\n\t\t\t\t\t$(this).css('background-color', 'rgb(225,225,225)');\n\t\t\t\t},\n\t\t\t\tfunction(){\n\t\t\t\t\t$(this).css('background-color', 'whiteSmoke');\n\t\t\t\t});\n\t\t\t\tbutton.click(function(){\n\t\t\t\t\tif( imgs_container.is(':visible') ){\n\t\t\t\t\t\t//Hide\n\t\t\t\t\t\tGM_setValue('gpp__hidden_img_url_' + url_hash, true);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//Show\n\t\t\t\t\t\tGM_removeItem('gpp__hidden_img_url_' + url_hash);\n\t\t\t\t\t}\n\t\t\t\t\t//Toggle show/hide\n\t\t\t\t\timgs_container.toggle();\n\t\t\t\t});\n\t\t\t\ti++;\n\t\t\t}else{\n\t\t\t\t//Process existing images\n\t\t\t\tif( imgs_container.is(':visible') ){\n\t\t\t\t\tif(hide_images_by_default){\n\t\t\t\t\t\tif(!imgs_container.hasClass('gpp__hide_images_tagged_shown')){\n\t\t\t\t\t\t\timgs_container.addClass('gpp__hide_images_tagged_shown');\n\t\t\t\t\t\t\timgs_container.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\turl_hash = md5(img_url);\n\t\t\t\t\t\tvar hidden_img_url = GM_getValue('gpp__hidden_img_url_' + url_hash, false);\n\t\t\t\t\t\tif(hidden_img_url){\n\t\t\t\t\t\t\timgs_container.hide();\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\n\t\t});\n\t}", "title": "" }, { "docid": "ebbc8d35ed516981fe670b8fc0171264", "score": "0.5536544", "text": "function createSquares() {\n for (var i = 1; i < NUM * NUM; i++) {\n var div = document.createElement(\"div\");\n div.className = \"puzzletile\";\n div.innerHTML = i;\n var row = Math.floor((i - 1) / NUM);\n var column = (i - 1) % NUM;\n var x = column * -1 * WIDTH + \"px\";\n var y = row * -1 * WIDTH + \"px\";\n\n \n div.style.height = WIDTH - 10 + \"px\";\n div.style.width = div.style.height;\n \n div.style.backgroundPosition = x + \" \" + y;\n \n div.id = \"square_\" + row + \"_\" + column;\n \n div.style.top = row * WIDTH + \"px\";\n div.style.left = column * WIDTH + \"px\";\n setEvents(div);\n document.getElementById(\"puzzlearea\").appendChild(div);\n }\n }", "title": "" }, { "docid": "48419fbc2a2fe484d18997d84c3056c5", "score": "0.553306", "text": "function genBoxes(data)\n{\n var ipoint=document.querySelector(\".db-boxes\");\n\n for (var x=0;x<data.length;x++)\n {\n var newbox=new dbBox();\n newbox.name=data[x].name;\n newbox.img=data[x].img;\n newbox.tags=data[x].tags;\n newbox.type=data[x].type;\n newbox.link=data[x].link;\n newbox.id=data[x].id;\n newbox.wide=data[x].wide;\n\n newbox.classList.add(\"new\");\n\n ipoint.appendChild(newbox);\n }\n\n boxEvents();\n}", "title": "" }, { "docid": "d99b6244f8069bca6f8617d855eabe62", "score": "0.55002373", "text": "function spaceEmpty(){\r\n for (var i = 1; i < 8; i++) {\r\n var hijos = 7- $(\".col-\"+i).children('img').length;\r\n for (var j = 0; j < hijos; j++) {\r\n var ClaseDulce= Math.floor((Math.random() * 4) + 1);\r\n var ElementImg=document.createElement('img')\r\n $(\".col-\"+i).prepend(ElementImg)\r\n $(ElementImg).addClass('elemento')\r\n $(ElementImg).attr('src',\"image/\"+ClaseDulce+\".png\")\r\n };\r\n };\r\n \r\n newCandyEvent();\r\n}", "title": "" }, { "docid": "d1a7963c99eef536c7834dd5d97a8156", "score": "0.5499873", "text": "function createGrid(size) {\n\twhile (wrapper.firstChild) {\n\t\twrapper.removeChild(wrapper.firstChild);\n\t}\n\twrapper.style[\"grid-template-columns\"] = `repeat(${size}, 1fr)`;\n\tfor(var i = 0; i < size * size; i++) {\n\t\tboxArr[i] = document.createElement('div');\n\t\tboxArr[i].classList.add('box');\n\t\tboxArr[i].addEventListener(\"mouseover\", mouseOver);\n\t\twrapper.appendChild(boxArr[i]);\n\t}\n}", "title": "" }, { "docid": "64a7a1ba63e2829fcc47952eebf5c41b", "score": "0.54872113", "text": "function buildGrid() {\n const docFragment = document.createDocumentFragment();\n shuffle(pictureArr); //Returns a shuffled array of pictures\n // for (const pict of pictureArr) {\n pictureArr.forEach(function(pict) {\n const cards = document.createElement(\"li\");\n\n const picture = document.createElement(\"i\");\n picture.setAttribute(\"class\", pict);\n\n cards.appendChild(picture);\n cards.classList.add(\"card\", \"close\");\n\n docFragment.appendChild(cards);\n });\n\n const cardsFrame = document.querySelector(\".card_frame\");\n cardsFrame.appendChild(docFragment);\n}", "title": "" }, { "docid": "0edac6e5e25e46bf013799435f52dd45", "score": "0.54838026", "text": "function addWineFlow(x,y,size) {\n\tvar flow = new MultiWidgets.ItemFlowWidget();\n\tflow.setLocation(x,y); \n\tfor (var i=1; i<=5; i++) {\n\tvar imgItem = new MultiWidgets.ImageWidget();\n\tvar path = \"Media/Similar_journal/wine\" + i + \".png\";\n\tif (imgItem.load(path)) {\n\t\timgItem.addOperator(new MultiWidgets.StayInsideParentOperator());\n \t \timgItem.resizeToFit(new Nimble.SizeF(size,size));\n\t\tflow.addItem(imgItem);\n\n\t\t}\n\t}\n\troot.addChild(flow);\n\tflow.raiseToTop();\n\n\treturn flow;\n\n}", "title": "" }, { "docid": "5cd52536b0ca09fe22696fdd1fda0a22", "score": "0.54721946", "text": "function makeDisplay(wSize) {\n let area = wSize * wSize;\n\n for (i = 0; i < area; i++) {\n const canvas = document.createElement('div');\n canvas.className = 'canv';\n canvas.id = i;\n canvas.style.display = 'flex';\n canvas.addEventListener(\"mouseover\", draw);\n displayContainer.appendChild(canvas);\n displayContainer.style.setProperty('grid-template-columns', 'repeat(' + wSize + ', 1fr)');\n\n if (wSize < 30) {\n canvas.style.width = '20px';\n canvas.style.height = '20px';\n\n } else if (wSize < 45) {\n canvas.style.height = '15px';\n canvas.style.width = '15px';\n\n } else if (wSize < 60) {\n canvas.style.height = '10px';\n canvas.style.width = '10px';\n } else {\n canvas.style.height = '5px';\n canvas.style.width = '5px';\n };\n\n };\n\n}", "title": "" }, { "docid": "3d65a80f32ab619b5f9125c8413aa41d", "score": "0.54687154", "text": "function makeGrid(){\n for (let i = 0; i < 4; i++){\n const row = document.createElement('div');\n parent.appendChild(row)\n for (let j = 0; j < 4; j++){\n // needed for unique card class\n const rn = (i+1).toString();\n const cn = (j+1).toString();\n // div creation step\n const container = document.createElement('div');\n const flipCard = document.createElement('div');\n const front = document.createElement('div');\n const back = document.createElement('div');\n // class set up step\n container.setAttribute('class', 'container');\n flipCard.setAttribute('class', 'flipCard');\n back.setAttribute('class', 'r'+ rn + 'c' + cn + ' ' + 'cell' + ' ' + 'back');\n front.setAttribute('class', 'front'+' '+'cell');\n //set position\n let picWidth = 128;\n let spaceTop =12;\n let spaceLeft =8;\n if (window.innerWidth < 530){\n picWidth = 65;\n spaceTop = 0;\n spaceLeft = 0;\n }\n const margin = (window.innerWidth - (picWidth*4))/2;\n container.style.top = (j * (picWidth+spaceTop) + 220).toString() + 'px';\n container.style.left = (i * (picWidth+spaceLeft) + margin).toString() + 'px';\n //append step\n flipCard.appendChild(front)\n flipCard.appendChild(back)\n container.appendChild(flipCard)\n row.appendChild(container)\n //adds an image to the back\n const img = document.createElement('img');\n img.setAttribute('src', 'img/001-insignia.png');\n img.setAttribute('class', 'pic' + ' ' + i+j);\n front.appendChild(img);\n }\n }\n }", "title": "" }, { "docid": "28a116ef7797760e0a10d9156d6461f7", "score": "0.54587716", "text": "function createCanvas() {\n\t\tvar numSquares = 3040;\n\t\tfor (var i = 0; i < numSquares; i++) {\n\t\t var pixelDiv = $(\"<div>\").addClass(\"square\");\n\t\t pixelDiv.appendTo(\"body\");\n\t\t pixelDiv.on(\"click\", function() {\n\t\t addColor($(\"#color-field\").val(), $(this));\n\t\t });\n\t\t}\n\t}", "title": "" }, { "docid": "e0af1f6bd022f5e325e0572a03ae3fa8", "score": "0.54539233", "text": "function run() {\n\tww = $(window).width();\n\tvCenter();\n\tmainHeight();\n\tfeatTextSize();\n\teqlBox($('.grid_box'));\t\n\teqlBox($('.feat_box_alt .lower'));\t\n}", "title": "" }, { "docid": "537fd633569fc8d399dac77b9eca69fb", "score": "0.5437483", "text": "function createGrid(x,y) {\n for (i = 0; i < x*y; i ++) {\n const box = document.createElement('div');\n box.classList.add('square');\n box.setAttribute('style', 'width:'+1000/x+'px; height:'+1000/x+'px;');\n document.querySelector('.container').append(box); \n };\n refreshDraw()\n}", "title": "" }, { "docid": "087143e9333b7cd245683411e09a7e18", "score": "0.54320633", "text": "function fakeTope(show){\n\tvar imgs = [].slice.call(document.querySelectorAll(\".imgContainer .imgWrap\"));\n\tvar container = document.querySelector(\".imgContainer\");\n\tvar imgHeight = document.querySelector(\".visible\").getBoundingClientRect().height; \n\tvar imgWidth = document.querySelector(\".visible\").getBoundingClientRect().width;\n\tvar maxW = container.offsetWidth;\n\tvar imgCount = 0;\n\tvar currRow = 1;\n\tvar currW = 0;\n\tvar x,y;\n\n\t//check if each image is being displayed and position accordingly\n\n\timgs.forEach(function (img){\n\t\timg.style.transition =\"0.4s\"\n\t\tif (img.dataset.category === show || show === \"All\"){\n\t\t\t//show & position image\n\t\t\timg.classList.add(\"visible\");\n\t\t\timg.style.transform =img.style.transform.replace(\"scale(0)\",\"scale(1)\");\n\n\t\t\tif (currW + imgWidth > maxW){\n\t\t\t\tx = 0;\n\t\t\t\tcurrRow += 1;\n\t\t\t\timgCount = 1;\n\t\t\t} else {\n\t\t\t\tx = (Math.floor(imgWidth) * imgCount-1) + \"px\";\n\t\t\t\timgCount +=1;\n\t\t\t}\n\t\t\tcurrW = (imgWidth * (imgCount));\n\t\t\ty= (Math.floor(imgHeight) * (currRow -1)) + \"px\";\n\t\t\timg.style.transform = \"translate3d(\" + x + \",\"+ y + \",0)\" +\"scale(1)\";\n\t\t} else {\n\t\t\t//hide image\n\t\t\timg.classList.remove(\"visible\");\n\t\t\timg.style.transform =img.style.transform.replace(\"scale(1)\",\"scale(0)\");\n\t\t}\n\t});\n\tcontainer.style.height = (imgHeight * currRow) + \"px\";\n}", "title": "" }, { "docid": "5278a9eef24209c06614111f383c7170", "score": "0.5431215", "text": "function calc() {\n\n\t\t$( '.entry-thumbnail, .entry-gallery, .entry-media, .hentry.format-video > .video-wrapper, .caption-big' ).each( function() {\n\t\t\tif( $( window ).width() < 768 ) {\n\t \t\t$( this ).css( 'width', '100%' ).css( 'width', '+=40px' );\n\t \t\tif ( $( 'body' ).hasClass( 'rtl' ) ) {\n\t\t \t\t$( this ).css( 'margin-right', '-20px' );\n\t \t\t} else {\n\t\t \t\t$( this ).css( 'margin-left', '-20px' );\n\t \t\t}\n\t\t\t} else if( $( window ).width() < 960 ) {\n\t \t\t$( this ).css( 'width', '100%' ).css( 'width', '+=80px' );\n\t \t\tif ( $( 'body' ).hasClass( 'rtl' ) ) {\n\t\t \t\t$( this ).css( 'margin-right', '-40px' );\n\t \t\t} else {\n\t\t \t\t$( this ).css( 'margin-left', '-40px' );\n\t \t\t}\n\t\t\t} else {\n\t\t\t\t$( this ).css( {\n\t\t\t\t\t'width': '',\n\t\t\t\t\t'margin-right': '',\n\t\t\t\t\t'margin-left': ''\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t\t$( '.caption-big' ).each( function() {\n\t\t\tif( $( window ).width() < 960 ) {\n\t \t\t$( this ).css( 'max-width', '200%' );\n\t\t\t} else {\n\t\t\t\t$( this ).css( 'max-width', '' );\n\t\t\t}\n\t\t} );\n\t\t$( '.image-big' ).each( function() {\n\t\t\tif( $( window ).width() < 768 ) {\n\t \t\t$( this ).parents( '.image-big-wrapper' ).css( {\n\t \t\t\t'display': 'block',\n\t \t\t\t'width': '100%',\n\t \t\t} ).css( 'width', '+=40px' );\n\t \t\tif ( $( 'body' ).hasClass( 'rtl' ) ) {\n\t\t \t\t$( this ).parents( '.image-big-wrapper' ).css( 'margin-right', '-20px' );\n\t \t\t} else {\n\t\t \t\t$( this ).parents( '.image-big-wrapper' ).css( 'margin-left', '-20px' );\n\t \t\t}\n\t\t\t} else if( $( window ).width() < 960 ) {\n\t \t\t$( this ).parents( '.image-big-wrapper' ).css( {\n\t \t\t\t'display': 'block',\n\t \t\t\t'width': '100%',\n\t \t\t} ).css( 'width', '+=80px' );\n\t \t\tif ( $( 'body' ).hasClass( 'rtl' ) ) {\n\t\t \t\t$( this ).parents( '.image-big-wrapper' ).css( 'margin-right', '-40px' );\n\t \t\t} else {\n\t\t \t\t$( this ).parents( '.image-big-wrapper' ).css( 'margin-left', '-40px' );\n\t \t\t}\n\t\t\t} else {\n\t\t\t\t$( this ).parents( '.image-big-wrapper' ).css( {\n\t\t\t\t\t'display': '',\n\t\t\t\t\t'width': '',\n\t\t\t\t\t'margin-right': '',\n\t\t\t\t\t'margin-left': ''\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t}", "title": "" }, { "docid": "f7e5954bbdd83bbc1f2e05a6609a20fe", "score": "0.5429895", "text": "function boxCoordinator() {\r\n let hscreen = window.innerWidth; // Size of the viewport width\r\n let vscreen = window.innerHeight; // Size of the viewport height\r\n let boxtotal = $(\"div.box-group\").children(\"div.box\").length; // Number of boxes\r\n var reducedboxtotal = boxtotal; // Number of box that can be shown\r\n var x; // X for columns\r\n var y; // Y for rows\r\n var limit = 0;\r\n console.clear();\r\n console.log(\"-----------------\");\r\n do {\r\n var counter = 0; //column - number of box along the horizontal axis\r\n var result = 0; //row - number of box along the vertical axis\r\n var canfit = true;\r\n\r\n if (hscreen > vscreen) {\r\n console.log(\"---------------------------\");\r\n console.log(\"Calculating the columns\");\r\n console.log(\"---------------------------\");\r\n let looplimit = 0;\r\n // Find the number of column that is equal or +1 of the number of row\r\n do {\r\n counter++;\r\n result = reducedboxtotal / counter;\r\n looplimit++;\r\n } while (\r\n counter - result.toFixed(0) != 1 &&\r\n counter - result.toFixed(0) != 0 &&\r\n looplimit < 10\r\n );\r\n x = counter; // X gets the counter as number of columns\r\n y = result.toFixed(0); // Y gets the result as number of rows\r\n\r\n // Uncomment for debugging purposes\r\n // console.log(\"-----------------\");\r\n // console.log(\"hscreen: \", hscreen);\r\n // console.log(\"columns: \", x);\r\n // console.log(\"total width columns: \", x * minboxwidth);\r\n // console.log(\"vscreen: \", vscreen);\r\n // console.log(\"rows: \", y);\r\n // console.log(\"total height columns: \", y * minboxheight);\r\n // console.log(\"Can fit before: \", canfit);\r\n\r\n //Check if x * minboxwidth <= hscreen to transfer some items to the next row\r\n\r\n var result = checkSizeToAllocate(x, y, hscreen, vscreen, reducedboxtotal);\r\n x = result.x;\r\n y = result.y;\r\n canfit = result.canfit;\r\n reducedboxtotal = result.reducedbox;\r\n } else {\r\n // Find the number of column that is equal or -1 of the number of row\r\n console.log(\"-----------------\");\r\n console.log(\"Calculating the rows\");\r\n console.log(\"-----------------\");\r\n let looplimit = 0;\r\n do {\r\n counter++;\r\n result = reducedboxtotal / counter;\r\n // console.log(result + \"=\" + boxtotal + \"/\" + counter);\r\n looplimit++;\r\n } while (\r\n counter - result.toFixed(0) != 1 &&\r\n counter - result.toFixed(0) != 0 &&\r\n looplimit < 10\r\n );\r\n x = result.toFixed(0); // X gets the counter as number of columns\r\n y = counter; // Y gets the result as number of rows\r\n\r\n // Uncomment for debugging purposes\r\n // console.log(\"-----------------\");\r\n // console.log(\"-----------------\");\r\n // console.log(\"hscreen: \", hscreen);\r\n // console.log(\"columns: \", x);\r\n // console.log(\"total width columns: \", x * minboxwidth);\r\n // console.log(\"vscreen: \", vscreen);\r\n // console.log(\"rows: \", y);\r\n // console.log(\"total height columns: \", y * minboxheight);\r\n // console.log(\"Can fit before: \", canfit);\r\n\r\n //Check if y * minboxheight <= vscreen to transfer some items to the next column\r\n var result = checkSizeToAllocate(x, y, hscreen, vscreen, reducedboxtotal);\r\n x = result.x;\r\n y = result.y;\r\n reducedboxtotal = result.reducedbox;\r\n console.log(\"Can fit after: \", canfit);\r\n }\r\n limit++;\r\n } while (!canfit && limit < 10);\r\n return {\r\n showbox: reducedboxtotal,\r\n hidenbox: boxtotal - reducedboxtotal,\r\n columns: x,\r\n rows: y\r\n };\r\n}", "title": "" }, { "docid": "10149dd6e65fd82569605ec69cd19218", "score": "0.54297256", "text": "function newCandy(){ \r\n for (var i = 1; i <8; i++) {\r\n for (var j = 1; j < 8; j++) {\r\n var candy= Math.floor((Math.random() * 4) + 1);\r\n var fila = \"<div class='row-\"+j+\"'></div>\";\r\n var ElementImg=document.createElement('img')\r\n $(\".col-\"+i).append(ElementImg)\r\n $(ElementImg).addClass('elemento')\r\n $(ElementImg).attr('src',\"image/\"+candy+\".png\") \r\n }\r\n }\r\n newCandyEvent();\r\n ValidateV();\r\n ValidateH();\r\n}", "title": "" }, { "docid": "27d14a938e868cd5391f2e76932ec957", "score": "0.542845", "text": "function buildPieces() {\n \n var a;\n var piece;\n var xPos = 0;\n var yPos = 0;\n \n //this loop sets all the pieces into place in the grid\n for(a = 0; a < scramble_rows * scramble_rows; a++) {\n piece = {};\n piece.sx = xPos;\n piece.sy = yPos;\n \n pieces.push(piece);\n \n xPos += pieceWidth;\n \n //this loop checks once the width is over pictureWidth, xPos goes to 0 and yPos increase by pieceHeight//\n if(xPos >= pictureWidth) {\n xPos = 0;\n yPos += pieceHeight;\n }\n }\n //when mouse is clicked over image, it scrambles into tiles\n document.onmousedown = shuffleScramble;\n}", "title": "" }, { "docid": "e4268d1350f84eba3eb4e0efa9ee7197", "score": "0.5425848", "text": "function createGrid() {\n let game = document.getElementById('game');\n\n // Creates the squares\n for (let i = 1; i <= 9; i++) {\n let square = document.createElement('div');\n square.id = 's' + i;\n square.className = 'container square item';\n game.appendChild(square);\n \n // Creates the boxes within the squares\n for (let j = 1; j <= 9; j++) {\n let box = document.createElement('div');\n box.id = 's' + i + 'b' + j;\n box.className = 'container box item';\n box.onclick = boxClicked;\n square.appendChild(box);\n\n // Container for the text\n let c = document.createElement('div');\n c.className = 'pCont';\n box.appendChild(c);\n\n // Text for the box\n let b = document.createElement('p');\n b.id = 's' + i + 'b' + j + 'p';\n b.className = 'boxP';\n c.appendChild(b);\n\n // Creates the note boxes within the boxes\n for (let k = 1; k <= 9; k++) {\n let note = document.createElement('div');\n note.id = 's' + i + 'b' + j + 'n' + k;\n note.className = 'item';\n box.appendChild(note);\n\n // Text for the note\n let n = document.createElement('p');\n n.id = 's' + i + 'b' + j + 'n' + k + 'p';\n n.className = 'noteP';\n note.appendChild(n);\n }\n }\n }\n}", "title": "" }, { "docid": "e0a370aff2328d58538dcd1d19d02bc7", "score": "0.5424749", "text": "function figify(){\n $('#event-content img[alt].give-caption, #news_listing img[alt].give-caption').each( function(i, val){\n $(this).css(\"height\", \"\");\n if($(this).css(\"margin-top\") == \"0px\"){\n \t$(this).css(\"margin-top\", \"5px\");\n $(this).css(\"margin-bottom\", \"5px\");\n }\n \tvar fig = $(\"<figure style='\" + $(this).attr(\"style\") + \"'></figure>\").insertAfter($(this));\n \t$(this).addClass('img-responsive');\n \t$(this).removeAttr('style');\n \t$(this).appendTo(fig);\n \t$(\"<figcaption>\" + $(this).attr('alt') + \"</figcaption>\").appendTo(fig);\n });\n}", "title": "" }, { "docid": "35bd5e215ae7de513c52853cde558abd", "score": "0.541894", "text": "function makeImages(cname, pname, categoryData) {\n var i = 0;\n var cont = document.getElementById(\"gallery\");\n var project = categoryData[cname][pname];\n // set sidebar according to cname and pname\n document.getElementById(cname).classList.add(\"toggled\");\n document.getElementById(pname).classList.add(\"current\");\n Array.prototype.map.call(document.getElementsByClassName(\"project-date\"), (e) => e.innerHTML = project[\"date\"]);\n Array.prototype.map.call(document.getElementsByClassName(\"project-description\"), (e) => e.innerHTML = project[\"description\"]);\n project[\"images\"].map((src) => {\n let div = document.createElement(\"div\");\n let a = document.createElement(\"a\");\n let img = document.createElement(\"img\");\n div.setAttribute(\"class\", \"slide\");\n img.setAttribute(\"class\", \"slide\");\n img.setAttribute(\"src\", src);\n a.setAttribute(\"name\", i);\n i++;\n div.appendChild(a);\n div.appendChild(img);\n cont.appendChild(div);\n });\n}", "title": "" }, { "docid": "f27e8e3a7d1fc67875d6011729e539b5", "score": "0.5416579", "text": "function mBoxElementBuilder(thisID,i){\n\t\t\tlet mBox = document.createElement(\"div\");\n\t\t\tmBox.className = \"moviebox\";\n\t\t\tmBox.id = \"mBox\"+ thisID;\n\t\t\tdocument.getElementById(\"movielist\").appendChild(mBox);\n\n\t\t\tlet mImg = document.createElement(\"img\");\n\t\t\t\tmImg.className = \"mPic\";\n\t\t\t\tmImg.src = \"./img/\" + moviedata[i].picurl;\n\t\t\t\tdocument.getElementById(\"mBox\"+thisID).appendChild(mImg);\n\n\t\t\tlet mTitle = document.createElement(\"p\");\n\t\t\t\tmTitle.className = \"movieTitle\";\n\t\t\t\tmTitle.id = \"mTitle\"+thisID;\n\t\t\t\tmTitle.textContent = moviedata[i].title;\n\t\t\t\tdocument.getElementById(\"mBox\"+thisID).appendChild(mTitle);\n\n\t\t\tlet mDscrptn = document.createElement(\"p\");\n\t\t\t\tmDscrptn.className = \"movieDscrptn\";\n\t\t\t\tmDscrptn.id = \"mDscrptn\"+thisID;\n\t\t\t\tmDscrptn.textContent = moviedata[i].dscrptn;\n\t\t\t\tdocument.getElementById(\"mBox\"+thisID).appendChild(mDscrptn);\n\n\t\t\tlet lBox = document.createElement(\"div\");\n\t\t\t\tlBox.className = \"likeBox\";\n\t\t\t\tlBox.id = \"lBox\"+thisID;\n\t\t\t\tdocument.getElementById(\"mBox\"+thisID).appendChild(lBox);\n\n\t\t\t\tlet liKes = document.createElement(\"p\");\n\t\t\t\t\tliKes.className = \"liKes\";\n\t\t\t\t\tliKes.id = \"liKes\"+thisID;\n\t\t\t\t\tliKes.textContent = \"Like \";\n\t\t\t\t\tliKes.addEventListener(\"click\", function(e){\n\t\t\t\t\t\tLiker(e.target.id);\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\tdocument.getElementById(\"lBox\"+thisID).appendChild(liKes);\n\n\t\t\t\t\tlet thumbUp = document.createElement(\"i\");\n\t\t\t\t\t\tthumbUp.className = \"fa fa-thumbs-up\";\n\t\t\t\t\t\tthumbUp.id = \"liKes\"+thisID;\n\t\t\t\t\t\tdocument.getElementById(\"liKes\"+thisID).appendChild(thumbUp);\n\n\t\t\t\tlet likeO = document.createElement(\"div\");\n\t\t\t\t\tlikeO.className = \"likeO\";\n\t\t\t\t\tlikeO.id = \"likeO\"+thisID;\n\t\t\t\t\tlikeO.textContent = moviedata[i].likes;\n\t\t\t\t\tdocument.getElementById(\"lBox\"+thisID).appendChild(likeO);\n\n}", "title": "" }, { "docid": "2e17115c8d34b27afd0efd6256e2c5c8", "score": "0.5415665", "text": "function getSize() {\n //choose the picture again\n Rechoose();\n\n //when press the size button, the web changed\n for (let f = 3; f < 6; f++) {\n document.getElementById(\"b\"+f.toString()).addEventListener(\"click\", function() {\n size = f; //get the size\n del(); //delete the size button\n PictureShow(); //show the pictures\n })\n }\n\n function PictureShow() {\n\n //get the pictures\n var frags = document.createDocumentFragment();\n for (var m = 0; m < 3; m++) {\n var element = document.createElement(\"img\");\n element.className = \"show\";\n element.id = \"ex\"+m.toString();\n if (m == 0) element.src = \"../image/Lovely.jpg\";\n else if (m == 1) element.src = \"../image/panda.jpg\";\n else element.src = \"../image/cat.jpg\";\n pic.push(element);\n frags.appendChild(element);\n }\n document.getElementById(\"selectShow\").appendChild(frags);\n\n //when the picture is clicked, the puzzle is forming\n for (let q = 0; q < 3; q++) {\n document.getElementById(\"ex\"+q.toString()).addEventListener(\"click\", function() {\n if (permit) {\n document.getElementById(\"ex\"+q.toString()).className = \"Big\";\n puzzle = q;\n Dealing(size, puzzle);//forming puzzle\n permit = false;\n return permit;\n }\n })\n } \n }\n \n //button delete function\n function del() {\n var parent = document.getElementById(\"Whole\");\n var child = document.getElementById(\"choice\");\n parent.removeChild(child);\n }\n \n //first delete the current puzzle, and change the status of the other buttons\n function Rechoose() {\n document.getElementById(\"R1\").addEventListener(\"click\",function() {\n var parent = document.getElementById(\"pictures\");\n var child = document.getElementById(\"pic\");\n parent.removeChild(child);\n permit = true;\n while (Images.length!=0) {\n Images.pop();\n }\n document.getElementById(\"ex\"+puzzle.toString()).className = \"show\";\n document.getElementById(\"Start\").className = \"origin\";\n document.getElementById(\"R1\").className = \"origin\";\n document.getElementById(\"showStep\").className = \"origin\";\n count = 0;\n document.getElementById(\"step\").value = count.toString();\n return permit;\n })\n \n \n }\n\n //Puzzle dealing\n function Dealing(size, puzzle) {\n document.getElementById(\"Start\").className = \"act\";\n document.getElementById(\"R1\").className = \"act\";\n var sum = size*size;\n var maxnumber = sum-1;\n\n Images = getImages();\n Begin();\n var h = new Action();\n \n //get pieces of the image\n function getImages() {\n var element = document.createElement(\"div\");\n element.id = \"pic\";\n document.getElementById(\"pictures\").appendChild(element);\n var fragss = document.createDocumentFragment();\n for (var i = 0; i < sum; i++) {\n element = document.createElement('div');\n element.x = Math.floor(i/size);\n element.y = i % size;\n if (size == 4) element.className = \"Block \"+picClass[puzzle]+(\"img\") + i.toString();\n else if (size == 3) element.className = \"Block \"+picClass[puzzle]+\"p\" + i.toString();\n else if (size == 5) element.className = \"Block \"+picClass[puzzle]+\"a\" + i.toString();\n Images.push(element);\n fragss.appendChild(element);\n }\n document.getElementById(\"pic\").appendChild(fragss);\n document.getElementById(\"showStep\").className = \"act\";\n return Images;\n }\n \n //get a random position\n var Random = function () {\n return Math.floor(Math.random()*sum);\n }\n\n //reset the current flag array\n var resetFlag = function() {\n for (var j = 0; j < sum; j++) {\n pos[j] = true;\n }\n }\n\n //get a random arrangment of the puzzle\n var Mess = function() {\n var reset = new resetFlag();\n for (var g = 0; g < sum; g++) {\n Images[g].picture = Random();\n while (true) {\n if (pos[Images[g].picture]) {\n pos[Images[g].picture] = false;\n break;\n } else {\n Images[g].picture = Random();\n }\n }\n }\n\n //judge whether it has a solution, if not, let it be\n var coverPairCount = 0;\n var d = 0;\n for (var i = 0; i < sum; i++) {\n if (Images[i].picture == maxnumber) {\n d = Images[i].x + Images[i].y;\n }\n for (var j = i+1; j < sum; j++) {\n if(Images[i].picture > Images[j].picture) {\n ++coverPairCount;\n }\n }\n }\n if ((coverPairCount&1) == (d&1)) {\n //change it into an odd one\n var h = Images[sum-1].picture;\n Images[sum-1].picture = Images[sum-2].picture;\n Images[sum-2].picture = h;\n }\n\n //finally get all arranged\n for (k = 0; k < sum; k++) {\n if (Images[k].picture == maxnumber) {\n EmptyY = Images[k].y;\n EmptyX = Images[k].x;\n }\n if (size == 4) Images[k].className = \"Block \"+picClass[puzzle]+ (\"img\") + Images[k].picture.toString();\n else if (size == 3) Images[k].className = \"Block \"+picClass[puzzle]+(\"p\") + Images[k].picture.toString();\n else if (size == 5) Images[k].className = \"Block \"+picClass[puzzle]+(\"a\") + Images[k].picture.toString();\n }\n }\n\n //what will happen if a start button be pressed\n function Begin() {\n document.getElementById(\"Start\").addEventListener(\"click\", function() {\n count = 0;\n document.getElementById(\"step\").value = count.toString();\n var mess = new Mess();\n document.getElementById(\"Start\").innerHTML = \"Restart\";\n if (ans) {\n var parent = document.getElementById(\"result\");\n var child = document.getElementById(\"congratulate\");\n parent.removeChild(child);\n ans = false;\n }\n }); \n }\n \n //when a puzzle piece was clicked, happen...\n function Action() {\n for (let t = 0; t < sum; t++) {\n Images[t].onclick = function() {\n if (EmptyY != Images[t].y || EmptyX != Images[t].x) {\n if ((Math.abs(EmptyY-Images[t].y)<=1 && Math.abs(EmptyX-Images[t].x)<=1)&&(!(Math.abs(EmptyY-Images[t].y)==1 && Math.abs(EmptyX-Images[t].x)==1))) {\n Images[EmptyX*size+EmptyY].className = Images[t].className;\n Images[EmptyX*size+EmptyY].picture = Images[t].picture;\n Images[t].picture = maxnumber;\n EmptyX = Images[t].x;\n EmptyY = Images[t].y;\n ++count;\n document.getElementById(\"step\").value = count.toString();\n if (size == 4) Images[t].className = \"Block \"+picClass[puzzle]+\"img\"+maxnumber.toString();\n else if (size == 3) Images[t].className = \"Block \"+picClass[puzzle]+\"p\"+maxnumber.toString();\n else if (size == 5) Images[t].className = \"Block \"+picClass[puzzle]+\"a\"+maxnumber.toString();\n Judge();\n }\n } \n }\n }\n }\n \n //Judge whether the puzzle is finished\n function Judge() {\n var name,str;\n for (var p = 0; p < sum; p++) {\n if (Images[p].picture != (Images[p].x*size+Images[p].y)) return false;\n }\n var element = document.createElement(\"p\");\n element.id = \"congratulate\";\n element.innerHTML = \"You Win!And you step\" + count.toString()+\"times\";\n document.getElementById(\"result\").appendChild(element);\n ans = true;\n return true;\n }\n }\n }", "title": "" }, { "docid": "b819eee206b3d002c23fbd6a40f542bd", "score": "0.5411615", "text": "function readyNow() {\n whoToClick(); // starts game\n $('#pictureSpot').on('click', '.imgClick', handleClick) // click event handler\n\n for (let i = 0; i < people.length; i++) { // for-of loop creating dynamic divs with unique IDs\n let newDiv = `\n <div class=\"divs\">\n <img class=\"imgClick\" data-name=\"${people[i].githubUsername}\" src=\"https://github.com/${people[i].githubUsername}.png?size=250\" alt=\"${people[i].name}\">\n </div>`;\n $('#pictureSpot').append(newDiv);\n };\n}", "title": "" }, { "docid": "512e28a5318d1e6123d47ed01ccf4712", "score": "0.5400253", "text": "function createGrid(size) {\n // empties the current grid\n $(\"#container\").empty();\n\n // creates and adds all the pixels to the container\n for (var idx = 0; idx < size*size; idx++) {\n $pixel = $('<div class=\"pixel\"></div>');\n $('#container').append($pixel);\n }\n\n $('.pixel').height(720 / size);\n $('.pixel').width(720 / size);\n}", "title": "" }, { "docid": "fa46a0a0c6c07d9a7fdc9461d06e8ea5", "score": "0.5395099", "text": "function defineSizes() {\n \n // define vertical vars\n \n if ( options.enableVertical ) {\n boxHeight = $box.height();\n windowHeight = $window.height();\n docHeight = $document.height();\n \n parallaxRoom = ( options.parallaxHeight || boxHeight ) - windowHeight;\n \n // if parallax object is smaller than window size\n if ( parallaxRoom < 0 ) {\n if ( options.staticSpeed ) parallaxRoom = windowHeight - boxHeight;\n else parallaxRoom = options.reverseDirection ? windowHeight - startingPos - boxHeight : startingPos;\n \n tooSmallMode = true;\n }\n \n if ( isIE6 && !maxIE6Move ) maxIE6Move = -1 * ( docHeight - boxHeight );\n \n if ( options.loopIt ) loopCount = parseInt( $document.scrollTop() / ( tooSmallMode ? windowHeight : boxHeight ) );\n }\n \n // define horizontal vars\n\n if ( options.enableHorizontal ) {\n boxWidth = $box.width();\n windowWidth = $window.width();\n docWidth = $document.width();\n \n parallaxRoomX = ( options.parallaxWidth || boxWidth ) - windowWidth;\n \n // if parallax object is smaller than window size\n if ( parallaxRoomX < 0 ) {\n parallaxRoomX = options.staticSpeedX ? windowWidth - boxWidth : options.reverseDirectionX ? windowWidth - startingPosX - boxWidth : startingPosX;\n \n tooSmallModeX = true;\n }\n \n if ( isIE6 && !maxIE6MoveX ) maxIE6MoveX = -1 * ( docWidth - boxWidth );\n \n if ( options.loopItX ) loopCountX = parseInt( $document.scrollLeft() / ( tooSmallModeX ? windowWidth : boxWidth ) );\n }\n \n // make any changes\n ani();\n }", "title": "" }, { "docid": "2376beb9d3d8355bd0230e88e95b9994", "score": "0.538265", "text": "function set_boxes() {\n\tvar a=window.innerHeight;\n\tvar b=document.getElementById('page_top').offsetHeight;\n\tvar c=document.getElementById('page_foot').offsetHeight;\n\tvar d=document.search.offsetHeight;\n\tvar e=0;\n\t\tif (document.edit) {\n\t\t\te=document.edit.offsetHeight;\n\t\t}\n\t\n\t\t// TODO - Only add the 26 margin when the offsetHeight is positive?\n\tvar f=document.getElementById('page_panel_statuses').offsetHeight+26;\n\t\n\tvar g=a-b-c-d-e-f-24;\n\t\n\t// If the similar results box will fit and display at least 76px then resize it, if not, set a decent size and force a vertical scroll\n\tif (g>76) {\n\t\tdocument.getElementById('results_similar_products_wrap').style.height=g+'px';\n\t} else {\n\t\tdocument.getElementById('results_similar_products_wrap').style.height='300px';\n\t}\n}", "title": "" }, { "docid": "0eedd7a7f2af761617134d1e08bd931e", "score": "0.53810793", "text": "function createBoxContainer(col, row, boxSize) {\n for (var i = 0; i < col; i++) {\n createBoxColumn(row);\n }\n $boxContainer.width(col * boxSize + col + 1 + \"px\");\n $boxContainer.height(row * boxSize + row + 1 + \"px\");\n $boxContainer.find(\".box\").css({\n width: boxSize + \"px\",\n height: boxSize + \"px\"\n });\n addBCEventListeners();\n}", "title": "" }, { "docid": "6385596dd5ad771745781e2063b369a1", "score": "0.5378597", "text": "function checkboxes() {\n const trigerBox = (window.innerHeight / 5) * 4;\n boxes.forEach((box) => {\n const boxTop = box.getBoundingClientRect().top;\n if (boxTop < trigerBox) {\n box.classList.add(\"show\");\n } else {\n box.classList.remove(\"show\");\n }\n });\n}", "title": "" }, { "docid": "67fa42bb83746b7fd4a1b44a46b92078", "score": "0.5369352", "text": "function createCanvas() {\n\tgridContainer.style.gridTemplateColumns = `repeat(${sizeSelector.value}, 1fr)`;\n\tgridContainer.style.gridTemplateRows = `repeat(${sizeSelector.value}, 1fr)`;\n\tfor (let i = 0; i < sizeSelector.value * sizeSelector.value; i++) {\n\t\tconst gridItem = document.createElement(\"div\");\n\t\tgridItem.classList.add(\"grid-item\")\n\t\tgridContainer.appendChild(gridItem);\n\t};\n}", "title": "" }, { "docid": "cb8a6ce1e64bf56748c0dfb4b1ed1e11", "score": "0.5369284", "text": "function render() {\n for (var i = 0; i < 3; i++) {\n var display = document.getElementById('display');\n var imageObj = displayPictures[i];\n var image = document.createElement('img');\n image.setAttribute('class', 'survey');\n image.setAttribute('src', imageObj.path);\n image.setAttribute('id', imageObj.name);\n display.appendChild(image);\n image.addEventListener('click', eventHandler);\n imageObj.displayCount++;\n imageObj.shownCount++;\n\n }\n}", "title": "" }, { "docid": "672481a6589f23208f3fe4d99a5fe1d9", "score": "0.536696", "text": "function createCells(n) {\n for (let i = 0; i < n; i++) {\n let row = document.createElement('div');\n row.className = \"row\";\n for (let j = 0; j < n; j++) {\n let box = document.createElement('div');\n box.className = \"box\";\n row.appendChild(box);\n }\n grid.appendChild(row);\n let boxes = document.getElementsByClassName(\"box\");\n for (k = 0; k < boxes.length; k++) {\n boxes[k].style.width = maxWidth / n + \"px\";\n boxes[k].style.height = maxWidth / n + \"px\";\n }\n }\n}", "title": "" }, { "docid": "d30f658ce3bffd18ea39d52180a618a4", "score": "0.5358811", "text": "function placeBoxes() {\n\n for(var i = 0; i < 4; i++) {\n boxCreator(i);\n }\n}", "title": "" }, { "docid": "66f8fc3b314b4f4c7a30ba33760dec67", "score": "0.5358031", "text": "function populateScreen(numShapes){\n for(let i=0;i<numShapes;i++){\n buildCircles(400,30);\n }\n}", "title": "" }, { "docid": "3963a1cd9a1441b8bab478d3fc2b237b", "score": "0.53549343", "text": "function makeGrid(size) {\r\n\tfor(var i = 1; i <= size*size ; i++) {\r\n\t\t$('#container').append(\"<div class='grid'></div>\");\r\n\t}\r\n\t$(\".grid\").height(500/size);\r\n\t$(\".grid\").width(500/size);\r\n}", "title": "" }, { "docid": "5027579fa2a7e0376e628c491654b6c6", "score": "0.53531873", "text": "function buildNewImages( data ) {\n var newImg, imgList = [];\n data.forEach(function( item ) {\n newImg = new PictureBox( item );\n imgList.push( newImg );\n });\n return imgList;\n }", "title": "" }, { "docid": "a67ffc068980eaa23003ee0c1ba24569", "score": "0.53517103", "text": "function centerThumbs() {\n\tvar thumbBoxWidth = $(\".thumb-box\").width();\n\tvar thumbBox2Width = $(\".thumb-box2\").width();\n\t\n\tvar scaledHeight = $(\".thumb-box\").height();\n\tvar scaledHeight2 = $(\".thumb-box2\").height();\n\t\n\t$(\".horizontal img\").each(function (index, elem){\n\t\trealDimensions(elem, function (width, height, elem) {\n\t\t\tvar isThumbBox = $(elem).parent().hasClass(\"thumb-box\");\n\t\t\t\n\t\t\tvar scaledWidth = (width / height) * scaledHeight;\n\t\t\tvar scaledWidth2 = (width / height) * scaledHeight2;\n\t\t\t\n\t\t\tif (isThumbBox) {\n\t\t\t\tvar thumbMargin = (thumbBox2Width - scaledWidth) / 2;\n\t\t\t\t$(elem).css(\"margin-left\", thumbMargin);\n\t\t\t} else {\n\t\t\t\tvar thumb2Margin = (thumbBox2Width - scaledWidth2) / 2;\n\t\t\t\t$(elem).css(\"margin-left\", thumb2Margin);\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "d684c1b4c753057942762ccbf53fc4ba", "score": "0.5338361", "text": "function GridBox() {\n\t}", "title": "" }, { "docid": "5d3b58f7d291452758d4f6a488b792a8", "score": "0.5328407", "text": "function makeBoxes(e){\n\tvar divs = [];\n\tvar newKids = [];\n\t for ( var i in e ) {\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.className=\"adElement \" + e[0].className.split(' ')[1] + \"Boxes\";\n\t\tcreative.elements.content.insertBefore(div, creative.elements.bg);\n\t\tvar base = e[i];\n\t\tspecs = {l:base.offsetLeft,t:base.offsetTop,w:base.offsetWidth,h:base.offsetHeight}\n\t\tTweenMax.set(div, {left:specs.l, top:specs.t, width:specs.w,height:specs.h+1, zIndex:2})\n\t\trootC = div;\n\n\t\toldChild = e[i].cloneNode(true);\n\t\te[i].parentNode.removeChild(e[i]);\n\t\trootC.appendChild(oldChild);\n\t\tTweenMax.set(oldChild,{left:0,top:0})\n\t\tnewKids.push(oldChild)\n\t\tdivs.push(div);\n\t\tif ( i == base.length - 1 ){\n\t\t\te = newKids;\n\t\t}\n\t }\n\t return divs;\n}", "title": "" }, { "docid": "229a0ce8121febc6809a66d117b29077", "score": "0.532788", "text": "function createImgPanel() {\n \n $imgContainer.empty();\n\n for (i = 0; i < numImages; i++) {\n var newBoxDiv = $('<div>');\n var newPanel = $('<div>');\n var newPanelHeading = $('<div>');\n var newPanelBody = $('<div>');\n var newPanelFooter = $('<div>');\n var newImgContent = $('<img>');\n var newID = 'img-'+i;\n var title = '<p><span class=\"title\"></span></p>';\n var rating = '<p>Rating: <span class=\"rating\"></span></p>';\n\n newBoxDiv.addClass('col-sm-6 col-md-4');\n newPanel.addClass('panel panel-primary');\n newImgContent.attr({ 'id': newID, 'data-img': i });\n $imgContainer.append(newBoxDiv);\n newBoxDiv.append(newPanel);\n newPanel.append(newPanelHeading);\n newPanel.append(newPanelBody);\n newPanel.append(newPanelFooter);\n newPanelHeading.addClass('panel-heading');\n newPanelBody.addClass('panel-body');\n newPanelFooter.addClass('panel-footer');\n newPanelBody.append(newImgContent);\n newPanelHeading.append(title);\n newPanelFooter.append(rating);\n }\n // Call function to grab new DOM elements\n getUpdatedDomElems();\n }", "title": "" }, { "docid": "0132bb0832915855ade1f987c114683e", "score": "0.53228295", "text": "function main() {\r\n\t$(\".postbody img\").each(function() {\r\n\t\tvar myImg = $(this);\r\n\t\tmyImg.css(\"max-width\",\"725px\");\r\n\t\tmyImg.wrap(\"<a href='\" + myImg.attr(\"src\") + \"' />\");\r\n\t});\r\n}", "title": "" }, { "docid": "dbedb7ba7c4a340a329b2cfd5ad25923", "score": "0.5322426", "text": "function setElms(id_p, im){\n //set1 properties\n img = im;\n //if(width =='') width = img.width;\n //if(height =='') height = img.height;\n if(width =='') width = window.innerWidth;\n if(height =='') height = window.innerHeight;\n\n //add canvas and solve button\n var parent = document.getElementById(id_p);\n id_solv = id_p +'_solv';\n parent.innerHTML ='<canvas id=\"'+ id_p +'_cnv\" width=\"'+ width +'\" height=\"'+ height +'\" class=\"puzcnv\"></canvas><button id=\"'+ id_p +'_solv\" class=\"puzsolve\"><i class=\"fas fa-user-secret\"></i> CHEAT</button><img src=\"'+ img.src +'\" width=\"'+ width /3 +'\" height=\"'+ height /3 +'\" class=\"puzimg\" />';\n parent.style.width = width +2 +'px';;\n\n //set2 properties\n var cnv = document.getElementById(id_p +'_cnv');\n cnt = cnv.getContext('2d');\n p_size = {w:img.naturalWidth /cols, h:img.naturalHeight /rows}; \n tl_size = {w:width /cols, h:height /rows};\n\n setImP(); //set image pieces\n\n //register click event\n cnv.addEventListener('click', function(ev){\n if(solv ==0){ //if not completed\n me.clicks++;\n var x = ev.offsetX;\n var y = ev.offsetY;\n\n //detect clicked tile from $tl_p\n for(var id in tl_p){\n if(y > tl_p[id].ty && y < tl_p[id].ty + tl_size.h && x > tl_p[id].tx && x < tl_p[id].tx + tl_size.w){\n //if 1st tile, add id in $tl_c and draw border, else, swap tiles\n if(tl_c ==-1){\n tl_c = id;\n drawB(2, '#f00', id);\n }\n else {\n var tl2 = {tx:tl_p[id].tx, ty:tl_p[id].ty, ord:tl_p[id].ord};//data of 2nd tile to be added in 1st tile\n tl_p[id] = {px:tl_p[id].px, py:tl_p[id].py, tx:tl_p[tl_c].tx, ty:tl_p[tl_c].ty, ord:tl_p[tl_c].ord, id:id}; //2nd tl\n tl_p[tl_c] = {px:tl_p[tl_c].px, py:tl_p[tl_c].py, tx:tl2.tx, ty:tl2.ty, ord:tl2.ord, id:tl_c}; //1st tl\n drawTL(tl_p);\n tl_c =-1;\n }\n break;\n }\n }\n }\n });\n\n //on mousemove\n cnv.addEventListener('mousemove', function(ev){\n if(solv ==0){ //if not completed\n var x = ev.offsetX;\n var y = ev.offsetY;\n\n //detect clicked tile from $tl_p\n for(var id in tl_p){\n if(y > tl_p[id].ty && y < tl_p[id].ty + tl_size.h && x > tl_p[id].tx && x < tl_p[id].tx + tl_size.w){\n //if other tile mousemove\n if(tl_h != id){\n tl_h = id;\n drawTL(tl_p);\n if(tl_c !=-1) drawB(2, '#f00', tl_c); //for clicked\n drawB(2, '#f8f900', id);\n }\n break;\n }\n }\n }\n });\n\n //click to solve puzzle\n document.getElementById(id_solv).addEventListener('click', function(){\n if(id_solv !=''){ solv =-1; drawTL(im_p);}\n });\n }", "title": "" }, { "docid": "b327cc7f88e2e54daca7aa6082ca9711", "score": "0.53209734", "text": "generate() {\n for (var rows = 0; rows < this.size; rows++) {\n for (var columns = 0; columns < this.size; columns++) {\n $(\"#grid_container\").append(\"<div class='grid'></div>\");\n };\n };\n $(\".grid\").width(600/this.size);\n $(\".grid\").height(600/this.size);\n }", "title": "" }, { "docid": "d8fbaa5ab2d81f14033c32c7a8c9cf66", "score": "0.5319818", "text": "function reqListener() {\n var data = JSON.parse(this.response);\n\n var parent = document.getElementById('box');\n\n for (let index = 0; index < data.retete.length; index++) {\n const reteta = data.retete[index];\n \n var container = document.createElement('div');\n container.classList = 'responsive';\n\n var gal = document.createElement('div');\n gal.classList = 'gallery';\n\n var a = document.createElement('a');\n a.href = `/reteta/${reteta.id}`;\n\n var img = document.createElement('img');\n img.src = reteta.image;\n img.style = 'width: 200; height: 200;';\n\n a.appendChild(img);\n\n var desc = document.createElement('div');\n desc.classList = 'desc';\n desc.innerText = reteta.nume;\n\n gal.appendChild(a);\n gal.appendChild(desc);\n\n container.appendChild(gal);\n\n parent.appendChild(container);\n }\n}", "title": "" }, { "docid": "90ac1ce5979d49703a5b5918472bad51", "score": "0.5312986", "text": "function getSizes(){\r\n\r\n //measure width of viewport with the help of 100% wide div\r\n w = document.getElementById('w100p').getBoundingClientRect().width ;\r\n h = document.getElementById('h100p').getBoundingClientRect().height ;\r\n\r\n if (w<340){w=340;} // special rule for tiny screens\r\n console.log('w: '+w+' h: '+h);\r\n\r\n //calculate width of images and border thickness - this will be the size reference for everything\r\n img_width = h*(3/4)*.9; // landscape orientation\r\n if (h>w){ // portrait orientation\r\n img_width = w*.9;\r\n }\r\n border_width = img_width/100;\r\n img_width=img_width/3;\r\n\r\n // calculate font sizes\r\n text_size = img_width/17;\r\n headline_size = img_width/13;\r\n line_height = img_width/13*1.5;\r\n title_size = img_width/11;\r\n title_height = img_width/11*2; // title box height\r\n\r\n // calculate div sizes\r\n circle_size=img_width/6;\r\n head_space = circle_size*2 + title_height;\r\n fade_space=img_width/4;\r\n\r\n shadow_size =img_width/100;\r\n}", "title": "" }, { "docid": "333759e769bbc3d7528f3a2b48d713cc", "score": "0.5311415", "text": "function main() {\r\n var largeImage = document.createElement(\"div\");\r\n largeImage.innerHTML = '<div style=\"position: fixed; top: 2em; right: 2em; \"><img id=\"FullSizeImage\" style=\"visibility: hidden; border-style: solid; border-color: black; border-width: 2 \" name=\"FullSizeImage\" src=\"\" width=\"' + fullSizeWidth + '\"></div>'\r\n document.body.insertBefore(largeImage,document.body.firstChild);\r\n\r\n size = getValue(SIZE_PARAM,100);\r\n keepAspectRatio = getValue(KEEP_ASPECT_RATIO_PARAM,true);\r\n addLinkAtTop();\r\n loopThroughAds();\r\n\r\n}", "title": "" }, { "docid": "80ce2e1e34e15171a0ce42586dcf03de", "score": "0.530717", "text": "function makeGrid(){\r\n for(let i = 0; i < 15; ++i){\r\n let $col = $(\"<div>\",{\r\n height: '40px',\r\n class: `col${i}`,\r\n })\r\n $col.css(\"display\", \"inline-block\");\r\n for(let j = 0; j < 15; ++j){\r\n let $cell = $(\"<div>\",{\r\n class: `r${j}c${i}`,\r\n height: '40px',\r\n width: '40px',\r\n // display: 'inline-block',\r\n })\r\n // $cell.display = \"inline-block\"\r\n $col.append($cell);\r\n }\r\n $gamebox.append($col) \r\n }\r\n \r\n}", "title": "" }, { "docid": "6ca7ab110a71535a2a41278bb44bf3a7", "score": "0.5306539", "text": "function drawGrid() {\n for (var i = 0; i < imgArray.length; i++) {\n if (imgsReveal[i]) {\n image(\n imgArray[i],\n (i % ROWS) * IMAGE_WIDTH,\n Math.floor(i / ROWS) * IMAGE_HEIGHT,\n IMAGE_WIDTH,\n IMAGE_HEIGHT\n );\n } else {\n //make grey rectangle to hide images\n fill(\"grey\");\n rect(\n (i % ROWS) * IMAGE_WIDTH,\n Math.floor(i / ROWS) * IMAGE_HEIGHT,\n IMAGE_WIDTH,\n IMAGE_HEIGHT\n );\n }\n }\n}", "title": "" }, { "docid": "b9ab732d7dcb0543186adfd33120e6cf", "score": "0.5303324", "text": "function boxControl() {\r\n\tfor (let i = 0; i < imageClick.length; i++)\r\n\t\timageClick[i].addEventListener('click', function () {\r\n\t\t\tphotoBox.style.display = 'initial';\r\n\t\t\tphotoBox.style.opacity = '0'\r\n\t\t\tfadeIn(photoBox, 300);\r\n\t\t\t//assigns source variable the src of image clicked and assigns src of photobox image this value\r\n\t\t\tvar source = this.getAttribute('src');\r\n\t\t\tboxImage.setAttribute('src', source);\r\n\t\t});\r\n}", "title": "" }, { "docid": "a547e77217efa458f522e787f8c225c9", "score": "0.5301714", "text": "function getImgZoom() {\n\t\n\t\tvar native_width = 0;\n\t\tvar native_height = 0;\n\t\t\n\t\t$(\".with-zoom\").each(function(i) {\n\t\t\n\t\t\t$(this).attr(\"id\",\"wiz\"+i);\n\t\t\t$(\"#wiz\"+i).css(\"width\",$(\"#wiz\"+i+\" .small\").width()+\"px\");\n\t\t\t$(\"#wiz\"+i+\" .magnify\").css({\"background-image\":\"url(\"+$(\"#wiz\"+i+\" .small\").attr(\"src\")+\")\", \"background-repeat\":\"no-repeat\"});\n\t\t\t\n\t\t\t// on mouse movement state\n\t\t\t$(\"#wiz\"+i).mousemove(function(e) {\n\t\t\n\t\t\t\tif (!native_width && !native_height) {\n\t\t\t\n\t\t\t\t\tvar image_object = new Image();\n\t\t\t\t\timage_object.src = $(\"#wiz\"+i+\" .small\").attr(\"src\");\n\t\t\t\n\t\t\t\t\tnative_width = image_object.width;\n\t\t\t\t\tnative_height = image_object.height;\n\t\t\t\n\t\t\t\t} else {\n\t\t\t\n\t\t\t\t\tvar magnify_offset = $(this).offset();\n\t\t\t\t\tvar mx = e.pageX - magnify_offset.left;\n\t\t\t\t\tvar my = e.pageY - magnify_offset.top;\n\t\t\t\n\t\t\t\t\tif(mx < $(this).width() && my < $(this).height() && mx > 0 && my > 0) {\n\t\t\t\t\t\n\t\t\t\t\t\t$(\"#wiz\"+i+\" .magnify\").fadeIn(100);\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\t$(\"#wiz\"+i+\" .magnify\").fadeOut(100);\n\t\t\t\t\t\tnative_width = 0;\n\t\t\t\t\t\tnative_height = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\tif($(\"#wiz\"+i+\" .magnify\").is(\":visible\")) {\n\t\t\t\n\t\t\t\t\t\tvar rx = Math.round(mx/$(\"#wiz\"+i+\" .small\").width()*native_width - $(\"#wiz\"+i+\" .magnify\").width()/2)*-1;\n\t\t\t\t\t\tvar ry = Math.round(my/$(\"#wiz\"+i+\" .small\").height()*native_height - $(\"#wiz\"+i+\" .magnify\").height()/2)*-1;\n\t\t\t\t\t\tvar bgp = rx + \"px \" + ry + \"px\";\n\t\t\t\n\t\t\t\t\t\tvar px = mx - $(\"#wiz\"+i+\" .magnify\").width()/2;\n\t\t\t\t\t\tvar py = my - $(\"#wiz\"+i+\" .magnify\").height()/2;\n\t\t\t\n\t\t\t\t\t\t$(\"#wiz\"+i+\" .magnify\").css({\"left\": px, \"top\": py, \"background-position\": bgp});\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}); // end mouse movement state\n\t\t\t\n\t\t}); // end each loop\n\t\t\n\t}", "title": "" }, { "docid": "0020fa32e521f270b8c0d00802953483", "score": "0.5300029", "text": "function createGrid (numberOfSquares) {\r\n\r\n\t//alert('Number of squares is: ' + Math.pow(numberOfSquares,2));\r\n\tvar gridHeight = 960;\r\n\tvar gridWidth = 960;\r\n\tvar blockHeight = gridHeight / numberOfSquares;\r\n\tvar blockWidth = gridWidth / numberOfSquares;\r\n\r\n\tfor(var i = 0; i < Math.pow(numberOfSquares,2); i++)\r\n\t{\r\n\tvar div = document.createElement(\"div\");\r\n\t$(div).attr(\"class\", \"sketch\");\r\n\t$(div).css(\"display\", \"block\");\r\n\t$(div).css(\"width\", blockWidth + \"px\");\r\n\t$(div).css(\"height\", blockHeight + \"px\");\r\n\t$(div).css(\"float\", \"left\");\r\n\r\n\t\t$('#grid-holder').append(div);\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "86c4813449bea143f739fb2cfe7a9075", "score": "0.5297414", "text": "function addMutualFlow(x,y,size) {\n\tvar flow = new MultiWidgets.ItemFlowWidget();\n\tflow.setLocation(x,y);\n\tfor (var i=1; i<=10; i++) {\n\tvar imgItem = new MultiWidgets.ImageWidget();\n\tvar path = \"Media/Mutual_journal/image\" +i + \".jpg\";\n\tif (imgItem.load(path)) {\n\t\timgItem.addOperator(new MultiWidgets.StayInsideParentOperator());\n \t \timgItem.resizeToFit(new Nimble.SizeF(size,size));\n\t\tflow.addItem(imgItem);\n\t\t}\n\t}\n\troot.addChild(flow);\n\tflow.raiseToTop();\n\n\treturn flow;\n}", "title": "" }, { "docid": "072816e17762da30d9da7f6a1c2d61f0", "score": "0.52971715", "text": "function centerIsotypeImages(){\n jQuery('.element').each(function(){\n var $this = jQuery(this);\n if($this.find('img').get(0) === undefined){ return; }\n var cont_ratio = $this.width() / $this.height();\n var img_ratio = $this.find('img').get(0).width / $this.find('img').get(0).height;\n\n if(cont_ratio <= img_ratio){\n $this.find('img').css({ 'width' : 'auto', 'height' : '100%', 'top' : 0 }).css({ 'left' : ~(($this.find('img').width()-$this.width())/2)+1 });\n $this.find('img').stop(true, true).fadeIn(200);\n $this.find('img').addClass('pf-img-visible');\n }else{\n $this.find('img').css({ 'width' : '100%', 'height' : 'auto', 'left' : 0 }).css({ 'top' : ~(($this.find('img').height()-$this.height())/2)+1 });\n $this.find('img').stop(true, true).fadeIn(200);\n $this.find('img').addClass('pf-img-visible');\n }\n });\n }", "title": "" }, { "docid": "ce071e63759fc0b9b205379bb59e8b37", "score": "0.5294697", "text": "function makeGrid(gridSize) {\n for(var i = 0; i < gridSize; i++) {\n for(var j = 0; j < gridSize; j++) {\n var square = $(\"<div class='square'></div>\");\n square.appendTo('#wrapper');\n };\n };\n }", "title": "" }, { "docid": "1284a5a7d3358e2288305f7e16279125", "score": "0.52931046", "text": "function fMediaQueries () {\n //mQ++;\n //console.log (\"fMediaQueries -------: \", mQ);\n /**-----===( When re-sizing window get the clicked amount mulitplied\n * by the current image width and used that number to re-position the container\n *********************************************************************)===-----**/\n //horizonMultiplier = 0;\n //horizonXpos = parseInt(colRightWidth * horizonMultiplier);\n\n //horizonXpos = colRightWidth * horizonMultiplier;\n //staxXpos = colRightWidth * staxMultiplier;\n ownXpos = ownColRightWidth3 * ownMultiplier;\n stax2Xpos = stax2ColRightWidth3 * stax2Multiplier;\n\n /** Keeps the image in place whenever the window gets resized **/\n //fXSlider (horizonImagesChamberId, -horizonXpos); //Used the css left instead of the x matrix\n //fXSlider (staxImagesChamberId, -staxXpos);\n //fXSlider (ownImagesChamberId, -ownXpos);\n //fXSlider (stax2ImagesChamberId, -stax2Xpos);\n ownImagesChamberId.css ({\"left\": ownXpos});\n stax2ImagesChamberId.css ({\"left\": stax2Xpos});\n\n //winWidth = $ (window).width (); //Browser window width\n ////console.log (\"winWidth: \" + winWidth);\n windowInnerWidth = window.innerWidth;\n\n /**-------------===========( Cellphones Viewport )===========-------------**/\n if (windowInnerWidth <= 480) {\n //console.log (\"•-------------------- Tiny : <= 480 ---------------------•\");\n /**-----{ //fTwoColumns: Changing the 2 columns width percentages in a Row }-----**/\n //fTwoColu//mns (90); //Right column @ 90% width. Left column @ 10%.\n //fHeaderFonts (2.5, .75, 1.2, 1.2, 1);\n fCommonFunctionalities ();\n //fResetContainers ();\n //console.log (\"•-------------------- End Tiny ---------------------•\");\n\n /**-------------===========( Smartphones Viewport: 480 - 640 )===========-------------**/\n } else if (windowInnerWidth <= smallDevices && windowInnerWidth > 480) {\n console.log (\"•-------------------- Small : 480 - 640 ---------------------•\");\n /**-----{ Changing columns width percentage in a Row }-----**/\n //fTwoColumns (90);\n //fHeaderFonts (4, 1, 1.4, 1.4, 1.2);\n fCommonFunctionalities ();\n //fResetContainers ();\n //console.log (\"•-------------------- End Small ---------------------•\");\n\n /**-------------===========( Between Tablets and Smartphones Viewport )===========-------------**/\n } else if (windowInnerWidth <= mediumDevices && windowInnerWidth > smallDevices) {\n console.log (\"•--------------- Medium : 640 - 992 ----------------•\");\n //console.log (\"mediumDevices: \", mediumDevices, \" smallDevices: \", smallDevices);\n //colRightCropWidth = 550\n //var colRightWidthX = 500\n /**-----{ Changing columns width percentage in a Row }-----**/\n //fTwoColumns (80);\n //fHeaderFonts (6, 1.2, 1.4, 1.4, 1.2);\n fCommonFunctionalities ();\n //console.log (\"•-------------------- End Medium ---------------------•\");\n\n /**-------------===========( Between Desktop and Tablets Viewport )===========-------------**/\n } else if (windowInnerWidth <= largeDevices && windowInnerWidth > mediumDevices) {\n console.log (\"•--------------- Large : 992 - 1200 ----------------•\");\n //console.log (\"largeDevices: \", largeDevices, \"mediumDevices: \", mediumDevices);\n /**-----{ Changing columns width percentage in a Row }-----**/\n ////fTwoColumns2 (100);//Testing config 2 for the logo container\n //////fTwoColumns3 (containerTemp, 100)\n //fT//woColumns (80);\n //fHeaderFonts (8, 1.4, 1.4, 1.5, 1.2); //Large settings\n fCommonFunctionalities ();\n\n /**-------------===========( Extra Large Viewport )===========-------------**/\n } else {\n console.log (\"•-------------------- Extra Large ---------------------•\");\n /**-----{ Changing columns width percentage in a Row }-----**/\n //fTwoColumns (80);\n //fHeaderFonts (10, 1.4, 1.4, 1.5, 1.2); //Large settings\n fCommonFunctionalities ();\n //console.log (\"•-------------------- End Extra Large ---------------------•\");\n }\n }", "title": "" }, { "docid": "856f9fedb34e0aed5bfe5785f3cf1aa0", "score": "0.52910024", "text": "function fitDisplay(we_fr, we_img, we_box, img_h, box_h_1,box_h_2){\n let frameWidth = $(we_fr).outerWidth();\n let contentWidth = $(\".detailCon\").outerWidth();\n let winWidth = $(window).width();\n $(we_img).outerHeight(frameWidth * img_h);\n if(winWidth > 800){\n $(we_box).outerHeight(contentWidth*box_h_1);\n } else {\n $(we_box).outerHeight(contentWidth*box_h_2);\n }\n }", "title": "" }, { "docid": "89fbd678c21ecfe41ca5546b67785e3e", "score": "0.5289035", "text": "function createGrid(size){\ncontainer.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\ncontainer.style.gridTemplateRows = `repeat(${size}, 1fr )`;\n\n //Generate the squares and give a class gridElement for each box and attach to the container as children. \nfor(var i=0;i<=size*size;i++){\n var griditem=document.createElement(\"div\");;\n griditem.classList.add(\"gridElement\");\n container.appendChild(griditem);\n}\n}", "title": "" }, { "docid": "203021eabe7e9bb8362cf2683997e59b", "score": "0.52808315", "text": "function generateGridDivs(sideSquareNumber) {\n let div = \"\";\n for (let i = 0; i < sideSquareNumber * sideSquareNumber; i++) {\n div += `<div class=\"grid-item\"></div>`;\n }\n gridContainer.innerHTML += div;\n changeBoxHoverColor();\n}", "title": "" }, { "docid": "0f6710c2b72bad30630d48bf7ea615b3", "score": "0.5279417", "text": "function boxCreation(totalBoxes) {\n boardContainer.innerHTML = \"\";\n\n\n let numberOfCols = Math.sqrt(totalBoxes, 2);\n\n for (let index = 0; index < totalBoxes; index++) {\n\n let newBox = document.createElement(\"div\");\n newBox.classList.add(\"box\");\n newBox.classList.add(\"box-level-\" + numberOfCols);\n newBox.innerText = index + 1;\n //6\n newBox.addEventListener(\"click\", function () {\n const boxNumber = parseInt(this.textContent);\n\n if (bombs.includes(boxNumber)) {\n this.classList.add(\"bomb\");\n alert(\"you lose!\");\n } else {\n this.classList.toggle(\"active\");\n }\n })\n boardContainer.append(newBox);\n }\n\n}", "title": "" }, { "docid": "887e7fbf8da674fc7af44f5c88953e7a", "score": "0.52749753", "text": "function makeBoxes(wid, hgt, w0, h0) {\n var wnum = ~~(wid/w0), wrem = wid%w0,\n hnum = ~~(hgt/h0), hrem = hgt%h0,\n xend = wid-wrem, yend = hgt-hrem;\n\n var bxs = [];\n for (var y = 0; y < hgt; y += h0)\n for (var x = 0; x < wid; x += w0)\n bxs.push({x:x, y:y, w:(x==xend?wrem:w0), h:(y==yend?hrem:h0)});\n\n return bxs;\n }", "title": "" }, { "docid": "f2254995544f2a9dca6771aad6022957", "score": "0.5273371", "text": "function createBoard() {\n for (var i = 0; i < cardArray.length; i++) {\n const card = document.createElement('img')\n card.setAttribute('src', 'images/blank.png')\n card.setAttribute('data-id', i)\n card.className = 'Cardimg'\n card.addEventListener('click', flipCard)\n grid.appendChild(card)\n }\n }", "title": "" }, { "docid": "2339d9dcdf1534a9b25e18b60d7949b2", "score": "0.52720416", "text": "addResizeBoxes(cropRect, par,e, imgEl) {\n\n\n let boxStyle = `background-color :rgba(0,0,0,0.7);width:10px;height:10px;border:1px solid rgba(255,255,255,255);`;\n let resizeBoxes = cropRect.querySelectorAll('span');\n \n\n if (0 === resizeBoxes.length) {\n let nwseResizeOne = document.createElement('span');\n nwseResizeOne.style = boxStyle + `cursor:nwse-resize;margin-left:-6px;margin-top:-6px;position:absolute;position:absolute;`\n nwseResizeOne.id = \"nwse-resize-one\";\n nwseResizeOne.setAttribute('draggable', false)\n nwseResizeOne.addEventListener('mousedown', () => {\n cropRect.setAttribute('data-prev-mousepos','')\n imgEl.setAttribute('data-mouse-status','up')\n cropRect.setAttribute('data-resize', \"nwse-resize-one\")\n })\n nwseResizeOne.addEventListener('mouseup', () => cropRect.setAttribute('data-resize', \"\"));\n cropRect.appendChild(nwseResizeOne);\n\n let nsResizeOne = document.createElement('span');\n nsResizeOne.style = boxStyle + `cursor:ns-resize;margin-left:${par.width / 2}px; margin-top: -7px; position:absolute;`\n nsResizeOne.id = \"ns-resize-one\";\n nsResizeOne.setAttribute('draggable', false)\n nsResizeOne.addEventListener('mousedown', () => {\n cropRect.setAttribute('data-prev-mousepos','')\n imgEl.setAttribute('data-mouse-status','up')\n cropRect.setAttribute('data-resize', \"ns-resize-one\")\n })\n nsResizeOne.addEventListener('mouseup', () => cropRect.setAttribute('data-resize', \"\"));\n cropRect.appendChild(nsResizeOne);\n\n let neswResizeOne = document.createElement('span');\n neswResizeOne.style = boxStyle + `cursor:nesw-resize;margin-left:${par.width - 6}px; margin-top: -6px; position:absolute;`\n neswResizeOne.id = 'nesw-resize-one';\n neswResizeOne.setAttribute('draggable', false)\n neswResizeOne.addEventListener('mousedown', () => {\n cropRect.setAttribute('data-prev-mousepos','')\n imgEl.setAttribute('data-mouse-status','up')\n cropRect.setAttribute('data-resize', \"nesw-resize-one\")\n })\n neswResizeOne.addEventListener('mouseup', () => cropRect.setAttribute('data-resize', \"\"));;\n cropRect.appendChild(neswResizeOne);\n\n let ewResizeOne = document.createElement('span');\n ewResizeOne.style = boxStyle + `cursor:ew-resize;margin-left:${par.width - 7}px; margin-top: ${(par.height / 2) - 7}px; position:absolute;`\n ewResizeOne.id = 'ew-resize-one';\n ewResizeOne.setAttribute('draggable', false)\n ewResizeOne.addEventListener('mousedown', () => {\n cropRect.setAttribute('data-prev-mousepos','')\n imgEl.setAttribute('data-mouse-status','up')\n cropRect.setAttribute('data-resize', \"ew-resize-one\")})\n ewResizeOne.addEventListener('mouseup', () => cropRect.setAttribute('data-resize', \"\"));;\n cropRect.appendChild(ewResizeOne);\n\n let nwseResizeTwo = document.createElement('span');\n nwseResizeTwo.style = boxStyle + `cursor:nwse-resize;margin-left:${par.width - 6}px; margin-top: ${par.height - 6}px; position:absolute;`\n nwseResizeTwo.id = 'nwse-resize-two';\n nwseResizeTwo.setAttribute('draggable', false)\n nwseResizeTwo.addEventListener('mousedown', () => {\n cropRect.setAttribute('data-prev-mousepos','')\n imgEl.setAttribute('data-mouse-status','up')\n cropRect.setAttribute('data-resize', \"nwse-resize-two\")\n })\n nwseResizeTwo.addEventListener('mouseup', () => cropRect.setAttribute('data-resize', \"\"));\n cropRect.appendChild(nwseResizeTwo);\n\n let nsResizeTwo = document.createElement('span');\n nsResizeTwo.style = boxStyle + `cursor:ns-resize;margin-left:${(par.width / 2) - 6}px; margin-top: ${par.height - 7}px; position:absolute;`\n nsResizeTwo.id = 'ns-resize-two';\n nsResizeTwo.setAttribute('draggable', false)\n nsResizeTwo.addEventListener('mousedown', () =>{ \n cropRect.setAttribute('data-prev-mousepos','')\n imgEl.setAttribute('data-mouse-status','up')\n cropRect.setAttribute('data-resize', \"ns-resize-two\")})\n nsResizeTwo.addEventListener('mouseup', () => cropRect.setAttribute('data-resize', \"\"));\n cropRect.appendChild(nsResizeTwo);\n\n let neswResizeTwo = document.createElement('span');\n neswResizeTwo.style = boxStyle + `cursor:nesw-resize;margin-left:-7px; margin-top:${par.height - 7}px;position:absolute;`\n neswResizeTwo.id = 'nesw-resize-two';\n neswResizeTwo.setAttribute('draggable', false)\n neswResizeTwo.addEventListener('mousedown', () => {\n cropRect.setAttribute('data-prev-mousepos','')\n imgEl.setAttribute('data-mouse-status','up')\n cropRect.setAttribute('data-resize', \"nesw-resize-two\")})\n neswResizeTwo.addEventListener('mouseup', () => cropRect.setAttribute('data-resize', \"\"));;\n cropRect.appendChild(neswResizeTwo);\n\n let ewResizeTwo = document.createElement('span');\n ewResizeTwo.style = boxStyle + `cursor:ew-resize;margin-left:-6px; margin-top: ${(par.height / 2) - 6}px; position:absolute;`\n ewResizeTwo.id = 'ew-resize-two';\n ewResizeTwo.setAttribute('draggable', false)\n ewResizeTwo.addEventListener('mousedown', () => {\n cropRect.setAttribute('data-prev-mousepos','')\n \n imgEl.setAttribute('data-mouse-status','up')\n cropRect.setAttribute('data-resize', \"ew-resize-two\")})\n ewResizeTwo.addEventListener('mouseup', () => cropRect.setAttribute('data-resize', \"\"));;\n cropRect.appendChild(ewResizeTwo);\n } else {\n\n if( null == cropRect.getAttribute('data-resize')){\n cropRect.querySelector('#nwse-resize-one').style = boxStyle + `cursor:nwse-resize;margin-left:-6px;margin-top:-6px;position:absolute;`;\n cropRect.querySelector('#ns-resize-one').style = boxStyle + `cursor:ns-resize;margin-left:${(par.width / 2) - 6}px; margin-top: -7px; position:absolute;`;\n cropRect.querySelector('#nesw-resize-one').style = boxStyle + `cursor:nesw-resize;margin-left:${par.width - 6}px; margin-top: -6px;position:absolute; `\n cropRect.querySelector('#ew-resize-one').style = boxStyle + `cursor:ew-resize;margin-left:${par.width - 7}px; margin-top: ${(par.height / 2) - 7}px;position:absolute;`\n cropRect.querySelector('#nwse-resize-two').style = boxStyle + `cursor:nwse-resize;margin-left:${par.width - 7}px; margin-top: ${par.height - 7}px;position:absolute; `;\n cropRect.querySelector('#ns-resize-two').style = boxStyle + `cursor:ns-resize;margin-left:${(par.width / 2) - 6}px; margin-top: ${par.height - 7}px;position:absolute; `;\n cropRect.querySelector('#nesw-resize-two').style = boxStyle + `cursor:nesw-resize;margin-left:-7px; margin-top:${par.height - 7}px;position:absolute;`;\n cropRect.querySelector('#ew-resize-two').style = boxStyle + `cursor:ew-resize;margin-left:-6px; margin-top: ${(par.height / 2) - 6}px; position:absolute;`;\n \n }else{ \n\n let imgBdRect = imgEl.getBoundingClientRect(); \n let bdRect = cropRect.getBoundingClientRect(); \n\n if('cropRect' != e.target.id && imgBdRect.x <= e.clientX && imgBdRect.y <= e.clientY && (imgBdRect.x+imgBdRect.width) >= e.clientX && (imgBdRect.y+imgBdRect.height) >= e.clientY ){\n \n\n\n if( null != cropRect.getAttribute('data-prev-mousepos') ){\n \n let prevPos = cropRect.getAttribute('data-prev-mousepos').split('-');\n \n let xDiff = Math.abs(parseInt( prevPos[0] ) - e.clientX);\n let yDiff = Math.abs(parseInt( prevPos[1] ) - e.clientY);\n\n switch(cropRect.getAttribute('data-resize')){\n case \"nwse-resize-one\":\n if(bdRect.x > e.clientX && bdRect.y > e.clientY){ \n cropRect.style.top = (parseInt(cropRect.style.top)-yDiff )+'px';\n cropRect.style.left = (parseInt(cropRect.style.left)-xDiff)+'px';\n cropRect.style.height = (parseInt(cropRect.style.height) + yDiff)+'px';\n cropRect.style.width = (parseInt(cropRect.style.width)+xDiff)+'px';\n }else{\n cropRect.style.top = (parseInt(cropRect.style.top)+yDiff )+'px';\n cropRect.style.left = (parseInt(cropRect.style.left)+xDiff)+'px';\n cropRect.style.height = (parseInt(cropRect.style.height) - yDiff)+'px';\n cropRect.style.width = (parseInt(cropRect.style.width)-xDiff)+'px';\n }\n\n break;\n case \"ns-resize-one\":\n if( bdRect.y > e.clientY){ \n cropRect.style.top = (parseInt(cropRect.style.top)-yDiff)+'px';\n cropRect.style.height = (parseInt(cropRect.style.height) + yDiff)+'px';\n }else{\n\n cropRect.style.top = (parseInt(cropRect.style.top)+yDiff)+'px';\n cropRect.style.height = (parseInt(cropRect.style.height) - yDiff)+'px';\n \n }\n break;\n case \"nesw-resize-one\":\n if(bdRect.y > e.clientY ){\n cropRect.style.top = (parseInt(cropRect.style.top)-yDiff )+'px';\n cropRect.style.height = (parseInt(cropRect.style.height) + yDiff)+'px';\n cropRect.style.width = (parseInt(cropRect.style.width)+xDiff)+'px';\n }else{\n cropRect.style.top = (parseInt(cropRect.style.top)+yDiff )+'px';\n cropRect.style.height = (parseInt(cropRect.style.height) - yDiff)+'px';\n cropRect.style.width = (parseInt(cropRect.style.width)-xDiff)+'px'; \n }\n \n break;\n case \"ew-resize-one\":\n if( (bdRect.x+ parseInt(bdRect.width) ) < e.clientX ){\n cropRect.style.width = (parseInt(cropRect.style.width)+xDiff)+'px';\n }else{\n\n cropRect.style.width = (parseInt(cropRect.style.width)-xDiff)+'px';\n }\n \n \n break;\n case \"nwse-resize-two\":\n if( (bdRect.x+ parseInt(bdRect.width) ) < e.clientX ){ \n cropRect.style.height = (parseInt(cropRect.style.height)+ yDiff)+'px';\n cropRect.style.width = (parseInt(cropRect.style.width)+xDiff)+'px';\n }else{\n\n cropRect.style.height = (parseInt(cropRect.style.height)- yDiff)+'px';\n cropRect.style.width = (parseInt(cropRect.style.width)-xDiff)+'px';\n\n }\n break;\n case \"ns-resize-two\":\n if( (bdRect.y+ parseInt(bdRect.height) ) < e.clientY ){ \n cropRect.style.height = (parseInt(cropRect.style.height) + yDiff)+'px';\n }else{\n cropRect.style.height = (parseInt(cropRect.style.height) - yDiff)+'px';\n } \n break;\n case \"nesw-resize-two\":\n if((bdRect.y+parseInt(bdRect.height)) < e.clientY){ \n cropRect.style.left = (parseInt(cropRect.style.left)-xDiff)+'px';\n cropRect.style.height = (parseInt(cropRect.style.height)+ yDiff)+'px';\n cropRect.style.width = (parseInt(cropRect.style.width)+xDiff)+'px';\n }else{\n cropRect.style.left = (parseInt(cropRect.style.left)+xDiff)+'px';\n cropRect.style.height = (parseInt(cropRect.style.height)- yDiff)+'px';\n cropRect.style.width = (parseInt(cropRect.style.width)-xDiff)+'px';\n }\n break;\n case \"ew-resize-two\":\n if(bdRect.x > e.clientX){\n cropRect.style.left = (parseInt(cropRect.style.left)-xDiff)+'px';\n cropRect.style.width = (parseInt(cropRect.style.width)+xDiff)+'px';\n }else{\n cropRect.style.left = (parseInt(cropRect.style.left)+xDiff)+'px';\n cropRect.style.width = (parseInt(cropRect.style.width)-xDiff)+'px';\n }\n break;\n }\n }\n\n \n cropRect.setAttribute('data-start-xy', (bdRect.x - imgBdRect.x ) + ',' + (bdRect.y - imgBdRect.y));\n cropRect.querySelector('#nwse-resize-one').style = boxStyle + `cursor:nwse-resize;margin-left:-6px;margin-top:-6px;position:absolute;`;\n cropRect.querySelector('#ns-resize-one').style = boxStyle + `cursor:ns-resize;margin-left:${( cropRect.offsetWidth / 2) - 6}px; margin-top: -7px; position:absolute;`;\n cropRect.querySelector('#nesw-resize-one').style = boxStyle + `cursor:nesw-resize;margin-left:${cropRect.offsetWidth - 6}px; margin-top: -6px;position:absolute; `\n cropRect.querySelector('#ew-resize-one').style = boxStyle + `cursor:ew-resize;margin-left:${cropRect.offsetWidth - 7}px; margin-top: ${(cropRect.offsetHeight/ 2) - 7}px;position:absolute;`\n cropRect.querySelector('#nwse-resize-two').style = boxStyle + `cursor:nwse-resize;margin-left:${cropRect.offsetWidth - 7}px; margin-top: ${cropRect.offsetHeight - 7}px;position:absolute; `;\n cropRect.querySelector('#ns-resize-two').style = boxStyle + `cursor:ns-resize;margin-left:${(cropRect.offsetWidth / 2) - 6}px; margin-top: ${cropRect.offsetHeight - 7}px;position:absolute; `;\n cropRect.querySelector('#nesw-resize-two').style = boxStyle + `cursor:nesw-resize;margin-left:-7px; margin-top:${cropRect.offsetHeight - 7}px;position:absolute;`;\n cropRect.querySelector('#ew-resize-two').style = boxStyle + `cursor:ew-resize;margin-left:-6px; margin-top: ${(cropRect.offsetHeight / 2) - 6}px; position:absolute;`;\n cropRect.setAttribute('data-prev-mousepos',`${e.clientX}-${e.clientY}`);\n \n \n }\n \n }\n }\n}", "title": "" }, { "docid": "f4b723228fd444144c121f843efbe386", "score": "0.52714163", "text": "function drawBoxes() {\n if (classTypes === null) return;\n hitBoxes = [];\n // first get dimensions\n var currX = boxOffsetX + boxMargin;\n var currY = boxOffsetY + boxMargin;\n boxHeight = boxHeight * boxScale;\n boxWidth = boxWidth * boxScale;\n\n // DataGenerator Column\n if (projectModel.DataGeneratorPart !== null) {\n projectModel.DataGeneratorPart.x = currX;\n projectModel.DataGeneratorPart.y = currY;\n projectModel.DataGeneratorPart.xw = currX + boxWidth;\n projectModel.DataGeneratorPart.yh = currY + boxHeight;\n drawBox(currX, currY, boxWidth, boxHeight, projectModel.DataGeneratorPart.Name);\n hitBoxes.push(new getHitBox(currX, currY, boxWidth, boxHeight, 0, projectModel.DataGeneratorPart.Id, projectModel.DataGeneratorPart.ClassType));\n }\n else {\n drawPlus(currX, currY, boxWidth, boxHeight);\n hitBoxes.push(new getHitBox(currX, currY, boxWidth, boxHeight, 0, null, classTypes.DatasetGenerator));\n }\n\n // Preprocess Column\n currX = currX + boxWidth + boxMargin;\n currY = boxOffsetY + boxMargin;\n for (part in projectModel.PreProcessParts) {\n projectModel.PreProcessParts[part].x = currX;\n projectModel.PreProcessParts[part].y = currY;\n projectModel.PreProcessParts[part].xw = currX + boxWidth;\n projectModel.PreProcessParts[part].yh = currY + boxHeight;\n drawBox(currX, currY, boxWidth, boxHeight, projectModel.PreProcessParts[part].Name);\n hitBoxes.push(new getHitBox(currX, currY, boxWidth, boxHeight, 1, projectModel.PreProcessParts[part].Id, projectModel.PreProcessParts[part].ClassType));\n currY = currY + boxHeight + boxMargin;\n }\n // Always be able to add another\n drawPlus(currX, currY, boxWidth, boxHeight);\n hitBoxes.push(new getHitBox(currX, currY, boxWidth, boxHeight, 1, null, classTypes.DataTransform));\n\n\n // Machine Learning Column\n currX = currX + boxWidth + boxMargin;\n currY = boxOffsetY + boxMargin;\n for (part in projectModel.MLParts) {\n projectModel.MLParts[part].x = currX;\n projectModel.MLParts[part].y = currY;\n projectModel.MLParts[part].xw = currX + boxWidth;\n projectModel.MLParts[part].yh = currY + boxHeight;\n drawBox(currX, currY, boxWidth, boxHeight, projectModel.MLParts[part].Name);\n hitBoxes.push(new getHitBox(currX, currY, boxWidth, boxHeight, 2, projectModel.MLParts[part].Id, projectModel.MLParts[part].ClassType));\n currY = currY + boxHeight + boxMargin;\n }\n // Always be able to add another\n drawPlus(currX, currY, boxWidth, boxHeight);\n hitBoxes.push(new getHitBox(currX, currY, boxWidth, boxHeight, 2, null, classTypes.MachineLearning));\n\n\n // Postprocess Column\n currX = currX + boxWidth + boxMargin;\n currY = boxOffsetY + boxMargin;\n for (part in projectModel.PostProcessParts) {\n projectModel.PostProcessParts[part].x = currX;\n projectModel.PostProcessParts[part].y = currY;\n projectModel.PostProcessParts[part].xw = currX + boxWidth;\n projectModel.PostProcessParts[part].yh = currY + boxHeight;\n drawBox(currX, currY, boxWidth, boxHeight, projectModel.PostProcessParts[part].Name);\n hitBoxes.push(new getHitBox(currX, currY, boxWidth, boxHeight, 3, projectModel.PostProcessParts[part].Id, projectModel.PostProcessParts[part].ClassType));\n currY = currY + boxHeight + boxMargin;\n }\n // Always be able to add another\n drawPlus(currX, currY, boxWidth, boxHeight);\n hitBoxes.push(new getHitBox(currX, currY, boxWidth, boxHeight, 3, null, classTypes.DataTransform));\n\n\n\n // Evaluator Column\n currX = currX + boxWidth + boxMargin;\n currY = boxOffsetY + boxMargin;\n for (part in projectModel.EvalutorParts) {\n projectModel.EvalutorParts[part].x = currX;\n projectModel.EvalutorParts[part].y = currY;\n projectModel.EvalutorParts[part].xw = currX + boxWidth;\n projectModel.EvalutorParts[part].yh = currY + boxHeight;\n drawBox(currX, currY, boxWidth, boxHeight, projectModel.EvalutorParts[part].Name);\n hitBoxes.push(new getHitBox(currX, currY, boxWidth, boxHeight, 4, projectModel.EvalutorParts[part].Id, projectModel.EvalutorParts[part].ClassType));\n currY = currY + boxHeight + boxMargin;\n }\n // Always be able to add another\n drawPlus(currX, currY, boxWidth, boxHeight);\n hitBoxes.push(new getHitBox(currX, currY, boxWidth, boxHeight, 4, null, classTypes.Evaluator));\n }", "title": "" }, { "docid": "3fb48acf64edbb306e4b4cbf53f9b8e2", "score": "0.5270965", "text": "function scaleSizes(){\n wh = $(window).height();\n ww = $(window).width();\n while(sizex>ww || sizey>wh)\n {\n sizex = 0.9 * sizex;\n sizey = 0.9 * sizey;\n }\n return [sizex,sizey]\n\n}", "title": "" }, { "docid": "532549dc9a9c3adc9ee6938647fd3f2a", "score": "0.5263277", "text": "function createClareWidget() {\n\t\n\tvar journal_text = createText(100,830,\"Wine Journal\");\n\tvar photo_text = createText(100,910,\"Photos\");\n\tjournal_text.addCSSClass(\"iconText\");\n\tphoto_text.addCSSClass(\"iconText\");\n\tvar journal_icon = createImage(210, 830, 80, 80, \"Media/icons/Journal.png\"); // call createImage function to make journal icon and photo icon\n\tvar photo_icon = createImage(210, 930, 80, 80, \"Media/icons/polaroid1.png\"); // when icon tapped, call flow for wine journal\n\n\n\tjournal_icon.setFixed();\n\tphoto_icon.setFixed();\n\tjournal_text.setFixed();\n\tphoto_text.setFixed();\n\n\tjournal_icon.onSingleTap(function(){\n\t\tvar clareflow = addClareFlow(395, 600,400*1.5);\n\t\tclareflow.onSingleTap(function(){\n\t\t\troot.removeChild(clareflow);\n\t\t});\n\t});\n\n\n\tphoto_icon.onSingleTap(function(){\n\t\tvar clarebook = addClareBook(270,800,680,240); // create personal photos \n\t\tclarebook.onSingleTap(function(){\n\t\t\troot.removeChild(clarebook);\n\t\t});\n\t});\n\n}", "title": "" }, { "docid": "6b4dbbd774019c0a5be918395f388da8", "score": "0.52631897", "text": "function getImages() {\n var element = document.createElement(\"div\");\n element.id = \"pic\";\n document.getElementById(\"pictures\").appendChild(element);\n var fragss = document.createDocumentFragment();\n for (var i = 0; i < sum; i++) {\n element = document.createElement('div');\n element.x = Math.floor(i/size);\n element.y = i % size;\n if (size == 4) element.className = \"Block \"+picClass[puzzle]+(\"img\") + i.toString();\n else if (size == 3) element.className = \"Block \"+picClass[puzzle]+\"p\" + i.toString();\n else if (size == 5) element.className = \"Block \"+picClass[puzzle]+\"a\" + i.toString();\n Images.push(element);\n fragss.appendChild(element);\n }\n document.getElementById(\"pic\").appendChild(fragss);\n document.getElementById(\"showStep\").className = \"act\";\n return Images;\n }", "title": "" }, { "docid": "85682d6481310fb37107154236557eae", "score": "0.5251372", "text": "function determineThumbnailInformation() {\n \"use strict\";\n var k, m, n, ratioH, ratioW, z, zn;\n\n k = slides.length;\n ratioH = screenGeom.height / slideGeom.height;\n ratioW = screenGeom.width / slideGeom.width;\n for (n = 1; n <= k; n++) {\n m = Math.ceil(k / n);\n zn = Math.min(ratioW / m, ratioH / n);\n if (n === 1 || zn > z) {\n z = zn;\n thumbnailGrid = new Vector(n, m);\n }\n }\n\n // retrieve transformations for the optimal grid\n getThumbnailTransforms(z);\n}", "title": "" }, { "docid": "ba2d78744fa2bedb3956b813f2eb28ad", "score": "0.5250032", "text": "function scaleImages(numTabs){\n\tsqrtNumTabs = Math.sqrt(numTabs);\n\t//Grid size always rounds up of sqrtNumTabs\n\tceilSqrt = Math.ceil(sqrtNumTabs);\n\tgridSize = ceilSqrt * ceilSqrt;\n\tpercentage = parseFloat(100/gridSize)*ceilSqrt - 2;\n\tif(percentage > 80){\n\t\tpercentage = 80;\n\t}\t\n\tpercentage = percentage.toString() + \"%\";;\n\n\n\tbuttonMargins = 11 - ceilSqrt*2;\n\t$('.previewGroupDiv').css({\n\t\twidth:percentage,\n\t\theight:percentage,\n\t\tmargin:buttonMargins + 'px'\n\t});\n}", "title": "" }, { "docid": "57e79c28fe04d0438c92b4a1feada58c", "score": "0.52472997", "text": "function changeBox() {\n const boxes = document.querySelectorAll('.small-box');\n \n if (main.childNodes[0].className === 'small-box') {\n const bigBox = document.createElement('div');\n bigBox.className = 'big-box';\n boxes.forEach(box => {\n box.style.transform = 'rotate(-90deg)';\n setTimeout(() => {\n box.remove();\n main.appendChild(bigBox);\n }, 200)\n });\n } else {\n const bigBox = document.querySelector('.big-box');\n bigBox.remove();\n createBoxes();\n }\n}", "title": "" }, { "docid": "b2439894579c681f940f6f15ad749ce3", "score": "0.52451396", "text": "function createGrid() {\nfor (let i = 0; i < calculations1(); i++) {\n const container = document.querySelector(\"#container\");\n const grid = document.createElement(\"div\");\n grid.classList.toggle(\"grid\");\n grid.style.height = calculations2();\n grid.style.width = calculations2();\n container.appendChild(grid);\n}\n}", "title": "" }, { "docid": "3a05859ba123bd3ec8912178618d7d42", "score": "0.5244624", "text": "function DisplayAreaToDraw() {\n for (var i = 0; i < quizContainerClass.length; i++) {\n quizContainerClass[i].style.minHeight = \"20vh\";\n quizContainerClass[i].style.marginBottom = \"30px\";\n }\n for (var i = 0; i < generatedImages.length; i++) {\n generatedImages[i].style.display = \"none\";\n }\n fullDraw.style.display = \"inline-block\";\n //currentCanvas.style.background = \"url('./questions/QT3-\" + currImage + \".png') no-repeat\";\n\n\n CopyImgToCanvas();\n }", "title": "" }, { "docid": "fa486cba61c9eabe03dc54f4ecb93fb5", "score": "0.52405304", "text": "function new_sizes(){\n\tw_width = window.innerWidth;\n\tw_height = window.innerHeight;\n}", "title": "" }, { "docid": "dc36f5d942b15dba2e1f066250c1d45e", "score": "0.5238426", "text": "function display() {\n $(\".seatgeek\").empty();\n for (var j = 0; j < 8; j++) {\n // console.log(urlPool[j]);\n var newFigure = $(\"<figure>\");\n var newImg = $(\"<img>\");\n newImg.attr(\"src\", urlPool[j]);\n newImg.attr(\"class\", \"event-thumb figure-img img-fluid rounded\");\n var venue = $(\"<p>\").text(venuePool[j]);\n venue.attr(\"class\", \"venue\");\n var performer = $(\"<p>\").text(performerPool[j]);\n performer.attr(\"class\", \"performer\");\n var newCap = $(\"<figcaption>\");\n newCap.append(performer, venue);\n newFigure.append(newImg, newCap);\n var newLink = $(\"<a>\").html(newFigure);\n newLink.attr(\"href\", linkPool[j]);\n $(\".seatgeek\").append(newLink);\n }\n}", "title": "" }, { "docid": "f1a8857339c190c31ae24b3dd318ecaf", "score": "0.5234015", "text": "function resetThumbnails(){\t\n\tfor (var counter = 1; counter <=6; counter +=1 ){\n\t\tvar image = document.getElementById(\"image-\" + counter);\n\t\t\n\t\timage.style.height = \"75px\";\n\t\timage.style.width = \"75px\";\n\t}\n}", "title": "" } ]
5be465c8840acdd953a47c4f1be5b285
parent component style should be after child's so that parent component's style could override it
[ { "docid": "8f8f294087eddf726e4236411d16fd58", "score": "0.0", "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": "3f56fc7088087d7f49b1ccb254962d3e", "score": "0.65065587", "text": "function App() {\n return (\n <Parent className='card'>\n <div className='card'>\n <Child isChild />\n </div>\n <div className='card'>\n <InlineStyles withBorder />\n </div>\n <div className='card' >\n <InlineStylesComputedPropertyNames />\n </div>\n <div className='card'>\n <InlineStylesComputedPropertyNames lightGrey />\n </div>\n <div className='card'>\n <CSSModules />\n </div>\n <div className='card'>\n <StyledComponents isRed />\n </div>\n </Parent>\n );\n}", "title": "" }, { "docid": "0712234a907db5c1d9315b0d42bca201", "score": "0.6155384", "text": "constructor(parentStyle=null)\n {\n super();\n this._inlineOnly = true;\n if (parentStyle)\n {\n this._globalStyle = parentStyle;\n }\n }", "title": "" }, { "docid": "4cdd91d9f673bd2be788d1bcfeede551", "score": "0.61263233", "text": "componentWillReceiveProps(properties) {\n const { style, ...childProps } = properties;\n this.childProps = childProps;\n }", "title": "" }, { "docid": "0e155c2bf4fe830d681d9b5b365491e6", "score": "0.59384644", "text": "getMergedStyle(){\n let style = this.getStyle();\n if( this.props.style ){\n return {...style, ...this.props.style};\n }\n return style;\n }", "title": "" }, { "docid": "1b1f5d58d94db306357d667a8cca67d7", "score": "0.5831992", "text": "chosenStyles() {\n const { show, children } = this.props;\n if (show && this.childRef) {\n return [\n {\n data: children,\n key: \"body\",\n style: {\n height: spring(this.childRef.clientHeight, {\n stiffness: 180,\n damping: 20\n }),\n opacity: spring(1)\n }\n }\n ];\n }\n // if we do not return the children we return an empty div.\n return [\n {\n data: <div />,\n key: \"body\",\n style: {\n height: spring(0, { stiffness: 180, damping: 20 }),\n opacity: spring(0)\n }\n }\n ];\n }", "title": "" }, { "docid": "433dc7cacda1cf3ef244272e1756f6c0", "score": "0.5817519", "text": "function Parent () {\n return <div className=\"Parent\">\n <ChildCounter />\n <hr />\n <Child />\n </div>\n}", "title": "" }, { "docid": "c3ca8fe974533b111247232aa0cdffd4", "score": "0.5765901", "text": "constructor() {\n // Must call super first\n super();\n\n // Create the CSS parts for the shadow DOM\n const style = document.createElement('style');\n\n // Set style\n style.textContent = /*css*/`\n:host {\n display: inline-block;\n}\n.parent-text {\n position: relative;\n background-color: lightgrey;\n width: 100%;\n height: 100%;\n}\n.child-text {\n position: absolute;\n color: rgb(48, 48, 48);\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n user-select: none;\n}`;\n\n // Attach shadow DOM root\n this._shadowRoot = this.attachShadow({mode: 'open'});\n\n // Add styles\n this._shadowRoot.appendChild(style);\n }", "title": "" }, { "docid": "1f8d15809c680dd81c3e304e13d3830b", "score": "0.57583827", "text": "static get styles() {\n return [...super.styles,\n css`\n :host{\n display: block;\n height: var(--icon-scale,inherit);\n width: var(--icon-scale,inherit);\n position: absolute;\n }\n `\n ];\n \n }", "title": "" }, { "docid": "563ec884ef4fe17a665c283734022551", "score": "0.57082236", "text": "function onAlignmentChanged(child) {\r\n if (child.parent && child.parent.layout) {\r\n child.parent.update();\r\n }\r\n }", "title": "" }, { "docid": "563ec884ef4fe17a665c283734022551", "score": "0.57082236", "text": "function onAlignmentChanged(child) {\r\n if (child.parent && child.parent.layout) {\r\n child.parent.update();\r\n }\r\n }", "title": "" }, { "docid": "563ec884ef4fe17a665c283734022551", "score": "0.57082236", "text": "function onAlignmentChanged(child) {\r\n if (child.parent && child.parent.layout) {\r\n child.parent.update();\r\n }\r\n }", "title": "" }, { "docid": "b75679a9195019020227b9aaf7f8ad39", "score": "0.56453204", "text": "populateDefaultStyles(children) {\n this.defaultStyles = children.map((child) => {\n return {x: 0}\n })\n }", "title": "" }, { "docid": "b0f5419690d11ed19b149a8c49cce938", "score": "0.5572257", "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": "0c261dec0270f4c6881c2c72324ddfe3", "score": "0.55714244", "text": "set parent(parent) {\n super.parent = parent;\n\n const me = this;\n\n me.gantt = parent;\n\n parent.project.on({\n load : 'updateStartDateField',\n refresh : 'updateStartDateField',\n thisObj : me\n });\n\n me.styleNode = document.createElement('style');\n document.head.appendChild(me.styleNode);\n }", "title": "" }, { "docid": "8b4bf4d2caa487853ad46ae47b8925c9", "score": "0.5568587", "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": "ba2c148b9c22c320ae996d17847c8253", "score": "0.55566615", "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": "a42dcd7506cc515a70b88a5a49ab767c", "score": "0.5526351", "text": "render() {\n return <ChildComponent {...this.props} />;\n }", "title": "" }, { "docid": "24000236f3444555eb70cd288f067a96", "score": "0.5509818", "text": "createComposed2Parent(props){\n\t\treturn <Group {...props}/>\n\t}", "title": "" }, { "docid": "25f399558843cc7925e32aec120e24c7", "score": "0.55037785", "text": "renderBubble(props){\n return(\n <Bubble\n {...props}\n wrapperStyle={{\n right: {\n backgroundColor: '#228B22',\n },\n }}\n />\n )\n }", "title": "" }, { "docid": "ad8787922a2a6bb24d23b4e79710464a", "score": "0.5494511", "text": "_addChildNodeToParentNode(parent, child) {\n if (parent instanceof ui.UiScrollView) {\n if (child instanceof ui.UiScrollBar) {\n parent.setScrollBar(child.Orientation, child);\n }\n\n if (child instanceof TransformNode) {\n if (child.offset !== undefined) {\n parent.setScrollContent(child, child.offset);\n } else {\n parent.setScrollContent(child);\n }\n }\n } else if (parent instanceof ui.UiListView) {\n if (child instanceof ui.UiScrollBar) {\n parent.setScrollBar(child);\n }\n if (child instanceof ui.UiListViewItem) {\n const { Padding, ItemAlignment } = child;\n if (Padding !== undefined) {\n if (ItemAlignment !== undefined) {\n parent.addItem(child, Padding, ItemAlignment);\n } else {\n parent.addItem(child, Padding);\n }\n } else {\n parent.addItem(child);\n }\n }\n } else if (parent instanceof ui.UiLinearLayout || parent instanceof ui.UiGridLayout) {\n const { Padding, ItemAlignment } = child;\n if (Padding !== undefined) {\n if (ItemAlignment !== undefined) {\n parent.addItem(child, Padding, ItemAlignment);\n } else {\n parent.addItem(child, Padding);\n }\n } else {\n parent.addItem(child);\n }\n } else if (parent instanceof ui.UiSlider) {\n if (child instanceof TransformNode) {\n if (child.offset !== undefined) {\n parent.setSliderModel(child, child.offset);\n } else {\n parent.setSliderModel(child);\n }\n }\n } else if (parent instanceof ui.UiRectLayout) {\n if (child instanceof TransformNode) {\n parent.setContent(child);\n }\n } else if (parent instanceof ui.UiDropDownList) {\n if (child instanceof TransformNode) {\n if (child.offset !== undefined) {\n parent.ButtonModel(child, child.offset);\n } else {\n parent.ButtonModel(child);\n }\n }\n if (child instanceof ui.DropDownListItem) {\n const list = parent.getList();\n list.push(child);\n parent.setList(list);\n }\n // ListFont: Font2dResource(fontDesc, fontFile, a_absolutePath)\n // fontDesc = Font2dDesc(advanceDir, flowDir, tileSize, quality, minAlpha)\n } else if (parent instanceof ui.UiDialog) {\n if (child instanceof TransformNode) {\n parent.setDialogContent(child);\n }\n } else if (parent instanceof ui.UiToggle) {\n if (child instanceof TransformNode) {\n if (child.offset !== undefined) {\n parent.setToggleModel(child, child.offset);\n } else {\n parent.setToggleModel(child);\n }\n }\n } else if (parent instanceof ui.UiPanel) {\n if (child instanceof ui.UiPanel) {\n if (child.Side !== undefined) {\n parent.setEdgeTransition(child.Side, child);\n }\n }\n } else if (parent instanceof ui.UiPortalIcon) {\n if (child instanceof ModelNode) {\n parent.setIconModel(child, child.offset);\n } else if (child instanceof TransformNode) {\n parent.setBackgroundModel(child, child.offset);\n }\n } else if (parent instanceof ui.UiButton) {\n if (child instanceof TransformNode) {\n if (child.offset !== undefined) {\n parent.setButtonModel(child, child.offset);\n } else {\n parent.setButtonModel(child);\n }\n }\n } else {\n parent.addChild(child);\n }\n }", "title": "" }, { "docid": "a14b41b18a27f740662cd896ae4fef0b", "score": "0.549317", "text": "inheritState(){\n let parentState = {};\n if (this.parent && this.parent.state) {\n parentState = this.parent.state;\n }\n this.state = Object.assign({}, parentState, this.state);\n }", "title": "" }, { "docid": "1b3aa5f6a1ff66cc16b11d0dddce34e4", "score": "0.54756814", "text": "function inheritDomSize(child, parent) {\n const parentSize = [\n parseFloat(getComputedStyle(parent).width),\n parseFloat(getComputedStyle(parent).height)\n ];\n\n if (isCanvas(child)) {\n child.width =\n (child.width / parseFloat(getComputedStyle(child).width)) *\n parentSize[0];\n child.height =\n (child.height / parseFloat(getComputedStyle(child).height)) *\n parentSize[1];\n }\n\n child.style.width = `${parentSize[0]}px`;\n child.style.height = `${parentSize[1]}px`;\n }", "title": "" }, { "docid": "969a8199e10c371aefcba1f5f1b83b35", "score": "0.5472279", "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_image = {\n backgroundImage: 'url('+img_elImage+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n pointerEvents: 'none',\n };\n const style_imageCopy4 = {\n backgroundImage: 'url('+img_elImageCopy4+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n pointerEvents: 'none',\n };\n const style_imageCopy = {\n backgroundImage: 'url('+img_elImageCopy+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n pointerEvents: 'none',\n };\n const style_imageCopy2 = {\n backgroundImage: 'url('+img_elImageCopy2+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n pointerEvents: 'none',\n };\n \n return (\n <div className=\"Component2\" style={baseStyle}>\n <div className=\"background\">\n <div className='elImage' style={style_image} />\n </div>\n <div className=\"foreground\">\n <div className='elImageCopy4' style={style_imageCopy4} />\n <div className='elImageCopy' style={style_imageCopy} />\n <div className='elImageCopy2' style={style_imageCopy2} />\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "6afa1b8172c225dff0398f9db317cde7", "score": "0.54581493", "text": "renderWithSettingsCss() {\r\n const styleOverride = this.settings.styleOverride;\r\n const el = super.render();\r\n // TODO: allow for theme props\r\n return (React_1.React.createElement(core_2.ClassNames, null, ({ css, cx }) => React_1.React.cloneElement(el, {\r\n className: (el.props.className ? el.props.className : \"\") +\r\n \" \" +\r\n css(styleOverride.css),\r\n })));\r\n }", "title": "" }, { "docid": "b951f5d34191947c67cc4c4c685ddbf3", "score": "0.54507154", "text": "_updateNativeStyles() {\n this.proton && this.proton.setNativeProps(this._protonStyles);\n }", "title": "" }, { "docid": "efcee40aa52faddfd7084df3f7419b6e", "score": "0.54462075", "text": "componentDidUpdate() {\n if (this.props.ripple && this.refs.root) {\n for (let key in this.state.rippleCss) {\n if (this.state.rippleCss.hasOwnProperty(key)) {\n this.refs.root.style.setProperty(key, this.state.rippleCss[key]);\n }\n }\n }\n }", "title": "" }, { "docid": "efaa115b4892f1774b93fa9ff1617709", "score": "0.5443074", "text": "render(){\n return <ChildComponent {...this.props}/>;\n }", "title": "" }, { "docid": "523b07445f41a735b8ca739964f718d7", "score": "0.5439193", "text": "renderBubble(props) {\n return (\n <Bubble\n {...props}\n wrapperStyle={{\n right: { backgroundColor: 'blue' },\n left: { backgroundColor: 'white' }\n }}\n />\n )\n }", "title": "" }, { "docid": "0a4b01fc175e6c05948200c8a5ea5860", "score": "0.5417949", "text": "static _appendStyleNode(root, child) {\n return root.appendChild(Node.createNode(child()))\n }", "title": "" }, { "docid": "86e4d8df1739fbe77c755fabc0667374", "score": "0.5409707", "text": "get overridingStylesMixinApplied() {\r\n return true;\r\n }", "title": "" }, { "docid": "089d3e3e68e8ed0f7e500548e4632529", "score": "0.53926766", "text": "getStyles() {\n if (!this.props.children) {\n return [];\n }\n\n return [\n {\n key: this.props.children.key,\n data: this.props.children,\n style: ensureSpring(this.props.atActive),\n },\n ];\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e890f64fa5a7ad7a641213f41e0c73f3", "score": "0.5391363", "text": "updateStyle() {\n this._styling(this._elRef, this);\n }", "title": "" }, { "docid": "e9c9ec8cf1d25a90b4814d28b51a4aa3", "score": "0.53900385", "text": "renderBubble(props) {\n return (\n <Bubble\n {...props}\n wrapperStyle={{\n right: {\n backgroundColor: '#000'\n }\n }}\n />\n )\n }", "title": "" }, { "docid": "49c5fc846ca1bfe1e6e556742b1f3ddf", "score": "0.53799164", "text": "static get styles() {\n return [\n css`\n :host {\n display: none;\n clear: both;\n }\n `,\n ];\n }", "title": "" }, { "docid": "b43dac96d3330c08c4379c5201d24e2c", "score": "0.5377471", "text": "componentDidUpdate(prevProps) {\n // if drop down with scrolling parent became active, update the positioning styles\n if (this.shouldCalculateDropdownStyle(prevProps)) {\n this.setState(this.fixedDropdownStyle());\n }\n }", "title": "" }, { "docid": "c5dc10ccdc89b23dc57c481bb028af1e", "score": "0.53723705", "text": "function App() {\n // https://webomnizz.com/change-parent-component-state-from-child-using-hooks-in-react/\n // parent-child communication\n const [background, setBackground] = useState(\"\");\n\n // this function gets called when the callback is called on the child\n function handleSectionChange(newValue) {\n setBackground(newValue);\n }\n // the style depends on the `background` variable\n const appBackground = {\n backgroundColor: background,\n };\n // we could add this to an element in the component, but we should change too many things in the style\n document.body.style = appBackground;\n return (\n <>\n <Header/>\n <div className=\"sections\">\n {elements.map((value, index) => {\n // here we pass the props to our section\n return <Section key={value.key} content={value} index={index} onSectionChanged={handleSectionChange} />\n })}\n </div>\n <Stamps/>\n </>\n );\n}", "title": "" }, { "docid": "e585d54c9542785dc1f3e2cef362cb45", "score": "0.53699887", "text": "function App() {\n return (\n <div className=\"className\">\n <GlobalStyle/>\n <AboutMe></AboutMe>\n </div>\n \n );\n}", "title": "" }, { "docid": "41c82f46e3fc1ed3932b3fe05c4c4c9e", "score": "0.53599024", "text": "function component1() {\n return (\n <Spring\n from={{ opacity: 0, marginTop: -500 }}\n to={{ opacity: 1, marginTop: 0 }}\n >\n {(props) => (\n <div style={props}>\n <div style={c1Style}>Component 1</div>\n </div>\n )}\n </Spring>\n );\n}", "title": "" }, { "docid": "638ec6bedf6c3abd2dcc635871a8260d", "score": "0.53578454", "text": "function getStyle(vnode,checkChild){\nvar res={};\nvar styleData;\n\nif(checkChild){\nvar childNode=vnode;\nwhile(childNode.componentInstance){\nchildNode=childNode.componentInstance._vnode;\nif(\nchildNode&&childNode.data&&(\nstyleData=normalizeStyleData(childNode.data)))\n{\nextend(res,styleData);\n}\n}\n}\n\nif(styleData=normalizeStyleData(vnode.data)){\nextend(res,styleData);\n}\n\nvar parentNode=vnode;\nwhile(parentNode=parentNode.parent){\nif(parentNode.data&&(styleData=normalizeStyleData(parentNode.data))){\nextend(res,styleData);\n}\n}\nreturn res;\n}", "title": "" }, { "docid": "b0c4812ee060dcb782b3118faf8653f3", "score": "0.53490883", "text": "update(e){super.update(e);const t=this.render();t instanceof TemplateResult&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._uniqueStyles.forEach(e=>{const t=document.createElement(\"style\");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}", "title": "" }, { "docid": "9a428dbb2a20516f9d8e0d4b009f8e00", "score": "0.534457", "text": "function GrandParent() {\n return (\n <div className=\"GrandParent\">\n <Parent />\n </div>\n )\n}", "title": "" }, { "docid": "c3044f921b5f4f68b5455b5cee2f469c", "score": "0.53301924", "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_image = {\n backgroundImage: 'url('+img_elImage+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n pointerEvents: 'none',\n };\n const style_imageCopy3 = {\n backgroundImage: 'url('+img_elImageCopy3+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n pointerEvents: 'none',\n };\n const style_imageCopy4 = {\n backgroundImage: 'url('+img_elImageCopy4+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n pointerEvents: 'none',\n };\n const style_imageCopy = {\n backgroundImage: 'url('+img_elImageCopy+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n pointerEvents: 'none',\n };\n \n return (\n <div className=\"Component6\" style={baseStyle}>\n <div className=\"background\">\n <div className='elImage' style={style_image} />\n </div>\n <div className=\"foreground\">\n <div className='elImageCopy3' style={style_imageCopy3} />\n <div className='elImageCopy4' style={style_imageCopy4} />\n <div className='elImageCopy' style={style_imageCopy} />\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "44f9fe63ad5ae128877b0700eb351d3b", "score": "0.53263557", "text": "setStyleOverrides(_styles) {\n\t\t/* start 1 - here until the end of this code is where I will delcare a block with logic sort of relient on eachother */\n\t\tif(this.state.shiftUpHelper !== '') {\n\t\t\t//if I have set a style to override in the state, use it\n\t\t\t_styles.AddressSectionContainer = { ...styles.AddressSectionContainer, top: this.state.shiftUpHelper }\n\t\t}\n\t\telse {\n\t\t\t//otherwise use the default style\n\t\t\t_styles.AddressSectionContainer = { ...styles.AddressSectionContainer }\n\t\t}\n\t\tif(this.state.shiftLeftHelper !== '') {\n\t\t\tif(this.state.shiftUpHelper !== '') {\n\t\t\t\t//this whole if else above and this if else here need to be merged, but for now\n\t\t\t\t//I add this mini if else to make sure that the top property doesnt get overwritten\n\t\t\t\t_styles.AddressSectionContainer = { ...styles.AddressSectionContainer, left: this.state.shiftLeftHelper, top: this.state.shiftUpHelper }\n\t\t\t}\n\t\t\telse {\n\t\t\t\t_styles.AddressSectionContainer = { ...styles.AddressSectionContainer, left: this.state.shiftLeftHelper }\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t_styles.AddressSectionContainer = { ...styles.AddressSectionContainer }\n\t\t}\n\t\t/* end 1 */\n\n\n\n\t\treturn { ..._styles }\n\t}", "title": "" }, { "docid": "3480de98eed9bf2f0941c2a0fe8f2361", "score": "0.53256005", "text": "render() {\n return (\n <StylePickerComponent\n styles={this.props.styles}\n selectedStyle={this.props.selectedStyle}\n onStyleSelected={this.props.changeMapStyle}\n />\n )\n }", "title": "" }, { "docid": "6b8dda264481ca37d499d5cfcc3564bb", "score": "0.53206223", "text": "updateAppearance () {\n const centerY = this.toBottom ?\n 0 : this.height + this.visData.global.row.height;\n\n this.wrapper\n .classed('transitionable', this.visible)\n .classed('open', this.opened)\n .style('transform', this.translate + ' ' + this.scale)\n .style(\n 'transform-origin',\n (this.visData.global.column.width / 2) + 'px ' + centerY + 'px'\n );\n }", "title": "" }, { "docid": "c55972444bb6daf9ff15421da4c943a7", "score": "0.5317228", "text": "updateStyle(updateRenderer) {\n\t let s = window.getComputedStyle(this.elem, null);\n\t this.defaultColor = s.color;\n\t this.defaultBackground = s.backgroundColor;\n\t if (updateRenderer !== false) {\n\t this.renderer.updateStyle(s);\n\t }\n\t }", "title": "" }, { "docid": "062afb0ece59ebf4674e39d3bd6a8558", "score": "0.530547", "text": "setBentStyle(newValue){\r\n this.bentStyle.style = newValue\r\n }", "title": "" }, { "docid": "0e698dc413efac41132511f4c0dd194d", "score": "0.5300111", "text": "render(){\n return (\n <ChildComp2>This is <Spades></Spades> clickable</ChildComp2>\n )\n }", "title": "" }, { "docid": "f5dcd4c37e22a6637d2da71c38900cf6", "score": "0.52993864", "text": "@updateStyles\n componentWillUpdate() {\n console.log('will update');\n }", "title": "" }, { "docid": "1c1c532cbc4e368348c7c4032fd0cf76", "score": "0.5249568", "text": "function onChildCellConfigChanged(child) {\r\n if (child.parent && child.parent.layout instanceof GridLayout) {\r\n child.parent.fit();\r\n }\r\n }", "title": "" }, { "docid": "1c1c532cbc4e368348c7c4032fd0cf76", "score": "0.5249568", "text": "function onChildCellConfigChanged(child) {\r\n if (child.parent && child.parent.layout instanceof GridLayout) {\r\n child.parent.fit();\r\n }\r\n }", "title": "" }, { "docid": "1c1c532cbc4e368348c7c4032fd0cf76", "score": "0.5249568", "text": "function onChildCellConfigChanged(child) {\r\n if (child.parent && child.parent.layout instanceof GridLayout) {\r\n child.parent.fit();\r\n }\r\n }", "title": "" }, { "docid": "80c0965a264aa727e4201e3e1d1e60b3", "score": "0.52491254", "text": "componentDidUpdate() {\n if (this.nativeSwitch) {\n this.nativeSwitch.disabled = this.state.disabledInternal;\n }\n // To make the ripple animation work we update the css properties after React finished building the DOM.\n if (this.root) {\n this.state.rippleCss.forEach((v, k) => {\n this.root.style.setProperty(k, v);\n });\n }\n }", "title": "" }, { "docid": "d682f0ff1f60adc91b3a79a482ecbd32", "score": "0.5225845", "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": "640c882005a133931e7f254023d10382", "score": "0.52230775", "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 &&\n childNode.data &&\n (styleData = normalizeStyleData(\n childNode.data,\n ))\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 (\n parentNode.data &&\n (styleData = normalizeStyleData(\n parentNode.data,\n ))\n ) {\n extend(res, styleData)\n }\n }\n return res\n }", "title": "" }, { "docid": "b9e3dd0dc7cc5fdae17c2b55874e9704", "score": "0.52187955", "text": "get componentStylesMixinApplied() {\r\n return true;\r\n }", "title": "" }, { "docid": "e7ae80d473fe31f4ba135781d46109e2", "score": "0.5212749", "text": "render(){\n return(\n <div className=\"bar\" style={navBarLiStyle}>\n <div>\n {this.props.children}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "8683b7e2881f632f98cdcaeb3689da32", "score": "0.5201188", "text": "static get styles() {\n return [\n css`\n :host {\n display: block;\n }\n .field {\n padding-top: 32px;\n padding-bottom: 32px;\n }\n\n .actions {\n display: flex;\n border-top: 2px solid gainsboro;\n margin-top: 16px;\n font-size: 14px;\n }\n\n .actions .spacer {\n flex: 1 1 auto;\n }\n\n .submission-critique-outline + .submission-critique-outline {\n margin-top: 16px;\n }\n\n :host([edit])\n .submission-critique-outline--feedback\n lrnapp-studio-block {\n padding: 0;\n }\n `\n ];\n }", "title": "" }, { "docid": "43cba0e020e440c0d622c01ac55a8f56", "score": "0.5190214", "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": "7cdd14ce940e2a3ce3a154960118a610", "score": "0.51743245", "text": "function getChildContext(){\n that = this;\n\n // get react-inline-style context\n this.context.reactInlineStyle = this.context.reactInlineStyle || {};\n var context = this.context.reactInlineStyle;\n context[this._reactInternalInstance._mountOrder] = context[this._reactInternalInstance._mountOrder] || {};\n var thisContext = context[this._reactInternalInstance._mountOrder];\n \n // get parent styles\n var id, parent = this._reactInternalInstance;\n var parentStyles = false;\n\n while(parent._currentElement._owner) {\n parent = parent._currentElement._owner;\n id = parent._mountOrder;\n if(typeof context[id] === \"object\" && typeof context[id].ownerStyles === \"function\") {\n parentStyles=context[id];\n break;\n }\n }\n\n // define componentInstance styles\n if(parentStyles) {\n ownerStyles = parentStyles.ownerStyles();\n rootNamespace = parentStyles.rootNamespace || \"\";\n }\n\n // apply root namespace\n var namespace = \"\";\n if(typeof this.props.styleNamespace === \"string\") {\n namespace = getNamespace(this.props.styleNamespace);\n ownerStyles = getClassFromString(namespace, ownerStyles);\n }\n\n rootNamespace = getNamespace(rootNamespace, namespace);\n\n // copy styles from moduleInstance to componentInstance\n new objct.e.extend(store, objct.e.deep(moduleStore), objct.e.deep(instanceStore));\n\n // pass on component styles\n context[this._reactInternalInstance._mountOrder]={\n ownerStyles : objct.e(store, objct.e.deep(ownerStyles)),\n rootNamespace : rootNamespace\n }\n\n return {\n reactInlineStyle : context\n }\n }", "title": "" }, { "docid": "0178c8a2a60d82d6b96c4a28c524d565", "score": "0.5173243", "text": "function PropsPractice() {\r\n return (\r\n <div>\r\n\r\n <Child/>\r\n \r\n </div>\r\n )\r\n}", "title": "" }, { "docid": "653ac038fd7a0c94ee82600493878da2", "score": "0.5171918", "text": "initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}", "title": "" }, { "docid": "f0d2ee39c5d1f9c2ac588469b2ce214a", "score": "0.51682025", "text": "constructor(props) {\n //...and props is sent back to the parent Component\n //class using super()\n super(props);\n }", "title": "" }, { "docid": "de298ff6b75d63a0485ab34d364f5c47", "score": "0.5167475", "text": "constructor(props,children) {\n super(props);\n }", "title": "" }, { "docid": "743b7539b8d2deb1ce56644120ec3e1a", "score": "0.5165236", "text": "function Container(props) {\n return <div className=\"container\" style={props.style}>{props.children}</div>;\n}", "title": "" }, { "docid": "a22f18f681c4c329dd594148d4a94c13", "score": "0.5163939", "text": "function decorateChildren(parent) {\n parent.children.forEach(c => {\n c.userData.partOfModal = e;\n decorateChildren(c);\n });\n }", "title": "" }, { "docid": "49caaf3a3c800d68372f66a5fce5baf1", "score": "0.5159891", "text": "function App() {\n return (\n <React.Fragment>\n <Container style={{backgroundColor: 'grey', marginTop: '150px'}}>\n <Header />\n <PostControl />\n </Container>\n </React.Fragment>\n );\n}", "title": "" }, { "docid": "bea4feb9d2938b020a297d603c3ed076", "score": "0.5136791", "text": "havingBaseStyle(style){style=style||this.style.text();const wantSize=sizeAtStyle(Options.BASESIZE,style);if(this.size===wantSize&&this.textSize===Options.BASESIZE&&this.style===style){return this;}else{return this.extend({style:style,size:wantSize});}}", "title": "" }, { "docid": "820ea63eb62c280b00b090da2ac9c43d", "score": "0.5134494", "text": "function child() {\n parent.apply(this, arguments);\n}", "title": "" }, { "docid": "da3eec9f994cd315974c41d452d377d4", "score": "0.51326525", "text": "render() {\n let {\n alignContent, alignItems, alignSelf, as, basis, border, children, color,\n cursor, decor, direction, display, fill, full, grow, height, hoverBorder,\n hoverColor, hoverFill, justify, margin, maxHeight, maxWidth, onClick, pad,\n reverse, responsive, responsiveOptions, shrink, textAlign, family,\n textSize, weight, texture, width, wrap, theme, ...props\n } = this.props;\n\n // Expand child functionality, e.g., pad.between & margin.between\n const { frame, brand } = theme;\n\n const styles = `\n align-content: ${find(frame, 'alignContent', alignContent)}\n align-items: ${find(frame, 'alignItems', alignItems)};\n align-self: ${find(frame, 'alignSelf', alignSelf)};\n background: ${brand.colorIndex[fill] || fill};\n background-image: ${!!texture ? `url(${texture})`: 'none'};\n background-position:${!!texture ? 'center center' : '0% 0%'};\n background-repeat: no-repeat;\n background-size: cover;\n box-sizing: border-box;\n color: ${brand.colorIndex[color] || color};\n cursor: ${!!(onClick || hoverBorder || hoverColor || hoverFill)\n ? 'pointer' : 'auto'};\n display: ${find(frame, 'display', display)};\n flex: ${find(frame, 'grow', grow)}\n ${find(frame, 'shrink', shrink)}\n ${find(frame, 'basis', basis)};\n flex-direction: ${find(frame, 'direction', direction)};\n flex-wrap: ${find(frame, 'wrap', wrap)};\n font-family: ${brand.font[family] || family};\n font-size: ${brand.textSize[textSize] || textSize};\n font-weight: ${brand.weight[weight] || weight};\n height: ${find(frame, 'height', height)};\n justify-content: ${find(frame, 'justify', justify)};\n max-height: ${maxHeight};\n max-width: ${maxWidth};\n text-align: ${textAlign};\n text-decoration: none;\n width: ${find(frame, 'width', width)};\n\n ${parse(brand, 'border', border) || 'border:none;'};\n ${parse(frame, 'pad', pad, 'padding') || 'padding:0;'};\n ${parse(frame, 'margin', margin) || 'margin:0;'};\n\n &:hover {\n background: ${brand.colorIndex[hoverFill] || hoverFill};\n color: ${brand.colorIndex[hoverColor] || hoverColor};\n\n ${parse(brand, 'border', hoverBorder) || parse(brand, 'border', border)};\n }\n\n @media ( max-width: 768px ) {\n flex-direction: ${!!responsive\n ? direction === 'row' ? 'column' : 'row'\n : find(frame, 'direction', direction) };\n\n * {\n padding-${!!responsive ? 'top' : 'left'}: ${pad.between};\n margin-${!!responsive ? 'top' : 'right'}: ${margin.between};\n }\n\n ${responsiveOptions}\n }\n `;\n\n const Box = typeof as === 'string'\n ? styled[as]`${styles}`\n : styled(as)`${styles}`;\n\n return <Box onClick={ onClick } {...props}>{ reverse\n ? Object.assign([], children).reverse()\n : children }</Box>;\n }", "title": "" }, { "docid": "4b1a35061c068f77bf639707ac0fcee6", "score": "0.5131671", "text": "function App() {\n return (\n <React.Fragment>\n <Header />\n <Container style={{ backgroundColor: 'blue', marginTop: '150px' }}>\n <SurveyControl />\n </Container>\n </React.Fragment>\n );\n}", "title": "" }, { "docid": "e8fe65a3aeac18415bc42340aae36545", "score": "0.5127477", "text": "componentWillMount() {\n if (this.props.color) {\n this.styles.color = this.props.color;\n }\n }", "title": "" }, { "docid": "7581d9ab509ba238cbd48aa88fae7e0a", "score": "0.5124882", "text": "static get styles() {\n return css`\n :host {\n display: block;\n }\n :host([need='joy']) {\n color: yellow;\n background-color: black;\n }\n `;\n }", "title": "" }, { "docid": "7061e5d555d1b0ffee4502b200df1326", "score": "0.5116667", "text": "constructor(parent) {\n\n }", "title": "" }, { "docid": "7061e5d555d1b0ffee4502b200df1326", "score": "0.5116667", "text": "constructor(parent) {\n\n }", "title": "" }, { "docid": "7061e5d555d1b0ffee4502b200df1326", "score": "0.5116667", "text": "constructor(parent) {\n\n }", "title": "" }, { "docid": "7061e5d555d1b0ffee4502b200df1326", "score": "0.5116667", "text": "constructor(parent) {\n\n }", "title": "" }, { "docid": "7061e5d555d1b0ffee4502b200df1326", "score": "0.5116667", "text": "constructor(parent) {\n\n }", "title": "" }, { "docid": "7061e5d555d1b0ffee4502b200df1326", "score": "0.5116667", "text": "constructor(parent) {\n\n }", "title": "" }, { "docid": "e50aaebc3c81471e1c2cfae3a97239f5", "score": "0.51162684", "text": "transferToChild(children, props = {}) {\n const child = Children.only(children);\n const mergedProps = {};\n\n Object.keys(props).forEach((key) => {\n const newValue = props[key];\n const newType = typeof newValue;\n const oldValue = child.props[key];\n const oldType = typeof oldValue;\n let mergedValue = null;\n\n // If a value exists on both ends, handle accordingly\n // We need to do `typeof` checks so that we don't type juggle incorrectly\n if (oldType !== 'undefined' && newType !== 'undefined') {\n // Event handlers should be wrapped\n if (key.match(/^on[A-Z]/)) {\n mergedValue = wrapFunctions(newValue, oldValue);\n\n // Append the new class name\n } else if (key === 'className' || key.match(/^[a-zA-Z]ClassName$/)) {\n mergedValue = `${oldValue} ${newValue}`;\n }\n } else if (oldType === 'undefined' && newType !== 'undefined') {\n mergedValue = newValue;\n }\n\n if (mergedValue !== null) {\n mergedProps[key] = mergedValue;\n }\n });\n\n return React.cloneElement(child, mergedProps);\n }", "title": "" }, { "docid": "71d4f0fb3e464958742971b939a99087", "score": "0.5107172", "text": "function getStyle (vnode, checkChild) {\r\n var res = {};\r\n var styleData;\r\n\r\n if (checkChild) {\r\n var childNode = vnode;\r\n while (childNode.componentInstance) {\r\n childNode = childNode.componentInstance._vnode;\r\n if (\r\n childNode && childNode.data &&\r\n (styleData = normalizeStyleData(childNode.data))\r\n ) {\r\n extend(res, styleData);\r\n }\r\n }\r\n }\r\n\r\n if ((styleData = normalizeStyleData(vnode.data))) {\r\n extend(res, styleData);\r\n }\r\n\r\n var parentNode = vnode;\r\n while ((parentNode = parentNode.parent)) {\r\n if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\r\n extend(res, styleData);\r\n }\r\n }\r\n return res\r\n }", "title": "" }, { "docid": "7d29aeaa5c21e71d2ade6cc8567a4b9b", "score": "0.5097319", "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.5097319", "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.5097319", "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.5097319", "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": "94e5554225d4b6f9fbaa7fa5cf052187", "score": "0.5095491", "text": "static get styles() {\n return [\n css`\n :host {\n display: block;\n }\n paper-button {\n padding: 0;\n margin: 0;\n min-width: 1rem;\n }\n `\n ];\n }", "title": "" }, { "docid": "99a8b2779219d43594c889766c3be610", "score": "0.5095028", "text": "componentWillReceiveProps() {\n this.fitToParentSize();\n }", "title": "" }, { "docid": "bb5895f18a66b00b90b22c86b81913d8", "score": "0.5094179", "text": "function getStyle (vnode, checkChild) {\n\t var res = {};\n\t var styleData;\n\n\t if (checkChild) {\n\t var childNode = vnode;\n\t while (childNode.componentInstance) {\n\t childNode = childNode.componentInstance._vnode;\n\t if (\n\t childNode && childNode.data &&\n\t (styleData = normalizeStyleData(childNode.data))\n\t ) {\n\t extend(res, styleData);\n\t }\n\t }\n\t }\n\n\t if ((styleData = normalizeStyleData(vnode.data))) {\n\t extend(res, styleData);\n\t }\n\n\t var parentNode = vnode;\n\t while ((parentNode = parentNode.parent)) {\n\t if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n\t extend(res, styleData);\n\t }\n\t }\n\t return res\n\t }", "title": "" }, { "docid": "88157967f571f7e12da7125a9059982f", "score": "0.50903225", "text": "onChildShown(msg) {\n super.onChildShown(msg);\n // Post a fit request for the parent widget.\n this.parent.fit();\n }", "title": "" } ]
654524d301931a604c5345d75147e510
custom submit handler invokes callback to the function that invokes youtube search.
[ { "docid": "57f9e5365ab2e9ecb6da35c837c1f545", "score": "0.0", "text": "onSubmitSearch(term){\n // console.log(term);\n this.props.onSearchTermChange(term);\n }", "title": "" } ]
[ { "docid": "91b76e24be227143cc9de3a378617f46", "score": "0.76744246", "text": "function listenForSubmit() {\n\t$(\".js-search-form\").submit(function(event) {\n\t\tevent.preventDefault();\n\t\tconst queryTarget = $(event.currentTarget).find(\".js-search-term\"); // creating a variable \"querTarget\" which is \n\t\tconst query = queryTarget.val(); //setting a variable \"query\" to the value of queryTarget\n\t\tqueryTarget.val(\"\"); // clears the input box - but still storing the original search term in \"query\"\n\t\tgetDataFromApi(query, displayYouTubeSearchData); // this is calling the function \"getDatafromApi\" with \"query\" and the callback function \"displayYT...\"\n\t});\n}", "title": "" }, { "docid": "33ebaf4f11da1449e371927e44e6812a", "score": "0.7225874", "text": "submit(e) {\n e.preventDefault();\n if (!this.props.youtube.searching && !isSearchLoaded(this.props.youtube, this.state.query)) {\n this.changeQueryString(this.state.query);\n this.search();\n }\n }", "title": "" }, { "docid": "5bdf68ddc8e43b676d64ae37fa2474d8", "score": "0.7036147", "text": "function handleSubmitClick(obj, event){\n\t\tuserEntry = document.getElementById('userEntry');\n\t\tsearchTerm = userEntry.value;\n\t\ttoggleErrorMessage(false);\n\t\tpreviousSearches = [];\n\t\tpreviousSearches.push(searchTerm);\n\t\tif(searchTerm != null && searchTerm != ''){\n\t\t\tcurrentVideoList = [];\n\t\t}\n\t\tgetVideosList(searchTerm);\n\t}", "title": "" }, { "docid": "1fcf8bae07c978fe6eb9667cad23c1ef", "score": "0.6853224", "text": "function submitHandler(e) {\n e.preventDefault();\n callSearch();\n }", "title": "" }, { "docid": "10c60acda65a3c2c9abb336679294731", "score": "0.6706667", "text": "function watchSubmit() {\n $('.js-search-form').submit(event => {\n event.preventDefault();\n const queryTarget = $(event.currentTarget).find('.js-query');\n const query = queryTarget.val();\n // clear out the input\n showResultsText();\n queryTarget.val(\"\");\n getDataFromApi(query, displayYouTubeData);\n $('main').addClass('g-bg');\n });\n}", "title": "" }, { "docid": "bd772540061e50881a3ef422cfb78384", "score": "0.6579096", "text": "function runOnSubmit(){\n $('.guidebox-search-form').submit(function(event){ //when search form has a submit\n $('.guidebox-search-results').empty(); //empty the previous results\n event.preventDefault(); //prevent submit from reloading the page\n var query = $(this).find('.guidebox-query').val(); //grab the users search term\n searchGuideboxAPI(query, displaySearchData); //call the function to search movies passing in the users term then running displaySearchData\n });\n }", "title": "" }, { "docid": "b31f2abe645714e3819690f8c3ea48e7", "score": "0.65418416", "text": "submitHandler(searchTerm) {\n this.makeSearch(searchTerm)\n }", "title": "" }, { "docid": "0667328e7f7990cea0a1c155fbb0600c", "score": "0.6502379", "text": "function SubmitSearch(artist, title, album) {\n // Send the data using post\n var posting = $.get( '/yt/search', { artist: artist, title: title, album:album } );\n \n // Put the results in a div\n posting.done(function( data ) {\n if (data.success == true) {\n showtoast(\"Link successfully retrieved\");\n }\n else {\n showtoast(\"Error: \"+data.error);\n }\n $('#search-box').val('');\n });\n\n posting.error(function () {\n showtoast(\"Error: POST to service failed\");\n });\n\n}", "title": "" }, { "docid": "d6db4a6b6455e0cf142172f7d2df581d", "score": "0.64713997", "text": "function onSearchSubmit() {\n \n function formatInput(str) {\n // remove any space and # from the hashtag\n var regex = /[\\s|#]*/g;\n var trimed = str.replace(regex, \"\");\n return trimed;\n }\n\n if (_callback) {\n var userInput = formatInput(_searchInput.value);\n _callback(userInput);\n }\n else {\n console.error(\"Search callback is not specified\");\n }\n }", "title": "" }, { "docid": "d113b53efe5e6fee6a373045488c677e", "score": "0.641323", "text": "function handleSubmit() {\n console.log('1');\n $('#input-form').submit(event => {\n event.preventDefault();\n const searchWordTarget = $(event.currentTarget).find('#searchfield');\n const searchWord = searchWordTarget.val();\n searchWordTarget.val(\"\");\n console.log(searchWord);\n if (searchWord == '') {\n \t$('main').html(`\n \t\t<div class = 'empty'>\n \t\t<h1>Whoops!</h1>\n \t\t<p>Please add a search keyword</p>\n \t\t</div>\n \t\t`);\n }\n else{\n \tcallYoutube(searchWord, displayYoutubeData);\n \tcallUrbanDictionary(searchWord);\n \tcallGiphy(searchWord);\n }\n });\n}", "title": "" }, { "docid": "bd7035ea40c30b1e08525dd07b7da2cc", "score": "0.638644", "text": "function youtubeRequest(searchTerm, callback) {\n const query = {\n part: 'snippet',\n key: `${youtubeKey}`,\n q: `The best recipe for ${searchTerm} in: name`\n }\n let result = $.ajax({\n /* update API end point */\n url: YOUTUBE_URL,\n data: query,\n dataType: 'json',\n /*set the call type GET / POST*/\n type: 'GET'\n })\n /* if the call is successful (status 200 OK) show results */\n .done(function (result) {\n /* if the results are meeningful, we can just console.log them */\n callbackTube(result);\n })\n /* if the call is NOT successful show errors */\n .fail(function (jqXHR, error, errorThrown) {\n console.log(jqXHR);\n console.log(error);\n console.log(errorThrown);\n });\n}", "title": "" }, { "docid": "dbb536da0f9455c2ecc2aa193d1e1a18", "score": "0.6377988", "text": "function watchSubmit() {\n $('.js-search').submit(event => {\n event.preventDefault();\n const queryTarget = $(event.currentTarget).find('.js-query');\n const query = queryTarget.val();\n\n getDataFromApi(query, getMovie);\n });\n}", "title": "" }, { "docid": "c5e1f3710c55520258f447ee416862fb", "score": "0.6322425", "text": "function searchButton() {\n $('#video-search').on('submit', function(evt) {\n evt.preventDefault();\n searchPlayer.cuePlaylist({\n listType: 'search',\n list: $('input[name=query]').val()\n });\n $('input[name=query]').blur();\n });\n }", "title": "" }, { "docid": "4cea491719f48ea9b1aa38ac2ac82dc3", "score": "0.6278125", "text": "handleSubmit(event) {\n // invokes callback to search for videos.\n this.props.enterSearch(this.state.term);\n // below code to prevent default behaviour of react for this event.\n event.preventDefault();\n }", "title": "" }, { "docid": "d02a456af70d67e5f5267c7d82b69f9c", "score": "0.624455", "text": "handleQuerySubmit(e) {\n e.preventDefault();\n return this.makeWikiQuery();\n }", "title": "" }, { "docid": "48783a186483451295fd9b4fcfa78ed6", "score": "0.6196243", "text": "function searchCallback() {\n\t\tlet searchValue = escapeHtml($(\".search__input\").val());\n\t\t\n\t\t// Check if the input field contains text\n\t\tif(searchValue.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clear\n\t\t$( \".channel__search\" ).empty();\n\n\t\t// Hide the regular stuff\n\t\t$( \".clear-cache\" ).addClass('hide');\n\t\t$( \".cache-status\" ).addClass('hide');\n\t\t$( \".channel\" ).each(function() {\n\t\t\t$( this ).addClass('hide');\n\t\t});\n\t\t\n\t\t// Show the 'stop searching' button and loader\n\t\t$( \".stop-searching\" ).removeClass('hide');\n\t\t$( \"#content .container\" ).append('<div class=\"loader\"></div>');\n\t\t\n\t\t// Add the new channel\n\t\t$( \".channel__search\" ).html(addInnerChannel());\n\t\t$( \".channel__search\" ).find(\".channel__username\").text(searchValue);\n\t\t$( \".channel__search\" ).find(\".channel__header a\").attr(\"href\", \"https://www.youtube.com/results?search_query=\" + searchValue);\n\t\t\n\t\t// Start the search\n\t\t$.ajax({\n\t\t\turl: String.format(YOUTUBE_SEARCH_URL, searchValue, YOUTUBE_KEY, SEARCH_VIDEO_AMOUNT),\n\t\t\ttype: \"GET\",\n\t\t\tasync: true,\n\t\t\tcache: false,\n\t\t\tsuccess:function(data){\n\t\t\t\t\n\t\t\t\t// Remove the loader\n\t\t\t\t$( \".loader\" ).remove();\n\n\t\t\t\t// Create the formatted array\n\t\t\t\tlet videos = $( \".channel__search\" ).find(\".channel__videos\");\n\t\t\t\tlet formattedVideos = formatVideo(data.items, true);\n\n\t\t\t\t$.each(formattedVideos, function(key, value) {\n\t\t\t\t\tvideos.append(addVideo(value));\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$( \".channel__search\" ).removeClass('hide');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "2d0ea37b2b20f123a7979052d4a78c52", "score": "0.6162414", "text": "handleSubmit(event){\n\t\tevent.preventDefault(); \n\t\tthis.search(event);\n\t}", "title": "" }, { "docid": "0484eb4700f8aa7d0e634b413faebbc8", "score": "0.61616486", "text": "submit() {\n const searchString = this.refs.searchString.value.trim();\n this.searchTweets(this.filter(searchString));\n }", "title": "" }, { "docid": "096117dce85b5730f369455b58dbe78f", "score": "0.6161289", "text": "function submitResults() {\n \n }", "title": "" }, { "docid": "b40a3a68d523425eb414c898cef2bdae", "score": "0.61527795", "text": "async function handleSearchSubmit(e){\n e.preventDefault();\n changeUrl();\n }", "title": "" }, { "docid": "001002745be3d68cfc081029a3b3f32f", "score": "0.614551", "text": "function processSubmit() {\r\n // Get the forms values:\r\n var artist = $(\"#artist-query\").val();\r\n\r\n // Send artist and query options off to getEvents function for further handling:\r\n getEvents(artist);\r\n}", "title": "" }, { "docid": "964e6c5953f73570d03eb92bd75d8019", "score": "0.61224693", "text": "addHandlerSearch(handler) {\n this._parentEl.addEventListener('submit', event => {\n event.preventDefault(); // Prevent reloading of page upon user clicking on a recipe\n handler(); // Passes functionality back to controller (controller.js file) and the controlSearchResults method\n });\n }", "title": "" }, { "docid": "737d880a61e1f6012b63ba7914735dad", "score": "0.608373", "text": "function SubmitURL(url) {\n // Send the data using post\n var posting = $.post( '/yt/q', { url: url } );\n \n // Put the results in a div\n posting.done(function( data ) {\n if (data.success == true) {\n showtoast(\"Link successfully retrieved\");\n }\n else {\n showtoast(\"Error: \"+data.error);\n }\n $('#url-box').val('');\n });\n\n posting.error(function () {\n showtoast(\"Error: POST to service failed\");\n });\n\n}", "title": "" }, { "docid": "5843eb551344a506639c05ad4e9c8ad1", "score": "0.6074601", "text": "async function submitForm(event) {\n event.preventDefault(); \n\n setIsLoading(true);\n\n // Change variable declaration to match API request keys\n const name = songName; \n const description = songCategory;\n const fileName = suggestionFileName; \n const songLink = suggestionSongLink; \n const cold = (songColdness ? \"Y\" : \"N\");\n const hot = (songHotness ? \"Y\" : \"N\");\n const temperate = (songTemperateness ? \"Y\" : \"N\");\n const precip = (songRainyness ? \"Y\" : \"N\"); \n\n try {\n await postsongEntry(\n {name,\n fileName, \n description, \n songLink, \n cold, \n hot,\n temperate,\n \"tableName\" : TABLE_NAME,\n precip \n }); \n history.push(\"/suggestion/another\");\n console.log(\"final youtube is:\",songLink)\n\n }\n\n catch (e) {\n onError(e);\n setIsLoading(false); \n }\n }", "title": "" }, { "docid": "631b02601ce1520bd6bbd9ad63618a22", "score": "0.60690707", "text": "function watchSubmit(){\n $('.js-search-form').submit(function(event){\n $('.js-search-results').empty();\n event.preventDefault();\n var query = $(this).find('.js-query').val();\n getSearchDataFromApi(query, displaySearchData);\n });\n }", "title": "" }, { "docid": "06820e744f7be78383497678c4b3e266", "score": "0.6060996", "text": "function search() {\n var q = $('#query').val();\n var request = gapi.client.youtube.search.list({\n q: q,\n part: 'snippet'\n });\n\n}", "title": "" }, { "docid": "a90d709c05f21e5c0019f504d8581134", "score": "0.60290396", "text": "function submitSearch () {\n console.log('submitsearch')\n requestResponseObject(currentLocation)\n}", "title": "" }, { "docid": "3ab5004c2c9a623064259088cebc6f27", "score": "0.60267985", "text": "function submitMovieSearch() {\n\n //grab the search text from the text box. Make sure to trim the text\n\t//to remove uneeded whitespace\n var searchText = document.getElementById(\"movieSearchText\").value.trim();\n\n //if the user didn't type in any text\n if(!searchText || searchText === '')\n {\n return;\n }\n\n\t//then search for the movies asynchronously and display the results to the\n\t//page\n searchMovieByTitle(searchText)\n .then((movies) => {\n renderMovieTitles(movies);\n });\n}", "title": "" }, { "docid": "48ddb225cb72a3aae8de6adfe3f74d44", "score": "0.60160327", "text": "function processWidgetSubmit() {\n var f = w.currentlySubmittingWidget = this;\n if ( w.onWidgetSubmit ) {\n try {\n var res = onWidgetSubmit(f);\n if ( typeof(res) === typeof(false) && !res ) return false;\n } catch(e) { err(e) };\n }\n f.className += ' submitting';\n d.body.focus();\n addHidden(f, 'callback', 'receivedWidgetResponse');\n addHidden(f, 'utf8', '\\u1234');\n addHidden(f, 'js', '1');\n jsonpSubmit(f)\n return false;\n}", "title": "" }, { "docid": "e2a0891fc20cd3ce03f5f3f8249bc9c3", "score": "0.6006404", "text": "function watchSubmit() {\n $('.js-search-form').submit(event => {\n event.preventDefault();\n const queryTarget = $(event.currentTarget).find('#js-query');\n const query = queryTarget.val();\n queryTarget.val(\"\");\n getDataFromAPI(query,displaySearchResults);\n});\n}", "title": "" }, { "docid": "947bbe7a97c4049a4c81153c451be487", "score": "0.5961115", "text": "function watchSubmit() {\n\t$('.js-search-form').submit(function(event) {\n\t\tevent.preventDefault();\n\t\tvar query = $(this).find('.js-search-input').val();\n\t\tgetApiData(query, displayResults);\n\t\t$('.js-search-input').val('');\n $('.js-search-input').focus();\n\t});\n}", "title": "" }, { "docid": "aa74327cb102876d205b3d15089932db", "score": "0.59547055", "text": "function handleSubmit(event) {\n event.preventDefault()\n const results = document.getElementById('results')\n const resultsList = document.getElementById('results_list')\n console.log(\"::: Form Submitted :::\")\n let formText = document.getElementById('search-keyword').value\n resultsList.innerHTML =''\n \n // check what text was put into the form field\n Client.checkForName(formText)\n console.log(Client.URLChecker(formText))\n\n // check if URL is valid or not\n if(Client.URLChecker(formText)){\n results.innerHTML = '<strong>Loading...</strong>'\n document.getElementById('search-keyword').value = ''\n\n sendUrl('http://localhost:3030/postUrl', {url: formText})\n .then(()=> getDataUpdatePage('http://localhost:3030/getResults'))\n }else{\n alert('Invalid URL, please try with a valid URL.')\n }\n \n // fetch('http://localhost:3030/test')\n // .then(res => res.json())\n // .then(function(res) {\n // document.getElementById('results').innerHTML = res.message\n // })\n}", "title": "" }, { "docid": "81a216b21e92d538c2096c87a0e42996", "score": "0.59337616", "text": "function onYouTubeApiLoad() {\n // To get a key for your own application:\n // 1. Go to https://console.cloud.google.com/apis/dashboard\n // 2. Create a new project if you've not already got one\n // 3. Click the Enable API button\n // 4. Choose YouTube Data API\n // 5. Click the Enable button\n // 6. Click create credentials\n // 7. Select \"Web browser (JavaScript)\" from the second dropdown\n // 8. Click the \"Public data\" radio button\n // 9. Click the \"What credentials do I need?\" button\n // 10. Copy your API key and paste it in below\n gapi.client.setApiKey('YOUR-API-KEY-HERE');\n\n // Attach an event listener to the form so that a search is carried out\n // when it is submitted — the search() function\n searchForm.addEventListener('submit', search);\n}", "title": "" }, { "docid": "f79743b54d6dbe1619a4eed838c70507", "score": "0.59198433", "text": "onSearchTermChange(searchtext) {\r\n\t\tsearchtext = searchtext || 'dude prefect latest';\r\n\t\tconsole.log(searchtext);\r\n\t\tYoutubeApi({ key: API_KEY, term: searchtext }, videos => {\r\n\t\t\tthis.setState({ videos: videos, selectedVideo: videos[0] });\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "b903d09a174caea1578f74548cfcac87", "score": "0.59083927", "text": "function watchSubmit() {\n\t$('#searchForm').submit(event => {\n\t\tevent.preventDefault();\n\t\tconst queryTarget = $(event.currentTarget).find('#searchText');\n\t\tquery = queryTarget.val();\n\t\tqueryTarget.val('');\n\t\tgetDataForMovies(query, dataMovies);\n\t});\n}", "title": "" }, { "docid": "06a27cd5b5016f065e6fcd195bf6c480", "score": "0.5904503", "text": "function onSearchSubmit () {\n var term = $('#form-search-term').val();\n performSearch(term);\n\n // Don't perform the submit action\n return false;\n}", "title": "" }, { "docid": "d99f038da410119b0793ff9b08499e98", "score": "0.5891363", "text": "_handleSubmit(e) {\n this._submitFunction(this.form, e);\n }", "title": "" }, { "docid": "7314a93fbb8c5c574f84ca2cbb504cea", "score": "0.58910716", "text": "function handleSubmit(evt) {\n evt.preventDefault();\n handleSearch(search);\n }", "title": "" }, { "docid": "ae71b19bb2ad8ec0d299e45ff71d8f97", "score": "0.58877486", "text": "submit() {\n }", "title": "" }, { "docid": "e0cf6a89e9962f68bca6da773884e846", "score": "0.5886293", "text": "function handleSubmit(event) {\n\n // prevent the default behavior of a form submit button\n event.preventDefault();\n \n //run the searchArticles function when the search button is clicked\n searchArticles();\n }", "title": "" }, { "docid": "ba0a5565308e873152803ef558c65da9", "score": "0.58802783", "text": "function handleYoutube() {\n var url = prompt(\"Please enter the Youtube url\");\n if (url != null && url != \"\") {\n if (validateURL(url))\n {\n panelJSON = {\n \"type\": \"youtube\",\n \"url\": url\n };\n sendPanel(panelJSON);\n }\n }\n}", "title": "" }, { "docid": "82746f71f77125c7e3dcda7192f666e7", "score": "0.5874871", "text": "function youtubeApiCall(title) {\r\n console.log('The youtubeApiCall function is running...')\r\n console.log(`${youtubeSearchURL}?key=${youtubeApiKey}&q=book%20review%20${title}&part=snippet&maxResults=10&type=video`);\r\n //Fetch info from the api, based on form data\r\n fetch(`${youtubeSearchURL}?key=${youtubeApiKey}&q=book%20review%20${title}&part=snippet&maxResults=10&type=video`)\r\n .then(response => response.json())\r\n .then(responseJson =>\r\n displayResults(responseJson))\r\n .catch(error => alert('something went wrong'));\r\n}", "title": "" }, { "docid": "745ecc85103de77c53b24b01b5519934", "score": "0.58660746", "text": "function search() {\r\n var query = document.getElementById('query').value;\r\n // Use the JavaScript client library to create a search.list() API call.\r\n var request = gapi.client.youtube.search.list({\r\n part: 'snippet',\r\n q:query,\r\n maxResults: 20\r\n });\r\n // Send the request to the API server, call the onSearchResponse function when the data is returned\r\n request.execute(onSearchResponse);\r\n}", "title": "" }, { "docid": "589cafc44db27fb53bfe8ced322fd181", "score": "0.58581156", "text": "function searchVideo (artist) {\n console.log(\"clicked last result\");\n var userInputArtist = artist;\n videoSearch(APIKey, userInputArtist, 3);\n\n}", "title": "" }, { "docid": "ffbebe4b215baac67e00ef37f52cf8a7", "score": "0.5849706", "text": "function submit_me() {\r\n \t\r\n \t\t// check if the search string is empty\r\n \t\tif ($('#insights-search').val().length==0) {\r\n \t\t\t$('#insights-results').html('');\r\n \t\t\treturn;\r\n \t\t}\r\n \t \t \r\n // get active radio checkbox\r\n var mode = $(\"input[@name='insights-radio']:checked\").val();\r\n \r\n // create the query\r\n var query = InsightsSettings.insights_url + '/insights-ajax.php?search=' + escape($('#insights-search').val()) + '&mode=' + mode + '&_ajax_nonce=' + InsightsSettings.nonce;\r\n \r\n // check if already called\r\n if (query!=last_query)\r\n { \r\n \t$('#insights-results').html('Please wait...');\r\n \t$('#insights-results').load(query);\r\n \tlast_query=query;\r\n \t}\r\n }", "title": "" }, { "docid": "1eb3ccc3a879ecd03cc3e652bb403d75", "score": "0.58438104", "text": "async function handleSearchSubmit(event) {\n\t\tevent.preventDefault();\n\t\tsetIsSearchLoading(true);\n\t\ttry {\n\t\t\tconst searchResult = await API.graphql(\n\t\t\t\tgraphqlOperation(searchMarkets, {\n\t\t\t\t\tfilter: {\n\t\t\t\t\t\tor: [\n\t\t\t\t\t\t\t{ name: { wildcard: `*${searchTerm}*` } },\n\t\t\t\t\t\t\t{ tags: { wildcard: `*${searchTerm}*` } },\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\tconsole.log(searchResult.data.searchMarkets.items);\n\t\t\tsetSearchResultList(\n\t\t\t\tsearchResult.data.searchMarkets.items.sort(\n\t\t\t\t\tCOMPARE_NOTES_CREATEDTIME_ASCENDING\n\t\t\t\t)\n\t\t\t);\n\t\t\tsetCurrentSearchTerm(searchTerm);\n\t\t\tsetSearchTerm(\"\");\n\t\t\tsetShouldShowAllMarkets(false);\n\t\t\tsetIsSearchLoading(false);\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t}", "title": "" }, { "docid": "fb8bbfd45f41d7be806c8fb185667313", "score": "0.5833253", "text": "function youtubeSearch(performer) {\n\n\n // This URL will return videos only (no playlists or channels), and then we'll\n // just pick the first result (for now). The search string equals the function argument,\n // which will be a string containing the name of a performer. \n //alert(performer);\n var searchURL = \"https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=2&format=5&q=\" + performer + \"&type=video&key=AIzaSyCLK-c5IZaVIY7qgvkQmYS41uG6UQA5lmY\";\n $.ajax({\n url: searchURL,\n method: \"GET\"\n }).done(function(response) {\n var vidOK = true;\n try {\n var dataRet = response.items[0].id.videoId;\n } catch (err) {\n vidOK = false;\n console.log(\"bad videoID\")\n } finally {\n if (vidOK) {\n // console.log(\"Returned: \" + dataRet);\n showmeaVideo(dataRet);\n }\n }\n\n\n });\n\n}", "title": "" }, { "docid": "0c9f720bb135a4e965060b496034f524", "score": "0.58163196", "text": "function onYouTubePlayerReady(playerid){\n\t\tvar userEntry = document.getElementById('userEntry');\n\t\tif(userEntry.addEventListener){\n\t\t\tuserEntry.addEventListener(\"keyup\",handleEnter, false);\n\t\t}\n\t\telse{\n\t\t\tuserEntry.attachEvent(\"keyup\",handleEnter);\n\t\t}\n\t\tsubmitEntry = document.getElementById('submitEntry');\n\t\tif(submitEntry.addEventListener){\n\t\t\tsubmitEntry.addEventListener(\"click\",handleSubmitClick,false);\n\t\t}\n\t\telse{\n\t\t\tsubmitEntry.attachEvent(\"click\",handleSubmitClick);\n\t\t}\n\t\t\n\t\t//hide the player initially until the user has entered a search criteria.\n\t\tytplayer = document.getElementById('myytplayer'); \t\n \tif(ytplayer){\n\t\t\tytplayer.style.visibility = \"hidden\";\n\t\t\tif(ytplayer.addEventListener){\n \t\t\tytplayer.addEventListener(\"onStateChange\",\"onytplayerStateChange\" );\n \t\t}\n \t\telse{\n \t\t\tytplayer.attacheEvent(\"onStateChange\",\"onytplayerStateChange\" );\n \t\t}\n \t}\n\t}", "title": "" }, { "docid": "4d648a3477c3a1e3d3293e8182f4c310", "score": "0.58145374", "text": "function watchSubmit() {\n $('.js-search-form').submit(event => {\n //prevent it from resetting\n event.preventDefault();\n \n $(\".title\").empty();\n $(\".js-search-results\").empty();\n $(\".swear-results\").empty();\n //save as constants to clear out form after submission.\n const artistInput = $(this).find('.input-artist');\n const titleInput = $(this).find('.input-title');\n const artist = artistInput.val().trim();\n const title = titleInput.val().trim();\n artistInput.val('');\n titleInput.val('');\n getLyricDataFromApi(artist, title, displaySearchData);\n });\n}", "title": "" }, { "docid": "4e0029bd9dd2658ac62c2d9485a0a499", "score": "0.5794976", "text": "function search() \n{\n var q = document.querySelector('#query').value;\n \n var request = gapi.client.youtube.search.list({\n q: q,\n part: 'snippet'\n });\n\n request.execute(function(response) \n {\n var str = JSON.stringify(response.result);\n var obj = JSON.parse(str);\n\n for (var i = 0; i < obj.items.length; i++) \n {\n var videoHash = obj.items[i].id.videoId;\n document.getElementById('results').innerHTML += \"<span class='vClicker' hash='\" + videoHash + \"' >\" + obj.items[i].snippet.title + \"</span>\" + \"<br/>\";\n }\n \n var ancArray = document.querySelectorAll(\".vClicker\");\n \n for (var i = 0; i < ancArray.length; i++)\n {\n ancArray[i].addEventListener(\"click\", function(event) \n {\n var loc = 'https://www.youtube.com/embed/' + this.getAttribute('hash') + '?enablejsapi=1&controls=0&autoplay=0&rel=0';\n document.getElementById('player').setAttribute('src',loc);\n document.getElementById('player').setAttribute('style','display: inline-block;');\n document.getElementById('pcontrols').setAttribute('style','display: inline-block;');\n });\n }\n });\n}", "title": "" }, { "docid": "f5eb208a3b93e6837175a1c4c7367207", "score": "0.57835764", "text": "function handleFormSubmit(evt) {\n evt.preventDefault(); \n searchResults.innerHTML = \"\" \n movieSearch();\n}", "title": "" }, { "docid": "bdf28d43ac19848b32dc8a18d6b61b30", "score": "0.57650495", "text": "function submitHandler() {\n $('form').on('submit', function (event) {\n event.preventDefault();\n let searchTerm = $('#search').val();\n let city = $('#city').val();\n $('#errorFood').html('');\n $('#errorCity').html('');\n\n if (searchTerm === '') {\n $('#errorFood').html('Oops, enter a food please');\n } else if (city === '') {\n $('#errorCity').html('Oops, enter a city');\n } else {\n $('#errorCity').html('');\n $('#errorFood').html('');\n $('#city').val('');\n $('#search').val('');\n $('.recipesHeader').html('<h2>Recipes</h2>');\n $('.restaurantsHeader').html('<h2>Restaurants</h2>');\n $('.youtubeHeader').html('<h2>YouTube</h2>');\n youtubeRequest(searchTerm, callbackTube);\n recipeRequest(searchTerm, callbackFood);\n restaurantRequest(searchTerm, city, callbackRestaurant);\n }\n });\n}", "title": "" }, { "docid": "51c05d23d75bb27c212da153ffc8e090", "score": "0.576196", "text": "function handleSubmit(){\n $('form').submit(event =>{\n event.preventDefault();\n console.log('Just got a submit!');\n const searchTerm = $('.js-search-state').val();\n let maxResults;\n if ($('.js-search-number').val()) {\n maxResults = $('.js-search-number').val();\n }\n else {\n maxResults = 10;\n }\n getParks(searchTerm,maxResults); \n });\n\n}", "title": "" }, { "docid": "8fb2304f7672bebaa9591cebd17a192c", "score": "0.5755011", "text": "function watchSubmit() {\n \n $('#js-search-form').submit(event => {\n event.preventDefault();\n const queryTarget = $(event.currentTarget).find('.js-query');\n const query = queryTarget.val();\n queryTarget.val(\"\");\n getDataFromApi(query, renderData);\n $('#displayBox').css('display', 'none');\n $('#loadScreen').css('display', 'block');\n });\n}", "title": "" }, { "docid": "c85afaa47f5ab7e5943358886357dc59", "score": "0.57503945", "text": "function init(){\n\t\n\tconsole.log(\"Initializing Google API client.\");\n\t\n\t// TODO hide API key\n\tgapi.client.setApiKey(\"AIzaSyA38kJ-p-UZLgjf3QWqKbABsgLFiAqbXfg\");\n\tgapi.client.load(\"youtube\",\"v3\",function(){\n\t\t// yt api is ready\n\t\t//console.log(\"YouTube Search API is ready\");\n\t});\n\t\n\t// show all videos\n\t$(function(){\n\t\te.preventDefault();\n\t\tconsole.log(\"Submitting form...\");\n\t\t\n\t\t// build YouTube Search API request\n\t\tvar request = gapi.client.youtube.search.list({\n\t\t\t\n\t\t\t// specify that we are looking for video snippets\n\t\t\tpart: \"snippet\",\n\t\t\ttype: \"video\",\n\t\t\t\n\t\t\t// replace spaces with pluses for GET request\n\t\t\tq: encodeURIComponent($(\"#search\").val()).replace(/%20/g, \"+\"),\n\t\t\t\n\t\t\t// number and order of videos received\n\t\t\t// most recent -> \"date\", most popular -> \"viewCount\"\n\t\t\tmaxResults: 5,\n\t\t\torder: order,\n\t\t\t\n\t\t\t// specify that we only want videos from our channel\n\t\t\tchannelId: \"UCdXtMm5nSlpZez3nkciKpng\"\n\t\t\t\n\t\t});\n\t\t\n\t\t// execute HTTP request\n\t\trequest.execute(function(response){\n\t\t\t\n\t\t\tconsole.log(\"Executed search request.\");\n\t\t\t\n\t\t\t// collect results\n\t\t\tvar results = response.result;\n\t\t\t\n\t\t\t// empty video display div\n\t\t\t$(\"#videosbody\").html(\"\");\n\t\t\t\n\t\t\tconsole.log(\"Number of search results: \"+results.items.length);\n\t\t\t\n\t\t\t// if there are no applicable results, tell user\n\t\t\tif (results.items.length == 0){\n\t\t\t\t\n\t\t\t\tconsole.log(\"No search results found.\");\n\t\t\t\t$(\"#videosbody\").html('No tutorials found. Try entering something else.');\n\t\t\t\t\n\t\t\t} \n\t\t\t// otherwise, show the results to user\n\t\t\telse {\n\t\t\t\t$.each(results.items, function(index, item) {\n\t\t\t\t\t$.get(\"item.html\", function(data) {\n\t\t\t\t\t\t$(\"#videosbody\").append(\"<div class=\\\"youtubevid\\\">\" + tplawesome(data, [{\"title\":item.snippet.title, \"videoid\":item.id.videoId}]) + \"</div>\");\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tresetVideoHeight();\n\t\t\t}\n\t\t});\n\t});\n\t\n}", "title": "" }, { "docid": "991afee56aea578e3371ec16169282e8", "score": "0.57486683", "text": "async function handelSubmit(e) {\n //e.preventDefault();\n //setSearch(\"ByName\");\n await getDogsByName(Input); \n \n }", "title": "" }, { "docid": "3b5c3d88f32a2823edb5e7ac43e86436", "score": "0.574804", "text": "function searchHandler() {\n $('.search-input').on('keyup search submit', function () {\n search();\n });\n}", "title": "" }, { "docid": "cb0477f4766d8c17cc722a4494b59357", "score": "0.57465076", "text": "function advancedSearchSubmit() {\n\tif (! go()) return false;\n\treturn submitSSForm(\"advanceSearchForm\");\n}", "title": "" }, { "docid": "09cbf93476137de1924a73627d32e774", "score": "0.5740623", "text": "function handleFormSubmit(event) {\n\n event.preventDefault();\n\n searchBooks(searchKeyword.current.value);\n }", "title": "" }, { "docid": "5c556c05aab5555a93b4abb6b3fcf486", "score": "0.57222354", "text": "function _onChangeSearchField() {\n htElement.welSearchForm.submit();\n }", "title": "" }, { "docid": "9af3cdbb25317c824f0c2819ed3de325", "score": "0.5700569", "text": "function listenToSearchSubmit() {\n\t\t// Header search form\n\t\t// ------------------\n\t\t$('#wsite-header-search-form').on('click', 'span.wsite-search-button', function(ev) {\n\t\t\t$(ev.delegateTarget).submit();\n\t\t}).on('submit', function(ev) {\n\t\t\t// Disable search from Theme Previews\n\t\t\treturn !window.document.body.className.match(/wsite-page-theme_browser\\/preview/);\n\t\t});\n\n\t\t// Search element\n\t\t// ------------------\n\t\t$('form.wsite-search-element-form')\n\t\t\t.on('click', 'span.wsite-search-element-submit', function(ev) {\n\t\t\t\t$(ev.delegateTarget).submit();\n\t\t\t})\n\t\t\t.on('submit', function() {\n\t\t\t\t// Disable search from Theme Previews\n\t\t\t\treturn !window.document.body.className.match(/wsite-page-theme_browser\\/preview/);\n\t\t\t});\n\t}", "title": "" }, { "docid": "b09edc126b28d9d2c69678caa3ceca76", "score": "0.5695571", "text": "function searchThroughYouTube() {\n\n // Flush the previous result for animation\n var ytResult = document.querySelector(\"#ytResult\");\n ytResult.innerHTML = \"\";\n \n // Animate the search\n var imgLoading = new Image();\n imgLoading.src = \"../img/loading.svg\";\n imgLoading.classList.add(\"loading\");\n ytResult.appendChild(imgLoading);\n\n var keywords = document.querySelector(\"#ytInput\").value;\n var action = \"/youtube/search/\" + keywords;\n\n // ********** AJAX ********** //\n\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var jsonResponse = JSON.parse(this.responseText);\n\n // Flush the previous result for new result\n ytResult.innerHTML = \"\";\n\n for(var i = 0; i < jsonResponse.length; i++) {\n // console.log(jsonResponse[i]);\n\n // ********** WRAPPER ********** //\n var trackWrapper = document.createElement(\"button\");\n trackWrapper.classList.add(\"track\");\n trackWrapper.classList.add(\"button\");\n trackWrapper.classList.add(\"button-track\");\n trackWrapper.classList.add(\"flex-col\");\n // trackWrapper.classList.add(\"blurred\");\n trackWrapper.style.backgroundImage = \"url(\" + jsonResponse[i].thumbnailUrl + \")\";\n trackWrapper.setAttribute('data-id', jsonResponse[i].id);\n \n // ********** TITLE ********** //\n var titleSpan = document.createElement(\"span\");\n titleSpan.classList.add(\"thumb\");\n titleSpan.innerHTML = jsonResponse[i].title;\n trackWrapper.appendChild(titleSpan);\n \n // ********** DURATION ********** //\n var durationSpan = document.createElement(\"span\");\n durationSpan.classList.add(\"thumb\");\n durationSpan.innerHTML = jsonResponse[i].duration;\n trackWrapper.appendChild(durationSpan);\n\n // ********** ADD CLICK EVENT ********** //\n trackWrapper.onclick = function() {\n // console.log(this)\n // console.log(titleSpan.innerHTML);\n selectTrack(this);\n toggleElement('difficulty','open');\n };\n\n // ********** ADD WRAPPER TO PAGE ********** //\n ytResult.appendChild(trackWrapper);\n }\n }\n };\n\n xhttp.open(\"GET\", action, true);\n xhttp.send();\n}", "title": "" }, { "docid": "148a2a09e3c36eba53982852dae217f7", "score": "0.56930566", "text": "function handleSearchClick(){\n $('#searchForm').submit( function(event){\n event.preventDefault();\n const movieName = $('#movieName').val().trim();\n if(movieName == \"\"){\n DisplayBlankError();\n }else{\n AddToHistory(movieName);\n getSearchMovieInfo(movieName);\n }\n });\n}", "title": "" }, { "docid": "51dd441302f82232d62e0efff89e5aca", "score": "0.5691179", "text": "function listenButton() {\r\n formSearch.addEventListener(\"submit\", getDataFromApi);\r\n}", "title": "" }, { "docid": "d6c0fa278d508d53e6e33aedd413e8cb", "score": "0.56808287", "text": "function submitForm() {\n $('#js-form').submit(function(event) {\n event.preventDefault();\n let inputVal = $('#js-search-movie').val();\n callMovieAPI(inputVal);\n setTimeout(function(){\n getPopularMovies();\n }, 1000);\n });\n}", "title": "" }, { "docid": "29572893e59450b6e4ca82b47e785fe6", "score": "0.5678903", "text": "function videoSearch(key, search, maxResults) {\n // Gets the URL using Youtube Search and plugs in our API_KEY, maxResults, and search-input\n $.get(\n \"https://www.googleapis.com/youtube/v3/search?key=\" +\n key +\n \"&type=video&part=snippet&maxResults=\" +\n maxResults +\n \"&q=\" +\n search,\n function (data) {\n //Remove console log when complete\n console.log(data);\n //Store the videoId of the first search result in the array\n var id = data.items[0].id.videoId;\n $(\".playlist\").empty();\n mainVid(id);\n displayVideos(data);\n }\n );\n }", "title": "" }, { "docid": "cf75d2a122f83dfe147ed2a5b9fd44bd", "score": "0.5672979", "text": "function search(query) {\n var q = '';//$('#query').val();\n if (query == null||query == \"\") {\n q = 'roller+derby+italia';\n } else {\n q = query;\n }\n var request = gapi.client.youtube.search.list({\n q: q,\n part: 'snippet',\n maxResults : 50,\n type: 'video',\n order: 'relevance',\n videoDuration: 'long',\n videoEmbeddable: true,\n pageToken: nextPageToken\n\n });\n\n request.execute(function(response) {\n var str = JSON.stringify(response.result);\n nextPageToken = response.result.nextPageToken;\n //console.log(str);\n buildData(response);\n //$('#search-container').html('<pre>' + str + '</pre>');\n });\n}", "title": "" }, { "docid": "e8424ab98c02d6a11cff34af651b2083", "score": "0.5668249", "text": "function search() {\n var request = google.client.youtube.search.list({\n part: 'snippet',\n q: squery\n });\n // Send the req search to the API server.\n request.execute(onSearchResponse);\n }", "title": "" }, { "docid": "64da21834cd12cb4b1a99f141f1adba2", "score": "0.5663739", "text": "submitHandler(_event) {\n this.sendTextMessage();\n }", "title": "" }, { "docid": "b962f630c7f44fd1dd6baec7e1efe9eb", "score": "0.56568205", "text": "handlerSubmit(event) {\n event.preventDefault();\n\n this.input = event.currentTarget.elements.query;\n\n if (this.input.value === '') {\n PNotify.error({\n text:\n 'No results were found for your request. Please enter valid data!',\n ...this.pnotifySettings(),\n width: '260px',\n minHeight: '120px',\n });\n\n return;\n }\n\n SearchImageApp.query = this.input;\n\n this.clearImageListItems();\n\n this.infScrollInstance.pageIndex = 1;\n\n this.infScrollInstance.option({\n /**\n * For work with CORS:\n * Add this: https://cors-anywhere.herokuapp.com/ before your URL\n */\n path() {\n return `https://cors-anywhere.herokuapp.com/https://pixabay.com/api/?key=14950911-bbc5df412008123c8c9940cf8&image_type=photo&orientation=horizontal&q=${SearchImageApp.query.value}&page=${this.pageIndex}&per_page=12`;\n },\n });\n\n this.infScrollInstance.updateGetPath();\n this.infScrollInstance.updateGetAbsolutePath();\n\n spinner.show(this.spinner);\n\n this.infScrollInstance.loadNextPage();\n }", "title": "" }, { "docid": "372a499c436f73574eca620223de8f73", "score": "0.5656616", "text": "responseSubmit(event) {\n\t\t\n\t\tevent.preventDefault();\n\t\tthis.match(this.state.response);\n\t}", "title": "" }, { "docid": "aad15bdd171e8f657221b500f0320991", "score": "0.5649245", "text": "function watchSearchButton() {\n $('.search-form').submit(function(event) {\n event.preventDefault();\n let queryTarget = $(event.currentTarget);\n let queryValue = queryTarget.find('.search-data').val();\n let queryLocation = queryTarget.find('.search-loc').val();\n getDataFromYelp(queryValue, queryLocation, displaySearchData);\n queryValue = '';\n queryLocation = '';\n });\n}", "title": "" }, { "docid": "845a25f4cd0fb3ca12815e5acc5f4d8c", "score": "0.5647115", "text": "function searchSubmit() {\r\n $(\"#search-button\").click();\r\n }", "title": "" }, { "docid": "ba0d5949fd2efcebe708a5ec3053d487", "score": "0.5644451", "text": "function handleSubmit(e) {\n\t\tfetch(`http://localhost:8080/books/get/title/${props.titleSearched}`)\n\t\t\t.then((response) => {\n\t\t\t\treturn response.json();\n\t\t\t})\n\t\t\t.then((object) => {\n\t\t\t\tprops.setBooksFound(object);\n\t\t\t\tconsole.log('set books found');\n\t\t\t\t//console.log(props.booksFound);\n\t\t\t});\n\t\te.preventDefault();\n\n\t\t// console.log('Searched');\n\t\t// console.log(props.titleSearched);\n\t\t// console.log(props.booksFound);\n\t}", "title": "" }, { "docid": "726ecd0490219ad8d1797cacd6243512", "score": "0.56390375", "text": "function search(query, e)\r\n{\r\n\tvar storedVideosArray = eval(GM_getValue(\"videos_array\"));\r\n\t\r\n\t//If e = click then this search function has been triggered by a click of the search button\r\n\t//Or e.keyCode = 13 (Enter key) then this search function has been triggered by the enter key\r\n\t//And will not search if search box is empty\r\n\tif ((e == \"click\" || e.keyCode == ENTER_BUTTON_KEYCODE) && query != EMPTY_VALUE)\r\n\t{\r\n\t\tif (storedVideosArray.length == DISPLAY_UPPER_LIMIT)\r\n\t\t{\r\n\t\t\tif (document.getElementById(SEARCH_CHECKBOX_ID).checked)\r\n\t\t\t{\r\n\t\t\t\tlocation.href = SEARCH_URL + query + \"&ps=1\" + \"&\" + MATCH_TERMS_PARAMETER + \"=t\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tlocation.href = SEARCH_URL + query + \"&ps=1\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//If the \"Match all terms\" checkbox is checked then add a match all terms parameter to the URL\r\n\t\t\tif (document.getElementById(SEARCH_CHECKBOX_ID).checked)\r\n\t\t\t{\r\n\t\t\t\tlocation.href = SEARCH_URL + query + \"&ps=\" + DISPLAY_UPPER_LIMIT + \"&\" + MATCH_TERMS_PARAMETER + \"=t\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tlocation.href = SEARCH_URL + query + \"&ps=\" + DISPLAY_UPPER_LIMIT;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "8bd9a2dd19d299c216969fcda9a63d48", "score": "0.5618764", "text": "handleSubmit(e) {\n e.preventDefault()\n //*note: increase the numerical value of below property when adding new buttons to form. yeah it's weird sorry\n let query = e.target[6].value\n this.searchAmazon(query)\n }", "title": "" }, { "docid": "9c745348e339a0dde568b636278b2899", "score": "0.5618193", "text": "function addListeners(){\n\n\t$('form').on('submit', function(event){\n\t\tevent.preventDefault();\n\t\tappState.search = $('#search-youtube').val();\n\t\tgetJsonElement(appState.search, callback);\n\t});\n\n\t$('div.thumbnails').on('click', 'img', function(event){\n\t\t//event.preventDefault();\n\t\trenderIFrame(appState, $(this), $(this).closest('.results').find('iframe'));\n\t});\n\n}", "title": "" }, { "docid": "fd4ba8d7c4658e32df21488cd4bf306a", "score": "0.56119066", "text": "function submitSearch() {\n search(\"/javase\");\n }", "title": "" }, { "docid": "a5389ffde79d62d1dd06dbc0c822f0d1", "score": "0.56076455", "text": "function watchSubmit() {\n\t$('.js-search-form').submit(function (event){\n\t\tevent.preventDefault();\n\t\t$('.app-instructions').fadeOut(200);\n\t\t// reset search-result area\n $('.js-search-results-1').html('');\n\t\t$('.js-search-results-2').html('');\n\t\t// reset state and UI\n\t\tstate = {attributionHTML: '' , character: {id: null, name: '', imagePath: '', imageExtension: ''}, comics: [], comicsStartPoint: 0, comicsApiCallOffset: 0, totalRowsDisplayed: 0,totalResults: 0};\n\t\tresetUi();\n\t\t// Api calls and rendering\n\t\tgetCharacterInfo(state, $(this).find('.js-search-input').val());\n\t\t// Search input reset \n\t\t$('.js-search-input').val('');\n $('.js-search-input').focus();\n\t});\n}", "title": "" }, { "docid": "deda5ecbf61d0d045eaeae24b8fedf92", "score": "0.55885327", "text": "function handleBtn(submitEvent)\n{\n\t//submitEvent.preventDefault();\n\tconsole.log(\"using button\");\n\tlet value = document.getElementById(\"autocomplete\").value;\n\t\n\thandleNormalSearch(value);\n}", "title": "" }, { "docid": "cb9907b9ef85056f445585627c5cdf97", "score": "0.5585284", "text": "function getYoutubeResults(userSearchTerm) {\n $.getJSON('https://www.googleapis.com/youtube/v3/search', {\n q: userSearchTerm,\n part: 'snippet',\n key: 'AIzaSyAuQxnyeTiG2xHqYKu3EDRxP9owZqfiAjc',\n maxResults: 10,\n type: 'video',\n }, displayYoutubeResults)\n}", "title": "" }, { "docid": "0d9369c59adf98a8c0fc91b76fba62e0", "score": "0.55837804", "text": "function getVideoBtn() {\n videoContainer.style.display = \"none\";\n $(videoContainer).empty()\n var drink = event.target.textContent;\n console.log(\"YOUTUBE API CALL\");\n\n\n$.ajax({\n type: 'GET',\n url: 'https://www.googleapis.com/youtube/v3/search',\n data: {\n\n // key: 'AIzaSyD4-o_Z0ZCDzl4kzTrKCjueFjiMqFk7Cdc',\n // q: \"how to make the best \" + drink + \" cocktail\",\n\n key: 'AIzaSyCwb1cWof_bTtytUuCwABzIn0y2tu3GHLM',\n q: \"how to make the best \" + searchInput.value + \" cocktail\",\n\n part: 'snippet',\n maxResults: 1,\n type: 'video',\n videoEmbeddable: true,\n allowFullScreen: true,\n },\n success: function(data){\n embedVideo(data)\n // console.log(data);\n },\n error: function(response){\n console.log(\"Request Failed\");\n }\n });\n\n}", "title": "" }, { "docid": "8d9c1280b6cedb018f906d640f48893b", "score": "0.55819017", "text": "function handleFormSubmit(event) {\n event.preventDefault();\n if (formObject.title) {\n API.searchBooks(formObject.title)\n .then(res => displayResults(res.data.items))\n .catch(err => console.log(err));\n }\n }", "title": "" }, { "docid": "026ed363c09acd796cd7400aae869ae9", "score": "0.55786985", "text": "function useSubmit() {\n return useSubmitImpl();\n }", "title": "" }, { "docid": "3cf9e3d042f04d71cac9bea861f1abad", "score": "0.55781347", "text": "function onLoadExtended()\n{\n // Load the base media search.\n onLoadMediaSearch();\n \n // Setup YouTube search.\n searchObject = new LastFMSearch('ResultsPane');\n \n // Bind enter key to search input.\n $(\"#SearchInput\").keypress(\n function (e)\n {\n if (e.which == 13)\n {\n search($('#SearchInput')[0].value)\n }\n });\n}", "title": "" }, { "docid": "9b0d9b1243ab07802e6b7f7aedd92838", "score": "0.55745274", "text": "_submitEvtHandler(evt) {\n evt.preventDefault();\n this._submit(this._getInputValues());\n this._handleCloseWork();\n }", "title": "" }, { "docid": "346866fc38401aad98f43e4fb02fa44f", "score": "0.5568135", "text": "function ant_search_submit() {\r\n\tant_loading_start();\r\n\tdocument.getElementById(\"ant_search-form\").submit();\r\n}", "title": "" }, { "docid": "2054bebea6a2a7cea6cc49745bcd8cb3", "score": "0.556168", "text": "function submitSearchForm(formSubmitEvent) {\r\n console.log(\"submit insert movie form\");\r\n \r\n // Important: disable the default action of submitting the form\r\n // which will cause the page to refresh\r\n // see jQuery reference for details: https://api.jquery.com/submit/\r\n formSubmitEvent.preventDefault();\r\n\r\n jQuery.get(\r\n \"api/insert_movie\",\r\n // Serialize the login form to the data sent by POST request\r\n jQuery(\"#insert_form\").serialize(),\r\n (resultDataString) => handleSearchResult(resultDataString));\r\n\r\n}", "title": "" }, { "docid": "96f7516011724c48890cdf3e80786089", "score": "0.55551654", "text": "function ahook(frm,button,resdiv,path) {\n console.log(\"running ahook\",frm, resdiv,path);\n $(frm).submit(function(e){\n\tdsearch_run_ajax(frm,path,resdiv);\n\te.preventDefault();\n });\n}", "title": "" }, { "docid": "ac2fc5a7dfc63193d8d8ae7258c41d9e", "score": "0.55528057", "text": "handleSearch(e) {\n e.preventDefault();\n let query = this.txtSearch.value;\n let performed = this.performSearch(this.getTwitchSearchUrl(query));\n if (performed) this.currentPage = 1;\n }", "title": "" }, { "docid": "37209b494599304ecebb8f04947cd51e", "score": "0.55497056", "text": "runSearch(searchTerm) {\n // calling apiKey and the term\n YouTubeSearch({ key: apiKey, term: searchTerm }, videos => {\n console.log(\"Logging out the variable videos :\", videos);\n this.setState({\n videos: videos,\n //the first video by the index\n selectedVideo: videos[0]\n })\n });\n }", "title": "" }, { "docid": "8c006348064878a3f5eac532656a87a5", "score": "0.5546845", "text": "function youtubeGetCheck() {\n\tlet currentUrl = window.location.href;\n\tif (currentUrl.indexOf(\"?url=\") > -1) {\n\t\tlet ytUrl = currentUrl.split(\"url=\")[1];\n\t\tif (!jQuery.isEmptyObject(ytUrl)) {\n\t\t\t$(\"#txtVidUrl\").val(ytUrl);\n\t\t\tvidUrlValidate();\n\t\t\tbtnSearchClick();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5543455", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5543455", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5543455", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5543455", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5543455", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5543455", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "f4d8253816ee2112c303471b6c666f45", "score": "0.5543455", "text": "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See http://goo.gl/PdPA1 to get a key for your own applications.\n gapi.client.setApiKey('AIzaSyCBzjxLmrI6-HCQbaKbyWkBQuplm2ESpCU');\n\n \n\n // var arrayLength = songs.length;\n\t\n\t// for (var i = 0; i < arrayLength; i++) {\n\t// var raw = songs[i];\n\t// var clean = raw.replace(/\\W/g, '');\n\n // search(clean);\n\t// }\n\n\n // search(\t\"Thrift Shop Macklemore and Ryan Lewis featuring Wanz\");\n \t searchNext();\n}", "title": "" }, { "docid": "e4e353731cee6afbdf4e8bb5a9f63e0f", "score": "0.55420804", "text": "function onSearchSubmit(ev){\n ev.preventDefault\n // getSearchInput\n \n // setSearchInput\n}", "title": "" }, { "docid": "ee959828dbdaded989d94edad2981cf7", "score": "0.55351853", "text": "_onInputSubmit() {}", "title": "" } ]
b3749e12ae33803854c6cd788a891b72
Get the priority of a charset.
[ { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.69198257", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" } ]
[ { "docid": "41e3e61415057815cc1f8e084cdab579", "score": "0.69566727", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {\n o: -1,\n q: 0,\n s: 0\n };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "fb9a1f7ec850b6864cc43cb53a4add9f", "score": "0.69243044", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = { o: -1, q: 0, s: 0 };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "fb9a1f7ec850b6864cc43cb53a4add9f", "score": "0.69243044", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = { o: -1, q: 0, s: 0 };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "0cc424aeeadea18ff88d163cf291cf9e", "score": "0.6918222", "text": "function getCharsetPriority(charset, accepted, index) {\n\t var priority = { o: -1, q: 0, s: 0 };\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(charset, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "0cc424aeeadea18ff88d163cf291cf9e", "score": "0.6918222", "text": "function getCharsetPriority(charset, accepted, index) {\n\t var priority = { o: -1, q: 0, s: 0 };\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(charset, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "def3cf8dcd00b540d366bed111cd8b2a", "score": "0.69057494", "text": "function getCharsetPriority(charset, accepted, index) {\n\t var priority = {o: -1, q: 0, s: 0};\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(charset, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "def3cf8dcd00b540d366bed111cd8b2a", "score": "0.69057494", "text": "function getCharsetPriority(charset, accepted, index) {\n\t var priority = {o: -1, q: 0, s: 0};\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(charset, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "e6ad760112169d95de7b9fe354d85c8d", "score": "0.58641666", "text": "get priority() {\n return 1;\n }", "title": "" }, { "docid": "4bec3031d6a64329670cb365c306e5bf", "score": "0.5751277", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {\n o: -1,\n q: 0,\n s: 0\n };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "5e4af87d5516af9665f3710fefb1cc21", "score": "0.57376623", "text": "function getEncodingPriority(encoding, accepted, index) {\n\t var priority = { o: -1, q: 0, s: 0 };\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(encoding, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "5e4af87d5516af9665f3710fefb1cc21", "score": "0.57376623", "text": "function getEncodingPriority(encoding, accepted, index) {\n\t var priority = { o: -1, q: 0, s: 0 };\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(encoding, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "8235924bb10fa8b5c924518e79926f41", "score": "0.5736224", "text": "function getEncodingPriority(encoding, accepted, index) {\n\t var priority = {o: -1, q: 0, s: 0};\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(encoding, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "8235924bb10fa8b5c924518e79926f41", "score": "0.5736224", "text": "function getEncodingPriority(encoding, accepted, index) {\n\t var priority = {o: -1, q: 0, s: 0};\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(encoding, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.57328194", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "eac3ec91ab934612d297c49ff58cdded", "score": "0.57263654", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = { o: -1, q: 0, s: 0 };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "eac3ec91ab934612d297c49ff58cdded", "score": "0.57263654", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = { o: -1, q: 0, s: 0 };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "9179b6de706e017014440239b8130b5a", "score": "0.5698247", "text": "get priority()\n {\n this.resetOnTick();\n return this._priority;\n }", "title": "" }, { "docid": "c5481fe64c3ecefc52464452174f208e", "score": "0.56840855", "text": "get priority() {\n\t\treturn this.__priority;\n\t}", "title": "" }, { "docid": "c5481fe64c3ecefc52464452174f208e", "score": "0.56840855", "text": "get priority() {\n\t\treturn this.__priority;\n\t}", "title": "" }, { "docid": "0f606d2b24fc8084792cd217f34546d7", "score": "0.5628004", "text": "get priority() {\n return this._priority;\n }", "title": "" }, { "docid": "77d70c8f1247cb540c1b58b3075e3b0c", "score": "0.55827606", "text": "getPriority() {\n return 100;\n }", "title": "" }, { "docid": "9b0538cb2d30509a37c9eff21a0b125c", "score": "0.55240196", "text": "get priority() {\n return this.getNumberAttribute('priority');\n }", "title": "" }, { "docid": "3795dd1ec5a79f36f06fa78c22a6df53", "score": "0.5448686", "text": "get defaultPriority() {\n return 0;\n }", "title": "" }, { "docid": "53f5e8d29ef13867997bfe4ed7a53ef3", "score": "0.5404617", "text": "function getSelectedPriorityStyle(priorityLevel) {\n switch (priorityLevel) {\n case 1:\n priorityStyle = \"low\";\n break;\n case 2:\n priorityStyle = \"medium\";\n break;\n case 3:\n priorityStyle = \"high\";\n break;\n default:\n alert(\"Something went wrong!\");\n }\n\n return priorityStyle;\n}", "title": "" }, { "docid": "b8013a4baaa9f3efaf09c1e2e2f499e3", "score": "0.53491145", "text": "NameToPrio(name) {\r\n var prio = null;\r\n \r\n for (var color of this.config.colors) {\r\n if (color.name == name) {\r\n prio = color.prio;\r\n break;\r\n }\r\n }\r\n if (prio == null) {\r\n for (var effect of this.config.effects) {\r\n if (effect.name == name) {\r\n prio = effect.prio;\r\n break;\r\n } \r\n }\r\n }\r\n \r\n return prio;\r\n }", "title": "" }, { "docid": "2bcf3d721ccfcff6f8451331d5818208", "score": "0.5252956", "text": "function _getDistFilePriority(filename) {\n const HIGHEST = 0;\n const HIGH = 1;\n const LOW = 2;\n return filename.indexOf('runtime') !== -1\n ? HIGHEST\n : filename.indexOf('polyfill') !== -1\n ? HIGH\n : LOW;\n}", "title": "" }, { "docid": "40c944c558178babfe78e16ec245583c", "score": "0.49795663", "text": "function t$c(e){const r=e.toLowerCase().split(\" \").join(\"-\");switch(r){case\"serif\":return \"noto-serif\";case\"sans-serif\":return \"arial-unicode-ms\";case\"monospace\":return \"ubuntu-mono\";case\"fantasy\":return \"cabin-sketch\";case\"cursive\":return \"redressed\";default:return r}}", "title": "" }, { "docid": "88d253b104ed719f6f3a2a611d671d15", "score": "0.4938231", "text": "topKey() {\n if (!queue.length) {\n return Infinity;\n }\n return queue[indexOfLowestPriority()].priority;\n }", "title": "" }, { "docid": "d26a59f762e37482ace28a69b06cad70", "score": "0.49035293", "text": "function getMinCPForLevel(mon, ECpM) {\n return getCP(mon, {\n atk: 0,\n def: 0,\n sta: 0,\n }, ECpM)\n}", "title": "" }, { "docid": "1dc87b8827a7bae2cd1ed4403b567a83", "score": "0.48769546", "text": "static getWorkOrderPriorityFormat(context) {\n let binding = context.getBindingObject();\n if (binding && binding.WOPriority && binding.WOPriority.PriorityDescription) {\n return binding.WOPriority.PriorityDescription;\n }\n return ' ';\n }", "title": "" }, { "docid": "d30de9d71d83ec9e5cbc785b874776df", "score": "0.47574058", "text": "function priorityFomater(value){\n\t\tvar priority = \"\";\n\t\t\tswitch(value){\n\t\t\t\tcase 1: \n\t\t\t\tpriority = 'Urgent';\n\t\t\t\treturn[\n\t\t\t\t\t'<a style=\"color:Crimson\" herf=\"javascript:void(0)\" title=\"priority \">',\n\t\t\t\t\t\t'<i class=\"fa fa-lg fa-battery-full\">&nbsp</i>' +priority+ '</a>'].join('');\t\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\tpriority = 'High';\n\t\t\t\treturn[\n\t\t\t\t\t'<a style=\"color:DarkOrange\" herf=\"javascript:void(0)\" title=\"priority \">',\n\t\t\t\t\t\t'<i class=\"fa fa-lg fa-battery-three-quarters\">&nbsp</i>' +priority+ '</a>'].join('');\t\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\tpriority = 'Medium';\n\t\t\t\treturn[\n\t\t\t\t\t'<a style=\"color:ForestGreen\" herf=\"javascript:void(0)\" title=\"priority \">',\n\t\t\t\t\t\t'<i class=\"fa fa-lg fa-battery-half\">&nbsp</i>' +priority+ '</a>'].join('');\t\n\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\tpriority = 'Low';\n\t\t\t\treturn[\n\t\t\t\t\t'<a style=\"color:DimGray\" herf=\"javascript:void(0)\" title=\"priority \">',\n\t\t\t\t\t\t'<i class=\"fa fa-lg fa-battery-quarter\">&nbsp</i>' +priority+ '</a>'].join('');\t\n\t\t\t\tbreak;\t\n\t\t\t}\t\n\t\t}", "title": "" }, { "docid": "1cd1ed9d72a0c7faa21bab511031f9cb", "score": "0.47554007", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n }); // sorted list of accepted charsets\n\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "488e1b2c603e99440fcca43e240e3b6f", "score": "0.47330886", "text": "function weightByCharacter(character){\r\n\t\tfor(var i=0;i<code128b.length;i++){\r\n\t\t\tif(code128b[i][0]==character){\r\n\t\t\t\treturn code128b[i][2];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "title": "" }, { "docid": "16d4acfe1df82220e200066a3edd97d5", "score": "0.47211352", "text": "function getScorePreference(characterClass) {\n const charClass = characterClass.toLowerCase();\n\n if (charClass === 'barbarian') {\n return ['str', 'con', 'dex', 'wis', 'cha', 'int'];\n }\n if (charClass === 'bard') {\n return ['cha', 'dex', 'con', 'int', 'wis', 'str'];\n }\n if (charClass === 'cleric') {\n return ['wis', 'con', 'str', 'int', 'dex', 'cha'];\n }\n if (charClass === 'druid') {\n return ['wis', 'con', 'dex', 'str', 'int', 'cha'];\n }\n if (charClass === 'fighter') {\n return ['str', 'con', 'dex', 'wis', 'cha', 'int'];\n }\n if (charClass === 'monk') {\n return ['dex', 'wis', 'con', 'str', 'cha', 'int'];\n }\n if (charClass === 'paladin') {\n return ['str', 'cha', 'con', 'wis', 'dex', 'int'];\n }\n if (charClass === 'ranger') {\n return ['dex', 'wis', 'con', 'int', 'cha', 'str'];\n }\n if (charClass === 'rogue') {\n return ['dex', 'int', 'cha', 'wis', 'con', 'str'];\n }\n if (charClass === 'sorcerer') {\n return ['cha', 'con', 'dex', 'int', 'wis', 'str'];\n }\n if (charClass === 'warlock') {\n return ['cha', 'dex', 'con', 'wis', 'int', 'str'];\n }\n if (charClass === 'wizard') {\n return ['int', 'dex', 'con', 'cha', 'wis', 'str'];\n }\n return 'oops!';\n}", "title": "" }, { "docid": "03eeaa7363180eda9ff0da770d9bcc25", "score": "0.47081324", "text": "function compare(a, b) {\n if (a.priority < b.priority) return -1;\n if (a.priority > b.priority) return 1;\n return 0;\n }", "title": "" }, { "docid": "f786b41125f99d7a79da7038c04472aa", "score": "0.47067732", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "f786b41125f99d7a79da7038c04472aa", "score": "0.47067732", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "dd2d07ee9d834acc585375c6c68aee68", "score": "0.46926418", "text": "function preferredCharsets(accept, provided) {\n // RFC 2616 sec 14.2: no header = *\n var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n if (!provided) {\n // sorted list of all charsets\n return accepts\n .filter(isQuality)\n .sort(compareSpecs)\n .map(getFullCharset);\n }\n\n var priorities = provided.map(function getPriority(type, index) {\n return getCharsetPriority(type, accepts, index);\n });\n\n // sorted list of accepted charsets\n return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n return provided[priorities.indexOf(priority)];\n });\n}", "title": "" }, { "docid": "9381edd80a08fe2316026ebdfb61cd50", "score": "0.46867642", "text": "function maxChar(str) {\n\n\tlet charOccurenceMap = {};\n\n\tfor (let character of str) {\n\t\tif (!charOccurenceMap[character]) {\n\t\t\tcharOccurenceMap[character] = {\n\t\t\t\tc: character,\n\t\t\t\tn: 0\n\t\t\t}\n\t\t}\n\n\t\tcharOccurenceMap[character].n += 1;\n\t}\n\n\treturn Object.values(charOccurenceMap).sort(function(a, b) {\n\t\treturn b.n - a.n;\n\t})[0].c;\n\n}", "title": "" }, { "docid": "fcf3d1d15c3c25a705527b84816dbeba", "score": "0.46800533", "text": "PrioToName(prio) { \r\n /* Todo: a map would be better here */\r\n var name = null; \r\n for (var color of this.config.colors) {\r\n if (color.prio == prio) {\r\n name = color.name;\r\n break;\r\n }\r\n } \r\n if (name == null) {\r\n for (var effect of this.config.effects) {\r\n if (effect.prio == prio) {\r\n name = effect.name;\r\n break;\r\n } \r\n }\r\n }\r\n if (name == null) {\r\n name = prio.toString();\r\n } \r\n return name;\r\n }", "title": "" }, { "docid": "84dd1977fa298fd81055b8f933c299f9", "score": "0.46713758", "text": "function getCharset() {\n var htmlCharset_Beginning = \"<meta charset='\";\n var htmlCharset_End = \"'>\" + \"<title> -Insert Title- </title>\" + \"<!-- Insert CSS links below -->\" + \"</head>\" + \"<body>\";\n var charsetChoice = document.getElementById(\"charset\").value;\n if (charsetChoice === \"utf8\") {\n charsetChoice = \"UTF-8\";\n return htmlCharset_Beginning + charsetChoice + htmlCharset_End;\n } else {\n charsetChoice = \"UTF-16\";\n return htmlCharset_Beginning + charsetChoice + htmlCharset_End;\n }\n }", "title": "" }, { "docid": "1bf3062e2a2d8c560fe8f54588b7b065", "score": "0.46707767", "text": "function formatPriority(priority) {\n var s = '';\n s += (priority >> 24);\n s += ' | ';\n s += (priority >> 8) & 0xFFFF;\n s += ' | ';\n s += priority & 0xFF;\n return s;\n}", "title": "" }, { "docid": "4a80f2b187f44a80350c1bd6ee96f073", "score": "0.46613124", "text": "function preferredCharsets(accept, provided) {\n\t // RFC 2616 sec 14.2: no header = *\n\t var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n\t if (!provided) {\n\t // sorted list of all charsets\n\t return accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset);\n\t }\n\n\t var priorities = provided.map(function getPriority(type, index) {\n\t return getCharsetPriority(type, accepts, index);\n\t });\n\n\t // sorted list of accepted charsets\n\t return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n\t return provided[priorities.indexOf(priority)];\n\t });\n\t}", "title": "" }, { "docid": "4a80f2b187f44a80350c1bd6ee96f073", "score": "0.46613124", "text": "function preferredCharsets(accept, provided) {\n\t // RFC 2616 sec 14.2: no header = *\n\t var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n\t if (!provided) {\n\t // sorted list of all charsets\n\t return accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset);\n\t }\n\n\t var priorities = provided.map(function getPriority(type, index) {\n\t return getCharsetPriority(type, accepts, index);\n\t });\n\n\t // sorted list of accepted charsets\n\t return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n\t return provided[priorities.indexOf(priority)];\n\t });\n\t}", "title": "" }, { "docid": "d78f7eedef6f74c64b3618a161da1295", "score": "0.4660361", "text": "function preferredCharsets(accept, provided) {\n\t // RFC 2616 sec 14.2: no header = *\n\t var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n\t if (!provided) {\n\t // sorted list of all charsets\n\t return accepts\n\t .filter(isQuality)\n\t .sort(compareSpecs)\n\t .map(getFullCharset);\n\t }\n\n\t var priorities = provided.map(function getPriority(type, index) {\n\t return getCharsetPriority(type, accepts, index);\n\t });\n\n\t // sorted list of accepted charsets\n\t return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n\t return provided[priorities.indexOf(priority)];\n\t });\n\t}", "title": "" }, { "docid": "d78f7eedef6f74c64b3618a161da1295", "score": "0.4660361", "text": "function preferredCharsets(accept, provided) {\n\t // RFC 2616 sec 14.2: no header = *\n\t var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');\n\n\t if (!provided) {\n\t // sorted list of all charsets\n\t return accepts\n\t .filter(isQuality)\n\t .sort(compareSpecs)\n\t .map(getFullCharset);\n\t }\n\n\t var priorities = provided.map(function getPriority(type, index) {\n\t return getCharsetPriority(type, accepts, index);\n\t });\n\n\t // sorted list of accepted charsets\n\t return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {\n\t return provided[priorities.indexOf(priority)];\n\t });\n\t}", "title": "" }, { "docid": "b0fc9520fd47190c1e6b6fdb5f38f203", "score": "0.4615397", "text": "function operatorPriority(operator){\n switch(operator){\n case '^': return 2;\n case '+': \n case '-': return 0;\n default : return 1; // *, /, %\n \n // minimizes comparisons by doing in 2 0 1 order\n }\n }", "title": "" }, { "docid": "eb86cb660170bed25d1afb02da8e09b4", "score": "0.4611471", "text": "function lower () {\n return lowerCharset\n}", "title": "" }, { "docid": "9169f1a4210740417966a0730dc7ae11", "score": "0.46107563", "text": "function getLanguagePriority(language, accepted, index) {\n\t var priority = { o: -1, q: 0, s: 0 };\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(language, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "9169f1a4210740417966a0730dc7ae11", "score": "0.46107563", "text": "function getLanguagePriority(language, accepted, index) {\n\t var priority = { o: -1, q: 0, s: 0 };\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(language, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "0936fe53a760dc0ffd675b47ea66c347", "score": "0.46070603", "text": "function getLanguagePriority(language, accepted, index) {\n\t var priority = {o: -1, q: 0, s: 0};\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(language, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "0936fe53a760dc0ffd675b47ea66c347", "score": "0.46070603", "text": "function getLanguagePriority(language, accepted, index) {\n\t var priority = {o: -1, q: 0, s: 0};\n\n\t for (var i = 0; i < accepted.length; i++) {\n\t var spec = specify(language, accepted[i], index);\n\n\t if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n\t priority = spec;\n\t }\n\t }\n\n\t return priority;\n\t}", "title": "" }, { "docid": "3117734bf61bddfa3115208ed6d4760b", "score": "0.45666096", "text": "function parseCharset(str, i) {\n\t var match = simpleCharsetRegExp.exec(str);\n\t if (!match) return null;\n\n\t var charset = match[1];\n\t var q = 1;\n\t if (match[2]) {\n\t var params = match[2].split(';');\n\t for (var i = 0; i < params.length; i++) {\n\t var p = params[i].trim().split('=');\n\t if (p[0] === 'q') {\n\t q = parseFloat(p[1]);\n\t break;\n\t }\n\t }\n\t }\n\n\t return {\n\t charset: charset,\n\t q: q,\n\t i: i\n\t };\n\t}", "title": "" }, { "docid": "3117734bf61bddfa3115208ed6d4760b", "score": "0.45666096", "text": "function parseCharset(str, i) {\n\t var match = simpleCharsetRegExp.exec(str);\n\t if (!match) return null;\n\n\t var charset = match[1];\n\t var q = 1;\n\t if (match[2]) {\n\t var params = match[2].split(';');\n\t for (var i = 0; i < params.length; i++) {\n\t var p = params[i].trim().split('=');\n\t if (p[0] === 'q') {\n\t q = parseFloat(p[1]);\n\t break;\n\t }\n\t }\n\t }\n\n\t return {\n\t charset: charset,\n\t q: q,\n\t i: i\n\t };\n\t}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "95e6dacb23912bf0640b593373050f2b", "score": "0.45563868", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "4338d7fc0943a01c7c9b6cf90f3fcaa6", "score": "0.45555344", "text": "function getLanguagePriority(language, accepted, index) {\n var priority = {\n o: -1,\n q: 0,\n s: 0\n };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(language, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" } ]
7d8921b2b61a44969f82c59b096b3702
submit Login handler to send a request to the node backend
[ { "docid": "7eb3e6c62377e4ca280d9cb84c4aad82", "score": "0.0", "text": "onSubmit(values) {\n console.log(values);\n this.props.submitLogin(values, () => {\n console.log(\"inside onsubmit\")\n /* this.props.history.push(\"/ownerlogin\"); */\n });\n }", "title": "" } ]
[ { "docid": "7e80adb118ae79a3dfd819328d7e06d1", "score": "0.75389224", "text": "async function login(username, password) {\n console.log(\"in Backend post request\")\n return makePOST(backendURL + '/login', {\n username: username,\n password: password\n });\n}", "title": "" }, { "docid": "f222cedab3931d295b5874cf267c0f3f", "score": "0.73078483", "text": "function login(req, res, next) {\n requestToken(req, res, next);\n}", "title": "" }, { "docid": "e6dc7a030de3016b7e99860b596e37a3", "score": "0.7220903", "text": "static async login() {\n return new Promise((resolve, reject) => {\n var formData = querystring.stringify( { password:'', button:'Login' } )\n request.post({\n headers: {\n 'content-type': 'application/x-www-form-urlencoded',\n 'Content-Length': formData.length\n },\n url: 'http://' + KHG_IP + ':8090/Login',\n formData: formData,\n }, function(error, response, body){\n if ( !error ) {\n console.log(\"Login success\")\n }\n resolve(\"done\")\n });\n });\n}", "title": "" }, { "docid": "bd50f980e3c8a4d687827615b81d937a", "score": "0.71317875", "text": "function loginAction(e) {\n e.preventDefault();\n\n const username = usernameBox.value;\n const password = passwordBox.value;\n // console.log(username);\n\n const url = '/user/login';\n const request = new Request(url, {\n method: 'post',\n body: JSON.stringify({\"username\": username, \"password\": password}),\n headers: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': 'application/json'\n },\n });\n fetch(request).then(function (res) {\n if (res.status === 200) {\n if (res.statusText === \"true\") {\n loginSucceedAdmin()\n } else {\n loginSucceed(username)\n }\n } else {\n // console.log(res);\n showMessage(res.statusText)\n }\n }).catch((error) => {\n console.log(error)\n });\n}", "title": "" }, { "docid": "19ede9db22839670afe2993813c171d6", "score": "0.7123094", "text": "function login(){\n console.log('Login called');\n var username = document.getElementById('login-username').value;\n var password = document.getElementById('login-password').value;\n \n grout.login({username:username, password:password}).then(function (loginInfo){\n console.log('successful login:', loginInfo);\n setStatus();\n }, function (err){\n console.error('login() : Error logging in:', err);\n });\n }", "title": "" }, { "docid": "80e77b77630383b4f2f58639984fdb88", "score": "0.70802563", "text": "function login() {\n var Login = require('../pages/login');\n var page = new Login();\n httpBackend.onLoad.when('GET', /users\\/2/).respond(200, mockData('user'));\n page.get();\n httpBackend.when('POST', /session/).respond(200, mockData('post_session'));\n page.login();\n}", "title": "" }, { "docid": "64e4bd0751bc6d3d4dd051d9587ee327", "score": "0.7074512", "text": "function handleUserLogin(req, res) {\n let params = req.query;\n if (params.username && params.password) {\n auth.login(params.username, params.password, (token) => {\n if (token) {\n res.send({\n succ: true,\n contents: {\n token: token\n }\n });\n } else {\n res.send({\n succ: false,\n message: \"Login failed.\",\n code: 4\n });\n }\n });\n } else {\n res.send({\n succ: false,\n message: \"Username and password not specified.\",\n code: 3\n });\n }\n}", "title": "" }, { "docid": "2b62aa8d4832d75bf015d36871807f63", "score": "0.7026765", "text": "async function authSubmitHandler() {\n try {\n const response = await fetch(LINK + '/login', {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n phoneNo: phoneNo,\n password: password,\n userType: selectedMode.name,\n }),\n });\n const responseData = await response.json();\n if (!response.ok) {\n throw new Error(responseData.message);\n } else {\n global.user = responseData.user;\n navigation.navigate(selectedMode.tabs);\n }\n } catch (err) {\n alert('Incorrect Credentials');\n }\n }", "title": "" }, { "docid": "e16f5f388e07990e68094714b42fd7b2", "score": "0.69854015", "text": "login(username, password) {\r\n return this._call(\"post\", \"login\", { username, password });\r\n }", "title": "" }, { "docid": "0446d41207bf483fb96e3137b19f3661", "score": "0.6963355", "text": "async function login() {\n try {\n const response = await Axios.post(`/login`, { username: state.username.value, password: state.password.value }, { cancelToken: ourRequest.token });\n if (response.data) {\n //set loggedIn to true if obviously correct details\n appDispatch({ type: \"LOGIN\", data: response.data });\n appDispatch({ type: \"FLASH_MESSAGE\", value: \"You have successfully logged in\", status: \"success\" });\n // console.table(resposne.data);\n } else {\n console.log(\"Incorrect username / password\");\n appDispatch({ type: \"FLASH_MESSAGE\", value: \"Invalid username / password\", status: \"danger\" });\n }\n } catch (e) {\n appDispatch({ type: \"FLASH_MESSAGE\", value: \"We are sorry, we are experiencing technical issues\", status: \"danger\" });\n console.log(\"There was a problem, with registering the user\");\n }\n }", "title": "" }, { "docid": "e5fd2a802c5611d74286ff136c2c968a", "score": "0.69597405", "text": "async function httpPostLogin(req, res) {\n // login process starts with a non-authenticated session\n req.session.username = null;\n req.session.notAfter = null;\n const { username } = req.body;\n if (typeof username !== 'string' || username.trim().length === 0) {\n console.log('httpPostLogin: non-empty username is required');\n return res.render('main', { error: 'username required to login' });\n }\n\n const seconds = 900; // 60 seconds in 1 minute * 15 minutes\n const expiresMillis = Date.now() + (seconds * 1000);\n req.session.username = username;\n req.session.notAfter = expiresMillis;\n console.log(`httpPostLogin: ${username}`);\n\n // redirect to main page\n res.status(303);\n res.set('Location', '/');\n res.end();\n}", "title": "" }, { "docid": "0ce5b83eafac12dbd741eae73c24b8ce", "score": "0.6952379", "text": "async _loginNodeUser () {\n if (this.authToken) {\n return\n }\n\n let walletPublicKey = this.web3Manager.getWalletAddress()\n let clientChallengeKey\n let url\n\n try {\n let challengeResp = await this._makeRequest({\n url: '/users/login/challenge',\n method: 'get',\n params: {\n walletPublicKey\n }\n }, false)\n\n clientChallengeKey = challengeResp.data.challenge\n url = '/users/login/challenge'\n } catch (e) {\n const requestUrl = this.creatorNodeEndpoint + '/users/login/challenge'\n await this._handleErrorHelper(e, requestUrl)\n }\n\n const signature = await this.web3Manager.sign(clientChallengeKey)\n\n const resp = await this._makeRequest({\n url,\n method: 'post',\n data: {\n data: clientChallengeKey,\n signature\n }\n }, false)\n this.authToken = resp.data.sessionToken\n\n setTimeout(() => {\n this.authToken = null\n this.connected = false\n }, BROWSER_SESSION_REFRESH_TIMEOUT)\n }", "title": "" }, { "docid": "bc28eab32437fa715af872556b4fb17d", "score": "0.6951154", "text": "function handleLogin(request, response) {\n\tvar result = {success: false};\n\n\t// We should do better error checking here to make sure the parameters are present\n\tif (request.body.username == \"admin\" && request.body.password == \"password\") {\n\t\trequest.session.user = request.body.username;\n\t\tresult = {success: true};\n\t}\n\n\tresponse.json(result);\n}", "title": "" }, { "docid": "61d64d9965657b1dd80b697491376e9b", "score": "0.6935544", "text": "function loginSubmit() {\n var elements = getSubmittedData(document.getElementById('loginForm').elements);\n var json_body = JSON.stringify({\n \"email\" : elements.email,\n \"password\" : elements.password\n });\n\n //send to server\n xmlHttpReq('POST', '/sign_in', json_body, function(responseText) {\n var response = JSON.parse(responseText);\n if (response.success) {\n localStorage.setItem(\"token\", response.data);\n setUpWebSocket();\n } else {\n snackbar(response.message);\n logOut();\n }\n });\n return false;\n}", "title": "" }, { "docid": "96b2159cf20fb763a009e1580011ec35", "score": "0.69211316", "text": "async function handleSubmit(evt) {\n evt.preventDefault();\n await logInUser(loginFormData);\n }", "title": "" }, { "docid": "6c29a117130e74d7ec2425f25b4c0a97", "score": "0.691134", "text": "function user_login(req,res){\r\n connection.query(\"SELECT * FROM users WHERE username = ?\", [req.body.username], (err, rows, fields) => {\r\n //TODO: actually authenticate users!!\r\n if(rows[0]){\r\n //success\r\n queued_users.push(req.body.username);\r\n send_game_data();\r\n req.session[\"username\"] = req.body.username;\r\n res.send(JSON.stringify({\r\n login_status: \"success\",\r\n username: req.body.username\r\n }));\r\n }\r\n else {\r\n //failure\r\n res.send(JSON.stringify({\r\n login_status: \"failure\",\r\n username: req.body.username\r\n }));\r\n }\r\n });\r\n}", "title": "" }, { "docid": "626078257e4d585b93172600cd561cea", "score": "0.68845713", "text": "Login (req, res, next) {\n res.json({titulo:\"Login Arduino\"});\n }", "title": "" }, { "docid": "ae22e09c978f403bd8fb3e046ad2159a", "score": "0.6864897", "text": "function login(req, res) {\n console.log('site_router.js login() - fired :' + req);\n\n var options = getOptions();\n\n\toptions.args = {\n\t\t'username' : \treq.body.username,\n\t\t'password' : req.body.password\n\t};\n\n // Registering the user against a peer can serve as a login checker, for now\n console.log('attempting login for:' + req.body.username);\n marbles_lib.login(options, function (err, user) {\n if (err) {\n console.error('Login failed:' + err);\n\t\t\t//return res.redirect('/login');\n\t\t\treturn res.json();\n } else {\n \tconsole.log(JSON.stringify(user));\n \tvar userJSON = user.parsed;\n \treq.session.role = userJSON.role;\n\t\t\treq.session.username = userJSON.userName;\n\t\t\treturn res.json(user.parsed);\n \t//retrieveLCApplications(req, res);\n }\n });\n}", "title": "" }, { "docid": "290217bf7dffe490815f3321c4f69295", "score": "0.68620735", "text": "function login(req, res, callback){\r\n res.send(\"login page\");\r\n}", "title": "" }, { "docid": "9f4d7d489de599adf8f0c3b57a0433a2", "score": "0.6857176", "text": "login(handler) {\n addHandler(this.emitter, \"login\", handler);\n }", "title": "" }, { "docid": "9f4d7d489de599adf8f0c3b57a0433a2", "score": "0.6857176", "text": "login(handler) {\n addHandler(this.emitter, \"login\", handler);\n }", "title": "" }, { "docid": "cf839049449a467b670d423c3f74a3f1", "score": "0.6856503", "text": "async logIn() {\n\n const {loginInput, passwordInput} = this.state\n const {location} = this.props\n\n loginRequest(loginInput, passwordInput, location)\n }", "title": "" }, { "docid": "8b56175f5a68aac9f79ba75afeaf9b4b", "score": "0.6840027", "text": "function onUserLogin() {\n const nameInput = document.getElementById('userName');\n const pswdInput = document.getElementById('password');\n const username = nameInput.value;\n const password = pswdInput.value;\n\n if (username === '') return setInfo('Username field empty!');\n if (password === '') return setInfo('You must type in your password!');\n\n const user = JSON.stringify({ username, password });\n\n console.log('about to login', user);\n\n fetch('/user/login', {\n method: 'POST',\n headers: { 'Content-Type': 'Application/JSON' },\n body: user,\n })\n .then((response) => response.json())\n .then((data) => {\n console.log;\n if (data.message === 'usernameNoMatch') {\n setInfo('Not an existing user!');\n } else if (data.message === 'passwordNoMatch') {\n pswdInput.value = '';\n setInfo('Wrong password!');\n } else if (data.ssid) {\n setInfo(<div className=\"greenText\">Logged in!</div>);\n setTimeout(() => setLoginName(data.ssid), 750);\n }\n })\n .catch((error) => {\n console.error('Error when POST-fetching for login: ', error);\n });\n }", "title": "" }, { "docid": "5c966eae56de26fae05c3466f8dd52c5", "score": "0.6829436", "text": "async login() {\n const request = axios.create({baseURL: '/' + Config.DEFAULT_LANGUAGE});\n const response = await request.post('login', {\n username: this.username,\n password: this.password,\n remember: this.remember\n });\n // all good, submit form manually\n window.location = response.data.redirectURL;\n }", "title": "" }, { "docid": "43d01a5bb7fbd0ecef81bdcd5446c7f0", "score": "0.68257093", "text": "handleLoginClick() {\n const params = {\n username: this.state.username,\n password: this.state.password\n };\n if (!params.username || !params.password) {\n return;\n }\n const options = {\n method: 'POST',\n body: JSON.stringify(params)\n };\n\n fetch(\"http://localhost:4000/login\", options)\n .then(res => res.json())\n .then(res => {\n if (res.authenticated) {\n this.props.handleLogin(res.username, res.handle);\n } else {\n this.loginUnsuccessful();\n }\n });\n\n }", "title": "" }, { "docid": "79f976d8121257438aae742d1ed5066d", "score": "0.6812801", "text": "function handleLogin() {\n\n\t\tif (submitButtonProcessing) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Set submit button to processing (prevent multiple clicks)\n\t\tsetSubmitButtonProcessing(true);\n\n\t\t// Prepare data to send to API\n\t\tconst userData = {\n\t\t\tusername: username,\n\t\t\tpassword: password\n\t\t};\n\n\t\t// Call API utility function\n\t\tloginUser(userData).then(function (response) {\n\n\t\t\tif (response.isAuthenticated) {\n\n\t\t\t\tconst authUserData = {\n\t\t\t\t\tusername: response.username,\n\t\t\t\t\temail: response.email,\n\t\t\t\t\tname: response.name,\n\t\t\t\t\tsignupDate: response.signupDate\n\t\t\t\t};\n\n\t\t\t\t// Save user data and authentication to the store\n\t\t\t\tdispatch(SET_USERDATA(authUserData));\n\t\t\t\tdispatch(SET_ISAUTH(true));\n\n\t\t\t\tauth.signin( () => {\n\t\t\t\t\thistory.push('/dashboard');\n\t\t\t\t});\n\n\t\t\t} else {\n\n\t\t\t\t// Login failed, reset processing\n\t\t\t\tsetSubmitButtonProcessing(false);\n\n\t\t\t\t// TODO: Show some type of login error\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "50f633887c2923f829a88a557546678f", "score": "0.67923164", "text": "function login() {\n User.login(self.user, handleLogin);\n }", "title": "" }, { "docid": "7c2b15b6c444d528650a057aad2f6407", "score": "0.6778344", "text": "function requestLogin (creds): Action {\n return {\n type: LOGIN_REQUEST,\n isFetching: true,\n isAuthenticated: false,\n creds\n }\n}", "title": "" }, { "docid": "217f7acb83fe1ac47c3ab44b273af3a4", "score": "0.67719984", "text": "userLogin(req, res) {\r\n this.auth.userAuth(req, res)\r\n }", "title": "" }, { "docid": "96af4d6dc94962d7ae41ee6a2f151cae", "score": "0.6770899", "text": "async login(context, payload) { // nema namespace-a pa u dispatch samo stavim logn , isto je i za sign up\n return context.dispatch('auth', {\n ...payload,\n mode: 'login',\n });\n }", "title": "" }, { "docid": "7a0f6cc340863cb4b0dcc67b81588704", "score": "0.6769239", "text": "static _login( ) {\n\t\tvar loginAcc = WsMngr.createSendObj( \"core\", \"user\", \"login\", WsMngr._loginObj, \n\t\t\tWsMngr._loginSuccessCB, WsMngr._loginErrorCB );\n\t\tWsMngr.sendAction(loginAcc, true );\t\t// true 2nd arg puts it at the front of queue\n\t}", "title": "" }, { "docid": "8942709ff2dbe805ed09b8ae1187716c", "score": "0.6749928", "text": "async function handleLogin() {\n try {\n const response = await axios.post('http://localhost:3000/admins/login', {\n email: email,\n password: password,\n });\n console.log(response.data);\n console.log(response);\n setInfo(response.data);\n if (response.status === 200) Router.push('dashboard');\n } catch (error) {\n notify();\n console.error(error);\n }\n }", "title": "" }, { "docid": "44baab97548529c6f12f7ed27e2bb8ac", "score": "0.67475635", "text": "async login ({ auth,request}) {\n return await auth.attempt(request.input('email'), request.input('password'))\n }", "title": "" }, { "docid": "cd868a03a7e382aa9d172c2db49d52dd", "score": "0.67430055", "text": "function signin(){\n var payload = {\n \"username\": username.value,\n \"password\": password.value\n };\n\n send_post_request(window.location.origin + '/api/rest-auth/login/', payload, function (data, status){\n\n if (status == 200 || status == 201){\n signin_message.innerHTML = \"Welcome, \" + username.value + \"!\";\n\n // Store token in browser\n sessionStorage.setItem(\"token\", data[\"key\"]);\n sessionStorage.setItem(\"username\", username.value);\n\n // go home\n location.href = window.location.origin\n\n }else{\n signin_message.innerHTML = \"Sign in Failed!\";\n\n }\n \n }, use_token=false)\n}", "title": "" }, { "docid": "98395731f8f0927bd8eb0fa9d77e1454", "score": "0.6728893", "text": "login(values, postSubmit) {\n\t\tvar myHeaders = new Headers();\n\t\tmyHeaders.append('Content-Type', 'application/json');\n\t\tmyHeaders.append('Accept', 'application/json');\n\n\t\tvar postData = new FormData();\n\t\tpostData.append( \"username\", values.username );\n\t\tpostData.append( \"password\", values.password );\n\n\t\tvar timeoutId = setTimeout(function () {\n\t\t\tpostSubmit();\n\t\t\tLoginActions.loginError(\"Connection Error\", \n\t\t\t\t\"The operation timed out, contact an administrator immediately\");\n\t\t}, LOGIN_TIMEOUT);\n\n\t\treturn fetch(LoginConstants.LOGIN_URL, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tmode:'cors',\n\t\t\t\theaders: myHeaders,\n\t\t\t\tbody: postData\n\t\t\t})\n\t\t\t.then((response) => { \t\t\t//Received response from server\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\tpostSubmit(); //Clear the spinner on the login button\n\t\t\t\treturn response.json()\n\t\t\t})\n\t\t\t.then((responseData) => {\n\t\t\t\tif(responseData.error) { \t//Api returned an error\n\t\t\t\t\tLoginActions.loginError(\"LoginError\", responseData.error);\n\t\t\t\t\treturn false;\n\t\t\t\t} else { \t\t\t\t\t//Successful login\n\t\t\t\t\tLoginActions.loginUser(responseData);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tLoginActions.loginError(\"Connection Error\", error.message)\n\t\t\t\treturn false;\n\t\t\t})\n\t\t\t.done(() => {});\n\t}", "title": "" }, { "docid": "fa4131c8186edcb3a15a97e33f8c0961", "score": "0.6720827", "text": "function sendLoginRequest(loginCredential){\n fetch(globalVariable.backendRoot + \"/login\", {\n method: \"POST\",\n body: JSON.stringify(loginCredential),\n headers: {\n \"Content-type\": \"application/json; charset=UTF-8\",\n }\n }).then(response => response.json())\n \t.then(res => {\n \t\tif(res) loginResponse(res, loginCredential)\n \t\telse alertPopUp(\".header-md\",\"No response\")\n })\n }", "title": "" }, { "docid": "3f68d15c4b08785465d74149d09c3d0f", "score": "0.67171633", "text": "login (context, creds) {\n console.debug('get auth.index.login for ' + process.env.NODE_ENV + ' : ' + apiURL)\n return axios.post(apiURL + '/login', creds)\n }", "title": "" }, { "docid": "2b7292b2e0dbb3a7224e46bcbe949250", "score": "0.67146486", "text": "function login() {\n const request = new XMLHttpRequest();\n request.open(\"POST\", \"http://localhost:9000/api/user/login\", true);\n request.setRequestHeader(\"Content-Type\", \"application/json\");\n request.send(JSON.stringify({ email: \"[email protected]\", password: \"password\" }));\n}", "title": "" }, { "docid": "81a3f4e17340f84c58779f37dd9d310d", "score": "0.6711085", "text": "async function loginAction(req, res) {\n const username = req.body.username;\n const password = req.body.password;\n\n const token = checkAuth(username, password);\n if (token) {\n res.cookie('auth', token);\n res.redirect('/');\n } else {\n const r = loginPageTemplate({\n error: true,\n });\n res.send(r);\n }\n}", "title": "" }, { "docid": "44c92743e0a7915dd2d9cc2629183f46", "score": "0.6697937", "text": "function logIn(req, res, next) {\n console.log('Logging in as %s', config.username);\n ug.login(config.username, config.password, function(err) {\n if (err) {\n console.log('Login failed: %s', JSON.stringify(err));\n res.jsonp(500, {error: err});\n return;\n }\n \n loggedIn = new usergrid.client({\n 'orgName' : config.organization,\n 'appName' : config.application,\n 'authType' : usergrid.AUTH_APP_USER,\n 'token': ug.token,\n logging: config.logging\n });\n \n // Go on to do what we were trying to do in the first place\n setTimeout(expireToken, config.tokenExpiration);\n \n next(req, res);\n });\n}", "title": "" }, { "docid": "fe2c25ed40f9c99a05336736c4b2988f", "score": "0.6684382", "text": "function login(req, res) {\n console.log('site_router.js login() - fired');\n req.session.error_msg = 'Invalid username or password';\n req.session.reg_error_msg = null;\n\n // Registering the user against a peer can serve as a login checker, for now\n console.log(TAG, 'attempting login for:', req.body.username);\n user_manager.enrollUser(req.body.username, req.body.password, function (err) {\n if (err) {\n console.error(TAG, 'User enrollment failed:', err.message);\n return res.redirect('/login');\n } else {\n console.log(TAG, 'User enrollment successful:', req.body.username);\n\n // Go ahead and create an 'account' for this ID in the chaincode\n chaincode_ops.createCompany(req.body.username, req.body.roleText, function(err) {\n if(err) {\n console.error(TAG, 'failed to initialize user account:', err.message);\n // TODO set an error and return to the login screen\n return res.redirect('/login');\n }\n\n /*Determine the user's role and login by adding the user info to the session.\n if (req.body.username.toLowerCase().indexOf('monitor') > -1) {\n req.session.role = 'charitymonitor';\n } else {\n req.session.role = 'acceptor';\n }*/\n req.session.username = req.body.username;\n req.session.name = req.body.username;\n req.session.role = req.body.roleText;\n req.session.error_msg = null;\n\n // Redirect to the appropriate UI based on role\n if (req.session.role.toLowerCase() === 'charitymonitor'.toLowerCase()) {\n res.redirect('/audit');\n } else {\n res.redirect('/ledger');\n }\n });\n }\n });\n}", "title": "" }, { "docid": "9a0b308040a77bb2ff8b83a094f8fe18", "score": "0.6681045", "text": "async [m.LOGIN](context, credentials) {\n // Try to login with the provided credentials\n let res = await API.login(credentials.email, credentials.password);\n \n // If login was successful\n if(!res.error) {\n // Save JWT in local storage\n localStorage.setItem(\"sinus-token\", JSON.stringify(res.response.token));\n // Save the current user\n localStorage.setItem(\"current-user\", JSON.stringify(res.response.user));\n \n // Save token and user data\n context.commit(m.SAVE_USER, { user: res.response.user, token: res.response.token});\n }\n \n \n // Return response\n return res;\n }", "title": "" }, { "docid": "9dc8dd370851bbae034c2a228098ada2", "score": "0.6680283", "text": "onSubmit(values) {\n return this.props.dispatch(login(values.username, values.password));\n }", "title": "" }, { "docid": "6f57a26ca5f2c8d620e0ee5c1f9c6db5", "score": "0.6667665", "text": "async doLogin() {\n\t\t// If an email doesn't exist, return immediately\n\t\tif (!this.state.email) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If a password doesn't exist, return immediately\n\t\tif (!this.state.password) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Set button's state to true\n\t\tthis.setState({\n\t\t\tbuttonDisabled: true\n\t\t})\n\n\t\t// API calls to the dbserver\n\t\ttry {\n\t\t\tlet res = await fetch(API_URL + '/login', {\n\t\t\t\tmethod: 'post',\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n credentials: 'include',\n\t\t\t\t// Checks the submitted email and password against the dbserver records to see if it exists\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\temail: this.state.email,\n\t\t\t\t\tpassword: this.state.password\n\t\t\t\t})\n\t\t\t});\n\n\t\t\tlet result = await res.json(); // The result from res variable\n\n\t\t\t// If user is successfully logged in\n\t\t\tif (result && result.success) {\n this.setState({isLoggedIn: true});\n\t\t\t// If user is not successfully logged in\n\t\t\t} else if (result && result.success === false) {\n\t\t\t\tthis.resetForm();\n\t\t\t\talert(result.msg);\n\t\t\t}\n\n\t\t// Catch errors\t\t\n\t\t} catch(e) {\n\t\t\tconsole.log(e);\n\t\t\tthis.resetForm();\n\t\t}\n\t}", "title": "" }, { "docid": "40f2f6b8d8743ce0744199a1df9e1174", "score": "0.6661954", "text": "processLogin( request, response, next ) {\n\n\t\t// The processing action shares the same view as the form.\n\t\tresponse.rc.title = \"Login\";\n\t\tresponse.setView( \".login\" );\n\n\t\tif ( ! request.rc.username ) {\n\n\t\t\tresponse.status( 400 );\n\t\t\tresponse.rc.errorMessage = \"Please enter your usename.\";\n\t\t\treturn( next() );\n\n\t\t}\n\n\t\tthis._userService\n\t\t\t.authenticateUser( request.rc.username )\n\t\t\t.then(\n\t\t\t\t( user ) => {\n\n\t\t\t\t\tresponse.cookie( \"sessionId\", user.id );\n\t\t\t\t\tresponse.redirect( \"/\" );\n\n\t\t\t\t}\n\t\t\t)\n\t\t\t.catch(\n\t\t\t\t( error ) => {\n\n\t\t\t\t\tresponse.status( 401 );\n\t\t\t\t\tresponse.rc.errorMessage = \"That username does not exist.\";\n\t\t\t\t\tnext();\n\n\t\t\t\t}\n\t\t\t)\n\t\t\t.catch( next )\n\t\t;\n\n\t}", "title": "" }, { "docid": "7c09b85071759fd895dde0e789bf89e8", "score": "0.665633", "text": "function userLogin(e) {\n e.preventDefault();\n if (e.target.id === \"login\") {\n // The data we are going to send in our request\n let data = {\n userName: document.querySelector('#userNameInput').value,\n password: document.querySelector('#userPasswordInput').value\n }\n\n const request = new Request(\"/users/signin\", {\n method: 'post', \n body: JSON.stringify(data),\n headers: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': 'application/json'\n },\n });\n fetch(request)\n .then(function(res) {\n console.log(res.status)\n if (res.status !== 200) {\n swal(\"\", \"Login failed! Wrong user credentials, please check.\", \"error\");\n }\n }).catch((error) => {\n console.log(error)\n })\n }\n}", "title": "" }, { "docid": "8c570da4e2b467946bd1654eb1885bd5", "score": "0.6656253", "text": "handleLogin(e) {\n e.preventDefault();\n\n if ($('#username').val() == '' || $('#password').val() == '') {\n handleError('You need to fill in both the Username and Password.');\n return false;\n }\n\n // Sends login request to server.\n sendAjax('POST', $('#loginForm').attr('action'), $('#loginForm').serialize())\n .then(redirect);\n\n return false;\n }", "title": "" }, { "docid": "059cb16d14b82942d32812ebce810082", "score": "0.66501087", "text": "async function login(req, res) {\n return res.status(200).send();\n}", "title": "" }, { "docid": "1451b41a44f134186ed875a4c6f49b1e", "score": "0.66500133", "text": "function handleLoginSubmit() {\n\t$('.js-login-button').click(function(e) {\n\t\te.preventDefault();\n\t\tconst uname = $('.js-uname-entry').val();\n\t\tconst pword = $('.js-pword-entry').val();\n\n\t\t//Make sure no empty strings will be submitted, then \n\t\tif (uname != '' && pword != '') {\n\t\t\tconst loginParams = {\n\t\t\t\tusername: uname,\n\t\t\t\tpassword: pword\n\t\t\t};\n\t\t\t$.ajax({\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\tdata: JSON.stringify(loginParams),\n\t\t\t\tdataType: 'json',\n\t\t\t\tsuccess: function(response){\n\t\t\t\t\tif (response.authToken) {\n\t\t\t\t\t\twindow.localStorage.setItem(\"Bearer\", response.authToken);\n\t\t\t\t\t\twindow.location.replace('/events?=welcome');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclearInputs();\n\t\t\t\t\t\tconst alertInvalid = 'Please enter a valid username and/or password.';\n\t\t\t\t\t\talertUser(alertInvalid);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(){\n\t\t\t\t\tconst alertError = 'Error encountered in POST.';\n\t\t\t\t\talertUser(alertError);\n\t\t\t\t},\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: '/api/auth/login'\n\t\t\t});\n\t\t} else {\n\t\t\tconst alertBlank = 'Please enter a username and / or password.';\n\t\t\talertUser(alertBlank);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "eec00891d60d20c5f6c05e8ab7be20f2", "score": "0.6642941", "text": "login(credentials) {\n return Api().post('login', credentials)\n }", "title": "" }, { "docid": "3bc30655807c70799a9507c523ebbbf1", "score": "0.66392803", "text": "handleSubmit(event) {\n event.preventDefault();\n sendLoginRequest(this.state, false, this.state.username, this.props.onLogin);\n }", "title": "" }, { "docid": "37b463cdbd739929f724e90cd13e1737", "score": "0.6637937", "text": "function login(e){\n\t// prevent default behaviour\n\te.preventDefault();\n\n\t// define url\n\tlet url = \"https://hingastores.herokuapp.com/api/v2/auth/login\"\n\n\t// get login data from login ui\n\tlet data = {\n\t\temail: document.getElementById('email').value,\n\t\tpassword: document.getElementById('password').value\n\t};\n\n\tlet loginData = {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t'Access-Control-Allow-Origin': '*',\n\t\t\t'Access-Control-Request-Method': 'POST'\n\t\t},\n\t\tbody: JSON.stringify(data)\n\t};\n\n\tfetch(url, loginData)\n\t.then ((res) => res.json())\n\t.then ((data) => {\n\t\tlocalStorage.setItem('token', data.token)\n\t\tif(data.message === \"Logged in successfully!\"){\n\t\t\twindow.location.href = 'ui/products.html';\n\t\t} else{\n\t\t\tlet errorMessage = document.getElementById('errorMessage')\n\t\t\tif (errorMessage){\n\t\t\t\terrorMessage.innerHTML = data.message\n\t\t\t}\n\t\t}\n\t})\n\t.catch((err) => console.log(err))\n}", "title": "" }, { "docid": "aae68c8d554c16f9ace92fe8526a5ef5", "score": "0.66366315", "text": "login(email, password) {\n return this.postData(urljoin(process.env.REACT_APP_LOCAL___API, 'api', 'accounts/login'), { email, password })\n .then(res => {\n if (res) {\n this.client = new faunadb.Client({ secret: res.secret })\n return res.account\n }\n return res\n })\n .catch(err => console.log('error calling frontend - login', err))\n }", "title": "" }, { "docid": "1f8ade907a47afc9c9b2be2a3584fd8d", "score": "0.66363704", "text": "function requestLogin() {\n\tlog('requesting');\n\tvar deferred = Q.defer();\n\n\tif (!code) {\n\t\tdeferred.reject('empty code');\n\t}\n\n\tvar data = querystring.stringify({\n\t\t'AjaxMethod': 'LOGIN',\n\t\t'Account': ACCOUNT.username,\n\t\t'Pwd': ACCOUNT.password,\n\t\t'ValidCode': code\n\t});\n\n\tvar options = {\n\t\thostname: HOST,\n\t\tport: 80,\n\t\tpath: URLS.login,\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n\t\t\t'Content-Length': data.length,\n\t\t\t'Cookie': COOKIE\n\t\t}\n\t};\n\n\tvar req = http.request(options, function(res) {\n\t\tvar content = '';\n\t\tres.setEncoding('utf8');\n\t\tres.on('data', function(chunk) {\n\t\t\tcontent += chunk;\n\t\t})\n\t\t.on('end', function() {\n\t\t\tlog('login message: ' + content);\n\t\t\tif (content.indexOf('true') !== -1) {\n\t\t\t\tdeferred.resolve();\n\t\t\t} else if (content.indexOf('验证码不符合!') != -1) {\n\t\t\t\tdeferred.reject('wrong validcode');\n\t\t\t} else {\n\t\t\t\tdeferred.reject('unknown error');\n\t\t\t}\n\t\t})\n\t});\n\n\treq.on('error', function(e) {\n\t\tdeferred.reject(e.message);\n\t})\n\n\treq.write(data);\n\treq.end();\n\n\treturn deferred.promise;\n}", "title": "" }, { "docid": "3711602f423f1d5a1608d6eb6639ee4c", "score": "0.6635602", "text": "function postLogin(e) {\n e.preventDefault();\n axios\n .get(`https://vmaware.herokuapp.com/api/usertoken/${userId}`)\n .then((result) => {\n if (result.status === 200) {\n // make the current user logged in\n setAuthTokens(result.data.token);\n setLoggedIn(true);\n } else {\n setIsError(true);\n }\n })\n .catch((e) => {\n setIsError(true);\n });\n }", "title": "" }, { "docid": "4a50cd07693525511c3f087134677f5e", "score": "0.6633879", "text": "async function login()\n\t{\n\t\tlet data = await Fetch.post(LOGIN_URL, { name: username, password: password });\n\n\t\tif (data.ok)\n\t\t{\n\t\t\thistory.push({ pathname: \"/home\" });\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (data.error)\n\t\t\t\tsetError(data.error);\n\t\t\telse\n\t\t\t\tsetError(\"unknown error\");\n\t\t}\n\t}", "title": "" }, { "docid": "15e60a6af6d7328ffdc78f423c898d2e", "score": "0.66319174", "text": "logIn(req, res, next){\n\t\tconsole.log(req.body)\n\t\tuserDB.checkCred(req.body)\n\t\t.then(result => {\n\t\t\treq.session.user = result;\n\t\t\tnext();\n\t\t})\n\t\t.catch(() => {\n\t\t\treq.session.error = \"Username and password does not match, please try again!\";\n\t\t\tres.redirect(`back`);\n\t\t})\n\t}", "title": "" }, { "docid": "eb59a8e1bc5145339936df06c8bdcdc6", "score": "0.66313547", "text": "function handleSubmit() {\n const reqParams = {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ email, password }),\n };\n\n fetch('/user/login', reqParams)\n .then((res) => res.json())\n .then((confirmation) => {\n if (confirmation.confirmed) {\n props.addLoginInfo(confirmation.userInfo);\n\n const { firstName, email, arn, region } = confirmation.userInfo;\n\n updateArnIDB({ arn }).catch((error) => {\n console.error('error while updating login arn', error);\n });\n\n updateUserInfoIDB({ firstName, email }).catch((error) => {\n console.error('error while updating login user info', error);\n });\n\n updateRegionIDB({ region }).catch((error) => {\n console.error('error while updating region info', error);\n });\n history.push('/admin');\n } else {\n setConfirmed(true);\n password.value = '';\n email.value = '';\n }\n });\n }", "title": "" }, { "docid": "4986e53c3d2d7c126af595992df716ff", "score": "0.6630893", "text": "function handleLoginSubmission(){\n\t$('main').on('submit','.login-form', function(event) {\n\t\tevent.preventDefault();\n\t\tconst username = $('#login-username').val();\n\t\tconst password = $('#login-password').val();\n\t\tlet userInfo = {username, password}\n\t\t$.ajax({\n\t\t\tmethod: 'POST',\n\t\t\turl: `/auth/login`,\n\t\t\tdata: JSON.stringify(userInfo),\n\t\t\tcontentType: 'application/json',\n\t\t\tsuccess: function(data) {\n\t\t\t\tauthToken = data.authToken;\n\t\t\t\tloggedIn = true;\n\t\t\t\tlocalStorage.setItem(\"authToken\", data.authToken);\n\t\t\t\tlocalStorage.setItem(\"username\", data.username);\n\t\t\t\tupdateNavigationBar(username, true);\n\t\t\t\tgetTrips();\n\t\t\t},\n\t\t\terror: function(err) {\n\t\t\t\tconsole.error(err);\n\t\t\t\t$('.login-section').html(handleIncorrectPassword())\n\t\t\t}\n\t\t})\n\t})\n}", "title": "" }, { "docid": "6910f6902ef23d1bcca09c6a2f5581dc", "score": "0.662332", "text": "function postLogin(){\n\treturn request(app)\n\t.post(\"/api/v1/auth/login\")\n\t.send({username: user1.username, password: user1.password})\t\n\t.then(function(res) {\n\t\texpect(res).to.have.status(200);\n\t\texpect(res).to.be.json;\n\t\t\t\t\t\t\t\n\t\t//Asserts that the target is neither null nor undefined.\n\t\texpect(res.body.token).to.exist;\n\t\t\n\t\texpect(res).to.have.cookie(\"accesstoken\");\n\t})\n\t.catch(function(err) {\n\t\tconsole.log(err.stack);\n\t\tthrow err;\n\t});\n}", "title": "" }, { "docid": "eb667d503c2883b73dcf91ecd7f77c91", "score": "0.6616054", "text": "static loginUser(req, res, next) {\n pool.query('SELECT * from users WHERE name=$1', [req.body.name], (err, data) => {\n if (err) {\n return next(err);\n }\n if (data.rowCount > 0) {\n const checkPassword = bcrypt.compareSync(req.body.password, data.rows[0].password);\n const role = data.rows[0].roles;\n if (checkPassword) {\n const token = jwt.sign({\n name: req.body.name,\n role,\n }, process.env.JWTKEY, {\n expiresIn: '1h',\n });\n\n return res.status(200).json({\n success: true,\n token,\n message: 'Login Successful',\n });\n }\n return res.status(403).json({\n success: false,\n message: 'Invalid Credentials',\n });\n }\n return res.status(403).json({\n success: false,\n message: 'Invalid Credentials',\n });\n });\n }", "title": "" }, { "docid": "30026e3ed845f5af935cbe9bcc08f04f", "score": "0.6614943", "text": "function loginUser(event) {\n axios({\n method: 'POST',\n url: '/users/login',\n data: {\n username: event.target.parentNode.children[2].value, //username from input\n password: event.target.parentNode.children[3].value, //password from input\n },\n }).then((response) => {\n if (response.data === 'Send to their page') {\n //this is the expected response from backend upon successful login\n setIsLoggedIn(true);\n }\n });\n }", "title": "" }, { "docid": "436b346acec9c7bc61ed2d89e3b009d8", "score": "0.66127485", "text": "function handleLoginBegin(req, res) {\n rdio.beginAuthentication(function(error, loginUrl) {\n if (error) {\n res.send('Error beginning request: ' + JSON.stringify(error));\n return;\n }\n res.redirect(loginUrl);\n });\n}", "title": "" }, { "docid": "15efa3d26481042b8613b65e4a847c42", "score": "0.6611684", "text": "logIn(req, res) {\n let reqBody = '';\n req.on('data', chunk => {\n reqBody += chunk.toString();\n }).on('end', () => {\n let body = JSON.parse(reqBody);\n let user = body['user'];\n let password = body['password'];\n this.verifyUser(user, password).then(() => {\n if (AdminController.stateChanged) {\n AdminController.stateChanged = false;\n if (!AdminController.validUser) {\n this.fs.readFile('./403.html', function (error, content) {\n res.writeHead(HttpCodes_1.HttpCodes.HttpStatus_Forbidden, { 'Content-Type': 'text/html' });\n res.end(content, 'utf-8');\n });\n }\n else {\n res.writeHead(HttpCodes_1.HttpCodes.HttpStatus_OK, 'text/text');\n res.end('ok');\n }\n }\n else {\n this.fs.readFile('./500.html', function (error, content) {\n res.writeHead(HttpCodes_1.HttpCodes.HttpStatus_InternalServerError, { 'Content-Type': 'text/html' });\n res.end(content, 'utf-8');\n });\n }\n });\n });\n }", "title": "" }, { "docid": "8cfcdaf190d00739ee67eac644c014cd", "score": "0.6605493", "text": "function adminLoginCall(payload) {\n return request('post', urls.ADMIN_LOGIN_URL, payload);\n}", "title": "" }, { "docid": "a14249986d4beb0b2d53be5af4ba12a4", "score": "0.6599859", "text": "login(username, password) {\n this.send(`auth login ${username} ${password}`);\n }", "title": "" }, { "docid": "9e1536a998970f173921322659a520ff", "score": "0.6596828", "text": "function logIn(req, res, next)\n{\n res.json({success: 1, authToken: 'asdf'});\n // dummy method for log in\n}", "title": "" }, { "docid": "faed38c6d354c970a81affd4ac1c6dfc", "score": "0.6594511", "text": "function loginUser(request, response)\r\n{\r\n\tcon.query(\"SELECT name, password FROM users WHERE name = \" + con.escape(request.body.username), // escaping used to prevent SQL injection\r\n\tfunction (err, fields){\r\n\t\tif (fields[0].password == request.body.psw)\r\n\t\t{\r\n\t\t\tconsole.log(\"Login success\")\r\n\t\t\trequest.session.userName = fields[0].name;\r\n\t\t\tresponse.sendFile(dir + '/selector.html');\r\n\t\t\t\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tresponse.sendFile(dir + '/login.html');\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "02c8e3d41d617535f835dc942a1a1e5e", "score": "0.65865713", "text": "function login(data) {\n console.log('Trying to log in..');\n \n return axios.post('https://hkrrun-jswgvsei4q-lz.a.run.app/login', {\n password: data.password,\n username: data.username\n })\n .then((response) => {\n console.log('Response received..');\n\n return response;\n\n }, (error) => {\n console.log('Error!');\n console.log(error);\n\n return false;\n }\n );\n}", "title": "" }, { "docid": "a25cb4425f29df5e6938b37fa054bcf4", "score": "0.6583368", "text": "function devLogin(){\n\tconst user = $('#dev-login-username').val();\n\tconst pass = $('#dev-login-password').val();\n\n\t// VALIDATING FORM\n\tif(user == '' || pass == ''){\n\t\t// DO NOT POST EMPTY FIELDS TO SERVER\n\t}\n\telse{\n\t\t// SENDS LOGIN CREDENTIALS TO main.js\n\t\tipcRenderer.send('dev-login:attemp',{username: user, password: pass});\n\t\t$('#dev-login-password').val('');\n\t}\n}", "title": "" }, { "docid": "53275605505cdc0a1cf5bef58775febb", "score": "0.65826327", "text": "function main () {\r\n let app = express(); // Export app for other routes to use\r\n let handlers = new HandlerGenerator();\r\n const port = process.env.PORT || 8080;\r\n app.use(bodyParser.urlencoded({ extended: true }));\r\n app.use(bodyParser.json());\r\n app.use(session({secret: \"TokenKey\"}));\r\n // Routes & Handlers\r\n app.post('/login', (req, res) => {\r\n let loginCheck = handlers.login(req, res);\r\n if(loginCheck.success) {\r\n req.session.token = loginCheck.token;\r\n res.writeHead(200, {'Content-Type': 'text/html'});\r\n res.write(loginCheck.message);\r\n res.write('<br>Welcome ' + req.body.username + '!');\r\n res.end();\r\n } else {\r\n res.writeHead(200, {'Content-Type': 'text/html'});\r\n res.write(loginCheck.message);\r\n res.write('<br><a href=\"/\">Back</a>');\r\n res.end();\r\n }\r\n });\r\n \r\n app.get('/', (req,res) => {\r\n console.log(req.session);\r\n let authCheck = authValidate.checkToken(req, res);\r\n console.log(authCheck);\r\n if(authCheck && !authCheck.success) {\r\n res.writeHead(200, {'Content-Type': 'text/html'});\r\n //res.write(authCheck.message);\r\n res.write(\"<div><form action='/login' method='post'>\");\r\n res.write(\"<p><label>Username: <input type='text' required name='username'></label></p>\");\r\n res.write(\"<p><label>Password: <input type='password' required name='password'></label></p>\");\r\n res.write(\"<input type='submit' value='Submit'></form></div>\");\r\n res.end();\r\n } else if (!authCheck && req.decoded.authSuccess) {\r\n res.writeHead(200, {'Content-Type': 'text/html'});\r\n res.write(\"<div><p>Hello \" + req.decoded.username + \"</p>\");\r\n res.write(\"<p>You are already logged in!</p>\");\r\n res.end();\r\n }\r\n });\r\n app.listen(port, () => console.log(`Server is listening on port: ${port}`));\r\n}", "title": "" }, { "docid": "e69ac32c0497533a5a530f631f71109a", "score": "0.6580054", "text": "login(app, database) {\n app.post(\"/login\", (req, res) => {\n let username = req.body.username;\n let password = req.body.password;\n\n console.log(\n `\\nreceived login request -> username : ${username} / password : ${password}`\n );\n\n let cols = [username];\n database.query(\n \"SELECT * FROM user WHERE username = ? LIMIT 1\",\n cols,\n (err, data) => {\n if (err) {\n res.json({ success: false, message: \"cant login with the db\" });\n return false;\n }\n\n if (data && data.length === 1) {\n if (data[0].password === password) {\n database.query(\n \"UPDATE user SET logged = 1 WHERE username = ?\",\n cols,\n (err, data) => {\n if (err) {\n res.json({\n success: false,\n message: \"Cant update the login status\",\n });\n return false;\n }\n }\n );\n res.json({\n success: true,\n message: \"LOGGED IN WITH DB\",\n username: username,\n });\n } else {\n res.json({ success: false, message: \"Wrong password\" });\n return false;\n }\n } else {\n res.json({ success: false, message: \"Wrong credentials\" });\n return false;\n }\n }\n );\n });\n }", "title": "" }, { "docid": "1dd6a66489d8ca1ddf6505ed30aa8f24", "score": "0.65787196", "text": "async function login() {\n let form = $('#formLogin');\n let username = form.find('input[name=\"username\"]').val();\n let password = form.find('input[name=\"passwd\"]').val();\n\n try {\n let response = await requester.post('user', 'login', 'basic', {\n username,\n password\n });\n saveSession(response);\n showView('viewAds');\n showInfo('Successfully logged in!');\n } catch (e) {\n handleError(e);\n }\n }", "title": "" }, { "docid": "9ca5a0f7e5639602d5034cbef787c04b", "score": "0.6576207", "text": "function onLoginClick() {\n console.log(\"Login Clicked\");\n\n if(username == null || password == null || username.length === 0 || password.length === 0) {\n console.log(\"Username and password cannot be empty\");\n }\n // TODO: Contact server and wait for a response\n}", "title": "" }, { "docid": "55f59cb124f5b7d8f2b728ecdb411e73", "score": "0.6573096", "text": "function loginHandler( err, token ) {\n if (err) {\n console.error( err );\n } else {\n console.log(\"Logged in with \" + token );\n // checkUser( token );\n // getCurrentUser( token );\n // doSomething();\n firstLambaFunction();\n }\n}", "title": "" }, { "docid": "4a80a1f2882dc53df3b56d0b25f6a214", "score": "0.6562332", "text": "function login() {\n\n }", "title": "" }, { "docid": "dfe2473907960494e37ca8fc9b7e7f83", "score": "0.65585303", "text": "login(username, password) {\n this.state.username = username;\n\n this.send(':auth', 'login', username, password);\n }", "title": "" }, { "docid": "f61db265ae0ca62e23e7904575c7091d", "score": "0.6557774", "text": "function login(username, password) {\n // Sending and receiving data in JSON format using POST method\n network_login(username.value, password.value, function (response) {\n localStorage['username'] = username.value;\n localStorage['token'] = response;\n window.location.href = localStorage['prevPath'];\n }, function (xhr) {\n username.value = \"Please Enter A Valid Login\";\n })\n}", "title": "" }, { "docid": "db803f4a633282de323446ea0686a3b7", "score": "0.6556674", "text": "function loginFormHandler(e) {\n e.preventDefault()\n const emailInput = document.querySelector(\"#email\").value\n const pwInput = document.querySelector(\"#password\").value\n loginFetch(emailInput, pwInput)\n}", "title": "" }, { "docid": "f80acec3ab7b9295635f9c40d02294c9", "score": "0.65508205", "text": "async login({ params, request, response, auth }) {\n console.log('用户登录')\n const { email, password } = request.all()\n await auth.attempt(email, password)\n const user = await auth.getUser()\n response.status(200).json({\n message: 'login success',\n result: {\n username: user.username,\n id: user.id,\n email: user.email\n }\n })\n }", "title": "" }, { "docid": "c1975290c22c5ad43407e8231c0323f5", "score": "0.6546388", "text": "async function handleLogin(){ \n\n try {\n const newUrl = url.split(\"?code=\");\n window.history.pushState({}, null, newUrl[0]);\n const code = newUrl[1];\n \n const res = await backend.post('/Authorize', { code }); \n const data = res.data;\n\n window.localStorage.setItem(\"access_token\", data.access_data.access_token);\n window.localStorage.setItem(\"token_type\", data.access_data.token_type);\n window.localStorage.setItem(\"scope\", data.access_data.cope);\n window.localStorage.setItem(\"user_data\", JSON.stringify(data.user_data));\n history.push('/');\n \n } catch (error) { \n console.error(error.message);\n } \n\n }", "title": "" }, { "docid": "0dbcda74ef80e3a59a69563e7728403f", "score": "0.6539882", "text": "login(credentials){\n let data = JSON.stringify(credentials);\n return Api.post('login', {data}); \n }", "title": "" }, { "docid": "f022dca549d0b68e6883f4e44f03a654", "score": "0.6535347", "text": "postAdminLogin(payload) {\n return Repository.post(`admin/login`, {\n username: payload.username,\n password: payload.password,\n });\n }", "title": "" }, { "docid": "b778ae0c4320205085b54c1dad707171", "score": "0.6531636", "text": "function login() {\n\t//send out the info submitted by the user to the server.\n\tsocket.emit(\"login\", { username: loginUsernameInput.value, password: loginPasswordInput.value })\n\t//when recieveing the loginResponse it checks if his login was successful or not.\n\tsocket.on(\"loginResponse\", function (data) {\n\t\tif (data.reason == null && data.success) {\n\t\t\tusername = loginUsernameInput.value\n\t\t\t/** If success, then log them in */\n\t\t\tDisclaimer.style.display = \"none\"\n\t\t\tlogo.style.display = \"none\"\n\t\t\tsigninModal.style.display = \"none\"\n\t\t\tmenuModal.style.display = \"inline-block\"\n\t\t} else {\n\t\t\t/** If not success, give them feedback */\n\t\t\talert(data.reason)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "8360013dc0a5b5e4f192b375cf96c5c0", "score": "0.6528574", "text": "function handleLogin(username, password, userdata){\n const formData = new FormData();\n formData.append('username',username);\n formData.append('password', password);\n const options = {\n method: 'POST',\n body: formData,\n };\n fetch('https://thefoth.herokuapp.com/api/v1/thefoth-admin', options)\n .then((res) => {\n if (res.ok){\n alert('Successfully Logged In');\n document.querySelector(\".login-area\").style.display = \"none\";\n document.getElementById(\"service\").style.display = \"block\";\n document.getElementById(\"footer-admin\").style.display = \"block\";\n // this checks if browser is mobile\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n // some code..\n document.getElementById(\"side-menu\").style.display = \"none\";\n } else {\n document.getElementById(\"side-menu\").style.display = \"block\";\n }\n return res.json();\n }else {\n alert('Unsuccessful!!!!!!!!!');\n window.stop();\n }\n \n })\n .then((data)=> {\n\n localStorage.setItem('token','Bearer ' + data.token)\n })\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "7a26b8e6a69bdcc9811cb09ac4b629eb", "score": "0.65223885", "text": "login(params, callback){\n request(genRequestOptions({\n 'url' : 'https://apps.mypurecloud.com/api/v2/login',\n 'method' : 'POST',\n 'token' : null,\n 'data' : params\n }), function(error, response, body){\n if(error || response.statusCode !== 200){\n if(response.statusCode === 401)\n callback({'status' : 403, 'error' : body});\n else\n callback({'status' : response.statusCode, 'error' : body});\n }\n else{\n callback(null, body);\n }\n });\n }", "title": "" }, { "docid": "dcc10e779dad508d840e767be3ddfda3", "score": "0.65182656", "text": "function loginHandler(app){\n\treturn function(req, res) {\n \t \tconst isDisplay = (typeof req.query.submit === 'undefined');\n \t\tif (isDisplay) { //simply render search page\n \t\t\tres.send(doMustache(app, 'login', {}));\n \t\t}\n \t\telse {\n\t\t\tconst q = req.query.q;\n\t\t\tconst p = req.query.p;\n\t\t\tif(typeof q === 'undefined' || q.trim().length === 0 || !(EMAIL_REG.test(q))){\n\t\t\t\tconst view = {qError : 'Please enter email in valid format', q : q};\n\t\t\t\tres.send(doMustache(app, 'login', view));\n\t\t\t}\n\t\t\telse if (typeof p === 'undefined' || p.trim().length === 0) {\n\t\t\t\tconst view = {qError : 'Please enter password', q : q};\n\t\t\t\tres.send(doMustache(app, 'login', view));\n \t\t\t}\n\t\t\telse{\n\t\t\t\tapp.users.login(q, p)\n\t\t\t\t.then((auth) => {\n\t\t\t\t\tres.cookie('ID', q, {maxAge: 365 * 24 * 60 * 60 * 1000});\n\t\t\t\t\tres.cookie('AUTH', auth, {maxAge: 365 * 24 * 60 * 60 * 1000});\n\t\t\t\t\tviewUserHandler(app, auth,res, q);})\n\t\t\t\t.catch(() => res.send(doMustache(app, 'login', { q: q, qError: 'Please enter valid user email and password' }))\n\t\t\t\t);\n\t\t\t}\n \t\t}\n \t};\n}", "title": "" }, { "docid": "dd3f6dcae82d14f0734c7112bbc0e746", "score": "0.64964795", "text": "function watchLoginForm() {\n $('#login-form').submit(event => {\n event.preventDefault();\n const userData = {\n username: $('#username-login').val(),\n password: $('#password-login').val()\n };\n\n // Verifies provided data, signs user in if data is valid\n HTTP.loginUser({\n userData,\n onSuccess: res => {\n const authUser = res.user;\n authUser.jwtToken = res.jwtToken;\n CACHE.saveAuthenticatedUser(authUser);\n window.open('/user/hub.html', '_self');\n },\n onError: err => {\n $('#error-message').html(`\n <p>Your username and/or password were incorrect.</p>\n `);\n }\n });\n });\n}", "title": "" }, { "docid": "fca57fb553e868f802ee32034a7993d4", "score": "0.6494863", "text": "function login(logininfo) {\n console.log(\"loggggginnn\", logininfo)\n return request({\n url: '/login',\n method: 'POST',\n data: {\n mobile: logininfo.username,\n password: logininfo.password,\n // scope: \"*\",\n // client_id: \"1\",\n // client_secret: env.CLIENT_SECRET,\n // grant_type: \"password\"\n }\n });\n}", "title": "" }, { "docid": "b5bbf24ff6e28c6733b608a121a671c9", "score": "0.64919025", "text": "onSubmit(e, email, password) {\n e.preventDefault()\n this.logIn(email, password)\n }", "title": "" }, { "docid": "412fafaa61c3290963934796207cb7f8", "score": "0.64914024", "text": "function login ({ username, password }, cb = NOOP) {\n request.post({ url: 'https://tubitv.com/oz/auth/login/', jar, json:true, gzip: true, body: { password, username } }, function (err, response, body) {\n if (!err && response.statusCode == 200 && body.token) {\n const { userId, name, email, fbId, hasPassword, token } = body\n\n cb(false, { userId, name, email, fbId, hasPassword, token })\n } \n else cb(err || new Error('Unauthorized'))\n })\n}", "title": "" }, { "docid": "6ccccac5f66ecf0f8378386a26a6ffcb", "score": "0.6490208", "text": "static async login(username, password) {\n try {\n const response = await this.request('users/login', { username, password }, 'post')\n localStorage.setItem('username', response.username)\n localStorage.setItem('token', response.token)\n return response\n } catch (err) {\n alert(err[0].error.message)\n }\n }", "title": "" }, { "docid": "c6be48951680c0b6955f86f6745177ee", "score": "0.6482546", "text": "login(req, res, next) {\n const we = req.we;\n\n if (!we.config.passport || !we.config.passport.strategies || !we.config.passport.strategies.local) {\n return res.notFound();\n }\n\n if (!lt.canLogin(req)) {\n const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;\n\n we.log.warn('AuthController:login:throttle:', { ip: ip });\n res.addMessage('warning', {\n text: 'auth.login.throttle.limit'\n });\n lt.onLoginFail(req);\n return res.badRequest();\n }\n\n const email = req.body.email;\n\n if (req.method !== 'POST' || req.isAuthenticated()) {\n // else show login page\n return res.ok();\n }\n // -- set req.body for error page\n res.locals.data = req.body;\n\n return we.passport.authenticate('local', (err, user, info)=> {\n if (err) {\n lt.onLoginFail(req);\n we.log.error('AuthController:login:Error on get user ', {\n error: err,\n email\n });\n return res.serverError(err);\n }\n\n if (!user) {\n we.log.debug('AuthController:login:User not found', {\n email\n });\n res.addMessage('warning', {\n text: info.message,\n vars: { email: email }\n });\n lt.onLoginFail(req);\n return res.badRequest();\n }\n\n if (user.blocked) {\n we.log.warn('auth.user.blocked.on.login', { id: user.id });\n res.addMessage('danger', 'user.blocked');\n return res.goTo('/');\n }\n\n if (!user.active) {\n we.log.debug('AuthController:login:User not active', { email });\n res.addMessage('warning', {\n text: 'auth.login.user.not.active',\n vars: { email: email }\n });\n return res.badRequest();\n }\n\n we.auth.logIn(req, res, user, (err)=> {\n if (err) return res.serverError(err);\n we.log.info('AuthController:login: user autheticated:', {\n id: user.id,\n username: user.username\n });\n\n if (err) {\n we.log.error('logIn error: ', { error: err });\n return res.serverError(err);\n }\n\n lt.onLoginSuccess(req);\n\n res.locals.newUserCreated = true;\n // redirect if are a html response or have the redirectTo\n if (res.locals.redirectTo) return res.goTo(res.locals.redirectTo);\n if (req.accepts('html')) return res.goTo('/');\n\n res.send({ user: user});\n });\n })(req, res, next);\n }", "title": "" }, { "docid": "3db817ef60f2b6163205d8bf945af3c8", "score": "0.6476357", "text": "login(req, res) {\n // console.log(req.body);\n if (Object.keys(req.body).length === 0) {\n res.render('login', { layout: false });\n\n } else {\n const reqUsername = req.body.username;\n const reqPassword = req.body.password;\n user_model.getPassword(reqUsername, function (dbPassword) {\n if (bcrypt.compareSync(reqPassword, dbPassword[0]['password'])) {\n res.cookie('name', 'login',\n { expires: new Date(Date.now() + timeOut) });\n res.json({\n status: \"OK\",\n redirect: \"/\"\n });\n } else {\n res.json({\n status: \"WRONG\",\n });\n }\n })\n }\n }", "title": "" }, { "docid": "3a5175fb677a170af735b81a02bb8af0", "score": "0.64743704", "text": "login( request, response ) {\n\n\t\tresponse.rc.title = \"Login\";\n\n\t}", "title": "" }, { "docid": "1525bf8f0020d6a2ef9fea77bb9d6c00", "score": "0.64743334", "text": "async function login (event) {\n\n try {\n const validationStatus = loginValidation (event);\n if (validationStatus.noErrors > 0){\n throw { statusCode: 422, errorMsg: validationStatus.errors };\n }\n \n await db.connectToDB();\n const { username, password } = validationStatus;\n let userDets = await userAccount.selectUserAccountByUsername (username);\n\n if (userDets.rows === 0) {\n throw { statusCode: 404, errorMsg: {'password': \"Invalid username and password.\"} };\n }\n \n if (userDets.user[0].validated === 'N') {\n throw { statusCode: 401, errorMsg: {'password': \"You need to validate your account before login in.\"} };\n }\n\n // Check the password matches\n const isMatched = await bcrypt.compare(password, userDets.user[0].password);\n if (!isMatched) {\n throw { statusCode: 404, errorMsg: {'password': \"Invalid username and password.\"} };\n }\n \n const payload = {\n user_id:userDets.user[0].user_id\n }\n const token = utils.createToken( payload, process.env.JWT_SECRET );\n\n return { statusCode: 201, token };\n // return { statusCode: 201, message: JSON.stringify( { token } ) };\n\n } catch (err) {\n throw err;\n }\n }", "title": "" }, { "docid": "e90c06c319d054d49cc6e96a87dd5edc", "score": "0.646847", "text": "async login() {\n console.info(new Date(), 'Logging in to Moodle...');\n const loginHTML = await this._client.get(`${this._url}/login/index.php`);\n const tree = parse(loginHTML);\n const logintoken = tree\n .querySelector('.loginsub [name=\"logintoken\"]')\n .getAttribute('value');\n return this._client.post(`${this._url}/login/index.php`, {\n form: {\n logintoken,\n password: this._password,\n rememberusername: 1,\n username: this._username\n }\n });\n }", "title": "" }, { "docid": "e2a958573a51bcb578d5600f25d6d898", "score": "0.64662665", "text": "function loginUser(request, response, next) {\n console.log(\"received a request to login a user\");\n\n // ENSURE THE REQUEST IS PROPERLY FORMED\n if (!request.body.email || !request.body.password) {\n response.status(400).json({\n \"message\": \"Email or password was not specified!\"\n });\n }\n else {\n \n // LOOK UP THE USER WITH THE SPECIFIED USER\n dbService.getUser(request.body.email)\n .then( (user) => {\n // IF THE USER IS FOUND\n if (user) {\n \n // COMPARE THE PASSWORD TO THE HASH\n passwordService.comparePassword(request.body.password, user.hash)\n .then( (passwordsMatch) => {\n \n // IF THE PASSWORD MATCHES THE HASH, CREATE AND SEND A TOKEN\n if (passwordsMatch) {\n response.status(200).send({\n id_token: jwtService.createToken(user)\n })\n }\n else {\n response.status(401).json({\n message: \"The username/password combination doesn't match any users\"\n })\n }\n })\n .catch( (err) => {\n response.status(500).json({\n message: `An error ocurred: ${err}`\n })\n })\n }\n else { \n response.status(401).json({\n message: `An account matching that email could not be found`\n })\n }\n })\n .catch( (err) => {\n response.status(500).json({\n message: `An error ocurred: ${err}`\n })\n })\n }\n\n\n}", "title": "" }, { "docid": "5e850d0f09485d605c41916419ae9897", "score": "0.64660126", "text": "static login(req, res, next) {\n var _a;\n user_1.User.findOne({\n where: {\n login: (_a = req.body) === null || _a === void 0 ? void 0 : _a.login\n }\n }).then((user) => {\n var _a;\n if (!user)\n res.status(401).redirect('/');\n else {\n bcrypt.compare((_a = req.body) === null || _a === void 0 ? void 0 : _a.password, user.password).then((result) => {\n if (!result)\n res.status(401).json({ error: \"User not found.\" });\n else {\n req.session.connected = true;\n res.redirect('/monitor.html');\n }\n }).catch((error) => {\n res.status(500).json({ error: error });\n });\n }\n }).catch((error) => {\n res.status(500).json({ error: error });\n });\n }", "title": "" }, { "docid": "b9ccef1345c85c9e4df063657f4a698e", "score": "0.6463947", "text": "async function handleSubmit(evt) {\n evt.preventDefault();\n\n const result = await login(formData);\n if (result.success) {\n history.push(\"/\");\n } else {\n // TODO: Add error local state to render error alerts\n console.error(\":( Invalid credentials\");\n }\n }", "title": "" }, { "docid": "33ad306153831f9bbe0ebf677579b52e", "score": "0.6461725", "text": "async function handleOnSubmit(e) {\n e.preventDefault();\n try {\n let result = await axios.post(\"http://localhost:3001/users/login\", {\n email,\n password,\n });\n\n localStorage.setItem(\"jwtToken\", result.data.jwtToken);\n\n const decodedToken = jwtDecode(result.data.jwtToken);\n authContext.dispatch({ type: \"LOGIN\", user: decodedToken.email });\n props.history.push(\"/auth-home\");\n } catch (e) {\n console.log(e);\n }\n }", "title": "" } ]
af07b39ddf65dca885f8da300f9782d5
Add a line to the log buffer. NOTE: The line will not be rendered immediately, it will be rendered in the next tick so that multiple lines added in one tick will be rendered efficiently together.
[ { "docid": "a2a9241770c08e9012a37dc2ea6f8ed3", "score": "0.65222514", "text": "log(...args) {\n let text = util.format(...args);\n this.emit('log', text);\n if (! this.content) {\n // Bugfix: pushLine works with an array, but not if it's empty\n this.pushLine(text);\n return;\n }\n for (let line of text.split('\\n')) {\n this.pendingLines.push(line);\n }\n if (! this.scheduledRender) {\n this.scheduledRender = true;\n process.nextTick(() => {\n this.scheduledRender = false;\n this.pushLine(this.pendingLines);\n this.pendingLines = [];\n if (this._clines.fake.length > this.scrollback) {\n this.shiftLine(this._clines.fake.length - this.scrollback);\n }\n });\n }\n }", "title": "" } ]
[ { "docid": "f312373185c99a59a46d9583a91bae17", "score": "0.71541125", "text": "addLogLine(entry) {\n this.log.value = entry + \"\\n\" + this.log.value;\n }", "title": "" }, { "docid": "1b72035ecf8ce1c12b2db6f897b0d3a1", "score": "0.6854267", "text": "_addLine(line) {\n //line.initProgram(this.webgl);\n line._vbuffer = this.webgl.createBuffer();\n this.webgl.bindBuffer(this.webgl.ARRAY_BUFFER, line._vbuffer);\n this.webgl.bufferData(this.webgl.ARRAY_BUFFER, line.xy, this.webgl.STREAM_DRAW);\n this.webgl.bindBuffer(this.webgl.ARRAY_BUFFER, line._vbuffer);\n line._coord = this.webgl.getAttribLocation(this.progThinLine, \"coordinates\");\n this.webgl.vertexAttribPointer(line._coord, 2, this.webgl.FLOAT, false, 0, 0);\n this.webgl.enableVertexAttribArray(line._coord);\n }", "title": "" }, { "docid": "30addd0c554b062db0e7fe9aa54bbba0", "score": "0.64790833", "text": "appendLine(line) {\n return this._insertLineAndChildren(line)\n }", "title": "" }, { "docid": "e59548fea96abaef372892662630b45a", "score": "0.63017774", "text": "function pushBuffer () {\n console.debug(`Push lineate buffer: ${bufferIdx} n: ${nStrings} avg: ${avgString.toFixed(1)} remain: ${lineateBufferSize - bufferIdx}`)\n stream.push(buffer.slice(0, bufferIdx))\n resetBuffer()\n }", "title": "" }, { "docid": "9737cd2179879a6f7b133aea737864da", "score": "0.6255413", "text": "function new_line() {\n const line = dom.create('pre')\n line.appendChild(dom.text(' '))\n line.classList.add('line')\n append_stdout(line)\n components.bottom_offset.scrollIntoView()\n }", "title": "" }, { "docid": "f8532815229e7f640fcf01ff35aa1180", "score": "0.62505776", "text": "function addLine(y) {\n gMeme.lines.push({\n id: gMeme.lines.length,\n pos: { x: CANVSA_WIDTH / 2, y: y },\n txt: DEF_TXT,\n size: DEF_LINE_SIZE,\n align: DEF_LINE_ALIGN,\n color: DEF_LINE_COLOR,\n frameColor: DEF_LINE_FRAME_COLOR,\n font: DEF_FONT\n });\n}", "title": "" }, { "docid": "62afbffe528acbbf5a31c3f356c64c19", "score": "0.6248818", "text": "appendLine( div, position=this.lines.length ) {\n this.el.appendChild( div );\n\n if ( position > this.lines.length ) {\n this.lines.push( div );\n } else {\n this.lines.splice( position, 0, div );\n this.resetLines();\n }\n\n // Sort out tatty size\n this.setSize();\n\n this.showLastLine();\n }", "title": "" }, { "docid": "9b1706813e608131835151883917a0b9", "score": "0.62387747", "text": "_logLine(log, string, isHighlight) {\n const line = document.createElement(\"pre\");\n // Check if scroll is near bottom\n const autoScrollOn =\n log.scrollTop + log.offsetHeight > log.scrollHeight - 10;\n\n if (isHighlight) {\n line.className = \"highlight\";\n }\n\n line.textContent = string;\n\n log.appendChild(line);\n\n if (autoScrollOn) {\n log.scrollTop = log.scrollHeight;\n }\n }", "title": "" }, { "docid": "7827c7aca9d9e2e9bbec75cf71921b2a", "score": "0.6195031", "text": "withLineAppended(line) {\n let newChunk = new Chunk(null, this.costFunc);\n newChunk.lines = this.lines.push(line);\n return newChunk;\n }", "title": "" }, { "docid": "5a1f4df8c78b1083e43acdd6492b095b", "score": "0.6140676", "text": "function addLine() {\n const line = {\n txt: 'you know!!',\n size: 50,\n family: 'Arial',\n align: 'left',\n color: 'white',\n stroke: 'black',\n txtAlign: 'center',\n idx: 50,\n idy: 300,\n isDragging: false\n }\n gMeme.lines.unshift(line);\n}", "title": "" }, { "docid": "4ed3d112beabefd78adb0aa984596862", "score": "0.6098777", "text": "function addLine() {\n let txtToPush = Object.assign({}, gMeme.txts[0])\n gMeme.txts.push(txtToPush)\n document.querySelector('.text-input').value = \"\"\n gMeme.txts[gCurrIdx + 1].str = 'type here'\n changeStart()\n let elInputs = document.querySelectorAll('[data-idx]')\n elInputs.forEach(input => {\n input.dataset.idx++\n })\n gCurrIdx++\n document.querySelector('#curr-idx').innerText = 'Line :' + (gCurrIdx + 1)\n document.querySelector('.color-input').value = '#ffffff';\n renderText()\n}", "title": "" }, { "docid": "01cc523c9678401db3681bb6a01dd3c4", "score": "0.6034737", "text": "function addToHistory(line) {\n history.push(line);\n restoreText = '';\n }", "title": "" }, { "docid": "765f94b5e16f8fe6005cc72afe227f84", "score": "0.60314816", "text": "function line(timestamp) {\n\n ctx.clearRect(0, 0, canvasWidth, canvasHeight);\n drawLine();\n w = w+2;\n z = z+2;\n\n // making sure that the line stays in the canvas boundaries\n if (w + nw > canvasWidth || w + nw < nw) {\n nw = -nw\n }\n\n if (z + nz > canvasHeight || z + nz < nz) {\n nz = -nz\n }\n\n w += nw;\n z += nz;\n\n window.requestAnimationFrame(line);\n}", "title": "" }, { "docid": "85a0a9948487024427aa2aee779f8e26", "score": "0.6019151", "text": "addLine() {\r\n const _self = this\r\n this.lineElement = $('<div></div>').addClass('linea line-' + this.line)\r\n this.lineElement.attr('contenteditable', 'true')\r\n\r\n if (this.line > 0 || !this.modoEscritura) {\r\n this.oldLine = $('.linea:focus')\r\n this.oldLine.removeAttr('contenteditable')\r\n this.oldLine.after(this.lineElement)\r\n } else {\r\n this.dom.$editor.append(this.lineElement)\r\n }\r\n\r\n this.lineElement.html('')\r\n setTimeout(() => {\r\n _self.lineElement.html(''), 1\r\n })\r\n this.line++\r\n this.endTyping()\r\n }", "title": "" }, { "docid": "73355664ebc4e194e99ac3ec28511845", "score": "0.5937274", "text": "function addNewLine() {\n createLine();\n drawCanvas();\n}", "title": "" }, { "docid": "854038e76db97ae41e6668cde6f8d8ff", "score": "0.59287703", "text": "function addToHistory(line){\n history.push(line);\n restoreText = '';\n }", "title": "" }, { "docid": "651b3901040bd9f5dde5b7c74d8f1b58", "score": "0.592214", "text": "AddLog(fmt) {\r\n let old_size = this.Buf.size();\r\n // va_list args;\r\n // va_start(args, fmt);\r\n // Buf.appendfv(fmt, args);\r\n // va_end(args);\r\n this.Buf.append(fmt);\r\n for (const new_size = this.Buf.size(); old_size < new_size; old_size++)\r\n if (this.Buf.Buf[old_size] === \"\\n\")\r\n this.LineOffsets.push_back(old_size + 1);\r\n if (this.AutoScroll)\r\n this.ScrollToBottom = true;\r\n }", "title": "" }, { "docid": "8c809736e816428787190ef675957a33", "score": "0.59183097", "text": "_enterDrawLineOnBuffer() {\n // tw: reset attributes when starting pen drawing\n this._resetAttributeIndexes();\n\n const gl = this._renderer.gl;\n twgl.bindFramebufferInfo(gl, this._framebuffer);\n gl.viewport(0, 0, this._size[0], this._size[1]);\n const currentShader = this._lineShader;\n gl.useProgram(currentShader.program);\n twgl.setBuffersAndAttributes(gl, currentShader, this._lineBufferInfo);\n const uniforms = {\n u_skin: this._texture,\n u_stageSize: this._size\n };\n twgl.setUniforms(currentShader, uniforms);\n }", "title": "" }, { "docid": "6bd1d4286d261a16a91a78eda80a9b82", "score": "0.58516943", "text": "function addToken(token) {\n if (currentLine === undefined) {\n currentLine = new Line(lineNum);\n }\n currentLine.tokens.push(token);\n }", "title": "" }, { "docid": "a0b0d122f6dad26e8df6d7c70846c021", "score": "0.58493996", "text": "addLineToLinesDrawn() {\n if (!Array.isArray(this._currentLineCoordinates)) throw Error('Line coordinates must be an array')\n this._linesDrawn.push(this._currentLineCoordinates)\n }", "title": "" }, { "docid": "c01b22fc97d1149d51b52bc833b30651", "score": "0.57834536", "text": "embedLine(line)\n {\n this.postProcessor.embedAnotherPolyline(line);\n }", "title": "" }, { "docid": "458b153b432b04347a9b9f76b31f4f05", "score": "0.5774025", "text": "function log (line) {\n\t\tconsole.log(line);\n\t}", "title": "" }, { "docid": "756c779013e6842d6fdbb9f361968a92", "score": "0.57465035", "text": "function handleLine (line_) {\n\tconsole.assert (typeof (line_) === 'string');\n\n\tif (line_.length === 0)\n\t\treturn;\n\n\tif (! startsWith ('$', line_))\n\t\tugly.queuedCommands.push (line_);\n\telse if (startsWith ('$END_', line_)) {\n\t\trequestAnimationFrame (processQueuedCommands);\n\t}\n}", "title": "" }, { "docid": "64401d6a909a24ab7f21bc118118dffe", "score": "0.56967914", "text": "function line(...args) {\n return add(args)\n}", "title": "" }, { "docid": "6eddb9bc973e43f984783ad5ae4752f5", "score": "0.5673972", "text": "function log (line) {\n console.log.apply(console, line)\n}", "title": "" }, { "docid": "78b4fde4abb1da92d1e49730510e821d", "score": "0.56454676", "text": "function addLine(pConfLine, pIndex) {\n var myCanvas = myCanvasContainer.svg().svg(\"get\"),\n g = myCanvasContainer.find(\"#linesOverlay\").svg(),\n myElemId = \"line_\" + gCountLines++,\n myLine = null,\n myLineHandlers = null;\n if (gIsDrawingLine) {\n if (pConfLine.points.length > 1) {\n // We're adding a segment to the line\n myElemId = \"line_\" + --gCountLines;\n gCurrentConf.lines.pop();\n }\n var myLineProps = {};\n for (var myLinePropName in pConfLine.props) {\n switch (myLinePropName) {\n case \"marker-start\":\n case \"marker-end\":\n myLineProps[myLinePropName] = \"url(#\" + pConfLine.props[myLinePropName] + \")\";\n break;\n default:\n myLineProps[myLinePropName] = pConfLine.props[myLinePropName];\n break;\n }\n }\n myLine = myCanvas.polyline(g, pConfLine.points, myLineProps);\n for (var myLinePropName in pConfLine.style) {\n $(myLine).css(myLinePropName, pConfLine.style[myLinePropName]);\n }\n $(myLine).addClass(\"drawing\");\n $(myLine).attr(\"id\", myElemId);\n gCurrentLine = myLine;\n }\n // Update serialization\n myLine = $(myLine);\n var myHandlersHtml = \"\";\n for (var myPointIndex in pConfLine.points) {\n myHandlersHtml += \"<div class=\\\"handler point\" + myPointIndex + \"\\\" rel=\\\"\" + myPointIndex + \"\\\" style=\\\"left:\" + (pConfLine.points[myPointIndex][0] + myCanvasContainer[0].offsetLeft - 8) + \"px;top:\" + (pConfLine.points[myPointIndex][1] + myCanvasContainer[0].offsetTop - 8) + \"px\\\"></div>\";\n }\n myLine.on(\"mouseenter\", function(e) {\n if (!gIsDrawingLine) {\n myLineHandlers = $(\"#lineHandlers\").empty().html(myHandlersHtml).show().find(\".handler\");\n myLineHandlers.on(\"mouseenter\", function(e) {\n myContextMenuLine.css(\"top\", $(this).css(\"top\")).css(\"left\", $(this).css(\"left\"))\n .attr(\"rel\", myLine.attr(\"id\"));\n myContextMenuLine.data(\"point-index\", $(this).attr(\"rel\") * 1);\n myContextMenuLine.show();\n // Keep menu open for 200ms\n preventClosingContextMenu = true;\n timeoutIdContextMenu = window.setTimeout(function() {\n preventClosingContextMenu = false;\n }, 200);\n });\n gCurrentElement = pConfLine;\n }\n }).on(\"mouseleave\", function(e) {\n if (!preventClosingContextMenu) {\n myContextMenuLine.hide();\n $(\"#lineHandlers\").hide();\n }\n });\n if (!gIsImporting) {\n gCurrentConf.lines.push(pConfLine);\n myLine.data(\"index\", gCurrentConf.lines.length - 1);\n } else {\n myLine.data(\"index\", pIndex);\n }\n }", "title": "" }, { "docid": "76d8af418c0f570e940ce6243849c5e1", "score": "0.561303", "text": "extend_line (distance) {\n if (this.line.length === 0) {\n this.lines.push(this.line);\n }\n if (this.line.length > 0 && this.line[0].color == this.colors[0]) {\n // extend existing/current same-color section\n if (distance === EOL) {\n this.line[0].distance = EOL;\n } else {\n this.line[0].distance += distance;\n }\n } else {\n this.line.unshift({distance, color: this.colors[0]});\n }\n if (distance === EOL) {\n this.line = [];\n }\n }", "title": "" }, { "docid": "ae9a92e7f7b84d8ba489cf8ca5500a57", "score": "0.5594344", "text": "function addToLog(msg) {\n var date = new Date();\n var time;\n var hours = pad2(date.getHours());\n var minutes = pad2(date.getMinutes());\n var seconds = pad2(date.getSeconds());\n time = hours + \":\" + minutes + \":\" + seconds + \" \";\n document.getElementById(\"log\").value += time + msg + \"\\n\";\n\n showmessagetag();\n\n if (scrollToBottom) {\n document.getElementById(\"log\").scrollTop =\n document.getElementById(\"log\").scrollHeight;\n }\n}", "title": "" }, { "docid": "ae8186412de222b7badc492e61211ba3", "score": "0.5589549", "text": "addToLineResult(lineResult, lines, line, lineWidth, breakType) {\n let info = new LineInfo();\n info.text = line;\n info.width = lineWidth;\n info.lineType = breakType;\n lines.push(info);\n let size = lineResult.actualSize;\n size.height += this.getLineHeight();\n size.width = Math.max(size.width, lineWidth);\n lineResult.size = size;\n }", "title": "" }, { "docid": "523f12488b001db06a3d072ca6c26429", "score": "0.5576817", "text": "addLineTo(x, y) {\n if (this.closed) {\n return this;\n }\n const newPoint = new Vector2_1.Vector2(x, y);\n const previousPoint = this._points[this._points.length - 1];\n this._points.push(newPoint);\n this._length += newPoint.subtract(previousPoint).length();\n return this;\n }", "title": "" }, { "docid": "042ac63fcf56cae34c19a3386310a7a9", "score": "0.55720186", "text": "withLineAdded(line) {\n // look for the first handle that's bigger than the line's handle\n let i = this.lines.findIndex(l => l.handle > line.handle);\n if (i == -1) {\n i = this.lines.size();\n }\n\n // that becomes our insertion point, as everything at or after the index\n // just gets moved up by one\n let newChunk = new Chunk(null, this.costFunc);\n newChunk.lines = this.lines.splice(i, 0, line);\n\n return newChunk;\n }", "title": "" }, { "docid": "a7ddf3723d85fc2b778fd93c7c1ea75b", "score": "0.5529648", "text": "function append(str) {\n if(this.stringify && (this.comment && str.source)) {\n try {\n str = JSON.stringify(str, undefined, this.indent) + EOL;\n }catch(e) {\n /* istanbul ignore next: not going to mock circular reference */\n return e;\n }\n }\n this.push(str);\n if(this.buffer !== undefined) {\n this.buffer += str; \n }\n}", "title": "" }, { "docid": "1597e1db18d592e5be9309fdfb4c373a", "score": "0.55177826", "text": "insertLine() {\n this._code.splice(__WEBPACK_IMPORTED_MODULE_1__global_Helper__[\"a\" /* default */].rand(this._code.length), 0, __WEBPACK_IMPORTED_MODULE_4__Num__[\"a\" /* default */].get());\n this._reset();\n }", "title": "" }, { "docid": "6f421da3986cae74e538e2347ab7a155", "score": "0.5510875", "text": "function addLine() {\n\toptions.shift(); //remove first element from command\n\tvar allLine = options.join(' ') ; //wrap all command as one line\n\tfs.appendFileSync('todo.txt', allLine + '\\n', 'utf8'); // append the new line to list\n\tlistTodos(); // show the new list\n}", "title": "" }, { "docid": "efa0e5295969f4c2319a9e0d46818617", "score": "0.55046546", "text": "function appendLog(logText) {\n var log = document.getElementById(\"log\");\n log.value = log.value + logText + \"\\n\"\n}", "title": "" }, { "docid": "e2510554bb1a5991258a30aef0253960", "score": "0.55020046", "text": "startLine(event){\n this.art.push({\n tool: 'line',\n x1: event.clientX, y1: event.clientY,\n x2: event.clientX, y2: event.clientY,\n stroke: this.stroke,\n strokeWidth: this.strokeWidth != 0 ? this.strokeWidth : 1, // line should at least have 1 stroke width\n linecap: this.linecap\n });\n }", "title": "" }, { "docid": "878aa9ecc7c6f9a5c05b44c4dbabd6a4", "score": "0.5497337", "text": "function addToLog(aMessage){\r\n//\tvar p = document.getElementById('debug');\r\n//\tif(p) p.innerHTML += '<br />' + aMessage;\r\n}", "title": "" }, { "docid": "2034bd23c5e71856849425e0d2b0ef45", "score": "0.5475591", "text": "function addLine(prevLocation, currentLocation, color, weight) {\n var latlngs = [prevLocation, currentLocation];\n var polyline = L.polyline(latlngs, {\n color: color,\n weight: weight,\n opacity: 0.4,\n\n }).addTo(lineGroup);\n\n}", "title": "" }, { "docid": "54ad19d4e1f8c88da2bec43e4b6d08b8", "score": "0.5462615", "text": "function log(str, newLine = true) {\n if (typeof str !== 'string') {\n process.stdout.write('\\nError to display log ' + typeof str);\n return;\n }\n if (newLine) {\n process.stdout.write('\\n');\n } else {\n readline.clearLine(process.stdout, 0);\n readline.cursorTo(process.stdout, 0);\n }\n process.stdout.write(str);\n}", "title": "" }, { "docid": "5f2a575b66c166f2c65552a5b17a2a40", "score": "0.5458175", "text": "function addStringToBuffer (str, enc) {\n const len = Buffer.byteLength(str, enc)\n accumulateStringLength(len)\n if (len > lineateBufferSize) {\n if (len > lineateBufferSize * 2) {\n console.error(`WARNING: Lineate string is more than twice the buffer size`)\n }\n // String exceeds buffer size. Push the current buffer,\n // push the entire string as a buffer, and reset the buffer\n pushBuffer()\n console.debug(`Push lineate large string: len: ${len}`)\n stream.push(Buffer.from(str, enc))\n return\n }\n if (len + bufferIdx > lineateBufferSize) {\n // Buffer cannot contain the string, push it and create a new one\n pushBuffer()\n }\n bufferIdx += buffer.write(str, bufferIdx, enc)\n }", "title": "" }, { "docid": "e68304aa34f88882fe40d09bf47a918c", "score": "0.5447179", "text": "function line(e) {\n console.log(\"HERE!\");\n let pos = getMouseCoordsOnCanvas(canvas, e);\n let attr = getLineAttributes();\n console.log(\"Start: \" + c.startPos.x + \", \" + c.startPos.y);\n console.log(\"Ends: \" + c.currentPos.x + \", \" + c.currentPos.y);\n let data = {\n sPos: {x: c.startPos.x, y: c.startPos.y},\n ePos: pos,\n attr: attr\n }\n c.beginPath(); \n socket.emit('mousePos', data);\n \n }", "title": "" }, { "docid": "44ee1f629cbd38ed861a2ddcee21a5fa", "score": "0.54428864", "text": "add(line) {\n this.$addAction('add', { line });\n return this;\n }", "title": "" }, { "docid": "661e0aaf404296bb041c07b200dccd26", "score": "0.54327667", "text": "replace(line) {\n this._lines[this._current] = line;\n }", "title": "" }, { "docid": "b257081722dd79bea60c5bf2293c9a4c", "score": "0.54228675", "text": "function animateLine()\n{\n if (is_drawing)\n {\n is_drawing = false;\n\n return;\n }\n\n current_audio_time = audio_context.currentTime;\n\n // set up starting position\n is_drawing = true;\n\n window.webkitRequestAnimationFrame(step);\n}", "title": "" }, { "docid": "af5436f6980a4d18e77e20cb40980dae", "score": "0.54223436", "text": "function drawLine (s) {\n\t\tif (typeof s === 'number') s = lines[s]\n\n\t\tif (!(s && s.count && s.opacity && s.positions && s.positions.length > 2)) return\n\n\t\tregl._refresh()\n\n\t\tif (s.fill && s.triangles && s.triangles.length > 2) {\n\t\t\tdrawFill(s)\n\t\t}\n\n\t\tif (!s.thickness || !s.color) return\n\n\t\ts.scaleRatio = [\n\t\t\ts.scale[0] * s.viewport.width,\n\t\t\ts.scale[1] * s.viewport.height\n\t\t]\n\n\t\t// high scale is only available for rect mode with precision\n\t\tif (s.scaleRatio[0] > precisionThreshold || s.scaleRatio[1] > precisionThreshold) {\n\t\t\tdrawRectLine(s)\n\t\t}\n\n\t\t// thin lines or too many points are rendered as simplified rect shader\n\t\telse if (s.join === 'rect' || (!s.join && (s.thickness <= 2 || s.positions.length >= maxPoints))) {\n\t\t\tdrawRectLine(s)\n\t\t}\n\t\telse {\n\t\t\tdrawMiterLine(s)\n\t\t}\n\n\t\tif (s.after) s.after(s)\n\t}", "title": "" }, { "docid": "4a3945d72b638fe6fa8ab72d3648830d", "score": "0.54178643", "text": "function addLog(logString) {\n $scope.logs.push('> ' + logString); \n maintainLogSize();\n }", "title": "" }, { "docid": "dc869d43f4a5c3913ef5ae81f039dccd", "score": "0.54173636", "text": "addLine(p1, p2) {\n this.current.lines.push(p1, p2);\n return this;\n }", "title": "" }, { "docid": "b6c25eb7b77b22dd0b86362c8c38d985", "score": "0.54102874", "text": "function drawLine (s) {\r\n\t\tif (typeof s === 'number') s = lines[s]\r\n\r\n\t\tif (!(s && s.count && s.opacity && s.positions && s.positions.length > 2)) return\r\n\r\n\t\tregl._refresh()\r\n\r\n\t\tif (s.fill && s.triangles && s.triangles.length > 2) {\r\n\t\t\tdrawFill(s)\r\n\t\t}\r\n\r\n\t\tif (!s.thickness || !s.color) return\r\n\r\n\t\ts.scaleRatio = [\r\n\t\t\ts.scale[0] * s.viewport.width,\r\n\t\t\ts.scale[1] * s.viewport.height\r\n\t\t]\r\n\r\n\t\t// high scale is only available for rect mode with precision\r\n\t\tif (s.scaleRatio[0] > precisionThreshold || s.scaleRatio[1] > precisionThreshold) {\r\n\t\t\tdrawRectLine(s)\r\n\t\t}\r\n\r\n\t\t// thin lines or too many points are rendered as simplified rect shader\r\n\t\telse if (s.join === 'rect' || (!s.join && (s.thickness <= 2 || s.positions.length >= maxPoints))) {\r\n\t\t\tdrawRectLine(s)\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdrawMiterLine(s)\r\n\t\t}\r\n\r\n\t\tif (s.after) s.after(s)\r\n\t}", "title": "" }, { "docid": "2975f5f40cd431036c47b88e5d8f27a6", "score": "0.54098207", "text": "__debugLine(line, data){\n\tconsole.log(line, data.debugFile, currentFile);\n\t\tthis.removeDebuggerMarker();\n\t\t\n\t\t// add new marker at line\n\t\tif (line && data.debugFile === currentFile){\n\t\t\tthis.editor.session.addMarker(new Range(line-1, 0, line-1, 1), \"breakpointMarker\", \"fullLine\");\n\t\t\tthis.editor.gotoLine(line, 0);\n\t\t}\n\t}", "title": "" }, { "docid": "f248a231b1c16172baea5e570f0360cf", "score": "0.54050577", "text": "function appendLine(num, content, prefix) {\n sb.append(prefix + lineNumbers[num] + ' | ' + content + '\\n');\n }", "title": "" }, { "docid": "44255db0deadd2773ecf92fb0bb5b00c", "score": "0.5400775", "text": "function updateLine(record) {\n if (!record || record.debugId < firstSessionId) {\n return;\n }\n // Optimization: only compute line number when there is a visible\n // async animation, OR, if it's one of the first 100 debug events.\n if (record.line == null && record.exception &&\n ((record.exited && record.appearCount > record.resolveCount) ||\n record.debugId - firstSessionId < 100)) {\n record.line = editorLineNumberForError(record.exception);\n }\n // TODO: schedule background computation of line numbers for debug\n // events after the first 100.\n if (record.line != null) {\n var oldRecord = lineRecord[record.line];\n if (record.appearCount > record.resolveCount) {\n lineRecord[record.line] = record;\n if (!oldRecord || !oldRecord.traced) {\n traceLine(record.line);\n }\n record.traced = true;\n } else {\n if (!oldRecord || !oldRecord.appearCount || oldRecord === record) {\n lineRecord[record.line] = record;\n if (oldRecord && oldRecord.traced) {\n untraceLine(record.line);\n }\n }\n record.traced = false;\n }\n }\n // Should we garbage-collect? Here we do:\n // The idea is this: we will only need to look up records by debugId\n // in the future when there is a future event pending. If all the\n // expected \"resolves\" have occurred and all the expected \"appears\"\n // have matching \"resolves\", and there has been an \"exit\" (matching\n // the initial \"enter\", then there should be no further events for\n // this debugId.\n if (record.resolveCount >= record.totalCount &&\n record.resolveCount >= record.appearCount &&\n record.exited) {\n delete debugIdRecord[record.debugId];\n }\n}", "title": "" }, { "docid": "72f4779cc1c08aebfe512a994d0c7058", "score": "0.53866947", "text": "_addRowLog( row ){\n\n\t\t// Adiciona horário no LOG\n\t\tlet now \t= new Date(),\n\t\t\trowTxt \t= `[${addZero( now.getHours() )}:${addZero( now.getMinutes() )}:${addZero( now.getSeconds() )}]: ${row.text}`;\n\n\t\t// Adiciona na lista do LOG\n\t\tlet newRow \t= \tdocument.createElement(\"li\");\n\n\t\tnewRow.innerHTML \t= rowTxt;\n\t\tnewRow.style.color \t= row.color ? row.color : 'white';\n\t \n\t document.getElementById( \"BoxRows\" ).appendChild( newRow ); \n\n\t\t// Deixa o scroll sempre no botttom para pegar os novos elementos sempre\n\t\tlet objDiv = document.getElementById(\"BoxRows\");\n\t\t\tobjDiv.scrollTop = objDiv.scrollHeight;\n\t}", "title": "" }, { "docid": "c83096e5fc2c29fdcb177d6a9f334e1a", "score": "0.5384847", "text": "function onAddLine() {\n addLine()\n document.querySelector('[name=\"text\"]').value = 'TYPE SOMETHING'\n renderMeme()\n}", "title": "" }, { "docid": "e5def091d6695cd601f1afff5b1f3d8f", "score": "0.5378952", "text": "function drawLine(x1, y1, x2, y2) {\n let line = document.createElement(`line`);\n\n line.setAttribute(`x1`, x1);\n line.setAttribute(`y1`, y1);\n line.setAttribute(`x2`, x2);\n line.setAttribute(`y2`, y2);\n\n let animate = document.createElement(`animate`);\n animate.setAttribute(`attributeName`, \"opacity\");\n animate.setAttribute(`from`, \"1\");\n animate.setAttribute(`to`, \"0\");\n animate.setAttribute(`dur`, \"2s\");\n animate.setAttribute(`repeatCount`, \"indefinite\");\n\n line.append(animate);\n field.append(line);\n\n}", "title": "" }, { "docid": "678edca61fe088daa05ee9ad73b7dae8", "score": "0.5365858", "text": "addPosition(x, y){\n this.positionBuffer.push({x: x, y: y, t: new Date()});\n if(this.positionBuffer.length > 2){\n this.positionBuffer.shift();\n }\n }", "title": "" }, { "docid": "b90e0f8ffaf3e41103892d99c0f54aae", "score": "0.5365239", "text": "AddLine(a, b, col, thickness = 1.0) {\r\n this.native.AddLine(a, b, col, thickness);\r\n }", "title": "" }, { "docid": "fc6b8ce529557f9aadc4151d06ab0d37", "score": "0.5363794", "text": "function recordLog(msg) {\n var t = new Date();\n logmsg = t + \" --- \" + msg + \"\\n\";\n fs.appendFile(clog, logmsg, function(err) {\n if (err) throw err;\n console.log(msg + ' added to log');\n });\n}", "title": "" }, { "docid": "206d268c95e5e44163cc81041090a34d", "score": "0.5342837", "text": "insertLine(row, line) {\n throw new Error('Not implemented: insertLine');\n }", "title": "" }, { "docid": "e13056e5681cfd01f198c9cf177c7996", "score": "0.5342386", "text": "function drawLine() {\n push();\n stroke(String(this.c));\n strokeWeight(this.sSize);\n line(this.x, this.y, this.x2, this.y2);\n pop();\n}", "title": "" }, { "docid": "ca973d956bab19f310388395708d19af", "score": "0.53397554", "text": "function drawLine() {\n let line = new Abschlussaufgabe.Line(coordinates[0], coordinates[1], coordinates[2], coordinates[3]);\n objects.push(line);\n console.log(\"drawLine with coordinates:\", coordinates);\n drawObjects();\n }", "title": "" }, { "docid": "81659d1173852e4048d05103601c2efb", "score": "0.533201", "text": "function append_line(d,f,t,r,l,n) {\n\tdep.push(d);\n\tfrm.push(f);\n\ttr.push(t);\n\trul.push(r);\n\tlin.push(l);\n\tcnt.push(n+1);\n\n\tvar table = document.getElementById('drvt');\n\tvar row = mkRow(cnt.length-1);\n\ttable.appendChild(row);\n\tclear_appt();\n}", "title": "" }, { "docid": "404c5e2da8df33839c8fd34563cf0268", "score": "0.5330677", "text": "function addCommentToDiffLine(side, chunkNum, line, commentIndex, author, content)\n{\n\tidString = diffLineIdFromParams(side, chunkNum, line);\n\tif(idString != \"error\")\n\t{\n\t\taddCommentToDiffElement(idString, commentIndex, author, content);\n\t}\n}", "title": "" }, { "docid": "1d8eeb5ed7538aaf765f79e1d33c63cb", "score": "0.5323118", "text": "function drawLine (yarray) {\n var line = svg.append('path').datum(yarray.toArray())\n line.attr('d', renderPath)\n yarray.observe(function (event) {\n // we only implement insert events that are appended to the end of the array\n event.values.forEach(function (value) {\n line.datum().push(value)\n })\n line.attr('d', renderPath)\n })\n }", "title": "" }, { "docid": "f2a64c6c17369802b6bc854eb1df54db", "score": "0.5317775", "text": "function addedLine(position, divid) {\n ep_activity.splice(position, 0, new Array(divid, 0));\n}", "title": "" }, { "docid": "65dcfbf9a4ed69d64db652da341831d9", "score": "0.531669", "text": "function line() {\n console.log('---------------------------------------------------------------');\n}", "title": "" }, { "docid": "e6b58f4330f6d761032f103cbdbdca40", "score": "0.530765", "text": "function paintLine()\n{\n _cvs.game.beginPath();\n _cvs.game.lineWidth = _line.width;\n _cvs.game.moveTo(_line.body[0].x, _line.body[0].y);\n \n for(var i = 1; i < _line.body.length; i++)\n _cvs.game.lineTo(_line.body[i].x, _line.body[i].y);\n \n _cvs.game.strokeStyle = getRandomColor(0, 255);\n _cvs.game.stroke();\n _cvs.game.closePath();\n}", "title": "" }, { "docid": "b0e9295a54a6a208faa0360eec058029", "score": "0.52879983", "text": "add(location, {setIndexToHead = true, message} = {}) {\n const newEntry = new Entry(location)\n if (atom.config.get(\"cursor-history.keepSingleEntryPerBuffer\")) {\n const isSameURI = entry => newEntry.URI === entry.URI\n this.entries.filter(isSameURI).forEach(destroyEntry)\n } else {\n const isAtSameRow = entry => newEntry.isAtSameRow(entry)\n this.entries.filter(isAtSameRow).forEach(destroyEntry)\n }\n\n this.entries.push(newEntry)\n\n if (setIndexToHead) {\n this.setIndexToHead()\n }\n if (atom.config.get(\"cursor-history.debug\") && message) {\n this.log(message)\n }\n }", "title": "" }, { "docid": "515fd76d1e7020dcc915353dc086db37", "score": "0.52754396", "text": "function addBreakpoint(ctx, line, cond) {\n function _addBreakpoint(ctx, line, cond) {\n let { ed, cm } = ctx;\n let meta = dbginfo.get(ed);\n let info = cm.lineInfo(line);\n\n ed.addMarker(line, \"breakpoints\", \"breakpoint\");\n meta.breakpoints[line] = { condition: cond };\n\n info.handle.on(\"delete\", function onDelete() {\n info.handle.off(\"delete\", onDelete);\n meta.breakpoints[info.line] = null;\n });\n\n ed.emit(\"breakpointAdded\", line);\n deferred.resolve();\n }\n\n if (hasBreakpoint(ctx, line))\n return;\n\n let deferred = promise.defer();\n // If lineInfo() returns null, wait a tick to give the editor a chance to\n // initialize properly.\n if (ctx.cm.lineInfo(line) === null) {\n DevToolsUtils.executeSoon(() => _addBreakpoint(ctx, line, cond));\n } else {\n _addBreakpoint(ctx, line, cond);\n }\n return deferred.promise;\n}", "title": "" }, { "docid": "0867d38347e11c2197e0d1630d24c9f3", "score": "0.52557385", "text": "function addLogEntry(logType, msg) {\n if (!isStepClosed) {\n customCommand.appendToBody(prettyMessage(logType, msg));\n }\n else {\n customCommand = new CustomCommand(`${logType} - ${msg}`, 'more info', prettyMessage(logType, msg));\n sendCustomCommand(customCommand);\n }\n }", "title": "" }, { "docid": "b42d6732d3ee5954a3fbee1e0c3b0339", "score": "0.52545595", "text": "function traceLine(line) {\n view.markPaneEditorLine(\n view.paneid('left'), line, 'guttermouseable', true);\n view.markPaneEditorLine(view.paneid('left'), line, 'debugtrace');\n}", "title": "" }, { "docid": "1b29a2af2bce0ddc27872921c4325d38", "score": "0.52469635", "text": "log(text) {\n\n this.logs.push({\n date: this.getDate() +\" / \"+ this.getTime(),\n type: \"log\",\n msg: text\n });\n\n if (this.level >= 4 && this.able) console.log(this.getDate() + \" / \" + this.getTime() + \" [Log]: \" + text);\n }", "title": "" }, { "docid": "9f0df6827027c849aefd72ae3e603d8f", "score": "0.5228665", "text": "function log(entry) {\n fs.appendFile(\"./log.txt\", entry + '\\r\\n', (error) => {\n if (error) throw error;\n });\n}", "title": "" }, { "docid": "9915cc129a962643852fe40ef8bb4517", "score": "0.5228264", "text": "function InsertLine(context_) {\n td.lineState = 'true';\n td.lineCount = 0;\n // context_.actionContext.document.showMessage(\"Line drawn\");//debugging\n}", "title": "" }, { "docid": "2aa279eafde2d5f6bc742f6877d467a5", "score": "0.5224597", "text": "function SocketLineBuffer(socket) {\n\tEventEmitter.call(this);\n\n\tthis.socket = socket;\n\tthis.buffer = \"\";\n\n\tthis.socket.on(\"data\", this.handleData.bind(this));\n}", "title": "" }, { "docid": "5403bffea434c77da22e8256800a91f4", "score": "0.5211934", "text": "function writeLine(line) {\n // if we didn't get a suggestion try again using the poem as seed text\n if (line == null && wordCount < maxWords) {\n winston.warn(\"ran out of suggestions, using poem as seed\");\n getLine(getSeed(poem), writeLine, t * 2);\n } \n\n // if we start to repeat ourself get a new seed from the poem\n if (line == lastLine) {\n winston.warn(\"got repeat\", {line: line});\n getLine(getSeed(poem), writeLine, line * 2);\n }\n\n // otherwise write the line \n else {\n console.log(line);\n winston.info(\"wrote line\", {line: line});\n\n // remember the entire text of the poem in case we need it for seed text\n poem += line + \" \";\n\n // add a stanza break\n lineCount += 1;\n if (lineCount % stanzaLines === 0) {\n console.log();\n }\n\n // write more lines?\n wordCount += line.split(' ').length;\n if (wordCount < maxWords) {\n getLine(getSeed(line), writeLine, t);\n }\n }\n}", "title": "" }, { "docid": "1d1afea2b559c34aca8a32829501ca8f", "score": "0.520983", "text": "function appendToLog(dataLog){\n var divider = \"\\n===================================\\n\\n\";\n fs.appendFile(\"log.txt\", dataLog + divider, function(err) {\n if (err) {\n return console.log(err);\n }\n console.log(\"log.txt was updated!\");\n });\n}", "title": "" }, { "docid": "29b203b37618fa0833262ae3cd7ebd4a", "score": "0.52034146", "text": "function debugLog( msg ) \n{\n\tlog.insertLine(1, msg);\n\tscreen.render();\n\treturn;\n}", "title": "" }, { "docid": "725ef514cef3cc4e0ed7a8e7cc061280", "score": "0.5196289", "text": "function drawLine (points) {\n console.log('draw line', points.value())\n var line = svg.append('path')\n .datum(points.value())\n .attr('class', 'line')\n\n line.attr('d', renderPath)\n\n // Observe changes that happen on this line\n points.on('change', lineChanged)\n\n function lineChanged (event) {\n console.log('line changed', event)\n // we only implement insert events that are appended to the end of the array\n if (event.type === 'insert') {\n line.datum().push(event.value)\n line.attr('d', renderPath)\n }\n }\n }", "title": "" }, { "docid": "250718749e8549eec6911bd17e3057c2", "score": "0.51908636", "text": "function _write(logItem) {\n console.log('>> ', utils.objToString(logItem));\n logStorage.push(logItem);\n }", "title": "" }, { "docid": "49f57a62d5c91be2124ded3c0fad81ae", "score": "0.5190423", "text": "function drawLine() {\n\t\t\tif (!started) {\n\t\t\t\ttmp_ctx.beginPath();\n\t\t\t\ttmp_ctx.moveTo(cursorX2, cursorY2);\n\t\t\t\tstarted = true;\n\t\t\t} \n\t\t\telse {\n\t\t\t\ttmp_ctx.lineTo(cursorX, cursorY);\n\t\t\t\ttmp_ctx.strokeStyle = color;\n\t\t\t\ttmp_ctx.lineWidth = width_brush;\n\t\t\t\ttmp_ctx.stroke();\n\t\t\t}\n\t}", "title": "" }, { "docid": "fd307085183f389b75567e7f0864123f", "score": "0.5184862", "text": "function addLog(choice, userInput) {\n fs.appendFile(\"./text/log.txt\", \"\\n\" + \"Command: \" + choice + \" Input: \" + userInput, function (err) {\n if (err) console.log(err);\n });\n}", "title": "" }, { "docid": "c9703f421dd0461edfb6b2c157acce00", "score": "0.5176417", "text": "function addLine() {\n let rowCount = (newPostElement.current.value.split(\"\\n\")).length;\n if (rowCount > 5 && rowCount < 13) {\n newPostElement.current.rows = rowCount;\n }\n }", "title": "" }, { "docid": "52884fe698eda5cea9057e227ade23fc", "score": "0.5169125", "text": "function drawLine(point) {\n myPath.add(point);\n myPath.smooth();\n view.draw();\n}", "title": "" }, { "docid": "aaf7483521149b03633d00be1bc62adb", "score": "0.5162798", "text": "_flushLines() {\n const gl = this._renderer.gl;\n const currentShader = this._lineShader; // If only a small amount of data needs to be uploaded, only upload part of the data.\n // todo: need to see if this helps and fine tune this number\n\n if (this.a_lineColorIndex < 1000) {\n twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_lineColor, new Float32Array(this.a_lineColor.buffer, 0, this.a_lineColorIndex), 0);\n twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_penPoints, new Float32Array(this.a_penPoints.buffer, 0, this.a_penPointsIndex), 0);\n twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_lineThicknessAndLength, new Float32Array(this.a_lineThicknessAndLength.buffer, 0, this.a_lineThicknessAndLengthIndex), 0);\n } else {\n twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_lineColor, this.a_lineColor);\n twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_penPoints, this.a_penPoints);\n twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_lineThicknessAndLength, this.a_lineThicknessAndLength);\n } // todo: if we skip twgl and do all this buffer stuff ourselves, we can skip some unneeded gl calls\n\n\n twgl.setBuffersAndAttributes(gl, currentShader, this._lineBufferInfo);\n twgl.drawBufferInfo(gl, this._lineBufferInfo, gl.TRIANGLES, this.a_lineThicknessAndLengthIndex / 2);\n\n this._resetAttributeIndexes();\n\n this._silhouetteDirty = true;\n }", "title": "" }, { "docid": "692fcc3ccf2b8e5cd6de7cc8d59fbdcd", "score": "0.5158608", "text": "function lineDrawn(lineIdx) {\n this.deps.splice(this.deps.indexOf(lineIdx), 1);\n if (this.deps.length === 0 && ctx.doDrawDots) {\n mainGroup.appendChild(ctx.outlines[this.idx]);\n mainGroup.appendChild(ctx.dots[this.idx]);\n say(`Rendering: dot ${this.idx}`);\n }\n}", "title": "" }, { "docid": "28037af0c3015efba0d139073e2fddaf", "score": "0.5140465", "text": "function addInfosToLine(line, $line) {\n\t\tvar $infos = $(\n\t\t\t'<div class=\"infos\">' +\n\t\t\t'<label class=\"modelName\">' + line['product']['model']['name'] + '</label>' +\n\t\t\t'<label class=\"sku\">' + skuFormat(line['product']['sku']) + '</label>' +\n\t\t\t'<label class=\"quantity\">' + line['quantity'] + '</label>' +\n\t\t\t'<label class=\"field\">' + label['CART_ITEM_LBL_QUANTITY'] + '</label>' +\n\t\t\t'</div>'\n\t\t);\n\n\t\t$infos.appendTo($line);\n\t}", "title": "" }, { "docid": "2809ebb18e55b47795455df0933ed958", "score": "0.5129348", "text": "onLinesInserted(fromLineNumber, toLineNumber) {\n this._checkPendingChanges();\n fromLineNumber = fromLineNumber | 0;\n toLineNumber = toLineNumber | 0;\n this._lineCount += (toLineNumber - fromLineNumber + 1);\n for (let i = 0, len = this._arr.length; i < len; i++) {\n const afterLineNumber = this._arr[i].afterLineNumber;\n if (fromLineNumber <= afterLineNumber) {\n this._arr[i].afterLineNumber += (toLineNumber - fromLineNumber + 1);\n }\n }\n }", "title": "" }, { "docid": "deaf4fe9b88039b2d1427dc00380bc4f", "score": "0.512345", "text": "function processLine(line) {\n // code to parse relevant data from log files (string manipulation)\n return line\n}", "title": "" }, { "docid": "c485876555da0cf6c0bd657ed74d3639", "score": "0.5120597", "text": "function logThis(text) {\n fs.appendFile('log.txt', text + '\\n', 'utf8', (err) => {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "3e970d4a10077e388726cc90ce9bc27b", "score": "0.51179224", "text": "function CreateBuffer() {\n var line_vertices = [ // A VBO for horizontal line in a standard position. To be translated to position of mouse click \n -0.1, 0.0, 0.0,\n 0.1, 0.0, 0.0\n ];\n LineVertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, LineVertexPositionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(line_vertices), gl.STATIC_DRAW);\n LineVertexPositionBuffer.itemSize = 3; // NDC'S [x,y,0] \n LineVertexPositionBuffer.numItems = 2;// this buffer only contains A line, so only two vertices \n}", "title": "" }, { "docid": "c9d5b18cc725ac81e5816ba3b4271789", "score": "0.51124877", "text": "AddMessage( message, user, timestamp=null, type=GameConsole.MESSAGE_TYPE.MSG )\n {\n var msg = \"\"\n\n if ( this._hasMessage )\n msg = \"<br />\" \n\n if ( timestamp == null )\n timestamp = new Date().toLocaleString()\n\n message = message.replace(/\\\\n/g, \"<br />\") // convert new lines to html\n \n msg += `${timestamp} | ${user} | ${type} ${message}`\n \n this.window.innerHTML += msg\n this.bottomScrollPosition += 20 \n this.window.scrollTop = this.bottomScrollPosition\n\n this._hasMessage = true\n\n }", "title": "" }, { "docid": "b43adf2962121374702348af472a58ca", "score": "0.5109193", "text": "function append() {\n var text = \"\\n\" + process.argv.slice(2).join(\" \");\n fs.appendFile(\"log.txt\", text, function(err) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Content Added!\"); \n }\n });\n}", "title": "" }, { "docid": "9e7cbb0de2e562a24198af9fb8ffd034", "score": "0.51041573", "text": "function draw_line(e)\n{\n\t//here we have location and pen state like the color\n\t// so that can draw some lines as it moves\n\tvar locX = e.locationX;\n\tvar locY = e.locationY;\n\tvar color = getSampleColor();\n\tdrawPolyLine(locX, locY, color);\n}", "title": "" }, { "docid": "3788c22bcefb01fd588f6c786b7c1036", "score": "0.5102451", "text": "updateLines(lines) {\n const webgl = this.webgl;\n lines.forEach((line) => {\n if (line.visible) {\n webgl.useProgram(this.progThinLine);\n const uscale = webgl.getUniformLocation(this.progThinLine, \"uscale\");\n webgl.uniformMatrix2fv(uscale, false, new Float32Array([\n line.scaleX * this.gScaleX * (this.gLog10X ? 1 / Math.log(10) : 1),\n 0,\n 0,\n line.scaleY * this.gScaleY * this.gXYratio * (this.gLog10Y ? 1 / Math.log(10) : 1),\n ]));\n const uoffset = webgl.getUniformLocation(this.progThinLine, \"uoffset\");\n webgl.uniform2fv(uoffset, new Float32Array([line.offsetX + this.gOffsetX, line.offsetY + this.gOffsetY]));\n const isLog = webgl.getUniformLocation(this.progThinLine, \"is_log\");\n webgl.uniform2iv(isLog, new Int32Array([this.gLog10X ? 1 : 0, this.gLog10Y ? 1 : 0]));\n const uColor = webgl.getUniformLocation(this.progThinLine, \"uColor\");\n webgl.uniform4fv(uColor, [line.color.r, line.color.g, line.color.b, line.color.a]);\n webgl.bufferData(webgl.ARRAY_BUFFER, line.xy, webgl.STREAM_DRAW);\n webgl.drawArrays(line.loop ? webgl.LINE_LOOP : webgl.LINE_STRIP, 0, line.webglNumPoints);\n }\n });\n }", "title": "" }, { "docid": "e42a9fcd1b07118cbb0fb3012fcc63a7", "score": "0.5098049", "text": "add_dummy_line() {\n $(\".messages\").append(\" \");\n $(\".messages\").scrollTop(100000);\n }", "title": "" }, { "docid": "7236b0e656f4ee46d2debfddf6d5153d", "score": "0.50847375", "text": "async log(logRow) {\n const client = await this.queue.client;\n const logsKey = this.toKey(this.id) + ':logs';\n return client.rpush(logsKey, logRow);\n }", "title": "" }, { "docid": "16f252d2a8ea0da5ab25b3ec05877bb1", "score": "0.5076047", "text": "function quickLog (path, e) {\n var d = new Date();\n var eWrite = \"[\" + d + \" ]\";\n eWrite += \":\" + e + \"\\n\";\n\n fs.appendFileSync(path, eWrite, encoding = 'utf8');\n\n }", "title": "" }, { "docid": "463ba1cf8307b798be07626c85c91a6e", "score": "0.5072505", "text": "function appendToTerminal(logLines) {\n\tif (typeof(logLines) === 'undefined') {\n\t\treturn;\n\t}\n\n\t// Get the terminal agent\n\tlet term = document.getElementById('terminal');\n\n\t// Keep list at MAX_TERM_LEN items (prune)\n\twhile (term.firstChild && (term.childElementCount+logLines.length) > MAX_TERM_LEN) {\n\t\tterm.removeChild(term.firstChild);\n\t}\n\n\t// Add each new log line to the terminal\n\tfor (let i = 0; i < logLines.length; i++) {\n\t\tgTerminalOffset++; // remember new offset for next request (append logs)\n\t\tterm.innerHTML += \"<div>\" + logLines[i] + \"</div>\";\n\t}\n\n\t// Scroll so newest are in view\n\tterm.scrollTop = term.scrollHeight - term.clientHeight;\n}", "title": "" }, { "docid": "40fd20c1e172083b3cef867aaca3f9c9", "score": "0.50665426", "text": "function new_line(that, y_clicked, st, et)\n{\n\tif(drawActivitiesInPlace)\n\t{\n\t\treturn -1;\n\t}\n\t//using this to prefix empty lines and check\n\tlet emptyLineSign = \" \";\n\t//sanity check\n\tif (!(that && that.dataObject && that.dataObject.data))\n\t{\n\t\treturn -1;\n\t}\n\t//check that the line below is not already empty. In this case, we should not add a new line, and we \n\t//need to update only the new data, which will happen outside.\n\t//todo: improve character comparison and ideally use another way\n\t//if the line below is already empty, return 0 to signal necessary processing on the data outside.\n\tif(that.axisTickTransform[y_clicked-2]===emptyLineSign)\n\t{\n\t\treturn 0;\n\t}\n\telse\n\t{\n\t\t//add an empty line hdr on Y axis\n\t\tthat.axisTickTransform.splice(y_clicked-1, 0, emptyLineSign);\n\t\t//Update rect Y's if needed..\n\t\tfor (var i=0;i< that.dataObject.data.length;i++)\n\t\t{\n\t\t\tif (that.dataObject.data[i].y>=y_clicked)\n\t\t\t{\n\t\t\t\tthat.dataObject.data[i].y++;\n\t\t\t\tthat._reDraw();//debug only to spot changes\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}\n}", "title": "" }, { "docid": "8f1d5937e9ec783fac9f33255dfbb109", "score": "0.50604576", "text": "function appendToLog(instance, message) {\n instance.log.set(`${instance.log.get()}\\n${message}`);\n}", "title": "" } ]
294e439c8682c3d2418c329a6055148c
(protected) this op (1<<n)
[ { "docid": "88e707e43b302c2484572edf3b347150", "score": "0.0", "text": "function bnpChangeBit(n, op) {\n var r = BigInteger.ONE.shiftLeft(n)\n this.bitwiseTo(r, op, r)\n return r\n}", "title": "" } ]
[ { "docid": "0539c41e9e94e87cb269d9da4dd36479", "score": "0.67215097", "text": "function bnpChangeBit(n, op)\n{\n var r = Int128.ONE.shiftLeft(n);\n this.bitwiseTo(r, op, r);\n return r;\n}", "title": "" }, { "docid": "4896b71a968984e24b39eb3e93ee7125", "score": "0.6657043", "text": "function R1(n) { return (n<<1)|(n>>>31); }", "title": "" }, { "docid": "7f747312549ca7b385741c608690e22e", "score": "0.66545635", "text": "function bnSetBit(n)\n{\n return this.changeBit(n, op_or);\n}", "title": "" }, { "docid": "d174b2f492746fe7bf56053356d2ca5b", "score": "0.6653313", "text": "function bnpChangeBit(n,op) {\n\t var r = BigInteger.ONE.shiftLeft(n);\n\t this.bitwiseTo(r,op,r);\n\t return r;\n\t }", "title": "" }, { "docid": "440a9ff7acb7e5f1d60251140d7cbbff", "score": "0.663446", "text": "function bnpChangeBit(n,op) {\nvar r = BigInteger.ONE.shiftLeft(n);\nthis.bitwiseTo(r,op,r);\nreturn r;\n}", "title": "" }, { "docid": "440a9ff7acb7e5f1d60251140d7cbbff", "score": "0.663446", "text": "function bnpChangeBit(n,op) {\nvar r = BigInteger.ONE.shiftLeft(n);\nthis.bitwiseTo(r,op,r);\nreturn r;\n}", "title": "" }, { "docid": "440a9ff7acb7e5f1d60251140d7cbbff", "score": "0.663446", "text": "function bnpChangeBit(n,op) {\nvar r = BigInteger.ONE.shiftLeft(n);\nthis.bitwiseTo(r,op,r);\nreturn r;\n}", "title": "" }, { "docid": "440a9ff7acb7e5f1d60251140d7cbbff", "score": "0.663446", "text": "function bnpChangeBit(n,op) {\nvar r = BigInteger.ONE.shiftLeft(n);\nthis.bitwiseTo(r,op,r);\nreturn r;\n}", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "a8a4336f25e44e6a49dad08e5dd45e89", "score": "0.66343343", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "c78c71e49570ba6837988769053c9702", "score": "0.6612648", "text": "function bnpChangeBit(n,op) {\n\t var r = BigInteger.ONE.shiftLeft(n);\n\t this.bitwiseTo(r,op,r);\n\t return r;\n\t}", "title": "" }, { "docid": "c78c71e49570ba6837988769053c9702", "score": "0.6612648", "text": "function bnpChangeBit(n,op) {\n\t var r = BigInteger.ONE.shiftLeft(n);\n\t this.bitwiseTo(r,op,r);\n\t return r;\n\t}", "title": "" }, { "docid": "1872935533944f1b2300e79ce94b4344", "score": "0.66034317", "text": "function bnpChangeBit(n,op) {\n\tvar r = BigInteger.ONE.shiftLeft(n);\n\tthis.bitwiseTo(r,op,r);\n\treturn r;\n }", "title": "" }, { "docid": "0c7f4506702c3f2aff52a8ec037a53ce", "score": "0.66008925", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n }", "title": "" }, { "docid": "5333fcc5c49f1d445555096216faec2b", "score": "0.6587345", "text": "function bnpChangeBit(n, op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r, op, r);\n return r;\n }", "title": "" }, { "docid": "5333fcc5c49f1d445555096216faec2b", "score": "0.6587345", "text": "function bnpChangeBit(n, op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r, op, r);\n return r;\n }", "title": "" }, { "docid": "a552e601d13de7e201f5b27f7f845d8b", "score": "0.65850836", "text": "function solve(args){\n var n = +args[0];\n\n var index = 3;\n var bit = ((1 << index) & n) >> index ;\n\n console.log(n.toString(2));\n console.log(bit);\n}", "title": "" }, { "docid": "0cca47163dc01cac7cb022fc0527a8f0", "score": "0.65766966", "text": "function bnpChangeBit(n, op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r, op, r);\n return r;\n }", "title": "" }, { "docid": "0cca47163dc01cac7cb022fc0527a8f0", "score": "0.65766966", "text": "function bnpChangeBit(n, op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r, op, r);\n return r;\n }", "title": "" }, { "docid": "28f50c821768414d677c852edd5a0d50", "score": "0.65537393", "text": "function bnpChangeBit(n, op) {\n\t var r = BigInteger.ONE.shiftLeft(n);\n\t this.bitwiseTo(r, op, r);\n\t return r;\n\t}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "2e8e46b610177f1f4cf29933506d8548", "score": "0.6534292", "text": "function bnpChangeBit(n,op) {\n var r = BigInteger.ONE.shiftLeft(n);\n this.bitwiseTo(r,op,r);\n return r;\n}", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" }, { "docid": "3b93b29b238903bfe6589bdcd0e892ee", "score": "0.6533691", "text": "function bnSetBit(n) { return this.changeBit(n,op_or); }", "title": "" } ]
c859fe0c52d243641ab9ee5e4b2fd279
Convert a bloom filter at location `idx` in `array` into binary representation.
[ { "docid": "8f5973aae32aed6e2bed85154766aad9", "score": "0.7711283", "text": "function toBloom(array, idx) {\n if (idx < 0) {\n return 'NO_NODE_INJECTOR';\n }\n return `${binary(array, idx + 7)}_${binary(array, idx + 6)}_${binary(array, idx + 5)}_${binary(array, idx + 4)}_${binary(array, idx + 3)}_${binary(array, idx + 2)}_${binary(array, idx + 1)}_${binary(array, idx + 0)}`;\n}", "title": "" } ]
[ { "docid": "60408c881ba99d16e4e9aa740f933510", "score": "0.8099908", "text": "function toBloom(array, idx) {\n return `${binary(array, idx + 7)}_${binary(array, idx + 6)}_${binary(array, idx + 5)}_${binary(array, idx + 4)}_${binary(array, idx + 3)}_${binary(array, idx + 2)}_${binary(array, idx + 1)}_${binary(array, idx + 0)}`;\n}", "title": "" }, { "docid": "60408c881ba99d16e4e9aa740f933510", "score": "0.8099908", "text": "function toBloom(array, idx) {\n return `${binary(array, idx + 7)}_${binary(array, idx + 6)}_${binary(array, idx + 5)}_${binary(array, idx + 4)}_${binary(array, idx + 3)}_${binary(array, idx + 2)}_${binary(array, idx + 1)}_${binary(array, idx + 0)}`;\n}", "title": "" }, { "docid": "60408c881ba99d16e4e9aa740f933510", "score": "0.8099908", "text": "function toBloom(array, idx) {\n return `${binary(array, idx + 7)}_${binary(array, idx + 6)}_${binary(array, idx + 5)}_${binary(array, idx + 4)}_${binary(array, idx + 3)}_${binary(array, idx + 2)}_${binary(array, idx + 1)}_${binary(array, idx + 0)}`;\n}", "title": "" }, { "docid": "b5694968f5184e4567e310ec96cf3d9b", "score": "0.60269904", "text": "function binary(array, idx) {\n const value = array[idx];\n // If not a number we print 8 `?` to retain alignment but let user know that it was called on\n // wrong type.\n if (typeof value !== 'number')\n return '????????';\n // We prefix 0s so that we have constant length number\n const text = '00000000' + value.toString(2);\n return text.substring(text.length - 8);\n}", "title": "" }, { "docid": "b5694968f5184e4567e310ec96cf3d9b", "score": "0.60269904", "text": "function binary(array, idx) {\n const value = array[idx];\n // If not a number we print 8 `?` to retain alignment but let user know that it was called on\n // wrong type.\n if (typeof value !== 'number')\n return '????????';\n // We prefix 0s so that we have constant length number\n const text = '00000000' + value.toString(2);\n return text.substring(text.length - 8);\n}", "title": "" }, { "docid": "b5694968f5184e4567e310ec96cf3d9b", "score": "0.60269904", "text": "function binary(array, idx) {\n const value = array[idx];\n // If not a number we print 8 `?` to retain alignment but let user know that it was called on\n // wrong type.\n if (typeof value !== 'number')\n return '????????';\n // We prefix 0s so that we have constant length number\n const text = '00000000' + value.toString(2);\n return text.substring(text.length - 8);\n}", "title": "" }, { "docid": "b5694968f5184e4567e310ec96cf3d9b", "score": "0.60269904", "text": "function binary(array, idx) {\n const value = array[idx];\n // If not a number we print 8 `?` to retain alignment but let user know that it was called on\n // wrong type.\n if (typeof value !== 'number')\n return '????????';\n // We prefix 0s so that we have constant length number\n const text = '00000000' + value.toString(2);\n return text.substring(text.length - 8);\n}", "title": "" }, { "docid": "b5694968f5184e4567e310ec96cf3d9b", "score": "0.60269904", "text": "function binary(array, idx) {\n const value = array[idx];\n // If not a number we print 8 `?` to retain alignment but let user know that it was called on\n // wrong type.\n if (typeof value !== 'number')\n return '????????';\n // We prefix 0s so that we have constant length number\n const text = '00000000' + value.toString(2);\n return text.substring(text.length - 8);\n}", "title": "" }, { "docid": "b5694968f5184e4567e310ec96cf3d9b", "score": "0.60269904", "text": "function binary(array, idx) {\n const value = array[idx];\n // If not a number we print 8 `?` to retain alignment but let user know that it was called on\n // wrong type.\n if (typeof value !== 'number')\n return '????????';\n // We prefix 0s so that we have constant length number\n const text = '00000000' + value.toString(2);\n return text.substring(text.length - 8);\n}", "title": "" }, { "docid": "7eba6dad8a1df203d8ea7769aeed7138", "score": "0.5773012", "text": "static from (arrayLike, hashFns) {\n return new BloomFilter(arrayLike, hashFns)\n }", "title": "" }, { "docid": "65c1ccbb9d3259c83a3a66ee7ddb00f7", "score": "0.57232636", "text": "function fibEncodeArray(arr) {\r\n return bitsToBuf(Array.prototype.concat.apply([], arr.map(fibEncodeNum)));\r\n /*var bin = new Bin();\r\n for (var i = 0; i < arr.length; i++) {\r\n bin.push(fibEncodeNum(arr[i]));\r\n }\r\n return bin.toBuffer();*/\r\n}", "title": "" }, { "docid": "13091c130ef3ad8208a4965c6e4f819a", "score": "0.5699354", "text": "arrToBinary(arr) {\n let val = 0;\n for (let i of arr) {\n val = (((val << 8) >>> 0) | i) >>> 0;\n }\n return val;\n }", "title": "" }, { "docid": "bd20e3c5300c295fa8466342103b36f8", "score": "0.5358532", "text": "binbToHex(binarray) {\n let hex_tab = this.hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n let str = \"\";\n for (let i = 0; i < binarray.length * 4; i++) {\n str += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) +\n hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 )) & 0xF);\n }\n return str;\n }", "title": "" }, { "docid": "da6f98f8a21e1869853c8e521c3423a9", "score": "0.51796854", "text": "function toBuffer(filter) {\n assertAllowed();\n const a = Buffer.from(filter.buckets.buffer);\n const b = Buffer.alloc(1 + a.byteLength);\n b.writeUInt8(filter.numHashes, 0);\n a.copy(b, 1);\n return b;\n}", "title": "" }, { "docid": "1670ee74ed1a29cc661dd692e7d21253", "score": "0.5174759", "text": "function arrayToBinaryString(arr) {\n return arr.reverse().reduce((acc, e) => {\n return acc + (e ? '1' : '0');\n }, '');\n}", "title": "" }, { "docid": "87d21c4ccddf770ac7536554b8220fe4", "score": "0.5137069", "text": "function arr2bin(n){\n let res = 0;\n for(let i = 0; i < n.length; i++) {\n if(typeof n[i] === \"number\")\n res += n[i];\n else\n return false;\n }\n return res.toString(2);\n}", "title": "" }, { "docid": "5505ba9a4b57d2862e96ff7e551cfa5b", "score": "0.5130327", "text": "fromBits(arr) {\n let i,\n out = '',\n x;\n for (i = 0; i < arr.length; i++) {\n out += ((arr[i] | 0) + 0xf00000000000).toString(16).substr(4);\n }\n return out.substr(0, sjcl.bitArray.bitLength(arr) / 4); // .replace(/(.{8})/g, \"$1 \");\n }", "title": "" }, { "docid": "3d629aeff699a0951d5d17af0b81de70", "score": "0.51034695", "text": "function binb2hex(binarray) {\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for (var i = 0; i < binarray.length * 4; i++) {\n str += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) +\n hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8)) & 0xF);\n }\n return str;\n }", "title": "" }, { "docid": "9e3983e5133c358f43c5389901bf216e", "score": "0.50916207", "text": "function binb2hex(binarray)\r\n{\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for(var i = 0; i < binarray.length * 4; i++)\r\n {\r\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\r\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "9e3983e5133c358f43c5389901bf216e", "score": "0.50916207", "text": "function binb2hex(binarray)\r\n{\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for(var i = 0; i < binarray.length * 4; i++)\r\n {\r\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\r\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "2c35778f61c0287c8413a624eb13c3d2", "score": "0.50906384", "text": "function binb2hex(binarray)\r\n{\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for(var i = 0; i < binarray.length * 4; i++)\r\n {\r\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\r\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "e649f8d899976a325a8e83fe1a2d810c", "score": "0.50901026", "text": "function arrayMixer(array) {\n return new Array(1 << array.length)\n .fill()\n .map((e1, i) => array.filter((e2, j) => i & (1 << j)));\n}", "title": "" }, { "docid": "2f4d0cb2e2508a2570f7baa4c6e2cc36", "score": "0.50307506", "text": "function binb2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "2f4d0cb2e2508a2570f7baa4c6e2cc36", "score": "0.50307506", "text": "function binb2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "2f4d0cb2e2508a2570f7baa4c6e2cc36", "score": "0.50307506", "text": "function binb2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "2f4d0cb2e2508a2570f7baa4c6e2cc36", "score": "0.50307506", "text": "function binb2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "2f4d0cb2e2508a2570f7baa4c6e2cc36", "score": "0.50307506", "text": "function binb2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "2f4d0cb2e2508a2570f7baa4c6e2cc36", "score": "0.50307506", "text": "function binb2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "b6542dd23bbb9ea02d951854fed1c6e3", "score": "0.501768", "text": "function binb2hex (binarray) {\n var hex_tab = hexcase ? '0123456789ABCDEF' : '0123456789abcdef';\n var str = '';\n for (var i = 0; i < binarray.length * 4; i++) {\n str += hex_tab.charAt(binarray[i >> 2] >> (3 - i % 4) * 8 + 4 & 0xF) + hex_tab.charAt(binarray[i >> 2] >> (3 - i % 4) * 8 & 0xF);\n }\n return str;\n }", "title": "" }, { "docid": "b3c0b774c1b3862b512b71dd09d70623", "score": "0.50141275", "text": "function binb2hex (binarray) {\n var hex_tab = hexcase ? '0123456789ABCDEF' : '0123456789abcdef'\n var str = ''\n for (var i = 0; i < binarray.length * 4; i++) {\n str += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) +\n hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8)) & 0xF)\n }\n return str\n}", "title": "" }, { "docid": "916840d08a226989658dc7b6034dc4ad", "score": "0.49723905", "text": "function mutateToBinary(arr) {\n\tlet boardMutatedArray = [];\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tif (arr[i].className === 'grid-item true') {\n\t\t\tboardMutatedArray.push(1);\n\t\t} else {\n\t\t\tboardMutatedArray.push(0);\n\t\t}\n\t}\n\treturn boardMutatedArray;\n}", "title": "" }, { "docid": "06a108b7aaf42f1ebfc61d9994461f3c", "score": "0.4962214", "text": "function binb2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "8a3d2aaceac77a2eb4e619cde11036ee", "score": "0.49485126", "text": "function binaryCleaner(arr) {\n /*\n // Cool but a little bit large\n\n let binary = [];\n let indexes = [];\n\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] <= 1) {\n binary.push(arr[i]);\n } else {\n indexes.push(i);\n }\n }\n return [binary, indexes]\n */\n\n return [\n arr.filter(n => n <= 1),\n arr.map((n, i) => i).filter((n, i) => arr[i] > 1)\n ];\n}", "title": "" }, { "docid": "9fc1e9b45b45560db83c37f791aec399", "score": "0.49348295", "text": "function encodeModified(arr) {\n return encode(arr).map(function (x) {return x[0] == 1 ? x[1] : x;});\n}", "title": "" }, { "docid": "4578ade66939494081d4ad501b457cf1", "score": "0.49133956", "text": "function crossfilter_bitarray(n) {\n this.length = n;\n this.subarrays = 1;\n this.width = 8;\n this.masks = {\n 0: 0\n }\n\n this[0] = crossfilter_array8(n);\n}", "title": "" }, { "docid": "20290e4fd1630f3e24550ecba810cc14", "score": "0.48889613", "text": "function binb2hex(binarray)\n{\n\tvar hex_tab = hexCase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n\tvar str = \"\";\n\tvar length = binarray.length * 4;\n\n\tfor(var i = 0; i < length; i++)\n\t\tstr += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\n\t\t\thex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8)) & 0xF);\n\n\treturn str;\n}", "title": "" }, { "docid": "cde1217c9eee475d8339cb8be89e017d", "score": "0.48654917", "text": "static convertWordArrayToByteArray(arr) {\n return util_1.Util.convertInt32ArrayToUint8Array(arr.words);\n }", "title": "" }, { "docid": "e6c67455cab02ef34d02dbdc59e0df27", "score": "0.4850404", "text": "function fromBitArrayCodec(arr) {\n var out = [], bl = sjcl.bitArray.bitLength(arr), i, tmp;\n for (i=0; i<bl/8; i++) {\n if ((i&3) === 0) {\n tmp = arr[i/4];\n }\n out.push(tmp >>> 24);\n tmp <<= 8;\n }\n return out;\n}", "title": "" }, { "docid": "560896144281090c22f68cf7654ca0b4", "score": "0.47959304", "text": "function BloomFilter(a, k) {\r\n var m = a.length * 32;\r\n\r\n var n = Math.ceil(m / 32),\r\n i = -1;\r\n this.m = m = n * 32;\r\n this.k = k;\r\n\r\n var buckets = this.buckets = [];\r\n while (++i < n) buckets[i] = a[i];\r\n this._locations = [];\r\n }", "title": "" }, { "docid": "003248daa80c2d7667dce88b347d5461", "score": "0.47875392", "text": "function arrayToBinstr (a) {\n const s = []\n const len = a.length\n let i\n let c\n for (i = 0; i < len; i += 1) {\n c = a[i]\n if (c > 0xff) {\n throw new RangeError('Invalid byte value')\n }\n s.push(String.fromCharCode(c))\n }\n return s.join('')\n }", "title": "" }, { "docid": "a8afa8dee8f688c9888bb8228295fd09", "score": "0.47765034", "text": "function convertToBinary(addressArr){\n //console.log(\"here\");\n addressArr.forEach(function(element){\n temp = parseInt(element, 10);\n //console.log(\"temp is \" + temp);\n if(temp == 0){\n bin = \"00000000\";\n }else{\n while(temp > 0){\n if(temp >= binaryCheck[idx]){\n temp = temp - binaryCheck[idx];\n bin += \"1\";\n }else{\n bin += \"0\";\n }\n idx++;\n }\n for(var i = idx;i < 8;i++){\n bin += \"0\";\n }\n idx = 0;\n }\n //console.log(bin);\n binAddress += bin + \".\";\n bin = \"\";\n temp = 0;\n });\n return binAddress.substring(0, binAddress.length - 1);\n}", "title": "" }, { "docid": "d737187ae61e80d7e4a13cadca77e89d", "score": "0.47404215", "text": "function binl2hex(binarray)\r\r{\r\r var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\r var str = \"\";\r\r for(var i = 0; i < binarray.length * 4; i++)\r\r {\r\r str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\r\r hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\r\r }\r\r return str;\r\r}", "title": "" }, { "docid": "721f9a2796f1bc564cc6c0bb8a5edf74", "score": "0.47395945", "text": "function filter (array, cb) {\n let result = [];\n for (let i = 0; i < array.length; i++) {\n let input = array[i]\n if (cb(array[i])) {\n result.push(input);\n };\n };\n return result;\n}", "title": "" }, { "docid": "5ca5346a579ecda5314329aab4e43b41", "score": "0.47373825", "text": "function array(encoder,value){var length=value.length;var type=length<16?0x90+length:length<=0xFFFF?0xdc:0xdd;token[type](encoder,length);var encode=encoder.codec.encode;for(var i=0;i<length;i++){encode(encoder,value[i]);}}// bin 8 -- 0xc4", "title": "" }, { "docid": "3f9096fe8fe2eb6074bdf3446e0ac62f", "score": "0.47353727", "text": "function BloomFilter()\n\t{\n\t core.AbstractFilter.call(this);\n\n\t this.blurXFilter = new BlurXFilter();\n\t this.blurYFilter = new BlurYFilter();\n\n\t this.defaultFilter = new core.AbstractFilter();\n\t}", "title": "" }, { "docid": "f98bb5943e34a10227839385a2aa781e", "score": "0.47275355", "text": "function binl2hex(binarray)\n{\nvar hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\nvar str = \"\";\nfor(var i = 0; i < binarray.length * 4; i++)\n{\nstr += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\nhex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n}\nreturn str;\n}", "title": "" }, { "docid": "9da97c4a76ba3b1ba081aa8e63513174", "score": "0.46869707", "text": "function convertToFilters(array){\r\n var newObjects = {};\r\n newObjects = [];\r\n angular.forEach(array, function(value) {\r\n newObjects.push(new Filter(value));\r\n });\r\n return newObjects;\r\n }", "title": "" }, { "docid": "fc642c359716f5d0ef5a8989d0751374", "score": "0.46763754", "text": "function createBlurFilter(size){\n var a = [];\n for(var i = 0; i < size * size; i++){\n a.push(1 / (size * size));\n }\n return a;\n }", "title": "" }, { "docid": "e066d4e8a60a265cb43d10c24e64db33", "score": "0.46486145", "text": "function binl2hex(binarray)\r\n{\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for(var i = 0; i < binarray.length * 4; i++)\r\n {\r\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\r\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "e066d4e8a60a265cb43d10c24e64db33", "score": "0.46486145", "text": "function binl2hex(binarray)\r\n{\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for(var i = 0; i < binarray.length * 4; i++)\r\n {\r\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\r\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "e066d4e8a60a265cb43d10c24e64db33", "score": "0.46486145", "text": "function binl2hex(binarray)\r\n{\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for(var i = 0; i < binarray.length * 4; i++)\r\n {\r\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\r\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "e066d4e8a60a265cb43d10c24e64db33", "score": "0.46486145", "text": "function binl2hex(binarray)\r\n{\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for(var i = 0; i < binarray.length * 4; i++)\r\n {\r\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\r\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "e066d4e8a60a265cb43d10c24e64db33", "score": "0.46486145", "text": "function binl2hex(binarray)\r\n{\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var str = \"\";\r\n for(var i = 0; i < binarray.length * 4; i++)\r\n {\r\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\r\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\r\n }\r\n return str;\r\n}", "title": "" }, { "docid": "4425782b5a6f0872a74663774bc5cc0e", "score": "0.46483156", "text": "function compact(array) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__[\"a\" /* default */])(array, Boolean);\n}", "title": "" }, { "docid": "16bd09609a269a63f25359468b40e181", "score": "0.46368223", "text": "createBloomFilter (filterData) {\n let bloom = new BloomFilter(filterData.totalEntries, filterData.errorRate)\n let buffer = Buffer.from(filterData.data, 'base64')\n bloom.importData(buffer)\n return bloom\n }", "title": "" }, { "docid": "fb2760f695362dbacefb1956fc666a72", "score": "0.46367195", "text": "function binaryToDecimal(binArr) {\n\n //Mapping function\n function toInteger(num, index) {\n if (num == 0) return 0;\n else {\n num = Math.pow(2, index);\n return num;\n }\n }\n\n //Reducing function\n function sumIntegers(acc, val) {\n acc += val;\n return acc;\n }\n let result = binArr.reverse().map(toInteger).reduce(sumIntegers);\n return result;\n}", "title": "" }, { "docid": "358f804565254446b8e3734e136c0d61", "score": "0.46364018", "text": "function dotbin(array, step, smooth, f) {\n f = f || (_ => _);\n const n = array.length, v = new Float64Array(n);\n let i = 0, j = 1, a = f(array[0]), b = a, w = a + step, x;\n for (; j < n; ++j) {\n x = f(array[j]);\n if (x >= w) {\n b = (a + b) / 2;\n for (; i < j; ++i) v[i] = b;\n w = x + step;\n a = x;\n }\n b = x;\n }\n b = (a + b) / 2;\n for (; i < j; ++i) v[i] = b;\n return smooth ? smoothing(v, step + step / 4) : v;\n }", "title": "" }, { "docid": "f341fd821b84137da9c2034a9842c537", "score": "0.463308", "text": "function binl2hex(binarray) {\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for (var i = 0; i < binarray.length * 4; i++) {\n str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +\n hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "d7fe50b91a537c44763348e986d24f1b", "score": "0.4626002", "text": "function filterFunction(value, index, array) {\n return y[index] > 0;\n }", "title": "" }, { "docid": "aefae6d3ca25272e50f7b195eecee5ab", "score": "0.46241888", "text": "function compact(array) {\n return Object(_filter_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(array, Boolean);\n}", "title": "" }, { "docid": "a559659c952b835ad1f0506944f7a5e9", "score": "0.461265", "text": "function compact(array) {\n return (0,_filter_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(array, Boolean);\n}", "title": "" }, { "docid": "645e87873b3a4dcb0f6e0d35e46e0b19", "score": "0.46121714", "text": "function nibblesToBuffer (arr) {\n var buf = new Buffer(arr.length / 2)\n for (var i = 0; i < buf.length; i++) {\n var q = i * 2\n buf[i] = (arr[q] << 4) + arr[++q]\n }\n return buf\n}", "title": "" }, { "docid": "645e87873b3a4dcb0f6e0d35e46e0b19", "score": "0.46121714", "text": "function nibblesToBuffer (arr) {\n var buf = new Buffer(arr.length / 2)\n for (var i = 0; i < buf.length; i++) {\n var q = i * 2\n buf[i] = (arr[q] << 4) + arr[++q]\n }\n return buf\n}", "title": "" }, { "docid": "1f5c0560a39dceeff7742f4c3902aaaf", "score": "0.45963317", "text": "function binl2hex(binarray) {\n let hexTab = hexcase ? '0123456789ABCDEF' : '0123456789abcdef'\n let str = ''\n for (let i = 0; i < binarray.length * 4; i++) {\n str += hexTab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) +\n hexTab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF)\n }\n return str\n }", "title": "" }, { "docid": "1eaf83c5e19fa4147ba991c723809979", "score": "0.45946962", "text": "function balanceIndex(arr) {}", "title": "" }, { "docid": "11fb61f8fad49c0ce4e4554ed255cce8", "score": "0.45940515", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n   hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "7a73e38bf03ea1686b657549e23e40d1", "score": "0.45747787", "text": "function convertFilter(filter) {\n\t\tif (filter[\"xsi:type\"] != 'sawx:logical') {\n\t\t\tcode = filter.expr[0].text;\n\t\t\tvalue = filter.expr[1].text;\n\t\t\ttype = filter.expr[1][\"xsi:type\"].replace('xsd:','');\n\t\t\tbiFilter = new obiee.BIFilter(code, value, filter.op, type);\n\t\t\treturn biFilter;\n\t\t} else {\n\t\t\tvar subFilter = filter.expr;\n\t\t\tvar filterList = [];\n\t\t\tfor (var j=0; j < subFilter.length; j++) {\n\t\t\t\tfilterList.push(convertFilter(subFilter[j]));\n\t\t\t}\n\t\t\tvar biFilterGroup = new obiee.BIFilterGroup(filterList, filter.op);\n\t\t\treturn biFilterGroup;\n\t\t}\n\t}", "title": "" }, { "docid": "c1479f98bc10d9fae16969469603fb04", "score": "0.4573151", "text": "function bouncer(arr) {\n return arr.filter(Boolean)\n}", "title": "" }, { "docid": "a4acb138447ad16806d9052de2c76e3a", "score": "0.4569941", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.456757", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.456757", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.456757", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.456757", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.456757", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "1a891040a2f0e055d143ce852af62498", "score": "0.456757", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "d1cfc41cb5c6b8aef6bd5033a179a4b0", "score": "0.45572644", "text": "function binl2hex(binarray)\n{\n var hex_tab = hexcase ? '0123456789ABCDEF' : '0123456789abcdef';\n var str = '';\n for (var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 + 4 & 0xF) +\n hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 & 0xF);\n }\n return str;\n}", "title": "" }, { "docid": "e1bc74987008212dde4e6b5cae3ecd02", "score": "0.45557603", "text": "function bouncer(arr) {\n //returning the filtered array by using a inline callback function, which uses\n //Boolean() to return true or false depending on the actual element checked by filter()\n return arr.filter(function(el){\n return Boolean(el);\n });\n}", "title": "" }, { "docid": "6654687b4ea48052a6414966c20120aa", "score": "0.4555041", "text": "function floatToBit (arr) {\n for (var i = 0; i < arr.length; i++) {\n var precision = arr[i].toString().split('.')[1].length\n arr[i] = parseInt(arr[i] * Math.pow(10, precision))\n arr[i] = arr[i] % 2\n }\n return arr\n}", "title": "" }, { "docid": "49b4169e3a57f8d86b8b659f0a238e65", "score": "0.45535505", "text": "meldIndicesToSuits(indexArray) {\n return indexArray.map((i) => this.suitMask[i]);\n }", "title": "" }, { "docid": "34b578602bb4578884ec7a73a256f26d", "score": "0.45413864", "text": "function binl2hex(binarray)\n {\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++)\n {\n str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n }\n return str;\n }", "title": "" }, { "docid": "26de54cd9f0cd96e44c48bbe374460aa", "score": "0.45365357", "text": "function binl2hex(binarray) {\n\t\tvar hex_tab = hexcase ? \"0123456789ABCDEF\": \"0123456789abcdef\";\n\t\tvar str = \"\";\n\t\tfor (var i = 0; i < binarray.length * 4; i++) {\n\t\t\tstr += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF);\n\t\t}\n\t\treturn str;\n\t}", "title": "" }, { "docid": "de18ca67471efb4508e11227d05303fb", "score": "0.4531044", "text": "fromBits(arr) {\n let out = '',\n bl = sjcl.bitArray.bitLength(arr),\n i,\n tmp;\n for (i = 0; i < bl / 8; i++) {\n if ((i & 3) === 0) {\n tmp = arr[i / 4];\n }\n out += String.fromCharCode(tmp >>> 24);\n tmp <<= 8;\n }\n return decodeURIComponent(escape(out));\n }", "title": "" }, { "docid": "6503fa9b1dc9a26a0c57b3b30c0cf169", "score": "0.45295024", "text": "function bouncer(arr) {\n return arr.filter(Boolean); \n}", "title": "" }, { "docid": "58a2b6e5e5a41f5dccd8694399341630", "score": "0.45256263", "text": "function binl2hex(binarray) {\n\tvar hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n\tvar str = \"\";\n\tfor (var i = 0; i < binarray.length * 4; i++) {\n\t\tstr += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF)\n\t\t\t\t+ hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF);\n\t}\n\treturn str;\n}", "title": "" }, { "docid": "63d18959bf8d6f00ce8ad7ce5e9b0dd6", "score": "0.45250514", "text": "function bouncer(arr) {\n\t// use the filter method to return only items from the array that are truthy\n\tconst truth = arr.filter(item => item);\n\n\t// return the new array of truthy values\n\tconsole.log(truth);\n\treturn truth;\n}", "title": "" }, { "docid": "fb7859e5c7a35513f0d0230508f8f9ba", "score": "0.45214564", "text": "function binb(x, len) {\n var i, j, t, olda, oldb, oldc, oldd, olde,\n w = Array(80),\n a = 1732584193,\n b = -271733879,\n c = -1732584194,\n d = 271733878,\n e = -1009589776;\n\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\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 += 1) {\n if (j < 16) {\n w[j] = x[i + j];\n } else {\n w[j] = bit_rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n }\n t = safe_add(safe_add(bit_rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = bit_rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n }", "title": "" }, { "docid": "0c660d27c639055086cb199a5315f823", "score": "0.45212996", "text": "function bouncer(arr) {\n return arr.filter(Boolean);\n }", "title": "" }, { "docid": "1d9d5eb804b7fa1a1c3274cb7d8f2d02", "score": "0.45189154", "text": "function convertArraytoUtf8BinaryString(byteArray, startIndex, endIndex) {\n var result = '';\n\n for (var i = startIndex; i < endIndex; i++) {\n result = result + String.fromCharCode(byteArray[i]);\n }\n\n return result;\n}", "title": "" }, { "docid": "b1a2e5aebf2f4b303f432eb5a28682a5", "score": "0.45156112", "text": "function toBinString(arr) {\n arr = new Uint8Array(arr);\n const strings = []\n const chunksize = 0xffff;\n\n // There is a maximum stack size.\n // We cannot call String.fromCharCode with as many arguments as we want\n for (let i = 0; i * chunksize < arr.length; i++) {\n const sub = arr.subarray(i * chunksize, (i + 1) * chunksize);\n strings.push(String.fromCharCode.apply(null, sub));\n }\n\n return strings.join('');\n}", "title": "" }, { "docid": "eb07a07c3a70c3eadcf7adc5107b3ffe", "score": "0.45129034", "text": "function binl2hex(binarray)\n\t\t\t{\n\t\t\t var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n\t\t\t var str = \"\";\n\t\t\t for(var i = 0; i < binarray.length * 4; i++)\n\t\t\t {\n\t\t\t str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +\n\t\t\t hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);\n\t\t\t }\n\t\t\t return str;\n\t\t\t}", "title": "" }, { "docid": "2ab935dc1b2f0d2cbb9a31512774ee55", "score": "0.45101872", "text": "function binb(x, len) {\n var i, j, t, olda, oldb, oldc, oldd, olde,\n w = Array(80),\n a = 1732584193,\n b = -271733879,\n c = -1732584194,\n d = 271733878,\n e = -1009589776;\n\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\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 += 1) {\n if (j < 16) {\n w[j] = x[i + j];\n } else {\n w[j] = bit_rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n }\n t = safe_add(safe_add(bit_rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = bit_rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n }", "title": "" }, { "docid": "da6315ec620d4b78cfcac4313a9e7464", "score": "0.45092228", "text": "function WordArrayToByteArray(wordArray) {\n\t\tvar len = wordArray.words.length;\n\t\tif (len == 0) {\n\t\t\treturn new Array(0);\n\t\t}\n\t\tvar byteArray = new Array(wordArray.sigBytes);\n\t\tvar offset = 0,\n\t\t\tword, i;\n\t\tfor (i = 0; i < len - 1; i++) {\n\t\t\tword = wordArray.words[i];\n\t\t\tbyteArray[offset++] = word >> 24;\n\t\t\tbyteArray[offset++] = (word >> 16) & 0xff;\n\t\t\tbyteArray[offset++] = (word >> 8) & 0xff;\n\t\t\tbyteArray[offset++] = word & 0xff;\n\t\t}\n\t\tword = wordArray.words[len - 1];\n\t\tbyteArray[offset++] = word >> 24;\n\t\tif (wordArray.sigBytes % 4 == 0) {\n\t\t\tbyteArray[offset++] = (word >> 16) & 0xff;\n\t\t\tbyteArray[offset++] = (word >> 8) & 0xff;\n\t\t\tbyteArray[offset++] = word & 0xff;\n\t\t}\n\t\tif (wordArray.sigBytes % 4 > 1) {\n\t\t\tbyteArray[offset++] = (word >> 16) & 0xff;\n\t\t}\n\t\tif (wordArray.sigBytes % 4 > 2) {\n\t\t\tbyteArray[offset++] = (word >> 8) & 0xff;\n\t\t}\n\t\treturn byteArray;\n\t}", "title": "" }, { "docid": "64d0b4cab5a0f69ad14745e0b394caf2", "score": "0.45069882", "text": "function bouncer(arr) {\n let newArr = arr.filter(e => Boolean(e));\n return newArr;\n}", "title": "" }, { "docid": "86631e4471d6be1a0aef573638ab99b0", "score": "0.44988233", "text": "function bin_buffer(encoder,value){var length=value.length;var type=length<0xFF?0xc4:length<=0xFFFF?0xc5:0xc6;token[type](encoder,length);encoder.send(value);}", "title": "" }, { "docid": "a9d361c9ae2c99f990f9309595fe500f", "score": "0.44974175", "text": "function wordArrayToByteArray(wordArray) {\n var len = wordArray.words.length;\n if (len == 0) {\n return new Array(0);\n }\n var byteArray = new Array(wordArray.sigBytes);\n var offset = 0, word, i;\n for (i = 0; i < len - 1; i++) {\n word = wordArray.words[i];\n byteArray[offset++] = word >> 24;\n byteArray[offset++] = (word >> 16) & 0xff;\n byteArray[offset++] = (word >> 8) & 0xff;\n byteArray[offset++] = word & 0xff;\n }\n word = wordArray.words[len - 1];\n byteArray[offset++] = word >> 24;\n if (wordArray.sigBytes % 4 == 0) {\n byteArray[offset++] = (word >> 16) & 0xff;\n byteArray[offset++] = (word >> 8) & 0xff;\n byteArray[offset++] = word & 0xff;\n }\n if (wordArray.sigBytes % 4 > 1) {\n byteArray[offset++] = (word >> 16) & 0xff;\n }\n if (wordArray.sigBytes % 4 > 2) {\n byteArray[offset++] = (word >> 8) & 0xff;\n }\n return byteArray;\n}", "title": "" }, { "docid": "2e0604641f0d56ea7b165871f3463a5e", "score": "0.44943053", "text": "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "title": "" }, { "docid": "9ab39b1b172566fb10f40980c83bce18", "score": "0.44939744", "text": "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "title": "" }, { "docid": "b255c178afbb0ce5f667a7f5992e5f8c", "score": "0.44919074", "text": "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "title": "" } ]
a74a1d8cda930f6ad031586a6da30b0d
SEARCH // Return all tracks with search term in tags
[ { "docid": "1cc7c2c2e6b40d09ca799e86bac282d6", "score": "0.7122471", "text": "function FilterSearchTags(array, term) {\n term = term.toLowerCase();\n var filtered = [];\n for (var i=0; i<array.length; i++) {\n var track = array[i];\n for (var h=0; h<track.tags.length; h++) {\n if (track.tags[h].toLowerCase().indexOf(term) !== -1) {\n filtered.push(track);\n break;\n }\n }\n }\n return filtered;\n}", "title": "" } ]
[ { "docid": "67acc1a470505f28f67d9ec8b2b5663b", "score": "0.7365847", "text": "function FilterSearch(array, term) {\n term = term.toLowerCase();\n var filtered = [];\n for (var i=0; i<array.length; i++) {\n var track = array[i];\n\n // SEARCH TITLE //\n if (track.title.toLowerCase().indexOf(term) !== -1) {\n filtered.push(track);\n continue;\n }\n\n // SEARCH IN TAGS //\n for (var h=0; h<track.tags.length; h++) {\n if (track.tags[h].toLowerCase().indexOf(term) !== -1) {\n filtered.push(track);\n break;\n }\n }\n }\n return filtered;\n}", "title": "" }, { "docid": "810bb41d7ea9d3fe629675b5bb6d5f18", "score": "0.7086912", "text": "function searchByTag(tag) {\n // TODO\n}", "title": "" }, { "docid": "f8e6b335ac2b96380ac78a8406a986a7", "score": "0.6750221", "text": "function searchByTrack(keyword) {\n var url = 'http://ws.spotify.com/search/1/track.json?q='+keyword;\n return url;\n}", "title": "" }, { "docid": "a24dc6f01e67844fc4eea2f7e68df59d", "score": "0.67229027", "text": "function searchSpotify(term) {\n spotify.search({ type: 'track', query: term }, function(err, data) {\n if (err) {\n console.log(\"-----------------\");\n return console.log('Error occurred: ' + err);\n }\n console.log(\"Phrase Searched: \" ,term);\n for (let index = 0; index < data.tracks.items.length; index++) {\n console.log(\"---------------------------------- RESULT #\"+ (index+1) +\"----------------------------------\");\n console.log(\"*Name of the artists: \",data.tracks.items[index].album.artists[0].name);\n console.log(\"*Song's name: \",data.tracks.items[index].name);\n console.log(\"*Preview link for the song: \",data.tracks.items[index].preview_url);\n console.log(\"*The album the song is from: \",data.tracks.items[index].album.name);\n console.log(\"----------------------------------END OF RESULT----------------------------------\");\n }\n \n });\n}", "title": "" }, { "docid": "be29608232f55499d9ee1f68d2b7319f", "score": "0.6619032", "text": "function filter(search, tags) {\n if (search.length === 0)\n return true\n for (let i in search)\n for (let j in tags)\n if (tags[j].toLowerCase().includes(search[i].toLowerCase()))\n return true\n return false\n}", "title": "" }, { "docid": "ba98b27acc0bec6a69df63bddf4856c7", "score": "0.6584509", "text": "function FilterSearchTitle(array, term) {\n term = term.toLowerCase();\n var filtered = [];\n for (var i=0; i<array.length; i++) {\n var track = array[i];\n if (track.title.toLowerCase().indexOf(term) !== -1) {\n filtered.push(track);\n }\n }\n return filtered;\n}", "title": "" }, { "docid": "2005bc0b41aaba71defc50ae512b174e", "score": "0.6553109", "text": "async search(term) {\n const headers = {\n Authorization: `Bearer ${accessToken}`,\n };\n const urlToFetch = `https://api.spotify.com/v1/search?type=track&q=${term}`;\n\n // Get Spotify Catalog information that match a keyword\n try {\n const response = await fetch(urlToFetch, {\n method: \"GET\",\n headers: headers,\n });\n if (response.ok) {\n const jsonResponse = await response.json();\n if (!jsonResponse.tracks) {\n return [];\n }\n return jsonResponse.tracks.items.map((track) => {\n return {\n id: track.id,\n name: track.name,\n artist: track.artists[0].name,\n album: track.album.name,\n uri: track.uri,\n };\n });\n }\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "a45c2ed9348dcc0a6e749d7c34cb5149", "score": "0.6513241", "text": "function songSearch(track) {\n spotify.search({ type: \"track\", query: track }, (err, content) => {\n if (err) {\n return console.log(`Error occurred: ${err.message}`);\n }\n\n const result = content.tracks.items[0];\n\n const data = `\n ==============SPOTIFY SONG==============\n\n Artist: ${result.artists[0].name}\n Song: ${result.name}\n Preview Link: ${result.preview_url}\n Album: ${result.album.name}\n `;\n\n logger(data);\n console.log(data);\n });\n}", "title": "" }, { "docid": "943584e3761acc13bd2b8eb573e1075b", "score": "0.63557327", "text": "function search(criteria, token, callback) {\n let query = criteria;\n let bearerstring = 'Bearer ' + token;\n let headers = {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': bearerstring\n };\n let options = {\n url: `https://api.spotify.com/v1/search?q=${encodeURIComponent(query)}&type=track&limit=10`,\n headers: headers\n };\n request(options, callback);\n}", "title": "" }, { "docid": "fb5ad1e1b80d70264204237c4fb5fd49", "score": "0.6339751", "text": "search(term){\n const accessToken = Spotify.getAccessToken();\n return fetch(`https://api.spotify.com/v1/search?type=track&q=${term}`,{\n headers: {\n Authorization: `Bearer ${accessToken}`\n }\n }).then((response) => {\n return response.json();\n }).then(jsonResponse => {\n if(!jsonResponse.tracks) {\n return [];\n }\n return jsonResponse.tracks.items.map(track => ({\n id: track.id,\n name: track.name,\n artist: track.artists[0].name,\n album: track.album.name,\n uri: track.uri\n }));\n });\n }", "title": "" }, { "docid": "339825aa5ef3ae24ba010bf782c184e1", "score": "0.62911236", "text": "async search(term){\n const accessToken = Spotify.getToken();\n let fetchURL = 'https://api.spotify.com/v1/search';\n fetchURL += '?q=' + term;\n fetchURL += '&type=track';\n return fetch(fetchURL, {\n headers: {\n 'Authorization': 'Bearer ' + accessToken\n }\n })\n .then(\n response => {\n if(response.ok) {\n return response.json();\n }\n throw new Error('Request failed!');\n }, networkError => console.log(networkError.message)\n )\n .then(\n jsonResponse => {\n if(jsonResponse.tracks.items) {\n console.log(jsonResponse.tracks);\n console.log(jsonResponse.tracks.items);\n let returnedTracks = jsonResponse.tracks.items.map( track => ({\n id: track.id,\n trackName: track.name,\n artistName: track.artists[0].name,\n albumName: track.album.name,\n uri: track.uri,\n previewURL: track.preview_url\n }));\n if (typeof returnedTracks !== \"undefined\" && returnedTracks !== null) {\n return returnedTracks;\n }\n }\n }\n );\n }", "title": "" }, { "docid": "ae74cbdb93fa1a8dfe46c2c983104c60", "score": "0.6282215", "text": "function spotifySearch(input) {\n spotify.search({ type: 'track', query: input }, function(err, data) {\n if (err) {\n console.log('Error occurred: ' + err);\n return;\n }\n\n //create string of all artist names involved with track\n //grab first track returned\n let artists = data.tracks.items[0].artists;\n artists = artists.reduce((a, b) => {\n return a + b.name + ' '\n }, '');\n\n console.log('======RESULTS========');\n console.log('Artist(s): ' + artists);\n console.log('Song Name: ' + data.tracks.items[0].name);\n console.log('Preview Link: ' + data.tracks.items[0].href);\n console.log('Album Name: ' + data.tracks.items[0].album.name);\n console.log('=====================');\n });\n}", "title": "" }, { "docid": "32c7815746474adc4b8b23e892e78e68", "score": "0.6253021", "text": "function spotifySearch(term) {\n var song = term;\n if (!song) {\n song = \"the sign Ace of Base\" \n }\n spotify.search({ type: 'track', query: song }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n var songData = [\n \"Song Name: \" + data.tracks.items[0].name,\n \"Artist Name: \" + data.tracks.items[0].artists[0].name,\n \"Album Name: \" + data.tracks.items[0].album.name,\n \"Preview URL: \" + data.tracks.items[0].preview_url,\n ].join(\"\\n\\n\");\n fs.appendFile(\"log.txt\", songData + divider, function (err) {\n if (err) throw err;\n console.log(songData);\n\n });\n })\n}", "title": "" }, { "docid": "482fb857a5588a0edadf8c0d8f28f180", "score": "0.617893", "text": "function searchTracks (vibe) {\n SC.get('/tracks', { q: vibe }, function (tracks) {\n var songs = tracks;\n var randomSongNumber = Math.floor(Math.random() * (songs.length - 1));\n var song = songs[randomSongNumber];\n playTrack(song.id);\n $('#songtitle').text(song.user.username + '' + song.title);\n });\n}", "title": "" }, { "docid": "679453f2b04f9f57d5ee47fb7bc0ea4a", "score": "0.61428195", "text": "function search(e) {\n const searched = e.target.value.toLowerCase()\n const filtered_packs = packs.filter(\n p => p.title.toLowerCase().includes(searched) || // by title\n (p.tags.map(t => t.includes(searched)).includes(true)) // by tags\n )\n document.getElementById(\"stickers_list\").innerHTML = \"\";\n filtered_packs.forEach(filetered_pack => displayPackThumbnail(filetered_pack))\n}", "title": "" }, { "docid": "a6ef34451d1925afaa1558dec8d28e46", "score": "0.6131441", "text": "function searchSong(query = \"\") {\n if (query == \"\") {\n main.innerHTML = allSongsHTML;\n /*songList = songs;\n updateList();*/\n return;\n }\n if (query.length <= 1) {\n return;\n }\n main.innerHTML = \"\";\n\n var filteredSongs = [];\n for (let i = 0; i < songs.length; i++) {\n if (songs[i].getAttribute(\"name\").indexOf(query) > -1) {\n filteredSongs.push(songs[i]);\n } else {\n var parts = songs[i].getElementsByTagName(\"p\");\n for (let j = 0; j < parts.length; j++) {\n var songText = parts[j].childNodes[0].nodeValue.toLowerCase();\n if (songText.indexOf(query.toLowerCase()) > -1) {\n filteredSongs.push(songs[i]);\n break;\n }\n }\n }\n }\n\n songList = filteredSongs;\n updateList();\n}", "title": "" }, { "docid": "6d9d140fad7821ce872496d51a87c0d7", "score": "0.61210424", "text": "function searchSong(parameter, songs) {\n filtered = [];\n filtered = songs.filter((song) =>\n song.toLowerCase().includes(parameter.toLowerCase())\n );\n\n filtered.sort((a, b) => {\n positionA = a.toLowerCase().indexOf(parameter.toLowerCase());\n positionB = b.toLowerCase().indexOf(parameter.toLowerCase());\n return positionA - positionB;\n });\n return filtered;\n}", "title": "" }, { "docid": "eede3aecbd0c2b55cf547151f24eef15", "score": "0.6095982", "text": "getResults(query, data) {\n if (!query) return [];\n\n // Filter for matching strings\n let results = data.filter((item) => {\n return item.text.toLowerCase().includes(query.toLowerCase());\n });\n\n return results;\n }", "title": "" }, { "docid": "c697a125b4643aa2f29fcc30883d24be", "score": "0.6068424", "text": "function search() {}", "title": "" }, { "docid": "067b83685a8a0c33ecfd80294e6b14f3", "score": "0.6064486", "text": "function spotifySearch(input) {\r\n // Check if input is not empty and set a default\r\n if (input.length === 0) {\r\n input = \"the sign Ace of base\";\r\n }\r\n // We run the spotify search\r\n spotify.search({ type: \"track\", query: input, limit: 4 }, function(\r\n err,\r\n data\r\n ) {\r\n if (err) {\r\n return console.log(\"Error occurred: \" + err);\r\n }\r\n // We capture the relevant data\r\n var response = data.tracks.items.length;\r\n for (let j = 0; j < response; j++) {\r\n // and display it on the terminal\r\n console.log(\"===============================\");\r\n console.log(\"Title: \" + data.tracks.items[j].name);\r\n console.log(\"Artist: \" + data.tracks.items[j].artists[0].name);\r\n console.log(\"Album Name: \" + data.tracks.items[j].album.name);\r\n console.log(\"Preview: \" + data.tracks.items[j].preview_url);\r\n console.log(\"=============================== \\n\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "6df28596faf0370dd56b64205227cee1", "score": "0.6049633", "text": "function myPlayList(searchTitle) {\n if (searchTitle == undefined) {\n searchTitle = 'The Sign Ace of Base';\n }\n\n spotify.search({ type: 'track', query: searchTitle }, function(err, data) {\n if (err) {\n console.log(\"Error occurred: \" + err);\n return;\n }\n\n var albumTrack = data.tracks.items;\n\n albumTrack.forEach((track) => {\n var artists = track.artists.map((a) => a.name);\n console.log(\"\\n\\nArtists: \" + artists.join(\", \"));\n console.log(\"Track Name: \" + track.name);\n console.log(\"Preview Link: \" + track.preview_url);\n console.log(\"Album: \" + track.album.name);\n console.log(\"\");\n });\n\n });\n\n}", "title": "" }, { "docid": "3ccf7922e56e93c74b2d28da4735a84f", "score": "0.5934266", "text": "function searchMovie(search_term){\r\n let results = [];\r\n for(let x of movies){\r\n if(x != null){\r\n if(x.title.includes(search_term) == true){\r\n results.push(x);\r\n }\r\n }\r\n }\r\n return results;\r\n}", "title": "" }, { "docid": "0727780f9bb4f042aebe0e2bc69645da", "score": "0.59231627", "text": "function getSearchSongs() {\n if (vm.query !== null && vm.query !== '') {\n return dataservice.getSearchSongs(vm.query).then(function (data) {\n vm.songs = data;\n return vm.songs;\n });\n }\n }", "title": "" }, { "docid": "ad4ddf5f99e256e5547f2a4d735975f9", "score": "0.5922986", "text": "search(term) {\n console.log(`Searching Spotify with ${term}`);\n return Spotify.search(term)\n .then(tracks => this.setState({ searchResults: tracks }));\n }", "title": "" }, { "docid": "2ac49278cb6edc7a563fc118d0d5bfcb", "score": "0.5911004", "text": "async function searchSpotify(trackName = 'The Sign Ace of Base') {\n spotify.search({ type: 'track', query: trackName }, function(err, data) {\n if (err) {\n return appendToLog('Error occurred: ' + err)\n }\n appendToLog('========================')\n appendToLog('tracks found ' + data.tracks.items.length)\n for (var i = 0; i < data.tracks.items.length; i++) {\n appendToLog(\n 'Artist = ' + JSON.stringify(data.tracks.items[i].album.artists[0].name)\n )\n appendToLog('Song = ' + JSON.stringify(data.tracks.items[i].name))\n appendToLog(\n 'Link = ' + JSON.stringify(data.tracks.items[i].external_urls.spotify)\n )\n appendToLog('Album = ' + JSON.stringify(data.tracks.items[i].album.name))\n appendToLog('========================')\n }\n })\n}", "title": "" }, { "docid": "9d5b0162bab393094ac0571a2cba8229", "score": "0.5907562", "text": "doSearch(searchQuery) {\n for (let tag of this.existingTags) {\n const compareable = this.caseSensitiveTags\n ? tag.value\n : tag.value.toLowerCase();\n\n if (compareable.search(searchQuery) > -1 && ! this.tagSelected(tag)) {\n this.searchResults.push(tag);\n }\n }\n\n // Sort the search results alphabetically\n if (this.sortSearchResults) {\n this.searchResults.sort((a, b) => {\n if (a.value < b.value) return -1;\n if (a.value > b.value) return 1;\n\n return 0;\n });\n }\n\n // Shorten Search results to desired length\n if (this.typeaheadMaxResults > 0) {\n this.searchResults = this.searchResults.slice(\n 0,\n this.typeaheadMaxResults\n );\n }\n }", "title": "" }, { "docid": "9d5b0162bab393094ac0571a2cba8229", "score": "0.5907562", "text": "doSearch(searchQuery) {\n for (let tag of this.existingTags) {\n const compareable = this.caseSensitiveTags\n ? tag.value\n : tag.value.toLowerCase();\n\n if (compareable.search(searchQuery) > -1 && ! this.tagSelected(tag)) {\n this.searchResults.push(tag);\n }\n }\n\n // Sort the search results alphabetically\n if (this.sortSearchResults) {\n this.searchResults.sort((a, b) => {\n if (a.value < b.value) return -1;\n if (a.value > b.value) return 1;\n\n return 0;\n });\n }\n\n // Shorten Search results to desired length\n if (this.typeaheadMaxResults > 0) {\n this.searchResults = this.searchResults.slice(\n 0,\n this.typeaheadMaxResults\n );\n }\n }", "title": "" }, { "docid": "d2936ee6d6a67727d6f9e11a15d326fb", "score": "0.59015006", "text": "function search() {\r\n var arr = []; //create empty array\r\n for (let x of names) {\r\n if ((x.children[0].children[1].textContent).indexOf(input.value) != -1) //if keyword is found...\r\n arr.push(x); //add the names to the array\r\n }\r\n \r\n return arr; //return the updated array of names\r\n \r\n \r\n}", "title": "" }, { "docid": "860763452a0a4a6e3ca57795606e59ad", "score": "0.58995265", "text": "search(term) {\n\n /*\n * Get the access token or force reauthorization\n */\n accessToken = Spotify.getAccessToken();\n\n if (accessToken) {\n\n const fetchURL = 'https://api.spotify.com/v1/search?type=track&limit=10&q=' + term;\n const headerInfo = {headers: {Authorization: 'Bearer ' + accessToken}};\n\n /*\n * Fetch search results for the search term from Spotify\n */\n return fetch(fetchURL, headerInfo)\n .then(\n response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error('Search request response failed!');\n }, networkError => console.log(networkError.message)\n ) /* end then */\n .then(\n jsonResponse => {\n if (!jsonResponse.tracks) {\n return [];\n } else {\n\n /*\n * Extract the track information we're interested in from the JSON response\n */\n\n return jsonResponse.tracks.items.map(track => {\n return {\n id: track.id,\n name: track.name,\n artist: track.artists[0].name,\n album: track.album.name,\n uri: track.uri\n }\n });\n }\n }\n ) /* then */\n }\n else {\n console.log('Failure to get access token in search');\n }\n }", "title": "" }, { "docid": "ec2e0ba018177d7dade2cfdced0cc92b", "score": "0.58782417", "text": "search(term) {\n let accessToken = hash.access_token;\n\n fetch(constants.API + `search?type=track,artist&q=${term}&limit=20`, {\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${accessToken}`,\n },\n })\n .then((response) => {\n return response.json();\n })\n .then((jsonResponse) => {\n if (!jsonResponse.tracks) {\n return [];\n }\n return jsonResponse.tracks.items.map((track) => ({\n id: track.id,\n name: track.name,\n artist: track.artists[0].name,\n uri: track.uri,\n preview: track.preview_url,\n img: track.album.images[0].url,\n }));\n })\n .then((searchResults) => {\n this.setState({ searchResults: searchResults });\n })\n .catch((error) => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "66c0854240cd10e57cafeb3a6253497c", "score": "0.58608574", "text": "function search() {\n var q = $('#query').val();\n var request = gapi.client.youtube.search.list({\n q: q,\n part: 'snippet'\n });\n\n request.execute(function(response) {\n var str = JSON.stringify(response.result);\n $('#search-container').html('<pre>' + str + '</pre>');\n });\n}", "title": "" }, { "docid": "b31c64e8d3c02ce44e57a7a96210a35a", "score": "0.5856692", "text": "searchData(words) {\n\n let results = []\n for (let item of this.state.data) {\n\n let found = false\n for (let word of words) {\n\n if (word in item.keywordsDict) {\n\n results.push(item)\n found = true\n break;\n\n }\n }\n\n if (found) continue;\n }\n return results;\n }", "title": "" }, { "docid": "5e0518d40232fb83110c2621c6b25cab", "score": "0.58537513", "text": "function findMatches() {\n var arr = $(\"#search-input\").val().split(\" \");\n var ids = [];\n getKeywords().done(function(jsonArray) {\n $.each(jsonArray, function(index, jsonObj) {\n for (var input of arr) {\n if (jsonObj.Keyword.indexOf(input) >= 0) {\n if (ids.indexOf(jsonObj.Id) == -1) {\n ids.push(jsonObj.Id);\n }\n }\n }\n });\n searchDocuments(ids);\n });\n}", "title": "" }, { "docid": "be088feb688ae3b7d165610027cc454b", "score": "0.58517724", "text": "function searchSpotify(song) {\n\n\tvar song = process.argv[3];\n\n\tspotify.search({\n\t\ttype: \"track\",\n\t\tquery: song\n\t},\n\tfunction(err, data) {\n\t\tif (err) {\n\n\t\t\tconsole.log(\"An error occurred: \" + err);\n\t\t\treturn;\n\n\t\t} else {\n\n\t\t\tvar track = data.tracks.items[0];\n\n\t\t\tvar logSpotify = \"Artist: \" + track.artists[0].name + \"\\nSong name: \" + track.name + \"\\nPreview link: \" + track.preview_url + \"\\nAlbum title: \" + track.album.name;\n\n\t\t\tconsole.log(logSpotify);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a165dc3ad6d8d50266151ebcd0655c25", "score": "0.5845291", "text": "matchTags(objTags,tag){\n var tagTexts=[];\n objTags.map(function(item){\n tagTexts.push(item.name);\n });\n var flag= false;\n tagTexts.map(function(text){\n if(text.toLowerCase().indexOf(tag)!=-1)\n {\n flag=true;\n }\n });\n return flag;\n }", "title": "" }, { "docid": "4f76396bc5a15edec2b62cb11244ef7d", "score": "0.58451086", "text": "async searchFor(keywords) {\n let itemsList = [];\n\n if (!keywords && this.remoteSearch) return this.prepareItemsList(itemsList);\n\n if (!keywords) {\n this.prepareItemsList(this.map(this.originalItems));\n return;\n }\n\n if (this.remoteSearch) {\n this.searching = true;\n this.detectChanges();\n try {\n let response = await this.request(Object.merge({\n [this.searchKeywordsKey]: keywords\n }, this.queryParams));\n\n itemsList = this.map(response[this.responseKey]);\n\n let appendedItems = itemsList.filter(item => {\n return !Array.get(this.originalItems, originalItem => item.value == originalItem.value);\n });\n\n // add the list to the original items and filter it to be uinque only\n this.originalItems = this.originalItems.concat(appendedItems);\n } catch (response) {\n echo(response)\n } finally {\n this.searching = false;\n }\n } else {\n itemsList = this.map(this.originalItems).filter(item => item.text && item.text.match(new RegExp(keywords, 'i')));\n }\n\n this.prepareItemsList(itemsList);\n\n this.detectChanges();\n }", "title": "" }, { "docid": "85cdbda53cd0bbd51df360ceb5764de9", "score": "0.583965", "text": "search_results() {\n const param = FlowRouter.getParam('searchParam');\n let findParams = { recipeName: { $regex: `${param}` } };\n if (param === '*') {\n findParams = {};\n }\n const results = Recipes.find(findParams, { sort: { viewcount: -1 } }).fetch();\n\n let tagSearchArr = param.split(',');\n tagSearchArr = _.map(tagSearchArr, function snip(term) { return term[0] === ' ' ? term.substr(1) : term; });\n const tagSearchMap = _.map(tagSearchArr, function searchterm(term) { return { tagName: term }; });\n const tagSearchResults = Tags.find({ $or: tagSearchMap }, { fields: { recipeID: 1 } }).fetch();\n const tagSearchResultsRenamed = _.map(tagSearchResults, function rename(item) { return { _id: item.recipeID }; });\n if (tagSearchResultsRenamed.length > 0) {\n const tagSearch = Recipes.find({ $or: tagSearchResultsRenamed }, { }).fetch();\n results.push(tagSearch);\n }\n const flatresults = _.uniq(_.flatten(results, true), function isUniq(key) {\n return key._id;\n });\n Template.instance().numResults.set(flatresults.length);\n return flatresults;\n }", "title": "" }, { "docid": "f771fd607f66464ccb706c59f9d9a87d", "score": "0.5831642", "text": "search(term) {\n const accessToken = Spotify.getAccessToken();\n return fetch(`https://api.spotify.com/v1/search?type=track&q=${term}`,\n {headers: {Authorization: `Bearer ${accessToken}`}})\n .then(\n response => { \n console.log(response)\n return response.json();\n }\n )\n .then(jsonResponse => {\n console.log(jsonResponse);\n if (!jsonResponse.tracks) {\n return [];\n } \n\n return jsonResponse.tracks.items.map(track => ({\n id: track.id,\n name: track.name,\n artist: track.artists[0].name,\n album: track.album,\n uri: track.uri\n }))\n })\n }", "title": "" }, { "docid": "dd62ad291e920e2a2ac87bb6428bb589", "score": "0.5830468", "text": "function spotifyThisSong() {\n console.log(`\\n - - - - -\\n\\nSEARCHING FOR...\"${userQuery}\"`);\n\n // NOT FOUND, DEFAULT\"ACE OF BASE\" \n if (!userQuery) {\n userQuery = \"the sign ace of base\"\n };\n spotify.search({\n type: 'track',\n query: userQuery,\n limit: 1\n }, function (error, data) {\n if (error) {\n return console.log('Error occurred: ' + error);\n }\n let spotifyArr = data.tracks.items;\n\n for (i = 0; i < spotifyArr.length; i++) {\n console.log(`\\nTARRRRRRA!...\\n\\nArtist: ${data.tracks.items[i].album.artists[0].name} \\nSong: ${data.tracks.items[i].name}\\nAlbum: ${data.tracks.items[i].album.name}\\nSpotify link: ${data.tracks.items[i].external_urls.spotify}\\n\\n - - - - -`)\n };\n });\n}", "title": "" }, { "docid": "95a87e74ba18872648f11636d749d633", "score": "0.5820556", "text": "async function searchSongs(term) {\n const res = await fetch(`${ url }/suggest/${ term }`);\n const data = await res.json();\n\n showData(data);\n}", "title": "" }, { "docid": "560045cf5d0042283f595f92d4882a30", "score": "0.58130723", "text": "function search() {\n var q = $('#query').val();\n \n DM.api('/videos', {\n search: q,\n fields: 'id,title,thumbnail_360_url'\n}, handleAPIResponse);\n}", "title": "" }, { "docid": "4d6d087ae95306ea3e94dde0a9e06ee9", "score": "0.58069867", "text": "function searchSkill(search){\n let searchList = [];\n for(let id in skills)\n //If the current skill includes the search string\n if(skills[id].name.toLocaleLowerCase().includes(search.toLocaleLowerCase()) && search !== \"\")\n //Add to list\n searchList.push(id);\n return searchList;\n}", "title": "" }, { "docid": "017619532d8e82481439c2506d4f37c6", "score": "0.5788713", "text": "function FilterTagsOr(array, terms) {\n var filtered = [];\n for (var i=0; i<array.length; i++) {\n var track = array[i];\n for (var h=0; h<terms.length; h++) {\n if (track.tags.indexOf(terms[h]) !== -1) {\n filtered.push(track);\n break;\n }\n }\n }\n return filtered;\n}", "title": "" }, { "docid": "94e357ba1a6bfa344501386ec3a94f88", "score": "0.57859415", "text": "searchWithOffset(searchStr = \"\", offset = 0){\n const tags = searchStr.split(',');\n return searchStr.length !== 0 ? \n this.findAll({limit: PRODUCT_LIMIT, offset, \n where: {$or: [{tags: {$contains: tags}},\n {title: {$iLike: '%' + searchStr + '%'}}] }}) :\n this.findAll({limit: PRODUCT_LIMIT, offset});\n }", "title": "" }, { "docid": "fd175f8110570fc1f62e09db29cced36", "score": "0.57701427", "text": "function findAllAssociatedTags(){\r\n\r\n}", "title": "" }, { "docid": "2ecbb74b3c5a2c8215b31af94a698867", "score": "0.57538706", "text": "function search() {\n reset();\n var query = document.getElementById('query').value;\n // Use the JavaScript client library to create a search.list() API call.\n var request = gapi.client.youtube.search.list({\n part: 'snippet',\n q:query\n });\n // Send the request to the API server, call the onSearchResponse function when the data is returned\n request.execute(onSearchResponse);\n}", "title": "" }, { "docid": "3c41c73582b3c8e7953f70564cc2788b", "score": "0.57463866", "text": "function querySpotify(searchTerm) {\n\n\tvar spotify = new Spotify({\n\n\t\tid: config.spotifyKeys.id,\n\t\tsecret: config.spotifyKeys.secret,\n\t\n\t});\n\n\tspotify.search({\n\t\ttype: \"track\",\n\t\tquery: searchTerm,\n\t\tlimit: 1,\n\n\t}).then(function(response){\n\n\t\tvar artists = \"Artists: \" + response.tracks.items[0].artists[0].name;\n\t\tvar name = \"Track Name: \" + response.tracks.items[0].name;\n\t\tvar previewLink = \"Preview Link: \" + response.tracks.items[0].preview_url;\n\t\tvar album = \"Album Name: \" + response.tracks.items[0].album.name;\n\n\t\tvar dataArray = [artists, name, previewLink, album];\n\n\t\tlogToFile(dataArray);\n\n\t\tconsole.log(artists);\n\t\tconsole.log(name);\n\t\tconsole.log(previewLink);\n\t\tconsole.log(album);\n\n\t})\n\n}", "title": "" }, { "docid": "b87084b12ff9482d5ce9554ce5f68277", "score": "0.5746226", "text": "search (term, page, app) {\r\n let myAccessToken = Spotify.getAccessToken();\r\n //console.log ('Return: ' + accessToken);\r\n if (!accessToken) {\r\n console.log ('Unable to acquire access token');\r\n return [];\r\n }\r\n\r\n let headers = {\r\n 'headers': {\r\n 'Content-type': 'application/json',\r\n 'Authorization': `Bearer ${myAccessToken}`\r\n }\r\n }\r\n //console.log (`Offset ${page*20}`);\r\n const URL = `https://api.spotify.com/v1/search?type=track&offset=${page*20}&q=${term}`;\r\n //console.log (URL);\r\n fetch (URL, headers).then (response => {\r\n //console.log ('Search OK');\r\n //console.log (response);\r\n if (response.ok) {\r\n return response.json();\r\n }\r\n throw new Error ('Unable to conduct search on Spotify!');\r\n },\r\n networkError => console.log ('Request Failed!')\r\n )\r\n .then ( jsonResponse => {\r\n let totalTracks = jsonResponse.tracks.total;\r\n let spotifyTracks = jsonResponse.tracks.items;\r\n let tracks = spotifyTracks.map (item => {\r\n return {\r\n ID: item.id,\r\n Artist: item.artists[0].name,\r\n Name: item.name,\r\n Album: item.album.name,\r\n duration: item.duration_ms,\r\n URI: item.uri\r\n };\r\n });\r\n Spotify.playListNames (app);\r\n if (tracks) app.setState ({\r\n searchResults: tracks,\r\n totalTracks: totalTracks,\r\n pageNum: page\r\n });\r\n //console.log (jsonResponse);\r\n })\r\n }", "title": "" }, { "docid": "186b7b1ef5a963612d511cf0e743cb83", "score": "0.57440156", "text": "function searchByTitle(string) {\n let searchedResult=[]\n for (let i=0; i<movies.length; i++){\n let movie = movies[i].Title;\n \n if (movie.includes(string)){\n searchedResult.push(movies[i])\n }\n }return searchedResult\n \n }", "title": "" }, { "docid": "3292201bd052465bf6966b002d90f4df", "score": "0.5739944", "text": "byTags(tags) {\n if (typeof tags === \"string\") {\n const allTags = tags.trim().split(/\\s+|\\s*,\\s*/);\n return this.entries.filter(e => allTags.every(t => e.tags.indexOf(t) >= 0));\n }\n return this.entries.filter(e => tags.some(t => e.tags.indexOf(t) >= 0));\n }", "title": "" }, { "docid": "1466a1187b37fb69f12f3175b661c7fe", "score": "0.57267606", "text": "async function searchSong() {\n let response = await fetch(\n 'https://yt-music-api.herokuapp.com/api/yt/songs/' + input,\n )\n let result = await response.json()\n setSongs(result.content)\n }", "title": "" }, { "docid": "56126a6d59553d25cc4f677e3be3b8d7", "score": "0.5719099", "text": "function songs(){\n spotify.search({\n type:\"track\",\n query: randomText,\n })\n .then(function (response) {\n\n console.log(response.tracks.items[1].name);\n console.log(response.tracks.items[0].album.artists[0].name);\n console.log(response.tracks.items[1].preview_url);\n console.log(response.tracks.items[1].album.name);\n })\n .catch(function (error) {\n if (error.response) {\n //logging errors\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 // `error.request` is an object that comes back with details pertaining to the error that occurred.\n console.log(error.request);\n } else {\n // Something happened in setting up the request that triggered an Error\n console.log(\"Error\", error.message);\n }\n console.log(error.config);\n })\n }", "title": "" }, { "docid": "b7833985e9c3a2a1653f6e3dea6fd261", "score": "0.57177246", "text": "function searchSong(searchString) {\n var searchSong;\n // Setting up auto search if user enters spotify command but does not enter a song\n if (!searchString) {\n searchSong = \"The Sign ace of base\";\n } else {\n searchSong = searchString;\n }\n\n // Spotify Search\n spotify.search(\n {\n type: \"track\",\n query: searchSong\n },\n function(error, data) {\n if (error) {\n console.log(\"Error occurred: \" + error);\n return;\n } else {\n // Displaying artist/song/album information\n console.log(\"\\n==============================\\n\");\n console.log(\"* Artist: \" + data.tracks.items[0].artists[0].name);\n console.log(\"* Song Name: \" + data.tracks.items[0].name);\n console.log(\n \"* Preview Link from Spotify: \" + data.tracks.items[3].preview_url\n );\n console.log(\"* Album: \" + data.tracks.items[0].album.name);\n console.log(\"\\n==============================\\n\");\n }\n }\n );\n}", "title": "" }, { "docid": "acaf0f252e5450d0765db70ac222e212", "score": "0.57129735", "text": "function updateSearch() {\n var album = document.getElementById(\"filter-album\").value.toLowerCase();\n var artist = document.getElementById(\"filter-artist\").value.toLowerCase();\n var genre = document.getElementById(\"filter-genre\").value.toLowerCase();\n var title = document.getElementById(\"filter-title\").value.toLowerCase();\n var year = document.getElementById(\"filter-year\").value.toLowerCase();\n\n var libraryContent = document.getElementById(\"library-content\");\n var size = libraryContent.children.length;\n var tracks = [];\n\n for (var i = 0; i < size; i++) {\n if (album.length == 0 && artist.length == 0 && genre.length == 0 && title.length == 0 && year.length == 0) {\n alert(\"Please enter at least one field.\");\n break;\n }\n\n var track = libraryContent.firstElementChild.firstElementChild.firstElementChild;\n if (track.getAttribute(\"data-title\").toLowerCase().includes(title) || title.length == 0) {\n //title pass\n if (track.getAttribute(\"data-artist\").toLowerCase() == artist || artist.length == 0) {\n //artist pass\n if (track.getAttribute(\"data-album\").toLowerCase() == album || album.length == 0) {\n //album pass\n if (track.getAttribute(\"data-genre\").toLowerCase().includes(genre) || genre.length == 0) {\n //genre pass\n if (track.getAttribute(\"data-year\") == year || year.length == 0) {\n //year pass\n //all criteria met\n tracks.push(libraryContent.firstElementChild);\n }\n }\n }\n }\n }\n libraryContent.removeChild(libraryContent.firstElementChild);\n }\n\n //add all matching tracks to DOM\n for (var i = 0; i < tracks.length; i++) {\n libraryContent.appendChild(tracks[i]);\n }\n}", "title": "" }, { "docid": "749bf5974da8648f0c15ffb366fec472", "score": "0.57081044", "text": "function spotifySongs() {\n spotify\n .search({ type: 'track', query: searchValue })\n .then(function(response) {\n if (response.tracks.items.length > 0) {\n $.each(response.tracks.items, function(index, value) {\n $.each(value.artists, function(index, item) {\n console.log('artists', item.name);\n });\n console.log('song name', value.name);\n console.log('spotify song url', value.external_urls.spotify);\n console.log('song album name', value.album.name);\n console.log('\\n');\n });\n } else {\n searchValue = 'The Sign';\n spotifySongs();\n }\n })\n .catch(function(err) {\n console.log(err);\n });\n}", "title": "" }, { "docid": "9b75793c22676f6a820844df44459392", "score": "0.569547", "text": "function findSong(){\n spotify.search({type:\"track\", query:search}, function(err,data){\n if(err){\n return console.log(\"There was an Error:\", err)\n };\n // console.log(JSON.stringify(data));\n \n console.log(\"**********************Your Song*******************\")\n console.log(\"Artist(s) Name:\", data.tracks.items[0].artists[0].name);\n console.log(\"Song Name:\", data.tracks.items[0].name);\n console.log(\"Song Preview Link:\", data.tracks.items[0].href);\n console.log(\"Album:\", data.tracks.items[0].album.name);\n console.log(\"*****************************************************\")\n });\n}", "title": "" }, { "docid": "2ce8f5be95f1add53a3e1f306f876f25", "score": "0.5689034", "text": "function searchSong(param) {\n var divider = \"***********************************************************************************************************************************\"\n spotify.search({\n type: 'track',\n query: param\n }, function(err, data) {\n if (err) {\n console.log('Error occurred: ' + err);\n return;\n }\n //loop through the array of songs\n console.log(\"\");\n\n var songs = data.tracks.items;\n\n for (var i = 0; i < 5; i++) {\n var showMusicData = [\n \"\\nSong's Name: \" + songs[i].name,\n \"\\nArtist: \" + songs[i].artists.map(getArtistsNames),\n \"\\nPreview Link: \" + songs[i].preview_url,\n \"\\nAlbum: \" + songs[i].album.name\n ]\n\n console.log(divider + \"\\n\" + showMusicData + \"\\n\")\n fs.appendFile(\"log.txt\", divider + showMusicData + \"\\n\", function(err) {\n if (err) throw err;\n });\n }\n\n });\n}", "title": "" }, { "docid": "2415718e16b4c43ce27751563e31d33b", "score": "0.56874925", "text": "function search(searchTerm) {\n var search = new RegExp(searchTerm, 'i');\n \n return TITLES.filter(function(title) {\n return search.test(title);\n });\n}", "title": "" }, { "docid": "38884e077f94d417ad5c6697f989d56e", "score": "0.5686937", "text": "searchByName(searchName){\n \n const artists = this.artistas.filter( function(artista) { return artista.name.includes(searchName)} );\n const albums = this.albumes.filter( function(album) { return album.name.includes(searchName)} );\n const tracks = this.tracks.filter( function(track) { return track.name.includes(searchName)} );\n const playlists = this.playsLists.filter( function(playlist) { return playlist.name.includes(searchName) } );\n \n \n return {artists: artists, albums: albums, tracks: tracks, playlists: playlists};\n \n }", "title": "" }, { "docid": "a906b6d95990633c39c43133e7fa4564", "score": "0.5682534", "text": "function querySearch(query) {\n var results = [];\n for (var i = 0, len = vm.fullarr.length; i < len; ++i) {\n if (vm.fullarr[i].value.indexOf(query.toLowerCase()) != -1) {\n results.push(vm.fullarr[i]);\n }\n }\n return results;\n }", "title": "" }, { "docid": "3c0169e7a9413130470c375e7d961197", "score": "0.56640685", "text": "function getLyrics(searchName, searchTitle ){\n\n}", "title": "" }, { "docid": "9c62fca2b0133472955ba0da60207c36", "score": "0.56606394", "text": "function songSearch() {\n let foundSongs = \"\";\n\n if (searchTerm.Type === \"artist\") {\n if (searchTerm.Genre.length > 1) {\n foundSongs = gamesEntries.filter(game =>\n game.songs.some(\n song =>\n song.genre.toLowerCase() === searchTerm.Genre &&\n song.artist.toLowerCase().includes(searchTerm.Keyword)\n )\n );\n } \n else if (searchTerm.Genre.length < 1) {\n foundSongs = gamesEntries.filter(game =>\n game.songs.some(song =>\n song.artist.toLowerCase().includes(searchTerm.Keyword)\n )\n );\n }\n }\n\n else if (searchTerm.Type === \"game\") {\n if (searchTerm.Genre.length > 1) {\n if (searchTerm.Keyword.length < 1) {\n foundSongs = gamesEntries.filter(game =>\n game.songs.some(song => song.genre.toLowerCase() === searchTerm.Genre)\n );\n } \n else if (searchTerm.Keyword.length > 1) {\n foundSongs = gamesEntries.filter(game =>\n game.songs.some(\n song =>\n song.genre.toLowerCase() === searchTerm.Genre &&\n game.title.toLowerCase().includes(searchTerm.Keyword)\n )\n );\n }\n } \n else {\n foundSongs = gamesEntries.filter(game =>\n game.title.toLowerCase().includes(searchTerm.Keyword)\n );\n }\n }\n\n else {\n if (searchTerm.Genre.length > 1) {\n if (searchTerm.Keyword.length > 1) {\n foundSongs = gamesEntries.filter(game =>\n game.songs.some(song => song.title.toLowerCase().includes(searchTerm.Keyword.toLowerCase()) && song.genre.toLowerCase() === searchTerm.Genre.toLowerCase())\n );\n }\n }\n else {\n foundSongs = gamesEntries.filter(game =>\n game.songs.some(song => song.title.toLowerCase().includes(searchTerm.Keyword.toLowerCase()))\n );\n }\n }\n return foundSongs;\n}", "title": "" }, { "docid": "c95bef3b6a6d031533dc60dcdef573b8", "score": "0.56553584", "text": "function searchArtists() {\n var tempArray = JSON.parse(myStorage.getItem('artists'));\n\n // search form\n var search = document.querySelector('#artist-search-form');\n\n // search form user-input text\n search = search.elements[0].value.toLowerCase();\n\n filteredArray = [];\n \n // if search field is empty, display all artists and return\n if (search == '') {\n displayArtists();\n return;\n }\n\n // add any matching elements to filteredArray\n for (i = 0; i < tempArray.length; ++i) {\n if (tempArray[i]['name'].toLowerCase().includes(search)) {\n filteredArray.push(tempArray[i]);\n }\n }\n\n // redisplays artists after artist is removed\n displayFilteredArtists();\n}", "title": "" }, { "docid": "f89c8c51dc83defc9a7e33176d8375d8", "score": "0.56538516", "text": "async function searchSongs(term) {\r\n const res = await fetch(`${apiURL}/suggest/${term}`);\r\n const data = await res.json();\r\n showData(data);\r\n}", "title": "" }, { "docid": "d44f73698f97670ffe55715d3232499e", "score": "0.5650939", "text": "function Search(items, search) {\n var result = [];\n for (var i = 0; i < items.length; i++) {\n if (items[i].value.toLowerCase().indexOf(search.toLowerCase()) !== -1) {\n result.push(items[i]);\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "fade80a3eec48b8185bd911bfe0349e3", "score": "0.5648162", "text": "function searchFunction(e){\n var address= getExactAddress();\n console.log('e='+e);\n $.ajax({\n type: \"GET\",\n url: address +\"/token\",\n dataType: \"text\",\n success: function(response){\n //console.log(response);\n window.token = response;\n }\n });\n\n var params = {\n q:e,\n type:\"track\",\n limit: \"3\"\n };\n\n\n $.ajax({\n type: \"GET\",\n url: \"https://api.spotify.com/v1/search?\"+$.param(params),\n dataType: \"json\",\n contentType:\"application/json\",\n headers:{\n \"Authorization\": \"Bearer \"+window.token\n },\n success: function(response){\n console.log(response);\n\n var i=0;\n while(i<3){\n //console.log(response.tracks.items[i].name);\n console.log(response.tracks.items[i]);\n displaySongs(response.tracks.items);\n i = i+1;\n\n }\n //console.log(response.tracks.items[0].name);\n\n\n }\n\n });\n}", "title": "" }, { "docid": "5ebb03a7f2843582facd14f3fe603fbc", "score": "0.5647591", "text": "function search(tracksInfo){\n return Promise.all(tracksInfo.map( (track) => {\n return axios.get(`https://api.deezer.com/search`, {\n params: {\n access_token: access_token,\n q: `track:\"${track.title}\"album:\"${track.album}\"artist:\"${track.artist}\"`\n }\n })\n .then(res => {\n for(var i = 0; i < res.data.total; ++i){\n if(res.data.data[i].title == track.title){\n return res.data.data[i].id;\n }\n }\n })\n .catch(err => console.log(err));\n }))\n .then(res => res);\n}", "title": "" }, { "docid": "97677e91f3059401313cd96f11029c86", "score": "0.56388307", "text": "function searchTrackByName(track_name, offset = 0, onDone) {\n $.ajax({\n url: \"/trackSearch\",\n data: {\n track_value: track_name,\n searchOffset: offset,\n token: sessionStorage.getItem(token_id)\n }\n }).done(function (data) {\n if (responseIsSuccess(data)) {\n trackResult = data.trackResult.tracks.items;\n displaySearchResults(trackResult);\n }\n if (onDone && typeof onDone === \"function\") {\n onDone(data);\n }\n });\n }", "title": "" }, { "docid": "d754fb453dd0c4084726f23464597cec", "score": "0.5637867", "text": "function searchSpotify(songTitle) {\n spot.search({ type: 'track', query: songTitle }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n // console.log(data);\n var tracks = data.tracks.items[0];\n\n console.log( '' );\n console.log( '******************************************************************************************************************' );\n console.log( '******************************************* Spotify **************************************************' );\n console.log( '' );\n\n console.log( 'SONG INFORMATION' );\n console.log( 'Song Title: ' + tracks.name);\n console.log( 'Artist: ' + tracks.album.artists[0].name );\n console.log( 'Preview Link: ' + tracks.artists[0].external_urls.spotify );\n console.log( 'Album: ' + tracks.album.name );\n console.log( '' );\n console.log( '******************************************************************************************************************' );\n\n // Log all data to log.txt\n let toFile =\n 'Song Title: ' + tracks.name +\n ' Artist: ' + tracks.album.artists[0].name +\n ' Preview Link: ' + tracks.artists[0].external_urls.spotify +\n ' Album: ' + tracks.album.name +\n '\\n' + '******************************************************************************************************************' + '\\n';\n log( toFile );\n\n });\n}", "title": "" }, { "docid": "23afe3cb08c0f0f83f3b4cd0153d94fc", "score": "0.56275564", "text": "function spotifyThisSong(value) {\n if (value == null) {\n value = 'the sign';\n }\n\n spotify\n .search({ type: 'track', query: value })\n .then(function(response) {\n console.log('------------------------------------------------------');\n console.log('Album: ',response.tracks.items[0].album.name);\n console.log('Song Name: ',response.tracks.items[0].name);\n console.log('Artist Name: ',response.tracks.items[0].artists[0].name);\n console.log('Preview Link: ',response.tracks.items[0].preview_url);\n console.log('------------------------------------------------------');\n })\n .catch(function(err) {\n console.log(err);\n });\n\n}", "title": "" }, { "docid": "4ab20b647edae8d2814e3054102ffc07", "score": "0.5627208", "text": "function spotifyThisSong(term){\n if(term!=null || term!=\"\"){\n spotify.search({ type: 'track,album', query: ''+term}).then(function(response) {\n\n firstSong=response.tracks.items[0];\n var songInfo=[\n \"Artists: \"+firstSong.artists[0].name,\n \"Song Title: \"+firstSong.name,\n \"Preview Link: \"+firstSong.preview_url,\n \"Album: \"+firstSong.album.name\n ].join(\"\\n\\n\");\n console.log(songInfo);\n }).catch(function(err) {\n console.log(err);\n });\n }\n else{\n spotify.search({ type: 'track', query: \"The Sign\" }).then(function(response) {\n console.log(response);\n }).catch(function(err) {\n console.log(err);\n });\n }\n\n }", "title": "" }, { "docid": "6189b0146b0bc4311949b227f3a9d313", "score": "0.561882", "text": "function trackNames(track) {\n let queryURL = \"https://ws.audioscrobbler.com/2.0/?method=track.search&track=\" + track + \"&api_key=\" + APIKey + \"&format=json\";\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (response) {\n const tracks = response.results.trackmatches.track;\n songsArray.splice(0, songsArray.length);\n for (let i = 0; i < 10; i++) {\n songsArray.push(tracks[i].name);\n songsArray.push(tracks[i].artist);\n songsArray.push(tracks[i].url)\n }\n //builds song rows once the song information has been collected\n buildSongRows();\n })\n }", "title": "" }, { "docid": "a7f93d203640c4eea76517055c6b5f99", "score": "0.56148666", "text": "async searchEntriesByTags(tags) {\n var allNames = this.unfuck(await this.getAllNames());\n var n = allNames.length;\n var allTags = this.unfuck(await this.getAllTags(n));\n\n var matches = [];\n for (var i in allTags) {\n matches.push(this.intersect(tags, allTags[i]));\n }\n\n var order = Array.apply(null, Array(n)).map(function (_, i) {return i;});\n\n // all this just to sort order and matches both by matches\n var list = [];\n for (var j = 0; j < order.length; j++)\n list.push({'order': order[j], 'matches': matches[j]});\n list.sort(function(a, b) {\n return ((a.matches < b.matches) ? -1 : ((a.matches == b.matches) ? 0 : 1));\n });\n list.reverse();\n for (var k = 0; k < list.length; k++) {\n order[k] = list[k].order;\n matches[k] = list[k].matches;\n }\n\n var entries = [];\n for (i in order) {\n var j = order[i];\n if (matches[i] == 0)\n break;\n\n var author_j = (await (this.getAuthor(j)));\n var image_j = (await this.getImage(j));\n var user_tags_j = (this.unfuck(await this.getUserTags(j)));\n\n entries.push(\n new Entry(allNames[j], author_j, image_j, user_tags_j));\n }\n \n return entries;\n }", "title": "" }, { "docid": "144003e2aaec164e00649fd3b0ac33be", "score": "0.5609193", "text": "search(e) {\n \n \n e.preventDefault();\n try {\n songsService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "3f13aaebc10f5e6ac6d38ecee75574a6", "score": "0.55956894", "text": "function findMatches(keyword) {\n return places.filter( (places) => { //FILTER FUNCTION TO RETURN ARRAY ITEMS THAT MATCH WITH KEYWORD\n var regEx = new RegExp(keyword, \"gi\");\n //console.log(regEx);\n return places.city.match(regEx) || places.state.match(regEx); //RETURN CITIES OR STATES THAT MATCH WITH KEYWORD\n })\n}", "title": "" }, { "docid": "17777c18e9d00de914066dbcf2a95ad6", "score": "0.55896634", "text": "function searchForListings(searchTerm) {\n \n}", "title": "" }, { "docid": "c1d3c5b7ec05e483e73c7eed41d86668", "score": "0.55804133", "text": "function searchByTitle(title) {\n title = title.toLowerCase();\n\n books.forEach(function (book) {\n if (book.title.toLowerCase().includes(title)) {\n searchResults.push(book);\n }\n });\n}", "title": "" }, { "docid": "dc3be47f62aa0c00244b418508f47780", "score": "0.5580191", "text": "function spotifySong(searchTerm) {\n var spotify = new Spotify(keys.spotify)\n var preSong = searchTerm ? searchTerm : 'The Sign Ace of Base'\n spotify.search({\n 'type': 'track',\n query: preSong\n }, function (err, data) {\n if(err) {\n console.log(err + \"\\n\");\n } else {\n var track = data.tracks.items[0]\n console.log('')\n console.log('==============================================================')\n console.log('Artist: ' + track.album.artists[0].name);\n console.log('Song Name: ' + track.name);\n console.log('Ext URL: ' + track.external_urls.spotify);\n console.log('Album Name: ' + track.album.name);\n console.log('==============================================================')\n console.log('')\n logResults('\\nCommand: ' + cmd + '\\n')\n }\n })\n }", "title": "" }, { "docid": "09308ceab7a6de631e2788b70b976fc2", "score": "0.55693835", "text": "function searchSongs(input, type, aliasArr){\n\t\n\t//variables\n\tvar url;\n\tvar searchType = '';\n\tvar typeStr;\n\t\n\t//include name to listNames and alias to echonest format\n\tvar listNames = aliasArr.join(', ');\n\tif(listNames == ''){\n\t\tlistNames = input;\n\t} else{\n\t\tlistNames = input + ', ' + listNames;\n\t}\n\tlistNames = listNames.replace(/,\\s/g, ',');\n\tlistNames = listNames.replace(/\\s/g, '+');\n\tlistNames = listNames.split(',');\n\tconsole.log(listNames);\n\t\n\t\n\t//set search type\n\tif(type == 'artist'){\n\t\tsearchType = 'artist/song';\n\t\ttypeStr = 'artist';\n\t} else if(type == 'song'){\n\t\tsearchType = 'artist/song';\n\t\ttypeStr = 'title';\n\t} else{\n\t\tsearchType = 'album';\n\t}\n\t\n\t//search based on type\n\tswitch(searchType){\n\t\tcase 'artist/song':\n\t\t\t\n\t\t\t//clear previous song results\n\t\t\t$('#song_table tbody').html('');\n\t\t\t\n\t\t\t//get song list for each name\n\t\t\tfor(var i = 0; i < listNames.length; i++){\n\t\t\t\turl = 'http://developer.echonest.com/api/v4/song/search?api_key=KKIZOFIEWNN9075BD&' + typeStr + '=' + listNames[i] + '&results=100&bucket=audio_summary&callback=?';\n\t\t\t\t$.get(url, function(json) {\n\t\t\t\t\tconsole.log(json);\n\t\t\t\t\t\n\t\t\t\t\t//get list of songs\n\t\t\t\t\tvar listSongs = json.response.songs;\n\t//\t\t\t\tconsole.log(listSongs);\n\t\t\t\t\t\n\t\t\t\t\t//declare variables\n\t\t\t\t\tvar songHTML = '';\n\t\t\t\t\tvar song;\n\t\t\t\t\t\n\t\t\t\t\t//retrieve information on each song\n\t\t\t\t\tfor(var i = 0; i < listSongs.length; i++){\n\t\t\t\t\t\tsong = listSongs[i];\n\t\t\t\t\t\t\n\t\t\t\t\t\t//get song info\n\t\t\t\t\t\tvar artistName = song.artist_name;\n\t\t\t\t\t\tvar trackTitle = song.title;\n\t\t\t\t\t\tvar trackTime = song.audio_summary.duration;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//convert trackTime to minutes\n\t\t\t\t\t\ttrackTime = trackTime / 60;\n\t\t\t\t\t\ttrackTime = trackTime.toFixed(2);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//convert trackTitle\n\t\t\t\t\t\ttrackTitle = trackTitle.replace(/_/g, \"'\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//add song to song result list\n\t\t\t\t\t\tsongHTML = '<tr id=\"track_' + i + '\">' +\n\t\t\t\t\t\t\t\t\t\t'<td class=\"add\" onclick=\"addingTrack(this)\"></td>' +\n\t\t\t\t\t\t\t\t\t\t'<td class=\"track_name\">' + trackTitle + '</td>' +\n\t\t\t\t\t\t\t\t\t\t'<td class=\"artist\">' + artistName + '</td>' +\n\t\t\t\t\t\t\t\t\t\t'<td class=\"album\"></td>' +\n\t\t\t\t\t\t\t\t\t\t'<td class=\"time\">' + trackTime + '</td>' +\n\t\t\t\t\t\t\t\t\t'</tr>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$('#song_table tbody').append(songHTML);\n\t\t\t\t\t\t\n\t/*\t\t\t\t\t//change to echonest format\n\t\t\t\t\t\tartistName = artistName.replace(/\\s/g, '+');\n\t\t\t\t\t\ttrackTitle = trackTitle.replace(/\\s/g, '+');\n\t\t\t\t\t\t\n\t\t\t\t\t\turl = 'http://developer.echonest.com/api/v4/song/identify?api_key=KKIZOFIEWNN9075BD&artist=' \n\t\t\t\t\t\t\t\t\t+ artistName + '&title=' + trackTitle;\n\t\t\t\t\t\tconsole.log(url);\n\t*//*\t\t\t\t\t$.get(url, function(data){\n\t\t\t\t\t\t\t console.log(data);\n\t*//*\t\t\t\t\tsongHTML = '<tr id=\"searched_song\">' +\n\t\t\t\t\t\t\t\t\t\t'<td class=\"add\"></td>' +\n\t\t\t\t\t\t\t\t\t\t'<td class=\"track_name\">' + song.title + '</td>' +\n\t\t\t\t\t\t\t\t\t\t'<td class=\"artist\">' + song.artist_name + '</td>' +\n\t\t\t\t\t\t\t\t\t\t'<td class=\"album\">Album</td>' +\n\t\t\t\t\t\t\t\t\t\t'<td class=\"time\">Time</td>' +\n\t\t\t\t\t\t\t\t\t'</tr>';\n\t*//*\t\t\t\t\t});\n\t*/\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6d3509aa491e2929c98eec8d2e37113f", "score": "0.5560505", "text": "function searchTweets(searchInput){\n console.log(\"searching tweets with\", searchInput);\n //resets search results\n searchResult = []\n\n //detects tweets with wanted string\n for(i = 0; i < tweetDatabase.length; i++){\n var tweetText = tweetDatabase[i].text\n console.log(tweetText.toLowerCase().includes(searchInput), searchInput, tweetText);\n if(tweetText.toLowerCase().includes(searchInput)){\n searchResult.push(tweetDatabase[i])\n }\n }\n\n //changes view to only filtered tweets\n document.getElementById(\"response\").innerHTML =\n createContainer(searchResult);\n\n}", "title": "" }, { "docid": "76e5f8d22cf895027796b9e7bfa0d4a3", "score": "0.55480963", "text": "search(searchPhrase, list) {\n return listOfResults;\n }", "title": "" }, { "docid": "0ff40004720b6bc21f9fab59b5e54b58", "score": "0.55324703", "text": "async function youtubeSearch(artist, track) {\n artist = artist.trim().replace(' ', '+');\n track = track.trim().replace(' ', '+');\n const fetchString = `https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&order=relevance&q=${artist}${track}&key=${youtubeKey}`;\n const response = await fetch(fetchString);\n return response.json();\n}", "title": "" }, { "docid": "eafa9e9154098cce894ac3d3918e6abb", "score": "0.5528187", "text": "function song() {\n\n spotify.search({ type: 'track', query: term }, function (error, data, response) {\n if (error && response.statusCode === 200) {\n return console.log('Error occurred: ' + err);\n }\n\n var song = data.tracks.items[0];\n\n var trackData = [\n \" Artist(s): \" + song.artists[0].name,\n \" Song Title: \" + song.name,\n \" Spotify Link: \" + song.external_urls.spotify,\n \" Album: \" + song.album.name\n ].join(\"\\n\\n\");\n console.log('\\n' + trackData);\n\n });\n}", "title": "" }, { "docid": "2408e13ca19ab84645df16ab51d98e0a", "score": "0.5525671", "text": "searchFilm(querystring) {\n querystring = querystring.toLowerCase();\n return this.filmsByTitleArray\n .filter(film => film.title.toLowerCase().includes(querystring));\n }", "title": "" }, { "docid": "2f6fad88decba6c230b1025c963ac979", "score": "0.55154425", "text": "function itunesSearch(searchText) {\n addScript('https://itunes.apple.com/search?term=' \n + searchText \n + '&media=music&entity=musicArtist&limit=1&callback=updateItunesButton', \n updateItunesButton);\n }", "title": "" }, { "docid": "6fbc9a67df7af9b7a3db0c5121ea069f", "score": "0.5512384", "text": "function searchSC(sTerm){\n if (sTerm == \"\") {\n $('#error').empty();\n $('#error').append(\"<p>Please enter valid Search Term</p>\");\n //console.log(\"User cancelled the prompt.\");\n } else {\n $('#error').empty();\n //this is where we search if the user has completed a field\n SC.get('/tracks', {\n q: searchTerm\n //genre: genre,\n //user: artist\n }).then(function(tracks) {\n console.log(tracks);\n if(tracks.length == 0){\n console.log(\"no tracks\");\n $('#error').empty();\n $('#error').append(\"<p>No Matches Please Try again</p>\");\n }\n //\n $('#songTable tr').not(':first').remove();\n\n for(var i = 0; i<tracks.length; i++){\n\n var trackName = tracks[i].title;\n var artistName = tracks[i].user.permalink;\n var imgURL = tracks[i].artwork_url;\n var trackURL = tracks[i].permalink_url;\n var trackURI = tracks[i].uri;\n\n // create row for each song\n var songRow = '';\n //format the song table row\n songRow += '<tr data-uri=\"' + trackURI + '\" data-url=\"'+trackURL\n +'\" data-img=\"'+imgURL+'\" data-title=\"'+trackName+'\" data-artist=\"'\n +artistName+'\"><td>' + trackName + '</td><td>' + artistName\n + '</td></tr>';\n $('#songTable tr').first().after(songRow);\n\n } // end of for loop\n\n });// end of tracks search returnx\n\n } //end of search complete\n\n }//end of seach soundcloud", "title": "" }, { "docid": "0cec7601dca7bd81f86d5bd32f0251ed", "score": "0.55113864", "text": "function search() {\n param = \"keywords=\";\n gameName = searchBar.value;\n gameName = gameName.replace(/[<>]/g, '');\n plat = platform.options[platform.selectedIndex].value;\n if(plat != '') plat = '+' + plat;\n results.innerHTML = \"<p>Searching eBay for \" + gameName + \"...</p>\";\n keywords = gameName.replace(/[';:!$#&^@,/\\\\`{}*\\[\\]()]/g, '');\n keywords += plat;\n keywords = encodeURIComponent(keywords);\n param += keywords;\n requestData();\n}", "title": "" }, { "docid": "0e85b3e18d3c6b87ac09c707e1986090", "score": "0.5507595", "text": "searchRequest(query, tags, // the ?: indicates optional\n categories, // the ?: indicates optional\n mime_types, // the ?: indicates optional\n hashes, // the ?: indicates optional\n required) {\n return this._fetch({\n method: 'post',\n url: `${this.endpoint}/${this.version}/lens/search`,\n data: {\n query,\n tags,\n categories,\n mime_types,\n hashes,\n required,\n },\n })\n .then(res => res.data);\n }", "title": "" }, { "docid": "d90c4a5b21800671bf9c0ce6b8b41e85", "score": "0.55064774", "text": "function search_tags(tag){\n\t\t$.ajax({\n\t\t\ttype\t\t\t: \"POST\",\n\t\t\turl\t\t\t\t: base_url+\"admin/search_tags\",\n\t\t\tdata\t\t\t: { tag: tag },\n\t\t\tsuccess\t\t\t: function(response){ auto_suggest_tags(response); },\n\t\t\terror\t\t\t: function(response){ handle_error('Server could not complete the request. Please check that the website is available and try again.'); }\n\t\t});\n\t}", "title": "" }, { "docid": "9f826f9a4427a3496ba1e313aa33ff68", "score": "0.5506124", "text": "function loadExtendedResults(needle, results){\r\n\t\tif($(\"#searchBox\").val() != needle) return;\r\n\t\tfor(var i=30; i<results.length; i++){\r\n\t\t\tvar item = results[i];\r\n\t\t\tTermManager.addTerms(item.keywords);\r\n\t\t\tDomainManager.addDomain(item.domain.favUrl, item.domain.name);\r\n\t\t\tStreamManager.addStream(item.stream);\r\n item.id = i;\r\n self.results[i] = item;\r\n\t\t\tdisplayItem(item);\r\n\t\t}\r\n\t\tTermManager.display();\r\n\t\tDomainManager.display();\r\n\t\tStreamManager.display();\r\n itemTable.display();\r\n analytics(\"YouPivot\", \"Search: \"+needle, {action: \"search\", needle: needle});\r\n\t}", "title": "" }, { "docid": "29f7f813793d8fe8ce8e9a3fe4688ee3", "score": "0.5502945", "text": "function search(search){\n if(search){\n window.open(\"https://www.google.com/search?q=intitle:\\\"index.of\\\" (wma|mp3|midi) \"+search,\"_self\");\n }\n}", "title": "" }, { "docid": "a1f786705764a0925f69b6f24535aeed", "score": "0.5498806", "text": "function search(items, term) {\n results = [];\n if (term === undefined) {\n return searchables;\n }\n _.each(items, function(item) {\n var q;\n var keys = (item.UID + ' ' + item.Title + ' ' + item.path + ' ' + item.portal_type).toLowerCase();\n if (typeof(term) === 'object') {\n for (var i = 0; i < term.length; i = i + 1) {\n q = term[i].toLowerCase();\n if (keys.indexOf(q) > -1) {\n results.push(item);\n break;\n }\n }\n } else {\n q = term.toLowerCase().replace('*', '');\n if (keys.indexOf(q) > -1) {\n results.push(item);\n }\n }\n });\n }", "title": "" }, { "docid": "3486265c5458a23e42df49a8710432d9", "score": "0.5497229", "text": "function searchWithKeywords(keywords){\n\tvar obj={};\n\tfor(i = 0; i < sessionStorage.length; i++){\n\t\tif(sessionStorage.key(i).indexOf('_smry') < 0 && sessionStorage.key(i).indexOf('extractVar') < 0 && sessionStorage.key(i).indexOf('_keyword') < 0){\n\t\t\tvar data = new FormData();\n\t\t\tdata.append('data', sessionStorage.getItem(sessionStorage.key(i)));\n\t\t\tdata.append('keywords', keywords);\n\n\t\t\tvar ourRequest = new XMLHttpRequest();\n\t\t\tourRequest.open('POST', \"/fetchFilteredSummaries\", false);\n\n\t\t\tourRequest.onreadystatechange = function() {\n\t\t\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\t\t\tif(ourRequest.responseText != 'Empty File') {\n\t\t\t\t\t\tobj[sessionStorage.key(i) + \"_smry\"]=ourRequest.responseText;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\n\t\t\t\t}\n\t\t\t};\n\t\t\tourRequest.send(data);\n\t\t}\n\t}\n\treturn obj;\n}", "title": "" }, { "docid": "3103982b466d796bf95e493f3fa0969c", "score": "0.54902387", "text": "getPetsByTags({tags}) {\n // if there exists a common tag name between \n return pets.filter(p => p.tags.some(t => tags.map(t2 => t2.name).includes(t.name)))\n }", "title": "" }, { "docid": "c08755eb753c4c57b7fd2638917caf21", "score": "0.54872197", "text": "function spotifyThis() {\n\n if (input === \"\") input = \"the sign ace of base\"\n \n spotify\n .search({\n type: 'track',\n query: input\n })\n .then(function (response) {\n for (var k = 0; k < response.tracks.items.length; k++) {\n console.log(\"---------------------\");\n console.log(\"Artist: \", response.tracks.items[k].artists[0].name);\n console.log(\"Song Name: \", response.tracks.items[k].name);\n console.log(\"Preview Link: \", response.tracks.items[k].external_urls.spotify);\n console.log(\"Album Name: \", response.tracks.items[k].album.name);\n console.log(\"---------------------\");\n }\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "title": "" }, { "docid": "e421f8f4741a58ff3ad43fb57b301a11", "score": "0.5486245", "text": "function getEntityTags(entityName, searchValue){\n searchValue = searchValue || \"\"; \n var filter = {\n \"where\":{\n \"name\":{\"like\": searchValue + \".*\", \"options\":\"i\"}, \n \"useWith\": entityName\n }, \n \"fields\":[\"name\",\"id\"]\n }; \n\n return Tag.find({\"filter\": filter}).$promise\n }", "title": "" }, { "docid": "98d6bb8539e47af3e4d79468b7958a3d", "score": "0.5485443", "text": "function search(addToHistory){\n var query = $('#searchBox').val().split(\"<script>\").join(\"\").split(\"</script>\").join(\"\");\n\n while(query.includes(\"<script>\") || query.includes(\"</script>\")){\n query = query.split(\"<script>\").join(\"\").split(\"</script>\").join(\"\");\n }\n\n if(addToHistory){\n if(queryHistory.getMostRecentQuery() == query){ //Don't add a new entry for the history if the user is just modifying the latest query (Ex. adding/removing tags)\n queryHistory.setTag(0, searchTags.toString()); //Just update the tags for the latest entry\n addToHistory = false;\n }\n }\n\n var tags = searchTags.getQuerySyntax();\n\n if(query == \"\" && tags == ''){ //Don't make empty queries\n return;\n }\n\n reset();\n\n JavaBridge.searchButtonClicked(query, tags, searchMethod, addToHistory); //Call JavaBridge to execute the actual query\n hideAutoQueryIcon();\n}", "title": "" }, { "docid": "1e25c331c7afe9b0d19ef251798bc455", "score": "0.54834735", "text": "function search(people) {\r\n\t\t\r\n\t}", "title": "" }, { "docid": "64e7ce76c7af9f34ae8b19d6244c82d3", "score": "0.5479034", "text": "function listSongs(query) {\n SC.get(\"/tracks/\", { limit: 10, q: query }, function(tracks) {\n //store result for later\n result = tracks;\n\t\t\n\t\t$(\"#content\").html(\"<h2>Search Results</h2>\");\n \n //populate new values\n for(var i in tracks) {\n var curTrack = tracks[i];\n \n trackListing.append(\n \"<li><span>\" + curTrack.title + \"</span><span data-index='\" + i + \"' class='addToPlaylist'>Add to Playlist</span></li>\"\n );\n }\n });\n}", "title": "" }, { "docid": "8f70d345dffa33abfffca3c0eadfb317", "score": "0.54790205", "text": "function searchAlbumList(searchTerm) {\n const term = searchTerm.toLowerCase();\n if(term === \"\") {\n setAlbumList(albums);\n } else {\n setAlbumList(() => {\n return albums.filter((albumItem, index) => {\n return albumItem.album.toLowerCase().includes(term) || albumItem.artist.toLowerCase().includes(term); // Filter returns both albums and artists that include the term\n });\n });\n } \n }", "title": "" } ]
da2ca5e9c65bd542b00293bf27f661b6
Support push of new workspace. Other events can be added.
[ { "docid": "29852d802c694b7ade220def7e8ab55a", "score": "0.0", "text": "push(obj){\n this.array.push(obj);\n this.emit('change', {flag: 'insert', data: obj});\n }", "title": "" } ]
[ { "docid": "51099eb8b67c54870d0c7f195c4c4a7f", "score": "0.6225684", "text": "function PushEvent() {}", "title": "" }, { "docid": "1a96bcd5602c822bea2d6cd66da990eb", "score": "0.6034434", "text": "function push(event) {\n\tpublish();\n}", "title": "" }, { "docid": "f97b8a157339fce399ce6c77d6daa874", "score": "0.5965229", "text": "function workspaceStart () {\r\n\r\n}", "title": "" }, { "docid": "ff9c291cbc6de082faedd53fb07a1708", "score": "0.5871302", "text": "clickNewWorkspace() {\n\t\treturn this.createWorkspace.click();\n\t}", "title": "" }, { "docid": "406e4ac3c134b2555948553b132e70b4", "score": "0.58618593", "text": "function push(){\n\tcontext.save();\n}", "title": "" }, { "docid": "f605281b9204a818814be5969ca0aef3", "score": "0.5699283", "text": "push({stack,data,owner}) { this.$publish('push', {stack,data,owner})}", "title": "" }, { "docid": "327ff2eec5aebf144fdff5fe0a8dbf0e", "score": "0.56191915", "text": "function LogNewProjects() {\n // Check state of play by using LogNewProjects.event as a 'static' variable for our event\n if (typeof LogNewProjects.event == 'undefined' ) {\n // Start the watch\n (LogNewProjects.event = Instance.OnNewProject()).watch(function(e, res) {\n if (e)\n console.error(e);\n else{\n // OnNewProject(uint indexed Id, address indexed OwnerA, bytes32 NameS, uint TargetWei, uint DeadlineT, address CreatorA, uint WhenT);\n console.log('NewProject: Project '+res.args.Id.toNumber()+' '+web3.toUtf8(res.args.NameS)+', owned by '+res.args.OwnerA+', target '+ WeiToEtherDec2(res.args.TargetWei, \"ether\")\n +', deadline '+GmtNixBnDateS(res.args.DeadlineT)+' GMT, created by '+res.args.CreatorA+' @ '+GmtNixBnDateS(res.args.WhenT)+' GMT');\n }\n });\n }else{\n // Watch is running. Stop it and delete the 'static'\n LogNewProjects.event.stopWatching();\n delete LogNewProjects.event;\n }\n}", "title": "" }, { "docid": "8ff5024c5fd5b6a14edd6f32d6c8ae4a", "score": "0.56115", "text": "function newProjectEvent() {\n newProjectDialog.show();\n}", "title": "" }, { "docid": "48f6f88e348b5849f294744e0c492022", "score": "0.5605295", "text": "push() {\n \n }", "title": "" }, { "docid": "4f8b8be0602f7913488f2cae1b2057f1", "score": "0.55699235", "text": "async addToDock () {\n await atom.workspace.open(await this.getInstance(), {\n activateItem: atom.config.get(`${PLUGIN_NAME}.dock.isActive`),\n activatePane: atom.config.get(`${PLUGIN_NAME}.dock.isVisible`),\n location: atom.config.get(`${PLUGIN_NAME}.dock.position`)\n });\n\n this.handleEvents();\n }", "title": "" }, { "docid": "4309c29a126d7cbb0407abd2c57800ec", "score": "0.5557147", "text": "function createNewProject() {\r\n\tvar requestData = '{'\r\n\t\t\t+ '\"command\" : \"createProject\",'\r\n\t\t\t+ '\"arguments\" : {'\r\n\t\t\t+ '\"project\" : \"' + $('#new-project-name').val() + '\"'\r\n\t\t\t+ '}'\r\n\t\t\t+ '}';\r\n\tmakeAsynchronousPostRequest(requestData, refresh, null);\t// Defined in \"/olive/scripts/master.js\".\r\n}", "title": "" }, { "docid": "808ba71089ba819ac9b73aa52e93686f", "score": "0.5528271", "text": "push() {\n push();\n }", "title": "" }, { "docid": "e339ceb1f4e1b160797c84f4ffb7c857", "score": "0.5499292", "text": "function addWorkspaceInfo() {\n let propertyAddress = document.getElementById(\"propertySelect\").value;\n let type = document.getElementById(\"workspaceType\").value;\n let cap = document.getElementById(\"capcity\").value;\n let price = document.getElementById(\"price\").value;\n let avaliable = document.getElementById(\"date\").value;\n let term = document.getElementById(\"term\").value;\n let smoke = document.getElementById(\"smoke\").value;\n let activeUser = JSON.parse(sessionStorage.getItem('activeUser'));\n\n\n if (!sessionStorage.getItem('login')) {\n\n confirm(\"You must login or sign up to create a workspace\")\n\n\n } else if (addressMatch(propertyAddress) === false) {\n alert(\"Property address doesnt exist\")\n } else if (activeUser.accountType == 'Coworker') {\n alert(\"You must be an owner to add workspace\")\n } else if (propertyAddress == \"\" || type == \"\" || cap == \"\" || price == \"\" || avaliable == \"\" || term == \"\" || smoke == \"\") {\n alert(\"Please fill out all fields\")\n } else if (cap <= 0) {\n alert(\"Please enter a valid price\")\n } else if (price <= 0) {\n alert(\"Please enter a valid price\")\n } else {\n let workspaces = {\n id: idMaker(),\n email: activeUser.email,\n propertyAddress: propertyAddress,\n type: type,\n capcity: cap,\n price: price,\n avaliable: avaliable,\n term: term,\n smoke: smoke,\n }\n\n workspacesData = JSON.parse(localStorage.getItem(\"workspaces\")) || [];\n\n workspacesData.push(workspaces);\n localStorage.setItem(\"workspaces\", JSON.stringify(workspacesData));\n workspacesData = localStorage.getItem(\"workspaces\");\n workspacesData = JSON.parse(workspacesData);\n document.getElementById(\"workspaceForm\").reset();\n alert(\"Workspace had been created.\")\n }\n}", "title": "" }, { "docid": "c5c1946a681ddc6ed06823769bdcce43", "score": "0.54753566", "text": "handleEvents () {\n this.disposables.add(\n atom.commands.add('atom-workspace', {\n 'project-viewer-plus:open-database-file': () => {\n this.database.openFile();\n },\n 'project-viewer-plus:open-editor': () => {\n this.projectViewer.openEditor();\n },\n 'project-viewer-plus:toggle-visibility': () => {\n this.projectViewer.toggleVisibility();\n },\n 'project-viewer-plus:toggle-focus': () => {\n this.projectViewer.toggleFocus();\n },\n 'project-viewer-plus:toggle-select-list': () => {\n this.projectViewer.toggleSelectList();\n }\n }),\n atom.commands.add(this.projectViewer.element, {\n 'core:move-up': function () {\n devlog('core:move-up', this);\n },\n 'core:move-down': function () {\n devlog('core:move-down');\n },\n 'core:move-left': function () {\n devlog('core:move-left');\n },\n 'core:move-right': function () {\n devlog('core:move-right');\n },\n 'core:confirm': function () {\n devlog('core:confirm');\n }\n }),\n atom.workspace.getLeftDock().onDidStopChangingActivePaneItem(\n item => this.handlePositionChange('left', item)\n ),\n atom.workspace.getRightDock().onDidStopChangingActivePaneItem(\n item => this.handlePositionChange('right', item)\n ),\n atom.config.onDidChange(`${PLUGIN_NAME}.dock.position`,\n () => {\n // TODO validate if it's better to use getInstance\n if (this.projectViewer) {\n this.projectViewer.destroy();\n }\n this.addToDock();\n }\n )\n );\n }", "title": "" }, { "docid": "29b4258b4fa691218f0ad155e7c7cac5", "score": "0.5421771", "text": "addNewEvent(event) {\n const events = {...this.state.events};\n const timestamp = Date.now();\n event.eventId = `evt${timestamp}`;\n events[`evt${timestamp}`] = event;\n\n base.push(`allEvents/evt${timestamp}`, {\n data: event\n }).then(() => {\n this.setState( { events });\n this.showNotifyr('New Event Added', 'notifyr-success');\n })\n }", "title": "" }, { "docid": "44878eb2f8a8b5bf2903adee37c765cd", "score": "0.54115695", "text": "async createWorkspace(createPayload){\n let workspace = new WorkspaceDto({\n workspaceName : createPayload.workspaceName,\n location : createPayload.location,\n attributes : createPayload.attributes,\n workspaceType : createPayload.workspaceType,\n status : createPayload.status\n })\n return await workspace.save(workspace);\n }", "title": "" }, { "docid": "4b788904b3983f1962135a6fb80b89b1", "score": "0.5366315", "text": "function addProject() {\n alert(\"Das neue Projekt wird nach Neustart der Anwendung angezeigt!\")\n let item_name = document.getElementById(\"p_name\").value;\n let item_description = document.getElementById(\"p_description\").value;\n let newProject = new Project(item_name, item_description);\n console.log(newProject);\n\n let json = JSON.stringify(newProject, null, '\\t');\n fs.writeFileSync(path.join(require('os').homedir() + \"/.pm-tool/\") + newProject.title.replace(/\\s+/g, '').toLowerCase() + '.json', json, 'utf-8');\n\n syncProjects();\n closeAddProject();\n reload();\n }", "title": "" }, { "docid": "49dbf34900b502cbf0c30ab6c0026345", "score": "0.5288329", "text": "pushData() {\n document.body.dispatchEvent(new CustomEvent('newData', {\n detail: {\n data: this.tasks,\n },\n }))\n }", "title": "" }, { "docid": "2922fa1ff57330ebf7b9c7bc9c316aaf", "score": "0.5250173", "text": "function newProject(){\r\n webengine.engine.runJavaScript(\"realoadWorkSpace()\",function(request){})\r\n}", "title": "" }, { "docid": "898034f01b7bb7fc6eabc84f0c33724c", "score": "0.5245312", "text": "addEvent(event) {\n // call write repo to save to event store\n writeRepo.enqueueEvent(event, function(offset) {\n CommonCommandHandler.sendEvent(event, offset);\n });\n }", "title": "" }, { "docid": "273c7ce5dbb8ae2dffbce936c0918074", "score": "0.5237482", "text": "addEvent(event) {\n // call write repo to save to event store\n writeRepo.enqueueEvent(event, function(offset) {\n handler.sendEvent(event, offset);\n });\n }", "title": "" }, { "docid": "396f84427ebc3a1ac81530584f786a82", "score": "0.52342814", "text": "addCommand(workspaceId, command) {\n return this.remoteWorkspaceAPI.addCommand({workspaceId : workspaceId}, command).$promise;\n }", "title": "" }, { "docid": "8287a96882981ad701981e4247a34a1e", "score": "0.5210815", "text": "function pushEvent(pEvent) {\n var isNewEvent = new Boolean(true);\n for (var i=0;i<scEvents.length;i++) {\n if (scEvents[i] == pEvent) {\n isNewEvent = false;\n break;\n }\n }\n if (isNewEvent == true) {\n scEvents.push(pEvent);\n }\n}", "title": "" }, { "docid": "9da7701b9dd96c3e6b8c460cafdc5b8e", "score": "0.520014", "text": "function addToDock() {}", "title": "" }, { "docid": "dde8d796f14c866aab08f9f4e3585eaa", "score": "0.516387", "text": "function addToLocalStorage(e) {\n var storedStock = storage.get();\n var x = this.children;\n var name = $(x[1]).text();\n var exchange = $(x[2]).text()\n var symbol = $($(this)[0].firstChild).text();\n var stockToAdd = {\n 'Symbol': symbol,\n 'Name': name,\n 'Exchange': exchange\n };\n // console.log(stockToAdd);\n // console.log(storedStock.indexOf(stockToAdd) !== -1);\n // if(){}\n storedStock.push(stockToAdd);\n storage.set(storedStock);\n renderStored();\n\n }", "title": "" }, { "docid": "12b21eb281880012f8db5b8eb601ba8b", "score": "0.515679", "text": "onPush() {\n }", "title": "" }, { "docid": "4a11cf29444a48249b6f7c4204093a32", "score": "0.5143929", "text": "push(payload, silent) {\n /**\n * push action to be performed is checkout status is true.\n *\n * @type {any}\n */\n let pushOperation = async function( payload, silent ) {\n // adding payload path in files_inProgress list to track inprogress files.\n this.addInProgress(payload.path);\n let status_notification;\n if ( !silent ) {\n status_notification = messenger.info( ModuleMessage.STATS_CHECK, true );\n }\n\n // check status for all files and filders under payload.\n this.status( payload )\n .then( (statusList) => {\n // display notification if no changes found under payload.\n if ( statusList.length == 0 ) {\n if ( !silent ) {\n status_notification.dismiss();\n messenger.info( ModuleMessage.STATS_NO_CHANGE, false );\n this.removeInProgress(payload.path);\n }\n return;\n };\n // if changes found under payload then prepare promise for new and deleted files\n // under payload. Prepare promises for new and deleted files based on their state\n // this will add/ delete files under control of vlt.\n let promises = [];\n statusList.forEach(\n ( fileStatus ) => {\n let filePayload;\n switch ( fileStatus.status ) {\n case STATE.NEW:\n filePayload = new PayloadModel( `${payload.content_root}${fileStatus.path}` );\n\n promises.push(\n executor.run(\n prepare_command( filePayload, \"add\", `-v ${filePayload.path}` )\n )\n );\n\n break;\n\n case STATE.DELETE:\n filePayload = new PayloadModel( `${payload.content_root}${fileStatus.path}` );\n\n promises.push(\n executor.run(\n prepare_command( filePayload, \"delete\", `-v ${filePayload.path}` )\n )\n );\n break;\n }\n }\n );\n\n // after all promises for new and delete are complete then perform actual push command to\n // commit and send all changes to remote crx server.\n Promise.all( promises )\n .then( ( result ) => {\n // removing status notification.\n if ( !silent ) {\n status_notification.dismiss();\n }\n executor.run(\n prepare_command(payload, \"ci\", `-v ${payload.path} --force`)\n )\n .then( (stdout) => {\n handle_result( ModuleMessage.PUSH_SUCCESS, ModuleMessage.PUSH_FAILED, stdout, silent );\n this.removeInProgress(payload.path);\n })\n .catch( (error) => {\n messenger.error( ModuleMessage.PUSH_FAILED, true, error );\n this.removeInProgress(payload.path);\n });\n })\n })\n .catch( (error) => {\n if ( !silent ) {\n status_notification.dismiss();\n }\n messenger.error( ModuleMessage.STATS_ERROR, true, error );\n this.removeInProgress(payload.path);\n });\n\n }.bind(this);\n\n if (!this.isInProgress(payload.path)) {\n // checking checkout status for jcr root and calling push action based on results\n validate_checkout(payload.jcr_root)\n .then( (result) => {\n if ( result ) {\n pushOperation( payload, silent );\n } else {\n this.checkout( payload, silent )\n .then( (checkoutResult) => {\n pushOperation( payload, silent );\n });\n }\n });\n }\n }", "title": "" }, { "docid": "a67505834dd58cb4fa5ad9f415debd49", "score": "0.5125818", "text": "function saveEvent(eventData) \n{\n savedEvents.push(eventData);\n}", "title": "" }, { "docid": "4ac4941abd52433cdb83f6d561fb6bca", "score": "0.5117136", "text": "function createProject() {\n const theName= document.getElementById(\"projectName\").value;\n const newProject = new Project(theName);\n console.log(newProject);\n projects.push(newProject);\n settingLocalStorage();\n return newProject;\n}", "title": "" }, { "docid": "6cbbf30cfe439d8f78ea75c63c89a919", "score": "0.50888425", "text": "addItemToWorkspace(item, idProp = 'id') {\n const workspace$ = this.rxdux.dispatch({\n type: ADD_ITEM_TO_WORKSPACE,\n data: {id: item[idProp], item}\n }, this.namespace)\n .pipe(\n first(),\n tap(workspace => {\n this.hooks.onWorkspaceItemAdded$.next({item, workspace});\n })\n );\n\n workspace$\n .pipe(\n untilDestroyed(this, 'destroy')\n )\n .subscribe(() => {});\n return workspace$;\n }", "title": "" }, { "docid": "44fd82cf1e815c16fc303ed14001c801", "score": "0.50880015", "text": "createNewStack() {\n let stack = new Stack();\n this._stacks.push(stack);\n this._registers.push(null);\n this._callbackUpdateStack(\"register\", \"push\", null);\n this._updateStackGUI();\n return stack;\n }", "title": "" }, { "docid": "ee01a65b1742ac8c29f6ead236ecc333", "score": "0.5086483", "text": "function addWatchList(event) {\n if (!event.target.classList.contains(\"fa-plus-circle\")) return;\n const id = event.target.dataset.id;\n if (!watchList.includes(id)) {\n watchList.push(id);\n }\n localStorage.setItem(\"watchListItems\", JSON.stringify(watchList));\n}", "title": "" }, { "docid": "3038733d3e3f6b5a5929686f9e5ad7f2", "score": "0.5080983", "text": "async function createWorkspace(p, name) {\n await p.waitForSelector('#add-workspace');\n await p.click('#add-workspace');\n await p.waitForSelector('#workspace-name');\n await p.focus('#workspace-name');\n await p.keyboard.type(name);\n await p.click('#create-workspace');\n}", "title": "" }, { "docid": "d2704fbee6bb1b86c6d745029ea0416c", "score": "0.50751853", "text": "function push_some_notification() {\n monitoredItem.simulateMonitoredItemAddingNotification();\n }", "title": "" }, { "docid": "d2704fbee6bb1b86c6d745029ea0416c", "score": "0.50751853", "text": "function push_some_notification() {\n monitoredItem.simulateMonitoredItemAddingNotification();\n }", "title": "" }, { "docid": "1b3865e4d78cfb6186f85ce36a8bebc6", "score": "0.505718", "text": "get push() { return this._push; }", "title": "" }, { "docid": "1b3865e4d78cfb6186f85ce36a8bebc6", "score": "0.505718", "text": "get push() { return this._push; }", "title": "" }, { "docid": "1b3865e4d78cfb6186f85ce36a8bebc6", "score": "0.505718", "text": "get push() { return this._push; }", "title": "" }, { "docid": "1b3865e4d78cfb6186f85ce36a8bebc6", "score": "0.505718", "text": "get push() { return this._push; }", "title": "" }, { "docid": "4d171dbabdd6889ca84957894399e2f1", "score": "0.50540537", "text": "function addProject(e) {\n e.preventDefault();\n const projectName = projectInput.value;\n let projectsNames = projectPresence(projectName);\n if (projectName == \"\" || projectName == null) {\n alert(`Please enter a valid project name.`);\n } else if (projectsNames.indexOf(projectName) !== -1) {\n alert(`A project with same name already exists.`);\n } else {\n const newProject = createProject(projectName);\n projectInput.value = null;\n todoAppData[newProject[0]] = newProject[1];\n displayProject(newProject[0], newProject[1]);\n }\n}", "title": "" }, { "docid": "15c5ec7bab66722576438de04ced3a1f", "score": "0.50410676", "text": "function createProject(contentSection, myProject, mySavedProject) {\n let projectItem = document.getElementById('newProject').value;\n myProject.push(projectItem);\n placeInStorage(myProject);\n loadCreateNewProject(contentSection, myProject, mySavedProject);\n}", "title": "" }, { "docid": "9c85d7de9a394f3e16f53b1766bf6d43", "score": "0.50200737", "text": "function push() {\n var repo = h5p.push(function (error, result) {\n var result;\n if (error === -1) {\n result = color.yellow + 'SKIPPED' + color.default + lf;\n }\n else if (error) {\n result = color.red + 'FAILED' + color.default + lf + error;\n }\n else {\n result = color.green + 'OK' + color.default + ' ' + result + lf;\n }\n\n spinner.stop(result);\n push();\n });\n if (!repo) return; // Nothing to clone.\n var msg = 'Pushing \\'' + color.emphasize + repo + color.default + '\\'... ';\n var spinner = new Spinner(msg);\n}", "title": "" }, { "docid": "78d50498bf39564745e652c3e00c8f1d", "score": "0.5005546", "text": "function addNewSensor(req, res){\n\tvar json_responses = {};\n\tconsole.log(\"Inside sensor.js addProject\");\n\tvar projectName = req.param(\"projectName\");\n\tvar description = req.param(\"description\");\n\tvar testingType = req.param(\"testingType\");\n\tvar platform = req.param(\"platform\");\n\n\tmongo.connect(mongoURL, function() {\n\t\tconsole.log('connected to mongo at: ' + mongoURL);\n\t\tvar coll = mongo.collection('projectList');\n\t\t// Add project list starts here\n\t\tcoll.insert({projectName : projectName, description : description, testingType : testingType, platform : platform}, function(err,project){\n\t\t\tif (project) {\n\t\t\t\tconsole.log(\"Project list successfully inserted\");\n\t\t\t\tjson_responses.statusCode= 200;\n\t\t\t\tres.send(json_responses);\n\t\t\t}\n\t\t});\n\t})\n}", "title": "" }, { "docid": "cf1f373439b5a3b3e5c467caf954acf5", "score": "0.4991189", "text": "function addProjectEvents(button) {\n button.addEventListener(\"click\", () => projectSelect(button));\n button\n .querySelector(\"i\")\n .addEventListener(\"click\", (event) => projectDelete(event, button));\n}", "title": "" }, { "docid": "3f0bc8082fe6126401d281c8105fb811", "score": "0.49782", "text": "function createAddWindow() {\n\tif (!store.get('isConnected')&&!singlemode) {\n\t\twindow.sendData('MainWindow', 'NOCONNECTION')\n\t\treturn\n\t}\n\tif (!store.get('configSet') || !store.get('loginPassword')) {\n\t\twindow.sendData('MainWindow', 'ConfigError')\n\t\treturn\n\t}\n\twindow.sendData('MainWindow', 'removeStart')\n\n\twindow.createWindow('AddWindow', {\n\t\tbackgroundColor: '#303030',\n\t\tparent: 'MainWindow',\n\t\tshow: false,\n\t\tdarkTheme: true,\n\t\twidth: 800,\n\t\theight: 800,\n\t\ttitle: \"New Server\",\n\t\ticon: ICON_GLOBAL_PNG,\n\t\twebPreferences: {\n\t\t\tnodeIntegration: true\n\t\t}\n\t}, {\n\t\tpage: {\n\t\t\tpathname: path.join(__dirname, '/Pages/addWindow.html'),\n\t\t\tprotocol: 'file:',\n\t\t\tslashes: true,\n\t\t}\n\t},true)\n}", "title": "" }, { "docid": "faa91f74c89dc6d1253935a95fb9c939", "score": "0.49621496", "text": "pushSettings(){\n\n }", "title": "" }, { "docid": "72af05e5e8b22c613aa9051c880cb3c2", "score": "0.49556166", "text": "function workspaceHTML(workspace, workspaceName) {\n // Workspace buttons\n let opt = document.createElement(\"BUTTON\");\n opt.appendChild(document.createTextNode(workspaceName));\n opt.id = workspace + \"_btn\";\n //opt.className = \"workspace_btn btn btn-secondary\"\n opt.className = \"workspace_btn btn btn-secondary\";\n // Sends user to workspace view with the context of that workspace\n opt.onclick = function () { goToWorkspace(workspace, workspaceName) };\n\n // Opens context menu on right click of workspace button\n opt.oncontextmenu = function (event) { spawnContextMenu(\"workspace-button\", event, workspace) };\n\n let optRow = document.createElement(\"DIV\");\n optRow.classList.add(\"row\");\n optRow.appendChild(opt);\n\n let btns = document.getElementById(\"workspace_btns\");\n btns.appendChild(optRow);\n\n // JQTree divs for each workspace\n let treeDiv = document.createElement(\"DIV\");\n treeDiv.id = workspace + \"_tree\";\n treeDiv.classList.add(\"hidden\");\n let treeDisp = document.getElementById(\"tree_display\");\n treeDisp.appendChild(treeDiv);\n}", "title": "" }, { "docid": "f43d0f6ec7102dfc1a053930344a3ab4", "score": "0.49403274", "text": "function addEvent() {\n\n }", "title": "" }, { "docid": "909130b27d20cf0f4307a2144a7ebca6", "score": "0.4937626", "text": "function updateWorkspaceInfomation(id) {\n\n let popup = document.getElementById(\"popup\");\n let propertyAddress = document.getElementById(\"propertySelect\").value;\n let type = document.getElementById(\"workspaceType\").value;\n let cap = document.getElementById(\"capcity\").value;\n let price = document.getElementById(\"price\").value;\n let avaliable = document.getElementById(\"date\").value;\n let term = document.getElementById(\"term\").value;\n let smoke = document.getElementById(\"smoke\").value;\n let updateWorkspace = document.getElementById(\"workspaceUpdate\")\n let workspaceData = getWorkspaces();\n let activeUser = JSON.parse(sessionStorage.getItem('activeUser'));\n\n let index = workspaceData.findIndex(x => x.id === id)\n\n\n\n if (addressMatch(propertyAddress) === false) {\n alert(\"Property address doesnt exist\")\n } else if (propertyAddress == \"\" || type == \"\" || cap == \"\" || price == \"\" || avaliable == \"\" || term == \"\" || smoke == \"\") {\n alert(\"Please fill out all fields\")\n } else if (cap <= 0) {\n alert(\"Please enter a valid price\")\n } else if (price <= 0) {\n alert(\"Please enter a valid price\")\n } else {\n workspaceData.splice(index, 1)\n let workspaces = {\n id: id,\n email: activeUser.email,\n propertyAddress: propertyAddress,\n type: type,\n capcity: cap,\n price: price,\n avaliable: avaliable,\n term: term,\n smoke: smoke,\n }\n\n workspaceData.push(workspaces);\n localStorage.removeItem('workspaces', index)\n localStorage.setItem(\"workspaces\", JSON.stringify(workspaceData));\n popup.style.display = \"none\";\n updateWorkspace.style.display = \"none\"\n alert(\"Workspace has been updated.\")\n location.reload();\n }\n\n\n}", "title": "" }, { "docid": "a2197eacef0353fec0837e8f0364ef53", "score": "0.49325788", "text": "function on_ok() {\n let filepath = env.notebook.notebook_path;\n\n // Read data from modal form\n let push_changes = $('#push-changes').is(':checked');\n let message = $('#commit-message').val().trim();\n \n // Do some form validation\n $('.form-validation').remove();\n if (message == '') {\n $('#commit-message').after($('<p/>').addClass('form-validation text-danger').text(\"Commit Message is required\"));\n return;\n }\n\n // Construct data payload for API call\n let payload = {\n files: [filepath],\n message: message\n }\n\n var settings = Object.assign({\n url : env.notebook.base_url + 'git/commit',\n type : 'PUT',\n data: JSON.stringify(payload)\n }, settings_template);\n\n if(push_changes) {\n let _success = settings.success;\n settings.success = function(data) {\n _success(data);\n push();\n }\n }\n\n // Trigger notebook save and make commit-push request once saved\n $.when(env.notebook.save_notebook()).then(function(data) {\n // Send request to API\n $.ajax(settings);\n }, function(error) {\n gitUtils.createNotification(\"Failed to save notebook. Save required to commit notebook\", true);\n });\n\n\n // Dismiss modal manually\n $('.modal').modal('hide');\n }", "title": "" }, { "docid": "aa9dd6035681c255c9c2d7687bad460f", "score": "0.4906214", "text": "addOperation (stackName, operation) {\n let stacks = this.get('stacks');\n let opClone = cloneObject(operation, true);\n opClone.startedAt = new Date().getTime();\n // if we don't have a stack with this name, create one\n if (!stacks[stackName]) {\n Ember.set(stacks, stackName, {\n current: opClone,\n completed: []\n });\n } else {\n // use the existint stack\n let activeStack = stacks[stackName];\n if (activeStack.current) {\n activeStack.current.completedAt = new Date().getTime();\n activeStack.completed.push(cloneObject(activeStack.current, true));\n }\n activeStack.current = opClone;\n }\n }", "title": "" }, { "docid": "749354d6428389136a6d59d5b98ff065", "score": "0.4903042", "text": "async addNewLogWork(event) {\n event.preventDefault();\n if (!_this.validateForm())\n return;\n\n // send request\n const logwork = _this.state.logwork;\n delete logwork._id;\n const resp = await newLogWork(logwork);\n if (resp) {\n _this.msgUpdate('OK', 'Success!!');\n _this.props.isNewFnc();\n _this.clearInputs();\n _this.props.updateTable();\n _this.getProjects()\n\n } else {\n _this.msgUpdate('ERR', 'ERR!!');\n }\n }", "title": "" }, { "docid": "2e9331c8519b40f5e2e01238c1648f56", "score": "0.48796448", "text": "function pushPlayList(uri, text, callback){\r\n //push to stack\r\n //update playlist in db\r\n playListStack.push({ url: uri, name: text});\r\n if(callback){\r\n callback();\r\n }\r\n}", "title": "" }, { "docid": "624fd1c2c07da1ebe0bb0410c59ef60b", "score": "0.48717028", "text": "AddEvent() {}", "title": "" }, { "docid": "991c4527d2043f497698450de5ae4fad", "score": "0.48549464", "text": "function push(operation, data) {\n\n let info = {\n operation: operation,\n data: data\n }\n\n const json = JSON.stringify(info)\n const dbData = json // json.replace(/\"|\"/g, '\\\\\"')\n log('DB PUSH [' + listName+ '] ' + dbData)\n let r = client.rpush( listName, dbData)\n log('rpush returned ' + r)\n}", "title": "" }, { "docid": "2f2ce5f616afc36a9bd5a62a900eda0a", "score": "0.4853732", "text": "updateWorkspace () {\n this.setState({dialogWorkspace: false});\n Utils.setItem(\"@workspace\", this.state.workspace);\n this.props.updateWorkspace(this.state.workspace);\n }", "title": "" }, { "docid": "3215e5f8f3c38e34d2569f6402adf3c4", "score": "0.48513877", "text": "function selectWorkspace(index) {\n // send workspace name to sessionStorage so that open/close\n // button know what workspace to operate on\n localStorage.setItem('selectedWorkspace', index);\n}", "title": "" }, { "docid": "68477a17892c3d93a80a724aaec58671", "score": "0.48411414", "text": "function addProject(contentSection, myProject, mySavedProject) {\n const addCreateButton = document.querySelector('#button');\n\n addCreateButton.innerHTML = `<nav class = 'button'>\n <ul>\n <button id = 'create'>Create</a></li>\n </ul>\n </nav>\n `;\n\n create.addEventListener('click', () => {\n createProject(contentSection, myProject, mySavedProject);\n });\n}", "title": "" }, { "docid": "9a10f9f7e99622953dfdc23b95344965", "score": "0.4838444", "text": "function newProjectInputKeyup(event) {\n if (event.keyCode === 13) {\n document.querySelector(\"#add-project-popup-add\").click();\n }\n}", "title": "" }, { "docid": "094ffe5a305922610418c3a75e4aff29", "score": "0.48371032", "text": "function addProject(project) {\n if (project !== null) {\n removeProject(project);\n projects.push(project);\n $('#projects').append($buildProjectCard(project));\n updateSpaceInfo();\n }\n}", "title": "" }, { "docid": "194525ce68c4dc8a752e5919bb9fc47d", "score": "0.48325828", "text": "onProjectCreated() {\n\t\t\tthis.refresh();\n\t\t}", "title": "" }, { "docid": "183fe98820a2b0fb48ebf1c9cef8b8e7", "score": "0.48306432", "text": "addProject(title, description, numOfPeople) {\n //Creating a new project with the input\n const newProject = new _project__WEBPACK_IMPORTED_MODULE_0__.Project(Math.random().toString(), title, description, numOfPeople, _project__WEBPACK_IMPORTED_MODULE_0__.ProjectStatus.Active);\n //Adding the project to the project list\n this.projects.push(newProject);\n this.updateListeners();\n }", "title": "" }, { "docid": "affcc104bc0ad3928a887e709df12488", "score": "0.48293397", "text": "onAddToWorld() {}", "title": "" }, { "docid": "9a4ff754917e9092163550f5fe4110c9", "score": "0.48260817", "text": "function Workspace(object) {\n this._object = object;\n}", "title": "" }, { "docid": "079f6f96d304a91b7dc9f36736f645d3", "score": "0.4817744", "text": "createTaskList() {\n // push \n this.data.currentProject.taskLists.push(this.data.newTaskList);\n\n // reset new taskList\n this.data.newTaskList = {\n name: \"\",\n watch: false,\n color: \"\",\n cards: [],\n cardOrderStyle: \"alphabetical\",\n showModal: false,\n createNewCard: false\n }\n }", "title": "" }, { "docid": "f8ff86a2735a9b3cdc239a419c3c1485", "score": "0.48146823", "text": "function addPush(db, text) {\n return new Promise((resolve, reject) => {\n const transaction = db.transaction([\"pushes\"],\"readwrite\");\n const store = transaction.objectStore(\"pushes\");\n const req = store.add({ payload: text });\n req.onerror = e => reject(e);\n req.onsuccess = e => resolve(e);\n })\n}", "title": "" }, { "docid": "cbecee00e28ee68f43246916cf32e890", "score": "0.4813436", "text": "push() {}", "title": "" }, { "docid": "f022521e9f3be565ad8a825546e84779", "score": "0.4803425", "text": "function onProjectNext() {\n\n\t// Create or save the project\n\tif (newProject)\n\t\twriteProject(project, !!folderName, false);\n\telse\n\t\twriteProject(project, true, false);\n\n}", "title": "" }, { "docid": "ef3bc8a07c4991497e7ba4aac742b03b", "score": "0.48028395", "text": "function pushLocal() {\n var localCheck = localStorage.getItem('jsonFile');\n if (localCheck == null) {\n var json = { \"theTask\": arrTask };\n var jsonStr = JSON.stringify(json);\n localStorage.setItem(\"jsonFile\", jsonStr);\n } else {\n var arryfromLocal = outFromLocal()\n newArryTask(arryfromLocal);\n var json = { \"theTask\": arrTask };\n var jsonStr = JSON.stringify(json);\n localStorage.setItem(\"jsonFile\", jsonStr);\n }\n}", "title": "" }, { "docid": "24c11a0622672eb4c1bb7e77da5762cf", "score": "0.47995013", "text": "function addNewVariable(event) {\n if (ctrl.isFunctionDeploying()) {\n return;\n }\n\n $timeout(function () {\n if (ctrl.variables.length < 1 || lodash.chain(ctrl.variables).last().get('ui.isFormValid', true).value()) {\n ctrl.variables.push({\n name: '',\n value: '',\n ui: {\n editModeActive: true,\n isFormValid: false,\n name: 'variable'\n }\n });\n\n ctrl.environmentVariablesForm.$setPristine();\n\n $rootScope.$broadcast('change-state-deploy-button', {\n component: 'variable',\n isDisabled: true\n });\n event.stopPropagation();\n }\n }, 50);\n }", "title": "" }, { "docid": "d8dbaabe2d4525f79a1753147751c87c", "score": "0.4796129", "text": "function event_add_event()\n{\n\tvar descr = L_mymodel.get(\"event_description\");\n\tvar type = L_mymodel.get(\"event_type\");\n\tvar mydate = L_mymodel.get(\"date\");\n\tmydate = dd_mname_yyyy_to_mysql(mydate); \n\tvar mytime = L_mymodel.get(\"time\");\t\n\tvar the_datetime = mydate.substr(0,10) + \" \" + mytime;\n\t\n\tadd_event ( the_datetime, G_selected_team, type, descr)\n\tprocess_events_queue (events_cb);\n}", "title": "" }, { "docid": "04f0ca0155bc305c92feabb9c6bad622", "score": "0.47941786", "text": "pushPlaylist() {\n\t\tif (this.host) {\n\t\t\tconst playlist = this.host.playlist.serializeGuest(this);\n\t\t\tthis.socket.emit('setPlaylist', {playlist});\n\t\t}\n\t}", "title": "" }, { "docid": "362b5cebd45054b97dab26d88333f0ee", "score": "0.47889432", "text": "function initEventHandlers() {\n // Leave editor page exit processing\n leavePageHandler();\n\n // Dialog Windows\n newProjectDialog.initEventHandlers();\n openProjectDialog.initEventHandlers();\n importProjectDialog.initEventHandlers();\n\n // Update the blockly workspace to ensure that it takes\n // the remainder of the window.\n window.addEventListener('resize', () => resetToolBoxSizing(100));\n\n // ----------------------------------------------------------------------- //\n // Left side toolbar event handlers //\n // ----------------------------------------------------------------------- //\n // Compile the program\n document.getElementById('prop-btn-comp')\n .addEventListener('click', () => compile());\n\n // Load the program to the device RAM\n document.getElementById('prop-btn-ram')\n .addEventListener('click', () => loadInto(\n 'Load into RAM', 'bin', 'CODE', 'RAM'));\n\n // Load the program into the device EEPROM\n document.getElementById('prop-btn-eeprom')\n .addEventListener('click', () => loadInto(\n 'Load into EEPROM', 'eeprom', 'CODE', 'EEPROM'));\n\n // Open a serial terminal window\n document.getElementById('prop-btn-term')\n .addEventListener('click', () => serialConsole());\n\n // Open a graphing window\n document.getElementById('prop-btn-graph')\n .addEventListener('click', () => graphingConsole());\n\n // Init C source editor toolbar event handlers\n initCSourceEditorButtonEvenHandlers();\n\n // The event handler is just stub code.\n // const termGraphSetup = document.getElementById('term-graph-setup');\n // termGraphSetup.addEventListener('click', () => configureTermGraph());\n // $('#term-graph-setup').on('click', () => configureTermGraph());\n\n // Close upload project dialog event handler\n document.getElementById('upload-close')\n .addEventListener('click', () => clearUploadInfo());\n\n\n // **********************************\n // ** Toolbar - right side **\n // **********************************\n\n // Project Name listing\n projectNameUIEvents();\n\n // Blocks/Code/XML button\n document.getElementById('btn-view-propc')\n .addEventListener('click', () => renderContent('tab_propc'));\n\n document.getElementById('btn-view-blocks')\n .addEventListener('click', () => renderContent('tab_blocks'));\n\n document.getElementById('btn-view-xml')\n .addEventListener('click', () => renderContent('tab_xml'));\n\n // New Project toolbar button\n // TODO: New Project should be treated the same way as Open Project.\n document.getElementById('new-project-button')\n .addEventListener('click', () => newProjectEvent());\n\n // Open Project toolbar button\n document.getElementById('open-project-button')\n .addEventListener('click', () => openProjectEvent());\n\n // Save Project toolbar button\n document.getElementById('save-btn')\n .addEventListener('click', () => saveProject());\n document.getElementById('save-project')\n .addEventListener('click', () => saveProject());\n\n // Save project nudge dialog onclose event handler\n // Not implemented\n // $('#save-check-dialog').on('hidden.bs.modal', () => {\n // logConsoleMessage('Closing the project save timer dialog.');\n // });\n\n // --------------------------------\n // Hamburger menu items\n // --------------------------------\n\n // Edit project details\n document.getElementById('edit-project-details')\n .addEventListener('click', () => {\n editProjectDialog.editProjectDetails();\n });\n\n // Help and Reference - online help web pages\n // Implemented as an href in the menu\n\n // ---- Hamburger drop down horizontal line ----\n\n // Download project to Simple IDE\n // TODO: Investigate why downloadPropC() is missing.\n document.getElementById('download-side')\n .addEventListener('click', () => downloadPropC());\n\n // Import project file menu selector\n // Import (upload) project from storage. This is designed to merge code from an existing\n // project into the current project or to simply replace the contents of the current\n // project with the contents of the imported project.\n document.getElementById('upload-project')\n .addEventListener('click', () => importProjectDialog.show());\n\n // ---- Hamburger drop down horizontal line ----\n\n // Configure client menu selector\n // Client configuration is only possible with the deprecated\n // BlocklyProp Client. The BlocklyProp Launcher does not require\n // a configuration dialog\n // TODO: Client configuration is deprecated. No needed for Launcher\n document.getElementById('client-setup')\n .addEventListener('click', configureConnectionPaths, false);\n\n // ---- Hamburger drop down horizontal line ----\n\n // About Solo\n document.getElementById('editor-about')\n .addEventListener('click', showEditorAbout, false);\n\n // Display the license in a modal when the link is clicked\n document.getElementById('editor-license')\n .addEventListener('click', showLicenseEventHandler, false);\n\n // --------------------------------\n // End of hamburger menu items\n // --------------------------------\n\n\n // Save As button\n document.getElementById('save-as-btn')\n .addEventListener('click', () => saveAsDialog());\n\n // Save As new board type\n document.getElementById('save-as-board-type')\n .addEventListener('change', () => {\n const dialogSender = document.getElementById('saveAsDialogSender');\n checkBoardType(dialogSender.html());\n });\n\n // popup modal\n document.getElementById('save-as-board-btn')\n .addEventListener('click', () => {\n saveProjectAs(\n document.getElementById('save-as-board-type').innerText,\n document.getElementById('save-as-project-name').innerText,\n );\n });\n\n document.getElementById('btn-graph-play')\n .addEventListener('click', ()=> graphPlay(''));\n\n document.getElementById('btn-graph-snapshot')\n .addEventListener('click', () => downloadGraph());\n\n document.getElementById('btn-graph-csv')\n .addEventListener('click', () => downloadCSV());\n\n document.getElementById('btn-graph-clear')\n .addEventListener('click', () => graphStartStop('clear'));\n\n document.getElementById('comPort')\n .addEventListener('change', (event) => {\n logConsoleMessage(`Selecting port: ${event.target.value}`);\n clientService.setSelectedPort(event.target.value);\n propToolbarButtonController();\n });\n\n // These elements appear more than once in the HTML page. We are adding a\n // listener to each matching element.\n let matchingElements = document.getElementsByClassName('show-os-win');\n if (matchingElements && matchingElements.length > 0) {\n for (let index = 0; index < matchingElements.length; index++) {\n matchingElements[index].addEventListener('click', () => showOS('Windows'));\n }\n }\n\n matchingElements = document.getElementsByClassName('show-os-mac');\n if (matchingElements && matchingElements.length > 0) {\n for (let index = 0; index < matchingElements.length; index++) {\n matchingElements[index].addEventListener('click', () => showOS('MacOS'));\n }\n }\n\n matchingElements = document.getElementsByClassName('show-os-chr');\n if (matchingElements && matchingElements.length > 0) {\n for (let index = 0; index < matchingElements.length; index++) {\n matchingElements[index].addEventListener('click', () => showOS('ChromeOS'));\n }\n }\n}", "title": "" }, { "docid": "3d66b099ed135d4697df2f6545eb8ab4", "score": "0.47885796", "text": "function saveWorkspace() {\n\tif (typeof (Storage) !== \"undefined\") {\n\t\tconst xml = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);\n\t\tlocalStorage.setItem(SAVE_NAME, Blockly.Xml.domToText(xml));\n\n\t\tsaveMessage.innerText = 'Saved';\n\t} else {\n\t\tconsole.log(\"Error saving workspace\");\n\t}\n}", "title": "" }, { "docid": "307546d4c6a16cdc4b311b0c04b2184d", "score": "0.47874978", "text": "openWorkspaceEditor() {\n [\n 'published', 'version', 'description'\n ].forEach((prop) => {\n this.workspaceEditor[prop] = this[prop] || '';\n });\n let provider;\n if (this.provider) {\n provider = Object.assign({}, this.provider);\n } else {\n provider = {};\n }\n this.workspaceEditor.provider = provider;\n this.workspaceEditorOpened = true;\n }", "title": "" }, { "docid": "d14de94d009684e37a350870c799dbc9", "score": "0.47853962", "text": "function processPush(data, context) {\n // Get the current time for determining whether to reset the data.\n let time = Date.now();\n // Either gets the data or returns an empty object.\n const record = returnOrCreateObject(context, data.pusher);\n\n // If the record has a lastModified attribute, we need to check whether\n // it is time for the data to be reset.\n if (record.lastModified)\n //Check whether the data should be reset.\n doResetIfNeeded(record.lastModified, record);\n else {\n // If there is no lastModified field, then this is presumably\n // the first time this author has pushed code, so reset the data so it is not undefined.\n resetRecord(record);\n }\n\n // Convert the current date into a meaningful name of a day of the week,\n // e. g. \"Wednesday\"\n let today = datemath.convertDay(time);\n // Add the number of commits in the push to the number of commits that have been pushed today.\n record.days[today] += data.commitNumber;\n // Set lastModified to now so we can determine whether to reset in the future\n record.lastModified = time;\n // Calculate the total number of commits this week.\n record.totalCommits = commitsThisWeek(record);\n}", "title": "" }, { "docid": "61bf457b8c5f5c3f91104a3069e70ae3", "score": "0.4781649", "text": "function onWebsocketStudentAdd ( data ) {\r\n console.log(\"WebsocketStudentAdd: \" + JSON.stringify(data));\r\n \r\n for ( var i=0; i < workspace.students.length; i++ ) {\r\n if ( workspace.students[i].id == data.id ) {\r\n workspace.students[i].name = data.name;\r\n workspace.students[i].success = data.success;\r\n return;\r\n } \r\n }\r\n\r\n workspace.students.push({ id: data.id, name: data.name, success: data.success });\r\n\r\n updateWorkspace();\r\n}", "title": "" }, { "docid": "2393d2ff7f2aae66b848805465821505", "score": "0.47815654", "text": "function newProjectError() {\n\tconsole.log('Unable to add new project...');\n}", "title": "" }, { "docid": "9fb642099f027c472f7e0e83ad7bb8da", "score": "0.47799462", "text": "function addToCartPushEventiZooto(){\n var pushInformation = $('#itemDetailsForm #addToCart').data('pusheventizooto');\n iZootoPushEvent('Add to Cart',pushInformation);\n}", "title": "" }, { "docid": "49b467d852996116edede0b8b501ea10", "score": "0.47797906", "text": "ADD_EVENT(state, event) {\n // Create empty set of events if needed\n if (!state.events) {\n state.events = [];\n }\n\n // Add event to set of events\n state.events.push(event);\n }", "title": "" }, { "docid": "4319af7f5376f7abdb2e00ab85a92195", "score": "0.47787663", "text": "doPush() {\n if (!this.started || !this.config.dynamic) return;\n if (this.outputQueue.length === 0) return;\n debug('Dynamic mode: pushing actions to host');\n this.connector.push(this.outputQueue, this.connector.getHostId());\n this.outputQueue = [];\n }", "title": "" }, { "docid": "12ea448314b6d275c2b58e5261f55233", "score": "0.47784606", "text": "push({items,owner}) { this.$publish('push', {items,owner})}", "title": "" }, { "docid": "79c36a980b38d65ddcca010b7117e4b4", "score": "0.47763896", "text": "todoAdded(state, action: PayloadAction<Todo>) {\n state.push(action.payload);\n }", "title": "" }, { "docid": "01b8c31b9169f1d5237f8db080fdfe8c", "score": "0.4769073", "text": "createItems(){\n this.clearItems();\n\n var projects = atom.history.getProjects();\n var paths = [];\n\n for(var i in projects){\n var historyProject = projects[i];\n var path = historyProject.paths[0];\n\n /// ignore duplicates (TODO: symlinks)\n if(paths.indexOf(path) > -1)\n continue;\n\n paths.push(path);\n\n var project = SweetProject.initializeByHistoryProject(historyProject);\n\n atom.sweetproject = project;\n\n this.createItem(project);\n }\n }", "title": "" }, { "docid": "e5c01912bb3f883d596c77695d5fd1b2", "score": "0.47599337", "text": "openWorkspaceDetails() {\n [\n 'published', 'version', 'provider', 'description'\n ].forEach((prop) => {\n this.workspaceDetails[prop] = this[prop];\n });\n this.workspaceDetailsOpened = true;\n }", "title": "" }, { "docid": "1e1d15d1ad52874e90d4e46b091d5644", "score": "0.47555655", "text": "function addNewJobToLocalStorageAndUI() {\n var alias = $('#prism-add-new-alias-job');\n var url = $('#prism-add-new-url-job');\n\n //TODO: Add validation check\n\n config.jobs.push({\n alias: alias.val(),\n url: url.val(),\n active: false,\n });\n\n saveToLocalStorage(config);\n\n drawAllUIElements(config);\n\n $('input[type=text]').val('');\n }", "title": "" }, { "docid": "c6dc23623844c88efe4d1c5e89fb8dfb", "score": "0.4752277", "text": "function handleCreateTeam() { history.push('/team-creation') }", "title": "" }, { "docid": "135665f6564bb057d0bcddf4b2f63f1b", "score": "0.47505882", "text": "push(message) {\n }", "title": "" }, { "docid": "ef1afc19d59f081dd857e0c2074851ab", "score": "0.47445714", "text": "function addToNight() {\n $(document).on('click', '.addButton', function (event) {\n\n //pulls data attributes from plus icon that was clicked\n var restName = $(this).attr('data-name');\n var restAddr = $(this).attr('data-addr');\n\n //pushes each event to an array\n userEvents.push({\n name: restName,\n info: restAddr\n });\n\n var newItem = $('<li>');\n newItem.append(`<div class=\"collapsible-header teal darken-3 white-text\">\n <i class=\"material-icons right-align\">more_horiz</i>\n ` + restName + `</div>\n <div class=\"collapsible-body\">\n <span>` + restAddr + `</span>\n </div>\n </li>`);\n newItem.appendTo('#eventList').fadeIn(1000);\n\n //enables the 'finished' button after adding your first event\n $('#finished').removeClass('disabled').addClass('waves-effect');\n $('#finished').addClass('waves-light');\n });\n }", "title": "" }, { "docid": "090519a7dd9edccd56da635b0218ebc2", "score": "0.47431248", "text": "function addEvent(){\n //Get the value from the new-task input\n var newTaskStringInput= document.getElementById(\"new-task\");\n //create a new item\n var newItem= createItem(newTaskStringInput.value);\n //Append the item to incompleteTasks\n incompleteTasks.appendChild(newItem);\n //Add the bindEvent to the item\n bindEvent(newItem);\n //clear the new-task input\n newTaskStringInput.value=\"\";\n}", "title": "" }, { "docid": "02ca4971a6def37867aec76bed859828", "score": "0.47409356", "text": "function pushLS(data){\n localStorage.setItem('singleItem',JSON.stringify(data));\n \n}", "title": "" }, { "docid": "e810db48e97b19a41b1ce4ca21f9eea7", "score": "0.4739782", "text": "function OnSaveHistory(event, info) {\n var docker_save_history = {\n type: \"POST\",\n data: { cmd: \"savehistory\", notebook_name: IPython.notebook.notebook_path },\n success: function(data, status) {\n console.log(data[\"message\"]);\n },\n error: function(jqXHR, status, err) {\n alert(\"save histories failed: \" + err);\n }\n };\n\n ajax(service_url, docker_save_history);\n }", "title": "" }, { "docid": "6ac53292568c82cb108d8b25d5461c80", "score": "0.47374976", "text": "function handleAddEvent() {\n console.log('Add event!');\n var event = {\n summary: 'Google I/O 2015',\n location: '800 Howard St., San Francisco, CA 94103',\n description: \"A chance to hear more about Google's developer products.\",\n start: {\n dateTime: '2020-08-28T09:00:00-07:00',\n timeZone: 'America/Los_Angeles',\n },\n end: {\n dateTime: '2020-08-28T17:00:00-07:00',\n timeZone: 'America/Los_Angeles',\n },\n recurrence: ['RRULE:FREQ=DAILY;COUNT=1'],\n attendees: [\n // {email: '[email protected]'}, {email: '[email protected]'}\n ],\n reminders: {\n useDefault: false,\n overrides: [\n {method: 'email', minutes: 24 * 60},\n {method: 'popup', minutes: 10},\n ],\n },\n };\n\n var request = window.gapi.client.calendar.events.insert({\n calendarId: 'primary',\n resource: event,\n });\n\n request.execute((event) => {\n window.open(event.htmlLink);\n });\n }", "title": "" }, { "docid": "bf5b25ed4c5159ce4e551fd6ff84bd91", "score": "0.47281563", "text": "save(module) {\n this.stack.push(module);\n }", "title": "" }, { "docid": "44c4fc2ced692c01207f2fc1a7bf8fb3", "score": "0.47236025", "text": "function pushHello(index, type, pushedObj, pushObj) {\n var source = (type == \"video\") ? 'wistia' : 'instagram';\n\n pushedObj.push(\n {\n title: pushObj.title,\n type: type,\n videoID: video_embed_codes[index],\n videoHTML: pushObj.html,\n image: pushObj.thumbnail_url,\n thumbnail: pushObj.thumbnail_url + '&image_crop_resized=75x75',\n source: source\n }\n );\n }", "title": "" }, { "docid": "0c79b90f93b70a9fd3cf68805e265be0", "score": "0.4722762", "text": "function addEventPressed() {\n\t\taddNewEvent(key, name);\n\t\tprops.onClosePressed();\n\t\tsetActiveEvent(key);\n\t\tsetShowEventDetails(true);\n\t}", "title": "" }, { "docid": "c0ca6a655222ee416aba9d4c6ef29860", "score": "0.47177395", "text": "async openNewProjectDialog() {\n\t\tlet newProjectDialogPanel;\n\t\tthis.newProjectDialog = new NewProjectDialog({\n\t\t\tcancel: () => {\n\t\t\t\tnewProjectDialogPanel.destroy();\n\t\t\t},\n\t\t\tcallback: (args) => {\n\t\t\t\targs.callback = () => {\n\t\t\t\t\tnewProjectDialogPanel.destroy();\n\t\t\t\t};\n\t\t\t\tAppc.new(args);\n\t\t\t}\n\t\t});\n\t\tnewProjectDialogPanel = atom.workspace.addModalPanel({ item: this.newProjectDialog });\n\t}", "title": "" }, { "docid": "7dbfde60f9151304dfb9c35ae82f6050", "score": "0.471299", "text": "constructor() {\n /**\n * Object holding the location of the cursor for each workspace.\n * Possible locations of the cursor are: workspace, flyout or toolbox.\n * @type {Object<string,Constants.STATE>}\n * @protected\n */\n this.workspaceStates = {};\n\n /**\n * An optional method that allows a developer to customize how to handle\n * logs, warnings, and errors. The first argument is one of 'log', 'warn',\n * or 'error'. The second argument is the message.\n * @type {?function(Constants.LOGGING_MSG_TYPE, string)}\n * @public\n */\n this.loggingCallback = null;\n\n /**\n * The distance to move the cursor when the cursor is on the workspace.\n * @type {number}\n * @public\n */\n this.WS_MOVE_DISTANCE = 40;\n\n /**\n * The name of the marker to use for keyboard navigation.\n * @type {string}\n * @public\n */\n this.MARKER_NAME = 'local_marker_1';\n\n /**\n * The default coordinate to use when focusing on the workspace and no\n * blocks are present. In pixel coordinates, but will be converted to\n * workspace coordinates when used to position the cursor.\n * @type {!Blockly.utils.Coordinate}\n * @public\n */\n this.DEFAULT_WS_COORDINATE = new Blockly.utils.Coordinate(100, 100);\n\n /**\n * The default coordinate to use when moving the cursor to the workspace\n * after a block has been deleted. In pixel coordinates, but will be\n * converted to workspace coordinates when used to position the cursor.\n * @type {!Blockly.utils.Coordinate}\n * @public\n */\n this.WS_COORDINATE_ON_DELETE = new Blockly.utils.Coordinate(100, 100);\n\n /**\n * Wrapper for method that deals with workspace changes.\n * Used for removing change listener.\n * @type {Function}\n * @protected\n */\n this.wsChangeWrapper = this.workspaceChangeListener.bind(this);\n\n /**\n * Wrapper for method that deals with flyout changes.\n * Used for removing change listener.\n * @type {Function}\n * @protected\n */\n this.flyoutChangeWrapper = this.flyoutChangeListener.bind(this);\n\n /**\n * The list of registered workspaces.\n * Used when removing change listeners in dispose.\n * @type {!Array<!Blockly.WorkspaceSvg>}\n * @protected\n */\n this.workspaces = [];\n }", "title": "" }, { "docid": "f87a5b5a524c77d9ecc5f99ae244aec9", "score": "0.47084054", "text": "function pushLog(data) {\n\t\tdebugPrint(\"pushing \" + data);\n\t\tlog.push(data);\n\t\tupdateStats(data);\n\t\t//console.log(\"stats = \"+JSON.stringify(gameStats));\n\t}", "title": "" }, { "docid": "07a5492ea0d30426e74bea3cb1ed1e1e", "score": "0.47005475", "text": "function addNewPanel() {\n\tcomic.push(panel);\n}", "title": "" }, { "docid": "d6fa5241ae96fb01214ef8ba331f956c", "score": "0.4699624", "text": "click () { menuPushToCloud(store) }", "title": "" } ]
b078cf26230a9551d069501f7f9ad4c9
path.relative(from, to) posix version
[ { "docid": "a68cc29c3704733c68af0366eab48277", "score": "0.7429287", "text": "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}", "title": "" } ]
[ { "docid": "d7fabf08e6662581c59e3db8d29b1f5a", "score": "0.8304706", "text": "function pathPosixRelative(from, to) {\n const relative = path.posix.relative(from, to);\n return path === path.win32 ? relative.replace(/\\.\\.\\.\\./g, '../..') :\n relative;\n}", "title": "" }, { "docid": "595902f6127716603c1d36175a9ba0fb", "score": "0.7706835", "text": "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = path_resolve(from).substr(1);\n to = path_resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "title": "" }, { "docid": "6668e71592f71c373680c65310679cab", "score": "0.7533542", "text": "function relative(from, to) {\n\t from = resolve(from).substr(1);\n\t to = resolve(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "title": "" }, { "docid": "6668e71592f71c373680c65310679cab", "score": "0.7533542", "text": "function relative(from, to) {\n\t from = resolve(from).substr(1);\n\t to = resolve(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "title": "" }, { "docid": "6668e71592f71c373680c65310679cab", "score": "0.7533542", "text": "function relative(from, to) {\n\t from = resolve(from).substr(1);\n\t to = resolve(to).substr(1);\n\n\t function trim(arr) {\n\t var start = 0;\n\t for (; start < arr.length; start++) {\n\t if (arr[start] !== '') break;\n\t }\n\n\t var end = arr.length - 1;\n\t for (; end >= 0; end--) {\n\t if (arr[end] !== '') break;\n\t }\n\n\t if (start > end) return [];\n\t return arr.slice(start, end - start + 1);\n\t }\n\n\t var fromParts = trim(from.split('/'));\n\t var toParts = trim(to.split('/'));\n\n\t var length = Math.min(fromParts.length, toParts.length);\n\t var samePartsLength = length;\n\t for (var i = 0; i < length; i++) {\n\t if (fromParts[i] !== toParts[i]) {\n\t samePartsLength = i;\n\t break;\n\t }\n\t }\n\n\t var outputParts = [];\n\t for (var i = samePartsLength; i < fromParts.length; i++) {\n\t outputParts.push('..');\n\t }\n\n\t outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n\t return outputParts.join('/');\n\t}", "title": "" }, { "docid": "9f94160fe7adb330552c900075e2bd68", "score": "0.75183445", "text": "function relative(from, to) {\n /* eslint-disable no-param-reassign */\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n /* eslint-enable no-param-reassign */\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "title": "" }, { "docid": "9f94160fe7adb330552c900075e2bd68", "score": "0.75183445", "text": "function relative(from, to) {\n /* eslint-disable no-param-reassign */\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n /* eslint-enable no-param-reassign */\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "title": "" }, { "docid": "42ba9660ab9af171a8bd58e02ff4d2a6", "score": "0.7483649", "text": "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "title": "" }, { "docid": "42ba9660ab9af171a8bd58e02ff4d2a6", "score": "0.7483649", "text": "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "title": "" }, { "docid": "42ba9660ab9af171a8bd58e02ff4d2a6", "score": "0.7483649", "text": "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "title": "" }, { "docid": "430e950e4c6f221d118f9d891ba0bbe5", "score": "0.7448", "text": "function relative(from, to) {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n return outputParts.join('/');\n}", "title": "" }, { "docid": "5c7f547c50dd91f395ec44e721c36655", "score": "0.73701316", "text": "function explicitRelative(fromDir, toFile) {\n let result = path_1.join(path_1.relative(fromDir, path_1.dirname(toFile)), path_1.basename(toFile));\n if (!path_1.isAbsolute(result) && !result.startsWith('.')) {\n result = './' + result;\n }\n if (path_1.isAbsolute(toFile) && result.endsWith(toFile)) {\n // this prevents silly \"relative\" paths like\n // \"../../../../../Users/you/projects/your/stuff\" when we could have just\n // said \"/Users/you/projects/your/stuff\". The silly path isn't incorrect,\n // but it's unnecessarily verbose.\n return toFile;\n }\n // windows supports both \"./\" and \".\\\", but webpack 5 insists on \"./\"\n if (result.startsWith('.\\\\')) {\n return './' + result.slice(2);\n }\n // windows supports both \"../\" and \"..\\\", but webpack 5 insists on \"../\"\n if (result.startsWith('..\\\\')) {\n return '../' + result.slice(3);\n }\n return result;\n}", "title": "" }, { "docid": "1c5f594b342859711707aabc135e7f60", "score": "0.7334595", "text": "function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n }", "title": "" }, { "docid": "09e265af71a86e65fded02b90e45a2d5", "score": "0.70499235", "text": "function resolveRelativePath(to, from) {\n if (to.startsWith('/'))\n return to;\n if (( true) && !from.startsWith('/')) {\n warn(`Cannot resolve a relative location without an absolute path. Trying to resolve \"${to}\" from \"${from}\". It should look like \"/${from}\".`);\n return to;\n }\n if (!to)\n return from;\n const fromSegments = from.split('/');\n const toSegments = to.split('/');\n let position = fromSegments.length - 1;\n let toPosition;\n let segment;\n for (toPosition = 0; toPosition < toSegments.length; toPosition++) {\n segment = toSegments[toPosition];\n // can't go below zero\n if (position === 1 || segment === '.')\n continue;\n if (segment === '..')\n position--;\n // found something that is not relative path\n else\n break;\n }\n return (fromSegments.slice(0, position).join('/') +\n '/' +\n toSegments\n .slice(toPosition - (toPosition === toSegments.length ? 1 : 0))\n .join('/'));\n}", "title": "" }, { "docid": "09e265af71a86e65fded02b90e45a2d5", "score": "0.70499235", "text": "function resolveRelativePath(to, from) {\n if (to.startsWith('/'))\n return to;\n if (( true) && !from.startsWith('/')) {\n warn(`Cannot resolve a relative location without an absolute path. Trying to resolve \"${to}\" from \"${from}\". It should look like \"/${from}\".`);\n return to;\n }\n if (!to)\n return from;\n const fromSegments = from.split('/');\n const toSegments = to.split('/');\n let position = fromSegments.length - 1;\n let toPosition;\n let segment;\n for (toPosition = 0; toPosition < toSegments.length; toPosition++) {\n segment = toSegments[toPosition];\n // can't go below zero\n if (position === 1 || segment === '.')\n continue;\n if (segment === '..')\n position--;\n // found something that is not relative path\n else\n break;\n }\n return (fromSegments.slice(0, position).join('/') +\n '/' +\n toSegments\n .slice(toPosition - (toPosition === toSegments.length ? 1 : 0))\n .join('/'));\n}", "title": "" }, { "docid": "09e265af71a86e65fded02b90e45a2d5", "score": "0.70499235", "text": "function resolveRelativePath(to, from) {\n if (to.startsWith('/'))\n return to;\n if (( true) && !from.startsWith('/')) {\n warn(`Cannot resolve a relative location without an absolute path. Trying to resolve \"${to}\" from \"${from}\". It should look like \"/${from}\".`);\n return to;\n }\n if (!to)\n return from;\n const fromSegments = from.split('/');\n const toSegments = to.split('/');\n let position = fromSegments.length - 1;\n let toPosition;\n let segment;\n for (toPosition = 0; toPosition < toSegments.length; toPosition++) {\n segment = toSegments[toPosition];\n // can't go below zero\n if (position === 1 || segment === '.')\n continue;\n if (segment === '..')\n position--;\n // found something that is not relative path\n else\n break;\n }\n return (fromSegments.slice(0, position).join('/') +\n '/' +\n toSegments\n .slice(toPosition - (toPosition === toSegments.length ? 1 : 0))\n .join('/'));\n}", "title": "" }, { "docid": "91c6241c0ac1048883a93071b25eda13", "score": "0.6902434", "text": "function relative(dir, file) {\n return normalize(path.relative(dir, file));\n}", "title": "" }, { "docid": "ce0e64b4d955e3744293b0538dc72fbe", "score": "0.69016373", "text": "static makeRelative(basePath, fullPath) {\n return fullPath.replace(Path.wrapDirectoryPath(basePath), \"\");\n }", "title": "" }, { "docid": "60b42a2af618916ca9271d8e9068da1a", "score": "0.6885697", "text": "function relativize (dest, src) {\n // both of these are absolute paths.\n // find the shortest relative distance.\n src = src.split(\"/\")\n var abs = dest\n dest = dest.split(\"/\")\n var i = 0\n while (src[i] === dest[i]) i++\n if (i === 1) return abs // nothing in common, leave absolute\n src.splice(0, i + 1)\n var dots = [0, i, \".\"]\n for (var i = 0, l = src.length; i < l; i ++) dots.push(\"..\")\n dest.splice.apply(dest, dots)\n dest = dest.join(\"/\")\n return abs.length < dest.length ? abs : dest\n}", "title": "" }, { "docid": "83e7c5766f860846704e638118030cd2", "score": "0.6824087", "text": "relative(path) {\n return new URL(path, this.getUrl().href).href;\n }", "title": "" }, { "docid": "83e7c5766f860846704e638118030cd2", "score": "0.6824087", "text": "relative(path) {\n return new URL(path, this.getUrl().href).href;\n }", "title": "" }, { "docid": "be7cf0fd364ff313c417da751a7523e4", "score": "0.67761534", "text": "function getRelativeModulePath(from, to) {\n const fromDir = path_1.dirname(from);\n const relativePathWithExtension = \"./\" + path_1.relative(fromDir, to);\n const extension = path_1.extname(relativePathWithExtension);\n const relativePathWithoutExtension = relativePathWithExtension.slice(0, -extension.length);\n return relativePathWithoutExtension;\n}", "title": "" }, { "docid": "713e5dbecf494133ef09022439e21f6f", "score": "0.6772264", "text": "function relativePath(file1, file2) {\n var file1Dirname = path.dirname(file1);\n var file2Dirname = path.dirname(file2);\n\n if (file1Dirname !== file2Dirname) {\n return path.relative(file1Dirname, file2Dirname);\n }\n return '';\n}", "title": "" }, { "docid": "653477603da5fdb12a499ab26545d5a3", "score": "0.67450696", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n }", "title": "" }, { "docid": "dbef87d0e8d2077062ab04cac7dda5f8", "score": "0.67113274", "text": "function resolvePathname(to, from) {\n if (from === void 0) { from = ''; }\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n }\n else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n if (!fromParts.length) {\n return '/';\n }\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = (last === '.' || last === '..' || last === '');\n }\n else {\n hasTrailingSlash = false;\n }\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n if (part === '.') {\n spliceOne(fromParts, i);\n }\n else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n }\n else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n if (!mustEndAbs) {\n for (; up--; up) {\n fromParts.unshift('..');\n }\n }\n if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) {\n fromParts.unshift('');\n }\n var result = fromParts.join('/');\n if (hasTrailingSlash && result.substr(-1) !== '/') {\n result += '/';\n }\n return result;\n }", "title": "" }, { "docid": "7c3929e69315f65bb59277a9e5eb8a32", "score": "0.66699785", "text": "function relative(aRoot,aPath){if(aRoot === \"\"){aRoot = \".\";}aRoot = aRoot.replace(/\\/$/,''); // XXX: It is possible to remove this block, and the tests still pass!\nvar url=urlParse(aRoot);if(aPath.charAt(0) == \"/\" && url && url.path == \"/\"){return aPath.slice(1);}return aPath.indexOf(aRoot + '/') === 0?aPath.substr(aRoot.length + 1):aPath;}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "f103fddd6cef4cad115aa8e5a1e17efd", "score": "0.66600525", "text": "function resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "86ff6e3b9ef9a8de95dd04f954605371", "score": "0.65927124", "text": "function resolvePathname(to, from = '') {\n const toParts = to && to.split('/') || [];\n let fromParts = from && from.split('/') || [];\n const isToAbs = to && isAbsolute(to);\n const isFromAbs = from && isAbsolute(from);\n const mustEndAbs = isToAbs || isFromAbs;\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n }\n else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n if (!fromParts.length) {\n return '/';\n }\n let hasTrailingSlash;\n if (fromParts.length) {\n const last = fromParts[fromParts.length - 1];\n hasTrailingSlash = (last === '.' || last === '..' || last === '');\n }\n else {\n hasTrailingSlash = false;\n }\n let up = 0;\n for (let i = fromParts.length; i >= 0; i--) {\n const part = fromParts[i];\n if (part === '.') {\n spliceOne(fromParts, i);\n }\n else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n }\n else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n if (!mustEndAbs) {\n for (; up--; up) {\n fromParts.unshift('..');\n }\n }\n if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) {\n fromParts.unshift('');\n }\n let result = fromParts.join('/');\n if (hasTrailingSlash && result.substr(-1) !== '/') {\n result += '/';\n }\n return result;\n}", "title": "" }, { "docid": "331bd96431528b6264ce04376ff2d701", "score": "0.65660566", "text": "function pathResolve(from, to) {\r\n var result = path.resolve(from, to);\r\n var index = result.indexOf(from[0]);\r\n return result.slice(index);\r\n}", "title": "" }, { "docid": "06e17e412c1f5ac565211290667f894c", "score": "0.6504051", "text": "function makeFilePathRelativeToCwd (file) {\n const cwd = process.cwd();\n return (file.startsWith(cwd)) ? '.' + file.substring(cwd.length) : file;\n}", "title": "" }, { "docid": "82be3f887ac53cf713a82482ad0c2465", "score": "0.6441435", "text": "function rebase(base, dir) {\n return path.relative(base, dir);\n}", "title": "" }, { "docid": "b7237a692bc541deec0bb94f8acc1813", "score": "0.64292574", "text": "function relative(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t\n\t aRoot = aRoot.replace(/\\/$/, '');\n\t\n\t // XXX: It is possible to remove this block, and the tests still pass!\n\t var url = urlParse(aRoot);\n\t if (aPath.charAt(0) == \"/\" && url && url.path == \"/\") {\n\t return aPath.slice(1);\n\t }\n\t\n\t return aPath.indexOf(aRoot + '/') === 0\n\t ? aPath.substr(aRoot.length + 1)\n\t : aPath;\n\t }", "title": "" }, { "docid": "e67c2074699140607a28d33fa239a7e2", "score": "0.6397687", "text": "static relativeTo(pathA, pathB) {\n return Path.wrapDirectoryPath(pathA).indexOf(Path.wrapDirectoryPath(pathB)) === 0;\n }", "title": "" }, { "docid": "eadb4e744d94142db3266f9147685edf", "score": "0.63940626", "text": "static abs(p) {\n return (process.platform === 'win32') ? path.resolve(p).replace(/\\\\/g, '/') : path.resolve(p);\n }", "title": "" }, { "docid": "52cd0eb9218ab5b3609c361795b0aa86", "score": "0.6367428", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n }", "title": "" }, { "docid": "79b929cc75d5941bc22ab16a15dbd9d4", "score": "0.6332171", "text": "function normalizePath(_base, file) {\n let base = _base;\n\n // ensure there is a tailing slash in the base path\n if (base && !/\\/$/.test(base)) {\n base += '/';\n }\n\n // ensure the is no starting slash\n if (base && /^\\//.test(base)) {\n base = base.replace(/^\\//, '');\n }\n\n base = base || '';\n return base + file.relative;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" }, { "docid": "3046442f4c589476c5d3f0eeccc4ec5f", "score": "0.632641", "text": "function resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}", "title": "" } ]
58175aa857945185283c8e0c792e7171
Validate if email is valid
[ { "docid": "efc614ba64c7fe13318d846dc4277d3a", "score": "0.0", "text": "function ValidateEmail(event) {\n // Get the email using event target property\n var email = event.target.value;\n\n // Regex to validate email\n var emailRegex = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n isEmailValid = emailRegex.test(email)\n\n // Show invalid email alert if email is not validate\n InputError(\"email\", isEmailValid);\n\n ValidateLogin();\n}", "title": "" } ]
[ { "docid": "6d3022b6d24cd3d9dafbfe560f3b996f", "score": "0.8537736", "text": "function checkEmail() {\r\n if (!(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email.val()))) {\r\n errors.push(' - Email invalid format');\r\n }\r\n}", "title": "" }, { "docid": "de0b0908c275e0bcec53b868144e0a6b", "score": "0.8269502", "text": "function emailIsValid (email) {\n return /\\S+@\\S+\\.\\S+/.test(email)\n}", "title": "" }, { "docid": "6cb6f0f6cda90306987cf31af876c50f", "score": "0.82420206", "text": "emailIsValid(email) {\n return /\\S+@\\S+\\.\\S+/.test(email);\n }", "title": "" }, { "docid": "7ac8853bed77cdb8673f55cae5aed10c", "score": "0.81801194", "text": "function validateEmail(){\n\tif(checkIfEmpty(email)) return;\n\tif(!containsCharacters(email, 5)) return;\n\treturn true;\n}", "title": "" }, { "docid": "a86ed01e9206ae8855fdc015594ef604", "score": "0.8131594", "text": "validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/\n return re.test(email);\n }", "title": "" }, { "docid": "25d697b4ad0405992a3c2ed3c3c0364c", "score": "0.80730885", "text": "function validateEmail(email){\n return emailRegex.test(email);\n }", "title": "" }, { "docid": "034d5d59e11e34e1300f75e2355d9971", "score": "0.80429256", "text": "function validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n }", "title": "" }, { "docid": "66f0ecdc66270e267cf9406b1e0cd0d9", "score": "0.80419225", "text": "validateEmail(email) {\n email = String(email).trim();\n var result = {\n valid: false,\n reason: '',\n };\n\n var emailRE = new RegExp('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$');\n if (!emailRE.exec(email)) {\n result.reason = 'invalidemail';\n } else {\n result.valid = true;\n }\n\n return result;\n }", "title": "" }, { "docid": "b348e8e7758bc0ff9929a3d7b3fd5d61", "score": "0.8036215", "text": "validateEmail(email) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email)) { return true }\n return false\n }", "title": "" }, { "docid": "4e69b84807d1a94361566c4ce44b088d", "score": "0.79976237", "text": "function checkEmail()\n{\n let emailPattern = /^[A-Za-z0-9+_!#$%&'*+/=?`{}~^..-]+@[.a-zA-Z0-9_-]+$/;\n setErrorFlag(this, emailPattern.test(this.value));\n}", "title": "" }, { "docid": "18fdd7c9273f0543fa66c73b423ef703", "score": "0.7987272", "text": "function validar_email( email ){\r\n var regex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\r\n return regex.test(email) ? true : false;\r\n\t}", "title": "" }, { "docid": "963735227f5b78758ecb5b774b9fa316", "score": "0.79628783", "text": "function validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "title": "" }, { "docid": "2eb22827d4e1de02576401c64967e7b8", "score": "0.7953751", "text": "_validateEmail(mail) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "219939bddc00efccbfe1bb5f23b39951", "score": "0.79183394", "text": "validateEmail( email ) {\n \"use strict\";\n const testPattern = /^[0-9a-zA-Z]+([0-9a-zA-Z]*[-._+])*[0-9a-zA-Z]+@[0-9a-zA-Z]+([-.][0-9a-zA-Z]+)*([0-9a-zA-Z]*[.])[a-zA-Z]{2,6}$/;\n const testEmail = testPattern.test( email );\n\n if( testEmail ) {\n return {\n result : true,\n message: 'Email accepted'\n };\n } else {\n return {\n result : false,\n message: 'Email is not accepted. ' +\n 'Email should contain only letters, numbers, -, ., _ only, and valid domain name with 2 - 6 letters' +\n ' extension).'\n };\n }\n }", "title": "" }, { "docid": "34778ed4c48fea145a890d95f414da17", "score": "0.78872126", "text": "function isEmailValid() {\n var email = $email.val();\n var format = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return format.test(email) && email.length > 0;\n }", "title": "" }, { "docid": "ef2c9f17b84045fbb7fe34ba58ce44ac", "score": "0.7880731", "text": "function validateEmail(email){\n var re = /\\S+@\\S+\\.\\S+/;\n //return true if valid email\n return re.test(email);\n}", "title": "" }, { "docid": "3c608a4acb87712746f3201fe4c9c1d8", "score": "0.78803295", "text": "function validateEmail(email) \n{\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "title": "" }, { "docid": "2967afd19de985d131a4d1e597be8acd", "score": "0.78776693", "text": "function validateEmail()\n {\n var email= document.logon.memberEmail.value;\n \t//isn't null & isn't empty\n if (email === null || email ===\"\"){\n return false;\n }\n\n email = email.trim();\n //has an @ not in first space\n if(email.indexOf(\"@\") <= 0){\n return false;\n }\n \t//has a . at least 3rd char from end\n if(email.indexOf(\".\") >= email.length - 2){\n return false;\n }\n \t//has . after the at\n if(email.indexOf(\".\") < email.indexOf(\"@\") + 1){\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "ff21cbfc6aa610ca3f14cee8aefec10a", "score": "0.78673685", "text": "get isEmailValid() {\n const input = document.getElementById('email');\n const emailRegXp = /^[a-z0-9]+([\\.]?[a-z0-9]+)*@[a-z0-9]+([\\.]?[a-z0-9]+)*(\\.[a-z0-9]{2,3})+$/;\n return input.value.length <= 128 && emailRegXp.test(input.value);\n }", "title": "" }, { "docid": "e8e9399bbbbba79136bfaa79b25cabe5", "score": "0.7857819", "text": "function validateEmail(email) {\n var re = /^(?:[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/;\n\n return re.test(email);\n }", "title": "" }, { "docid": "a348d39e4228a84a7a646f29ccb04c92", "score": "0.7857604", "text": "function validateEmail(email){\n var re = /[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}/igm;\n if (email == '' || !re.test(email))\n {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "7a6a0fbdb405db4e67e3d12c2b3f09a5", "score": "0.784594", "text": "function emailValid(email){\n return emailRegEx.test(email);\n}", "title": "" }, { "docid": "8b523fb9dd0e161dc672062ab4a44e27", "score": "0.7845318", "text": "function validateEmail(email)\r\n{\r\n var splitted = email.match(\"^(.+)@(.+)$\");\r\n if(splitted == null) return false;\r\n if(splitted[1] != null )\r\n {\r\n var regexp_user=/^\\\"?[\\w-_\\.]*\\\"?$/;\r\n if(splitted[1].match(regexp_user) == null) return false;\r\n }\r\n if(splitted[2] != null)\r\n {\r\n var regexp_domain=/^[\\w-\\.]*\\.[A-Za-z]{2,4}$/;\r\n if(splitted[2].match(regexp_domain) == null) \r\n {\r\n\t var regexp_ip =/^\\[\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\]$/;\r\n\t if(splitted[2].match(regexp_ip) == null) return false;\r\n }// if\r\n return true;\r\n }\r\nreturn false;\r\n}", "title": "" }, { "docid": "4ed58499078156d487f35f71a71e7696", "score": "0.78404635", "text": "function emailIsValid (email) {\n return /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)\n}", "title": "" }, { "docid": "0e11c7d66afd4ce2197ac0f577085b5c", "score": "0.78331107", "text": "function validar_email(email) {\n\tlet regex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n return regex.test(email) ? true : false;\n}", "title": "" }, { "docid": "843a45098cd3bfd7019aa8675e745ca7", "score": "0.7829959", "text": "validate(value) {\n if (!validator.isEmail(value)) {\n throw new Error(\"Email is Invalid\");\n }\n }", "title": "" }, { "docid": "5d5201a2affe24ac726be9929a60487e", "score": "0.7823188", "text": "function checkExpEmail(email)\r\n{\r\n // validating email input patterns\r\n if (email.value.match(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/))\r\n return true;\r\n return false;\r\n}", "title": "" }, { "docid": "cccc81875525ba478b527a510147066c", "score": "0.78134125", "text": "function validateEmail(email) {\n let re = /^(?:[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/;\n return re.test(email);\n}", "title": "" }, { "docid": "f21bfd8f277038cdc92e10e2c1f71d4f", "score": "0.77930653", "text": "function ValidateEmail(email) \n{ \n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email) )\n { \n return (true) \n } \n return (false) \n}", "title": "" }, { "docid": "c4a845432ce473811313ad3dab82a0d1", "score": "0.77895933", "text": "function validateEmail(email){\n// Regular Expression to validate proper email address\n// /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/\n return /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email);\n}", "title": "" }, { "docid": "c103e26aff5539360085aed8a548039a", "score": "0.7781183", "text": "function validateEmail(email){\n return /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email);\n\n}", "title": "" }, { "docid": "383e7425221fbece82c1db46314d8795", "score": "0.7779403", "text": "function validEmailAddress() {\n\tvar validEmail = new RegExp(/^[-a-z0-9~!$%^&*_=+}{\\'?]+(\\.[-a-z0-9~!$%^&*_=+}{\\'?]+)*@([a-z0-9_][-a-z0-9_]*(\\.[-a-z0-9_]+)*\\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,5})?$/i);\n\treturn validEmail.test($(\"#mail\").val());\n}", "title": "" }, { "docid": "45d125cb4f0e89010a080e1cac979ba4", "score": "0.7766962", "text": "function emailValidation() {\n let re = /\\S+@\\S+\\.\\S+/;\n if (re.test(emailText) == false) {\n setErrorEmail(\"אנא הזן אימייל תקין\");\n setValidEmail(false);\n } else {\n setErrorEmail(\"\");\n setValidEmail(true);\n }\n }", "title": "" }, { "docid": "5b61233bdc8c6e5e9c77a77de8b04631", "score": "0.77652967", "text": "function validEmail(email) {\r\n if(isEmptyString(email)) return false;\r\n if(email.match(/^([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5})$/)){\r\n return true;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "c371b1b94ba991a19742d7bd6932ef93", "score": "0.77651584", "text": "function isValidEmail(email) {\n setErrorMessage(email.length, 'mail', 'Email');\n return /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(email) && email.length > 0;\n}", "title": "" }, { "docid": "34b9cf46bb838adab4f78205ee463efe", "score": "0.7756056", "text": "function validEmail(email) {\n if(email == '' || !emailRegEx.test(email)) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "7721e2fd95f5ed89d5c26f576cc9aa24", "score": "0.7756034", "text": "function formValidateEmail() {\n const re = /^(([^<>()[\\]\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$/i;\n const emailInpt = $('#email');\n if (!emailInpt.val() || !re.test(emailInpt.val())) {\n emailInpt.addClass('invalid');\n\n emailInpt.trigger('focus');\n $('span', emailInpt.parent()).text('Email is not well formatted.');\n } else {\n emailInpt.removeClass('invalid');\n $('span', emailInpt.parent()).text('');\n }\n}", "title": "" }, { "docid": "b37601343505f64d1a44ad75a67ac3c7", "score": "0.77515364", "text": "function emailIsValid(email)\n{\n console.log(email)\n return /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)\n}", "title": "" }, { "docid": "438010bc424f9a9839a9f31e9170adc4", "score": "0.77506745", "text": "function validateEmail(el) {\r\n // RCF2822 - standard email validation regex\r\n var emailValidation = /[a-zA-Z0-9!#$%&'*+\\/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+\\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?/g;\r\n if (!el.val().match(emailValidation)) {\r\n alertUser(el, errorEmail, 'err-invalidEmail');\r\n\t\t} else {\r\n removeAlert(el, 'err-invalidEmail');\r\n\t\t}\r\n }", "title": "" }, { "docid": "d5f22e79ad3f864b6d49873f8d398cec", "score": "0.7749095", "text": "emailValidationFunc(email)\n {\n let mailFormat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\n if (email.match(mailFormat)) {\n return (true)\n }\n else {\n return (false)\n }\n }", "title": "" }, { "docid": "f3f68b42bc1019b4af867e768ed7c681", "score": "0.77487934", "text": "handleEmailValidation(email) {\n const re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n }", "title": "" }, { "docid": "2b4461aa5b2a9e957009e91ee0bbaf36", "score": "0.77485114", "text": "function valida_email(email) {\n\tvar res;\n expr = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n if ( !expr.test(email) ){\n \t//res = \"La dirección de correo \" + email + \" es incorrecta.\";\n \tres = 0;\n }else{\n \t//res = \"Ok\";\n \tres = 1;\n }\n return res;\n}", "title": "" }, { "docid": "c1b60b11d3290901189ff17da779388d", "score": "0.7739334", "text": "function validateEmail(email) {\n // \\S: match a character different than white space\n // +: one or more times\n // \\.: match dot\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "title": "" }, { "docid": "36634b3d78e6abd8f0c12f10dff3bd5a", "score": "0.7738381", "text": "function validateEmail(email) {\n if (email.match(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "bc0a7c5c8a728953b93343f276f1c31b", "score": "0.7735826", "text": "function validateEmail() {\n // return error if empty\n if (profile.email === '') { return 'This field is required'; }\n\n // regex check for email, checks that email input has (letters)@(letters).(letters)\n const reg = /^[ ]*([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})[ ]*$/i;\n return profile.email !== null && reg.test(profile.email) === false ? 'Invalid email' : '';\n }", "title": "" }, { "docid": "5d8d691cccf5fcc80ebd56c5bea35a4d", "score": "0.7730128", "text": "function validateEmail(email) {\n let result = email.match(/[a-z0-9._\\-]+@[a-z0-9._\\-]+\\.[a-z0-9._\\-]+/i);\n return result && result[0] === email ? true : \"Invalid E-mail address\";\n}", "title": "" }, { "docid": "86791cb3558ce2fc898ee8831ea0bf04", "score": "0.77287054", "text": "function validateEmail(email) {\r\n var re = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;\r\n return re.test(email);\r\n}", "title": "" }, { "docid": "c8eec3671b493ec2bd0e19db94a4e6d4", "score": "0.7726956", "text": "function validate_email(email) {\n\t\tvar reg = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;\n\t return reg.test(email);\n\t}", "title": "" }, { "docid": "ddb520bb534f861fcf4aa17ce913e7a9", "score": "0.77233696", "text": "function validateEmail() {\n var emailSel = '.email';\n var emailEle = $(emailSel);\n var emailEleVal = emailEle.val();\n var emailRegex = /^[a-zA-Z0-9_.]+\\@[a-zA-Z0-9.]+\\.[a-zA-Z0-9]{2,4}$/;\n if (!emailEleVal.match(emailRegex)) {\n showErrorMsg(emailSel, 'please enter valid email address');\n return false;\n }\n else {\n removeErrorMsg(emailSel);\n return true;\n }\n }", "title": "" }, { "docid": "369e2c281e140a3d8b0525353a23eea9", "score": "0.7717633", "text": "function validateEmail(email) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "bb2f0505af8f1d5afd1e3e7f12d2c12b", "score": "0.77154803", "text": "function isMailValid($email){\r\n let validMail = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return validMail.test($email.val());//returns true if valid ,false otherwise\r\n}", "title": "" }, { "docid": "e48a9ded38f5985ad2dbf5bf6de10f9d", "score": "0.7703649", "text": "function validate_email(email) {\r\n expression = /^[^@]+@\\w+(\\.\\w+)+\\w$/\r\n if (expression.test(email) == true) {\r\n return true\r\n }\r\n else{\r\n return false\r\n }\r\n }", "title": "" }, { "docid": "6e4dece0e361434934cc3f4fc3617f7a", "score": "0.77030915", "text": "function validateEmail(email)\n {\n var x = email;\n console.log(x);\n var atpos = x.lastIndexOf('@');\n var dotpos = x.lastIndexOf(\".\");\n if (atpos < 1 || dotpos<atpos+2 || dotpos+2>=x.length)\n {\n throw new Error(\"Please enter a valid e-mail address\");\n }\n return true;\n }", "title": "" }, { "docid": "7103bd0a5a52695ebfad08a06953fe94", "score": "0.76992846", "text": "validate(value) {\n if (!validator.isEmail(value)) {\n throw new Error('Email is Invalid')\n }\n }", "title": "" }, { "docid": "3a7bd72c63649e5aea152b5b3e9cdea5", "score": "0.76971215", "text": "function validateEmail(email) {\n\t\t\tvar email=$(\"#email\").val();\n\t\t\tvar filter = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n\t\t\tif (filter.test(email)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2109e633e54bbdcd613c9b00ab37b2d6", "score": "0.7692863", "text": "function validateEmail() {\n if (typeof self.sherpaUserName !== 'undefined' && self.sherpaUserName!==null) {\n self.validEmail = self.sherpaUserName.search(/^(([^<>()[\\]\\\\.,;:\\s@\\']+(\\.[^<>()[\\]\\\\.,;:\\s@\\']+)*)|(\\'.+\\'))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,3}))$/);\n } else {\n self.validEmail = -1;\n }\n }", "title": "" }, { "docid": "10e41951b630fd6597d297f9471979f6", "score": "0.7692625", "text": "function emailValidation(email)\n{\n var regex = /^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/;\n return regex.test(email);\n}", "title": "" }, { "docid": "26c6c4467a96a6c376d0c99315f85e01", "score": "0.76882464", "text": "function isValidEmail(email)\n{\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "title": "" }, { "docid": "2d3de28defe67efe0b3ab3dc512f0d4d", "score": "0.7682971", "text": "function emailValidation(field) {\n const re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if (re.test(field.value)) {\n success(field);\n } else {\n error(field, 'Email must be valid');\n }\n}", "title": "" }, { "docid": "9c194cd80a4c9314cc65790d0858e7a6", "score": "0.76805997", "text": "function isEmail(input) {\n\treturn validate(/^[w-.+]+@[a-zA-Z0-9.-]+.[a-zA-z0-9]{2,4}$/, input);\n}", "title": "" }, { "docid": "9351fd92572d4284a15d70a8c4d153ea", "score": "0.767984", "text": "validateEmail(email) {\n let re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n }", "title": "" }, { "docid": "0a28b2027fbef72bb293026385ab6c2b", "score": "0.7678796", "text": "validateEmail(email) {\n var re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n }", "title": "" }, { "docid": "82c990e6bebfa8db4da450b8a2f60934", "score": "0.76736915", "text": "function validateEmail(email) {\r\n const regEx = /\\S+@\\S+\\.\\S+/;\r\n const patternTest = regEx.test(email);\r\n return patternTest;\r\n}", "title": "" }, { "docid": "14dca6c34bdf98a30ecf7420d2f52dc1", "score": "0.7672824", "text": "function validateEmail(email) {\n const re = /\\S+@\\S+\\.\\S+/;\n if (re.test(email)) {\n basicInfo.mail.className = \"error-false\";\n return true;\n } else {\n basicInfo.mail.className = \"error-true\";\n return false;\n }\n}", "title": "" }, { "docid": "ece46549b6c3bc363fe66a990b32623f", "score": "0.7672355", "text": "function validateEmail(email) { \r\n var re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(email);\r\n}", "title": "" }, { "docid": "78f8d4d956dd884669fd671ebb588fe1", "score": "0.7670068", "text": "validate(value) {\n if (!validator.isEmail(value)) {\n throw new Error('Email is invalid');\n }\n }", "title": "" }, { "docid": "78f8d4d956dd884669fd671ebb588fe1", "score": "0.7670068", "text": "validate(value) {\n if (!validator.isEmail(value)) {\n throw new Error('Email is invalid');\n }\n }", "title": "" }, { "docid": "f2c8cba2f50e94e2f3fa0aeb82dcdbe7", "score": "0.76680404", "text": "function emailvalidate(email) {\n var mailreg = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n return mailreg.test(String(email).toLowerCase());\n }", "title": "" }, { "docid": "8f06e3024ff144c968a5a923e7929df0", "score": "0.7665919", "text": "function checkEmail(email) {\n\n filter = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/;\n\n if (filter.test(email.value)) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n\n}", "title": "" }, { "docid": "684712a5b90430cb483b528eb4743d93", "score": "0.7665163", "text": "function validateEmail(email) {\n if (email.value !== \"\") {\n const re =\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if (re.test(String(email.value).toLowerCase())) {\n showSuccess(email);\n } else {\n showError(email, \"Email is not valid\");\n }\n }\n}", "title": "" }, { "docid": "7a5bf6e41aab8834d2bfa3deea61d50f", "score": "0.7663511", "text": "function validateEmail(x) {\n if (x.length === 0) {\n addMissingWarning(\"Please Enter\", \"Email Address\");\n return false;\n }\n else {\n let myRegex = /[@].*(?:.net|.com|.org|.edu)$/;\n if (!myRegex.test(x)) {\n addValidateWarning(\"Please Enter\", \"a valid Email Address\");\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "8adc4d5869abc2418393c7b70a74cbc3", "score": "0.7662346", "text": "function validaEmail(email){\r\n\texpreg=/^[a-z][\\w.-]+@\\w[\\w.-]+\\.[\\w.-]*[a-z][a-z]$/i;\r\n\tif(expreg.test(email))\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "title": "" }, { "docid": "948e67418fe43d7526257d0a64faae10", "score": "0.7661216", "text": "function email_validation(uemail) {\n if(uemail == undefined)\n {\n alert(\"Email should not be empty.\")\n return false;\n }\n var uemail_len = uemail.length;\n if (uemail_len == 0) {\n alert(\"Email should not be empty.\");\n return false;\n }\n var uemail_source = uemail.substring(uemail_len - 8, uemail_len);\n if (uemail_source.toLowerCase() != \"@fiu.edu\") {\n alert(\"Email should be an @fiu.edu account\")\n return false;\n }\n\n /* Need a check if the email is in the DB once we learn to connect*/\n return true;\n}", "title": "" }, { "docid": "ef48ad445f96f6a2bc8b8a49049d94de", "score": "0.7651468", "text": "function valid_email(email) {\n\temail_regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\n\tif (email_regex.test(email))\n\t\treturn true;\n\treturn false;\n}", "title": "" }, { "docid": "b49aae031809949e40128b97d928a359", "score": "0.76482004", "text": "function validateEmail( email ) {\n // Regex Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#Validation\n var email_regex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\n if( !email_regex.test(email) ) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "9b4f630d4e28c6b927ccc52259602486", "score": "0.76465213", "text": "function emailvalidate()\n{\n\tvar emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\n\tvar v=$(\"#email\").val();\n\t\tif( !emailPattern.test(v))\n\t\t\t$(\"#error_mail\").show(\"slow\");\n\telse\n\t\t$(\"#error_mail\").hide(\"slow\");\n}", "title": "" }, { "docid": "e2fddcdc08d00c592ca8d4dbf1a39215", "score": "0.7638638", "text": "function isEmailValid(email) {\r\n return /^[^@]+@[^@.]+\\.[a-z]+$/i.test(email);\r\n}", "title": "" }, { "docid": "c23e6069d766f271b8cad52cc6e82611", "score": "0.7634546", "text": "function se_is_email_valid(email) {\n if (!email || email == '') { return false };\n var regex = /^([a-zA-Z0-9_.+-])+\\@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n return regex.test(email);\n}", "title": "" }, { "docid": "052ff303a668286a11beee018c1d2977", "score": "0.76333904", "text": "function ValidateEmail(mail){\r\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)){\r\n return (true)\r\n }\r\n return (false)\r\n}", "title": "" }, { "docid": "f424118d75b084bc479957d4bcbab67a", "score": "0.7630743", "text": "function validateEmail(email) {\n regEx = /^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$/;\n if (email.match(regEx)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "6993f0fe4856fe62d0f4c6935e562dc1", "score": "0.7629951", "text": "function validateEmailAddress(email) {\n\tvar validationRe = /\\S+@\\S+\\.\\S+/;\n\tconsole.debug('Email validate: ' + email);\n return validationRe.test(email);\n}", "title": "" }, { "docid": "c1f6f1abd265cac51cb5e7ba975ea258", "score": "0.76250553", "text": "_validateEmail() {\n if (!CommonValidator.isValidEmail(this.email)) {\n throw new Error('email is invalid');\n }\n }", "title": "" }, { "docid": "c65441efc7252e9f3a629ede967f4b24", "score": "0.7623501", "text": "validateEmail(email) {\n return email;\n }", "title": "" }, { "docid": "5d9c643a910002fbb45ebee3039fe653", "score": "0.762289", "text": "function validEmailAdress(email) {\n\t\t// $.ajax(settings).done(function (response) {\n\t\t// \tconsole.log(response);\n\t\t// \tvar res = response.isValid;\n\t\t// \tconsole.log(res);\n\t\t// });\n\n\t\tvar emailPattern = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\t\tconsole.log(\"local variable email = \" + email)\n\t\tconsole.log(\"is this a valid email? \" + emailPattern.test(email))\n\t\treturn emailPattern.test(email);\n\n\t}", "title": "" }, { "docid": "02952f3348078e1a72b3acde90297a48", "score": "0.7622073", "text": "function isValidEmail(val){\n try {\n address = new MailAddress(address).Address;\n } catch(FormatException) {\n // address is invalid\n }\n }", "title": "" }, { "docid": "4fa52eec58b6b11bbf828a9f8aa2cb61", "score": "0.7620818", "text": "function validEmail(email)\n{\n var re = /^(?:[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/;\n\n return re.test(email);\n}", "title": "" }, { "docid": "50eed0a3e6f1fdb08033ecbfbe3f96e9", "score": "0.7618292", "text": "function validateEmail() {\n let emailReg = new RegExp(/^([\\w-\\.]+)@((?:[\\w]+\\.)+)([a-zA-Z]{2,4})/i); // expression régulière pour définir le format du mail\n let valid = emailReg.test(document.getElementById('email').value); //comparaison avec le mail rentré par l'utilisateur\n\n if(!valid) {\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "2f1ad25367df4b5796530463c94006ea", "score": "0.76163423", "text": "function validateEmail(email){\r\n\t//M-am folosit de expresie regulata(regex) - un sir de caractere care verifica daca este valid mailul\r\n\tvar re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n\treturn re.test(email);\r\n}", "title": "" }, { "docid": "99f9c94317b22d7237fe8c4012b5f521", "score": "0.76131433", "text": "function emailValidation() {\n var x = document.getElementById('mail').value;\n var atpos = x.indexOf(\"@\");\n var dotpos = x.lastIndexOf(\".\");\n if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "b2c2c24d65f86462f6c160231e84e3b0", "score": "0.7612391", "text": "function validateEmail(email) {\r\n const re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(email);\r\n}", "title": "" }, { "docid": "83940373b12a7ac14a78482e21465b14", "score": "0.76122373", "text": "function isValidEmail(email){\r\n \r\n \r\n if(\r\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(email)\r\n )\r\n {\r\n \r\n return true;\r\n }\r\n else{\r\n $($errorEmail).show().css(\"color\",\"red\").delay(6000).fadeOut();\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "e28a20a27e33fd6a605e0d4d94c8a1c0", "score": "0.7611873", "text": "function validateEmail(email){\r\n\tvar emailReg = new RegExp(/^((\"[\\w-\\s]+\")|([\\w-]+(?:\\.[\\w-]+)*)|(\"[\\w-\\s]+\")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?$)/i);\r\n\tvar valid = emailReg.test(email);\r\n\r\n\tif(!valid) {\r\n\t\treturn false;\r\n\t} else {\r\n\t\treturn true;\r\n\t}\r\n}", "title": "" }, { "docid": "0d21a30a7cf1d617880d4ab78d9f8742", "score": "0.76116925", "text": "function validate(email) {\n if (validateEmail(email)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "43433adf86fefd47b6c86d7fae412527", "score": "0.7607676", "text": "function email_check() {\r\n email_warn(email_validate());\r\n final_validate();\r\n}", "title": "" }, { "docid": "ed1aa75d82bf44a434eafa4d0dd7ed48", "score": "0.7606048", "text": "isEmail(input) {\n Validate.clearErrors(input);\n let value = input.value;\n let error = null;\n\n const formatEmail = /^\\w+([\\.-_]?\\w+)*@\\w+([\\.-_]?\\w+)*(\\.\\w{2,3})/;\n if(!value.match(formatEmail)){\n error = \"email invalido\";\n Validate.displayError(input,error);\n return;\n }\n input.value = value;\n\n }", "title": "" }, { "docid": "5efbc27746c5ac1fe917d8d96a2c4958", "score": "0.7604637", "text": "function validateEmail(email){\n\t var re = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n\t return re.test(email);\n\t}", "title": "" }, { "docid": "9459b3468c9146ca7a0033a52b08500c", "score": "0.76043135", "text": "function validateEmail(email) {\n var re = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n return re.test(email);\n }", "title": "" }, { "docid": "3551eeb264fc09445021cf7ed66b407d", "score": "0.7601186", "text": "function validateEmail(email) {\r\n\tconst re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n\treturn re.test(email);\r\n }", "title": "" }, { "docid": "34079c47d04e71ded93230bc57f043b6", "score": "0.76004934", "text": "function validateEmail(email) { \n var re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n}", "title": "" }, { "docid": "7d833cd5156c8998ef5e2be2cc5f3c81", "score": "0.75937337", "text": "function isEmailValid(email) {\n return /^[^@]+\\@[^@.]+\\.[a-z]+$/i.test(email);\n }", "title": "" }, { "docid": "2f82772d4d170c6309d96ecd9996f1e8", "score": "0.7592633", "text": "function validateEmail(email, error) \n{\n var valid = 1;\n if (email.includes(\"@\") && email.includes(\".\")) {\n // '@' can't be the first symbol\n var eta = email.indexOf(\"@\", 1);\n var lastEta = email.lastIndexOf(\"@\");\n var dot = email.lastIndexOf(\".\");\n //There can be only one '@' and it has to be atleast 1 char before the '.', after the '.' the must be atleast 2 chars\n if (eta != lastEta || (dot - 1 <= eta) || (dot >= email.length -2)) {\n error.innerHTML += \"Please enter a valid email address. E.g. [email protected]<br />\";\n valid = 0;\n }\n } else {\n error.innerHTML += \"Please enter a valid email address. E.g. [email protected]<br />\";\n valid = 0;\n }\n if (email.length > 254) {\n error.innerHTML += \"The email address is too long. Maximum 254 characters allowed.<br />\";\n valid = 0;\n }\n return valid;\n}", "title": "" } ]
ca2779ad8c11832516d7a39548cd4d26
inlined Object.is polyfill to avoid requiring consumers ship their own /eslintdisable noselfcompare
[ { "docid": "9c21371635b2c8ea31d05094f05809d3", "score": "0.0", "text": "function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }", "title": "" } ]
[ { "docid": "06dfc1a519a19d9f8bb2a50adbe93498", "score": "0.6662855", "text": "_realObject(obj) {\n return (!!obj) && (obj.constructor === Object);\n }", "title": "" }, { "docid": "f004223dce9149727516e1e79f238bfa", "score": "0.66048104", "text": "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray$2(obj);\n}", "title": "" }, { "docid": "d3dac8c1f17528cb28d36fa271aee0e6", "score": "0.65691173", "text": "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n}", "title": "" }, { "docid": "b97cfdb5866c0ee0492eee4d17ded521", "score": "0.65655863", "text": "function is(obj) {\n return obj instanceof __WEBPACK_IMPORTED_MODULE_3__Range__[\"c\" /* default */];\n}", "title": "" }, { "docid": "5b98448001b88076b1ae4804953e2059", "score": "0.64682496", "text": "function _isPlainObject(obj) {\n return (obj && obj.constructor.prototype === Object.prototype);\n}", "title": "" }, { "docid": "465aa7289fa92ac8a633f6a96576835a", "score": "0.6425772", "text": "function is(obj) {\n return obj instanceof __WEBPACK_IMPORTED_MODULE_3__Range__[\"b\" /* default */];\n}", "title": "" }, { "docid": "ee30522796768eb00adeafdb9be32970", "score": "0.6365788", "text": "function isObject$1(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "title": "" }, { "docid": "ee30522796768eb00adeafdb9be32970", "score": "0.6365788", "text": "function isObject$1(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "title": "" }, { "docid": "7afecf9cc9a69bc25109f83a033cce3a", "score": "0.6340638", "text": "static isObject(value) { return value && typeof value === 'object' && value.constructor === Object; }", "title": "" }, { "docid": "7afecf9cc9a69bc25109f83a033cce3a", "score": "0.6340638", "text": "static isObject(value) { return value && typeof value === 'object' && value.constructor === Object; }", "title": "" }, { "docid": "231d3c13901b65b45f7094fd0c7ddbd5", "score": "0.63314", "text": "function isObjectLike(value) {\n return !!value && typeof value == 'object';\n}", "title": "" }, { "docid": "b39c54cc9c59e9a658260827201f8b6a", "score": "0.63222736", "text": "function isObjectLike(value) {\n return _typeof$1(value) == 'object' && value !== null;\n }", "title": "" }, { "docid": "b39c54cc9c59e9a658260827201f8b6a", "score": "0.63222736", "text": "function isObjectLike(value) {\n return _typeof$1(value) == 'object' && value !== null;\n }", "title": "" }, { "docid": "b39c54cc9c59e9a658260827201f8b6a", "score": "0.63222736", "text": "function isObjectLike(value) {\n return _typeof$1(value) == 'object' && value !== null;\n }", "title": "" }, { "docid": "d0bc7931985f32fa5fac09ce01253034", "score": "0.6313583", "text": "function isObject(o) { return o && typeof o === \"object\"; }", "title": "" }, { "docid": "4612c9bd6b528ff20039aa05adde4df6", "score": "0.63080364", "text": "function isObject(x) {\n return !!x\n && toString.call(x) === '[object Object]'\n}", "title": "" }, { "docid": "88dea5745b8c6d0dba2c5248e3db5c28", "score": "0.62973094", "text": "function isObjectLike(value) {\n return _typeof$2(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "bcfe86456dcbc277b0198a35cb5bd047", "score": "0.62962186", "text": "function isObject(o) { return typeof o === 'object'; }", "title": "" }, { "docid": "bcfe86456dcbc277b0198a35cb5bd047", "score": "0.62962186", "text": "function isObject(o) { return typeof o === 'object'; }", "title": "" }, { "docid": "50fa12e276cd01490d9d79173d1683b9", "score": "0.628592", "text": "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "title": "" }, { "docid": "50fa12e276cd01490d9d79173d1683b9", "score": "0.628592", "text": "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "title": "" }, { "docid": "50fa12e276cd01490d9d79173d1683b9", "score": "0.628592", "text": "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "title": "" }, { "docid": "50fa12e276cd01490d9d79173d1683b9", "score": "0.628592", "text": "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "title": "" }, { "docid": "50fa12e276cd01490d9d79173d1683b9", "score": "0.628592", "text": "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "title": "" }, { "docid": "50fa12e276cd01490d9d79173d1683b9", "score": "0.628592", "text": "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "title": "" }, { "docid": "50fa12e276cd01490d9d79173d1683b9", "score": "0.628592", "text": "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "title": "" }, { "docid": "50fa12e276cd01490d9d79173d1683b9", "score": "0.628592", "text": "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "title": "" }, { "docid": "8160e7511e77b3ef2125ff13d5e0784d", "score": "0.6250779", "text": "function is(){}", "title": "" }, { "docid": "878d700a460c3e3b741f30f6da2f9ed9", "score": "0.62458366", "text": "function isObject(obj) {\n return obj === Object(obj);\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.62409806", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "6e3015bc5209d7b85bdf20547485ab55", "score": "0.62375605", "text": "function isObjectLike(value) {\n return typeof value == 'object' && value !== null;\n}", "title": "" }, { "docid": "c7caa4452fde4184c7feee694cc0f82c", "score": "0.6231423", "text": "function isObject (o) { return o && typeof o === 'object' }", "title": "" }, { "docid": "c7caa4452fde4184c7feee694cc0f82c", "score": "0.6231423", "text": "function isObject (o) { return o && typeof o === 'object' }", "title": "" }, { "docid": "c7caa4452fde4184c7feee694cc0f82c", "score": "0.6231423", "text": "function isObject (o) { return o && typeof o === 'object' }", "title": "" }, { "docid": "7cf0bf18187f3ba83aeafa15a4ec6479", "score": "0.6214643", "text": "function isObject(obj){return obj!==null&&(typeof obj===\"undefined\"?\"undefined\":(0,_typeof6.default)(obj))==='object';}", "title": "" }, { "docid": "5e5ed301e58814c06559eedbcae155f0", "score": "0.6212927", "text": "function _isObject(obj){\n var type = typeof obj;\n return type === 'object' && !!obj;\n}", "title": "" }, { "docid": "a158659c4b0f8d7d26c1719d74d6fa6d", "score": "0.61965984", "text": "function isObject$1(input) {\n return _typeof$1(input) === 'object';\n}", "title": "" }, { "docid": "24a6a684f07e4a474ad98e1b9816c35d", "score": "0.61903846", "text": "static object(value)\n {\n return typeof value === 'object' && value !== null;\n }", "title": "" }, { "docid": "262e90d4630d657b6c5f8faab91fb8f2", "score": "0.6189775", "text": "function isObject(n) {\n return Object.prototype.toString.call(n) === '[object Object]';\n }", "title": "" }, { "docid": "da8c368357da8f412c65201c77e80a45", "score": "0.6189664", "text": "function isObject$2(obj) {\n return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;\n }", "title": "" }, { "docid": "91f15e90186a68e6dcc3109955c0e409", "score": "0.6189506", "text": "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "title": "" }, { "docid": "91f15e90186a68e6dcc3109955c0e409", "score": "0.6189506", "text": "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "title": "" }, { "docid": "91f15e90186a68e6dcc3109955c0e409", "score": "0.6189506", "text": "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "title": "" }, { "docid": "e71e5623e24a5440e5189a048ee28e7c", "score": "0.61815226", "text": "function isObject(value) {\r\n\t return !isPrimitive(value) && !isArray(value);\r\n\t }", "title": "" }, { "docid": "9963c3f571e3150ae04620860227a923", "score": "0.6180813", "text": "function isObjectLike(value) {\n return isObject(value) && value !== null\n}", "title": "" }, { "docid": "ba419cfcb2a8152e76d254565c8929bc", "score": "0.61647946", "text": "function isObject(obj) {\r\n\treturn obj === Object(obj);\r\n}", "title": "" }, { "docid": "9ec2ccff9f7142a7ba261af784e9c113", "score": "0.61556107", "text": "function isObject(a) {\n return (!!a) && (a.constructor === Object);\n}", "title": "" }, { "docid": "5b592c6439769c0c59fd317d8df17f94", "score": "0.61537474", "text": "function isObject(o){ return typeof o === 'object' && o !== null; }", "title": "" }, { "docid": "5b592c6439769c0c59fd317d8df17f94", "score": "0.61537474", "text": "function isObject(o){ return typeof o === 'object' && o !== null; }", "title": "" }, { "docid": "68673708831a45714607f8d4b1139fe9", "score": "0.61469305", "text": "function isObject(obj) {\n return typeof obj === 'object';\n}", "title": "" }, { "docid": "bca932627afb14b1da9289b2c79154ed", "score": "0.6136917", "text": "function isObject$1(value) {\n return value != null && (typeof value === 'object' || typeof value === 'function') && !Array.isArray(value);\n }", "title": "" }, { "docid": "374ee16f5d3ee3569f82c5038090b08c", "score": "0.6133091", "text": "function isObject(x) {\n const type = typeof x;\n return !!x && (type === 'function' || type === 'object');\n}", "title": "" }, { "docid": "374ee16f5d3ee3569f82c5038090b08c", "score": "0.6133091", "text": "function isObject(x) {\n const type = typeof x;\n return !!x && (type === 'function' || type === 'object');\n}", "title": "" }, { "docid": "374ee16f5d3ee3569f82c5038090b08c", "score": "0.6133091", "text": "function isObject(x) {\n const type = typeof x;\n return !!x && (type === 'function' || type === 'object');\n}", "title": "" }, { "docid": "374ee16f5d3ee3569f82c5038090b08c", "score": "0.6133091", "text": "function isObject(x) {\n const type = typeof x;\n return !!x && (type === 'function' || type === 'object');\n}", "title": "" }, { "docid": "374ee16f5d3ee3569f82c5038090b08c", "score": "0.6133091", "text": "function isObject(x) {\n const type = typeof x;\n return !!x && (type === 'function' || type === 'object');\n}", "title": "" }, { "docid": "813677a951d843faec766414925b2a00", "score": "0.6129991", "text": "function isSpecialObject(value) {\n return isObject(value) && (!isPlainPrototype(getPrototypeOf(value)) || isArguments(value))\n}", "title": "" }, { "docid": "70b256160ff016f449f8c83792f7a830", "score": "0.61291707", "text": "function _isObject(v){return Object.prototype.toString.call(v)==='[object Object]';}", "title": "" }, { "docid": "bb7322e0aa8e96da0aeed39ab99d39f6", "score": "0.6112067", "text": "function isObject(o) {\n return o === Object(o);\n}", "title": "" }, { "docid": "047dd25faa75641850ba04bb01829de9", "score": "0.6092843", "text": "function isObject(n) {\n return Object.prototype.toString.call(n) === '[object Object]';\n}", "title": "" }, { "docid": "eeee84608583542cc8ee339350961f0c", "score": "0.60891044", "text": "function isObject(obj) {\n\treturn obj === Object(obj);\n}", "title": "" }, { "docid": "ccc9e660a21483dbd00fb7defde01c05", "score": "0.6081662", "text": "function isObject( obj ) {\n return 'object' === typeof( obj );\n }", "title": "" }, { "docid": "3729fa77bce0f68a039ce9331abef0ad", "score": "0.60789174", "text": "function isObject$1(value) {\n return typeof value === 'object' && value !== null || typeof value === 'function';\n }", "title": "" }, { "docid": "ba0ecec46b8ac07927c3a05e6bac25f8", "score": "0.60664725", "text": "function isObject(e){return Object.prototype.toString.call(e)===\"[object Object]\"}", "title": "" }, { "docid": "3de93eb07649c48e057f84bd9d60fe7a", "score": "0.60564065", "text": "function isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "393236563c4aed17eced46bdc4958054", "score": "0.6055822", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "7db7a13da2f9ae1ae01d8e6dfb2c7333", "score": "0.6050706", "text": "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "title": "" }, { "docid": "7db7a13da2f9ae1ae01d8e6dfb2c7333", "score": "0.6050706", "text": "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "title": "" }, { "docid": "7db7a13da2f9ae1ae01d8e6dfb2c7333", "score": "0.6050706", "text": "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "title": "" }, { "docid": "7db7a13da2f9ae1ae01d8e6dfb2c7333", "score": "0.6050706", "text": "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "title": "" }, { "docid": "7db7a13da2f9ae1ae01d8e6dfb2c7333", "score": "0.6050706", "text": "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "title": "" }, { "docid": "47e264d776681365e707f7a0adcc4537", "score": "0.60493153", "text": "function isPlainObject$2(obj) {\n return _toString$2.call(obj) === '[object Object]';\n}", "title": "" }, { "docid": "8f59f758c7451a79cae93876585c107c", "score": "0.60449183", "text": "function isObject(obj) {\n return typeof obj === 'object';\n }", "title": "" }, { "docid": "c6ca0f2104f70bd3f6d61bb804141011", "score": "0.60426", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "c6ca0f2104f70bd3f6d61bb804141011", "score": "0.60426", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "c6ca0f2104f70bd3f6d61bb804141011", "score": "0.60426", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "c6ca0f2104f70bd3f6d61bb804141011", "score": "0.60426", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "c6ca0f2104f70bd3f6d61bb804141011", "score": "0.60426", "text": "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "title": "" }, { "docid": "3d19e8110317a680ae21f4497dc31aa0", "score": "0.6039012", "text": "function isObject (input) {\n return Object.prototype.toString.apply(input) === '[object Object]'\n }", "title": "" } ]
efdaa098c30b250c242aeffdba2836f0
doMerge() does all the heavy lifting of swapping values in the arrays.
[ { "docid": "00e58ce30857a83d4fabea1413d7a3ef", "score": "0.6369939", "text": "function doMerge(array, leftIdx, midIdx, rightIdx, auxiliaryArray, animations, finalDoMerge){\n let i = leftIdx;\n let k = leftIdx;\n let j = midIdx + 1;\n \n while(i <= midIdx && j <= rightIdx){\n // compare left idx value to right idx value of the aux array\n // and make swaps in array until loop exit condition reached.\n if (auxiliaryArray[i][1] <= auxiliaryArray[j][1]){\n // push bar color changes/ swaps to animation array\n // swapAnimations = [[barId, barHeightInteger, swapBars, swapColors, barInFinalPosition],...]\n animations.push(['#bar-' + i, 0, false, true, false]);\n animations.push(['#bar-' + k, auxiliaryArray[i][1], true, false, false]);\n animations.push(['#bar-' + i, 0, false, false, false]);\n if(finalDoMerge){\n animations.push(['#bar-' + i, 0, false, false, true]);\n }\n array[k][1] = auxiliaryArray[i][1];\n i++;\n }\n else{\n // push bar color changes/ swaps to animation array\n // swapAnimations = [[barId, barHeightInteger, swapBars, swapColors, barInFinalPosition],...]\n animations.push(['#bar-' + j, 0, false, true, false]);\n animations.push(['#bar-' + k, auxiliaryArray[j][1], true, false, false]);\n animations.push(['#bar-' + j, 0, false, false, false]);\n if(finalDoMerge){\n animations.push(['#bar-' + j, 0, false, false, true]);\n }\n array[k][1] = auxiliaryArray[j][1];\n j++;\n }\n k++;\n }\n\n // If while loop above ended due to j > rightIdx then we can update the remaining\n // values in the left half to the array\n while(i <= midIdx){\n animations.push(['#bar-' + i, 0, false, true, false]);\n animations.push(['#bar-' + k, auxiliaryArray[i][1], true, false, false]);\n animations.push(['#bar-' + i, 0, false, false, false]);\n if(finalDoMerge){\n animations.push(['#bar-' + i, 0, false, false, true]);\n }\n array[k][1] = auxiliaryArray[i][1];\n i++;\n k++;\n }\n // If while loop above ended due to i > midIdx then we can update the remaining\n // values in the right half to the array\n while(j <= rightIdx){\n animations.push(['#bar-' + j, 0, false, true, false]);\n animations.push(['#bar-' + k, auxiliaryArray[j][1], true, false, false]);\n animations.push(['#bar-' + j, 0, false, false, false]);\n if(finalDoMerge){\n animations.push(['#bar-' + j, 0, false, false, true]);\n }\n array[k][1] = auxiliaryArray[j][1];\n j++;\n k++;\n }\n}", "title": "" } ]
[ { "docid": "64118e0bcb435992820eddbf70175e1c", "score": "0.7002032", "text": "function merge(array1, array2) {}", "title": "" }, { "docid": "c86df0eb4974a63175cfed82cbd0777e", "score": "0.6700815", "text": "merge(arr) {\n\n }", "title": "" }, { "docid": "b83a4e0bc2a3f4ba0f688ac152383fe0", "score": "0.65982944", "text": "function merge(array1, array2){\n\n}", "title": "" }, { "docid": "3b43574194ca23e5ca91df35fe03aa9e", "score": "0.6511633", "text": "function arrayMerge(destination,source){return source;}", "title": "" }, { "docid": "1a3f4ec073cb2ee9773924cdc9ed4100", "score": "0.64901686", "text": "merge(arrToMerge) {\n let leftVirtualIndex = arrToMerge[0];\n let rightVirtualIndex = arrToMerge[2]+1;\n let current = arrToMerge[0];\n \n //Initial or \"Real\" merge state\n while(this.sortedArr[leftVirtualIndex] <= this.sortedArr[rightVirtualIndex]) {\n leftVirtualIndex++;\n current++;\n if(leftVirtualIndex == rightVirtualIndex) {\n //If you're here, the array is offically sorted!\n return;\n } \n }\n //Transition to \"Virtual Merge\" state\n this.swap(leftVirtualIndex, rightVirtualIndex)\n leftVirtualIndex = rightVirtualIndex;\n rightVirtualIndex++;\n current++;\n if(rightVirtualIndex > arrToMerge[1]) {\n return;\n }\n //Virtual Merge state\n while(leftVirtualIndex < rightVirtualIndex) {\n\n if(this.sortedArr[leftVirtualIndex] <= this.sortedArr[rightVirtualIndex] ) {\n this.swap(current, leftVirtualIndex);\n leftVirtualIndex++;\n current++;\n if(leftVirtualIndex == rightVirtualIndex) {\n //If you're here, the array is offically sorted!\n return;\n }\n }\n else {\n this.swap(current, rightVirtualIndex);\n rightVirtualIndex++;\n current++;\n if(rightVirtualIndex > arrToMerge[1]) {\n //If you're here, the array is offically sorted! \n return;\n }\n } \n }\n return this.sortedArr;\n }", "title": "" }, { "docid": "18a715dde8aa1773f730ec562219354e", "score": "0.6374732", "text": "function mergeSorted (array1, array2) {\n\n}", "title": "" }, { "docid": "a8a5907aebd7f3143a1ebc137d47dd11", "score": "0.63317376", "text": "function merge(left, right, arr) {\n var a = 0;\n\n while (left.length && right.length) {\n arr[a++] = (right[0] < left[0]) ? right.shift() : left.shift();\n }\n while (left.length) {\n arr[a++] = left.shift();\n }\n while (right.length) {\n arr[a++] = right.shift();\n }\n}", "title": "" }, { "docid": "819e5d6c5a426d313aa13a11f0c1378c", "score": "0.6179812", "text": "function mergeSortHelper(mainArray, startIdx, endIdx, auxiliaryArray, animations) {\n if (startIdx === endIdx) return;\n const middleIdx = Math.floor((startIdx + endIdx) / 2);//We find the middle of the array so that we can split it into two sections below\n mergeSortHelper(auxiliaryArray, startIdx, middleIdx, mainArray, animations);//this would beging sorting the left portion, using the middle index above, basically creating two 'arrays'\n mergeSortHelper(auxiliaryArray, middleIdx + 1, endIdx, mainArray, animations);//this would do the same but with right portion\n doMerge(mainArray, startIdx, middleIdx, endIdx, auxiliaryArray, animations);//here we actually begin the merging once we've sorted the values\n //we keep recursively calling this until we hit the above if statement and there is only one value within the 'array'\n}", "title": "" }, { "docid": "36dab11a35e67cb5cfaaf7025c92e34d", "score": "0.6164599", "text": "mergesort(arr){\n if(arr.length === 1){\n return arr;\n }\n const m=Math.floor(arr.length/2);\n const left=arr.slice(0,m);\n const right=arr.slice(m);\n return this.merge(\n this.mergesort(left),\n this.mergesort(right)\n );\n\n }", "title": "" }, { "docid": "0b61e8cb9fdd487a5ba4e4377172381c", "score": "0.6140676", "text": "function mergeSortHelper(\n mainArray,\n startIdx,\n endIdx,\n auxiliaryArray,\n animations,\n ) {\n if (startIdx === endIdx) return;\n const middleIdx = Math.floor((startIdx + endIdx) / 2);\n mergeSortHelper(auxiliaryArray, startIdx, middleIdx, mainArray, animations);\n mergeSortHelper(auxiliaryArray, middleIdx + 1, endIdx, mainArray, animations);\n doMerge(mainArray, startIdx, middleIdx, endIdx, auxiliaryArray, animations);\n }", "title": "" }, { "docid": "4ba1a4539fb23787b85a077b090873f3", "score": "0.60827416", "text": "function mergeSort(arr) {\n if (arr.length <= 1) return arr;\n let mid = arr.length >> 1;\n let left = mergeSort(arr.slice(0, mid));\n let right = mergeSort(arr.slice(mid));\n return merge(left, right);\n}", "title": "" }, { "docid": "cdccbe388fa715311148305bb0fa96b2", "score": "0.6080119", "text": "function merge(left, right, myArr) {\r\n // left right combine at the end\r\n //\r\n let leftCount = 0;\r\n let rightCount = 0;\r\n let resultsIndex = 0;\r\n // [1,6,7,10,13,2,3,8,9,11,14]\r\n // [1,6,7,10,13]\r\n // [2,3,8,9,11,14]\r\n // left [4] right [9]\r\n //\r\n while (leftCount < left.length && rightCount < right.length) {\r\n if (left[leftCount] < right[rightCount]) {\r\n myArr[resultsIndex++] = left[leftCount++];\r\n } else {\r\n myArr[resultsIndex++] = right[rightCount++];\r\n }\r\n }\r\n while (leftCount < left.length) {\r\n myArr[resultsIndex++] = left[leftCount++];\r\n }\r\n\r\n while (rightCount < right.length) {\r\n myArr[resultsIndex++] = right[rightCount++];\r\n }\r\n return myArr;\r\n}", "title": "" }, { "docid": "ec076feca2dd50e2cbbbc9fdec175e7f", "score": "0.60740304", "text": "function mergeSort (arr) {\r\n if (arr.length === 1) {\r\n // return one data array\r\n return arr\r\n }\r\n \r\n const middle = Math.floor(arr.length / 2) // get the middle item of the array\r\n const left = arr.slice(0, middle) // items on the left side\r\n const right = arr.slice(middle) // items on the right side\r\n \r\n return merge(\r\n mergeSort(left),\r\n mergeSort(right)\r\n )\r\n }", "title": "" }, { "docid": "cf3471e594b9558789fef4930ce39324", "score": "0.6071837", "text": "function mergeSort(arr) {\n \n if (arr.length <= 1) return arr; // base due to recursion \n let mid = Math.floor(arr.length/2);\n let left = mergeSort(arr.slice(0, mid));\n let right = mergeSort(arr.slice(mid));\n return merge(left, right) // join them back with merge function that takes two array parameters \n }", "title": "" }, { "docid": "22570f0025a6d5fa29926e391b7348d9", "score": "0.6046093", "text": "function mergeSort(arr) {\n var len = arr.length;\n if (len < 2)\n return arr;\n var mid = Math.floor(len / 2),\n left = arr.slice(0, mid),\n right = arr.slice(mid);\n //send left and right to the mergeSort to broke it down into pieces\n //then merge those\n return merge(mergeSort(left), mergeSort(right));\n}", "title": "" }, { "docid": "01e2c083c69fef4bd181515e45e5a807", "score": "0.603656", "text": "async function mergeSort(arr) {\n if (arr.length < 2)\n return arr;\n var middle = parseInt(arr.length / 2);\n var left = arr.slice(0, middle);\n var right = arr.slice(middle, arr.length);\n return await merge(await mergeSort(left), await mergeSort(right));\n }", "title": "" }, { "docid": "9dc5ec0a7e5018f1bf12c300fffe2eb3", "score": "0.60248375", "text": "function doMerge(mainArray, startIdx, middleIdx, endIdx, auxiliaryArray, animations) {\n let k = startIdx;\n let i = startIdx;\n let j = middleIdx + 1;\n while (i <= middleIdx && j <= endIdx) {\n // These are the values that we're comparing; we push them once\n // to change their color.\n animations.push([i, j]);\n // These are the values that we're comparing; we push them a second\n // time to revert their color.\n animations.push([i, j]);\n if (auxiliaryArray[i] <= auxiliaryArray[j]) {\n // We overwrite the value at index k in the original array with the\n // value at index i in the auxiliary array.\n animations.push([k, auxiliaryArray[i]]);\n mainArray[k++] = auxiliaryArray[i++];\n } else {\n // We overwrite the value at index k in the original array with the\n // value at index j in the auxiliary array.\n animations.push([k, auxiliaryArray[j]]);\n mainArray[k++] = auxiliaryArray[j++];\n }\n }\n while (i <= middleIdx) {\n // These are the values that we're comparing; we push them once\n // to change their color.\n animations.push([i, i]);\n // These are the values that we're comparing; we push them a second\n // time to revert their color.\n animations.push([i, i]);\n // We overwrite the value at index k in the original array with the\n // value at index i in the auxiliary array.\n animations.push([k, auxiliaryArray[i]]);\n mainArray[k++] = auxiliaryArray[i++];\n }\n while (j <= endIdx) {\n // These are the values that we're comparing; we push them once\n // to change their color.\n animations.push([j, j]);\n // These are the values that we're comparing; we push them a second\n // time to revert their color.\n animations.push([j, j]);\n // We overwrite the value at index k in the original array with the\n // value at index j in the auxiliary array.\n animations.push([k, auxiliaryArray[j]]);\n mainArray[k++] = auxiliaryArray[j++];\n }\n}", "title": "" }, { "docid": "f5b95200ccdb51cde630c02ab980c117", "score": "0.6010763", "text": "function merge(left, right, arr) {\n let leftI = 0;\n let rightI = 0;\n let outputI = 0;\n while (leftI < left.length && rightI < right.length) {\n if (left[leftI] < right[rightI]) {\n arr[outputI++] = left[leftI++];\n } else {\n arr[outputI++] = right[rightI++];\n }\n }\n\n for (let i = leftI; i < left.length; i++) {\n arr[outputI++] = left[i];\n }\n\n for (let i = rightI; i < right.length; i++) {\n arr[outputI++] = right[i];\n }\n return arr;\n}", "title": "" }, { "docid": "d571495240eefbad9bd613685a6237bd", "score": "0.6009196", "text": "function MergeSort(ArrayMergeSort, Izquierda, Mitad, Derecha){\r\n //bloquea el boton que ordena el merge sort\r\n var boton = document.querySelectorAll(\".styleboton\");\r\n boton[2].disabled = true;\r\n\r\n //Encuentra el tamaño de los sub-vectores para unirlos.\r\n var Arr1 = Mitad - Izquierda + 1;\r\n var Arr2 = Derecha - Mitad;\r\n\r\n //Vectores temporales.\r\n var ArrayIzquierdo = new Array(Arr1);\r\n var ArrayDerecho = new Array(Arr2);\r\n\r\n //Copia los datos a los arrays temporales.\r\n for(var i = 0; i < Arr1; i++){\r\n ArrayIzquierdo[i] = ArrayMergeSort[Izquierda + i];\r\n }\r\n for(var j = 0; j < Arr2; j++){\r\n ArrayDerecho[j] = ArrayMergeSort[Mitad + j + 1];\r\n }\r\n\r\n /* Une los vectorestemporales. */\r\n\r\n //Índices inicial del primer y segundo sub-vector.\r\n var i = 0;\r\n var j = 0;\r\n\r\n //Índice inicial del sub-vector arr[].\r\n var k = Izquierda;\r\n\r\n //Ordenamiento.\r\n while(i < Arr1 && j < Arr2){\r\n if(ArrayIzquierdo[i] <= ArrayDerecho[j]){\r\n ArrayMergeSort[k] = ArrayIzquierdo[i];\r\n i++;\r\n } else{\r\n ArrayMergeSort[k] = ArrayDerecho[j];\r\n j++;\r\n }\r\n k++;\r\n }\r\n\r\n //Comprueba si hay elementos por ordenar, de ser así\r\n //copia los elementos restantes de ArrayIzquierdo[].\r\n while(i < Arr1){\r\n ArrayMergeSort[k] = ArrayIzquierdo[i];\r\n i++;\r\n k++;\r\n }\r\n\r\n //Copiar los elementos restantes de ArrayDerecho[].\r\n while(j < Arr2){\r\n ArrayMergeSort[k] = ArrayDerecho[j];\r\n j++;\r\n k++;\r\n }\r\n\r\n //Recorre las cajas de texto y les da la animación que muestra que esran ordenadas \r\n for(var i = 0; i < ArrayMergeSort.length; i++){\r\n //Llama a la funcion que permite la animacion\r\n animaSort(\".txtMS\", i);\r\n }\r\n //Muestra los valores del array merge sort\r\n MostrarArrayMS();\r\n}", "title": "" }, { "docid": "67e7563b77cacc5e1e3bd060e0d6a92e", "score": "0.6003678", "text": "function merge(left, right) { \n \tconsole.log('left:', left.length)\n let mergeArray = [],\n leftIndex = 0,\n rightIndex = 0;\n //while the counters are less than the lengths of the arrays\n\twhile (leftIndex < left.length && rightIndex < right.length) {\n\t\t// put the smaller value in to the mergeArray\n\t\tif (left[leftIndex] < right[rightIndex]) {\n\t\t\t mergeArray.push(left[leftIndex])\n\t\t\t // increment\n\t\t\tleftIndex += 1;\n\t\t}else{\n\t\t // the other array was smaller or possibly the same size\n\t\t\tmergeArray.push(right[rightIndex])\n\t\t\trightIndex += 1;\n\t\t}\n\t}\n\t// put them back together \n\t// you want to slice where the indexes are pointing\n\tlet rest = right.slice(rightIndex).concat(left.slice(leftIndex))\n\treturn mergeArray.concat(rest)\n}", "title": "" }, { "docid": "02d6489f850a2d31291967de75502fad", "score": "0.59980226", "text": "function mergeSort (arr) {\n // base case\n if (arr.length <= 1) return arr\n\n let mid = Math.floor(arr.length / 2)\n let left = mergeSort(arr.slice(0, mid))\n let right = mergeSort(arr.slice(mid))\n return merge(left, right)\n // mergeSort()\n}", "title": "" }, { "docid": "5dfd8ab9c41b517050be47b42dbf1a0e", "score": "0.5982097", "text": "function merge(array1, array2) \r\n{\r\n for (key in array1) \r\n array2[key] = array1[key];\r\n return array2;\r\n}", "title": "" }, { "docid": "8b890f724a1ae3d1c9bb506ff18f89ac", "score": "0.5976711", "text": "function mergeSort(arr){\n if(arr.length <=1 ) return arr;\n\n let mid = Math.floor(arr.length/2), left = mergeSort(arr.slice(0, mid)), right = mergeSort(arr.slice(mid, arr.length));\n return merge(left, right);\n }", "title": "" }, { "docid": "3574bd5d5dec54d8f1a952de33e0dec4", "score": "0.5976331", "text": "function mergeSort(arr) {\n if (arr.length === 1) {\n return arr;\n }\n let midTerm = Math.floor(arr.length / 2);\n let left1 = arr.slice(0, midTerm);\n let right1 = arr.slice(midTerm);\n mergeSort(left1), mergeSort(right1);\n merge(left1, right1);\n}", "title": "" }, { "docid": "0cd91d199fcda0026bbd79b3e2f0fa56", "score": "0.5954957", "text": "function _merge(array, left, right, cmp)\r\n{\r\n\tvar ai = 0;\r\n\tvar li = 0;\r\n\tvar ri = 0;\r\n\r\n\twhile (li < left.length && ri < right.length)\r\n\t\tif (cmp(left[li], right[ri]) <= 0)\r\n\t\t\tarray[ai++] = left[li++];\r\n\t\telse\r\n\t\t\tarray[ai++] = right[ri++];\r\n\r\n\twhile (li < left.length)\r\n\t\tarray[ai++] = left[li++];\r\n\twhile (ri < right.length)\r\n\t\tarray[ai++] = right[ri++];\r\n}", "title": "" }, { "docid": "c73a61fb2ad381373de0d77a4363e1a4", "score": "0.5954003", "text": "function mergeSort(arr) {\n\tif (arr.length <= 1) return arr;\n\tlet mid = Math.floor(arr.length / 2);\n\tlet left = mergeSort(arr.slice(0, mid));\n\tlet right = mergeSort(arr.slice(mid));\n\treturn merge(left, right);\n}", "title": "" }, { "docid": "c73a61fb2ad381373de0d77a4363e1a4", "score": "0.5954003", "text": "function mergeSort(arr) {\n\tif (arr.length <= 1) return arr;\n\tlet mid = Math.floor(arr.length / 2);\n\tlet left = mergeSort(arr.slice(0, mid));\n\tlet right = mergeSort(arr.slice(mid));\n\treturn merge(left, right);\n}", "title": "" }, { "docid": "6db3cdcb43594b1c9fbf1ced54c962dd", "score": "0.59533024", "text": "function mergeSort (arr) { \n if (arr.length < 2) return arr;\n \n var mid = Math.floor(arr.length /2);\n var subLeft = mergeSort(arr.slice(0,mid));\n var subRight = mergeSort(arr.slice(mid));\n \n return merge(subLeft, subRight);\n}", "title": "" }, { "docid": "533433b32e7ca7c1d389b6103f99ad9a", "score": "0.5952805", "text": "function merge_sort(arr) {\n if (arr.length === 1) { return arr; }\n const center = Math.floor(arr.length / 2);\n const left = arr.slice(0, center);\n const right = arr.slice(center);\n return merge_helper(merge_sort(left), merge_sort(right));//here's the recursion\n}", "title": "" }, { "docid": "2c45ec05725baf6a9cae51cc93c391ed", "score": "0.5936046", "text": "function merge(arr) {\n\tvar otherInterval, increased, prevLen, currLen;\n\tvar len = arr.length;\n\tfor(var i = 0; i < len; i++) {\n\t\tdo {\n\t\t\tincreased = false;\n\t\t\tprevLen = arr[i].length;\n\t\t\tfor(var j = 0; j < len; j++) {\n\t\t\t\tif(i !== j) {\n\t\t\t\t\tarr[i] = combine(arr[i], arr[j]);\n\t\t\t\t\tcurrLen = arr[i].length;\n\t\t\t\t\tif(prevLen !== currLen) {\n\t\t\t\t\t\tarr[j] = [];\n\t\t\t\t\t\tincreased = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} while(increased)\n\t}\n\n\treturn arr;\n}", "title": "" }, { "docid": "7d40031a225cefb931acc840dcb193fa", "score": "0.5935422", "text": "function mergeSort(arr) {\n if (arr.length <= 1) return arr;\n let mid = Math.floor(arr.lenght / 2);\n let left = mergeSort(arr.slice(0, mid));\n let right = mergeSort(arr.slice(mid));\n return merge(left, right);\n}", "title": "" }, { "docid": "5f17debf8130fb1574b8846514cc1285", "score": "0.59177226", "text": "function mergeSort(arr) {\n //split array into 2 halves.\n if (arr.length <= 1) return arr;\n let mid = Math.floor(arr.length / 2)\n let left = mergeSort(arr.slice(0, mid));\n let right = mergeSort(arr.slice(mid));\n //merge arrays.\n return merge(left, right);\n}", "title": "" }, { "docid": "4aae4f16346e48ac99fed19d2e1cf5fe", "score": "0.5913835", "text": "function mergeSort(arr) {\n\tif(arr.length <= 1) return arr;\n\tlet middle = Math.floor(arr.length/2);\n\tlet left = mergeSort(arr.slice(0, middle));\n\tlet right = mergeSort(arr.slice(middle));\n\treturn merge(left, right);\n}", "title": "" }, { "docid": "88fb88590e2644b36da007b07f08bd57", "score": "0.590693", "text": "function mergeTwoSortedArrays(A,m,B,n)//A and B are the arrays and m and n are number of entries initially in the first and second array respectively\n{\n\tvar a = m-1\n\tvar b = n-1\n\tvar write_idx = m+n-1\n\n\twhile(a>=0 && b>=0)\n\t{\n\t\tA[write_idx--] = A[a]>B[b]? A[a--] : B[b--]\n\t}\n\n\twhile(b>=0)\n\t{\n\t\tA[write_idx--] = B[b--]\n\t}\n\n\tconsole.log('A',A)\n}", "title": "" }, { "docid": "9d0fb06685ba2eb75be2cad705d2bb96", "score": "0.59044164", "text": "function MergeSort (array) {\n var n = array.length,\n a0 = array,\n a1 = new Array(n),\n i, m, left, center, right;\n\n for (m = 1; m < n; m <<= 1) {\n for (i = 0; i < n; i += m << 1) {\n left = i;\n center = Math.min(i + m, n);\n right = Math.min(i + (m << 1), n);\n merge(a0, a1, left, center, right);\n }\n\n // swap a0 and a1\n i = a0, a0 = a1, a1 = i;\n }\n\n // the final sorted array from merge() is a1, but is swapped with a0 above.\n // depending on the number of elements, the final merge operation may actually have\n // taken place on the temporary array, so in that case the elements must be copied\n // back into the array originally passed into this function.\n if (array === a1) {\n for (i = 0; i < n; ++i) {\n array[i] = a0[i];\n }\n }\n}", "title": "" }, { "docid": "79952499c3e401a4283354e862d804ce", "score": "0.5902313", "text": "function mergeSort(arr) {\n if (arr.length <= 1) {\n return arr;\n }\n const center = Math.floor(arr.length / 2);\n const left = arr.slice(0, center);\n const right = arr.slice(center);\n\n return merge(mergeSort(left), mergeSort(right));\n}", "title": "" }, { "docid": "2b97c1e446d4728d21672e8943a0da95", "score": "0.5896252", "text": "function mergeSort(arr) {\r\n if (arr.length <= 1) return arr;\r\n\r\n var mid = Math.floor(arr.length / 2);\r\n var left = mergeSort(arr.slice(0, mid));\r\n var right = mergeSort(arr.slice(mid));\r\n\r\n return merge(left, right);\r\n}", "title": "" }, { "docid": "924b714684efe27463b1b284f21140b1", "score": "0.5893884", "text": "function mergeSort(arr) {\r\n const half = arr.length / 2;\r\n\r\n if (arr.length < 2) {\r\n return arr\r\n }\r\n\r\n const left = arr.splice(0, half)\r\n return merge(mergeSort(left), mergeSort(arr))\r\n\r\n}", "title": "" }, { "docid": "a9f95d444de9d2c6e74c044b6b5ec81c", "score": "0.5884649", "text": "function mergeSort(items){\n debugger;\n // Terminal case: 0 or 1 item arrays don't need sorting\n if (items.length < 2) {\n return items;\n }\n\n var middle = Math.floor(items.length / 2),\n left = items.slice(0, middle),\n right = items.slice(middle);\n\n //Still NFI how the below statement works\n return merge(mergeSort(left), mergeSort(right));\n}", "title": "" }, { "docid": "cf0cf42d6f3eff88334e1aaddf0469e4", "score": "0.58771586", "text": "function merge(left, right) {\n let result = []\n let indexLeft = 0\n let indexRight = 0\n\n while (indexLeft < left.length && indexRight < right.length) {\n if (left[indexLeft] < right[indexRight]) {\n mergeSwaps++\n result.push(left[indexLeft])\n indexLeft++\n } else {\n mergeSwaps++\n result.push(right[indexRight])\n indexRight++\n }\n }\n\n return result.concat(left.slice(indexLeft)).concat(right.slice(indexRight))\n}", "title": "" }, { "docid": "912b367348811d56c4c350704d9e18e0", "score": "0.5856832", "text": "function arrayMerge(destination, source) {\n\t return source;\n\t}", "title": "" }, { "docid": "76840084cd18daab583000b38c1c04cc", "score": "0.58499885", "text": "function mergeSort(arr) {\n let len = arr.length, middle, left, right\n if (len < 2) {\n return arr\n }\n middle = Math.floor(len / 2)\n left = arr.slice(0, middle)\n right = arr.slice(middle)\n return merge(mergeSort(left), mergeSort(right))\n\n}", "title": "" }, { "docid": "9fb541577309224b4fff433b08c21899", "score": "0.5842326", "text": "function mergeSort(arr) {\n if (arr.length <= 1) return arr;\n let midpoint = Math.floor(arr.length / 2);\n let left = mergeSort(arr.slice(0, midpoint));\n let right = mergeSort(arr.slice(midpoint));\n return merge(left, right);\n}", "title": "" }, { "docid": "22ff56daed6f76c790e862b73cfdc4d7", "score": "0.5834784", "text": "function mergeSort(arr) {\n if (arr.length <= 1) return arr;\n let mid = Math.floor(arr.length/2);\n let left = mergeSort(arr.slice(0, mid));\n let right = mergeSort(arr.slice(mid))\n return merge(left, right);\n}", "title": "" }, { "docid": "62ec86bd6699fd6f2167efc9a78ba879", "score": "0.58337766", "text": "function mergeSort(arr) {\n if(arr.length <= 1) return arr\n let mid = Math.floor(arr.length / 2)\n let left = mergeSort(arr.slice(0, mid))\n let right = mergeSort(arr.slice(mid))\n return merge(left, right)\n}", "title": "" }, { "docid": "3bb0b9623d9c5d07f5b1c08256c62a40", "score": "0.5822271", "text": "function mergeHelper(sub1, sub2){\n //console.log(\"++line 21 sub1 = \" + sub1)\n //console.log(\"++line 22 sub1 = \" + sub2)\n //store final result\n var results = [];\n //while we still have elements in both arrays\n while(sub1.length > 0 && sub2.length > 0){\n //if the first el of the first array is less than the first el of the second array\n if(sub1[0] < sub2[0]){\n //push it to results\n results.push(sub1[0])\n sub1 = sub1.slice(1)\n }\n else {\n //otherwise push the other el\n results.push(sub2[0])\n sub2 = sub2.slice(1)\n }\n }\n //we still have elements in our left array\n if(sub1.length){\n //console.log(\"++line 39: \" + results.concat(sub1))\n //go back up to line 15\n return results.concat(sub1)\n }\n else {\n //console.log(\"++line 43: \" + results.concat(sub2))\n //go back up to line 15\n return results.concat(sub2)\n }\n}", "title": "" }, { "docid": "83c9dea43ca712419fa935bfc004e7a4", "score": "0.5816796", "text": "function mergehelper(from, middle, to, temp){\n let i = from;\n let j = middle + 1;\n let k = from;\n while(i <= middle && j <= to){\n if(thearray[i] < thearray[j]){\n temp[k] = thearray[i];\n i+=1;\n }else{\n temp[k] = thearray[j];\n j+=1;\n }\n k+=1;\n }\n while(i <= middle){\n temp[k] = thearray[i];\n i+=1;\n k+=1;\n }\n while(j <= to){\n temp[k] = thearray[j];\n j+=1;\n k+=1;\n }\n for(let x = from; x<= to; x++){\n /* snapshot */\n let focus = [x];\n snapshot(focus);\n /* snapshot */\n thearray[x] = temp[x];\n }\n}", "title": "" }, { "docid": "611f9fb3b67e3b100270c1253cb4a779", "score": "0.5815655", "text": "function mergeSort(arr) {\n // setting edgecase\n if (arr.length <= 1) return arr;\n // finding out the middle of array so that we can slice it into smaller half chunks, Floor to round down\n let mid = Math.floor(arr.length / 2)\n // setting the left side to half of the array, split into 2 pieces\n // calling mergeSort again, and breaking the left side down into even smaller arrays\n // mergeSort until we have single item array\n let left = mergeSort(arr.slice(0, mid))\n // setting the right side to the other half of the array, array is now split into 2 pieces\n // calling mergeSort again, and breaking down the right side into smaller arrays\n // mergeSort until we have single item array\n let right = mergeSort(arr.slice(mid))\n // combining the two One Element arrays, sorted, together, 2 elements long now\n return merge(left, right);\n}", "title": "" }, { "docid": "15896d86b99d04502cc1287581c7ff94", "score": "0.58125484", "text": "function mergeSort(arr) {\n\n // BASE CASE\n // Will break all arrays down to size of 1 before merging\n if (arr.length === 1) {\n return arr;\n }\n\n const middle = Math.floor(arr.length / 2); // get the middle item of the array rounded down\n const left = arr.slice(0, middle); // items on the left side\n const right = arr.slice(middle); // items on the right side\n\n return merge(\n mergeSort(left),\n mergeSort(right),\n );\n}", "title": "" }, { "docid": "9c4cb202c2632d6903b5a3e64cfe13c5", "score": "0.58046335", "text": "function mergeSort(arr) {\n if (arr.length < 2)\n return arr;\n var midIdx = Math.floor((arr.length)/2);\n var left = arr.slice(0, midIdx);\n var right = arr.slice(midIdx, arr.length);\n var result = [];\n var sortedArr = merge(mergeSort(left), mergeSort(right), result);\n return sortedArr;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "53746d4a02613c1ce6a40911a14e44af", "score": "0.57996583", "text": "function arrayMerge(destination, source) {\n return source;\n}", "title": "" }, { "docid": "b3848d93d4362726926b90030fc8538f", "score": "0.5775111", "text": "function merge(a0, a1, left, center, right) {\n var i, j;\n for (i = left, j = center; left < right; ++left) {\n if (i < center && (j >= right || a0[i] <= a0[j])) {\n a1[left] = a0[i++];\n } else {\n a1[left] = a0[j++];\n }\n }\n}", "title": "" }, { "docid": "4d52f5e9ee846f1062471c69431c02ed", "score": "0.57736737", "text": "function mergeSort(arr) {\n if (arr.length < 2) {\n return arr;\n }\n\n var mid = Math.floor(arr.length / 2);\n var left = arr.slice(0, mid);\n var right = arr.slice(mid);\n\n return merge(mergeSort(left), mergeSort(right));\n}", "title": "" }, { "docid": "7dab66f17e254db595600f9ab0d28041", "score": "0.57702947", "text": "function mergeSort(numbers, leftIndex, rightIndex) {\n\n if(leftIndex < rightIndex){\n var mid = Math.floor((leftIndex+rightIndex)/2);\n mergeSort(numbers, leftIndex, mid);\n mergeSort(numbers, mid+1, rightIndex);\n merge(numbers, leftIndex, mid+1, rightIndex);\n }\n}", "title": "" }, { "docid": "059e67e1c13ab08a8c73d6c6c873a2c4", "score": "0.57673025", "text": "function mergeSort(arr){\n if(arr.length <= 1) return arr;\n let mid = Math.floor(arr.length/2);\n let left = mergeSort(arr.slice(0, mid));\n let right = mergeSort(arr.slice(mid));\n return merge(left, right)\n\n}", "title": "" }, { "docid": "2da9a51e6809c18d712cbad5546665c9", "score": "0.57579446", "text": "function mergeSort(arr) { \n\n if(arr.length <= 1) { \n return arr;\n }\n\n let mid = Math.floor(arr.length / 2);\n let leftSide = mergeSort(arr.slice(0, mid));\n let rightSide = mergeSort(arr.slice(mid));\n return merge(leftSide, rightSide);\n}", "title": "" }, { "docid": "b98c42a4ffc62b761a276369ee921c13", "score": "0.5752956", "text": "function mergeSort(arr) {\n if (arr.length <= 1) return arr;\n let mid = Math.floor(arr.length / 2);\n let left = mergeSort(arr.slice(0, mid)); //before mid\n let right = mergeSort(arr.slice(mid));\n return merge(left, right);\n}", "title": "" }, { "docid": "9b95c132f5043bbe6a0de70511c35973", "score": "0.57454526", "text": "function mergeSort(arr){\n const halves = toDivide(arr);\n\n return fullMerge(halves);\n}", "title": "" }, { "docid": "f7568082b9978e0ec416c9f7579ba384", "score": "0.5745246", "text": "function mergeSort(arr) {\n if (arr.length <= 1) { return arr; }\n\n let mid = Math.floor(arr.length / 2);\n let left = arr.slice(0, mid);\n let right = arr.slice(mid, arr.length);\n\n return merge(mergeSort(left), mergeSort(right));\n}", "title": "" }, { "docid": "c69e655b11cc5888fe8be226af6b4fea", "score": "0.57246375", "text": "function mergeSortHelper(mainArray, start, end, auxArray, steps) {\n if (start === end) return;\n const mid = Math.floor((start + end) / 2);\n mergeSortHelper(auxArray, start, mid, mainArray, steps);\n mergeSortHelper(auxArray, mid + 1, end, mainArray, steps);\n merge(mainArray, auxArray, start, mid, end, steps);\n}", "title": "" }, { "docid": "79bfb5034fc27478644660e611e2aa43", "score": "0.5712776", "text": "function merge_loops(a, b) {\n var result = a.concat(b);\n result.sort(compare_uopair);\n for(var i=result.length-1; i>0; --i) {\n if(compare_uopair(result[i], result[i-1]) === 0) {\n result.splice(i, 1);\n }\n }\n return result;\n}", "title": "" }, { "docid": "74563463eb52069d678d18ca218dcb4b", "score": "0.57108533", "text": "function mergeSort() {\n const animationsArr = MergeSort(array);\n updateAnimation(animationsArr);\n }", "title": "" }, { "docid": "55cf27f67afb78b66c1bc2cc615f9962", "score": "0.5701633", "text": "function merge(arrOne, arrTwo) {\n // variable to hold the new, sorted array\n let results = [];\n // variable to store pointer for array one... will move through array\n let i = 0;\n // variable to store pointer for array two, will move through the array\n let j = 0;\n // while both variables are less than the length of the array\n while (i < arrOne.length && j < arrTwo.length)\n // if the value from array one is less than the value from array two, push the lower(i) into our new array, and move down the line in array one\n if (arrTwo[j] > arrOne[i]) {\n results.push(arrOne[i]);\n i++;\n // if the value from array one is more than the value from array two, push the lower(j) into our new array, and move down the line in array two\n } else {\n results.push(arrTwo[j])\n j++;\n // if the length of array one is greater than the length of array two and we finish first, add the rest of array one to the results array, they are already sorted\n } while (i < arrOne.length) {\n results.push(arrOne[i])\n i++;\n // if the length of array two is greater than the length of array two and we finish first, add the rest of array two to the results array, they are already sorterd\n } while (j < arrTwo.length) {\n results.push(arrTwo[j])\n j++;\n }\n\n return results;\n}", "title": "" }, { "docid": "271e00d41c92830d08396743dfa74023", "score": "0.5699823", "text": "function mergeRecursiveLoop(mergeArr, lb, ub, animationArray)\n{\n if(lb < ub){\n var mid = Math.floor((ub+lb)/2);\n mergeRecursiveLoop(mergeArr, lb, mid, animationArray);\n mergeRecursiveLoop(mergeArr, mid+1, ub, animationArray);\n merge(mergeArr, lb, mid, ub, animationArray);}\n}", "title": "" }, { "docid": "17110ada312c74b863c007d34903ecf8", "score": "0.56925756", "text": "function mergeSortMerge(array1, array2) {\n const sorted = []\n const a1l = array1.length\n const a2l = array2.length\n let i = 0\n let j = 0\n while (i < a1l && j < a2l) {\n if (array1[i] < array2[j]) {\n sorted.push(array1[i])\n i++\n } else {\n sorted.push(array2[j])\n j++\n }\n }\n\n // remaining sorted array should be appended to sorted arrays\n while (i < a1l) {\n sorted.push(array1[i])\n i++\n }\n\n while (j < a2l) {\n sorted.push(array2[j])\n j++\n }\n\n return sorted\n}", "title": "" }, { "docid": "10b52ff200e9e7832e77117c3490da64", "score": "0.56741077", "text": "function mergeSort(arr){\n // BREAK CASE: if the sub-array we're looking at is\n // 1 element, it's sorted, and we need to return it\n if(arr.length == 1){\n return arr;\n }\n\n // We need to split the array down the middle, so let's calculate that mid-point.\n let mid = Math.floor(arr.length/2);\n // Now, let's actually split up the array. I'll be using .slice, which fortunately\n // has a time complexity of O(n), so we're all good!\n \n // The left subarray will be from index 0 up to the mid point\n let left = arr.slice(0,mid);\n // and the right subarray will be mid through the end\n let right = arr.slice(mid);\n\n // and now, for the recursive call(s). This is a tricky one. \n // We can do this in a couple of separate steps, or combine them into one.\n\n // MULTI-STEP APPROACH:\n \n // // make the two recursive calls separately and store the returned arrays into variables\n // let arrLeft = mergeSort(left);\n // let arrRight = mergeSort(right);\n\n // // and THEN merge them together and return\n // return merge(arrLeft, arrRight);\n \n \n // ONE-LINER\n // This will recursively call mergeSort to the left and right subarrays,\n // and then merge their resulting arrays.\n return merge(mergeSort(left), mergeSort(right));\n}", "title": "" }, { "docid": "ebcffa6c1a13d4e1f72355bf6c887168", "score": "0.5671657", "text": "function merge(mergeArr, lb, mid, ub, animationArray)\n{\n var i = lb;\n var j = mid+1;\n var k = 0;\n var newArray = new Array;\n while(i <= mid && j <= ub){\n animationArray.push([i,j, 1, 0]);\n animationArray.push([i,j, 1, 1]);\n if(mergeArr[i] <= mergeArr[j]){\n animationArray.push([lb+k, mergeArr[i], 1, 2])\n newArray[k++] = mergeArr[i++];\n }\n else{\n animationArray.push([lb+k, mergeArr[j], 1, 2]);\n newArray[k++] = mergeArr[j++];\n }\n }\n while(i <= mid){\n animationArray.push([i,i, 1, 0])\n animationArray.push([i,i, 1, 0])\n animationArray.push([lb+k, mergeArr[i], 1, 2])\n newArray[k++] = mergeArr[i++];\n }\n \n while(j <= ub){\n animationArray.push([j,j, 1, 0])\n animationArray.push([j,j, 1, 1])\n animationArray.push([lb+k, mergeArr[j], 1, 2])\n newArray[k++] = mergeArr[j++];\n }\n for(i = 0, j = lb; i < k; i++, j++)\n {\n mergeArr[j] = newArray[i];\n }\n}", "title": "" }, { "docid": "58e3c07c1751563d2875ffa449c1460d", "score": "0.56698066", "text": "function merge(leftArray, rightArray) {\n var mainArray = []; //main mergeed sorted array\n leftArrayIndex = 0;\n rightArrayIndex = 0;\n var mainArrayIndex = 0;\n //check each index and see which element is larger in one row and add then add the other\n while (\n leftArrayIndex < leftArray.length &&\n rightArrayIndex < rightArray.length\n ) {\n if (\n Number(leftArray[leftArrayIndex].innerHTML) <=\n Number(rightArray[rightArrayIndex].innerHTML)\n ) {\n mainArray[mainArrayIndex++] = leftArray[leftArrayIndex++];\n mainArray[mainArrayIndex++] = rightArray[rightArrayIndex++];\n } else {\n mainArray[mainArrayIndex++] = rightArray[rightArrayIndex++];\n mainArray[mainArrayIndex++] = leftArray[leftArrayIndex++];\n }\n }\n //condition where left array is larger than right\n if (leftArrayIndex < leftArray.length) {\n for (var i = leftArrayIndex; i <= leftArrayIndex.length; i++) {\n mainArray[mainArrayIndex++] = leftArray[i];\n }\n }\n //condition for right being larger than left\n else if (rightArrayIndex < rightArray.length) {\n for (i = rightArrayIndex; i <= rightArrayIndex.length; i++) {\n mainArray[mainArrayIndex++] = rightArray[i];\n }\n }\n return mainArray;\n}", "title": "" }, { "docid": "129d05c7f8868bda5ff446ac1088c912", "score": "0.5656761", "text": "function mergeSort(arr){\n if(arr.length ===1){\n return arr;\n }\n const mid = Math.floor(arr.length/2);\n const left = arr.slice(0, mid);\n const right = arr.slice(mid);\n\n return merge(mergeSort(left), mergeSort(right));\n}", "title": "" }, { "docid": "4fbf31e7f7f4a6e38b9a097da7ab79f4", "score": "0.5655504", "text": "function merge(arr, p, q, r) {\r\n \r\n var i, j, k; // incrementors\r\n \r\n var n_one = q - p + 1; \r\n var n_two = r - q; \r\n var L = new Array(n_one + 1);\r\n var R = new Array(n_two + 1 )\r\n \r\n for(i = 0; i < n_one - 1; i++){\r\n L[i] = arr[p + i]; \r\n }\r\n for(j = 0; j < n_two - 1; j++){\r\n R[j] = arr[q + j]; \r\n }\r\n \r\n /* Infinity will mark the ending \r\n sentinel variable for knowing it's the end\r\n */ \r\n L[n_one] = INFINITY; \r\n R[n_two] = INFINITY; \r\n i = 1;\r\n j = 1; \r\n \r\n for(k = p; k < r; k++){\r\n L[i] <= R[j] ? {arr[k] = L[i]; i++;} : {arr[k] = R[j]; j++;} \r\n }", "title": "" }, { "docid": "4b974396fa0e52a0c46e724017373362", "score": "0.5654564", "text": "function mergeSort(arr) {\n const sortedArray = [...arr];\n // termination\n if (sortedArray.length < 2) {\n return arr;\n }\n // recursive\n const middle = Math.floor(arr.length / 2);\n const left = sortedArray.slice(0, middle);\n const right = sortedArray.slice(middle);\n \n return merge(mergeSort(left), mergeSort(right));\n }", "title": "" }, { "docid": "7a65fe259a193300b731c0eea37ed5a4", "score": "0.5642409", "text": "function mergeSort(arr) {\r\n if(arr.length <= 1) return arr;\r\n let mid = Math.floor(arr.length / 2);\r\n let low = mergeSort(arr.slice(0, mid));\r\n let high = mergeSort(arr.slice(mid))\r\n return merge(low, high)\r\n}", "title": "" }, { "docid": "40caba52bdfa8a3d5387f57cc3d61977", "score": "0.56384706", "text": "function mergeSort(arr) {\n // base case for returning our arrays\n if (arr.length <= 1) return arr;\n // create variable mid that gives us the halfway point of arr\n let mid = Math.floor(arr.length / 2);\n // use slice to split arr in two halves\n // call mergeSort on each half\n let left = mergeSort(arr.slice(0, mid)); // will sort the left side\n let right = mergeSort(arr.slice(mid)); // will merge right side\n // need to merge our two arrays left and right (use function already built)\n // these are already sorted and will work with the earlier function\n // because they will eventually equal arrays with only 1 value (sorted arrays)\n return merge(left, right);\n}", "title": "" }, { "docid": "a898c22f2461bbce6a49909ebb22b101", "score": "0.5638235", "text": "function arrayMerge (firstData, secondData) {\n // Code disini\n \n var arr=[];\n \n for(var k=0;k<firstData.length;k++) {\n arr.push(firstData[k]);\n }\n\n\n for(var i=0; i<secondData.length; i++) {\n \n var store=1;\n for(var j=0;j<arr.length;j++){\n if(arr[j]===secondData[i]) {\n \n store*=0;\n }else {\n store*=1;\n \n }\n }\n if(store===1) {\n arr.push(secondData[i]);\n }\n \n }\n return arr;\n\n}", "title": "" }, { "docid": "d2b5c60aed5fabaa71f0ef936af04f39", "score": "0.56289697", "text": "mergeSort(array) {\n if (array > 0) {\n var n = array.length;\n if (n < 2) {\n return;\n }\n var mid = Math.floor(n / 2);\n var left = [mid];\n var right = [n - mid];\n for (let i = 0; i < mid; i++) {\n left[i] = array[i];\n }\n for (let j = mid; j < n; j++) {\n right[j - mid] = array[j];\n\n }\n this.mergeSort(left);\n this.mergeSort(right);\n this.merge(left, right, array);\n }\n else {\n console.log(\"enter valid input\");\n }\n }", "title": "" }, { "docid": "4c1fbaef4fa02a0c5e2f0659e85036a1", "score": "0.56268805", "text": "function mergeSort(arr) {\r\n\t//base case - array is 0 or 1 items\r\n\tif(arr.length <= 1) return arr;\r\n\t//split the array at the midpoint\r\n\tlet mid = Math.floor(arr.length/2);\r\n\tlet left = mergeSort(arr.slice(0, mid)); //splits/merges whole left\r\n\tlet right = mergeSort(arr.slice(mid)); //splits/merges whole right\r\n\t//merge sorted arrays\r\n\treturn mergeSorted(left, right);\r\n}", "title": "" }, { "docid": "2454612deeb9b167f79c3d6c28f50a98", "score": "0.5622932", "text": "function mergeSort(arr){\n let n = arr.length;\n\n if(n > 1){\n let mid = Math.ceil(n/2);\n let left = arr.slice(0, mid);\n let right = arr.slice(mid, n);\n\n //sort the left\n mergeSort(left);\n //sort the right\n mergeSort(right);\n merge(left, right, arr);\n }\n return arr;\n}", "title": "" }, { "docid": "b4d2f8da4c85c446dfd25888b208fde0", "score": "0.56135535", "text": "function mergeBugArrays(arr1, arr2) {\n var count = 0;\n for (var idx in arr2) {\n var merged = false;\n for (idx2 in arr1) {\n if (arr1[idx2][0] == arr2[idx][0]) {\n arr1[idx2][1] += arr2[idx][1];\n merged = true;\n break;\n }\n }\n if (merged == false) {\n arr1.push(arr2[idx]);\n }\n }\n return arr1;\n }", "title": "" }, { "docid": "8718601072f1bbc7142d6bf4e0ef8134", "score": "0.5612626", "text": "function merge(arr1, arr2) {\n if (arr1[0] < arr2[0]) {\n return arr1.concat(arr2);\n } else {\n return arr2.concat(arr1);\n }\n}", "title": "" }, { "docid": "13a120ebd3e5f1e39d2807a9e3cda67e", "score": "0.56070375", "text": "function mergerSort(arr){\n if(arr.length <= 1) return arr;\n var mid = Math.floor(arr.length/2)\n var left = mergerSort(arr.slice(0,mid))//calls the function and add the call stcak and return array each time incremental ad poped and added into array\n var right = mergerSort(arr.slice(mid))\n \n return mergeArrays(left,right);\n \n //function to compare and merge arrays\n function mergeArrays(arr1,arr2){\n var result = [];\n var i = 0;\n var j = 0;\n while(i < arr1.length && j < arr2.length){\n if(arr1[i] < arr2[j]){\n result.push(arr1[i])\n i++\n }else{\n result.push(arr2[j])\n j++\n }\n }\n while(i < arr1.length){\n result.push(arr1[i])\n i++\n }\n while(j < arr2.length){\n result.push(arr2[j])\n j++\n }\n return result;\n }\n\n}", "title": "" }, { "docid": "20fcd96ddc7422d8305b9b53a99c266a", "score": "0.5581702", "text": "function merge(arr1, arr2) {\n arr1 = arr1.slice();\n arr2 = arr2.slice();\n let result = [];\n let totalLength = arr1.concat(arr2).length; \n \n for (let index = 0; index < totalLength; index += 1) {\n let num1 = arr1[0];\n let num2 = arr2[0];\n \n if (num1 === undefined) {\n result = result.concat(arr2);\n return result;\n } else if (num2 === undefined) {\n result = result.concat(arr1);\n return result;\n } \n \n if (num1 < num2) {\n result.push(arr1.shift());\n } else {\n result.push(arr2.shift()); \n }\n }\n \n return result;\n}", "title": "" }, { "docid": "1b740a916650993ccea238a25fd6463f", "score": "0.5580646", "text": "mergeAll() {\n this.merges.forEach((mergeMove) => {\n this.merge(mergeMove[0], mergeMove[1]);\n });\n this.merges = [];\n }", "title": "" }, { "docid": "7e6089c65edee4da94ebe813f0b87b33", "score": "0.55798155", "text": "function mergeWithExtraSpace(arr1 , arr2) {\n let pointer1 = 0 , pointer2 = 0;\n let arr = [];\n for (let itr = 0; itr < (arr1.length + arr2.length) ; itr++) {\n if (arr1[pointer1] <= arr2[pointer2] && pointer1 < arr1.length) {\n arr.push(arr1[pointer1++]);\n } else if(arr1[pointer1] > arr2[pointer2] && pointer2 > arr2.length){\n arr.push(arr2[pointer2++]);\n }\n }\n for (let itr = pointer1; itr < arr1.length; itr++) {\n arr.push(arr1[itr]);\n }\n for (let itr = pointer2; itr < arr2.length; itr++) {\n arr.push(arr2[itr]);\n }\n\n let index = 0;\n for (let itr = 0; itr < (arr1.length) ; itr++) {\n arr1[itr] = arr[index++];\n }\n for (let itr = 0; itr < (arr2.length) ; itr++) {\n arr2[itr] = arr[index++];\n }\n}", "title": "" }, { "docid": "f3418c42b02f6de54293497255e16b99", "score": "0.557619", "text": "function merge(left_array, right_array) {\n\tvar left_ptr = 0,\t\n\t\tright_ptr = 0,\n\t\tsorted_arr = [], left, right;\n\n\twhile (left_ptr < left_array.length &&\n\t\t right_ptr < right_array.length) \n\t{\n\t\tleft = left_array[left_ptr];\n\t\tright = right_array[right_ptr];\n\t\tif (left < right) \n\t\t{\n\t\t\tsorted_arr.push(left);\n\t\t\tleft_ptr++;\n\t\t} \n\t\telse \n\t\t{\n\t\t\tsorted_arr.push(right);\n\t\t\tright_ptr++;\n\t\t}\n\t}\n\t\n \twhile (left_ptr < left_array.length) \n \t{\n\t\tsorted_arr.push(left_array[left_ptr++]);\n\t}\n\t\n\twhile (right_ptr < right_array.length) \n\t{\n\t\tsorted_arr.push(right_array[right_ptr++]);\n \t}\n\n\treturn sorted_arr;\n}", "title": "" } ]
f093ea84a1d0d4d098d7708d837a711f
Quick object check this is primarily used to tell Objects from primitive values when we know the value is a JSONcompliant type.
[ { "docid": "1bdd74e0a3c4358617464fac9f9dacc0", "score": "0.0", "text": "function isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}", "title": "" } ]
[ { "docid": "53486ecd3ddc30963f736688cd896cfe", "score": "0.7168206", "text": "static checkJSONValue(value) {\n if (value === undefined) throw new TypeError();\n if (value === null) return null;\n if ([Object, Array, String, Number, Boolean].indexOf(value.constructor) !== -1) return value;\n throw new TypeError();\n }", "title": "" }, { "docid": "1fe927a9698fd76d8db07e67c5dac0e6", "score": "0.7025353", "text": "function smellsLikeJavaObject(e) {\n return _.isObject(e) && !_.isArray(e) && !isLongValue(e);\n }", "title": "" }, { "docid": "c3efdf69d09fe411ca3468704465ea57", "score": "0.7006284", "text": "static isa(obj) {\n\t\tif ( ! obj) return false;\n\t\tif (super.isa(obj)) return true;\n\t\t// OLD format\n\t\tif (getType(obj) === 'MonetaryAmount') return true;\n\t\tif (obj.value100p) return true;\n\t\tif (obj.value100) return true;\n\t\t\t// allow blank values\n\t\tif (isNumeric(obj.value) || obj.value==='') return true;\n\t\tif (obj.currency) return true;\n\t\treturn false;\n\t}", "title": "" }, { "docid": "bb90311fd6220c1c0b7968f1acfa4735", "score": "0.69009143", "text": "isObject (value) {\n return value && typeof value === 'object' && value.constructor === Object;\n }", "title": "" }, { "docid": "9f019dd47976423d44085bc80ab9f688", "score": "0.68454754", "text": "function checkIsObjectPlain(value) {\n return Boolean(value) && typeof value === \"object\" && value.constructor === Object && !Array.isArray(value);\n}", "title": "" }, { "docid": "763c3dd68ad4f48a3321408abe0abcce", "score": "0.68142545", "text": "function isObject( value ) {\n\n if ( typeof value === 'object' && value !== null &&\n !( value instanceof Boolean ) &&\n !( value instanceof Date ) &&\n !( value instanceof Number ) &&\n !( value instanceof RegExp ) &&\n !( value instanceof String ) ) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "6c3434e9563613510843dab73d719158", "score": "0.6799257", "text": "function _isObject(v) {\n return Object.prototype.toString.call(v) === '[object Object]';\n }", "title": "" }, { "docid": "318d9adb5da5c04936f3de28a96e819c", "score": "0.6753785", "text": "static isPrim(obj) {\n if (obj === undefined) {\n throw new Error(\"undefined\");\n }\n return ['string', 'number', 'boolean'].indexOf(typeof obj) >=0;\n }", "title": "" }, { "docid": "cc7172d7ca4a1218ae33b6ae1ba1c997", "score": "0.6707682", "text": "static getIsObject(input) {\n if (typeof (input) !== 'string' && typeof (input) !== 'number' && typeof (input) !== 'boolean') {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67009985", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67009985", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67009985", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67009985", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67009985", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67009985", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67009985", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67009985", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "a1965c784003e813d550848228f330d9", "score": "0.67009985", "text": "function isObject(value) {\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "f711e7a95714d367abac0914e62a894b", "score": "0.66854745", "text": "static isPrimitiveValue(value){\n\t\tif (rtl.isScalarValue(value)){\n\t\t\treturn true;\n\t\t}\n\t\tif (value instanceof Vector){\n\t\t\treturn true;\n\t\t}\n\t\tif (value instanceof Map){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "678229e63854db997078cbeb3e8c28a9", "score": "0.66149944", "text": "static isObject(value) {\n return (value !== undefined && value !== null && value.constructor === Object);\n }", "title": "" }, { "docid": "51e25e20a9893a3219dfa430f3666473", "score": "0.6593079", "text": "isObject(obj) {\n return obj === Object(obj);\n }", "title": "" }, { "docid": "3f0e83c30146030c0c4b8d66b736ecec", "score": "0.6524791", "text": "function isObjectLike(value) {\n return isObject$1(value) && value !== null\n }", "title": "" }, { "docid": "20a82a8b30581032cd684e733a52d638", "score": "0.6522791", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n }", "title": "" }, { "docid": "02e2156f5b2b22e21babdc24c2a12af7", "score": "0.65167826", "text": "function isPrimitive(obj) {\n return obj !== Object(obj);\n}", "title": "" }, { "docid": "2af25904f70546eb58bcaec64883839f", "score": "0.6503611", "text": "function isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n }", "title": "" }, { "docid": "66cb4805460f154238323e1e23683c98", "score": "0.6502794", "text": "function isPrimitive(value) {\n\t // Using switch fallthrough because it's simple to read and is\n\t // generally fast: http://jsperf.com/testing-value-is-primitive/5\n\t switch (typeof value) {\n\t case \"string\":\n\t case \"number\":\n\t case \"boolean\":\n\t return true;\n\t }\n\n\t return value == null;\n\t }", "title": "" }, { "docid": "66cb4805460f154238323e1e23683c98", "score": "0.6502794", "text": "function isPrimitive(value) {\n\t // Using switch fallthrough because it's simple to read and is\n\t // generally fast: http://jsperf.com/testing-value-is-primitive/5\n\t switch (typeof value) {\n\t case \"string\":\n\t case \"number\":\n\t case \"boolean\":\n\t return true;\n\t }\n\n\t return value == null;\n\t }", "title": "" }, { "docid": "88811d67710b1961b1aae1341d24e09f", "score": "0.6500573", "text": "function isObject(x) { return Object.prototype.toString.call(x) === '[object Object]'; }", "title": "" }, { "docid": "7c57f1ebc58f7803df8b1a4c5c3fbaf2", "score": "0.6490268", "text": "function jslibUTypeIsObj (aType) { return (aType == \"object\"); }", "title": "" }, { "docid": "91f15e90186a68e6dcc3109955c0e409", "score": "0.64618", "text": "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "title": "" }, { "docid": "91f15e90186a68e6dcc3109955c0e409", "score": "0.64618", "text": "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "title": "" }, { "docid": "3427f1d028eb88d35c6bbd336a5010b5", "score": "0.64222825", "text": "function isObjectLike(value) {\n return _typeof$2(value) == 'object' && value !== null;\n }", "title": "" }, { "docid": "67eb3a643bddf5f67a42bf27a5605f57", "score": "0.6418153", "text": "function xs_isObject (o) { return typeof (o) === 'object' && Array.isArray(o) == false }", "title": "" }, { "docid": "f2e4b4ce7bfe8f252ca52dd9231f46b0", "score": "0.64179105", "text": "function isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}", "title": "" }, { "docid": "f2e4b4ce7bfe8f252ca52dd9231f46b0", "score": "0.64179105", "text": "function isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}", "title": "" }, { "docid": "3bd1a31417c7969550d4ac7b4ccd8a04", "score": "0.64119506", "text": "function isObject(value) {\n\t\t var type = typeof value;\n\t\t return !!value && (type == 'object');\n\t\t}", "title": "" }, { "docid": "0371ea39a0356aeb616a145d4b3cab96", "score": "0.64112025", "text": "function notObject(value) {\n return typeof value != \"object\";\n}", "title": "" }, { "docid": "734b7c4f9afffda664a6864c3112da19", "score": "0.6411164", "text": "_type(v) {\n if (typeof v === 'number') {\n return 1;\n }\n\n if (typeof v === 'string') {\n return 2;\n }\n\n if (typeof v === 'boolean') {\n return 8;\n }\n\n if (Array.isArray(v)) {\n return 4;\n }\n\n if (v === null) {\n return 10;\n } // note that typeof(/x/) === \"object\"\n\n\n if (v instanceof RegExp) {\n return 11;\n }\n\n if (typeof v === 'function') {\n return 13;\n }\n\n if (v instanceof Date) {\n return 9;\n }\n\n if (EJSON.isBinary(v)) {\n return 5;\n }\n\n if (v instanceof MongoID.ObjectID) {\n return 7;\n } // object\n\n\n return 3; // XXX support some/all of these:\n // 14, symbol\n // 15, javascript code with scope\n // 16, 18: 32-bit/64-bit integer\n // 17, timestamp\n // 255, minkey\n // 127, maxkey\n }", "title": "" }, { "docid": "8de102a63a350fdee94068ffb5f7710d", "score": "0.6409504", "text": "function isObject(value) {\n return toString.call(value) === '[object Object]';\n }", "title": "" }, { "docid": "84ea9f41abdea729601a7797032e9888", "score": "0.64062387", "text": "function jsonV3ValueIsObject(val) {\n return typeof val === 'object' && val !== null && !Array.isArray(val);\n}", "title": "" }, { "docid": "c12453264c8d3755ef4963bfbe0e5f3e", "score": "0.64005136", "text": "function coercePrimitiveToObject(obj) {\n\t if(isPrimitiveType(obj)) {\n\t obj = object(obj);\n\t }\n\t if(noKeysInStringObjects && isString(obj)) {\n\t forceStringCoercion(obj);\n\t }\n\t return obj;\n\t }", "title": "" }, { "docid": "5b5b05b76c7a0267ec464013b4edbe1e", "score": "0.63954693", "text": "function isObject(r){return Object.prototype.toString.call(r)===\"[object Object]\"}", "title": "" }, { "docid": "68a1ce3e50d09e80b0e09f58d148f971", "score": "0.6382023", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);\n }", "title": "" }, { "docid": "44f7f0ce05637a986be0e774a8b963b4", "score": "0.6368514", "text": "function isPrimitive(value) {\n // Using switch fallthrough because it's simple to read and is\n // generally fast: http://jsperf.com/testing-value-is-primitive/5\n switch (typeof value) {\n case \"string\":\n case \"number\":\n case \"boolean\":\n return true;\n }\n\n return value == null;\n }", "title": "" }, { "docid": "5fe90502bc4cde143588fc95770d7355", "score": "0.63677704", "text": "function isObject(value) {\n return is('object', value);\n }", "title": "" }, { "docid": "969ccb3bd622b405611d1074277aa564", "score": "0.6363354", "text": "function isPrimitive(value) {\n return (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean')\n }", "title": "" }, { "docid": "ce82c3008875be3871abd0102709d3a5", "score": "0.6361217", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n }", "title": "" }, { "docid": "aa03e2fa51bd48d9a610efd1cad0760d", "score": "0.6357293", "text": "function isObject(value) {\r\n return typeof value === \"object\";\r\n}", "title": "" }, { "docid": "eb522f7c2f4330d66fd61b15a7e4c864", "score": "0.63510853", "text": "function isObject(obj){return obj!==null&&(typeof obj==='undefined'?'undefined':_typeof2(obj))==='object';}", "title": "" }, { "docid": "5346d007d0412787dff57fcba0d2e670", "score": "0.63325065", "text": "function isObject(a){return a&&\"object\"===_typeof(a)&&!Array.isArray(a)}", "title": "" }, { "docid": "b178e4f43e2a2e92e68a30bc2fb52974", "score": "0.6330555", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n }", "title": "" }, { "docid": "ecbdbdb31e20cc48a2f11491badbd6ec", "score": "0.63062304", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\n }", "title": "" }, { "docid": "b913e9c37668f9a48ad1210eca46ebfb", "score": "0.6304448", "text": "function isObjectLike(value) {\n return !!value && typeof value === 'object';\n}", "title": "" }, { "docid": "132f48c3d4f3ef547c2de8a65bb4a8bc", "score": "0.63035905", "text": "function isObject(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}", "title": "" }, { "docid": "fbd2d6c91f78c6009d1da18dd5f330ce", "score": "0.6302384", "text": "detectObjectType (obj) {\n return 'object';\n }", "title": "" }, { "docid": "1194e53e7a3939c522cff9bdf967e7b5", "score": "0.6295063", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "title": "" }, { "docid": "1194e53e7a3939c522cff9bdf967e7b5", "score": "0.6295063", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }", "title": "" }, { "docid": "e1d8153bab9ac9b20b4a2106be209e6a", "score": "0.6292933", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "title": "" }, { "docid": "e1d8153bab9ac9b20b4a2106be209e6a", "score": "0.6292933", "text": "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "title": "" }, { "docid": "1f428e388567f28f73850e8eea88758f", "score": "0.6292674", "text": "function isPrimitive(value) {\n\t if (value === null) {\n\t return true;\n\t }\n\t if (value === undefined) {\n\t return false;\n\t }\n\t if (typeof value === 'function') {\n\t return false;\n\t }\n\t if (['boolean', 'number', 'string'].indexOf(typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) !== -1) {\n\t return true;\n\t }\n\t if (value instanceof Date || value instanceof ArrayBuffer) {\n\t return true;\n\t }\n\t return false;\n\t}", "title": "" }, { "docid": "bcfe86456dcbc277b0198a35cb5bd047", "score": "0.6290691", "text": "function isObject(o) { return typeof o === 'object'; }", "title": "" }, { "docid": "ba0ecec46b8ac07927c3a05e6bac25f8", "score": "0.6290571", "text": "function isObject(e){return Object.prototype.toString.call(e)===\"[object Object]\"}", "title": "" }, { "docid": "ba0ecec46b8ac07927c3a05e6bac25f8", "score": "0.6290571", "text": "function isObject(e){return Object.prototype.toString.call(e)===\"[object Object]\"}", "title": "" }, { "docid": "493c23d88afa1de9458c339313f24581", "score": "0.6281769", "text": "function isPrimitiveType(value) {\n return (\n value === null || (typeof value !== \"object\" && typeof value !== \"function\")\n )\n}", "title": "" }, { "docid": "c3fa70e4adc9277af0f9346f9c91b09c", "score": "0.62663496", "text": "function isObject(value) {\n return value === Object(value)\n}", "title": "" }, { "docid": "a616a32a09e19af429987975cf08fa54", "score": "0.6264141", "text": "function isObject(obj) {\n return obj !== null && is(obj, strObject);\n }", "title": "" }, { "docid": "9c2bf75f5aa2ef41583c2a2bb3bb5bf5", "score": "0.626155", "text": "function isPlainObject(value) {\r\n return value.constructor === Object || value.constructor == null;\r\n }", "title": "" }, { "docid": "6cd6594a17438294b56107a9090822de", "score": "0.6249564", "text": "function coercePrimitiveToObject(obj) {\n if (isPrimitiveType(obj)) {\n obj = object(obj);\n }\n if (noKeysInStringObjects && isString(obj)) {\n forceStringCoercion(obj);\n }\n return obj;\n }", "title": "" }, { "docid": "0a73d391bf439312c0bcd83c2fd0e50b", "score": "0.62491274", "text": "function isObject (value)\n{\n return value && typeof value === 'object';\n}", "title": "" }, { "docid": "1d04c9138450e4890ad0dd7f57183f56", "score": "0.62413955", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n }", "title": "" }, { "docid": "09be042fdc218b8e6e476e8728a484dd", "score": "0.62380886", "text": "function isNumberObject(obj){\n\treturn obj && typeof obj === \"object\"\n\t\t&& Function.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\n}", "title": "" }, { "docid": "ce97806e1705cbfae1556782b26c5349", "score": "0.62363136", "text": "function checkType(obj) {\r\n var objTyp = Object\r\n .prototype\r\n .toString\r\n .call(obj)\r\n .replace('[object ', '')\r\n .replace(']', '')\r\n .toLowerCase();\r\n return objTyp;\r\n}", "title": "" }, { "docid": "bc241350ed9a70791e2db003e465ae9e", "score": "0.62341744", "text": "function is_object(v) {\r\n //One of the quirks of JavaScript is that typeof null returns \"object\". But it’s not an object. So let’s check for that, too\r\n return (v instanceof Object && v.toString() == '[object Object]');\r\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.6220543", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.6220543", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.6220543", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.6220543", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "cdb3d202f1cd70f42349c45d0c907c5f", "score": "0.6220543", "text": "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "title": "" }, { "docid": "dd133ccdb99d901f66868a0e532ac18b", "score": "0.6219754", "text": "static checkObject(value, default_value) {\n if (value !== undefined && value !== null && value.constructor === Object) {\n if (default_value === undefined || (default_value !== null && default_value.constructor === Object)) {\n return value;\n }\n } else if (default_value !== undefined && default_value !== null && default_value.constructor === Object) {\n if (value === undefined) {\n return default_value;\n }\n }\n throw new TypeError();\n }", "title": "" }, { "docid": "c8033da159ff8dd383ec9acf98f491e4", "score": "0.6212428", "text": "function isObject(input) {\n return _typeof$1(input) === 'object';\n }", "title": "" }, { "docid": "bcd2c5d2cc71e37e9c06886891deac6a", "score": "0.6211501", "text": "function isObject(a){ return Object(a) === a }", "title": "" }, { "docid": "f77a1dbf6f86c397c194f3ad8aa3e60f", "score": "0.6211146", "text": "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n }", "title": "" }, { "docid": "f77a1dbf6f86c397c194f3ad8aa3e60f", "score": "0.6211146", "text": "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n }", "title": "" }, { "docid": "581f3fe12ff188c4e1d0d6b42ee44721", "score": "0.6208974", "text": "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "title": "" }, { "docid": "581f3fe12ff188c4e1d0d6b42ee44721", "score": "0.6208974", "text": "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "title": "" }, { "docid": "581f3fe12ff188c4e1d0d6b42ee44721", "score": "0.6208974", "text": "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "title": "" }, { "docid": "581f3fe12ff188c4e1d0d6b42ee44721", "score": "0.6208974", "text": "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "title": "" }, { "docid": "581f3fe12ff188c4e1d0d6b42ee44721", "score": "0.6208974", "text": "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "title": "" }, { "docid": "5147c23c0845f27324c5cf5286e47a83", "score": "0.6206066", "text": "function isPrimitive(value) {\n\t return typeof value === 'string' || typeof value === 'number';\n\t}", "title": "" }, { "docid": "4b189a8bab40cb794f6dc42f1eb71fd8", "score": "0.6203129", "text": "function isPlainEnoughObject(o) {\n return o !== null && !Array.isArray(o) && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object';\n}", "title": "" }, { "docid": "4b189a8bab40cb794f6dc42f1eb71fd8", "score": "0.6203129", "text": "function isPlainEnoughObject(o) {\n return o !== null && !Array.isArray(o) && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object';\n}", "title": "" }, { "docid": "358182537f7ffe89fbf7e6819bd351d4", "score": "0.6197624", "text": "function isPrimitiveJSValue(value) {\n return value === null || value === undefined || typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean';\n }", "title": "" }, { "docid": "14ea1a077a7afd4d6392350366dae91b", "score": "0.61962914", "text": "isPlainObject(value) {\n if (value == null) { // null or undefined\n return false\n }\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false\n }\n if (value.constructor === undefined) {\n return true\n }\n let proto = Object.getPrototypeOf(value)\n return proto === null || proto === Object.prototype\n }", "title": "" }, { "docid": "38538d4c0791f263f9f8ce333cb58e08", "score": "0.61939895", "text": "function isPrimitive (value) {\n\t return (\n\t typeof value === 'string' ||\n\t typeof value === 'number' ||\n\t typeof value === 'boolean'\n\t )\n\t}", "title": "" }, { "docid": "9963c3f571e3150ae04620860227a923", "score": "0.6193864", "text": "function isObjectLike(value) {\n return isObject(value) && value !== null\n}", "title": "" }, { "docid": "9963c3f571e3150ae04620860227a923", "score": "0.6193864", "text": "function isObjectLike(value) {\n return isObject(value) && value !== null\n}", "title": "" }, { "docid": "348d2a24f48f664a67622bd5556b9ec1", "score": "0.61870474", "text": "function TypeIsObject(x) {\r\n // This is expensive when it returns false; use this function\r\n // when you expect it to return true in the common case.\r\n if (false) {\r\n return x !== void 0 && x !== null && Object(x) === x;\r\n }\r\n // It turns out that !TypeIsNotObject is faster...\r\n return !TypeIsNotObject(x);\r\n}", "title": "" }, { "docid": "7d6f4a2678cf7b973ad5f040cda72cfd", "score": "0.61862713", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }", "title": "" }, { "docid": "7d6f4a2678cf7b973ad5f040cda72cfd", "score": "0.61862713", "text": "function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }", "title": "" }, { "docid": "0d3111f1daa2dba62fa53f342d691878", "score": "0.6184874", "text": "function isObject(obj) {\n\t return typeof obj === 'object' && obj !== null\n\t }", "title": "" }, { "docid": "fa7590883c3a2372902a4b9fbee12e6f", "score": "0.6173822", "text": "function isObject(v) {\r\n return t(v).isObject && !isDate(v);\r\n}", "title": "" } ]
bed61a5a2d5d99571a3c47f85b314a39
at this point, the user has presumably seen the 'readable' event, and called read() to consume some data. that may have triggered in turn another _read(n) call, in which case reading = true if it's in progress. However, if we're not ended, or reading, and the length < hwm, then go ahead and try to read some more preemptively.
[ { "docid": "b401904ef60106fddc1bcab8e422361c", "score": "0.0", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(function() {\n maybeReadMore_(stream, state);\n });\n }\n}", "title": "" } ]
[ { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6746112", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6746112", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6746112", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6746112", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "b9507326e6c08977d9affa20e7d6c660", "score": "0.674256", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "b9507326e6c08977d9affa20e7d6c660", "score": "0.674256", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "b9507326e6c08977d9affa20e7d6c660", "score": "0.674256", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "e40efab2d771ce37fcb0921d1eb440a7", "score": "0.6681479", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state)}}", "title": "" }, { "docid": "887c48c7799c60bad6d4ead75638f0d3", "score": "0.66423243", "text": "function read() {\n const chunk = readable.read();\n if (chunk === null) {\n writable.end();\n return;\n }\n if (!writable.write(chunk)) {\n readable.off('readable', read);\n writable.once('drain', () => {\n console.log('DRAIN');\n readable.on('readable', read);\n })\n }\n}", "title": "" }, { "docid": "156920c98f255d0e71108f0f7d307cc3", "score": "0.6541009", "text": "function needMoreData(state){return !state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);} // backwards compatibility.", "title": "" }, { "docid": "d3e7770e90e8abe83088ae3f4a84067c", "score": "0.6510663", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length; else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n } // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "9bb4ffd43e78855babfd661b34bb455d", "score": "0.650077", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}", "title": "" }, { "docid": "5a71ad436419063f53a02dfa66b013fc", "score": "0.6500038", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}", "title": "" }, { "docid": "609351c71b640a50894a5c0984fa2a9d", "score": "0.6484375", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}// backwards compatibility.", "title": "" }, { "docid": "609351c71b640a50894a5c0984fa2a9d", "score": "0.6484375", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}// backwards compatibility.", "title": "" }, { "docid": "a81349fe9b6a8135e3389bd25e00ec97", "score": "0.6465904", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){\n// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length}\n// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;\n// Don't have enough\nif(!state.ended){state.needReadable=true;return 0}return state.length}", "title": "" }, { "docid": "77785a7994af9a7af979c28debce7e94", "score": "0.6461209", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length; else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n } // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "77785a7994af9a7af979c28debce7e94", "score": "0.6461209", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length; else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n } // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "9da1df576dde6ebc99a70f187912c3e9", "score": "0.6444953", "text": "function howMuchToRead(n, state) {\n\t if (n <= 0 || state.length === 0 && state.ended) return 0;\n\t if (state.objectMode) return 1;\n\n\t if (n !== n) {\n\t // Only flow one buffer at a time\n\t if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n\t } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n\t if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n\t if (n <= state.length) return n; // Don't have enough\n\n\t if (!state.ended) {\n\t state.needReadable = true;\n\t return 0;\n\t }\n\n\t return state.length;\n\t} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "bf2a8dfc723f35c1e32e19f06e4b0bb4", "score": "0.643768", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n } // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "a8654dd211ed7347d0f4d8a39f2dc4ea", "score": "0.6415538", "text": "function howMuchToRead$2(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark$2(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n } // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "d5d76b475ea96f9ab1df91b973249821", "score": "0.6393054", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.63816214", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "f46a3b5cb45d8c529549acc834f4d665", "score": "0.63702416", "text": "async _read() {\n debug('_read')\n if (!this.setupComplete) {\n this.setupComplete = true\n\n /**\n * When there is no more data, let the upstream handler\n * know, and ask the downstream handler to destroy itself:\n */\n\n this.doFn.on('end', async () => {\n debug('end')\n this.push(null)\n await this.doFn.finishBundle(this)\n })\n\n this.doFn.on('data', chunk => {\n debug('data (', chunk, ')')\n if (!this.push(chunk)) {\n this.doFn.pause()\n }\n })\n }\n\n this.doFn.resume()\n }", "title": "" }, { "docid": "737c4ab818b0e17df2457cf3974e8475", "score": "0.63682145", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "737c4ab818b0e17df2457cf3974e8475", "score": "0.63682145", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "10cde7407ebcd16891fb7c4dbb394f8e", "score": "0.6366292", "text": "function howMuchToRead(n, state) {\r\n if (n <= 0 || state.length === 0 && state.ended) return 0;\r\n if (state.objectMode) return 1;\r\n\r\n if (n !== n) {\r\n // Only flow one buffer at a time\r\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\r\n } // If we're asking for more than the current hwm, then raise the hwm.\r\n\r\n\r\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\r\n if (n <= state.length) return n; // Don't have enough\r\n\r\n if (!state.ended) {\r\n state.needReadable = true;\r\n return 0;\r\n }\r\n\r\n return state.length;\r\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "0a512d91a9733a5e5e5b8288392d7d0f", "score": "0.63629764", "text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;\n else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n} // you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "70715f2a0bf707809ab80c27076f02ad", "score": "0.6352516", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" } ]
65a30f602ec499ec3b6e0cad1c29b6d2
called when user clicks add question button
[ { "docid": "8024436b770a877f203272805eb32207", "score": "0.0", "text": "function resetAnswerId() {\r\n answerId = 1;\r\n}", "title": "" } ]
[ { "docid": "ebbb7b33c115977dbcc9f281216c099f", "score": "0.7921165", "text": "function addQuestion() {\n $('#add-question').click(function() {\n var id = Math.floor(Math.random() * (100000)) + 9999;\n var regexp = RegExp($(this).data('id'), 'g');\n $(this).before($(this).data('fields').replace(regexp, id));\n trash();\n return false;\n });\n }", "title": "" }, { "docid": "eaa28d0fc9715de97a0e18d3da018341", "score": "0.76664895", "text": "function addQuestion() {\n let input = $('.question-input').serializeArray(); //loads user input\n userQuiz.addQ(input); //run addQ\n $(\"#create-question-form input\").val(''); //remove user typed input when question has been added\n\n //display newly added question below the form\n $(\"#added-Qs\").append(`\n <div class=\"new-question\">\n <div id=\"border-line\"></div>\n <h4>${userQuiz.questions[userQuiz.questions.length - 1].q}</h4>\n <h5>${userQuiz.questions[userQuiz.questions.length - 1].a}</h5>\n </div>\n `);\n}", "title": "" }, { "docid": "2dc090133bb5c2152fa9e223a6ef16fe", "score": "0.7661785", "text": "ADD_QUESTION(state, question) {\n state.questions.push(question);\n state.isAddQuestionVisible = false;\n }", "title": "" }, { "docid": "d05d80ab95d75a7ea7595aee6c0d507d", "score": "0.74879014", "text": "function addQuestion() {\n\tvar newquestion = document.getElementById(\"add_question_question\").value;\n\tvar answerSelect = document.getElementById(\"add_question_answer\");\n\tvar newanswer = answerSelect.textContent;\n\n\t$.post('/add_question', {question: newquestion, answer: newanswer}, function(data) {\n\t\tif (newquestion == \"\") {\n\t\t\twindow.alert(\"Et voi lisätä tyhjää kysymystä. Lisää kysymyksen tiedot.\");\n\t\t}\n\t\telse if (data.succesful == true) {\n\t\t\twindow.alert(\"Kysymys lisätty.\");\n\t\t\tlocation.reload();\n\t\t}\n\t\telse if (data.succesful == false) {\n\t\t\twindow.alert(\"Kysymyksen lisääminen epäonnistui.\");\n\t\t}\n\t});\n\tdocument.getElementById(\"add_question_inputs\").style.display=\"none\";\n}", "title": "" }, { "docid": "e33e530b045ee3f35d3429802e805880", "score": "0.74440414", "text": "function addQuestion() {\n // get the input from the text input\n var newQuestion = inputQuestion.value;\n var newChoices = inputChoices.value;\n var newCorrect = inputCorrect.value;\n\n // store the new question and answer\n var ret = browser.storage.local.set({[newQuestion]: [newChoices, newCorrect]});\n ret.then(() => {\n // redo the list\n displayCount();\n //displayList();\n }, onError);\n}", "title": "" }, { "docid": "5b9aee5ed68c279e417c72747ff37b50", "score": "0.7313041", "text": "addQuestionToPaper(event){\n\t\tvar id = FlowRouter.getParam(\"id\");\t\t\t\n\t\tvar questionId = $(event.target).attr('id');\t\t\n\t\tvar questionExist = QuestionPaperMaster.findOne({\"_id\":FlowRouter.getParam(\"id\"),'questionsArray.questionId':questionId});\n\t\tif(questionExist){\n\t\t\tMeteor.call(\"removeSelectedQuestion\",id,questionId);\n\t\t\tvar queCountFun = this.getSelectedQuesCount();\n\t\t}else{\n\t\t\tvar queCountFun = this.getSelectedQuesCount();\n\t\t\tvar maxQuestion = queCountFun[0];\n\t\t\tvar queCountarray = queCountFun[1]+1;\n\t\t\tif(queCountarray <=maxQuestion){\n\t\t\tMeteor.call(\"addQuestioToPaper\",questionId,id,(error,result)=>{\n\t\t\t\tif(error){\n\t\t\t\t\tswal(\"Question Not Added\");\n\t\t\t\t}else{\n\t\t\t\t}\n\t\t\t});\n\t\t\t}else{\n\t\t\t\t$('#'+questionId).attr('checked',false);\n\t\t\t\tswal({\n\t\t\t\t\t title: \"Can't select more than \" +'\"'+maxQuestion+'\"'+\" Questions\",\n \t\t\t\t\t text: '',\n \t\t\t\t\t type: 'warning',\n\t\t\t\t});\n\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "dc3bc7c38762aeac473f213ac9219109", "score": "0.7297611", "text": "function addQuestions() {\n createQuestions(\"What is the incantation for unlocking a door?\", \"Wingardium Leviosa\",\n \"Sectumsempra\",\n \"Silencio\",\n \"Alohomora\");\n createQuestions(\"When affected by a Dementor what should one eat?\", \"Broccoli\",\n \"Bread\",\n \"Soup\",\n \"Chocolate\");\n createQuestions(\"What is the difference between a Werewolf and an Animagus?\",\n \"Nothing they are synonyms\",\n \"A Werewolf chooses when to transform and an Animagus does not\",\n \"A Werewolf is a version of an Animagus, they just chose a wolf\",\n \"A Werewolf is cursed and must transform, an Animagus chooses to turn into an animal\");\n createQuestions(\"If one were to drink a Unicorn’s blood what would happen?\",\n \"They would get a wish\",\n \"They would die instantly\",\n \"They would turn into a Unicorn\",\n \"They would be kept alive indefinitely but would live a cursed life\");\n createQuestions(\"Which one is an Unforgivable Curse?\",\n \"Reducto\",\n \"Stupefy\",\n \"Aguamenti\",\n \"Imperio\");\n createQuestions(\"What cures most poisons?\",\n \"Dragon’s blood\",\n \"Pixie wings\",\n \"Polyjuice Potion\",\n \"A Bezoar\");\n createQuestions(\"What is the incantation to Disarm someone?\",\n \"Expecto Patronum\",\n \"Petrificus Totalus\",\n \"Serpensortia\",\n \"Expelliarmus\");\n createQuestions(\"How long does it take to brew a Polyjuice Potion?\",\n \"6 days\",\n \"3 hours\",\n \"1 year\",\n \"1 month\");\n createQuestions(\"What is a Horcrux?\",\n \"A type of currency\",\n \"A sword used to destroy unbreakable items\",\n \"A ball used in Quidditch\",\n \"A fragment of a soul hidden in an object\");\n createQuestions(\"What should one do first before approaching a Hippogriff?\",\n \"Wave\",\n \"Sing\",\n \"Clap\",\n \"Bow\");\n }", "title": "" }, { "docid": "2ecc977beed3319629914e6dc9306668", "score": "0.723962", "text": "addQuestion({ commit }, question) {\n commit('addQuestion', question);\n }", "title": "" }, { "docid": "be1e8ca19b8c8b183ed62b7aaaa33404", "score": "0.71682006", "text": "_onAddSurveyQuestionClicked() {\n this.props.addSurveyQuestionAction();\n }", "title": "" }, { "docid": "dfe9d0e2027374610a6f5e8b82fddff7", "score": "0.7158612", "text": "function addQuestion(question, answerId, options) {\n obj.questions.push({\n id : questionId,\n question : question,\n answerId : answerId,\n options : options\n });\n questionId++;\n $(\"#downloadFile\").remove();\n}", "title": "" }, { "docid": "8df254f2a746437ff7dd44eb571de103", "score": "0.71018696", "text": "function addQuestion (question){\n return {\n type: ADD_QUESTION,\n question\n }\n}", "title": "" }, { "docid": "d4619a697cbc3944eaf461cef044152e", "score": "0.7071309", "text": "addNewQuestion() {\n let Qns = this.state.qns.slice();\n if((this.state.qns.slice().map(Qn => Qn.Question)).indexOf('') < 0) {\n Qns.push({'Question' : DEFAULT_QN_PRETEXT + (Qns.length+1), 'Options' : ['',''], 'imageURI' : '#'});\n this.setState({qns : Qns, currIndex : Qns.length-1, leftPane: 'closed'});\n } else {\n alert(\"Please provide question text for all the available questions before adding a new Question\");\n }\n\n }", "title": "" }, { "docid": "29920f9599aab5d8002f72599828b59e", "score": "0.7052316", "text": "addQuestion(e) {\n e.preventDefault();\n this.setState(\n {\n questions: [\n ...this.state.questions,\n {\n id: Date.now(),\n quesType: 'radio',\n question: '',\n options: ''\n }\n ]\n }\n );\n }", "title": "" }, { "docid": "6fd2d59603329a2d873d088d55587a9a", "score": "0.70429474", "text": "function addQuestion($container) {\n // Dans le contenu de l'attribut « data-prototype », on remplace :\n // - le texte \"__name__label__\" qu'il contient par le label du champ\n // - le texte \"__name__\" qu'il contient par le numéro du champ\n var template = $container.attr('data-prototype')\n .replace(/__name__label__/g, 'Question')\n .replace(/__name__/g, index)\n ;\n\n // On crée un objet jquery qui contient ce template\n var $prototype = $(template);\n\n // On ajoute au prototype un lien pour pouvoir supprimer la catégorie\n addDeleteLinkQuestion($prototype);\n\n // On ajoute le prototype modifié à la fin de la balise <div>\n $container.append($prototype);\n\n indexR.push(0);\n\n // On récupère la balise <div> en question qui contient l'attribut « data-prototype » qui nous intéresse.\n var $containerR = $('div#hlin601_moocbundle_qcm_questions_'+index+'_reponses');\n\n var $addReponseLink = $('<a href=\"#\" id=\"add_reponse_'+index+'\" class=\"btn btn-default\">Ajouter une Réponse</a>');\n\n $containerR.append($addReponseLink);\n\n $('#add_reponse_'+index).click(function(e) {\n addReponse($containerR);\n\n e.preventDefault(); // évite qu'un # apparaisse dans l'URL\n return false;\n });\n\n // Enfin, on incrémente le compteur pour que le prochain ajout se fasse avec un autre numéro\n index++;\n }", "title": "" }, { "docid": "92baca58e2d7c18c7728bdb5a551d9f9", "score": "0.7039185", "text": "function addQuestionName() {\n\tvar questionName = document.getElementById(\"questionName\").value.trim();\n\tdocument.getElementById(\"qName\").innerHTML = questionName;\n\tvar data = questionName;\n\treturn saveToList(event, data);\n}", "title": "" }, { "docid": "14683ac6f70b08a753678b35e3a92da8", "score": "0.7018239", "text": "addQuestion() {\n let newQuestion = {\n title: this.state.temp_question_title,\n question: this.state.temp_question\n };\n let questions = this.state.questions;\n questions.push(newQuestion);\n this.setState({ questions: questions });\n this.setState({ temp_question: \"<p>Write your Challenge</p>\" });\n this.setState({ temp_question_title: \"\" });\n $(\"#newQuestion\").modal(\"hide\");\n }", "title": "" }, { "docid": "b423a47f68ffb8b6c14f806b206a97de", "score": "0.7003726", "text": "function addNewQuestion(testId) {\n console.log('trying to add a question');\n}", "title": "" }, { "docid": "e095fb69e2b10e2d235a7dee9e742c16", "score": "0.6963486", "text": "function putQuestion() {\n modal.style.display = \"block\"\n displayQuestion = document.createElement('p')\n displayQuestion.className = 'display-question'\n modalQuestion.style.display = \"block\"\n submitButton.style.display = \"block\"\n submitButton.reset ()\n displayQuestion.textContent = clickedClue.question\n modalQuestion.replaceChildren(displayQuestion)\n modalResult.replaceChildren(displayResults)\n displayResults.innerText = \"\"\n modalResult.replaceChildren(displayResults)\n submitButton.addEventListener('submit', submitAnswer)\n }", "title": "" }, { "docid": "0335ed6d5e2fd454bc6ba65f23150e7c", "score": "0.69616765", "text": "function registerNextQuestion() {\n $('#next_question_button').click(requestNewQuestion);\n}", "title": "" }, { "docid": "c561c531ddca2dca86829464608e3bc7", "score": "0.6958011", "text": "function addAnswer() {\n var answerDiv = event.target.parentNode;\n var questionLabelDiv = answerDiv.previousElementSibling;\n var labelElements = answerDiv.getElementsByTagName(\"label\");\n var answerField = document.createElement(\"input\");\n answerField.type = \"text\";\n answerField.className = \"form-control removable\";\n answerField.id = \"answer-\" + (labelElements.length + 1);\n var questionNumber = questionLabelDiv.getElementsByTagName(\"label\")[0].textContent.split(\" \")[1];\n answerField.name = \"answer-\" + questionNumber + \"[]\";\n\n var answerRemoveButton = document.createElement(\"button\");\n answerRemoveButton.className = \"btn btn-dark remove-button\";\n answerRemoveButton.textContent = \"X\";\n answerRemoveButton.addEventListener(\"click\", removeAnswer);\n\n var answerFieldDiv = document.createElement(\"div\");\n answerFieldDiv.className = \"form-group\";\n var answerFieldLabel = document.createElement(\"label\");\n answerFieldLabel.for = answerField.id;\n answerFieldLabel.textContent = \"Answer \" + (labelElements.length + 1);\n\n answerDiv.insertBefore(answerFieldDiv, event.target);\n answerFieldDiv.appendChild(answerFieldLabel);\n answerFieldDiv.appendChild(answerField);\n answerFieldDiv.appendChild(answerRemoveButton);\n}", "title": "" }, { "docid": "70196affdb648e2b4e10ae98a461ec23", "score": "0.69302124", "text": "function onQuestionSubmit() {\n const validate = validateData()\n if (validate.question && validate.answers) {\n microcredapi.post('/questions/create', payload)\n }\n setTimeout(() => {\n history.push('/manage/questions')\n }, 1000);\n }", "title": "" }, { "docid": "d3cc2c28d0ff92bf66a9e3a097131f8f", "score": "0.687201", "text": "function newObQuestion() {\n\n\t$(this).removeClass('btn-warning');\n $(this).addClass('btn-success');\n\n\t$(\"#contest_details_form\").show('slow');\n\t$(\"#answer_scheme\").hide('slow');\n\n\t$(\"#subjectiveForm\").show('slow');\n\t\t//Question_number++;\n\t\t$(\"#question_text\").val('');\n\t\t$(\"#question_id\").val(Question_number);\n\t\t$(\"#question_label\").text('Question No. #'+Question_number);\n\t\t$(\"#question_type\").val(0);\n\t\t$(\"#ObjectiveAnswer_options\").show('slow');\n\t\t$(\"#answer_id_text\").hide('slow');\n\n}", "title": "" }, { "docid": "20b392d95054d784516233b2d76b07b6", "score": "0.68616337", "text": "addNewQuestion(type) {\n \tlet form = (type === newFormType) ? this.state.newForm\n : this.state.editViewItem;\n form.questions.push(questionBase());\n if (type === newFormType) this.setState({newForm: form});\n else this.setState({editViewItem: form});\n }", "title": "" }, { "docid": "cec50b7db59670eb60018914188d92a9", "score": "0.6852278", "text": "function addNewQuestion() {\n var errArea = document.getElementById(\"ErrNewQuestion\");\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n $('#NewQuestionText').val(\"\");\n $('#AddQuestionClicker').fadeOut();\n $('#deleteEditTestButton').fadeOut();\n $('#cancelEditTestButton').fadeOut();\n $('#EditTestQuestionList').fadeOut();\n $('#saveEditTestButton').fadeOut();\n $('#validateTestButton').fadeOut(500, function () { $('#NewQuestion').fadeIn(500, null) });\n}", "title": "" }, { "docid": "bc26e921814599edec4374dcea065346", "score": "0.6841693", "text": "function newQuestion() {\n\n if (_questionNumber < _questionsList.length) {\n resetTime();\n setQuestions(_questionsList[_questionNumber], _answersList[_questionNumber]);\n // _questionNumberArray.push(_questionNumber);\n _questionNumber++;\n }\n else {\n finalResult();\n }\n}", "title": "" }, { "docid": "dabaa92f947353b9de77df49aa7bdfbf", "score": "0.6821503", "text": "function addNewItem(question, yes_cnt, no_cnt) {\n var y_pos = total_height + 10;\n num_items++;\n var edit = display_div.appendElement('<edit width=\"160\" wordwrap=\"true\" \\\n multiline=\"true\" x=\"10\" y=\"' + y_pos + '\" align=\"left\" \\\n background=\"#DDDDFF\" size=\"8\" editable=\"false\" enabled=\"false\" \\\n value=\"' + num_items + ') '+ question + '\"/>');\n edit.height = edit.idealBoundingRect.height;\n total_height = y_pos + edit.height;\n display_div.appendElement('<label height=\"15\" width=\"80\" x=\"170\" y=\"' +\n y_pos + '\" align=\"right\"> ' + yes_cnt + ' </label>');\n display_div.appendElement('<label height=\"15\" width=\"80\" x=\"250\" y=\"' +\n y_pos + '\" align=\"right\"> ' + no_cnt + ' </label>');\n}", "title": "" }, { "docid": "9eead51c0390e557ca3a54d6e15e9643", "score": "0.68014926", "text": "function putQuestion() {\n inputLabel.innerHTML = questions[position].question\n inputField.type = questions[position].type || 'text'\n inputField.value = questions[position].answer || ''\n inputField.focus()\n\n // set the progress of the background\n progress.style.width = position * 100 / questions.length + '%'\n\n previousButton.className = position ? 'ion-android-arrow-back' : 'ion-person'\n\n showCurrent()\n\n }", "title": "" }, { "docid": "35c8f5d7cca0099f6f49ac1a52b418fb", "score": "0.68007994", "text": "function jsGUIAddQuestion(question, currentQuestionName, currentNum) {\n\tif (!currentQuestionName) {\n\t\tvar tempID = \"dynQuestion_\" + $(\".question\").length;\n\t\t\n\t\t// Create the window first, if none exists\n\t\tif ($(\".window\").length < 1) {\n\t\t\tjsGUIAddWindow(10, 10);\n\t\t}\n\n\t\tvar recentSort = \"sort\" + ($(\".sortable\").length - 1);\n\n\t\t//Create the question\n\t\tvar div = $('<li>', { id: tempID },\n\t\t\t\t\t\t\t{ class: 'question' } );\n\t\tif (!currentNum) {\n\t\t\tdiv.appendTo('#' + recentSort);\n\t\t}\n\t\telse {\n\t\t\tdiv.appendTo('#sort' + currentNum);\n\t\t}\n\n\t \t// Start adding Text to the question\n\t \t$('<div>', {\n\t \t\thtml: 'Question: ' + question.label,\n\t \t\tid: tempID + '_label'\n\t \t}).appendTo(div);\n\t \t$('<div>', {\n\t \t\thtml: 'Type: ' + question.type,\n\t \t\tid: tempID + '_type'\n\t \t}).appendTo(div);\n\n\t \t// add the original name, but hide it!\n\t \t$('<div>', {\n\t \t\thtml: question.name,\n\t \t\tid: tempID + '_name',\n\t \t\tstyle: 'display:none'\n\t \t} ).addClass('true-name').appendTo(div);\n\n\t \t//add an edit button in the lower left corner\n\t\t$('<button>', {\n\t\t\tonclick: \"jsGUIEditQuestion('\" + tempID + \"')\",\n\t\t\ttype: 'button',\n\t\t\thtml: \"<i class='fa fa-edit'></i> Edit\"\n\t\t}).addClass('edit-icon').appendTo(div);\n\n\n\t\t//add a delete button in the lower right corner\n\t\t$('<button>', {\n\t\t\tonclick: \"jsGUIDeleteQuestion('\" + tempID + \"')\",\n\t\t\ttype: 'button',\n\t\t\thtml: \"<i class='fa fa-trash'></i> Delete\"\n\t\t}).addClass( 'delete-icon' ).appendTo(div);\n\n\t \t$(div).addClass('question');\n\t \t$(div).addClass('ui-state-default');\n\t}\n\n\telse {\n\t\tjsGUIUpdateQuestion(question, currentQuestionName);\n\t}\n\n\t//jsGUIDFS();\n}", "title": "" }, { "docid": "f9e9b5cb035fb2bdc46b381ae2920a19", "score": "0.6776052", "text": "function addChoice(questionId){\n\t//http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_prompt\n\tvar newAnswer = prompt(\"What's the answer choice?\", \"OSX is the best\");\n \n jsRoutes.controllers.SimplePassageController.addChoiceToQuestion(questionId, newAnswer, false).ajax({\n success : function(data) {\n //window.location.reload();\n },\n error : function(err) {\n //window.location = \"\";\n },\n complete : function() {\n window.location.reload();\n }\n });\n\n}", "title": "" }, { "docid": "d9ae9356340f5f655442268d0bec4274", "score": "0.6760872", "text": "function newQuestion() {\n if (questionCount + 1 === trivia.length) {\n questionCount++;\n $(\"#empty-question\").empty();\n $(\"#empty-question\").append(finalScore());\n } else {\n questionCount++;\n $(\"#empty-question\").empty();\n $(\"#empty-question\").append(question());\n }\n }", "title": "" }, { "docid": "b8a0a08327e92bfb1a992d085fde6a17", "score": "0.67576784", "text": "function addNewAnswer() {\n var errArea = document.getElementById(\"ErrNewAnswer\");\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n $('#NewAnswerText').val(\"\");\n $('#AnswerIsCorrect').prop('checked', false);\n $('#AddAnswerClicker').fadeOut();\n $('#deleteEditQuestionButton').fadeOut();\n $('#cancelEditQuestionButton').fadeOut();\n $('#EditQuestionAnswerList').fadeOut();\n $('#saveEditQuestionButton').fadeOut(500, function () { $('#NewAnswer').fadeIn(500, null) });\n}", "title": "" }, { "docid": "cc71c4c6f7db9da8de8f5aa1ef31ac77", "score": "0.6734657", "text": "addQuestionFeedback(questionAnswer, userAnswer, data) {\n this.questions.push({\n questionAnswer,\n userAnswer,\n data\n });\n }", "title": "" }, { "docid": "497be37f76497ee3a37a1783c4d5af3c", "score": "0.6727882", "text": "function newSubQuestion() {\n\n \t$(this).removeClass('btn-warning');\n $(this).addClass('btn-success');\n\n\t$(\"#contest_details_form\").show('slow');\n\t$(\"#subjectiveForm\").show('slow');\n\t\t//Question_number++;\n\t\t$(\"#question_text\").val('');\n\t\t$(\"#question_id\").val(Question_number);\n\t\t$(\"#question_label\").text('Question No. #'+Question_number);\n\t\t$(\"#question_type\").val(1);\n\t\t$(\"#ObjectiveAnswer_options\").hide('slow');\n\t\t$(\"#answer_id_text\").show('slow'); \n\t\t$(\"#answer_scheme\").show('slow');\n}", "title": "" }, { "docid": "88def0c72792a5c48f561bcf9ad6a008", "score": "0.67274016", "text": "addQuestion(questionObject, questionType) {\n this.questions.push(new Question(questionObject, questionType));\n }", "title": "" }, { "docid": "a9d63fb3436eccf50305435d934fd20b", "score": "0.6715362", "text": "createQuestion() {\n\n this.choosenCategories(); // Check for checked categories\n\n let gameInput = document.querySelector(\"#whichGame\");\n let questionInput = document.querySelector(\"#newPreQuestion\");\n\n _questionInputService.newPredefinedQuestion = {\n categories: this.choosenCategoriesArr,\n game: gameInput.value,\n questionContent: questionInput.value\n }\n\n _questionInputService.whichParameters('PredefinedPage', 'whichGame'); // Add extra parameteres for special games\n console.log(_questionInputService.newPredefinedQuestion)\n this.questionRef.add(_questionInputService.newPredefinedQuestion);\n questionInput.value = \"\";\n _questionInputService.resetQuizInputfields('PredefinedPage');\n\n\n\n }", "title": "" }, { "docid": "86df3a835ff6e0064db76973736b6490", "score": "0.67050964", "text": "function setQuestion() {\n //shows new question\n displayQuestion()\n}", "title": "" }, { "docid": "d117cbc646e1cb35b19fc2ca4b1e6cc2", "score": "0.66530895", "text": "function addQuestion() {\n\n 'use strict';\n\n var refQuestion = db.ref('questions').push();\n\n console.log(\"Frage: \" + textareaQuestion.value);\n var question = textareaQuestion.value;\n\n var childrenAnswers = divAnchorAnswers.getElementsByTagName ('textarea');\n refQuestion.set ({ \"question\" : question, \"num-answers\" : childrenAnswers.length });\n\n var refAnswers = refQuestion.child('answers').push();\n for (var i = 0; i < childrenAnswers.length; i++) {\n refAnswers.child('answer' + (i+1)).set(childrenAnswers[i].value);\n }\n\n var childrenCorrectAnswers = divCorrectAnswers.getElementsByClassName ('mdl-checkbox');\n var refCorrectAnswers = refQuestion.child('correct-answers').push();\n\n var numCorrectAnswers = 0;\n for (var i = 0; i < childrenCorrectAnswers.length; i++) {\n\n var label = childrenCorrectAnswers[i];\n var classAttributes = label.getAttribute(\"class\");\n\n var result = classAttributes.includes('is-checked');\n if (result === true) {\n numCorrectAnswers ++;\n refCorrectAnswers.child('answer' + (i+1)).set(true);\n } else {\n refCorrectAnswers.child('answer' + (i+1)).set(false);\n }\n }\n\n refQuestion.child('num-correct-answers').set(numCorrectAnswers);\n}", "title": "" }, { "docid": "910667add4137a8e2da7275ff8e7cb3b", "score": "0.6651779", "text": "saveAnswer(){\n var params = {\n author: this.get('author'),\n reply: this.get('reply')\n };\n this.set('addNewAnswer', false);\n this.sendAction('saveAnswer', params);\n }", "title": "" }, { "docid": "33589a364ae54eed76ecbc4c2baf9015", "score": "0.66433316", "text": "function submitQuestion() {\n tempHideButtons();\n\n db.collection(\"questions\")\n .add(getQuestionFormData())\n .then(docRef => {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch(error => {\n console.error(\"Error adding document: \", error);\n });\n }", "title": "" }, { "docid": "63618ba07c8194c78affe5705dacd030", "score": "0.6642489", "text": "function addQns () {\r\n refresh()\r\n var qnPick = Math.floor(Math.random() * ourQn.length)\r\n ans = ourQn[qnPick].answ\r\n\r\n // checking if music genre or not\r\n if (!(id === 'musBtn')) {\r\n // displaying question of the chosen question\r\n $('.question').text('Question:' + ourQn[qnPick].question)\r\n\r\n // removing question from chosen genre\r\n var chosen = ourQn.splice(qnPick, 1)[0]\r\n\r\n // randomize the choices for each question\r\n choiceRandom(chosen)\r\n\r\n // getting player choices\r\n getKeys()\r\n } else {\r\n $('.question').text('Question: Guess the title of the song!')\r\n\r\n // randomizing the question to be chosen\r\n var qnPick = Math.floor(Math.random() * ourQn.length)\r\n ans = ourQn[qnPick].answ\r\n var picked = ourQn.slice(qnPick, qnPick + 1)[0]\r\n\r\n // removing question from chosen genre\r\n var chosen = ourQn.splice(qnPick, 1)[0]\r\n updateSrc(picked.song)\r\n\r\n // randomize the choices for each question\r\n choiceRandom(chosen)\r\n\r\n // getting player choices\r\n getKeys()\r\n }\r\n }", "title": "" }, { "docid": "a8143be259e65b1b5ffde244782aa5f0", "score": "0.66414446", "text": "function NextQuestion(){\n // this function will render the second question untill the quiz is complete\n // It will add 1 to questioNum and display the next question in the array\n\n $('.js-question').on('click','.js-next', function(){\n STATE.questionNum +=1;\n STATE.questionNumUI +=1;\n $('.js-quiz').remove();\n renderQuestion();\n }\n )}", "title": "" }, { "docid": "891bba7c68e32d4bc776b175e3825016", "score": "0.6615258", "text": "function addQuestion(question, code, options, correctAnswer) {\n\n questionNumber = questions.children.length + 1;\n newQuestion = questions.firstElementChild.cloneNode(true);\n\n // Question Text\n newQuestion.children[0].children[0].children[2].children[2].value = question;\n // Code Text\n newQuestion.children[0].children[0].children[3].children[2].value = code;\n\n while (newQuestion.children[0].children[0].children[4].children.length > 1) {\n newQuestion.children[0].children[0].children[4].firstElementChild.remove();\n newQuestion.children[0].children[0].children[5].children[2].lastElementChild.remove();\n }\n\n for (i = 0; i < options.length; i++) {\n addOption(newQuestion.children[0].children[0].children[4]);\n newQuestion.children[0].children[0].children[4].children[i].children[2].firstElementChild.value = options[i];\n }\n\n // Correct Answer\n newQuestion.children[0].children[0].children[5].children[2].value = correctAnswer;\n\n newQuestion = renumberQuestion(newQuestion, questionNumber);\n questions.append(newQuestion);\n}", "title": "" }, { "docid": "e528f545c51a3f2a2350f933d9d94647", "score": "0.65967584", "text": "function askQuestions() {\n $(\".questions-form\").empty();\n if (count < ryan.questions.length) {\n let displayQuestion = \"<label for='userpref'>\" + ryan.questions[count].question + \"</label>\";\n let answer = \"<br><select id='userpref'><option value='yes'>Aye! That sounds great.</option><option value='no'>Nay, none of that.</option></select>\";\n let nextQuestion = \"<br><button id='nextQuestion' type='button' class='btn btn-success'>Next</button>\";\n $(\".questions-form\").append(displayQuestion, answer, nextQuestion);\n } else {\n var submitOrder = \"<button type='submit' class='btn btn-order' id='submitOrder'>Make drink</button>\";\n $(\".questions-form\").append(submitOrder);\n };\n }", "title": "" }, { "docid": "ee8b71343d85d59293c5e328dc0eb548", "score": "0.6588926", "text": "function add() {\n\tlet question = [\n\t\t{\n\t\t\tname: \"selection\",\n\t\t\ttype: \"list\",\n\t\t\tmessage: \"What would you like to add?\",\n\t\t\tchoices: [\"New Employee\", \"New Role\", \"New Department\"],\n\t\t},\n\t];\n\n\tinquirer.prompt(question).then((ans) => {\n\t\tif (ans.selection === \"New Employee\") {\n\t\t\taddEmployee();\n\t\t} else if (ans.selection === \"New Role\") {\n\t\t\taddRole();\n\t\t} else {\n\t\t\taddDepartment();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "324969d4b0f3ebf1bb0007cb62c10177", "score": "0.6559182", "text": "function generateQuestion() {\n popped = listOfQuestions.pop();\n $questionDiv.text(popped.question);\n $answers.empty();\n popped.choices.forEach((choice) => {\n $answers.append(`<button>${choice}</button>`);\n });\n }", "title": "" }, { "docid": "f8f8da2fd25c77bb0b5a0e79b95bbf46", "score": "0.65588707", "text": "function add() {\n inquirer\n .prompt({\n name: \"actionAdd\",\n type: \"list\",\n message: \"Select what you would like to add?\",\n choices: [\n \"Add department\",\n \"Add role\",\n \"Add employee\",\n \"Back\"\n ]\n })\n .then(function(answer) {\n switch (answer.actionAdd) {\n case \"Add department\":\n addDepartment();\n break;\n \n case \"Add role\":\n addRole();\n break;\n \n case \"Add employee\":\n addEmployee();\n break;\n\n case \"Back\":\n init();\n break;\n }\n });\n}", "title": "" }, { "docid": "cf51f8f7003b7fb3f6f1d13cbe5e3d1c", "score": "0.65457624", "text": "function nextQuestion() {\n var currentQuest = questions[index];\n questionDisplayEl.textContent = \" \";\n mainDisplay.textContent = currentQuest.title;\n questionDisplayEl.append(mainDisplay);\n var choicesContainer = document.createElement(\"div\");\n for (let i = 0; i < currentQuest.choices.length; i++){\n var choiceBtn = document.createElement(\"button\");\n choiceBtn.textContent = currentQuest.choices[i];\n choiceBtn.addEventListener(\"click\", checkAnswer);\n choicesContainer.append(choiceBtn);\n\n }\n questionDisplayEl.append(choicesContainer);\n\n}", "title": "" }, { "docid": "98bdae0762bf9f2289213a8d69103d2c", "score": "0.6543887", "text": "function generateQuestion(question){\r\n $(\"main\").on(\"click\", \"#start-btn\", function(){\r\n store.quizStarted = true;\r\n store.questionNumber = 1;\r\n displayQuestion();\r\n });\r\n}", "title": "" }, { "docid": "ed569010f4060792b6690ca69a069dfe", "score": "0.65385276", "text": "function getQuestion(err, q) {\n var body = {\n id : q._id,\n question : 'Bar?',\n quest : q.quest,\n tags : ''\n };\n common.requestPost(app, '/api/wouso-quest/add', body, checkQuestQ);\n }", "title": "" }, { "docid": "de3bf69df8c47841c029a6616768ae7b", "score": "0.6528101", "text": "function addQuestion(event) {\n\tlet newItemArray = [];\n\n\tevent.preventDefault();\n\tsetInvisible();\n\n\tif(arrayContainer.length){\n\t\tcurrentQID = parseInt(arrayContainer[arrayContainer.length-1][0]) + 1;\n\t}else {\n\t\tcurrentQID = 1;\n\t}\n\tnewCreated = document.createElement(\"li\");\n\n\tcheckbox = document.createElement(\"input\");\n\tcheckbox.type = \"checkbox\";\n\tcheckbox.style.display = \"inline\";\n\tcheckbox.checked = false;\t\n\n\tnewCreated.className = \"addItem center\";\n\tnewCreated.style.top = \"\" + counter+\"rem\";\n\taddList.appendChild(newCreated);\n\ttable = document.createElement(\"table\");\n\tnewCreated.appendChild(checkbox);\n\tnewCreated.appendChild(table);\n\taddList.style.height = \"\" + height + \"vh\";\n\thalves.style.height = \"\" + container+ \"vh\";\n\theight += 50;\n\tcontainer += 60;\n\tcounter += 25;\n\t\n\t\t\n\trow = document.createElement(\"tr\");\n\t//questID = document.createElement(\"td\");\n\t//uid = document.createElement(\"td\");\n\tquestionData = document.createElement(\"td\");\n\tparaData = document.createElement(\"td\");\n\tretData = document.createElement(\"td\");\n\t//printData = document.createElement(\"td\");\n\tdiff = document.createElement(\"td\");\n\ttopicData = document.createElement(\"td\");\n\t//testCaseData = document.createElement(\"td\");\n\n\tnewItemArray.push(currentQID);\n\tnewItemArray.push(\"njo3\");\n\tnewItemArray.push(question.value);\n\tnewItemArray.push(parameter.value);\n\tnewItemArray.push(retVal.value);\n\t//newItemArray.push(printVal.value);\n\tnewItemArray.push(difficulty.value);\n\tnewItemArray.push(topic.value);\n\tnewItemArray.push(testCase.value);\n\n\t//questID.innerHTML = currentQID;\n\t//uid.innerHTML = \"njo3\"; //for now, replace with proper id later.\n\tquestion.innerHTML = question.value;\n\tparaData.innerHTML = parameter.value;\n\tretData.innerHTML = retVal.value;\n\t//printData.innerHTML = printVal.value;\n\tdiff.innerHTML = difficulty.value;\n\ttopicData.innerHTML = topic.value;\n\t//testCaseData.innerHTML = testCase.value;\n\n\t//row.appendChild(questID);\n\t//row.appendChild(uid);\n\trow.appendChild(questionData);\n\trow.appendChild(paraData);\n\trow.appendChild(retData);\n\t//row.appendChild(printData);\n\t//row.appendChild(testCaseData);\n\trow.appendChild(diff);\n\trow.appendChild(topicData);\n\n\ttable.appendChild(row);\n\n\tidContainer.push(qID);\n\t\n\tqID = qID+1;\n\n\t// Need post method to post data\n\n//console.log( question.value + \" \" +parameter.value + \" \" + testCase.value + \" \" + difficulty.value);\t\n\t\n\tconst xhr = new XMLHttpRequest();\n\tcontent = newItemArray;\n\tconsole.log(content);\n \txhr.onload = function() {\n \t\tconsole.log(this.responseText);\t\n \t\tconsole.log('DONE', xhr.status);\n\t\tconsole.log(content);\n\t};\n\t\n\txhr.open(\"POST\", \"addQuestion.php\");\n\txhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t\n\txhr.send(\"question=\"+content[2]+\"&parameter=\"+content[3]+\"&retVal=\"+content[4]+\"&difficulty=\"+content[5]+\"&topic=\"+content[6]+\"&testCase=\"+content[7]);\n\t\n\t//window.location.reload();\n}", "title": "" }, { "docid": "f271235cb76d828cc4a409b494b18d6f", "score": "0.6522172", "text": "function addQuiz(p) {\n\t\tvar questionPar = \"<div class ='row'>\" + addQuestion(p);\n\t\tvar questionCho = questionPar + addChoices(p) + \"</div>\";\n\t\t$(\".holdplace\").prepend(questionCho);\n\t}", "title": "" }, { "docid": "e4270c64d174a3b346aca8ca4f50dc01", "score": "0.65213513", "text": "function addAnswer ({authUser, qid, answer}){\n return {\n type: ADD_ANSWER,\n authUser,\n qid,\n answer\n }\n}", "title": "" }, { "docid": "0bc1e560e7069906874d236df3d8cae9", "score": "0.65088767", "text": "function addQuiz() {\n let input = $('.details-input').serializeArray(); //loads user input\n userQuiz.addQuiz(input); //run addQuiz\n\n //re-stylize the page so its the landing page again\n $(\"#quiz-creation\").remove();\n $(\".new-question\").remove();\n $(\"#title-header\").text(\"Your quiz was added! Go check it out!\");\n $(\"#sub-title\").removeClass('invisible');\n $(\"#sub-title\").text(\"If you want to save your new quiz for the future, copy and paste the code below to the quizlets.js file.\")\n $('#dob-selector').removeClass('invisible');\n $(\"#create-quiz\").removeClass('invisible');\n $(\"#code-snippet\").text(`${JSON.stringify(userQuiz, null, 4)}`); //display JSON like code to add to the seperate file for permanent storage\n\n}", "title": "" }, { "docid": "1516fdb1b1761997923a1fb2a2b90b0e", "score": "0.65021384", "text": "function displayQuestion(question) {\n titleItem.innerText = question.title\n question.choices.forEach(element => {\n const button = document.createElement(\"button\")\n button.className = \"btn-primary btn-block text-left\"\n button.innerText = element\n\n questionAnswers.appendChild(button)\n button.addEventListener(\"click\", displaynextQuestion)\n });\n}", "title": "" }, { "docid": "facffa974fe26163d8ffbf5e2e366b27", "score": "0.65016264", "text": "function pullQuestion(){\n $('.js-quiz-form').append(`\n <div class=\"battle\"> <img class=\"wandBattle\" src=\"images/choose_answer.gif\" alt=\"Choose Your Answer\"> </div>\n <label class=\"hp-question\">${STORE[currentQuestion].question}</label>\n <div class=\"hp-options\">\n </div>`);\n let questionNow = STORE[currentQuestion];\n for(let i=0; i<questionNow.options.length; i++){\n $('.hp-options').append(`\n <input type =\"radio\" name=\"options\" id=\"option${i+1}\" value= \"${questionNow.options[i]}\" required> \n <label for=\"option${i+1}\" class=\"opt\"> ${questionNow.options[i]}</label> <br/>\n `);};\n $('.js-quiz-form').append(`<button class=\"answerBut\" type=\"submit\">Submit</button>`);\n}", "title": "" }, { "docid": "69a601321f649c288acddda07ad891cb", "score": "0.6493727", "text": "async _addQuestion(question) {\n return new Promise(resolve => {\n this.inquirer.ui.process.subscribe(\n ({ name, answer }) => {\n if (name === question.name) {\n resolve(answer)\n }\n }\n )\n this.prompts.next(question)\n })\n }", "title": "" }, { "docid": "a23fc116f12681591d6b1af8d2dc3041", "score": "0.646526", "text": "function newQuestion() {\n // clear result text\n answerResult.setAttribute(\"style\", \"opacity: 0\");\n correctAnswer.setAttribute(\"style\", \"display: none\");\n // clear inputted answer\n answerInput.value = \"\";\n //clear saved current user answer\n currentAnswer = \"\";\n //reset submit and next buttons\n submitButton.disabled = false;\n nextButton.disabled = true;\n // increment progress\n progress++;\n progressCount.textContent = Math.ceil(progress / 3).toString();\n}", "title": "" }, { "docid": "dbd42b33af03dc3c846fe99ec6f28d79", "score": "0.64636695", "text": "function generateNextQuestion(){\n \n \n \n var currentQuestion = questionsList[questionIndex];\n //After the last question if statement remove the question section\n //Make the End window score section appear\n if (!currentQuestion || timer <= 0) {\n timer = 0;\n // Makes question disappear\n questionsSection.style.display = \"none\";\n // Makes score section appear\n scoreSectionEl.style.display = \"block\";\n\n scoreEl.style.display = \"none\";\n\n finalScoreEl.textContent= \"Your Final Score is: \" + score;\n\n }\n \n \n titleEl.textContent = currentQuestion.question;\n \n document.getElementById('choices').innerHTML = '';\n\n currentQuestion.choices.forEach(function(options) {\n console.log(options);\n var node = document.createElement('button');\n var textnode = document.createTextNode(options);\n node.appendChild(textnode);\n var answerButton = document.getElementById('choices').appendChild(node);\n answerButton.setAttribute('value', options);\n \n \n node.addEventListener('click', function(event) {\n validateAnswer(event);\n \n });\n });\n\n \n}", "title": "" }, { "docid": "f717f4de51a60ac4b599cceeedc2398a", "score": "0.6459509", "text": "function createNewQuestion(questionText) {\n let $newListItem = $('<li>').addClass('form-group padout');\n let $newQuestion = $('<label>').text(questionText);\n let $newAnswerField = $('<input>').attr('type', 'text').addClass('form-control');\n let $newButton = $('<button>').text('Remove Question');\n $newListItem.slideUp(function(){\n $newListItem.append($newQuestion).append($newAnswerField).append($newButton);\n $('#surveyList').append($newListItem);\n $newListItem.slideDown(); \n });\n}", "title": "" }, { "docid": "af48de6a26943242c2cf7b6431ad1363", "score": "0.6459299", "text": "function addQuestion(questionName, questionIsRequired) {\n $log.info('[Assessment::addQuestion] name, required?', questionName, questionIsRequired);\n // look in the inventory to see if this property already exists\n if (questions.inventory.hasOwnProperty(questionName)) {\n $log.warn('[Assessment::addQuestion] ignoring duplicate page ' + questionName);\n } else {\n questions.total++;\n questions.inventory[questionName] = questionIsRequired;\n questions.answered.inventory[questionName] = {\n isCorrect: null,\n isRequired: questionIsRequired,\n answered: false\n };\n //NOTE: We are setting question required count through setRequiredQuestions()\n //if (questionIsRequired) {\n // questions.required++;\n //}\n }\n }", "title": "" }, { "docid": "620764a8e108f19101cb1cd27925840c", "score": "0.6456526", "text": "handleAddQuestion(event) {\n let quest = this.state.quiz\n quest.push({\n question: this.state.question,\n answer: this.state.answer,\n options: {\n 0: this.state.wrong1,\n 1: this.state.wrong2,\n 2: this.state.wrong3\n },\n wrong1: this.state.wrong1,\n wrong2: this.state.wrong2,\n wrong3: this.state.wrong3\n })\n\n // save quiz to state and reset form\n this.setState({\n quiz: quest,\n question: '',\n answer: '',\n wrong1: '',\n wrong2: '',\n wrong3: ''\n\n })\n\n document.getElementById(\"quiz-form\").reset();\n\n }", "title": "" }, { "docid": "d45f3a5e563176807d7f490f35743d3d", "score": "0.64545286", "text": "function createQuiz(){\n startQuiz();\n //renderQuestion();\n //submitAnswer();\n //renderNextQuestion();\n}", "title": "" }, { "docid": "247b3faad3abaac5e1ffd335d14f77b7", "score": "0.6445846", "text": "function displayQuestion(question) {\n qTitle.innerText = question.title;\n question.choices.forEach(element => {\n var button = document.createElement(\"button\")\n button.className = \"btn answer-btn\"\n button.innerText = element\n qAnswers.appendChild(button)\n button.addEventListener(\"click\", displayNextQuestion)\n });\n}", "title": "" }, { "docid": "b1acf279bbb2b81db311c5570311ee19", "score": "0.64398205", "text": "function tryButton() {\r\n\t$(\"#addQuestion\").click(spawn).hide(); \r\n \t}", "title": "" }, { "docid": "aab8d2985cecad0d442c489412e9b5c8", "score": "0.6438922", "text": "function QuestionForm() { }", "title": "" }, { "docid": "2a284f37521e5be85e294aa80235ead0", "score": "0.6434298", "text": "function addItem(title, completed=false) {\n _questions.push({title, completed});\n}", "title": "" }, { "docid": "3c89dd7750387ce5396adcd579822163", "score": "0.6429415", "text": "function nextQuestion() {\n $('body').on('click', '#nextQuestion', (event) => {\n let question = STORE[currentQuestionNumber];\n if (question){\n showQuestion(question);\n $('.response').html('');\n }\n else {\n finalBox();\n }\n });\n}", "title": "" }, { "docid": "04a45817f7f78fb2fbdd8faa4ef6a53d", "score": "0.64222515", "text": "function askQuestion(){\n inquirer.prompt([\n \n {\n type: \"list\",\n message: \"Who would you like to add next?\",\n choices: [\"Engineer\", \"Intern\",\"Manager\", \"Finish now\"],\n name: \"question\"\n }\n ]).then(answers =>{\n switch (answers.question) {\n case \"Engineer\":\n console.log(\"added Engineer\")\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break\n case \"Manager\":\n addManager();\n break\n case \"Finish now\":\n printWorkGroup();\n default:\n console.log(\"thanks for using:)\")\n break;\n }\n\n })\n}", "title": "" }, { "docid": "453846b874f2bdb0ff8175369a9cec95", "score": "0.6419224", "text": "function nextQuestion(){\r\n if(currentIndex < questions.length - 1){//you can't infinitely click \"next\"\r\n resetCounter();\r\n clearField();\r\n currentIndex++;\r\n answerIndex += 4;\r\n currentCorrectAns = correctAnswers[currentIndex];\r\n // removeAnswers()\r\n display();//add the new ones\r\n }else{\r\n displayEndingScreen();\r\n }\r\n}", "title": "" }, { "docid": "4a825a0d8ffbfe0f3b39257d7f8175ea", "score": "0.64054656", "text": "function create_question() {\n run_validations_question();\n var annotation = {\n question: $(\"#input-question\").val(),\n passageID: passage_ids[currentPassageIndex]\n };\n\n // create the text for the bottom rectangle container containing questions\n var qaText = \"Q: \" +\n annotation.question;\n\n // If the new_tab_id already exists in annotations, question is being edited,\n // so we have to change the text of the card and increment the associated counters.\n // If the new_tab_id doesn't already exist in annotations, the question is new,\n // so we have to create the card before we modify its text.\n if (editing_question == null) {\n // Initialize counter of number of passages for the question if it\n // hasn't been used yet.\n if (!question_num.hasOwnProperty(currentPassageIndex)) {\n question_num[currentPassageIndex] = 0;\n }\n var new_tab_id = currentPassageIndex + '-question-' + question_num[currentPassageIndex];\n create_question_card(new_tab_id);\n\n total_question_cnt += 1;\n question_num[currentPassageIndex] += 1;\n $(\"#numQuestionsWritten\").text(total_question_cnt);\n }\n else {\n var new_tab_id = editing_question;\n }\n\n // Modify the text of the question card\n $('#' + new_tab_id + '-text').text(qaText);\n\n // Store the annotation, regardless if editing or not.\n annotations[new_tab_id] = annotation;\n\n resetQuestionEntry();\n check_question_count();\n}", "title": "" }, { "docid": "7042fec494989a8cd520d2f54b3b072a", "score": "0.63931435", "text": "function requestNewQuestion() {\n $('.questionBody').load('/next', () => {\n $('#answer_submit_button').prop('disabled', true);\n $('#next_question_button').prop('disabled', true);\n registerSelectAnswer();\n });\n}", "title": "" }, { "docid": "192d0bf450160ce38301f2c3531764c9", "score": "0.6377253", "text": "function renderNextQuestion(){\n $('.feedback').on('click', '.nextQuestion', function(event){\n event.preventDefault();\n $('.feedback').remove();\n if(questionNum < STORE.length-1){\n questionNum++;\n renderQuestion();\n }\n else {\n finalFeedback();\n } \n });\n}", "title": "" }, { "docid": "8323f6d5392c7c33321776dd7037cf71", "score": "0.63594544", "text": "function createQuiz() {\n startQuiz();\n domRenderedQuestion();\n userSelectAnswer();\n showNextQuestion();\n}", "title": "" }, { "docid": "0ed4a48ca15e5ea906e643b199369f11", "score": "0.63568914", "text": "function displayQ() {\n clearQ();\n resetTimer();\n $(\".questionX\").html(questions[questionCounter].question);\n //Calling the function to display the response options\n createRadios();\n //Creating submit button\n $(\"#submit-div\").append('<button type=\"submit\" id=\"submit\">' + \"Next Question\" + '</button>');\n runTimer()\n submitAns();\n }", "title": "" }, { "docid": "a4a45116b0fe4450e50f73d16810bd70", "score": "0.6355287", "text": "function exercisePaperAdd() {\n\tvar title='信息反馈';\n\tvar form=$('#form1');\n\tvar checkedItems=addedExercise;\n\tif(addedExercise.length==0) {\n\t\t$.messager.alert(title,\"至少选择一个习题\",'warning');\n return ;\n\t}\n\n\tvar exerciseidset='';\n\tfor(var i=0;i<checkedItems.length;i++) {\n\t\texerciseidset += checkedItems[i].pk+','\n\t}\n\t$('#addedExerciseIdSet').val(exerciseidset);\n\n\tvar urls='';\n\t\n\tif(exercisepaper_id)\n\t\turls=urlprefix+'update/'+exercisepaper_id+'/';\n\telse\n\t\turls=urlprefix+'add/';\n\n\tform.form('submit',{ \n\t\turl:urls,\n onSubmit:function(){ \n \treturn $(this).form('validate'); \n }, \n success:function(data){ \n var data = eval('(' + data + ')');\n $.messager.alert('信息反馈',data.tip,'info',function(){\n \twindow.location.href=urlprefix;\n \t});\n } \n }); \n}", "title": "" }, { "docid": "c871cf711875ad6bca1154c1773206b4", "score": "0.6349083", "text": "function buttonClick () {\n\t$(\"button.answerBtn\").on(\"click\",nextQuestion);\n}", "title": "" }, { "docid": "0ace3ac67fe26154476ed251107274d8", "score": "0.6346183", "text": "createQuestion(){\n //creating div\n outerDiv = document.createElement(\"DIV\");\n outerDiv.classList.add(\"outer\");\n var div = document.createElement(\"DIV\");\n div.classList.add(\"input-group\");\n outerDiv.appendChild(div);\n //create question input\n var question = document.createElement(\"INPUT\");\n //asssign input name of the pattern answer(ans type)(question num) \n var inputName = \"answer\"+ this.ansType;\n inputName += addInput.questionNum.toString();\n //assign type to input field\n question.type = this.type;\n //push name into array\n nameArray.push(inputName);\n question.setAttribute(\"id\",inputName);\n question.setAttribute(\"name\",inputName);\n question.setAttribute(\"required\",\"true\");\n question.setAttribute(\"value\",\"Question\")\n question.classList.add(\"form-control\");\n question.classList.add(\"input\");\n //append question input to inner div\n div.appendChild(question);\n\n}", "title": "" }, { "docid": "77954bb1df871038a1d408d00030a623", "score": "0.63458574", "text": "function nextQuestion(){\n // Get Current Question information.\n var next_question_index = parseInt($(\".question_answers .question_counter\").data(\"start\"));\n next_question_index++;\n \n var question_number = (next_question_index + 1);\n var q = createQuestion(QUESTIONS[next_question_index], ANSWERS, question_number);\n $(\".question_answers\").empty();\n $(\".question_answers\").append(q);\n}", "title": "" }, { "docid": "c61c9db2ecf40b43ad8a611215ee7e5b", "score": "0.63416094", "text": "function addQuestion(whichQuestions) {\n if (whichQuestions === \"survey-question\") {\n addQuestion_impl(whichQuestions, QuizRollover);\n } else if (whichQuestions === \"course-question\") {\n addQuestion_impl(whichQuestions, SurveyRollover);\n }\n}", "title": "" }, { "docid": "28761ae43dc4fb5f88712756c6538039", "score": "0.633571", "text": "function nextQuestion() {\n resetQuestions()\n showQuestion(listQuestions[currentQuestionIndex])\n}", "title": "" }, { "docid": "67852ef046ec7e57859666e1eec33d45", "score": "0.63226986", "text": "addQ(question) {\n let tempQ = {}; //create temp question obj\n let tempOpt = [];//create temp options variable\n\n for (let i = 0; i < question.length; i++) {\n if (question[i].name === \"age\") { //if the input is age, then assign the correct value depending on input\n switch (question[i].value) {\n case '1-16':\n question[i].value = 1;\n break;\n case '17-40':\n question[i].value = 2;\n break;\n case '40+':\n question[i].value = 3;\n break;\n }\n } else if (question[i].name === 'options') { //if the input is options, then add them in the tempOpt array\n tempOpt.push(question[i].value);\n }\n let name = question[i].name;\n let value = question[i].value;\n tempQ[name] = value; //add the different input properties to the temp obj\n }\n tempQ['options'] = tempOpt; //add the options to the temp obj\n this.questions.push(tempQ); //add the temp obj (the question that the user added) to the main DB of new questions\n }", "title": "" }, { "docid": "165984469a0620ff587d65b9fc5e2f6e", "score": "0.63221306", "text": "function showMeQuestion() {\n if (index === questions.length) { \n gameOverResults(); \n } else {\n var html = '';\n html = html + '<h3>' + questions[index].question + '</h3>'\n for (var i = 0; i < questions[index].options.length; i++) {\n html = html + '<input type=\"radio\" name=\"radioName\" value=' + i + '>' + questions[index].options[i] + '<br>';\n }\n html = html + '<button onclick=checkAnswer()>Submit</button>';\n console.log(questions[index]);\n $('.questions').empty();\n $('.questions').append(html);\n \n }\n }", "title": "" }, { "docid": "1d96a7bfe0b5f2a1e9f5ed2b65c01d8e", "score": "0.6318801", "text": "function answerQuest(err, quest) {\n var body = {\n question : 'Foo?',\n quest : quest._id,\n tags : ''\n };\n common.requestPost(app, '/api/wouso-quest/add', body, checkQuest);\n }", "title": "" }, { "docid": "0aab5f4493837043bbe7a4bca8631498", "score": "0.63154006", "text": "function nextQuestion() {\n increaseQuestionTracker();\n increaseQuestionNumber();\n renderQuizAppQuestion();\n renderPossibleAnswers();\n renderTracker();\n}", "title": "" }, { "docid": "3876fd306724be5961410e67f32e7ebf", "score": "0.631531", "text": "function nextQuestion(){\n finalQuestionCheck();\n $('.next-question').on('click', function(event){\n event.preventDefault();\n renderQuestionPage();\n });\n}", "title": "" }, { "docid": "b57c4b892e11e34a3bf02253a1b2ad8b", "score": "0.6309422", "text": "addQuiz(details) {\n this.title = details[0].value; //when creating the quiz, set title and desc properties to that users input\n this.desc = details[1].value;\n\n quizes.push(this); //adds the newly created quiz to the main quizes object\n }", "title": "" }, { "docid": "38ad978e7f87fa9dd259f1bf8dc30d6b", "score": "0.62921005", "text": "function generateQuestion() {\n var questionNumber = document.querySelector(\".question-number\");\n var quizQuestion = document.querySelector(\".question\");\n var quizOptions = document.querySelector(\".options\");\n var btnAnswer = document.querySelector(\"#submit-answer\");\n\n quizQuestion.innerHTML = questionArray[questionTracker].question;\n questionNumber.innerHTML = \"Question \" + (questionTracker + 1);\n quizOptions.innerHTML = \"\";\n\n //add radio buttons to choose from options\n var opts = questionArray[questionTracker].options;\n for (var i = 0; i < opts.length; i++) {\n var opt = opts[i];\n var input = document.createElement(\"input\");\n input.type = \"radio\";\n input.id = \"rdo_\" + i;\n input.name = \"answers\";\n input.className = \"form-check-input\";\n input.setAttribute(\"onclick\", \"registerAnswer('\" + opt + \"')\");\n\n var label = document.createElement(\"label\");\n label.setAttribute(\"for\", \"rdo_\" + i);\n label.className = \"form-check-label\";\n label.innerHTML = opt;\n\n var rdoGroup = document.createElement(\"div\");\n rdoGroup.className = \"form-check\";\n rdoGroup.appendChild(input);\n rdoGroup.appendChild(label);\n\n quizOptions.appendChild(rdoGroup);\n }\n\n btnAnswer.style.visibility = \"visible\";\n btnAnswer.setAttribute(\"disabled\", \"disabled\");\n}", "title": "" }, { "docid": "43e590c70358638ab54ef2afc56b9ca1", "score": "0.6282474", "text": "function appendQuest(index)\r\n {\r\n questNumHead.innerText = \"Question No.\" + (index + 1);\r\n mainDiv.appendChild(questNumHead);\r\n var currentQues = IQexamObj.Quests[index];\r\n\r\n questHead.innerText = currentQues.head;\r\n mainDiv.appendChild(questHead);\r\n\r\n for (var x = 0; x < currentQues.answers.length; x++)\r\n {\r\n // var rad = document.createElement(\"input\");\r\n AnsRadArr[x].setAttribute(\"type\", \"radio\");\r\n AnsRadArr[x].setAttribute(\"value\", x);\r\n AnsRadArr[x].setAttribute(\"name\", \"q\" + index);\r\n AnsRadArr[x].checked=false;\r\n AnsRadArr[x].addEventListener(\"click\", function () {\r\n qIndex = Number(this.name.substring(1));\r\n IQexamObj.Quests[qIndex].userAnswer = this.value;\r\n });\r\n if (currentQues.userAnswer != undefined)\r\n AnsRadArr[currentQues.userAnswer].checked=true;\r\n\r\n mainDiv.appendChild(AnsRadArr[x]);\r\n\r\n //var lable = document.createElement(\"lable\");\r\n AnsLabelArr[x].innerText = currentQues.answers[x];\r\n mainDiv.appendChild(AnsLabelArr[x]);\r\n };\r\n }", "title": "" }, { "docid": "078c16d6f95f1e0e79512e06ee7086ed", "score": "0.62820804", "text": "function addQuestion(p) {\n\t\tvar s1 = \"<h2 class='col-xs-12 text-left'>\" + p.questionnum + \" . \" + p.question + \"</h2>\";\n\t\treturn s1;\n\t}", "title": "" }, { "docid": "b0ce1269c7505e1f581cffc7c5599414", "score": "0.6278871", "text": "addAnswers(answer) {\n this.answers.push(answer);\n }", "title": "" }, { "docid": "fc2597f477079f76c4f394ce4f9634c6", "score": "0.6276849", "text": "function handleQuestion()\n{\n // Internal question number is zero-based,\n // so add one for the displayed number\n // and update it (if the quiz isn't yet complete)\n if (questionNumber < STORE.length)\n {\n let displayQuestionNumber = questionNumber + 1;\n $('.questionNumber').text(displayQuestionNumber);\n }\n \n // Render the current question\n renderQuestion();\n \n // Wait for the user to submit their answer, then\n // give feedback on whether it's correct or wrong\n listenForSubmitClickAndHandle();\n}", "title": "" }, { "docid": "5934d19400fe890e0ed06d0bb888ea1f", "score": "0.6273075", "text": "function Question(question_counter){\n this.question_options = [];\n this.question_options_counter = 1;\n this.question_html = \"<div class='question_content'>Question \" + question_counter +\": <input name='survey_question_\"+question_counter+\"' type='text'><br>Option \"+ this.question_options_counter+\" <input name='survey_quest_\"+question_counter+\"_resp\"+question_counter+\"' type='text'><br><br><button id='option_add_\"+this.question_options_counter+\"'>Add an option</button><button id='option_remove_\"+this.question_options_counter+\"'>Remove an option</button><br><br></div>\";\n }", "title": "" }, { "docid": "43421e3179e3b8dbfafecd00298db9d3", "score": "0.62710476", "text": "function addTopicButton(evt) {\n evt.preventDefault();\n let addInput = document.querySelector(\"#add-input\");\n let newTopic = addInput.value.trim();\n gifTasticApp.addNewTopic(newTopic);\n addInput.value = \"\";\n }", "title": "" }, { "docid": "acaf762fb7f6aedf1f1a62c8591e0d86", "score": "0.62668526", "text": "function displayQuestion() {\n questionAnswered= false;\n questionsPane.empty();\n answersPane.empty();\n\n questionsPane.append(\"<p>\" + questions[currentQuestion].prompt + \"</p>\")\n console.log(answers);\n for(let i = 0; i < questions[currentQuestion].answers.length; i++) {\n answersPane.append(`<input type=\"radio\" name=\"questions\" value=\"` + i + `\">` + questions[currentQuestion].answers[i]);\n }\n\n answersPane.click(function() {\n questions[currentQuestion].userAnswer = event.target.value;\n questionAnswered = true;\n console.log(\"use answer;\", questions[currentQuestion].userAnswer);\n })\n\n \n}", "title": "" }, { "docid": "9167595104eac33264785b05b8485550", "score": "0.62667185", "text": "function clickAdd() {\n const newItem = {\n item: $(\".js-new-item\").val(),\n complete: \"N\",\n };\n saveItem(newItem);\n $(\".js-new-item\").val(\"\");\n}", "title": "" }, { "docid": "24cb2248109698dde9f9f00ff6e4ef4b", "score": "0.62629884", "text": "function add() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"addAction\",\n message: \"What would you like to add?\",\n choices: [\"Employee\", \"Department\", \"Role\"]\n }\n ])\n .then(answers => {\n switch (answers.addAction) {\n case \"Employee\":\n addEmployee()\n break;\n case \"Department\":\n addDepartment()\n break;\n case \"Role\":\n addRole()\n break;\n default: exit();\n\n }\n })\n\n}", "title": "" }, { "docid": "03801b18ed5252913931912cb288ffae", "score": "0.62624186", "text": "function addSurvey() {\n axios({\n method: 'POST',\n url: '/survey',\n data: survey\n })\n .then(response => {\n console.log('added a survey', response);\n })\n .catch(error => {\n console.log('Unable to add survey', error);\n alert('Unable to add survey');\n })\n }", "title": "" }, { "docid": "e968dee2ede3b7489d3c1af23d771d90", "score": "0.6260036", "text": "function createQuestion(questions) {\n for (var i = 0; i < questions.length; i++) {\n $(\".start\").hide();\n $(\"#questions\").append('<form id=\"' + i + '\" class=\"center-text\"><p>Question ' + (i + 1) + ' of ' + questions.length + '</p><h3 class=\"question\">' + questions[i].q + '</h3>' + radioButtons(questions[i].s, i) + '<button type=\"submit\" class=\"next\">SUBMIT &#8594;</button></p></form>');\n }\n //This hides all except the first question:\n for (var k = questions.length - 1; k > 0; k--) {\n $('#' + k).hide();\n }\n }", "title": "" }, { "docid": "0d32619c338925e8f2f71b6eecfa2612", "score": "0.62588966", "text": "function handleAddCards() {\n navigation.push(\"New Question\", { id: deckID });\n }", "title": "" }, { "docid": "091088526a9a03ec23c87b9d0b50afec", "score": "0.6256969", "text": "function generateNextQuestion() {\n $('main').on('click', '.nextButton', function (event) {\n renderQuestion();\n userSelectAnswer();\n });\n}", "title": "" }, { "docid": "d869cf8d791261315bbf989157adc541", "score": "0.6255876", "text": "function addQuestion(data, removable) {\n var parent = $('#qlist');\n var li = $('<li></li>');\n var a = $('<a></a>');\n var item = a.clone()\n .append($('<h3></h3>').text(data.title))\n .append($('<span></span>').attr('class', 'ui-li-count').text('0'));\n var splitbutton = a.clone();\n if (removable) {\n splitbutton.attr('data-icon', 'delete');\n } else {\n splitbutton.attr('data-icon', 'star');\n }\n\n item.on(\"click\", function() {\n $.ajax({\n url: getUrl('/readQuestion'),\n dataType: 'json',\n data: {\n id: data._id\n },\n type: 'GET',\n success: function(data) {\n pageInfo.setChangeData(data);\n $(\":mobile-pagecontainer\")\n .pagecontainer('change', getUrl('/question.html'), {\n role: 'page'\n });\n }\n });\n });\n\n li.append(item);\n li.append(splitbutton);\n parent.prepend(li);\n parent.listview('refresh');\n}", "title": "" } ]
23781d78473de38f3d0160f8f08c409c
Allow some things to happen. Use sparingly; this is a hack and using it masks some bugs.
[ { "docid": "9ab41515d50529d5a9417b1f63aa7c9c", "score": "0.0", "text": "function surrender_timeslice()\n{\n document.write( '<span> </span>' );\n}", "title": "" } ]
[ { "docid": "240644cc0b3bb87bf74241a66c29e74d", "score": "0.6535121", "text": "function StupidBug() {}", "title": "" }, { "docid": "6d7d07bcd00f20375880e1eedf614970", "score": "0.63845575", "text": "function useless() {\n console.log('Error in fake:true');\n }", "title": "" }, { "docid": "ea0e14d98e056010b109607e87b47f88", "score": "0.6250598", "text": "function fake() {\n\treturn false;\n}", "title": "" }, { "docid": "8be262385f2883ea2e0e5a32691fa3ae", "score": "0.62208486", "text": "function useless() {\n console.error('Error in fake:true');\n }", "title": "" }, { "docid": "64a0cc22f37d91d6e3d8f80a7aebce6f", "score": "0.61725473", "text": "function ignore() {\n return false;\n}", "title": "" }, { "docid": "2b09c3eba2fa94a0d8537ced9852e27f", "score": "0.6107672", "text": "function something_that_might_fail() {\n}", "title": "" }, { "docid": "2b09c3eba2fa94a0d8537ced9852e27f", "score": "0.6107672", "text": "function something_that_might_fail() {\n}", "title": "" }, { "docid": "538017052275471cdcc1d079fd0d173c", "score": "0.6084781", "text": "runSafetyCheck() {}", "title": "" }, { "docid": "664d0c6eca91e7f6dc3228348dde467d", "score": "0.6051807", "text": "no_op() {}", "title": "" }, { "docid": "13326ba6bb04214cfb0a669327150589", "score": "0.6049235", "text": "function ignore() {}", "title": "" }, { "docid": "8b71e29f13b51bdf56fb882193e8deb4", "score": "0.60300475", "text": "solved () {\n\n\t}", "title": "" }, { "docid": "d62e7dd31b63cc417ef5963169c865ca", "score": "0.6016594", "text": "_callerHungup() {\n assert(false, 'subclass responsibility to override this method');\n }", "title": "" }, { "docid": "6d2d3da9e2c87299774a7b751898b802", "score": "0.5951202", "text": "approve() {\n throw \"unimplemented\";\n }", "title": "" }, { "docid": "98082c8a532a1b3649f9433d22f87271", "score": "0.5919375", "text": "function SafeStyle() { }", "title": "" }, { "docid": "98082c8a532a1b3649f9433d22f87271", "score": "0.5919375", "text": "function SafeStyle() { }", "title": "" }, { "docid": "98082c8a532a1b3649f9433d22f87271", "score": "0.5919375", "text": "function SafeStyle() { }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "6c815de40d231761a6ebb53adae07218", "score": "0.5899733", "text": "function noop() { /* you waste your time by reading this, see, I told you.. */ }", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5892837", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5892837", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5892837", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5892837", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5892837", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5892837", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5892837", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5892837", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "e932fb0f64bf30e754889026baa9361c", "score": "0.5845275", "text": "function doNothing() {return true;}", "title": "" }, { "docid": "39108c9285f0c51065387194dae76942", "score": "0.58396894", "text": "function always () { return true }", "title": "" }, { "docid": "39108c9285f0c51065387194dae76942", "score": "0.58396894", "text": "function always () { return true }", "title": "" }, { "docid": "39108c9285f0c51065387194dae76942", "score": "0.58396894", "text": "function always () { return true }", "title": "" }, { "docid": "39108c9285f0c51065387194dae76942", "score": "0.58396894", "text": "function always () { return true }", "title": "" }, { "docid": "39108c9285f0c51065387194dae76942", "score": "0.58396894", "text": "function always () { return true }", "title": "" }, { "docid": "39108c9285f0c51065387194dae76942", "score": "0.58396894", "text": "function always () { return true }", "title": "" }, { "docid": "e302536814339b7329814eba545422f9", "score": "0.5821483", "text": "function trustNone() {\r\n return false;\r\n}", "title": "" }, { "docid": "b2add579a117707e3903a457ba97f493", "score": "0.58028746", "text": "function noop() { } // 1853", "title": "" }, { "docid": "5d13ffd1ba906e8f9361e90a165925eb", "score": "0.57973164", "text": "function SafeStyle() {}", "title": "" }, { "docid": "5d13ffd1ba906e8f9361e90a165925eb", "score": "0.57973164", "text": "function SafeStyle() {}", "title": "" }, { "docid": "4462a14c3384e87eaf11d8a91367a9d8", "score": "0.5757097", "text": "function asYetUnnamed () {\n \n }", "title": "" }, { "docid": "8af033e9a01f6309c6210eee0e32884e", "score": "0.5750859", "text": "IMP() {\r\n //do nothing\r\n }", "title": "" }, { "docid": "bb43cb7dffaa2b45b06554baa3dae30b", "score": "0.5748341", "text": "function doSomethingSecret() {}", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.57457185", "text": "enable() { }", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.57457185", "text": "enable() { }", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.57457185", "text": "enable() { }", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.57457185", "text": "enable() { }", "title": "" }, { "docid": "ca578167980e070f2cabf1644ed1d282", "score": "0.5741048", "text": "set BakedEmissive(value) {}", "title": "" }, { "docid": "9ae5c340df7ca953dc27d346b8ac40e6", "score": "0.5740944", "text": "function trustNone() {\n return false;\n}", "title": "" }, { "docid": "9ae5c340df7ca953dc27d346b8ac40e6", "score": "0.5740944", "text": "function trustNone() {\n return false;\n}", "title": "" }, { "docid": "9ae5c340df7ca953dc27d346b8ac40e6", "score": "0.5740944", "text": "function trustNone() {\n return false;\n}", "title": "" }, { "docid": "9ae5c340df7ca953dc27d346b8ac40e6", "score": "0.5740944", "text": "function trustNone() {\n return false;\n}", "title": "" }, { "docid": "9ae5c340df7ca953dc27d346b8ac40e6", "score": "0.5740944", "text": "function trustNone() {\n return false;\n}", "title": "" }, { "docid": "9ae5c340df7ca953dc27d346b8ac40e6", "score": "0.5740944", "text": "function trustNone() {\n return false;\n}", "title": "" }, { "docid": "9ae5c340df7ca953dc27d346b8ac40e6", "score": "0.5740944", "text": "function trustNone() {\n return false;\n}", "title": "" }, { "docid": "0ba5877ba505397e6a9659729973fb07", "score": "0.5734111", "text": "function dummy() {\n return false;\n}", "title": "" }, { "docid": "89b19d79e259d4aad941495dcb01ba56", "score": "0.57305413", "text": "function preventChanges(obj) {\n // write your code here\n // don't use a return statement\n\n Object.freeze(obj);\n // DON'T CHANGE OR REMOVE THE LINES BELOW\n obj.noChanges = false;\n obj.signature = \"whatever\";\n return obj;\n}", "title": "" }, { "docid": "5f37bbddaa11d90642208a970658c8f5", "score": "0.5729812", "text": "function doNothing(){}", "title": "" }, { "docid": "ede6fe89e43704304911e9c2bac64b03", "score": "0.5725918", "text": "function security_violation() {\n throw new Error(`\n Be super careful about HTML manipulation.\n\n Make sure your test objects set up their own\n functions to validate that calls to html/prepend/append\n use trusted values.\n `);\n }", "title": "" }, { "docid": "ce31c87d4797db56bb3a600ad7ae4b65", "score": "0.5716569", "text": "function NO_OP() {}", "title": "" }, { "docid": "ce31c87d4797db56bb3a600ad7ae4b65", "score": "0.5716569", "text": "function NO_OP() {}", "title": "" }, { "docid": "49fffe50b6a31f7d8dd8bcc92a00041f", "score": "0.57125366", "text": "function preventContext(e) {\r\n\t\t\treturn false;\r\n\t\t}", "title": "" }, { "docid": "23f0dc080fc5280988aecc50f5a09406", "score": "0.5712333", "text": "function noOP() {\n }", "title": "" }, { "docid": "23f0dc080fc5280988aecc50f5a09406", "score": "0.5712333", "text": "function noOP() {\n }", "title": "" }, { "docid": "9c7a318538c988cc3c996e65f460e432", "score": "0.57068396", "text": "function Noop() {}", "title": "" }, { "docid": "59a61df24d3a26ccd3d5ac0b8b73e73f", "score": "0.5690273", "text": "function doCheck() { return false; }", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.56893694", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.56893694", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.56893694", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.56893694", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.56893694", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.56893694", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.56893694", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.56893694", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.56893694", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.56893694", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.568833", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.568833", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.568833", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.568833", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.568833", "text": "function _noop() {}", "title": "" }, { "docid": "f2a42debc63a951e5dffe871e62b3d18", "score": "0.5666446", "text": "_ignoreChangeRejections () {\n return {};\n }", "title": "" }, { "docid": "e64019ab4146af40272917ebf46e2aa1", "score": "0.56597745", "text": "assertNotApplied() {}", "title": "" }, { "docid": "d6e1b5750763cc269e3921334ed66762", "score": "0.56366074", "text": "function doNothing() { /* empty */ }", "title": "" }, { "docid": "d6e1b5750763cc269e3921334ed66762", "score": "0.56366074", "text": "function doNothing() { /* empty */ }", "title": "" }, { "docid": "d6e1b5750763cc269e3921334ed66762", "score": "0.56366074", "text": "function doNothing() { /* empty */ }", "title": "" }, { "docid": "29f4bea26b0e139c5d5262c88f97962a", "score": "0.5632997", "text": "function SafeStyle(){}", "title": "" }, { "docid": "ebbf3b9db01ad0a5b9eb039a2c6e3c59", "score": "0.5626213", "text": "function checkistyping() {\n empty_istyping();\n flag_istyping = [];\n }", "title": "" } ]
85d4fc19f0f12ec8d2ccf55901225dd3
Finds the date inside a bigger string. Used when building an entry from text.
[ { "docid": "5dfeccb5dc5e106f9cdcc5a5d387b3a1", "score": "0.65524733", "text": "function _findDate (line) {\n const pattern = /\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:?\\d{0,2}/\n return line.match(pattern)[0]\n}", "title": "" } ]
[ { "docid": "18e48bbf6a33e1606c25b1dad12c00e2", "score": "0.6919854", "text": "function findDate(string) {\n var dateTime = /(\\d{1,2})-(\\d{1,2})-(\\d{4})/;\n var match = dateTime.exec(string);\n return new Date(match[3], match[2] - 1, match[1]);\n}", "title": "" }, { "docid": "4b1ed127c04168edac1831d3728ea579", "score": "0.6094416", "text": "function matchingDate(date) {\n const day = date.toString().slice(0, 3)\n const month = date.toString().slice(4, 7)\n const dd = date.toString().slice(8, 10)\n const yyyy = date.toString().slice(11, 15)\n return `${day}, ${dd} ${month} ${yyyy} 00:00:00 GMT`\n }", "title": "" }, { "docid": "266ae5bcd47a3be48f9f0d3b62f25cd3", "score": "0.6091877", "text": "function parseDate(entry) {\n const dateStrI = entry.search(/^\\d{2}\\/\\d{2}\\/\\d{4}/);\n if (dateStrI === -1) {\n return null;\n }\n\n const dateStr = entry.slice(dateStrI, dateStrI + 10);\n const year = parseInt(dateStr.slice(6, 10), 10);\n const month = parseInt(dateStr.slice(0, 2), 10);\n const day = parseInt(dateStr.slice(3, 5));\n\n return `${year}-${month}-${day}`; \n}", "title": "" }, { "docid": "c90110942cb30c7931f3312aa97dce04", "score": "0.6069584", "text": "function isolateDate2(textInput) {\r\n var arrayInput = textInput.split(' ');\r\n var temp, createdDate, potentialDate, validDate = '';\r\n var potentialDates = [];\r\n\r\n // Loop through words with head pointer\r\n for (var i = 0, len_i = arrayInput.length; i < len_i; i++) {\r\n // Reset temp\r\n temp = '';\r\n // Sub-loop that loops as trailing pointer. These two loops effectively\r\n // scan combinations of words from left to right to check whether they\r\n // are possible dates\r\n for (var j = i, len_j = arrayInput.length; j < len_j; j++) {\r\n\r\n if (temp) temp += ' ';\r\n temp += arrayInput[j];\r\n\r\n //console.log('Temp is now: ' + \"'\" + temp + \"'\");\r\n\r\n // Sugarjs magic\r\n createdDate = Sugar.Date.create(temp);\r\n // Is it potentially a date? We exclude dates of format 12.26\r\n if (createdDate != \"Invalid Date\" && !isolateCurrency(temp)) {\r\n //console.log('Temp before: ' + temp);\r\n\r\n // Need this because sugar accepts '- dec 16'\r\n //temp = temp.replace(/^[^a-zA-Z0-9]*|[^a-zA-Z0-9]*$/g, '');\r\n\r\n // Had to split this way because it's incorrectly removing the comma from 'december 16,'\r\n // This makes the plucked word not match up with any remainWords\r\n temp = temp.replace(/^[^a-zA-Z0-9]*/g, '').replace(/[^a-zA-Z0-9,]*$/g, '');\r\n potentialDate = temp;\r\n potentialDates.push(potentialDate);\r\n //console.log('------------ Potential date: [' + potentialDate + '] (' + temp + ')');\r\n\r\n } else if (potentialDate && createdDate == \"Invalid Date\") {\r\n // I'm not really sure why we still have this other than showing\r\n // strings invalidated by sugarjs\r\n //console.log(\"*** Invalid: '\" + temp + \"'\");\r\n }\r\n }\r\n\r\n // j was not maxed out, we found a valid date then, and break out of i loop\r\n if (j < len_j.length - 1) break;\r\n }\r\n\r\n // Need to do this in case last word ended as a valid date (TODO: Not sure if we will still need this)\r\n //if(potentialDate) validDate = potentialDate;\r\n\r\n var tempDate;\r\n\r\n // Loop through array of potential dates to pick the best possible date\r\n for (var k = 0, len_k = potentialDates.length; k < len_k; k++) {\r\n tempDate = potentialDates[k];\r\n //console.log(\"Tag test----> [\" + tempDate + \"]\");\r\n var pos_hash = posTagHash(tempDate.replace(',','')); // Remove comma just for pos count\r\n var pos_tag_count = Object.keys(pos_hash).length;\r\n if (\r\n // Preliminary tests show a valid date will not exceed 2 types of pos in a single text\r\n // A number is of type 'CD' (cardinal) and one other. This may change based on future\r\n // tests. We're also blindly picking out the longest of these potential valid dates.\r\n ((pos_tag_count <= 2) && (tempDate.length > validDate.length)) ||\r\n //((pos_tag_count <= 3) && (tempDate.length > validDate.length) && (pos_hash[\"CD\"] != undefined)) || // 16th December\r\n (false)\r\n ) {\r\n validDate = tempDate;\r\n //console.log('-------------VALID');\r\n }\r\n }\r\n\r\n //console.log('Valid date: ' + validDate);\r\n return validDate;\r\n}", "title": "" }, { "docid": "1030d3921d1399332aa4e2dda20fdda9", "score": "0.59759754", "text": "function getDayDate (dateString) {\n\tvar dateIndex = parseInt(dateString.indexOf(\"T\"));\n\treturn parseInt(dateString.substring(dateIndex - 2, dateIndex));\n}", "title": "" }, { "docid": "b0f687da3251d520b2b63a42a04a1b15", "score": "0.597496", "text": "function extractDate_(data){\r\n //Raccourcissement de la longueur de \"data\" pour faciliter l'extraction de la date\r\n data = data.substring(data.indexOf(\"item_absolute\\\">\") + 15 , data.indexOf(\"</aside>\", data.indexOf(\"item_absolute\\\">\") + 15));\r\n var extractAdsDate = data.substring(data.indexOf(\"item_supp\\\">\") + 12 , data.indexOf(\"</p>\", data.indexOf(\"item_supp\\\">\") + 12));\r\n extractAdsDate = extractAdsDate.replace(\",\" , \" / \");\r\n debug_(\"extractAdsDate : \" + extractAdsDate);\r\n return extractAdsDate;\r\n}", "title": "" }, { "docid": "2ae7c53641dbaac5f6e3d8307896f5b6", "score": "0.5949282", "text": "date(value) {\n return methods.regexMatch(value, keys.DATE);\n }", "title": "" }, { "docid": "55e00b05b81a1b4f70a9e577ee2a4d8a", "score": "0.5889226", "text": "function getEntryDate(entry) {\n var date = jQuery(entry).find('content tr.date td').text();\n var splittedDate = date.split('T');\n\n return splittedDate[0];\n}", "title": "" }, { "docid": "4ca39b9ebed4f278bc1052ed2969e50e", "score": "0.5879067", "text": "function get_date(dateORtime) {\r\n var current_timestamp = dateORtime.match(/\\b[0-3][0-9]\\s\\w{3}\\s\\d{4}\\b\\b/g);\r\n var current_date = current_timestamp[0].substring(0, 2);\r\n\r\n return current_date;\r\n}", "title": "" }, { "docid": "b356529dbae9270a9fb040151df7d0a0", "score": "0.5841656", "text": "function isDateStr(theStr) {\n\tvar the1st = theStr.indexOf('-');\n\tvar the2nd = theStr.lastIndexOf('-');\n\tif (the1st == the2nd) {\n\t\treturn (false);\n\t} else {\n\t\tvar y = theStr.substring(0, the1st);\n\t\tvar m = theStr.substring(the1st + 1, the2nd);\n\t\tvar d = theStr.substring(the2nd + 1, theStr.length);\n\t\tvar maxDays = 31;\n\t\tif (isInt(m) == false || isInt(d) == false || isInt(y) == false) {\n\t\t\treturn (false);\n\t\t} else if (y.length < 4) {\n\t\t\treturn (false);\n\t\t} else if (!isBetween(m, 1, 12)) {\n\t\t\treturn (false);\n\t\t} else if (m == 4 || m == 6 || m == 9 || m == 11)\n\t\t\tmaxDays = 30;\n\t\telse if (m == 2) {\n\t\t\tif (y % 4 > 0)\n\t\t\t\tmaxDays = 28;\n\t\t\telse if (y % 100 == 0 && y % 400 > 0)\n\t\t\t\tmaxDays = 28;\n\t\t\telse\n\t\t\t\tmaxDays = 29;\n\t\t}\n\t\tif (isBetween(d, 1, maxDays) == false) {\n\t\t\treturn (false);\n\t\t} else {\n\t\t\treturn (true);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e5e1000b6f56f5907ee0ce01d9ed83cc", "score": "0.566957", "text": "function validateDate(str) {\n\tvar seperators = ['-', ' ', '/'], strArr;\n\tvar i;\n\tfor (i = 0; i < str.length; i++) {\n\t\tvar j;\n\t\tfor (var j = 0; j < seperators.length; j++) {\n\t\t\tif (str.indexOf(seperators[j]) !== -1) {\n\t\t\t\tstrArr = str.split(seperators[j]);\n\t\t\t}\n\t\t\tif (strArr) break;\n\t\t}\n\t}\n\tif (strArr[0].length !== 4) {\n\t\tstrArr.push(strArr.shift());\n\t\tstrArr.push(strArr.shift());\n\t}\n\tif (strArr[0].length !== 4) {\n\t\tstrArr[0] = '20' + strArr[0];\n\t}\n\treturn strArr.join('-');\n}", "title": "" }, { "docid": "c106db47920c9a257f948c4b4f73fe70", "score": "0.56668615", "text": "function getDate4Holidaystring( holidaystring ){\n // convert d to a string, which compares to the date in the json-array\n let returnDay = 0\n \n // check only the current year\n for (feiertagsname in ft1) {\n if (feiertagsname.toString() == holidaystring ) {\n // datum has format \"yyyy-MM-dd\"\n let datum = ft1[feiertagsname].datum \n returnDay = new Date (parseInt( datum.substring(0,4) ), parseInt( datum.substring(5,7) ) - 1, parseInt( datum.substring(8,10) ))\n }\n } \n return returnDay\n}", "title": "" }, { "docid": "808ddfc94748ecc1c0b2ffe317b1364c", "score": "0.56632197", "text": "static textToDate(text){\n\n // lets add a fail fast using RegExp, this will prevent the user to enter the\n // data with the wrong format\n if (!/\\d{4}-\\d{2}-\\d{2}/.test(text)) \n throw new Error(\"the text to be converted to Date need to be pass in the following format 'YYYY-MM-DD'.\")\n return new Date(text.split('-'))\n }", "title": "" }, { "docid": "e6378bc40af8fffba3ac4414278fc0aa", "score": "0.56331664", "text": "function refractDate(a) {\r\n return a.replaceAll(\"-\", \"\").substr(2);\r\n }", "title": "" }, { "docid": "300ecd9450bd188d63eff1e0357b4f96", "score": "0.5627738", "text": "function parse_date(in_utc, s){\n for(var pkey in DATE_PATTERNS){\n var m = DATE_PATTERNS[pkey].regexp.exec(s);\n if(m){\n var args = [];\n for(var i = 1 ; i < m.length ;i++){\n args[i-1] = +m[i] ;\n }\n args[1]--;\n return new_date(in_utc, args);\n }\n }\n return undefined;\n }", "title": "" }, { "docid": "e7df2a3835c899ea43259b1a7754058d", "score": "0.55957454", "text": "function getDate(s) {\n var a = s.split(/[^0-9]/);\n var d = new Date(a[0], a[1] - 1, a[2], a[3], a[4], a[5]);\n return d;\n }", "title": "" }, { "docid": "78c9be07becf9e20729ee20efae02f72", "score": "0.5589566", "text": "function getdate(str) {\n\t\t\t// inner util function to convert 2-digit years to 4\n\t\t\tfunction fixYear(yr) {\n\t\t\t\tyr = +yr;\n\t\t\t\tif (yr<50) { yr += 2000; }\n\t\t\t\telse if (yr<100) { yr += 1900; }\n\t\t\t\treturn yr;\n\t\t\t};\n\t\t\tvar ret;\n\t\t\t// YYYY-MM-DD\n\t\t\tif (ret=str.match(/(\\d{2,4})-(\\d{1,2})-(\\d{1,2})/)) {\n\t\t\t\treturn (fixYear(ret[1])*10000) + (ret[2]*100) + (+ret[3]);\n\t\t\t}\n\t\t\t// MM/DD/YY[YY] or MM-DD-YY[YY]\n\t\t\tif (ret=str.match(/(\\d{1,2})[\\/-](\\d{1,2})[\\/-](\\d{2,4})/)) {\n\t\t\t\treturn (fixYear(ret[3])*10000) + (ret[1]*100) + (+ret[2]);\n\t\t\t}\n\t\t\treturn 99999999; // So non-parsed dates will be last, not first\n\t\t}", "title": "" }, { "docid": "1ffb5021c456848486d082c8522f0e4e", "score": "0.5574495", "text": "function matchDates(arr) {\r\n let pattern =\r\n /\\b([0-9]{1,2})-([A-Z][a-z]{2})-([0-9]{4})\\b/g;\r\n let dates = [], match;\r\n for (let sentence of arr)\r\n while (match = pattern.exec(sentence))\r\n dates.push(`${match[0]} (Day: ${match[1]}, Month: ${match[2]}, Year: ${match[3]})`);\r\n console.log(dates.join(\"\\n\"));\r\n}", "title": "" }, { "docid": "b358e9f3cd6a30210d1ac94797ecf403", "score": "0.55739856", "text": "function parseDate(title) {\n var m = dateRegex1.exec(title);\n\n if (m != null) {\n\n if (m[2].length == 1) { m[2] = '0' + m[2] };\n if (m[3].length == 1) { m[3] = '0' + m[3] };\n\n return m[1] + '-' + m[2] + '-' + m[3]; \n }\n\n m = dateRegex2.exec(title);\n \n if (m != null) {\n\n if (m[1].length == 1) { m[1] = '0' + m[1] };\n \n for (var k = 0; k < 12; k++) {\n \n if (monthRegexes[k].exec(m[2]) != null) {\n\n return m[3] + '-' + monthStrings[k] + '-' + m[1]; \n }\n }\n\n return m[3] + '-' + m[2] + '-' + m[1]; \n }\n \n m = dateRegex3.exec(title);\n\n if (m != null) {\n\n if (m[1].length == 1) { m[1] = '0' + m[1] };\n if (m[2].length == 1) { m[2] = '0' + m[2] };\n\n return m[3] + '-' + m[2] + '-' + m[1]; \n }\n\n return 'No Match';\n}", "title": "" }, { "docid": "e9f26cc678c21eb2582a9d50676bb10c", "score": "0.55691916", "text": "function get_date(string) {\n let [none, day, month, year] = /(\\d{1,2})\\.(\\d{1,2})\\.(\\d{4})/.exec(string);\n return new Date(year, month - 1, day);\n}", "title": "" }, { "docid": "35c7f291ec2a97834d7cb091b7c99951", "score": "0.55684435", "text": "function dateParser(dateObj){\n var date = dateObj[0];\n //Ex:--2017_01_01 -> 20170101 (YYYYMMDD)\n return date.charAt(2)+date.charAt(3)+date.charAt(4)+date.charAt(5)+date.charAt(7)+date.charAt(8)+date.charAt(10)+date.charAt(11);\n}", "title": "" }, { "docid": "1700101cbd3ca22531e4fc0300371427", "score": "0.55582225", "text": "function d4_time_parseWeekday(date, string, i) {\n d4_time_dayRe.lastIndex = 0;\n var n = d4_time_dayRe.exec(string.substring(i));\n return n ? i += n[0].length : -1;\n}", "title": "" }, { "docid": "217628b73e321ce512eee3131899fb7a", "score": "0.55573", "text": "function validatData(s) {\n var bits = s.split('/');\n var d = new Date(bits[2], bits[1] - 1, bits[0]);\n return d && (d.getMonth() + 1) == bits[1];\n}", "title": "" }, { "docid": "076441dba8d5563b56ac376ec76f66fa", "score": "0.55510813", "text": "function parseSnowflakeDate(dateStr) {\n const tokens = dateStr.split('-')\n const yyyy = +tokens[0];\n const mm = +tokens[1];\n const dd = +tokens[2];\n return new Date(yyyy,mm-1,dd);\n}", "title": "" }, { "docid": "bb1f14e6b9938124be8dda55ad22fe40", "score": "0.55502176", "text": "function isDateString(value) {\n var result = value.match(/^[\\d]{4}-[\\d]{2}-[\\d]{2}$/);\n if (result == null) {\n return false;\n }\n return result;\n}", "title": "" }, { "docid": "be86bb62cb69d624ee6cf166909aca30", "score": "0.5529712", "text": "function parseWaybackDateTime (htmlString) {\n const $ = cheerio.load(htmlString);\n const $displayYearEl = $('#displayYearEl');\n const displayYearElTitle = $displayYearEl.attr('title');\n\n return displayYearElTitle ? displayYearElTitle.split(': ')[1] : '';\n}", "title": "" }, { "docid": "05d96f869a1b0f20d5237c8b62b4c46a", "score": "0.55243695", "text": "function fixDate(data, i){\n let info = data.results[i];\n let date = (info.dob.date);\n day = date.split('-')[1];\n month = date.split('-')[2];\n month = month.substring(0,2);\n year = date.split('-')[0];\n}", "title": "" }, { "docid": "6de8c33b9332665d45fb257663a7bb70", "score": "0.55217326", "text": "function comparedate(S,E){\r\n\tS = S.replace(/(\\d+).(\\d+).(\\d+)/, '$3/$2/$1');\r\n\tS = S.replace(/^(\\d\\d\\/)/, '20$1');\r\n\tSD = new Date(S);\r\n\tE = E.replace(/(\\d+).(\\d+).(\\d+)/, '$3/$2/$1')\r\n\tE = E.replace(/^(\\d\\d\\/)/, '20$1')\r\n\tED = new Date(E);\r\n\tif(SD>ED)\r\n\t\treturn false;\r\n\telse\r\n\t\treturn true;\t\t\r\n}", "title": "" }, { "docid": "4ee21185ee9333f8eecd727850068329", "score": "0.55091196", "text": "function getDate(string) {\n // destructoring the return value of the exec method.\n // The _(underscore) binding is ignored and used only \n // to skip the full match element in the array returned by exec.\n\n let [_, month, day, year] =\n /(\\d{1,2})-(\\d{1,2})-(\\d{4})/.exec(string);\n // creates a new dat Object.\n return new Date(year, month - 1, day);\n}", "title": "" }, { "docid": "4295b63de701d66935c3b5c18fa919b5", "score": "0.5508317", "text": "function getDateStrFormat(s){\n\tif(s!==undefined && s.length>19){\n\t\treturn s.substring(0,19);\n\t}\n\treturn s\n}", "title": "" }, { "docid": "4295b63de701d66935c3b5c18fa919b5", "score": "0.5508317", "text": "function getDateStrFormat(s){\n\tif(s!==undefined && s.length>19){\n\t\treturn s.substring(0,19);\n\t}\n\treturn s\n}", "title": "" }, { "docid": "4295b63de701d66935c3b5c18fa919b5", "score": "0.5508317", "text": "function getDateStrFormat(s){\n\tif(s!==undefined && s.length>19){\n\t\treturn s.substring(0,19);\n\t}\n\treturn s\n}", "title": "" }, { "docid": "c26cea19cba6fddfe6a68d0248f92d3e", "score": "0.5501601", "text": "function d3_time_parseWeekday(date, string, i) {\r\n d3_time_weekdayRe.lastIndex = 0;\r\n var n = d3_time_weekdayRe.exec(string.substring(i, i + 10));\r\n return n ? i += n[0].length : -1;\r\n}", "title": "" }, { "docid": "0e09877c85299c55ac60866ad3d8bead", "score": "0.54977804", "text": "function parseDate(str){\n if(typeof str == 'string'){ \n var results = str.match(/^ *(\\d{4})-(\\d{1,2})-(\\d{1,2}) *$/); \n if(results && results.length>3){ \n \treturn new Date(parseInt(results[1],10),(parseInt(results[2],10) -1),parseInt(results[3],10)); \n } \n results = str.match(/^ *(\\d{4})-(\\d{1,2})-(\\d{1,2}) +(\\d{1,2}):(\\d{1,2}):(\\d{1,2}) *$/); \n if(results && results.length>6){\n \treturn new Date(parseInt(results[1],10),parseInt(results[2],10) -1,parseInt(results[3],10),parseInt(results[4],10),parseInt(results[5],10),parseInt(results[6],10));\n }\n results = str.match(/^ *(\\d{4})-(\\d{1,2})-(\\d{1,2}) +(\\d{1,2}):(\\d{1,2}):(\\d{1,2})\\.(\\d{1,9}) *$/); \n if(results && results.length>7){ \n \treturn new Date(parseInt(results[1],10),parseInt(results[2],10) -1,parseInt(results[3],10),parseInt(results[4],10),parseInt(results[5],10),parseInt(results[6],10),parseInt(results[7],10));\n }\n } \n return null; \n}", "title": "" }, { "docid": "afc0d12a7021e9ec0c77703ce0a68b4d", "score": "0.5481132", "text": "function get_date () {\r\n\t//var header = document.getElementsByTagName('td')[0].firstChild.nodeValue;\r\n\tvar dateArr = new Array();\r\n\tdateArr = document.body.innerHTML.match(/(\\d\\d)-(\\d\\d) (\\d\\d:\\d\\d:\\d\\d)/);\r\n\tdate = parseInt(dateArr[2], 10) + ' ' + c_of + ' ' + months[parseInt(dateArr[1],10)-1] + c_at + dateArr[3];\r\n\treturn date;\r\n}", "title": "" }, { "docid": "09afe798147af311874c83a941b6a6b6", "score": "0.5468018", "text": "function estDate(ch) {\n if (ch.length != 10) {\n return false;\n }\n var p1 = ch.indexOf('/');\n var p2 = ch.lastIndexOf('/');\n if (p1 != 2 || p2 != 5) {\n return false;\n }\n\n var jj = parseInt(ch.substring(0, 2));\n var mm = parseInt(ch.substring(3, 5));\n var aaaa = parseInt(ch.substring(6));\n if (isNaN(jj) || isNaN(mm) || isNaN(aaaa) || mm < 1 || mm > 12 || jj < 1 || jj > 31) {\n return false;\n }\n\n var nbj = nbreJours(mm, aaaa);\n if (jj > nbj) {\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "d19732dd5e261a87144f106c01a96913", "score": "0.5465909", "text": "function getDay(data) {\n let ret = /\\d+-\\d+-\\d+/.exec(data);\n return ret[0];\n}", "title": "" }, { "docid": "082e6d5a1521bc345b4ae0d54cf3a4a0", "score": "0.5455399", "text": "function convertStringToDate(text) {\n return new Date(text.replace(/(\\d{2})-(\\d{2})-(\\d{4})/, \"$2/$1/$3\"));\n}", "title": "" }, { "docid": "abd0a576cd6051ef7fed5cf5a29c1454", "score": "0.54551715", "text": "function parseDate(date_text) {\n var res = date_regex.exec(date_text);\n\n // Return null if the date string did not match the regex\n if (!res) {\n return null;\n }\n\n var day = parseInt(res[1]);\n var month = parseInt(res[2]);\n var year = parseInt(res[3]);\n\n // Return null is any of day, month or year are out of range\n if (day <= 0 || day > 31 || month <= 0 || month > 12 || year <= 0) {\n return null;\n }\n\n var d = new Date(year, month - 1, day); // -1 since Jan is 0, Feb 1 etc...\n return d;\n}", "title": "" }, { "docid": "141042a36accf99cb286d6d9f5bcb97a", "score": "0.5449196", "text": "function getDate(string) {\n let [_, month, day, year] = /(\\d{1,2})-(\\d{1,2})-(\\d{4})/.exec(string)\n return new Date(year, month - 1, day)\n}", "title": "" }, { "docid": "57d1f25f2af5526df2f4b71ddf54cee1", "score": "0.54438025", "text": "function filterDate(dateInput) {\r\n var filteredDate = dateInput.split(\"T\");\r\n var res = filteredDate[0]\r\n return res;\r\n}", "title": "" }, { "docid": "9c98d70a30a705e70feb71644f897096", "score": "0.54433846", "text": "function parseBirthday(dateString) {\n return dateString\n .substring(0, 10)\n .replace(/(\\d{4})-(\\d{2})-(\\d{2})/, \"$2 / $3 / $1\");\n }", "title": "" }, { "docid": "064bcd4ffa684f687be22ec758127e19", "score": "0.5439358", "text": "function dynamicDate_depricated( str ) {\n\tvar re = new RegExp(\"%\\\\$d.*\", \"i\")\n\tif (re.test(str)) {\n\t\tvar date = str.split(\"%$d\")[0]\n\t\tvar modif = str.split(\"%$d\")[1]\n\t\tif (modif.search(\"%now\") >= 0) {\n\t\t\tdate = new Date()\n\t\t} else { \n\t\t\tdate = new Date(date)\n\t\t}\n\t\tvar reBase = \"([+-]\\\\d+)\"\n\t\tvar dayRE = new RegExp(reBase + \"d\")\n\t\tvar monthRE = new RegExp(reBase+\"m\")\n\t\tvar yearRE = new RegExp(reBase+\"y\")\n\t\t\n\t\tvar dayModif = 0\n\t\tvar monthModif = 0\n\t\tvar yearModif = 0\n\t\t\n\t\tif (dayRE.test(modif)) {\n\t\t\tdayModif = parseInt(dayRE.exec(modif)[1])\n\t\t}\n\t\tif (monthRE.test(modif)) {\n\t\t\tmonthModif = parseInt(monthRE.exec(modif)[1])\n\t\t}\n\t\t\n\t\tif (yearRE.test(modif)) {\n\t\t\tyearModif = parseInt(yearRE.exec(modif)[1])\n\t\t}\n\t\t\n\t\tdate.setDate(date.getDate() + dayModif)\n\t\tdate.setMonth(date.getMonth() + monthModif)\n\t\tdate.setFullYear(date.getFullYear() + yearModif, date.getMonth(), date.getDate())\n\t\t\n\t\tvar formatRE = new RegExp(\"%f(.+)f%\")\n\t\tvar formatStr = \"\"\n\t\t\n\t\tif (formatRE.test(modif)) {\n\t\t\tformatStr = formatRE.exec(modif)[1]\n\t\t\treturn date.f(formatStr.trim())\n\t\t} else {\n\t\t\treturn date.getTime()\n\t\t}\n\t\t\n\t} else {\n\t\treturn str\n\t}\n}", "title": "" }, { "docid": "c8566dbe7746786a8d076a3c9831c98f", "score": "0.5413674", "text": "function getDate(date)\n{\n\tvar parse = date.split(\" \", 4);\n\tvar fixedDate = parse[0] + parse[2] + \" \" + parse[1] + \" \" + parse[3] + \" \";\n\treturn fixedDate;\n}", "title": "" }, { "docid": "0d5d7b7645eb8e7c926765ad483b1e49", "score": "0.53909373", "text": "function is_date(str) {\n return (str.length === \"2021-03-10T05:00:00.000Z\".length);\n}", "title": "" }, { "docid": "044aff779130cd4f146f1de8eb621758", "score": "0.5374679", "text": "function datetry(date) {\n var parts = date.split('-');\n var mydate = new Date(parts[0], parts[1] - 1, parts[2]);\n return mydate;\n }", "title": "" }, { "docid": "223ae58e0ff4e3d9bd37b3f934685235", "score": "0.5361124", "text": "function getRegExpWithDate(day, month, year) {\n return new RegExp(\"begin\\\\.date\\\\.day=\"+trim0(day)+\".*begin\\\\.date\\\\.month=\"+trim0(month)+\".*begin\\\\.date\\\\.year=\"+trim0(year));\n }", "title": "" }, { "docid": "c50eafa1b9cc90dd2d2b117607ac9221", "score": "0.5335963", "text": "function looksLikeMSDate(s) {\n return /^\\/Date\\(/.test(s);\n}", "title": "" }, { "docid": "45df2fe8c4591ed7eac465c64af015e1", "score": "0.53351986", "text": "function getNumber(match) {\n \t\tvar isDoubled = lookAhead(match);\n \t\tvar size = (match == '@' ? 14 : (match == '!' ? 20 : (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2))));\n \t\tvar digits = new RegExp('^\\\\d{1,' + size + '}');\n \t\tvar num = value.substring(iValue).match(digits);\n \t\tif (!num) {\n \t\t\tthrow 'Date.parseDate: Missing number at position ' + iValue;\n \t\t}\n \t\tiValue += num[0].length;\n \t\treturn parseInt(num[0], 10);\n \t}", "title": "" }, { "docid": "45df2fe8c4591ed7eac465c64af015e1", "score": "0.53351986", "text": "function getNumber(match) {\n \t\tvar isDoubled = lookAhead(match);\n \t\tvar size = (match == '@' ? 14 : (match == '!' ? 20 : (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2))));\n \t\tvar digits = new RegExp('^\\\\d{1,' + size + '}');\n \t\tvar num = value.substring(iValue).match(digits);\n \t\tif (!num) {\n \t\t\tthrow 'Date.parseDate: Missing number at position ' + iValue;\n \t\t}\n \t\tiValue += num[0].length;\n \t\treturn parseInt(num[0], 10);\n \t}", "title": "" }, { "docid": "fdfed4b552ede6481a93f1efcdd14607", "score": "0.5334747", "text": "function getCompleteDate(date){\n if(date==null){\n return null;\n }\n \tvar anio=date.substring(0, 4);\n \tvar mes=getCompleteMonth(date.substring(5, 7));\n \tvar dia=date.substring(8, 10);\n \treturn dia+' de '+mes+' del '+anio;\n }", "title": "" }, { "docid": "6ef96235cceb20953e2d65dd210ff207", "score": "0.5332205", "text": "function datesearch(data) {\n return data.datetime == listItemText;}", "title": "" }, { "docid": "6ada89bbcaa20c5cfd83935ad1ed0c7a", "score": "0.532508", "text": "static parseFormattedString(string) {\n const regexp = \"([0-9]{4})(-([0-9]{2})(-([0-9]{2})\" +\n \"([T| ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\\.([0-9]+))?)?\" +\n \"(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?\";\n const d = string.match(new RegExp(regexp));\n\n const date = new ISODate(d[1], 0, 1);\n\n if (d[3]) {\n date.setMonth(d[3] - 1);\n }\n if (d[5]) {\n date.setDate(d[5]);\n }\n if (d[7]) {\n date.setHours(d[7]);\n }\n if (d[8]) {\n date.setMinutes(d[8]);\n }\n return date;\n }", "title": "" }, { "docid": "2d712d2d1040a2eccb4744b8cb3ae3eb", "score": "0.53248775", "text": "function convertDate(str)\n{\n\tvar re = /[0-9]+/g;\n\tvar result = re[Symbol.match](str);\n\tvar dateLoc = new Date(result[0],result[1],result[2]);\n\n\treturn dateLoc;\n}", "title": "" }, { "docid": "876c2a30241b9c3e8aabab1b9df66ef6", "score": "0.5306437", "text": "function formated_date (date_str) {\n var date_arr = date_str.split(/[^\\d]+/)\n return date_arr[0] + \"-\" + date_arr[1] + \"-\" + date_arr[2]\n}", "title": "" }, { "docid": "ba50282d1efaa87fa07c1cdd7a21892c", "score": "0.529663", "text": "function dtlGetDate(dts) {\n // * given a DateStr or DateTimeStr, returns the date part\n // * date not checked for validity\n // * returns false for invalid input\n if (dtlIsDateStr(dts)) {\n return dts;\n } else if (dtlIsDateTimeStr(dts)) {\n return dts.substr(0, 10);\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "bf4d002303cf4c9627fc17d382391fcd", "score": "0.5286137", "text": "function extractHtmlDate_(data)\r\n{\r\n var idx1 = indexOfAfter(data, '<p class=\"item_supp\">');\r\n var idx2 = indexOfAfter(data, '<p class=\"item_supp\">', idx1);\r\n var idxStart = indexOfAfter(data, '<p class=\"item_supp\">', idx2);\r\n var idxUrgent = indexOfAfter(data, '<span class=\"item_supp emergency\"><i class=\"icon-star\"></i>Urgent</span>', idxStart);\r\n if ( idxUrgent > 0 ) {\r\n idxStart = idxUrgent;\r\n }\r\n var idxEnd = data.indexOf('</p>', idxStart);\r\n var returnValue = data.substring(idxStart , idxEnd).trim();\r\n return returnValue;\r\n}", "title": "" }, { "docid": "34cdc1c0816b41cead20d75ba8878eba", "score": "0.5283652", "text": "validateDate(birthday){\n\t\t//regex string taken from stackoverflow\n\t\tvar re = birthday.match(/^(0[1-9]|1[0-2])\\/(0[1-9]|1\\d|2\\d|3[01])\\/(19|20)\\d{2}$/)\n\t\treturn re;\n\t}", "title": "" }, { "docid": "48637e17c7c6bbcf37cbd6a68c44b4e6", "score": "0.52678007", "text": "getFormattedDate(s) {\n const components = s.split('-')\n const month = months[parseInt(components[1], 10)]\n const day = parseInt(components[2], 10) // This'll strip the zeroes\n\n return `${month} ${day}, ${components[0]}`\n }", "title": "" }, { "docid": "4e0a8890dbdbae2492f78debf1e2c2af", "score": "0.526723", "text": "function date_get_cell(dd)\r\n{\r\n\tfor (var el of document.getElementById('cal-frame').querySelectorAll(\"td\"))\r\n\t{\r\n\t\tif (el.className != \"nil\")\r\n\t\t{\r\n\t\t\tvar date = el.innerHTML.split(\">\")[1].split(\"<\")[0];\r\n\t\t\tif (date == dd)\r\n\t\t\t{\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "50d2a979c0be6c8664c2123c38d1e14a", "score": "0.5265117", "text": "function parseDate(str, fixdate) {\n\t\t\tvar d = new Date(str);\n\t\t\tif (good_pd) {\n\t\t\t\tif (fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);else if (fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n\t\t\t\treturn d;\n\t\t\t}\n\t\t\tif (str instanceof Date) return str;\n\t\t\tif (good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {\n\t\t\t\tvar s = d.getFullYear();\n\t\t\t\tif (str.indexOf(\"\" + s) > -1) return d;\n\t\t\t\td.setFullYear(d.getFullYear() + 100);return d;\n\t\t\t}\n\t\t\tvar n = str.match(/\\d+/g) || [\"2017\", \"2\", \"19\", \"0\", \"0\", \"0\"];\n\t\t\tvar out = new Date(+n[0], +n[1] - 1, +n[2], +n[3] || 0, +n[4] || 0, +n[5] || 0);\n\t\t\tif (str.indexOf(\"Z\") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);\n\t\t\treturn out;\n\t\t}", "title": "" }, { "docid": "ad6ae569810866cc577a4eccbfe6ed8b", "score": "0.5261112", "text": "function get_month_day_from_full_date(full_date) {\n\tif (full_date.split('-').length > 2) {\n\t\treturn full_date.substring(5)\n\t} else {\n\t\treturn full_date\n\t}\n}", "title": "" }, { "docid": "d0b4360ed51f215a2ffe5de97e2c7208", "score": "0.52586895", "text": "function parseGrADSdate(str) {\n\t\tvar hour = 0, min = 0, sec = 0;\n\t\tvar tStr = [\"\", \"\", \"\"];\n\t\tvar tIdx = 0;\n\n\t\tfor(var c = 0; c < str.length && str[c] != \"Z\" && str[c] != \"z\"; c++) {\n\t\t\tif(str[c] == \":\") {\n\t\t\t\ttIdx++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(tIdx < 3) {\n\t\t\t\t\ttStr[tIdx] = tStr[tIdx] + str[c];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(tStr[0] != \"\") {\n\t\t\thour = parseInt(tStr[0]);\n\t\t}\n\t\tif(tStr[1] != \"\") {\n\t\t\tmin = parseInt(tStr[1]);\n\t\t}\n\t\tif(tStr[2] != \"\") {\n\t\t\tsec = parseInt(tStr[2]);\n\t\t}\n\n\t\tc++; // now after Z, the date position\n\t\tvar datePart = str.substr(c);\n\t\tvar day = 0;\n\t\tvar charCodeZero = \"0\".charCodeAt(0);\n\t\tvar charCodeNine = \"9\".charCodeAt(0);\n\t\tvar cc = datePart.charCodeAt(0);\n\n\t\tif(cc >= charCodeZero && cc <= charCodeNine) {\n\t\t\tday = datePart.match(/[0-9][0-9]*/)[0];\n\t\t\tc += day.length;\n\t\t\tday = parseInt(day);\n\t\t}\n\n\t\tvar mon = str.substr(c, 3);\n\t\tvar mon = months[mon];\n\t\tvar year = parseInt(str.substr(c+3, 4));\n\n\t\tif(str.length == c + 3 + 2) {\n\t\t\t// two digit year implies year between 1950 and 2049\n\t\t\tif(year < 50) {\n\t\t\t\tyear += 2000;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tyear += 1900;\n\t\t\t}\n\t\t}\n\n\t\tvar extra = \"\"; // this should strictly speaking not happen according to the standard, but in our example data files there was no space between the date and the time increment specification\n\t\tif(str.length > c + 7) {\n\t\t\textra = str.substr(c+7);\n\t\t}\n\n\t\treturn [year, mon, day, hour, min, sec, extra];\n\t}", "title": "" }, { "docid": "2b3b38d76651e646c40671794bdc77b7", "score": "0.5254657", "text": "function isDate() {\n\tvar datePat = /^(\\d{1,2})[\\/|\\- ](\\d{1,2})[\\/|\\- ](\\d{2,4})$/;\n\tvar matchArray = this.match(datePat); // is format OK?\n\tif (matchArray == null) return false;\n\t// parse date into variables\n\tvar d = parseInt(matchArray[1],10);\n\tvar m = parseInt(matchArray[2],10);\n\tvar y = parseInt(matchArray[3],10);\n\tif (y < 20) y = 2000 + y // reglage du siecle\n\telse if (y < 100 ) y = 1900 + y\n\tif (y <= 1900 || y >= 2020) return false;\n\tif (m < 1 || m > 12) return false;\n\tvar maxDay = 31;\n\tif (m==4 || m==6 || m==9 || m==11) maxDay = 30;\n\telse if (m == 2) { // check for february 29th\n \tif (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)) maxDay = 29;\n \telse maxDay = 28;\n \t}\n\tif (d < 1 || d > maxDay) return false;\n\t// to string\n\tif (d < 10) s= \"0\"; else s=\"\"; s += d+\"/\"; if (m < 10) s += \"0\"; s+= m+\"/\"+y\n\treturn s;\n}", "title": "" }, { "docid": "1af9de1568ac8eee090f81f75c2e960b", "score": "0.5249732", "text": "function stringToDate(str) {\r\n\t var dArr = str.split(\"/\");\r\n\t var date = new Date(Number(dArr[2]), Number(dArr[1]) - 1, dArr[0]);\r\n\t return date;\r\n\t}", "title": "" }, { "docid": "4c7c0bd351892d982c94d5a0803d9e6e", "score": "0.52458334", "text": "_parseSpecialDate (day, dateString) {\n let date\n\n switch (day) {\n case 'today':\n dateString = dateString.replace(/today/, moment().format('YYYY-MM-DD'))\n break\n case 'yesterday':\n date = moment().subtract(1, 'day').format('YYYY-MM-DD')\n dateString = dateString.replace(/yesterday/, date)\n break\n default:\n // week days (sunday, monday, etc)\n date = nm.findPreviousDayOfWeek(day)\n dateString = dateString.replace(day, moment(date).format('YYYY-MM-DD'))\n }\n\n return moment(dateString)\n }", "title": "" }, { "docid": "8a5c889cf27e65acca2826d1d626592a", "score": "0.5245603", "text": "function parseDotNetDateString(s) {\n return new Date(parseInt(s.slice(6,-2), 10));\n}", "title": "" }, { "docid": "8996068f2e151ef0266c26ec7f3019e9", "score": "0.5243788", "text": "function d4_time_parseWeekdayAbbrev(date, string, i) {\n d4_time_dayAbbrevRe.lastIndex = 0;\n var n = d4_time_dayAbbrevRe.exec(string.substring(i));\n return n ? i += n[0].length : -1;\n}", "title": "" }, { "docid": "b46cb74638f99b69c249defa9302da41", "score": "0.52434975", "text": "function is_dateString()\r\n{\r\n var str = document.getElementById(\"date_is_dateString\").value;\r\n regexp = /^(1[0-2]|0?[1-9])\\/(3[01]|[12][0-9]|0?[1-9])\\/(?:[0-9]{2})?[0-9]{2}$/;\r\n\r\n if (regexp.test(str))\r\n {\r\n document.getElementById(\"result_is_dateString\").innerHTML = \"The result is : \" + true;\r\n }\r\n else\r\n {\r\n document.getElementById(\"result_is_dateString\").innerHTML = \"The result is : \" + false;\r\n }\r\n}", "title": "" }, { "docid": "6fb38e821cb173aca59f1bda3d2651c5", "score": "0.5241868", "text": "function parseDate(str) {\n var mdy = str.split(\"/\");\n return new Date(mdy[2], mdy[0] - 1, mdy[1]);\n }", "title": "" }, { "docid": "c3ceecb528319f590b9f9a9128e552fb", "score": "0.5237207", "text": "function findDateIndex(date,weatherObj) {\r\n var arr=[];\r\n for (let i=0;i<weatherObj.list.length; i++) {\r\n var string = parseInt(weatherObj.list[i].dt_txt.substring(8,10));\r\n if (string==date) {\r\n arr.push(i);\r\n } \r\n \r\n } //FOr loop\r\nreturn arr;\r\n}", "title": "" }, { "docid": "dfe81bf38b6425199134f4143521dcbc", "score": "0.5226856", "text": "function testingDateStr(str) {\n if (str) {\n console.log('validating date of birth.');\n var t = str.match(/^(\\d{2})\\/(\\d{2})\\/(\\d{4})$/);\n if (t === null)\n return false;\n var m = +t[1], d = +t[2], y = +t[3];\n\n // Below should be a more acurate algorithm\n if (m >= 1 && m <= 12 && d >= 1 && d <= 31) {\n return true;\n }\n\n return false;\n } else {\n console.log('no date of birth to validate.');\n return true;\n }\n }", "title": "" }, { "docid": "e3bb2873ff30f55d6ad3262b6bdfc272", "score": "0.52264863", "text": "function processDate(mdy){\r\n\tif(!mdy){return}\r\n\tvar a = mdy.split(\"/\");\r\n\tif(a.length == 1){\r\n\t\ta = \"\";\r\n\t\ta = mdy.split(\"-\");\r\n\t}\r\n\tif(a[0].length==1){\r\n\t\ta[0]= \"0\"+a[0];\r\n\t}\r\n\tif(a[1].length==1){\r\n\t\ta[1]= \"0\"+a[1];\r\n\t}\r\n\tif(a[2].length==2){\r\n\t\ta[2] = a[2]*1;\r\n\t\tif(a[2]+2000>=2006){\r\n\t\t\ta[2]=a[2]+1900;\r\n\t\t}else{\r\n\t\t\ta[2]=a[2]+2000;\r\n\t\t}\r\n\t}\r\n\tmdy = a[2]+a[0]+a[1];\r\n\treturn mdy;\t\r\n}", "title": "" }, { "docid": "b84c54e5d36e0bf17098542d611b8f15", "score": "0.52117634", "text": "function getDateForICalString(aDateStr) {\n let year = aDateStr.substr(0, 4);\n let month = aDateStr.substr(5, 2);\n let date = aDateStr.substr(8, 2);\n return year + month + date;\n}", "title": "" }, { "docid": "30f4f59f8489529ff998b9a6525bac84", "score": "0.5205684", "text": "function parseDate(str) {\n var mdy = str.split(\"-\");\n return new Date(mdy[2], mdy[0] - 1, mdy[1]);\n }", "title": "" }, { "docid": "bd141028d2130b9091d7c868fa1db588", "score": "0.52015746", "text": "function fechaUtils_getDate(stringDate){\n var split = stringDate.split(' ');\n var fechaSplit;\n\n if(split[0].indexOf('-') != -1){\n fechaSplit = split[0].split('-');\n }else{\n fechaSplit = split[0].split('/');\n }\n \n if(fechaSplit[0].length == 2){//dd-mm-yyyy\n var dia = fechaSplit[0];\n var anio = fechaSplit[2];\n }else{//yyyy-mm-dd\n var dia = fechaSplit[2];\n var anio = fechaSplit[0];\n }\n\n var mes = fechaSplit[1];\n\n var horaSplit = split[1].split(':');\n var hora = horaSplit[0];\n var min = horaSplit[1];\n var segSplit = horaSplit[2].split('.');\n var seg = segSplit[0];\n var mil = segSplit[1];\nconsole.log(stringDate);\n//console.log(anio+','+mes+','+dia+','+hora+','+min+','+seg+','+mil);\n return new Date(anio, mes-1, dia, hora, min, seg, mil);\n}", "title": "" }, { "docid": "c487097e2f8cf96ce6cc24f0fc18474e", "score": "0.51986945", "text": "function stringToDate(str) {\n var dArr = str.split(\"/\");\n var date = new Date(Number(dArr[2]), Number(dArr[1]) - 1, dArr[0]);\n return date;\n }", "title": "" }, { "docid": "4221d45859be42bf1ccc6903c3ddcaff", "score": "0.5188679", "text": "function strToDate(date){\n\tlet str = date+\"\"\n\tlet year = str.slice(0,4);\n\tlet month = str.slice(4,6);\n\tlet day = str.slice(6,8);\n\treturn (`${day}/${month}/${year}`)\n}", "title": "" }, { "docid": "cc77e528e8be394c364a527607faaf67", "score": "0.5188097", "text": "function parseDate(date) {\n var replaced = date.replace(/^\\w{3} /, '');\n\n return moment(replaced, 'MMMM DD HH:mm:SS Z YYYY');\n }", "title": "" }, { "docid": "cf80851f6d7f9a42b81eb3eb128ac45a", "score": "0.5188019", "text": "function getTimeZoneID(dateString){\n var re1='.*?'; // Non-greedy match on filler\n var re2='(?:[a-z][a-z]+)'; // Uninteresting: word\n var re3='.*?'; // Non-greedy match on filler\n var re4='(?:[a-z][a-z]+)'; // Uninteresting: word\n var re5='.*?'; // Non-greedy match on filler\n var re6='((?:[a-z][a-z]+))'; // Word 1\n var re7='([-+]\\\\d+)'; // Integer Number 1\n\n var p = new RegExp(re1+re2+re3+re4+re5+re6+re7,[\"i\"]);\n var m = p.exec(dateString);\n if (m != null)\n {\n return m[1]+m[2];\n }\n return \"\";\n}", "title": "" }, { "docid": "c2c50223a783ba3cdaa2958a76ddde4e", "score": "0.5169436", "text": "function stringToDate(str) {\n\tvar dArr = str.split(\"/\");\n\tvar date = new Date(Number(dArr[2]), Number(dArr[1]) - 1, dArr[0]);\n\treturn date;\n}", "title": "" }, { "docid": "9fa52c4aca0f3b76e068c1174f825d27", "score": "0.51509273", "text": "function parseDate(str) {\n var mdy = str.split('/');\n return new Date(mdy[2], mdy[0] - 1, mdy[1]);\n }", "title": "" }, { "docid": "a30b19e1513ceb582c2b152dbc391cc1", "score": "0.51424253", "text": "function filterDate(text) {\n console.log(text);\n if( ((new Date(convertDate(text)) !== \"Invalid Date\") && !isNaN(new Date(convertDate(text))) \n || months.some(month => convertDate(text).toLowerCase().includes(month))))\n {\n if(days.some(day => text.toLowerCase().includes(day))){\n let str = text;\n for(let i = 0; i < 14; i++){\n str = str.replace(days[i], '')\n str = str.replace(days[i].toUpperCase(), '')\n str = str.replace(days[i].toLowerCase(), '')\n }\n return str;\n }\n return text;\n } \n else if (durations.some((duration) => text.toLowerCase().includes(duration) === true )) \n {\n return text;\n }\n else {\n alert(\"Not a saveable date!\")\n return 'NaN';\n }\n}", "title": "" }, { "docid": "9eb9c430574a0f818b5be4a1c9b0ae5a", "score": "0.514003", "text": "function dayFinder(stringDate) {\n var weekdays = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n ];\n\n return weekdays[new Date(stringDate).getDay()];\n}", "title": "" }, { "docid": "e757ac3fd302300ffd555da38808b238", "score": "0.5136733", "text": "function dateStringPastTense(date_input)\n{\n var dtpieces = date_input.split(\" \");\n var dpieces_his = dtpieces[1].split(\":\");\n var dpieces_ymd = dtpieces[0].split(\"-\");\n if (dpieces_ymd == dtpieces[0])\n {\n var dpieces_mdy = dtpieces[0].split(\"/\");\n dpieces_ymd[0] = dpieces_mdy[2];\n dpieces_ymd[1] = dpieces_mdy[0];\n dpieces_ymd[2] = dpieces_mdy[1];\n }\n if (dtpieces[2] && dtpieces[2].toLowerCase()=='pm')\n {\n dpieces_his[0]=dpieces_his[0]*1 + 12;\n }\n dpieces_ymd[1]-=1;\n \n var d = new Date();\n d.setFullYear( dpieces_ymd[0], dpieces_ymd[1], dpieces_ymd[2] );\n d.setHours ( dpieces_his[0], dpieces_his[1], dpieces_his[2] );\n \n var sec = (new Date()).getTime() - d.getTime();\n sec/=1000;\n\n if (sec <0) \n {\n return \"in future\";\n }\n var string_def = {'second':60,'minute':60,'hour':24,'day':30,'month':12,'year':1000};\n for(def in string_def)\n {\n if (sec < string_def[def])\n { \n return sec + \" \" + def + (sec>1? \"s\" : \"\")+ \" ago\";\n }\n sec= Math.floor( sec/string_def[def] );\n }\n return \"over 1000 years ago\";\n}", "title": "" }, { "docid": "5b3e40cc979fff2723ed294cb1c17e6f", "score": "0.51359713", "text": "function getMonthAndDay(date){\n var dateArray = date.split(' ');\n return dateArray[3]+\"/\"+getIndexMonth(dateArray[1], monthAbrevNames)+\"/\"+dateArray[2];\n}", "title": "" }, { "docid": "0cf25841c77daef632be463783537005", "score": "0.51334924", "text": "function stringToDate(s) {\r\n\t var ret = NaN;\r\n\t var parts = s.split(\"/\");\r\n\t date = new Date(parts[2], parts[0], parts[1]);\r\n\t if (!isNaN(date.getTime())) {\r\n\t\tret = date;\r\n\t }\r\n\t return ret;\r\n\t}", "title": "" }, { "docid": "1c6b2394422690f231ee4a2d468d2ef9", "score": "0.5129648", "text": "function parseDate(dateStr) {\r\n var parts = dateStr.split('/');\r\n var returnVal = false;\r\n \r\n try{\r\n returnVal = new Date(parts[2], parts[0] - 1, parts[1])\r\n }\r\n catch (ex) {\r\n \r\n }\r\n\r\n return returnVal\r\n}", "title": "" }, { "docid": "544d035db490fdbddf35f1ed24a17ccd", "score": "0.5124199", "text": "function parseDate(date) {\n re = /(\\d+)\\-(\\d+)\\-(\\d+)\\s(\\d+)\\:(\\d+)/g;\n if (re.test(date)) {\n return (new Date(RegExp.$1, (RegExp.$2 - 1), RegExp.$3, RegExp.$4, RegExp.$5));\n }\n}", "title": "" }, { "docid": "3182632355219694b222ff7de9deda87", "score": "0.5123877", "text": "function parseDate(str) {\n var mdy = str.split('-');\n return new Date(mdy[2], mdy[1] - 1, mdy[0]);\n}", "title": "" }, { "docid": "82f6ed4ca34852285327941f0fb5d6af", "score": "0.5122599", "text": "function parseDate(str, fixdate) {\n\tvar d = new Date(str);\n\tif(good_pd) {\nif(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);\n\t\telse if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n\t\treturn d;\n\t}\n\tif(str instanceof Date) return str;\n\tif(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {\n\t\tvar s = d.getFullYear();\n\t\tif(str.indexOf(\"\" + s) > -1) return d;\n\t\td.setFullYear(d.getFullYear() + 100); return d;\n\t}\n\tvar n = str.match(/\\d+/g)||[\"2017\",\"2\",\"19\",\"0\",\"0\",\"0\"];\n\tvar out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));\n\tif(str.indexOf(\"Z\") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);\n\treturn out;\n}", "title": "" }, { "docid": "82f6ed4ca34852285327941f0fb5d6af", "score": "0.5122599", "text": "function parseDate(str, fixdate) {\n\tvar d = new Date(str);\n\tif(good_pd) {\nif(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);\n\t\telse if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n\t\treturn d;\n\t}\n\tif(str instanceof Date) return str;\n\tif(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {\n\t\tvar s = d.getFullYear();\n\t\tif(str.indexOf(\"\" + s) > -1) return d;\n\t\td.setFullYear(d.getFullYear() + 100); return d;\n\t}\n\tvar n = str.match(/\\d+/g)||[\"2017\",\"2\",\"19\",\"0\",\"0\",\"0\"];\n\tvar out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));\n\tif(str.indexOf(\"Z\") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);\n\treturn out;\n}", "title": "" }, { "docid": "82f6ed4ca34852285327941f0fb5d6af", "score": "0.5122599", "text": "function parseDate(str, fixdate) {\n\tvar d = new Date(str);\n\tif(good_pd) {\nif(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);\n\t\telse if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n\t\treturn d;\n\t}\n\tif(str instanceof Date) return str;\n\tif(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {\n\t\tvar s = d.getFullYear();\n\t\tif(str.indexOf(\"\" + s) > -1) return d;\n\t\td.setFullYear(d.getFullYear() + 100); return d;\n\t}\n\tvar n = str.match(/\\d+/g)||[\"2017\",\"2\",\"19\",\"0\",\"0\",\"0\"];\n\tvar out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));\n\tif(str.indexOf(\"Z\") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);\n\treturn out;\n}", "title": "" }, { "docid": "82f6ed4ca34852285327941f0fb5d6af", "score": "0.5122599", "text": "function parseDate(str, fixdate) {\n\tvar d = new Date(str);\n\tif(good_pd) {\nif(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);\n\t\telse if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n\t\treturn d;\n\t}\n\tif(str instanceof Date) return str;\n\tif(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {\n\t\tvar s = d.getFullYear();\n\t\tif(str.indexOf(\"\" + s) > -1) return d;\n\t\td.setFullYear(d.getFullYear() + 100); return d;\n\t}\n\tvar n = str.match(/\\d+/g)||[\"2017\",\"2\",\"19\",\"0\",\"0\",\"0\"];\n\tvar out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));\n\tif(str.indexOf(\"Z\") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);\n\treturn out;\n}", "title": "" }, { "docid": "82f6ed4ca34852285327941f0fb5d6af", "score": "0.5122599", "text": "function parseDate(str, fixdate) {\n\tvar d = new Date(str);\n\tif(good_pd) {\nif(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);\n\t\telse if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n\t\treturn d;\n\t}\n\tif(str instanceof Date) return str;\n\tif(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {\n\t\tvar s = d.getFullYear();\n\t\tif(str.indexOf(\"\" + s) > -1) return d;\n\t\td.setFullYear(d.getFullYear() + 100); return d;\n\t}\n\tvar n = str.match(/\\d+/g)||[\"2017\",\"2\",\"19\",\"0\",\"0\",\"0\"];\n\tvar out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));\n\tif(str.indexOf(\"Z\") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);\n\treturn out;\n}", "title": "" }, { "docid": "82f6ed4ca34852285327941f0fb5d6af", "score": "0.5122599", "text": "function parseDate(str, fixdate) {\n\tvar d = new Date(str);\n\tif(good_pd) {\nif(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);\n\t\telse if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n\t\treturn d;\n\t}\n\tif(str instanceof Date) return str;\n\tif(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {\n\t\tvar s = d.getFullYear();\n\t\tif(str.indexOf(\"\" + s) > -1) return d;\n\t\td.setFullYear(d.getFullYear() + 100); return d;\n\t}\n\tvar n = str.match(/\\d+/g)||[\"2017\",\"2\",\"19\",\"0\",\"0\",\"0\"];\n\tvar out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));\n\tif(str.indexOf(\"Z\") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);\n\treturn out;\n}", "title": "" }, { "docid": "82f6ed4ca34852285327941f0fb5d6af", "score": "0.5122599", "text": "function parseDate(str, fixdate) {\n\tvar d = new Date(str);\n\tif(good_pd) {\nif(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);\n\t\telse if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n\t\treturn d;\n\t}\n\tif(str instanceof Date) return str;\n\tif(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {\n\t\tvar s = d.getFullYear();\n\t\tif(str.indexOf(\"\" + s) > -1) return d;\n\t\td.setFullYear(d.getFullYear() + 100); return d;\n\t}\n\tvar n = str.match(/\\d+/g)||[\"2017\",\"2\",\"19\",\"0\",\"0\",\"0\"];\n\tvar out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));\n\tif(str.indexOf(\"Z\") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);\n\treturn out;\n}", "title": "" }, { "docid": "82f6ed4ca34852285327941f0fb5d6af", "score": "0.5122599", "text": "function parseDate(str, fixdate) {\n\tvar d = new Date(str);\n\tif(good_pd) {\nif(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);\n\t\telse if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);\n\t\treturn d;\n\t}\n\tif(str instanceof Date) return str;\n\tif(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {\n\t\tvar s = d.getFullYear();\n\t\tif(str.indexOf(\"\" + s) > -1) return d;\n\t\td.setFullYear(d.getFullYear() + 100); return d;\n\t}\n\tvar n = str.match(/\\d+/g)||[\"2017\",\"2\",\"19\",\"0\",\"0\",\"0\"];\n\tvar out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));\n\tif(str.indexOf(\"Z\") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);\n\treturn out;\n}", "title": "" }, { "docid": "831f6ea3c76667b28d35c20aa0e2cdc7", "score": "0.5107199", "text": "function dateChecker(date) {\n\treturn /^(\\d\\d-){2}\\d{4} \\d{2}:\\d{2}$/g.test(date);\n}", "title": "" }, { "docid": "3fa7052a5c04ccffd9210d7706345492", "score": "0.51010126", "text": "function dateToString(str, place) {\n const monthsNotInModal = {\n 01: 'Jan',\n 02: 'Feb',\n 03: 'Mar',\n 04: 'Apr',\n 05: 'May',\n 06: 'June',\n 07: 'July',\n 08: 'Aug',\n 09: 'Sept',\n 10: 'Oct',\n 11: 'Nov',\n 12: 'Dec',\n }\n const monthsInModal = {\n 01: 'January',\n 02: 'February',\n 03: 'March',\n 04: 'April',\n 05: 'May',\n 06: 'June',\n 07: 'July',\n 08: 'August',\n 09: 'September',\n 10: 'October',\n 11: 'November',\n 12: 'December',\n }\n\n let date = str.split('-') \n\n if(place === 'not-in-modal') return `${date[2]} ${monthsNotInModal[Number(date[1])]}`\n else if(place === 'in-modal') return `${date[2]} ${monthsInModal[Number(date[1])]} ${date[0]}`\n}", "title": "" } ]
d9b33c774908e2dbdb8cb98a624aae6b
Display inventory of given storage
[ { "docid": "d6bcaecf2806fdcdd6ab6153ce31b9eb", "score": "0.0", "text": "function chosenStorageTemplate(data) {\n //takes template and populate it with passed array\n var rawTemplate = document.getElementById(\"chosenStorageTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var transferProductGeneratedHTML = compiledTemplate(data);\n // display template in choosen ID tag\n var transferContainer = document.getElementById(\"chosenStorageContainer\");\n transferContainer.innerHTML = transferProductGeneratedHTML;\n}", "title": "" } ]
[ { "docid": "9bbdb3bc80c39a892bca101b5693a046", "score": "0.7321837", "text": "function displayInventory() {\n\tqueryStr = 'SELECT * FROM bamazondb.products';\n\tconnection.query(queryStr, function(err, data) {\n\t\tif(err) throw err;\n\n\t\tconsole.log(\"Current Inventory: \");\n\t\tconsole.log(\"...........................................................................................................\\n\");\n\n\t\tvar strOut = '';\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tstrOut = '';\n\t\t\tstrOut = 'Item ID: ' + data[i].item_id + ' // ';\n\t\t\tstrOut += 'Product Name: ' + data[i].product_name + ' // ';\n\t\t\tstrOut += 'Department: ' + data[i].department_name + ' // ';\n\t\t\tstrOut += 'Price: $' + data[i].customer_price + ' // ';\n\t\t\tstrOut += 'Quantity: ' + data[i].stock_quantity + '\\n';\n\n\t\t\tconsole.log(strOut);\n\t\t}\n\n\t\tconsole.log(\"-----------------------------------------------------------------------------------------------------------\\n\");\n\t\tpromptUserPurchase();\n\t})\n}", "title": "" }, { "docid": "c9de23975af9d60b2535e9be524a9409", "score": "0.7212153", "text": "function displayInventory() {\n\t// console.log('___ENTER displayInventory___');\n\n\t// Construct the db query string\n\tqueryStr = 'SELECT * FROM products';\n\n\t// Make the db query\n\tconnection.query(queryStr, function(err, data) {\n\t\tif (err) throw err;\n\n\t\tconsole.log('Existing Inventory: ');\n\t\tconsole.log('...................\\n');\n\n\t\tvar strOut = '';\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tstrOut = '';\n\t\t\tstrOut += 'Item ID: ' + data[i].item_id + ' // ';\n\t\t\tstrOut += 'Product Name: ' + data[i].product_name + ' // ';\n\t\t\tstrOut += 'Department: ' + data[i].department_name + ' // ';\n\t\t\tstrOut += 'Price: $' + data[i].price + '\\n';\n\n\t\t\tconsole.log(strOut);\n\t\t}\n\n\t \tconsole.log(\"---------------------------------------------------------------------\\n\");\n\n\t \t//Prompt the user for item/quantity they would like to purchase\n\t \tpromptUserPurchase();\n\t})\n}", "title": "" }, { "docid": "d355cac5cd613e6c1682fc65b033e852", "score": "0.7185169", "text": "function displayInventory() {\n\t\t\tvar text = \"Inventory: \";\n\t\t\tif (Inventory.length > 1) {\n\t\t\t\tfor (var x = 0; x < Inventory.length; x++) {\n\t\t\t\ttext = text + Inventory[x] + \", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfor (var x = 0; x < Inventory.length; x++) {\n\t\t\t\ttext = text + Inventory[x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tdocument.getElementById(\"Inventory\").innerHTML = text;\n\t\t\t\n\t}", "title": "" }, { "docid": "3e892ff00c7adfa4938dd03648cc4d72", "score": "0.7029011", "text": "function displayInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n console.log(\"-----------------------------------\");\n });\n }", "title": "" }, { "docid": "f57ec50868527c3f258ea1457b66da5b", "score": "0.702547", "text": "function displayInventory() {\n\tconnection.query('SELECT * FROM Products', function (err, res) {\n\t\tif (err) { console.log(err) };\n\t\tvar table = new Table({\n\t\t\thead: ['item_id', 'item_name', 'department_name', 'price', 'stock_quantity'],\n\t\t\tcolWidths: [10, 30, 30, 20, 20]\n\t\t});\n\t\tfor (i = 0; i < res.length; i++) {\n\t\t\ttable.push(\n\t\t\t\t[res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity]\n\t\t\t);\n\t\t}\n\t\tconsole.log(table.toString());\n\t\tinventoryUpdates();\n\t});\n}", "title": "" }, { "docid": "5a4fdaa6ff2daab3885acf0858ad9349", "score": "0.7022646", "text": "function showInventory() {\n connection.query('SELECT ItemID, ProductName, Price FROM products', function(err, rows, fields) {\n if (err) throw err;\n console.log('Available products:');\n for(var i = 0; i < rows.length; i++) {\n console.log('Item ID: ' + rows[i].ItemID + ' Product Name: ' + rows[i].ProductName + ' Price: $' + rows[i].Price);\n }\n runPrompt();\n });\n}", "title": "" }, { "docid": "d4894ccfda49553714f3f3d824d3ed76", "score": "0.6963838", "text": "function displayInventory() {\n\n var inventMsg = \"Inventory:\" + inventory;\n\n updateDisplay(inventMsg);\n\n }", "title": "" }, { "docid": "0c054e33a45abc7d1cff49947e52d663", "score": "0.6914368", "text": "function displayInventory() {\n console.log(\"\");\n console.log(\"------------------------------------------------\");\n console.log(\"Here's a look at our current inventory selection\");\n console.log(\"------------------------------------------------\");\n console.log(\"\");\n\n // Instantiate CLI table\n var table = new Table({\n head: ['Item', 'Product Name', 'Price', 'Avail.'],\n colWidths: [10, 20, 10, 10]\n });\n\n // Code below pulls back all data from the productstable\n connection.query(\"SELECT * FROM productstable\", function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n // Code below pushing this into the CLI table package to display the inventory\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n console.log(\"\");\n });\n setTimeout(userPrompt, 1000);\n}", "title": "" }, { "docid": "06df22c4e52da32a8b0e9517c793fe8a", "score": "0.67332023", "text": "function displayProducts() {\n console.log(\"\\nShowing current inventory...\\n\".info);\n connection.query(\n \"SELECT * FROM products\", \n (err, res) => {\n if (err) throw err;\n console.table(res);\n promptManager();\n }\n )\n}", "title": "" }, { "docid": "585515c71588a6b9c410e8e78146a966", "score": "0.6716907", "text": "function viewInventory() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\",\n function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].product_name + \"\\n----------------------\\n\");\n }\n }\n )\n }", "title": "" }, { "docid": "3cb2ed25d714c25248b12222f64e3c22", "score": "0.6711572", "text": "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n displayForManager(res);\n purchasePrompt();\n });\n}", "title": "" }, { "docid": "3d3c62285c1dc4528d139311e159bc06", "score": "0.6708272", "text": "function btn_displayInventory() {\n var msg = \"Inventory: \" + inventory;\n updateDisplay(msg);\n}", "title": "" }, { "docid": "cf20cc4674e34e65d1caa62892e1179f", "score": "0.66879994", "text": "function inventory() { }", "title": "" }, { "docid": "3fbc44892771737b5033e99d26bfa2ed", "score": "0.6676078", "text": "function showInventory() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n console.table(results);\n selectItem();\n })\n}", "title": "" }, { "docid": "007dbc0595f23801571ecea0e3e8af0a", "score": "0.6669197", "text": "function inventory(){\n connection.query(\"SELECT * FROM products\", function(err, res){\n if (err) throw err;\n res.forEach(function(item){\n console.log(`Item Name: ${item.product_name} \\n Department: ${item.department_name} \\n Price: ${item.price} \\n Quantity: ${item.stock_quantity}`);\n console.log(\"----------------------------------------------------\")\n })\n returntoMenu();\n });\n}", "title": "" }, { "docid": "8e10a8683f3e122b628f26cc65b6d6e5", "score": "0.66068995", "text": "function displayInventory(myArray) {\r\n\tvar space = 0; //inventory space\r\n\tfor(var i = 0; i < myArray.length; i++) {\r\n\t\tfor(var j = 0; j < itemStorageArray.length; j++) {\r\n\t\t\tif(myArray[i] == itemStorageArray[j].code) {\r\n\t\t\t\tget(\"item\" + i).style.display = \"block\";\r\n\t\t\t\tget(\"item\" + i).innerHTML = itemStorageArray[j].simpleName;\r\n\t\t\t\t\r\n\t\t\t\tif(itemStorageArray[j].category == \"item\") {\r\n\t\t\t\t\tget(\"icon\" + i).style.display = \"block\";\r\n\t\t\t\t\tget(\"icon\" + i).style.background = \"url(images/item-icon.png)\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(itemStorageArray[j].category == \"potion\") {\r\n\t\t\t\t\tget(\"icon\" + i).style.display = \"block\";\r\n\t\t\t\t\tget(\"icon\" + i).style.background = \"url(images/potion-icon.png)\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(itemStorageArray[j].category == \"weapon\") {\r\n\t\t\t\t\tget(\"icon\" + i).style.display = \"block\";\r\n\t\t\t\t\tget(\"icon\" + i).style.background = \"url(images/weapon-icon.png)\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(itemStorageArray[j].category == \"armor\") {\r\n\t\t\t\t\tget(\"icon\" + i).style.display = \"block\";\r\n\t\t\t\t\tget(\"icon\" + i).style.background = \"url(images/armor-icon.png)\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\tspace += 1; //set space to the amount of items\r\n\t}\r\n\t//displaySpace(space);\r\n}", "title": "" }, { "docid": "da153f8f09307b14aedb5457fa6980f0", "score": "0.66054237", "text": "function displayInventory(){\n var query = \"SELECT productID, product_name, price FROM products\";\n connection.query(query, (err, result) => {\n if(err) throw err;\n for(var i = 0; i < result.length; i++){\n console.log(`ID: ${result[i].productID} || Product: ${result[i].product_name} || Price: ${result[i].price} `)\n }\n })\n}", "title": "" }, { "docid": "c4db16cea5c801c6d5aed1926f7e4990", "score": "0.6565727", "text": "function printInventory(){\n\tif(user.inventory.length === 0){\n\t\tdocument.getElementById('outputDiv').innerHTML= 'You dont have anything in your inventory!';\n\t}else if(user.inventory.length === 1){\n\t\tdocument.getElementById('outputDiv').innerHTML= 'You have: ' + user.inventory[0].name + user.inventory.length;\n\t\t}else{\n\t\t\t\tvar inventoryString = 'You have ' + user.inventory.length + ' items. They are: ';\n\t\t\t\t\n\t\t\t\tfor(i = 0; i < user.inventory.length; i++){\n\t\t\t\t\tinventoryString = inventoryString + user.inventory[i].name + ', ';\n\t\t\t\t}\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= inventoryString;\n\t\t\t}\n\t\n\t\n}", "title": "" }, { "docid": "43402cc35332948bd7fe0f6997941baa", "score": "0.6560241", "text": "function displayInventory() {\n //retrieving all fields\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) {\n throw err;\n console.log(\"Unable to connect to Inventory Management System.\\n\".red);\n } \n console.log(\"\\nCurrent Inventory:\\n\".bold.cyan);\n //reset table so it is refreshed each time function is called\n tto.reset();\n //using terminal-table-output package for formatting, first line is header\n tto.pushrow([\"item_id\", \"product_name\", \"department_name\", \"price\", \"stock_quantity\"]).line();\n for(i = 0; i < res.length; i++) {\n //passing in table data retrieved with query, row by row\n tto.pushrow([res[i].item_id,res[i].product_name,res[i].department_name,res[i].price,res[i].stock_quantity]);\n //once final row has been read in, print to console\n if(i === res.length - 1) {\n tto.print(true);\n }\n }\n //calling manager menu function\n managerMenu();\n });\n \n}", "title": "" }, { "docid": "038a8801911d94600330c8f8a875a037", "score": "0.6512761", "text": "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n console.table(\"\\nInventory\", res);\n returnToMenu();\n });\n}", "title": "" }, { "docid": "36e27ddb323a8297db5eac1b6f6e7eb5", "score": "0.64893883", "text": "function viewLowInventory() {\n clearConsole();\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function (err, response) {\n if (err) throw err;\n displayInventory(response);\n userOptions();\n })\n}", "title": "" }, { "docid": "9526bc27dd358fc63bba0c6e370e8d7e", "score": "0.6429816", "text": "function inventoryMenu() {\n $scope.menuTitle = createText(\"Inventory\", [20, 10]);\n\n var datas = CharServ.getAllDatas();\n\n var i = 30;\n _.forIn(datas.inventory, function(value) {\n if (value.quantity > 0) {\n createItem(value, i);\n i += 30;\n }\n });\n }", "title": "" }, { "docid": "4f03c1d8ecd2c5719a68c3f615af4481", "score": "0.63698965", "text": "function showInventory(job) {\n console.log(\"Your answer was \" + job);\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n console.log(\" CURRENT INVENTORY \".bgRed.white);\n console.log(\"\\n\");\n console.log(\"\\n\");\n// build our table using table NPM\n var table = new Table({\n head: ['Item ID', 'Product', 'Price', 'Quantity']\n , colWidths: [20, 21, 25, 17]\n });\n for (var i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, \"$\" + res[i].price, res[i].stock_quantity]\n );\n };\n console.log(table.toString());\n console.log(\"\\n\");\n console.log(\"\\n\");\n continueManaging();\n });\n \n}", "title": "" }, { "docid": "a7cce2f0416484a51954a3ac6b9feae3", "score": "0.63486564", "text": "function displayInventory() {\n\tconnection.query('SELECT * FROM products', function(err, res){\n\t\tif (err) throw err;\n console.log('=============================What would you like to buy?==============================');\n \n for(var i = 0; i<res.length;i++){\n console.log(\"ID: \" + res[i].item_id + \" | \" + \n \"Product: \" + res[i].product_name + \" | \" + \n \"Department: \" + res[i].department_name + \" | \" + \n \"Price: \" + res[i].price + \" | \" + \n \"QTY: \" + res[i].stock_quantity);\n console.log('======================================================================================'); \n };\n buyItem();\n });\n}", "title": "" }, { "docid": "f60c9536ac1229bd1d0a2a68045a7fa9", "score": "0.63353753", "text": "function viewProducts() {\n console.log('Here is the current inventory: ');\n var table = new Table({\n head: ['Item ID', 'Product Name', 'Price', 'Quantity']\n });\n connection.query(\"SELECT * FROM products\", function (err, res) {\n for (let i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n console.log('\\n*******************');\n managerOptions();\n })\n}", "title": "" }, { "docid": "bc91cbf0d35841634216367be37fdec5", "score": "0.6334083", "text": "function getInventory() {\r\n\t// Check if values of inventory are in storage. If not, assign 0 to each\r\n\t// amount of items in the inventory\r\n\tif (localStorage.getItem(\"inventory\") === null) {\r\n\r\n\t\tvar newInventory = {\r\n\t\t\tpotions : 0,\r\n\t\t\tarrows : 0\r\n\t\t};\r\n\r\n\t\tdocument.getElementById(\"potionCount\").innerHTML = newInventory.potions;\r\n\t\tdocument.getElementById(\"arrowCount\").innerHTML = newInventory.potions;\r\n\r\n\t\t// stringify before storage because localStorage supports strings only\r\n\t\tlocalStorage.setItem(\"inventory\", JSON.stringify(newInventory));\r\n\t} else {\r\n\t\tvar inventory = JSON.parse(localStorage.getItem(\"inventory\"))\r\n\r\n\t\tdocument.getElementById(\"potionCount\").innerHTML = inventory.potions;\r\n\t\tdocument.getElementById(\"arrowCount\").innerHTML = inventory.arrows;\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "43a8cf07a9e881a1d2ff54ff23dc40ca", "score": "0.63043386", "text": "function viewLowInventory() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function (err, res) {\n if (err) throw err;\n let items = '';\n for (var i = 0; i < res.length; i++) {\n items = '';\n items += 'Product Name: ' + res[i].product_name + ' // ';\n items += 'Quantity: ' + res[i].stock_quantity + '\\n';\n console.log(items.toUpperCase());\n\n }\n return setTimeout(function () {\n managerPortal()\n }, 4000);\n })\n}", "title": "" }, { "docid": "1f0203e3bd9805044f43a48ead2b8111", "score": "0.62748784", "text": "function displayInventory(response) {\n tableValues = [];\n for (var i = 0; i < response.length; i++) {\n tableValues.push(\n {\n ID: response[i].item_id,\n Name: response[i].product_name,\n Price: \"$\" + response[i].price.toFixed(2),\n Quantity: response[i].stock_quantity\n }\n )\n }\n console.table(tableValues);\n}", "title": "" }, { "docid": "46001accc0fb8a5daf28b2dde5b7eb2f", "score": "0.62653124", "text": "function displayInventory() {\n\n // // Query db for all items\n querySelect = 'SELECT * FROM products';\n\n // build the db query\n connection.query(querySelect, function (err, data) {\n if (err) throw err;\n\n console.log(` \n ______ \n (____ \\ \n ____) ) ____ ____ ____ _____ ___ ____ \n | __ ( / _ | \\ / _ (___ ) _ \\| _ \\ \n | |__) | ( | | | | ( ( | |/ __/ |_| | | | |\n |______/ \\_||_|_|_|_|\\_||_(_____)___/|_| |_| \\n \n \\n-------------------------------------------------------------------\\n`);\n console.log('Existing Inventory: ');\n console.log('<___________________>\\n');\n\n let inventory = '';\n for (let i = 0; i < data.length; i++) {\n inventory = '';\n inventory += 'Item ID: ' + data[i].item_id + ' | ';\n inventory += 'Product Name: ' + data[i].product_name + ' | ';\n inventory += 'Department: ' + data[i].department_name + ' | ';\n inventory += 'Price: $' + data[i].price + ' | ';\n inventory += 'In Stock: ' + data[i].stock_quantity + '\\n';\n\n console.log(inventory);\n }\n\n console.log(\"---------------------------------------------------------------------\\n\");\n\n //Prompt the user for item/quantity\n promptBuyer();\n })\n}", "title": "" }, { "docid": "e4850dccee82481daf2e84f7b8ec1321", "score": "0.6259067", "text": "function displayInventory() {\n var i, item, inventory;\n inventory = document.querySelector(\"#inventory > ul\");\n clearContent(inventory);\n for (i in player.items) {\n item = document.createElement (\"li\");\n item.textContent = player.items[i];\n inventory.appendChild(item);\n }\n}", "title": "" }, { "docid": "20ad80479dd52d1263ee11de8d3b6551", "score": "0.62523574", "text": "function viewLowInventory(){\n\n\t// Query: Read products with stock_quantity < 5\n\tconnection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function(viewLowErr, viewLowRes){\n\t\tif (viewLowErr) throw viewLowErr;\n\n\t\tfor (var j = 0; j < viewLowRes.length; j++){\n\t\t\tconsole.log(\"Id: \" + viewLowRes[j].item_id + \" | Name: \" + viewLowRes[j].product_name +\n\t\t\t\t\t\t\" | Price: \" + viewLowRes[j].price + \" | Quantity: \" + viewLowRes[j].stock_quantity);\n\t\t\tconsole.log(\"-------------------------------------------------------------------\");\n\t\t}\n\n\t\t// Prompts user to return to Main Menu or end application\n\t\trestartMenu();\n\t});\n}", "title": "" }, { "docid": "dde853413a1e22f7fd9c9440d281a222", "score": "0.62129396", "text": "function displayAllInventory() {\r\n\r\n var query = \"SELECT item_id, department_name, product_name, price, stock_quantity FROM bamazon.products \" +\r\n \"INNER JOIN bamazon.departments ON products.department_id = departments.department_id \" +\r\n \"ORDER BY department_name, product_name ASC\";\r\n bamazon.query(query, function (err, res) {\r\n if (err) throw (err);\r\n\r\n displayInventoryTable(res);\r\n start();\r\n });\r\n}", "title": "" }, { "docid": "ee824a0a09ad6fa6fc6687d0a5457571", "score": "0.6199946", "text": "function viewProducts() {\n clearConsole();\n connection.query(\"SELECT * FROM products\", function (err, response) {\n if (err) throw err;\n displayInventory(response);\n userOptions();\n })\n}", "title": "" }, { "docid": "bc33578ea1d671a080c6e43ea4b8a0d1", "score": "0.61852235", "text": "function displayInventory(listContents) {\n\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\tvar j = 0;\n\tvar k = 1;\n\tfor(var i = 1; i <= LIST_MAX; ++i){\n\t\tswitch(parseInt(listContents[j])){\n\t\t\tcase 0:\n\t\t\t\tdocument.getElementById(\"slot\" + i).innerHTML = i + \"--> Empty\";\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tdocument.getElementById(\"slot\" + i).innerHTML = i + \"--> Hatchet\" + \" (\" + k + \") Removes Trees for 8 energy points\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tdocument.getElementById(\"slot\" + i).innerHTML = i + \"--> Axe\" + \" (\" + k + \") Removes Trees for 6 energy points\";\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tdocument.getElementById(\"slot\" + i).innerHTML = i + \"--> Chainsaw\" + \" (\" + k + \") Removes Trees for 2 energy points\";\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tdocument.getElementById(\"slot\" + i).innerHTML = i + \"--> Chisel\" + \" (\" + k + \") Removes Boulders for 15 energy points\";\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tdocument.getElementById(\"slot\" + i).innerHTML = i + \"--> Sledgehammer\" + \" (\" + k + \") Removes Boulders for 12 energy points\";\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tdocument.getElementById(\"slot\" + i).innerHTML = i + \"--> Jackhammer\" + \" (\" + k + \") Removes Boulders for 4 energy points\";\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tdocument.getElementById(\"slot\" + i).innerHTML = i + \"--> Machete\" + \" (\" + k + \") Removes Blackberry Bushes for 2 energy points\";\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tdocument.getElementById(\"slot\" + i).innerHTML = i + \"--> Shears\" + \" (\" + k + \") Removes Blackberry Bushes for 2 energy points\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdocument.getElementById(\"slot\" + i).innerHTML = i + \"--> Empty\";\n\t\t\t\tbreak;\n\t\t}\n\t\tj += 2;\n\t\tk += 2;\n\t} \n\n\n\t\n}", "title": "" }, { "docid": "d1349f02e21e33e3896e3230cbbda592", "score": "0.6175768", "text": "function displayStorage() {\n let exists = localStorage.getItem('groceryList');\n\n if (exists) {\n let storageItems = JSON.parse(localStorage.getItem('groceryList'));\n storageItems.forEach(item=>{\n createItem(item)\n })\n } else {\n groceryList=[];\n }\n}", "title": "" }, { "docid": "a766c8ca66752fda2f693f0067017b02", "score": "0.61512053", "text": "function readInventory() {\n connection.query(\"SELECT * FROM inventory\", function(err, res) {\n if (err) throw err;\n\n // For loop to display all current products id, name, price, and quantity\n for (var i = 0; i < res.length; i++) {\n console.log(\"Product: \" + res[i].product_name + \n \" || Price: $\" + res[i].product_price + \n \" || Stock: \" + res[i].product_quantity + \n \" || ID: \" + res[i].id + \"\\n\");\n }\n firstSheBang();\n });\n}", "title": "" }, { "docid": "fa593aa4df14287d9dc10b6f5b479a5c", "score": "0.61394525", "text": "function displaySingeStorage(givenStorageID) {\n refreshdisplaySingeStorage(givenStorageID); // trigger refreshing\n getChartInvetnoryInfo(givenStorageID); //pass selected storage ID to get chart info\n if (givenStorageID > 0) { // check if a storage is selected 0 = \"select a storage\" option\n $.ajax({\n type: 'POST',\n url: '?request=getStorageProduct', // given request to controller\n data: {givenStorageID: givenStorageID}, // passed data to controller\n dataType: 'json',\n success: function (data) {\n chosenStorageTemplate(data); //display inventory of selected storage\n rowColor(); // format color of inventory table\n }\n });\n }\n return false;\n}", "title": "" }, { "docid": "c094619d0ba8966446d4af69bb79873d", "score": "0.613469", "text": "function viewLowInventory() {\n con.query(\"SELECT * from vw_LowInventory\", function (err, result) {\n if (err) {\n throw err;\n }\n else {\n var table = new Table({\n\t\t head: ['Product Id', 'Product Name', 'Department','Price', 'Quantity'],\n\t\t style: {\n\t\t\t head: ['blue'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center','left','left','right', 'right']\n\t\t }\n\t });\n\n\t //loops through each item in the mysql database and pushes that information into a new row in the table\n\t for(var i = 0; i < result.length; i++) {\n\t\t table.push(\n\t\t\t [result[i].Product_Id, result[i].Product_Name, result[i].Department, result[i].Price, result[i].Quantity]\n\t\t );\n\t }\n \n console.log(table.toString());\n runManageBamazon();\n }\n });\n}", "title": "" }, { "docid": "f62b4fd3811bf588a64df2eead5a3486", "score": "0.6099082", "text": "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n //organizes the collumns i wish to display for each item\n for (var i = 0; i < res.length; i++) {\n console.log(`ID: ${res[i].id} || Name: ${res[i].product_name} || Department: ${res[i].department_name} || Price: $${res[i].price}`)\n }\n shopping();\n })\n}", "title": "" }, { "docid": "25460a989710494a179ae436c2d00df0", "score": "0.6096408", "text": "function displayStock() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n for (i in res) {\n let product = res[i];\n console.log(\"------\")\n console.log(\"ID:\", product.item_id);\n console.log(\"Product:\", product.product_name);\n console.log(\"Department:\", product.department_name);\n console.log(\"Price: $\"+product.price);\n console.log(\"# in Stock:\", product.stock_quantity);\n }\n selectProduct();\n \n });\n }", "title": "" }, { "docid": "c5d17ffb6dfdf22872732b7fec75fbc9", "score": "0.6086597", "text": "currentInventory() {\n const inv = [];\n const allItems = Object.keys(this.product);\n allItems.forEach(item => {\n inv.push(`${this.product[item].name}: ${this.product[item].quanity}`);\n });\n return inv;\n }", "title": "" }, { "docid": "1e317ae097d12fa09d2ebeef17fa770c", "score": "0.6084333", "text": "function showInventory() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"\\nVIEW INVENTORY\",\n name: \"confirm\",\n default: true\n }\n ])\n .then(function (inquirerResponse) {\n if (inquirerResponse.confirm) {\n connection.query(\"SELECT item_id, product_name, price FROM products\", function (err, res) {\n if (err) throw err;\n\n console.log(\"\\n \\n PRODUCTS LIST: \");\n console.log(\"---------------------------\\n\")\n\n var table = new Table({\n head: ['ID#', 'PRODUCT', 'PRICE']\n , colWidths: [10, 30, 20]\n });\n for (var i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name,\n res[i].price]\n );\n\n }\n placeOrder();\n console.log(table.toString());\n });\n }\n else {\n console.log(\"\\nThat's okay, maybe next time.\\n\");\n }\n });\n\n}", "title": "" }, { "docid": "633d0b37c9de8a0fec3246d327d5619f", "score": "0.6081072", "text": "function showInventory() {\n var query = \"SELECT * FROM products\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n var table = new Table({\n chars: {\n 'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗'\n , 'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚', 'bottom-right': '╝'\n , 'left': '║', 'left-mid': '╟', 'mid': '─', 'mid-mid': '┼'\n , 'right': '║', 'right-mid': '╢', 'middle': '│'\n }, head: ['ID', 'PRODUCT', 'DEPARTMENT', 'PRICE', 'IN STOCK']\n });\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity]);\n }\n console.log(table.toString());\n menu();\n });\n}", "title": "" }, { "docid": "8fcf1e0e968f6ef4aa9fe1772c933d9c", "score": "0.60799587", "text": "function viewLowInventory() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function(\n err,\n rows\n ) {\n if (err) throw err;\n if (rows.length === 0) {\n console.log(\"There are no products with stock lower than five units.\");\n } else {\n console.log(\"\");\n console.table(rows);\n console.log(\"=====================================================\");\n }\n menu();\n });\n}", "title": "" }, { "docid": "a75b56c325457e9edba7db49a2449451", "score": "0.6067589", "text": "function lowInventory (err, results) {\n if (err) {\n console.log(err)\n }\n console.table(results)\n mainMenu()\n}", "title": "" }, { "docid": "2dcf6cefb8e57fd65e734baa5d891f21", "score": "0.60493857", "text": "recordInventory(){\r\n this._listProduct();\r\n }", "title": "" }, { "docid": "5875d5d1602189e42f6250caa8b39882", "score": "0.6043489", "text": "function printFromStorage() {\n\t// get array from local storage\n\tlet itemsLS = getFromStorage();\n\n\t// for every item in array\n\titemsLS.forEach(function(item) {\n\t\t// create item in cart\n\t\tconst row = document.createElement('tr');\n\n\t\trow.innerHTML = `\n\t\t\t<td>\n\t\t\t\t<img src=\"${item.image}\">\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t${item.title}\n\t\t\t</td>\n\t\t\t<td class=\"data-price\" data-price=\"${item.priceData}\">\n\t\t\t\t${item.price}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<ion-icon name=\"close\" class=\"remove\" data-id=\"${item.id}\"></ion-icon>\n\t\t\t</td>\n\t\t`;\n\n\t\tshoppingCartCont.appendChild(row);\n\n\t\t// save current total price to var\n\t\tlet total = totalPrice.textContent;\n\n\t\t// add item price to total\n\t\ttotal = parseInt(total) + parseInt(item.priceData);\n\n\t\t// write total into totalPrice\n\t\ttotalPrice.textContent = total;\n\n\t\t// update count of items in 'itemAmount'\n\t\titemAmount.innerHTML = shoppingCartCont.childElementCount;\n\n\t\t// apply 'in basket' effect\n\t\tif (shoppingCartCont.childElementCount > 0) {\n\t\t\titemAmount.classList.add('active');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a8b9d99be3742f737c677095e42c6a06", "score": "0.6039447", "text": "function displayItems() {\n\tvar query = \"SELECT * FROM products\";\n\tconnection.query(query, (err,res) => {\n\t\tif (err) {console.log(err)};\n\t\tconsole.log(JSON.stringify(res));\n\t})\n}", "title": "" }, { "docid": "036ace6a171171ac56891f63a084d450", "score": "0.60258436", "text": "function displayItems() {\n\tconnection.query(\"SELECT * FROM products\", function(error, response) {\n\t\tif (error) throw error;\n\t\t//create new table to push product info into\n\t\tvar itemsTable = new Table({\n\t\t\thead: [\"Item ID\", \"Product Name\", \"Price\", \"Quantity\"]\n\t\t});\n\t\t//loop through response and push each items info into table\n\t\tfor (var i = 0; i < response.length; i++) {\n\t\t\titemsTable.push([response[i].item_id, response[i].product_name, \"$ \"+response[i].price, response[i].stock_quantity]);\n\t\t}\n\t\t//display table\n\t\tconsole.log(itemsTable.toString());\n\t\t//ask if user would like to return to menu\n\t\treturnToMenu();\n\t});\n}", "title": "" }, { "docid": "cf8e6c59f5b97ebfdd973393cdff5ce1", "score": "0.6017628", "text": "function displayStock() {\n\n //table creation using cli-table package\n var table = new Table({\n head: ['ID', 'PRODUCT', 'PRICE', 'IN STOCK'],\n colWidths: [6, 32, 14, 14],\n style: {'padding-left': 2, 'padding-right': 2}\n });\n for (var i = 0; i < stock.length; i++) {\n var item = stock[i];\n\n //if item is in stock, push to the table\n if (stock[i].StockQuantity > 0) {\n table.push([item.ItemID, item.ProductName, \"$\" + item.Price, item.StockQuantity]);\n }\n }\n clear();\n console.log(\"----------------------------------------------------------------------\");\n console.log(\" WELCOME TO BAMAZON CUSTOMER VIEW \");\n console.log(\" \");\n console.log(\" HERE IS WHAT WE HAVE IN STOCK \");\n console.log(\"----------------------------------------------------------------------\");\n //displays the table\n console.log(table.toString());\n}", "title": "" }, { "docid": "4836c7dc3f0d3e53af32b025aaefde9c", "score": "0.6016371", "text": "function viewLowInventory() {\n var query = \"SELECT item_id, product_name, price, stock_quantity FROM products WHERE stock_quantity < 5\";\n connection.query(query, function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n console.table(\"\\nLow Inventory\", res);\n returnToMenu();\n });\n}", "title": "" }, { "docid": "9ff3bff92817bc8531a298c149f33d85", "score": "0.60160875", "text": "function viewInventory() {\n console.log(\"viewInventory running\");\n connection.query(\n \"SELECT * FROM products WHERE stock_quantity < 5\",\n function(error, results) {\n if (error) throw error;\n\n for (var n=0; n < results.length; n++) {\n product = results[n];\n productId = product.item_id;\n productName = product.product_name;\n productPrice = parseInt(product.price);\n productQuantity = parseInt(product.stock_quantity);\n\n string = productId + \" | \" + productName + \" | $\" + productPrice + \" | \" + productQuantity;\n console.log(string);\n } \n }\n ) // close SQL query\n} // close viewInventory()", "title": "" }, { "docid": "e974efed70c77f1adc3b23137a1bdfb1", "score": "0.5998582", "text": "function getInventory(){\n axios.get('/inventory')\n .then(res => setItems(res.data))\n .catch(err => alert(err))\n }", "title": "" }, { "docid": "837c58e1be3a0684ed73ab3a60f6b29e", "score": "0.59978527", "text": "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(error, results) {\n if (error) throw error;\n console.log(\"AVAILABLE ITEMS:\");\n for (var i = 0; i < results.length; i++) {\n console.log(results[i].id + ' | ' + results[i].product_name + ' | ' + '$'+results[i].price + ' | ' + results[i].stock_quantity);\n }\n });\n connection.end();\n}", "title": "" }, { "docid": "8db1f1543d6dce7e7713c317175d2ff3", "score": "0.5996578", "text": "function viewLowInventory() {\n\n var query = \"SELECT * FROM products\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.log(\"All items that need to be restocked:\\n\");\n console.log(\"\\n-----------------------------------------\\n\");\n for (var i = 0; i < res.length; i++) {\n if (res[i].stock_quantity <= 5) {\n console.log(\"Id: \".bold + res[i].item_id + \" | Product: \".bold + res[i].product_name + \" | Department: \".bold + res[i].department_name + \" | Price: \".bold + \"$\".green.bold +res[i].price + \" | QOH: \".bold + res[i].stock_quantity);\n }\n }\n console.log(\"\\n-----------------------------------------\\n\");\n });\n\n\n}", "title": "" }, { "docid": "3c420420cb244a2b2e45596729d161aa", "score": "0.5994407", "text": "function viewLowInventory() {\n\tconnection.query('SELECT * FROM Products WHERE stockQuantity<5', function(err, result) {\n\t\tcreateTable(result);\n\t})\n}", "title": "" }, { "docid": "fc418f8b1c7e93aab862466160d29265", "score": "0.59852904", "text": "function showStock(){\n\t//search query that is selecting everything in our products table\n\tconnection.query(\"SELECT * FROM products\", function(error, results){\n\t\tif(error){\n\t\t\tconsole.log(error);\n\t\t}else{\n\t\t\t//looping through our table and grabbing our id, product, and price for each product\n\t\t\tfor(var i = 0; i < results.length; i++){\n\t\t\t\tconsole.log(\"ID: \" + results[i].item_id);\n\t\t\t\tconsole.log(\"Product: \" + results[i].product_name);\n\t\t\t\tconsole.log(\"Price: \" + \"$\" + results[i].price);\n\t\t\t\t//pushing product id and name back up to our choicesArray for use in inquirer\n\t\t\t\tchoicesArray.push(results[i].item_id + \": \" + results[i].product_name);\n\t\t\t};\n\t\t//calling our user input function to ask our user which product they would like to buy\t\n\t\tuserInput();\n\t\t};\n\t});\n}", "title": "" }, { "docid": "a77c14f2755d535ded5733e8d073054a", "score": "0.5978075", "text": "function displayProducts(addInventoryPrompt, redirect) { //invocation with callback used in addToInventory();\n var listedItems = [];\n\n connection.query('SELECT * FROM products', function(err, results) {\n if (err) throw err;\n\n // This loop does the following: \n // 1) Updates the price values to show '$' sign\n // 2) Builds an array of all the listed items (this is returned as a courtesy and used in addToInventory())\n for (var i = 0; i < results.length; i++) {\n results[i].price = \"$\" + results[i].price.toFixed(2);\n listedItems.push(results[i].item_id);\n }\n\n console.table('\\nPRODUCT LIST', results);\n \n if (addInventoryPrompt) {\n addInventoryPrompt(listedItems);\n }\n else if (redirect) {\n redirect();\n }\n });\n }", "title": "" }, { "docid": "3156b5210a98d25a4997ebc845e08690", "score": "0.5973555", "text": "function displayInv() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n console.log(\"\\n______________WELCOME TO BAMAZON!______________\")\n console.log(\"\\n-------------- Current Inventory --------------\\n\")\n console.log(\" ID: | Name: | Dept: | Price: |\");\n for (let i = 0; i < results.length; i++) {\n var inv = results[i];\n console.log(\"\\n\" + \" \" + inv.item_id + \" | \" + inv.product_name +\n \" | \" + inv.department_name + \" | \" + inv.price +\n \" | \");\n }\n console.log(\"\\n---------------------------------------------\\n\")\n\n shop();\n })\n\n}", "title": "" }, { "docid": "ea5d73a6b2cb041d8281f0911f82f42c", "score": "0.5971211", "text": "function runBamazon() {\n // Display the available inventory\n displayInventory();\n}", "title": "" }, { "docid": "405eb6ef0c26e6b0bc8418eb68b11681", "score": "0.5961438", "text": "function displayData() {\n\t// empty out our current list \n\tge('ubuntuVersionsDisplayList').innerHTML = \"\";\n\t\n\t// check if localstorage has anything in it\n\tif (localStorage.length === 0) {\n\t\talert('There is no data in Local Storage');\n\t}\n\telse { // there is local storage info\n\t\n\t\t// loop through each item in local storage\n\t\tfor (var i=0, j=localStorage.length; i<j; i++) {\n\t\t\t// Put the information from the localStorage row into some variables\n\t\t\tvar key = localStorage.key(i),\n\t\t\t\tvalue = localStorage.getItem(key),\n\t\t\t\tobj = JSON.parse(value);\n\t\t\t\n\t\t\t// let's check if the key for the entry starts with our ubuvers id.\n\t\t\t// substring lets you grab portions of the string. 0 is the first \n\t\t\t// character, and 7 means it goes up to character 7. This will read \n\t\t\t// charachters 1-7 (u b u V e r s). Note: It doesn't read the last \n\t\t\t// character. \n\t\t\tif (key.substring(0,7) == \"ubuVers\") {\n\t\t\t\t// let's check to make sure we are getting the right keys out\n\t\t\t\tconsole.log(key);\n\t\t\t\tconsole.log(obj);\t\t\t\n\t\t\t\t\n\t\t\t\t// now that we have our key right. let's display the data already added\n\t\t\t\tvar list = ge('ubuntuVersionsDisplayList'),\n\t\t\t\t\tlistItem = document.createElement('li'),\n\t\t\t\t\tubuVersNumValue = obj.version,\n\t\t\t\t\tubuVersNameValue = obj.release,\n\t\t\t\t\tlistText = ubuVersNumValue + \": \" + ubuVersNameValue + ' ',\n\t\t\t\t\titemDeleteButton = document.createElement('button'),\n\t\t\t\t\titemDeleteButtonText = \"Remove Item\";\n\t\t\t\t\titemEditButton = document.createElement('button'),\n\t\t\t\t\titemEditButtonText = \"Edit Item\";\n\t\t\t\t\n\t\t\t\t// delete button\t\n\t\t\t\titemDeleteButton.setAttribute('id',key),\n\t\t\t\titemDeleteButton.onclick = function() {deleteItem(this.id)};\n\t\t\t\t\n\t\t\t\t// edit button\n\t\t\t\titemEditButton.setAttribute('id',key),\n\t\t\t\titemEditButton.onclick = function() {editItem(this.id)};\n\t\t\t\t\n\t\t\t\t// setup our buttons and list item with their text\n\t\t\t\tlistItem.innerHTML = listText;\n\t\t\t\titemEditButton.innerHTML = itemEditButtonText;\n\t\t\t\titemDeleteButton.innerHTML = itemDeleteButtonText;\n\t\t\t\t\n\t\t\t\t// append our buttons to the list item\n\t\t\t\tlistItem.appendChild(itemEditButton);\n\t\t\t\tlistItem.appendChild(itemDeleteButton);\n\t\t\t\t\n\t\t\t\t// append the list item to the list to be displayed\n\t\t\t\tlist.appendChild(listItem);\n\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t\n\t}\n}", "title": "" }, { "docid": "fc5ca01498cd43ff9caa1e2e348b21b6", "score": "0.5958112", "text": "function fullDisplay() {\n query = \"SELECT * FROM products\";\n\n // Make the db query\n connection.query(query, function (err, data) {\n if (err) throw err;\n\n console.log(\"Existing Inventory: \");\n console.log(\"-------------------\\n\");\n\n let info = \"\";\n\n for (var i = 0; i < data.length; i++) {\n info = \"\";\n info += \"Item: \" + data[i].ID + \", \";\n info += \"Product Name: \" + data[i].product_name + \", \";\n info += \"Department: \" + data[i].department_name + \", \";\n info += \"Price: $\" + data[i].price + \"\\n\";\n console.log(info);\n }\n console.log(\"-------------------------------------------------\\n\");\n // start the sale!\n startGame();\n });\n\n}", "title": "" }, { "docid": "0438dcddf4a6c507f22a3179b00807ac", "score": "0.59562945", "text": "getInventory() {\n console.log('Fireplace inventory:', this.inventory);\n }", "title": "" }, { "docid": "85d6c0c6518356548c14af9d224fee6b", "score": "0.59524703", "text": "fetchInventory () {\r\n return Api().get('inventory')\r\n }", "title": "" }, { "docid": "d6f9c674b9d3c86716b0824c06567901", "score": "0.59420073", "text": "static showInventory() {\n document.getElementById('inventoryContainer').hidden = false;\n }", "title": "" }, { "docid": "a1e274ef8763f895de6771e448e21b68", "score": "0.59350634", "text": "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n console.log(\"\\n\" + colors.yellow(\"---------------------PRODUCTS FOR SALE---------------------\") + \"\\n\");\n var table = new cliTable({ head: [\"ID\", \"Item\", \"Price\", \"Quantity\"] });\n for (var i = 0; i < results.length; i++) {\n table.push([results[i].id, results[i].productName, results[i].price, results[i].stockQuantity]);\n }\n console.log(table.toString() + \"\\n\");\n actionPrompt();\n });\n}", "title": "" }, { "docid": "a61a6fd7c78690c4d319d6849c0c87d3", "score": "0.59296185", "text": "function updateInventory() {\n ul_inventoryList.empty();\n let li;\n $(inventory).each(function (index, element) {\n li = $(\"<li>\");\n li.data(\"name\", element[\"name\"]);\n li.html(element[\"name\"] + \": \" + element[\"count\"]);\n ul_inventoryList.append(li);\n });\n }", "title": "" }, { "docid": "59c987a0301cdc58e0a24a1f9d93b403", "score": "0.5905207", "text": "display() {\n for (let i = 0; i < this.data.stock.length; i++) {\n console.log(i + 1 + \". \" + this.data.stock[i].corporation);\n }\n }", "title": "" }, { "docid": "fc3e6cc83bfc6bffed55d0adada93f95", "score": "0.58959556", "text": "function viewFunction() {\n let text = 'Inventory to be uploaded (total ' + detectedItemsArray.length + ' items):';\n for (let i=0; i<detectedItemsArray.length; i++) {\n let item = detectedItemsArray[i];\n let hash = JSON.stringify(item).hashCode();\n text = text + '\\n\\nName: ' + item.name + ' (' + item.type + ')\\n\\t' +\n 'Damage: ' + item.dmg +' Accuracy: ' + item.acc +' Quality: ' + item.quality + '\\n\\t' +\n 'Buy: ' + item.buy + ' Sell: ' + item.sell + ' Value: ' + item.value + '\\n\\t' +\n 'Asking Price: ' + item.asking + ' Profile ID: ' + item.id + '\\n\\t' +\n 'Hashcode (debugging): ' + hash;\n }\n alert(text);\n }", "title": "" }, { "docid": "4872883ecdf8e04f25402575951d98cf", "score": "0.5891605", "text": "function listInventory() {\n //Variable creation from DB connection\n connection.query(\"SELECT * FROM products\", function (err, results) {\n for (var i = 0; i < results.length; i++) {\n\n var itemId = results[i].item_id,\n productName = results[i].product_name,\n price = results[i].price,\n stockQuantity = results[i].stock_quantity;\n\n table.push(\n [itemId, productName, price, stockQuantity]\n );\n }\n console.log(\"\");\n console.log(chalk.blue(\"==================================== \") + chalk.yellowBright(\"CURRENT BAMAZON PRODUCT INVENTORIES\") + chalk.blue(\" =========================================\"));\n console.log(\"\");\n console.log(chalk.greenBright(table.toString()));\n console.log(\"\");\n console.log(\"\");\n console.log(\"\");\n newTransaction();\n // connection.end();\n });\n }", "title": "" }, { "docid": "ebe6868ce5eab6e8b43c0d8417fd1747", "score": "0.5880496", "text": "function printInventory(){\n console.log(player.name + \" you have \" + player.inventory)\n console.log(\"Your hp is \" + player.hp)\n}", "title": "" }, { "docid": "0356e3850f65ae97b6df0f6240bed5a5", "score": "0.5876203", "text": "function getInventory() {\n connection.query(\"SELECT * FROM products\", function(err, inventoryRes) {\n if (err) {\n console.log(\"ERROR: \", err);\n }\n\n console.log(\"CURRENT INVENTORY: \");\n printTable(inventoryRes);\n console.log(\"\");\n\n purchase();\n });\n}", "title": "" }, { "docid": "c1c599f10a42176fa10f1c1e94bd09f3", "score": "0.5875584", "text": "loadInventory(size, data) {\n this.inventory = new Inventory(this.game, size);\n this.inventory.load(data);\n }", "title": "" }, { "docid": "d63e73e539d3b41f6bbddcc5e35c67f8", "score": "0.5864802", "text": "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif(err) {\n\t\t\tthrow err\n\t\t};\n\t\tfor (var i =0; i < res.length; i++) {\n\t\t\tconsole.log(\"SKU: \" + res[i].item_id + \" | Product: \" + res[i].product_name \n\t\t\t\t+ \" | Price: \" + \"$\" + res[i].price + \" | Inventory: \" + res[i].stock_quantity)\n\t\t}\n\t\t// connection.end();\n\t\trunQuery();\n\t});\n}", "title": "" }, { "docid": "0b429fe85d24b733589372436c291f83", "score": "0.5848036", "text": "function getAll() {\n return inventory;\n }", "title": "" }, { "docid": "233e638fe6514a506c4d060c9480845d", "score": "0.5843123", "text": "function viewLowInventory(){\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products WHERE Stock_Qty < 20;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n managerAsk();\n });\n }", "title": "" }, { "docid": "d8bb288bed6868a620dcb0668a9efb75", "score": "0.58390915", "text": "function viewProd(item){\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products WHERE ?;\", \n \t{ item_id: item }, function(err, res){\n\t if(err) throw err;\n\t // console.log(res);\n\t\tvar aligns = [null, null, null, 'right', 'right'];\n // instantiate \n var tableInventory = new Table({\n \thead: ['Item ID', 'Product Name', 'Department', 'Price', 'Quantity']\n , colWidths: [10, 48, 18, 10, 10]\n , colAligns: aligns\n });\n\n\t// the tableInventory is an Array, so you can `push`, `unshift`, `splice` and the rest \n\ttableInventory.push(\n\t [res[0].item_id, res[0].product_name, res[0].department_name, res[0].price.toFixed(2), res[0].stock_quantity] // .toFixed(2) forces trailing zeros in prices\n\t); \n console.log(tableInventory.toString());\n\n // adding space after rendered table\n console.log(oneLine);\n // return original inquirer list for manager's choice\n startMeUp();\n });\n}", "title": "" }, { "docid": "4fcc898c64114aa2355761285b4554fb", "score": "0.583697", "text": "function viewLowInventory() {\n connection.query(\"SELECT * FROM products\", function(error, results) {\n if (error) throw error;\n console.log(\"LOW INVENTORY:\");\n for (var i = 0; i < results.length; i++) {\n if (results[i].stock_quantity < 5) {\n console.log(results[i].id + ' | ' + results[i].product_name + ' | ' + '$'+results[i].price + ' | ' + results[i].stock_quantity);\n }\n }\n });\n connection.end();\n}", "title": "" }, { "docid": "035c93533956f17167de69f5c8ed1ae2", "score": "0.58326405", "text": "function viewLowInventory(){\n\tvar query = \"SELECT * FROM products WHERE stock_quantity <= 5\";\n\tconnection.query(query, function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log(\"INVENTORY RUNNING LOW!!!!\");\n\t\tfor(i=0; i< res.length; i++){\n\t\t\tconsole.log(\"---|| ID \"+ res[i].item_id+\" ---|| NAME: \"+ res[i].product_name+\" ---|| QUANTITY \" + res[i].stock_quantity);\n\t\t};\n\t\taskAction();\n\t})\n\n}", "title": "" }, { "docid": "72d0c50c1f4d54c5e2f820708b03675b", "score": "0.58160675", "text": "function viewLowInventory() {\n connection.query(\"SELECT item_id, product_name, price, department_name, stock_quantity FROM products\", function (err, res) {\n if (err) throw err;\n\n console.log(\"Following items are low in stock:\")\n var lowInventoryFound = false;\n for (var i = 0; i < res.length; i++) {\n if (parseInt(res[i].stock_quantity) < 5) {\n lowInventoryFound = true;\n console.log(\"==============================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n }\n if (!lowInventoryFound) {\n console.log(\"You do not have any items on low inventory\");\n }\n });\n displayChoices();\n}", "title": "" }, { "docid": "9fe3d156ede721bbcf9c6b1ecf00501e", "score": "0.58155197", "text": "_listProduct() {\r\n //Limpia el texto cada vez que se sobrescribe\r\n this._text = \"\";\r\n for (let i = 0; i < this._inventory.length; i++) {\r\n //console.log(this._inventory[i].toString());\r\n this._text += this._inventory[i].toString() + \"<br>\";\r\n };\r\n }", "title": "" }, { "docid": "cae743b8028daff614acdafd1ee28a7e", "score": "0.58125883", "text": "function itemInventoryTable() { }", "title": "" }, { "docid": "d68d273d0839e81dfdd5aa0415a5d42b", "score": "0.58102065", "text": "function displayInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price);\n }\n console.log(\"-----------------------------------\");\n startQuestions();\n });\n \n}", "title": "" }, { "docid": "d1baf3f4493ca2757b39d69a2dd83e30", "score": "0.5805629", "text": "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "title": "" }, { "docid": "7f7652427842c364d935a627839d6522", "score": "0.5805356", "text": "function storageSelect(price) {\n const storagePriceShow = document.getElementById('storage-price');\n storagePriceShow.innerText = price;\n priceManagement();\n}", "title": "" }, { "docid": "43a2adc6c0eb68fac4486f305c9f48e0", "score": "0.5800566", "text": "function displayItems() {\n connection.query(\"SELECT * FROM PRODUCTS\", function(error, data) {\n if (error) throw error;\n data.forEach(item => {\n if (item.stock > 0) {\n console.log(\n `######################\nItem ID: ${item.item_id}\nProduct: ${item.prod_name}\nDepartment: ${item.dept_name}\nPrice: ${item.price}\nItems Available: ${item.stock}\n######################\\n`\n );\n }\n });\n userProdID = getProdID(data);\n });\n}", "title": "" }, { "docid": "b23165868968deee68a2bdd43f289d30", "score": "0.5798063", "text": "function showItems() {\n connection.query( query , function (err, result, fields){\n if (err) throw err;\n for(i = 0; i < result.length; i++){\n console.log(\"\\n\" + colors.green(result[i].id) + \") \" + \"Item: \".yellow + result[i].product_name + \" |\".blue + \" Department: \".yellow + result[i].department + \" |\".blue + \" Price: \".yellow + \"$\"+ result[i].price + \" |\".blue + \" Stock: \".yellow + result[i].stock_qty + \"\\n------------------------------------\".blue);\n }\n })\n}", "title": "" }, { "docid": "48aa03ee325777f4561980807baa80b7", "score": "0.5796278", "text": "function viewInventory() {\n var query = \"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\";\n connection.query(query, function (err, res) {\n var t = new Table();\n t.push(\n [\"ID\", \" Name\", \"Price\", \"In Stock\"]\n );\n for (var i = 0; i < res.length; i++) {\n t.push(\n [res[i].item_id, res[i].product_name, \"$\" + res[i].price.toFixed(2), res[i].stock_quantity]\n );\n }\n\n console.log(\" Current Inventory\");\n console.log(\"\" + t);\n console.log(lineBreak);\n })\n}", "title": "" }, { "docid": "49908ff940aac357b5bf2927b1f83639", "score": "0.5793413", "text": "function listinventory() {\n\n //Variables from my DataBase\n \n connection.query(\"SELECT * FROM products\", function(err,res) {\n for (var i = 0; i < res.lenght; i++) {\n\n var itemId = res[i].item_id,\n productName = res[i].product_name,\n departmentName = res[i].department_name,\n price = res[i].price,\n stockQuantity = res[i].stock_quantity;\n\n table.push(\n [itemId, productName, departmentName, price, stockQuantity]\n );\n }\n console.log(\"\");\n console.log(\"============================ Zohars Bamazon inventory =================\");\n console.log(\"\");\n console.log(table.toString());\n console.log(\"\");\n continuePrompt();\n });\n\n \n }", "title": "" }, { "docid": "6c825ebe1d3fee9e208e2930b848810a", "score": "0.5791916", "text": "function viewLowInventory(){\n // query products table and return ids of products\n // with stock lower than 5 \n connection.query('SELECT * FROM products WHERE stock_quantity<=5',function(err,results){\n if(err) throw err;\n resultsToTable(results);\n });\n\n connection.end();\n\n}", "title": "" }, { "docid": "0a7441f0ef327209bc9cfb9757a9d365", "score": "0.5786984", "text": "function displayItems() {\n\n\tconnection.query(\"SELECT * from products\", function(err, res) {\n\t\tif (err) throw err;\n\t\t\n\t\tconsole.log(\"\\n\");\n\t\tconsole.table(res);\n\t\t\n\t\t//This is a recursive call. Using here by intention assuming this code will not be invoked again and again. Other options could've \n\t\t//been used which avoid recursion.\n\t\tdisplayMgrOptions();\n\t});\n}", "title": "" }, { "docid": "456b4ca7f65b5469e3477a412f4850a4", "score": "0.57837766", "text": "function displayItems()\n{\n\t//Select All from (products) table within (bamazon) DB\n\tconnection.query(\"SELECT * FROM products\", function(err, res)\n\t{\n\n\t\tif(err) throw err;\n\n\t\t//Display all products in table by looping through each row inside table\n\t\tfor(var i = 0; i < res.length; i++)\n\t\t{\n\t\t\tconsole.log(\"ID: \" + res[i].item_id + \" | \" +\n\t\t\t\t\t\t\"Product Name: \" + res[i].product_name + \" | \" +\n\t\t\t\t\t\t\"Category: \" + res[i].department_name + \" | \" +\n\t\t\t\t\t\t\"Price: \" + res[i].price );\n\t\t}\n\n\t\tconsole.log(\"-----------------------------------------------------------------\\n\");\n\n\t\t//Allow Customer to make purchase\n\t\tbuy();\n\n\t});\n}", "title": "" }, { "docid": "1f373fe6a7ddf423f7c0e1c2db97f234", "score": "0.5778922", "text": "function viewProducts(){\n\n\tvar query = \"SELECT * FROM products\";\n\n\tconnection.query(query, function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log(\"ALL INVENTORY IN PRODUCTS TABLE\");\n\t\tfor(i=0; i< res.length; i++){\n\t\t\tconsole.log(\"---|| ID \"+ res[i].item_id+\" ---|| NAME: \"+ res[i].product_name+\" ---|| PRICE: $\"+ res[i].price + \" ---|| QUANTITY \" + res[i].stock_quantity);\n\t\t};\n\t\taskAction();\n\t})\n\n}", "title": "" }, { "docid": "12895de4008c1acb002bb66f75c34934", "score": "0.5770149", "text": "function displayInventory(hero){\n let heroInventory = document.getElementById(\"heroInventory\");\n heroInventory.innerHTML = \"Hero's inventory is \" + hero.inventory;\n hero.inventory.forEach(function(entry){ \n let newWeaponType = document.createElement(\"weaponType\");\n let newWeaponTypeContent = document.createTextNode(\"new weapon\");\n newWeaponType.appendChild(newWeaponTypeContent);\n let newWeaponDamage = document.createElement(\"weaponDamage\");\n let newWeponDamageValue = document.createTextNode(\"new weapon damage\");\n newWeaponDamage.appendChild(newWeponDamageValue);\n });\n // console.log(hero.inventory);\n}", "title": "" }, { "docid": "1fb5e2e64be34211c1690ba1c2552a50", "score": "0.5762745", "text": "function itemDisplay() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n //Obligatory welcome message\n console.log(\"-------------------------------------------------------\")\n console.log(\"Welcome to Bamazon! The originally-named, totally unique online store!\")\n //Loop through each item in the products table\n for (var i = 0; i < res.length; i++) {\n console.log(\"-------------------------------------------------------\")\n console.log(\"Product name: \" + res[i].product_name);\n console.log(\"Department: \" + res[i].department_name);\n console.log(\"Price: $\" + res[i].price);\n console.log(\"Product ID: \" + res[i].item_id);\n if (res[i].stock_quantity < 10) {\n console.log(\"Less than 10 remaining!\")\n }\n }\n\n selectItem();\n });\n}", "title": "" }, { "docid": "7c80d682c53cc58f7ab1392293b12294", "score": "0.5762101", "text": "function viewLowInventory() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\t// console.log(res)\n\t\tif(err) {\n\t\t\tthrow err\n\t\t};\n\t\t\n\t\tvar enoughStocked = true;\n\n\t\tfor (var j = 0; j < res.length; j++) {\n\t\t\tif (res[j].stock_quantity < 5) {\n\t\t\t\tenoughStocked = false\n\t\t\t\tconsole.log(\"SKU: \" + res[j].item_id + \" | Product: \" + res[j].product_name \n\t\t\t\t+ \" | Inventory: \" + res[j].stock_quantity)\n\t\t\t} \n\t\t};\n\n\t\tif (enoughStocked === true){\n\t\t\tconsole.log(\"All products have sufficient stock.\")\n\t\t}\n \t// connection.end();\n \trunQuery();\n\t});\n}", "title": "" }, { "docid": "0f8475ebb95db3aea22f20846d77335e", "score": "0.5758845", "text": "function display () {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.log(\"Welcome to Bamazon! Here's what we have for sale:\")\n // for loop to loop through each item in the sql file for display\n for (var i=0; i < res.length; i++) {\n console.log(\"Item ID: \" + res[i].id + ' ' + res[i].product_name + ' $' + res[i].price);\n }\n purchase();\n })\n}", "title": "" }, { "docid": "a80704895d33eb11fd7de3374c240430", "score": "0.5758774", "text": "function displayStock() {\n\n connection.query(\"SELECT * FROM products\", function (err, res) {\n table(res);\n });\n}", "title": "" }, { "docid": "a25d32f89869684832fe9f86ef050511", "score": "0.5756428", "text": "function viewInventory(){\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function(err, res){\n if (err) throw err;\n for (var i = 0; i < res.length; i++){\n table.push(\n [\n res[i].item_id,\n res[i].product_name,\n res[i].department_name,\n res[i].price,\n res[i].stock_quantity\n ]);\n }\n console.log(table.toString());\n start(); \n })\n }", "title": "" }, { "docid": "ab5abf5348e13980b9809f8797adccf8", "score": "0.57533455", "text": "function viewLowInventory() {\n connection.query(\"SELECT * FROM bamazon.products WHERE stock_quantity < 5\", function (err, res) {\n if (err) throw err;\n console.log(`\\n`)\n for (let i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].item_id + \" ---- Product: \" + res[i].product_name + \" ---- Price: $\" + res[i].price + \" ---- Quantity: \" + res[i].stock_quantity)\n }\n })\n start();\n}", "title": "" }, { "docid": "17f0312d8757b4e785b1d68e0147768f", "score": "0.5751177", "text": "static Inventory(name, inv) {\n\n let invString = \"\";\n\n\n const capitalizeFirst = (word) => word.charAt(0).toUpperCase() + word.slice(1);\n\n for(let item in inv) {\n\n let quantity = (inv[item]);\n\n invString += `**${capitalizeFirst(item)} amount:** ${quantity}\\n`;\n\n }\n\n\n\n return new Discord.RichEmbed()\n .setColor(colors.TEAL)\n .addField(`${name}'s Updated Items:`, invString);\n\n\n }", "title": "" } ]
68d6fba0c417db266fc0ff91f93f079c
====================================================================== // Functions ====================================================================== // 1. Create a dummy `span` element using the ame text as the selected (current) option. 2. Append it to the body to get its width, then remove it. 3. Resize the original select.
[ { "docid": "c6a03d2373b06b673b5c7ccfaf5d02e2", "score": "0.7685285", "text": "function resizeIt( $select ) {\n /* [1] */\n var text = $select.find('option:selected').text();\n var className = (params.classes) ? ' class=\"'+params.classes+'\"' : '';\n var $dummyOption = $('<span'+className+'>').html(text);\n\n /* [2] */\n $dummyOption.appendTo('body');\n var width = $dummyOption.width();\n $dummyOption.remove();\n\n /* [3] */\n $select.width(width + params.iconWidth);\n }", "title": "" } ]
[ { "docid": "bf5be577cfd144bfb76941abb5147532", "score": "0.6707233", "text": "function tightenSelectWidth() {\n var text = this.options[this.options.selectedIndex].text;\n\n var width = estimateTextWidth(text,\n getComputedProperty(this, 'font-weight'),\n getComputedProperty(this, 'font-size'),\n getComputedProperty(this, 'font-family')\n );\n\n this.style.width = width + profile.selectPadding + 'px';\n}", "title": "" }, { "docid": "e4441f93dc8ad94a68b7171b233b7518", "score": "0.6602679", "text": "function truncateSelect(formName) {\n\t\n\t $(formName).parent().removeClass('overflow');\n\t\n\t var formWidth = $(formName).parent().width() - 50;\n\t var selOpt = $(formName).find(\"option:selected\");\n\t var spanWrap = $('<span>').addClass('overflow').text(selOpt.text());\n\t\n\t spanWrap.css({\n\t 'font-family': selOpt.css('font-family'),\n\t 'font-style': selOpt.css('font-style'),\n\t 'font-weight': selOpt.css('font-weight'),\n\t 'font-size': selOpt.css('font-size')\n\t });\n\t\n\t $('body').append(spanWrap);\n\t \n\t var optionWidth = spanWrap.width();\n\t\n\t if(optionWidth > formWidth) {\n\t\n\t $(formName).parent().addClass('overflow');\n\t \n\t }\n\t\n\t spanWrap.remove();\n\t }", "title": "" }, { "docid": "7185fa8976d46335f0bea6274dd2bdb7", "score": "0.6403282", "text": "function changeFontSize(select, s) {\n var span = document.createElement('span');\n span.innerHTML = select.toString();\n span.style.fontSize = s + \"px\";\n var range = select.getRangeAt(0);\n range.deleteContents();\n range.insertNode(span);\n}", "title": "" }, { "docid": "8aa3d877a8ef5978284632cea094d973", "score": "0.61716855", "text": "async _adjustScaleWidth() {\n const { items, l10n } = this;\n\n const predefinedValuesPromise = Promise.all([\n l10n.get(\"page_scale_auto\", null, \"Automatic Zoom\"),\n l10n.get(\"page_scale_actual\", null, \"Actual Size\"),\n l10n.get(\"page_scale_fit\", null, \"Page Fit\"),\n l10n.get(\"page_scale_width\", null, \"Page Width\"),\n ]);\n\n // The temporary canvas is used to measure text length in the DOM.\n let canvas = document.createElement(\"canvas\");\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"MOZCENTRAL || GENERIC\")\n ) {\n canvas.mozOpaque = true;\n }\n let ctx = canvas.getContext(\"2d\", { alpha: false });\n\n await animationStarted;\n const { fontSize, fontFamily } = getComputedStyle(items.scaleSelect);\n ctx.font = `${fontSize} ${fontFamily}`;\n\n let maxWidth = 0;\n for (const predefinedValue of await predefinedValuesPromise) {\n const { width } = ctx.measureText(predefinedValue);\n if (width > maxWidth) {\n maxWidth = width;\n }\n }\n const overflow = SCALE_SELECT_WIDTH - SCALE_SELECT_CONTAINER_WIDTH;\n maxWidth += 2 * overflow;\n\n if (maxWidth > SCALE_SELECT_CONTAINER_WIDTH) {\n items.scaleSelect.style.width = `${maxWidth + overflow}px`;\n items.scaleSelectContainer.style.width = `${maxWidth}px`;\n }\n // Zeroing the width and height cause Firefox to release graphics resources\n // immediately, which can greatly reduce memory consumption.\n canvas.width = 0;\n canvas.height = 0;\n canvas = ctx = null;\n }", "title": "" }, { "docid": "7896156016b3b52a0568750053378062", "score": "0.602353", "text": "function updateSelectLength(elem){\n var widthSel, widthOpt;\n widthSel = $(elem).outerWidth();\n\n // // Calcolo la larghezza del div figlio di .like_select\n // widthSel = $(elem).find('div').width();\n // // Calcolo la larghezza del div.option_container, aggiungendo 10 per via del padding \n // widthOpt = $(elem).find('.option_container').width()+10;\n // // Se la larghezza del contenitore esterno è maggiore di quella delle option aggiorno l'option_container e ristemo il genitore \n // if(widthSel > widthOpt){\n \n // // Imposto la larghezza dell'option container secondo quella del div figlio di .like_select\n // $(elem)\n // .find('.option_container')\n // .css('width', widthSel)\n // .attr('data-first-load-width', widthSel);\n\n // // Ricalcolo la dimensione dell'option_container, sempre aggiungendo 10 per il padding\n // widthOpt = $(elem).find('.option_container').width()+10;\n // // Se la nuova dimensione di option_container è maggiore di quella del div figlio di .like_select\n // // (Ovvero se le opzioni \"sbordano\")\n // // Aggiorno nuovamente la larghezza del div .like_select sulla base della nuova larghezza di option_container\n // if(widthSel < widthOpt){\n // // $(elem)\n // // .css('width', widthOpt)\n // // .attr('data-first-load-width', widthOpt);\n // }\n // }\n // // Se altrimenti il contenitore delle option è più largo in partenza aggiorno il genitore\n // else {\n \n // // imposto la larghezza di .like_select sulla base di quella di option_container, \n // // aggiungendo 14 per via del div per l'apertura\n // // $(elem)\n // // .css('width', widthOpt+14)\n // // .attr('data-first-load-width', widthOpt+14);\n // // Poi aggiorno la dimensione dell'option_container, aggiungendo i 4px che mi permettono di allinearla al div figlio di .like_select\n // $(elem)\n // .find('.option_container')\n // .css('width', widthOpt+4)\n // .attr('data-first-load-width', widthOpt+4);\n // }\n // Riporto la position di option_container ad absolute per rendere corretto il posizionamento all'apertura\n \n if ( $(elem).find('.option_container').hasClass('up') ) {\n var height;\n height = $(elem).find('.option_container').height()+6;\n $(elem).find('.option_container').attr('data-toggle-top', height);\n }\n\n if($(elem).attr('id') === 'span_ee_select'){\n var widthEE, optEE;\n widthEE = $('#span_ee_select').find('div').width();\n optEE = $('#span_ee_select').find('.option_container').width();\n\n // $('#span_ee_select-add')\n // .css('width', widthEE)\n // .attr('data-first-load-width', widthEE);\n $('#span_ee_select-add')\n .addClass('widthChanged')\n .find('.option_container')\n .removeAttr('style')\n .css('width', optEE)\n .attr('data-first-load-width', optEE);\n }\n if($(elem).attr('id') === 'span_dd_select'){\n var widthPP, optPP;\n if ($('#imgd_link').hasClass('current_mode')) {\n var optCont = $('#span_dd_select').find('.option_container');\n optCont.css({\n 'width': 'auto',\n 'position': 'relative',\n 'visibility': 'hidden',\n 'display': 'block'\n });\n \n widthPP = $('#span_dd_select').find('div').width() * 1.5 - 5;\n optPP = $('#span_dd_select').find('.option_container').width() * 1.5;\n widthSel = optCont.width()*1.2;\n } else {\n widthPP = $('#span_pp_select').find('div').width() * 1.5 - 5;\n optPP = $('#span_pp_select').find('.option_container').width() * 1.5; \n }\n $('#span_dd_select')\n .addClass('widthChanged')\n .find('.option_container')\n .removeAttr('style')\n .css('width', widthSel)\n .attr('data-first-load-width', widthSel);\n\n if ( optionTooltipInPages ) {\n if ( $(elem).find('.option_tooltip_dd').length > 0 ){\n $(elem).find('.option_tooltip_dd').css({\n 'left': widthSel+1,\n 'min-width': widthSel\n });\n }\n }\n }\n if( $(elem).attr('id') === 'span_tt_select' ) { \n if ( optionTooltipInPages ) {\n if ( $('#span_pp_select').find('.option_tooltip').length > 0 ){\n $('#span_pp_select').find('.option_tooltip').css({\n 'min-width': widthSel-50\n });\n }\n }\n }\n if( $(elem).attr('id') === 'span_pp_select' ) {\n if ( optionTooltipInPages ) {\n if ( $(elem).find('.option_tooltip').length > 0 ){\n $(elem).find('.option_tooltip').css({\n 'left': widthSel+1\n });\n }\n }\n }\n if( $(elem).attr('id') === 'span_list_select-add' ) {\n widthSel = $('#span_list_select').find('.option_container').width()+10;\n }\n\n $(elem).find('.option_container').css({\n \"width\": widthSel-10,\n \"position\": \"absolute\",\n \"visibility\": \"visible\",\n \"display\": \"none\"\n });\n}", "title": "" }, { "docid": "c6e99618b81a438387479c5e9b47549b", "score": "0.5820449", "text": "function resetSelectedText(initialSize, newSize, start, end, shift)\n{\n\tvar carretOffset = initialSize - newSize;\n\tvar expression = $(\"#expression\");\n\n\t// put caret at right position again\n\texpression.get(0).selectionStart = start + shift;\n\texpression.get(0).selectionEnd = end - carretOffset;\n}", "title": "" }, { "docid": "92ece8e4845b7b00924c6196a9d822c9", "score": "0.5809113", "text": "function transform_firstSelect(selectContainer) {\r\n var result = \"\",\r\n realselect = $(selectContainer).find(\"select\"),\r\n options = realselect.find(\"option\").length,\r\n divide = \"\",\r\n inputfocus = false,\r\n i = 0;\r\n\r\n divide = Math.floor(options / 5);\r\n\r\n //read select values, write and add to container\r\n $(selectContainer).find(\"select option\").each(function() {\r\n var text = ($(this).text());\r\n var value = ($(this).val());\r\n\r\n if (i == 0) {\r\n result += \"<div>\";\r\n }\r\n\r\n result += \"<span rel='\" + value + \"' text='\" + text + \"'>\" + text + \"</span>\";\r\n i++;\r\n\r\n if (i == divide + 1) {\r\n result += \"</div>\";\r\n i = 0;\r\n }\r\n });\r\n\r\n $(selectContainer).append(\"<div class='inner-container'>\" + result + \"</div>\");\r\n $(selectContainer).find(\"input\").val(realselect.find(\"option[selected]\").text());\r\n\r\n //base events\r\n $(selectContainer).find(\"input\").focus(function() {\r\n inputfocus = true;\r\n })\r\n\r\n $(selectContainer).find(\"input\").blur(function() {\r\n inputfocus = false;\r\n })\r\n\r\n $(selectContainer).click(function() {\r\n $(this).find(\".inner-container\").show();\r\n })\r\n\r\n $(selectContainer).find(\".inner-container\").mouseleave(function() {\r\n if (!inputfocus) {\r\n if ($(this).parent().find(\"input\").val() == \"\") {\r\n $(this).parent().find(\"input\").val(realselect.find(\"option:eq(0)\").text());\r\n realselect.val(realselect.find(\"option:eq(0)\").val());\r\n realselect.change();\r\n }\r\n $(this).hide();\r\n }\r\n })\r\n\r\n $(selectContainer).find(\".inner-container span\").live('click', function() {\r\n\r\n $(selectContainer).find(\"input\").val($(this).text()).addClass(\"focus\");\r\n realselect.val($(this).attr(\"rel\"));\r\n realselect.change();\r\n $(this).parent().parent().css(\"display\", \"none\");\r\n\r\n })\r\n}", "title": "" }, { "docid": "3bb0615c60dc9ed328542a67ab9c0ca3", "score": "0.5669489", "text": "function addFirstSelect() {\r\n\tvar currentLevel = 0;\r\n\tvar a = createDropdown(this.data, 0, \"Size\");\r\n\tworkspace.appendChild(a);\r\n moveDown(0);\r\n}", "title": "" }, { "docid": "6a7964abd0b85015d83cc2082bb4e9f6", "score": "0.5655632", "text": "function selectSize(){\n var e = document.getElementById(\"size\");\n var applyfontsize = e.options[e.selectedIndex].value;\n document.getElementById(\"displayarea\").style.fontSize = applyfontsize;\n}", "title": "" }, { "docid": "a58865f4517b010a0be15eed27aff1a0", "score": "0.5623897", "text": "function replaceSelect(oldElement , newValue){\n let newElement = document.createElement('h1');\n newElement.textContent = newValue;\n oldElement.replaceWith(newElement);\n }", "title": "" }, { "docid": "8500fbbe39c0a96df92b4376a5c52efe", "score": "0.55592865", "text": "selectFake() {\n const isRTL = document.documentElement.getAttribute('dir') == 'rtl';\n\n this.removeFake();\n\n this.fakeHandlerCallback = () => this.removeFake();\n this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;\n\n this.fakeElem = document.createElement('textarea');\n // Prevent zooming on iOS\n this.fakeElem.style.fontSize = '12pt';\n // Reset box model\n this.fakeElem.style.border = '0';\n this.fakeElem.style.padding = '0';\n this.fakeElem.style.margin = '0';\n // Move element out of screen horizontally\n this.fakeElem.style.position = 'absolute';\n this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';\n // Move element to the same position vertically\n let yPosition = window.pageYOffset || document.documentElement.scrollTop;\n this.fakeElem.style.top = `${yPosition}px`;\n\n this.fakeElem.setAttribute('readonly', '');\n this.fakeElem.value = this.text;\n\n this.container.appendChild(this.fakeElem);\n\n this.selectedText = select(this.fakeElem);\n this.copyText();\n }", "title": "" }, { "docid": "81416c3e0b7ff90e167e476e7999af84", "score": "0.5541746", "text": "handleSelect(){\n let select = document.getElementsByTagName(\"select\")[0];\n let spans = document.getElementsByTagName(\"span\");\n for(let i = 0; i < spans.length; i += 2){\n if(spans[i].innerText === select.value + \":\"){\n if(spans[i].parentElement.classList.contains(\"highlight\")){\n spans[i].parentElement.classList.remove(\"highlight\");\n } else {\n spans[i].parentElement.classList.add(\"highlight\");\n }\n }\n }\n select.selectedIndex = 0;\n }", "title": "" }, { "docid": "ccea7bc6aa2a91b3a27311c7fb16f78d", "score": "0.5505147", "text": "function insertSpanAfterSelection(clicks) {\n var html = \"<span class='dummy'><span>\";\n if (numClicks !== clicks) return;\n var isIE = (navigator.appName === \"Microsoft Internet Explorer\");\n var sel, range, expandedSelRange, node;\n var position;\n var scrollTop = $(window).scrollTop();\n\n if (window.getSelection) {\n sel = window.getSelection();\n selText = sel.toString();\n\n if ($.trim(selText) === '' || selText.split(' ').length < settings.minWords) {\n return;\n }\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = window.getSelection().getRangeAt(0);\n\n var bounding = range.getBoundingClientRect();\n var offset = $target.offsetParent().offset();\n\n position = {\n top: bounding.top + scrollTop,\n bottom: bounding.bottom + scrollTop,\n left: (bounding.left + bounding.right) / 2\n };\n\n if (numClicks !== clicks) return;\n hide();\n }\n } else if (document.selection && document.selection.createRange) {\n range = document.selection.createRange();\n expandedSelRange = range.duplicate();\n\n selText = expandedSelRange.text;\n if ($.trim(selText) === '' || selText.split(' ').length < settings.minWords) return;\n\n range.collapse(false);\n range.pasteHTML(html);\n\n expandedSelRange.setEndPoint(\"EndToEnd\", range);\n expandedSelRange.select();\n position = $(\".dummy\").offset();\n $(\".dummy\").remove();\n }\n\n move(position, scrollTop);\n\n $(settings.selector).css(\"left\", position.left + \"px\");\n show();\n settings.complete({\n selection: selText,\n $element: $(window.getSelection ? window.getSelection().anchorNode.parentElement : \"\")\n });\n }", "title": "" }, { "docid": "59d7590de1da9f174d1f880afd7300c6", "score": "0.54918754", "text": "function wrapSelection() {\n tinyMCE.selection.setContent(`<span lang=\"${lang}\">${selectedContentHtml}</span>`);\n resetSelectBox();\n console.log(\"Wrapped selected content in new HTML node with language attribute.\");\n }", "title": "" }, { "docid": "b31bcecf057b0a5f1996b086a354c965", "score": "0.5477708", "text": "function removeSelectDefault() {\n selectBox = document.getElementById(\"size\");\n selectBox.selectedIndex = -1;\n selectBox.style.boxShadow = \"none\";\n}", "title": "" }, { "docid": "e04a794312454eadb67b41662c01777a", "score": "0.5412866", "text": "_applyOptions() {\n if (this.options.placeholderImg) {\n this.dropdownElement\n .querySelector(\".pretty-dropdown__selected-image\")\n .querySelector(\"img\").src = this.options.placeholderImg;\n }\n\n if (this.options.disabled) {\n this.dropdownElement.classList.add(\"pretty-dropdown__disabled\");\n }\n\n if (this.options.placeholder) {\n this.dropdownElement.querySelector(\".pretty-dropdown__selected-description\").innerText = this.options.placeholder;\n this.dropdownElement.querySelector(\".pretty-dropdown__selected-display-value\").innerText = null;\n var valueInput = document.getElementById(\"pretty-dropdown__value\")\n valueInput.setAttribute(\"value\", \"\");\n \n var inputEvent = new Event(\"input\");\n valueInput.dispatchEvent(inputEvent);\n }\n\n // Add elements with certain IDs to the pretty-dropdown__options-wrapper\n if (this.options.addonIds) {\n this.options.addonIds.forEach(id => {\n var element = document.getElementById(id);\n if (element) {\n this.dropdownElement.querySelector(\".pretty-dropdown__options-wrapper\").appendChild(element);\n }\n });\n }\n }", "title": "" }, { "docid": "f32ef3cd74aba2034d81d17c469f6127", "score": "0.53800637", "text": "function handleSelectOptionsLength(event) {\n widthCodeSelector = parseFloat(event.target.value)\n resetAllVars()\n createGameBoard(codeSelectorPosition, userCodePosition)\n }", "title": "" }, { "docid": "5b48dec9f7b2fb4f521bdb37fdb3597f", "score": "0.53689444", "text": "unselect() {\n this.setScale( this.scaleX - 0.2 );\n this.helpText.destroy();\n }", "title": "" }, { "docid": "362a8e5262fb41b5847a4d1cbd785ac5", "score": "0.53621805", "text": "setupSelect() {\n let select = this._myInstance.getElementsByTagName(\"select\")[0];\n let template = document.querySelector('#options');\n let clone = document.importNode(template.content, true);\n select.appendChild(clone);\n let option1 = select.getElementsByTagName(\"option\")[0];\n option1.value = option1.textContent = \"clear\";\n\n clone = document.importNode(template.content, true);\n select.appendChild(clone);\n let option2 = select.getElementsByTagName(\"option\")[1];\n option2.value = option2.textContent = \"get last messages\";\n\n clone = document.importNode(template.content, true);\n select.appendChild(clone);\n let option3 = select.getElementsByTagName(\"option\")[2];\n option3.value = option3.textContent = \"select new nick\";\n\n select.options[0].selected = true;\n select.addEventListener(\"change\", this.chatReconfig.bind(this));\n }", "title": "" }, { "docid": "861f762a2336cd02389d92ed048bc24b", "score": "0.536086", "text": "setupSelect() {\n let select = this._myInstance.getElementsByTagName(\"select\")[0];\n let template = document.querySelector(\"#options\");\n for (let i = 0; i < 3; i += 1) {\n let clone = document.importNode(template.content, true);\n select.appendChild(clone);\n let option = select.getElementsByTagName(\"option\")[i];\n let val = i + 2;\n option.value = option.textContent = \" 4 * \" + val;\n }\n select.options[2].selected = true;\n select.addEventListener(\"change\", this.memoryGridReconfig.bind(this));\n }", "title": "" }, { "docid": "44ecd4b8be75138eb156beef7198e49f", "score": "0.53556806", "text": "function selectionTooLarge()\n{\n\talert('Выбранная область слишком велика!');\n\t\n\t$('divPrice').innerHTML='';\n\t$('coordinates').value='';\n\t$('txtArea').innerHTML='Too large';\n\t$('txtPrice').value='';\n\t$('divMessage').innerHTML='Your selected area is too large';\n\t/*\n\tif(SHOW_LAT_LNG)\n\t{\n\t\t$('SW-lat').innerHTML= ''; \n\t\t$('SW-lng').innerHTML= '';\n\t\t\n\t\t$('NE-lat').innerHTML= ''; \n\t\t$('NE-lng').innerHTML= '';\n\t}\n\t\n\t$('aoi-total').innerHTML= '-';\n\t$('aoi-total').className='';\n\n\tfor(i=0;i < AOI.length;++i)\n\t{\n\t\t$('aoi-option-'+i).className='rowOption free-trial-' + AOI[i]['has_free_trial'];\n\n\t\t$('aoi-amount-'+i).innerHTML='-';\n\t\t$('aoi-calc-'+i).innerHTML='-';\n\t}\n\n\t$('aoi-too-big').className='selected';\n\t*/\n\t\n}", "title": "" }, { "docid": "5dc7475b40b852e2c3ced1df8cc3e3e4", "score": "0.5355579", "text": "function update_select() {\n select = selector.options[selector.selectedIndex].innerHTML;\n}", "title": "" }, { "docid": "e302181ab2a33aadaa9ccaaf58fc5340", "score": "0.5344507", "text": "function swifty_fitTextElement( el, sel ) {\n try {\n if( el ) {\n var r = el.getBoundingClientRect();\n var fs = parseInt( swifty_getStyle( el, 'font-size' ), 10 );\n while( fs > 10 && r.height > 1.5 * swifty_getLineHeight( el ) ) {\n fs--;\n // The style below will override the style defined in the swifty stylesheet.\n // It can not be done via inline style on the text, because of a bug in chrome.\n swifty_addStylesheet( sel + ' { font-size:' + fs + 'px !important }' );\n r = el.getBoundingClientRect();\n }\n }\n } catch( e ) {}\n}", "title": "" }, { "docid": "4f85357a69c1326e1fd73bde9be7afdd", "score": "0.53225803", "text": "function selectSMGlaze () {\n document.getElementById(\"glaze_dropdown\").textContent = \"Sugar-milk glaze\";\n showDropdownContents();\n}", "title": "" }, { "docid": "502f93dd8214aee780116fc5b8ba9bcb", "score": "0.5318109", "text": "function fillSelect() {\n select = document.getElementById('SelectMarker');\n var opt = document.createElement('option');\n opt.value = markers.length\n opt.innerHTML = markers.length;\n select.appendChild(opt);\n}", "title": "" }, { "docid": "f52f5b40b562bfdba9b4cecaef55fffc", "score": "0.5316113", "text": "function insertSpanAfterSelection(clicks) {\n\n var html = \"<span class='dummy'><span>\";\n topOffset = 0;\n leftOffset = 0;\n\n if (numClicks !== clicks) return;\n if (numClicks === 3) return;\n\n var isIE = (navigator.appName === \"Microsoft Internet Explorer\");\n var sel, range, expandedSelRange, span, origHtml, text, startText, endText, node;\n var position;\n if (window.getSelection) {\n sel = window.getSelection();\n selText = sel.toString();\n\n if ($.trim(selText) === '' || selText.split(' ').length < settings.minWords) return;\n if (sel.anchorNode.parentElement != sel.extentNode.parentElement) return;\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = sel.getRangeAt(0);\n\n if (range.startOffset === 0 && range.endOffset === 0) {\n return;\n } else if(range.endOffset === 0) {\n return;\n }\n\n expandedSelRange = range.cloneRange();\n expandedSelRange.collapse(false);\n\n originalElement = $(range.startContainer.parentElement);\n span = '<span class=\"highlighted-section\">' + sel + '</span>';\n text = originalElement.text();\n origHtml = originalElement.html();\n startText = text.substring(0, range.startOffset);\n endText = text.substring(range.endOffset, text.length);\n\n // Range.createContextualFragment() would be useful here but is\n // non-standard and not supported in all browsers (IE9, for one)\n var el = document.createElement(\"div\");\n el.innerHTML = html;\n var dummy = document.createElement(\"span\");\n\n if (numClicks !== clicks) return;\n\n $(settings.selector).hide();\n if (!isIE && $.trim(selText) === $.trim(expandedSelRange.startContainer.innerText)) {\n expandedSelRange.startContainer.innerHTML += \"<span class='dummy'>&nbsp;</span>\";\n position = $(\".dummy\").offset();\n $(\".dummy\").remove();\n } else if (!isIE && $.trim(selText) === $.trim(expandedSelRange.endContainer.innerText)) {\n expandedSelRange.endContainer.innerHTML += \"<span class='dummy'>&nbsp;</span>\";\n position = $(\".dummy\").offset();\n $(\".dummy\").remove();\n } else {\n expandedSelRange.insertNode(dummy);\n position = $(dummy).offset();\n dummy.parentNode.removeChild(dummy);\n }\n }\n } else if (document.selection && document.selection.createRange) {\n range = document.selection.createRange();\n expandedSelRange = range.duplicate();\n\n selText = expandedSelRange.text;\n if ($.trim(selText) === '' || selText.split(' ').length < settings.minWords) return;\n\n range.collapse(false);\n range.pasteHTML(html);\n\n expandedSelRange.setEndPoint(\"EndToEnd\", range);\n expandedSelRange.select();\n position = $(\".dummy\").offset();\n $(\".dummy\").remove();\n }\n\n if (position.top === 0 && position.left === 0) return;\n\n originalElement.html(startText + span + endText);\n parentCommentContainer = $(expandedSelRange.commonAncestorContainer.offsetParent).closest('.commentable-section');\n $(settings.selector).css(\"top\", position.top + topOffset + \"px\");\n $(settings.selector).css(\"left\", position.left + leftOffset + \"px\");\n\n // These parameters can be whatever you'd like\n settings.complete(originalElement, origHtml, selText, parentCommentContainer);\n $(settings.selector).show();\n\n }", "title": "" }, { "docid": "f78df3cfae8e11f0cb01849939660a3b", "score": "0.53156", "text": "function selectToText(shortName, idStr) {\n $(\"div[id^='select_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(\"select_\", \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var id = $(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr).val();\n var term = $(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr+ \" option:selected\").text();\n var vocabtype = $(\"#\"+shortName+\"_\"+name+\"_vocabtype_\"+idStr).val();\n var minlength = $(\"#\"+shortName+\"_\"+name+\"_minlength_\"+idStr).val();\n\n var additionalStyle = \"\";\n var postText = \"\";\n if (vocabtype == \"name_component\") {\n additionalStyle = \"name-component-type\";\n postText = \" :\";\n }\n\n cont.html(\"<input type=\\\"hidden\\\" id=\\\"\"+shortName+\"_\"+name+\"_id_\"+idStr+\"\\\" \" +\n \"name=\\\"\"+shortName+\"_\"+name+\"_id_\"+idStr+\"\\\" value=\\\"\"+id+\"\\\"/>\" +\n \"<input type=\\\"hidden\\\" id=\\\"\"+shortName+\"_\"+name+\"_term_\"+idStr+\"\\\" \" +\n \"name=\\\"\"+shortName+\"_\"+name+\"_term_\"+idStr+\"\\\" value=\\\"\"+term+\"\\\"/>\" +\n \"<input type=\\\"hidden\\\" id=\\\"\"+shortName+\"_\"+name+\"_vocabtype_\"+idStr+\"\\\" \" +\n \"name=\\\"\"+shortName+\"_\"+name+\"_vocabtype_\"+idStr+\"\\\" value=\\\"\"+vocabtype+\"\\\"/>\" +\n \"<input type=\\\"hidden\\\" id=\\\"\"+shortName+\"_\"+name+\"_minlength_\"+idStr+\"\\\" \" +\n \"name=\\\"\"+shortName+\"_\"+name+\"_minlength_\"+idStr+\"\\\" value=\\\"\"+minlength+\"\\\"/>\" +\n \"<p class=\\\"form-control-static \"+additionalStyle+\"\\\">\"+term+postText+\"</p>\");\n\n }\n });\n}", "title": "" }, { "docid": "a3cee536453bbd6ffbcf638ccbbbca6c", "score": "0.5303372", "text": "function mdselect() {\n $('.mc-select').find('select.select').each(function() {\n var selected = $(this).find('option:selected').text();\n $(this)\n .css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})\n .after('<span class=\"select\">' + selected + '</span>' + '<i class=\"fa fa-angle-down\"></i>')\n .change(function(){\n var val = $('option:selected',this).text();\n $(this).next().text(val);\n });\n });\n }", "title": "" }, { "docid": "dbcce5ecc602ef42d62d67c655e0bfde", "score": "0.53020906", "text": "refreshSelection() {\n const newWidth = Math.abs(this.cursorInfo.currentX - this.cursorInfo.startX);\n const newHeight = Math.abs(this.cursorInfo.currentY - this.cursorInfo.startY);\n const newLeft = Math.min(this.cursorInfo.currentX, this.cursorInfo.startX);\n const newTop = Math.min(this.cursorInfo.currentY, this.cursorInfo.startY);\n\n this.selectionElement.style.width = `${newWidth}px`;\n this.selectionElement.style.height = `${newHeight}px`;\n this.selectionElement.style.left = `${newLeft}px`;\n this.selectionElement.style.top = `${newTop}px`;\n }", "title": "" }, { "docid": "6e0951d6b45180fbeeb22e0dcaf26b09", "score": "0.52970666", "text": "function selectFake(text) {\n var isRTL = document.documentElement.getAttribute('dir') == 'rtl';\n\n removeFake();\n\n fakeHandlerCallback = function fakeHandlerCallback() {\n return removeFake();\n };\n fakeHandler = document.body.addEventListener('click', fakeHandlerCallback) || true;\n\n fakeElem = document.createElement('textarea');\n // Prevent zooming on iOS\n fakeElem.style.fontSize = '12pt';\n // Reset box model\n fakeElem.style.border = '0';\n fakeElem.style.padding = '0';\n fakeElem.style.margin = '0';\n // Move element out of screen horizontally\n fakeElem.style.position = 'absolute';\n fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';\n // Move element to the same position vertically\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n fakeElem.style.top = yPosition + 'px';\n\n fakeElem.setAttribute('readonly', '');\n fakeElem.value = text;\n\n document.body.appendChild(fakeElem);\n\n selectedText = select(fakeElem);\n return copyText();\n}", "title": "" }, { "docid": "e25e564625719cb12344a952b4b106a3", "score": "0.52966386", "text": "function colsel() {\n var a = document.getElementById(\"tselect\").value;\n var appear = document.getElementById('cselect').value;\n var numb = parseInt(appear);\n // The selected id's will be put into a list. var a is a string with id's and spaces in between them\n var list = a.split(',');\n console.log(a);\n for (var j = 0; j < list.length; j++) {\n\n if (a === \"body\") {//Here every element of the page gets selected and changed with the selected change\n var all = document.getElementsByTagName(\"*\");\n } else {\n var all = document.getElementById(list[j]).querySelectorAll(\"*\");\n }\n\n for (let i = 0; i < all.length; i++) {\n all[i].style.color = appear;\n }\n\n for (let i = 0; i < all.length; i++) {//Here the selected part of the page, in the dropdown menu, changed with the selected change\n var stylo = window.getComputedStyle(all[i], null).getPropertyValue('font-size');\n var currentSize = parseInt(stylo);\n all[i].style.fontSize = (currentSize + (numb / 10)) + 'px';\n }\n }\n}", "title": "" }, { "docid": "bb773530f66a00673d3be98d1df42b7a", "score": "0.52869266", "text": "function w(a,b){W.select(N.buildSelectSpan.apply(N,arguments))}", "title": "" }, { "docid": "39c7929c5e77459f4e9a6cb1b3e2d494", "score": "0.52655584", "text": "formatMateriaSelected(val) {\n let ancho = window.innerWidth;\n\n if (ancho <= 576) {\n if (val.length >= 25) {\n let resto = val.length - 25;\n val = val.slice(0, -resto); // console.log(val+'...');\n\n return val + '...';\n } else {\n return val;\n }\n } else {\n return val = '';\n }\n }", "title": "" }, { "docid": "315574f533a29bdae50cd43138442bd1", "score": "0.5260923", "text": "function resizeSelectField (id) {\n var i, el, option, optionCount,\n scopeLabel, select;\n\n if (!document.getElementById(id)) {\n return;\n }\n\n\n option = $$('#' + id + ' select[multiple] option');\n optionCount = option.length;\n\n if (!optionCount) {\n return;\n }\n\n\n scopeLabel = $$('#' + id + ' td.scope-label')[0];\n select = $$('#' + id + ' select[multiple]')[0];\n\n select.setAttribute('size', optionCount);\n scopeLabel.innerHTML += '<br />';\n\n\n for (i = 0; i < optionCount; i ++) {\n el = option[i];\n\n if (el.selected) {\n scopeLabel.innerHTML += el.innerHTML + '<br />';\n }\n }\n }", "title": "" }, { "docid": "ea7340cad5d50d8b00f214d0d1d57d3f", "score": "0.5260593", "text": "function clearSelector() {\n const select = document.getElementById(\"select\");\n if (select){\n select.parentElement.removeChild(select);\n }\n }", "title": "" }, { "docid": "5653f5dd9ceb89265132ec6ea580e2cd", "score": "0.525987", "text": "function select_removeComment(objSelect) {\n\t\tif ((objSelect.item(0).value == \"-\") && (objSelect.selectedValue != 0)) {\n\t\t var w = objSelect.offsetWidth;\n\t\t\tobjSelect.remove(0);\n\t\t\tobjSelect.style.width = w+\"px\";\n\t\t}\n\t}", "title": "" }, { "docid": "369677b131b2d988da91e25fa355e82a", "score": "0.5255834", "text": "function resetSelect() {\n\t$(\"#select-ci\").html(\"\");\n}", "title": "" }, { "docid": "2bad41c4b434b12f18d6cb2633a19761", "score": "0.52253336", "text": "function modeSelect(obj, sel) {\n $(obj).text($(sel).text());\n //append a drop down arrow\n $(obj).append('<span class=\"caret\"></span>');\n}", "title": "" }, { "docid": "ca12043aed6bb8beba586644d97d77ca", "score": "0.5215721", "text": "function choose() {\n let word = selectWord();\n let forOnce = true\n let newa = text.innerText.split(\" \").map(item => {\n if (item == word && forOnce) {\n forOnce = false;\n return '<span> ' + item + '</span>';\n } else {\n return item\n }\n }).join(' ');\n text.innerHTML = newa\n}", "title": "" }, { "docid": "38b36512650a5401a3c9850b89c22f12", "score": "0.5209608", "text": "function textToSelect(shortName, idStr) {\n $(\"#\"+shortName+\"_datapart_\" + idStr + \" div[id^='select_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(\"select_\", \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var id = $(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr).val();\n var term = $(\"#\"+shortName+\"_\"+name+\"_term_\"+idStr).val();\n var vocabtype = $(\"#\"+shortName+\"_\"+name+\"_vocabtype_\"+idStr).val();\n var minlength = $(\"#\"+shortName+\"_\"+name+\"_minlength_\"+idStr).val();\n var placeholder = \"Select\";\n if ($(\"#\"+shortName+\"_\"+name+\"_placeholder_\"+idStr).exists()) {\n placeholder = $(\"#\"+shortName+\"_\"+name+\"_placeholder_\"+idStr).val();\n }\n var options = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_defaultOptions_\"+idStr).exists()) {\n options = $(\"#\"+shortName+\"_\"+name+\"_defaultOptions_\"+idStr).val();\n }\n\n cont.html(\"<select id='\"+shortName+\"_\"+name+\"_id_\"+idStr+\"' name='\"+shortName+\"_\"+name+\"_id_\"+idStr+\"' class='form-control' data-placeholder='\"+placeholder+\"'>\"+\n \"<option></option>\"+\n \"<option value=\\\"\"+id+\"\\\" selected>\"+term+\"</option>\"+ options +\n \"</select>\"+\n \"<input type=\\\"hidden\\\" id=\\\"\"+shortName+\"_\"+name+\"_vocabtype_\"+idStr+\"\\\" \" +\n \"name=\\\"\"+shortName+\"_\"+name+\"_vocabtype_\"+idStr+\"\\\" value=\\\"\"+vocabtype+\"\\\"/>\" +\n \"<input type=\\\"hidden\\\" id=\\\"\"+shortName+\"_\"+name+\"_minlength_\"+idStr+\"\\\" \" +\n \"name=\\\"\"+shortName+\"_\"+name+\"_minlength_\"+idStr+\"\\\" value=\\\"\"+minlength+\"\\\"/>\");\n\n if (name == \"citation\")\n scm_source_select_replace($(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr), \"_\"+idStr);\n else if (shortName == \"sameAs\" && name == \"baseuri\") {\n //The following block handles the specific case of Same As External Resource association form\n var loadPromise = loadVocabSelectOptions($(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr), \"external_sameas_domain\", \"Base URI\", true);\n loadPromise.then(function(result){\n var currentURI = $(\"#\"+shortName+\"_uri_\"+idStr).val();\n if (currentURI) {\n var found = false;\n $(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr+\" option\").each(function(index,op){\n if( found || (!op.hasAttribute(\"value\") || !op.value)) {\n return;\n }\n var uriComponents = op.value.split(/{id}/);\n if(currentURI.indexOf(uriComponents[0]) == 0) {\n var currOption = op.value;\n var currId = currentURI.replace(uriComponents[0],\"\");\n if(!!uriComponents[1]) {\n if(currentURI.indexOf(uriComponents[1]) != -1) {\n currId = currId.replace(/uriComponents[1]$/,\"\");\n }\n }\n found = true;\n $(\"#sameAs_baseuri_id_\"+idStr).val(currOption);\n $(\"#sameAs_baseuri_id_\"+idStr).trigger(\"change\");\n $(\"#sameAs_uriid_\"+idStr).val(currId);\n $(\"#sameAs_uri_\"+idStr).val(currOption.replace(/{id}/,currId));\n }\n });\n }\n $(\"#\"+shortName+\"_uri_\"+idStr).prop(\"readonly\", true);\n });\n // If dealing with subject, function, or occupation term, query Concept Vocab system\n } else if (shortName == 'activity' || shortName == 'subject' || shortName =='occupation') {\n conceptVocabSelectReplace($(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr), \"_\"+idStr, vocabtype, minlength);\n } else\n vocab_select_replace($(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr), \"_\"+idStr, vocabtype, minlength);\n\n }\n });\n}", "title": "" }, { "docid": "507e1270671137e447fa3a9d2ea20e8d", "score": "0.52047795", "text": "function sizeC(){\r\n\tvar s = document.getElementById(\"size\");\r\n\tdocument.getElementById(\"mytextarea\").style.fontSize=s.options[s.selectedIndex].value;\r\n}//end of sizeC() function", "title": "" }, { "docid": "381a14b86a904629f271e101f4acbd92", "score": "0.5201563", "text": "function sizeSel() {\n\tvar size = prompt('Font size:', '');\n\trichTextBox.document.execCommand('FontSize',false,size);\n}", "title": "" }, { "docid": "db7af294fff6d6c682b67bf92d9e22bb", "score": "0.52014935", "text": "function choose(idx)\r\n{\r\n var _target = $(\".option-container\").eq(idx);\r\n $(\".option-container\").removeClass(\"selected\");\r\n _target.addClass(\"selected\");\r\n var query = _target.find(\".option\").html().split(\"<span>\")[0];\r\n $(\"#search-bar\").val(query);\r\n}", "title": "" }, { "docid": "7856a2f16a3b6a92beafc9666d59a0db", "score": "0.5195918", "text": "function changeTermSelecterTermName (term) {\n if (term.length > 0) {\n const id = term.split(' ')[0].toLowerCase() + \"Option\";\n document.getElementById(id).innerHTML = term;\n }\n}", "title": "" }, { "docid": "2c0639981873db4e47f6f681f7c6566c", "score": "0.5191834", "text": "onUpKey() {\n const len = this.opt.choices.realLength;\n this.selected = this.selected > 0 ? this.selected - 1 : len - 1;\n this.showHelp = false;\n this.render(true);\n }", "title": "" }, { "docid": "d205651e4cea0648e992eda6b1275013", "score": "0.51884043", "text": "onUpKey() {\n var len = this.opt.choices.realLength;\n this.selected = this.selected > 0 ? this.selected - 1 : len - 1;\n this.render();\n }", "title": "" }, { "docid": "f993d71724d2fc746417d1845a4758d4", "score": "0.5182455", "text": "function setGlobalFontSize() {\n let fontSizeDropdown = document.getElementById(\"fontSizeDropdown\");\n let size = fontSizeDropdown.options[fontSizeDropdown.selectedIndex].text;\n switch (size) { //\"Small\",\"Medium\" and \"Large\" do not need to change as fontSize is not case sensitive\n case \"Extra extra small\":\n size = \"xx-small\";\n break;\n case \"Extra small\":\n size = \"x-small\";\n break;\n case \"Extra large\":\n size = \"x-large\";\n break;\n case \"Extra extra large\":\n size = \"xx-large\";\n break;\n }\n document.querySelectorAll('*').forEach(element => {\n element.style.fontSize = size;\n });\n}", "title": "" }, { "docid": "b8a559285472bdc00aa9dfe59e3f378e", "score": "0.51729983", "text": "function selectText(element) {\r\n if (element) {\r\n var element = element[0];\r\n\r\n // 20180724 mingeon_kim [IMS]167868\r\n // if (document.body.createTextRange) {\r\n // var range = document.body.createTextRange();\r\n // range.moveToElementText(element);\r\n // range.select();\r\n // } else if (window.getSelection) {\r\n var selection = window.getSelection();\r\n var range = document.createRange();\r\n\r\n if (element != \"undefined\" && element != null) {\r\n range.selectNodeContents(element);\r\n\r\n selection.removeAllRanges();\r\n selection.addRange(range);\r\n\r\n if ($(element).is(\":empty\")) {\r\n $(element).append(\"&nbsp;\");\r\n selectText($(element));\r\n }\r\n }\r\n // }\r\n }\r\n }", "title": "" }, { "docid": "d5583a72590a4049e02ecaa4f8b383c5", "score": "0.5172723", "text": "function renderSelectMemberBox() {\n\n if ('' === element.table.reducedSchema) {\n $('#spanTableSchemaMember' ).html('');\n return;\n }\n\n Y.dcforms.reducedschema.renderSelectMemberBoxSync(\n element.table.reducedSchema, // name of reduced schema\n 'spanTableSchemaMember', // DOM ID to render this into\n 'tableSchemaMember', // name of new select element\n 'selTableSchemaMember' // id of new select element\n );\n\n jq.selTableSchemaMember = $('#selTableSchemaMember');\n }", "title": "" }, { "docid": "07ea9c0e5aea822b56895b9ec76b75b5", "score": "0.51676947", "text": "function makeDropDown(eventsPhraseArray) {\n var tempArr = eventsPhraseArray.slice();\n\n for (var i = 0; i < tempArr.length; i++) {\n var tempPhrase = document.createElement(\"option\");\n tempPhrase.text += (i + 1) + \":\\xA0\"\n\n for (var j = 0; j < tempArr[i].length; j++) {\n var syllable = tempArr[i][j].split(\" = E \\\"lyric\")[1].trim().slice(0, -1);\n\n if (syllable.endsWith(\"-\")) {\n syllable = syllable.replace(\"-\" , \"\");\n } else if (syllable.endsWith(\"=\")) {\n syllable = syllable.replace(\"=\", \"-\")\n } else if (j != tempArr[i].length - 1){\n syllable += \"\\xA0\";\n }\n\n tempPhrase.text += syllable;\n }\n\n if (HTMLPhraseDropDown.options[i] != undefined) {\n if (HTMLPhraseDropDown.options[i].text == tempPhrase.text) { // if the text in both are the same do nothing\n //console.log(\"equals, do nothing\");\n } else { // if the texts are not the same, update:\n HTMLPhraseDropDown.options[i].text = tempPhrase.text;\n }\n } else if (HTMLPhraseDropDown.options[i] == undefined) { //if the option in this index is undefined add a new one\n HTMLPhraseDropDown.add(tempPhrase)\n }\n }\n}", "title": "" }, { "docid": "3adc9f92826a51994ac89119b1ea98ff", "score": "0.51420736", "text": "function _selectTag() {\n var html = '<select name=\"style\" tabIndex=\"1\">';\n html += _.map(editor.opts.imageMediaStyles, function(style) {\n var label = style.charAt(0).toUpperCase() + style.substring(1).replace(/_/, ' ');\n return '<option value=\"'+ style +'\">'+ label +'</option>';\n }).join()\n html += '<option value=\"_custom\">Custom</option>';\n html += '</select>';\n return html;\n }", "title": "" }, { "docid": "2aab56906b360bc9cfc249fc1011d1a6", "score": "0.5134654", "text": "setupSelect() {\n let select = this._myInstance.getElementsByTagName(\"select\")[0];\n let template = document.querySelector(\"#options\");\n let clone = document.importNode(template.content, true);\n select.appendChild(clone);\n let option1 = select.getElementsByTagName(\"option\")[0];\n option1.value = option1.textContent = \"run\";\n\n clone = document.importNode(template.content, true);\n select.appendChild(clone);\n let option2 = select.getElementsByTagName(\"option\")[1];\n option2.value = option2.textContent = \"restart\";\n\n select.options[0].selected = true;\n select.addEventListener(\"change\", this.game15Reconfig.bind(this));\n }", "title": "" }, { "docid": "f7bd6dc0349cc250f1440eee0df41932", "score": "0.5132059", "text": "function selectTT(current_doc){\n var current_doc_lab = $(\"#span_tt_select .option_container .option[data-value='\"+current_doc+\"']\").text();\n // SELETTORE TESTI E SELETTORE TESTI DUPLICATO NEL FRAME SINISTRO\n $('#span_tt_select .label_selected, #span_tt_select-add .label_selected')\n .attr('data-value', current_doc)\n .text(current_doc_lab);\n \n // GESTIONE DOCUMENTI MULTIPLI SU STESSA PAGINA\n var pp_first_doc_val = $(\"#span_pp_select .option_container .option.selected\").attr('data-first-doc'); \n $(\"#span_tt_select .option[data-value='\"+pp_first_doc_val+\"'], #span_tt_select-add .option[data-value='\"+pp_first_doc_val+\"']\")\n .addClass('inPage');\n $(\"#span_tt_select .option_container .option[data-value='\"+current_doc+\"'], #span_tt_select-add .option_container .option[data-value='\"+current_doc+\"']\")\n .addClass('selected')\n .addClass('inPage')\n .siblings('.selected')\n .removeClass('selected');\n\n if ( $(\"#span_tt_select\").find('.inPage').length > 1 ) {\n var actual_label = $('#span_tt_select .label_selected').text();\n $('#span_tt_select .label_selected').text(actual_label);\n $('#span_tt_select-add .label_selected').text(actual_label);\n }\n\n $('.doc.current').removeClass('current').addClass('not_current');\n $(\".doc[data-doc='\"+current_doc+\"']\").removeClass('not_current').addClass('current');\n if ( $('.doc.current').length > 0 && $('.doc.current').position() != undefined ){\n $('#text_cont, #text_cont-add').scrollTop($('.doc.current').position().top);\n }\n}", "title": "" }, { "docid": "43104c8eaa79a5baf8ff61d562f87f4c", "score": "0.5131967", "text": "function myOverflow() {\n document.getElementById('settingsselect').style.display = 'block';\n}", "title": "" }, { "docid": "ed4883f6f7cb869c46253e326dc12622", "score": "0.5131085", "text": "function addFontMenu() {\n let fonts = [\"Arial\", \"Helvetica\", \"Times New Roman\", \"Times\", \"Courier\", \"Courier New\", \"Verdana\", \"Georgia\", \"Garamond\", \"Bookman\", \"Palatino\", \"Comic Sans MS\", \"Trebuchet MS\", \"Arial Black\", \"Impact\", \"Montez\", \"Lobster\", \"Josefin Sans\", \"Shadows Into Light\", \"Pacifico\", \"Amatic SC\", \"Orbitron\", \"Rokkitt\", \"Righteous\", \"Dancing Script\", \"Bangers\", \"Chewy\", \"Sigmar One\", \"Architects Daughter\", \"Abril Fatface\", \"Covered By Your Grace\", \"Kaushan Script\", \"Gloria Hallelujah\", \"Satisfy\", \"Lobster Two\", \"Comfortaa\", \"Cinzel\", \"Courgette\"];\n let fontSelect = document.getElementById(\"fontSelect\");\n for (let i = 0; i < fonts.length; i++) {\n var fontOption = document.createElement('option');\n fontOption.value = fontOption.innerHTML = fonts[i];\n fontOption.style.fontFamily = fonts[i];\n fontSelect.add(fontOption);\n }\n}", "title": "" }, { "docid": "ef664ee3177e8ef5608df66a5d8251b8", "score": "0.51309216", "text": "function createSelect() {\n\t\t\tvar options = null;\n\t\t\tvar el = null;\n\t\t\tvar cmd = null;\n\t\t\tswitch (txt) {\n\t\t\t case \"fontsize\":\n\t\t\t case \"fontname\":\n\t\t\t case \"formatblock\":\n\t\t\t\toptions = editor.config[txt]; // HACK ;)\n\t\t\t\tcmd = txt;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (options) {\n\t\t\t\tel = document.createElement(\"select\");\n\t\t\t\tvar obj = {\n\t\t\t\t\tname: txt, // field name\n\t\t\t\t\telement: el, // the UI element (SELECT)\n\t\t\t\t\tenabled: true, // is it enabled?\n\t\t\t\t\ttext: false, // enabled in text mode?\n\t\t\t\t\tcmd: cmd, // command ID\n\t\t\t\t\tstate: setButtonStatus // for changing state\n\t\t\t\t};\n\t\t\t\ttb_objects[txt] = obj;\n\t\t\t\tfor (var i in options) {\n\t\t\t\t\tvar op = document.createElement(\"option\");\n\t\t\t\t\top.appendChild(document.createTextNode(i));\n\t\t\t\t\top.value = options[i];\n\t\t\t\t\tel.appendChild(op);\n\t\t\t\t}\n\t\t\t\tHTMLArea._addEvent(el, \"change\", function () {\n\t\t\t\t\teditor._comboSelected(el, txt);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn el;\n\t\t}", "title": "" }, { "docid": "09db8d83d274b6896457bb8da86be7e1", "score": "0.5129033", "text": "expandThemeDropdown() {\n const element = document.getElementById('themeDropdown');\n let expandLen = element.options.length;\n const currentLen = element.getAttribute('size');\n // toggle if already expand\n // note '+currentlen' converts a string to an int\n if (+currentLen === expandLen) {\n expandLen = 1;\n }\n return element.setAttribute('size', expandLen);\n }", "title": "" }, { "docid": "c53828b773b99ae98a45f68c47275114", "score": "0.5126841", "text": "function mostrarMsj1(mensaje, input){\n\tif(mensaje == \"\"){\n\t\treturn;\n\t}\n\tvar span_ruta = $(\"<span>\" + mensaje + \"</span>\");\n\t$('select').parent().append(span_ruta);\n}", "title": "" }, { "docid": "ea899ffc2ebfdab35ae6f3ebfd0814fe", "score": "0.51254433", "text": "function newSelectItem(text) {\r\n //String compilation\r\n ///Correctly formats HTML to be appended to the input box, returned at the end of the function\r\n var option = \"<option value='\" + text + \"'>\" + text + \"</option>\";\r\n\r\n return option\r\n}", "title": "" }, { "docid": "ba7de8f427196aca1c3381393206d7b0", "score": "0.51206416", "text": "function setFields(){\n // remove current selection\n var feedback = document.getElementById('feedback');\n while(feedback.firstChild){\n feedback.removeChild(feedback.firstChild);\n }\n // now create items for current selection\n for (var i = 0; i < MAX_CHOICES; i++){\n if(selection[i]){\n var span = document.createElement('span');\n span.className = 'fb';\n span.name = 'fb-'+selection[i];\n var emo = getLabel(selection[i]);\n // var strength = getNumber(selection[i]);\n span.appendChild(document.createTextNode(emo)); // + \"/4 \"));\n\n var remBut = document.createElement('a');\n remBut.href = 'javacript::void();';\n \tremBut.innerHTML = ' &otimes; ';\n remBut.name = 'fb-'+selection[i];\n \tremBut.addEventListener('click', function(ev){\n var circle = this.name.substring(3);\n deselect(circle);\n \t});\n span.appendChild(remBut);\n\n span.style.border = \"4px solid \" + getColor(selection[i]);\n feedback.appendChild(span);\n }\n }\n}", "title": "" }, { "docid": "141f591975ba2c6660e6915043efc424", "score": "0.5109688", "text": "function removePreviousHighlight() {\n var $wordSelect = $('#word-select');\n\n if ($wordSelect.length) {\n $wordSelect.after($wordSelect.text());\n $wordSelect.off();\n $wordSelect.remove();\n }\n }", "title": "" }, { "docid": "b22eb047b283328cdc28b1c2de026098", "score": "0.5098579", "text": "_adjustWidth() {\n var width = this._target.getBounds().width;\n var uiList = this.getChildControl(\"list\");\n if (this.getAllowGrowDropDown()) {\n // Let the drop-down handle its own width.\n this.setWidth(null);\n\n if (this.__cachedMaxListItemWidth > 0) {\n uiList.setWidth(this.__cachedMaxListItemWidth);\n } else {\n uiList.setWidth(width);\n }\n } else {\n // Make the drop-down as wide as the virtual-box that it is owned by.\n this.setWidth(width);\n uiList.resetWidth();\n }\n }", "title": "" }, { "docid": "78fb3dfd478eafd6d26abfdcfa3029ca", "score": "0.5097206", "text": "clearTextSelection() {\n var el = this._domNode;\n if (el) {\n qx.bom.Selection.clear(el);\n }\n delete qx.html.Element.__selection[this.toHashCode()];\n }", "title": "" }, { "docid": "aaea9badb1043f85ece5753545cf6c77", "score": "0.5096809", "text": "sizeDown() {\n let defaultSize = this.editorOptions.fontSize;\n if (defaultSize && defaultSize > 8) {\n let currentArrayId = this.fontSizeArray.indexOf(defaultSize);\n let newFontSize = this.fontSizeArray[currentArrayId - 1];\n let newEditorOptions = { fontSize: newFontSize };\n this.editorOptions = Object.assign({}, this.editorOptions, newEditorOptions);\n this.saveFont(newFontSize);\n }\n if (this.epubViewer) {\n this.epubViewer.setFont(`${this.editorOptions.fontSize}px`);\n }\n }", "title": "" }, { "docid": "1099a9f2c37a7712ee7d42f4e9eecca7", "score": "0.5084893", "text": "sizeUp() {\n let defaultSize = this.editorOptions.fontSize;\n if (defaultSize && defaultSize < 45) {\n let currentArrayId = this.fontSizeArray.indexOf(defaultSize);\n let newFontSize = this.fontSizeArray[currentArrayId + 1];\n let newEditorOptions = { fontSize: newFontSize };\n this.editorOptions = Object.assign({}, this.editorOptions, newEditorOptions);\n this.saveFont(newFontSize);\n }\n if (this.epubViewer) {\n this.epubViewer.setFont(`${this.editorOptions.fontSize}px`);\n }\n }", "title": "" }, { "docid": "628c4e03da10880b6e6a3b1468e4fd12", "score": "0.5079577", "text": "function clearFunc(element){\r\n\t\telement.attr(\"id\") == \"courseDropdown\" ? $termOrCourse = \"course\" : $termOrCourse = \"term\" ;\r\n\t\telement == $(\"select\") ? element.html(\"<option value='-1'>\" + \"Select a \" + $termOrCourse) : element.html(\"\");\r\n\t}", "title": "" }, { "docid": "0a3fb3a9b46d2b8fec67f246f93a970d", "score": "0.50764704", "text": "function select(){\n const selectSize = new Size(size.w + config.selectUnit.margin * 2, size.h + config.selectUnit.margin * 2);\n\n const tmpCoordinate = getStartCoordinate(coordinate, selectSize);\n\n ctx.strokeStyle = config.selectUnit.color;\n ctx.lineWidth = config.selectUnit.width;\n ctx.strokeRect(tmpCoordinate.x, tmpCoordinate.y, selectSize.w, selectSize.h);\n\n }", "title": "" }, { "docid": "0a3fb3a9b46d2b8fec67f246f93a970d", "score": "0.50764704", "text": "function select(){\n const selectSize = new Size(size.w + config.selectUnit.margin * 2, size.h + config.selectUnit.margin * 2);\n\n const tmpCoordinate = getStartCoordinate(coordinate, selectSize);\n\n ctx.strokeStyle = config.selectUnit.color;\n ctx.lineWidth = config.selectUnit.width;\n ctx.strokeRect(tmpCoordinate.x, tmpCoordinate.y, selectSize.w, selectSize.h);\n\n }", "title": "" }, { "docid": "648766559626ceefc4ed27a6b2f3e889", "score": "0.50747955", "text": "function translate_spans() {\n $(\"[data-i18n-text]\").each(function(i, sp) {\n i18n_text = sp.getAttribute(\"data-i18n-text\")\n if (i18n_text == null) {\n var i18n_text = \"unknown\" // flag for span with no text attr\n }\n var l10n_text = translate_l10n(i18n_text, language)\n console.log(\"translating(\" + language + \") '\" + i18n_text + \"' --> '\" + l10n_text + \"'\")\n sp.innerHTML = l10n_text\n })\n\n\n // for whatever reason, changes to option text does not take effect until\n // after the selection changes (???). (You can prove that by uncommenting\n // the \"proveit\" section below, and commenting-out \"!proveit\", then looking\n // at the menu at initial load.) So call .change() to \"change\" to force\n // a change when translation happens.\n // if(PROVIT) {\n // console.log(\"sanity check: select-date-range options\")\n // $(\"#select-date-range option\").each(function (i, el) { console.log($(el).text()) })\n // $(\"#select-date-range\").append(\"<option value='believeit'>Believe it?</option>\")\n // } else { // !PROVEIT\n var curval = $(\"#select-date-range option:selected\").val();\n $(\"#select-date-range\").val(curval).change() // \"change\" to the current value to trigger option text refresh (WTF????)\n // }\n\n\n}", "title": "" }, { "docid": "bd048db10970d6651580d5b89f7b6150", "score": "0.5074114", "text": "function makeSel () {\n const sel = window.getSelection()\n if (!sel) return\n const txtarea = lastClicked[0]\n const start = txtarea.selectionStart;\n const finish = txtarea.selectionEnd;\n const selection = txtarea.value.substring(start, finish);\n let val = txtarea.value\n txtarea.value = val.substring(0, start) + '<a href=\"https://oddert.github.io/\">' + val.substring(start, finish) + '</a>' + val.substring(finish)\n}", "title": "" }, { "docid": "1d7f01cbff64d43a613b2a5b486ff91b", "score": "0.50735277", "text": "function setTextBorderSelected(){\n $('#file').mouseup(function (e){\n if(mode === 1){//modalità annotatore\n selectedText = getSelectedText();\n rangeObject = selection.getRangeAt(0);\n if(!rangeObject){\n rangeObject = document.createRange();\n rangeObject.setStart(selection.anchorNode, selection.anchorOffset);\n rangeObject.setEnd(selection.focusNode, selection.focusOffset);\n }\n if(rangeObject && (rangeObject.collapsed == false)){\n rangySelection = rangy.getSelection();\n }\n }\n });\n}", "title": "" }, { "docid": "6ed6676fa91bb5f638e2df9d2f5b1cc4", "score": "0.50639844", "text": "function adjustSelectionToVisibleSelection() {\n function findSelectionEnd(start, end) {\n var walker = new TreeWalker(end);\n for (node = walker.prev2(); node; node = walker.prev2()) {\n if (node.nodeType == 3 && node.data.length > 0) {\n return node;\n }\n\n if (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {\n return node;\n }\n }\n }\n\n // Adjust selection so that a end container with a end offset of zero is not included in the selection\n // as this isn't visible to the user.\n var rng = ed.selection.getRng();\n var start = rng.startContainer;\n var end = rng.endContainer;\n\n if (start != end && rng.endOffset === 0) {\n var newEnd = findSelectionEnd(start, end);\n var endOffset = newEnd.nodeType == 3 ? newEnd.data.length : newEnd.childNodes.length;\n\n rng.setEnd(newEnd, endOffset);\n }\n\n return rng;\n }", "title": "" }, { "docid": "5c6178100eb172717c3e39e29c91188f", "score": "0.5061165", "text": "function ebSelectConvertToText(selectElement, optionElement) {\n 'use strict';\n selectElement.outerHTML = optionElement.innerHTML;\n}", "title": "" }, { "docid": "57bf866daf5f469e4f4e728e0b7835f7", "score": "0.5055477", "text": "function shrinkWideDropDowns() {\r\n // Get width of viewport\r\n var winWidth = $(window).width();\r\n // If we don't have a horizontal scrollbar, then do nothing\r\n if ($(document).width() <= winWidth) return;\r\n // Loop through each drop-down\r\n $('form#form select.x-form-text').each(function(){\r\n var dd = $(this);\r\n var posDdLeft = dd.offset().left\r\n var posDdRight = posDdLeft + dd.width();\r\n // If drop-down spills off page, then resize it\r\n if (posDdRight > winWidth) dd.css('width','95%');\r\n });\r\n}", "title": "" }, { "docid": "38fada29324a48f7853253553d7f177b", "score": "0.50528973", "text": "function addRAMInput( event ){\n\tlet select = document.querySelector('#ramDiv select').cloneNode( true );\n\tselect.name = \"ram_id\";\n\tselect.classList.add('w-100')\n\tselect.getElementsByTagName('option')[0].innerHTML = \"Add More RAM\";\n\tselect.addEventListener( 'change', selectHandler );\n\tevent.target.parentElement.insertBefore( select, event.target );\n}", "title": "" }, { "docid": "e38a164bdbcb9fe16641bdb1d07d54a4", "score": "0.5052592", "text": "function formTxt(){\n var spansEvt = oEvenmnt.getElementsByTagName('span'); \n \n var addEvt = document.getElementById(\"hidebox\");\n \n var new_option1= document.createElement(\"select\"); \n new_option1.id = \"mySelect1\";\n for (var i=0; i<48; i++) {\n var options1 = document.createElement('option');\n new_option1.appendChild(options1);\n }\n addEvt.appendChild(new_option1);\n\n var obj1 = document.getElementById('mySelect1'); \n for (var i=0; i<new_option1.options.length; i++) {\n obj1.options[i].value = i; //alert(spansEvt[12+2*i].innerHTML); \n obj1.options[i].innerHTML = spansEvt[12+2*i].innerHTML;\n }\n\n var new_option2= document.createElement(\"select\"); \n new_option2.id = \"mySelect2\";\n for (var i=0; i<48; i++) {\n var options2 = document.createElement('option');\n new_option2.appendChild(options2);\n }\n addEvt.appendChild(new_option2);\n\n var obj2 = document.getElementById('mySelect2'); \n for (var i=0; i<new_option2.options.length; i++) {\n obj2.options[i].value = i; //alert(spansEvt[13+2*i].innerHTML); \n obj2.options[i].innerHTML = spansEvt[13+2*i].innerHTML;\n }\n var titleEvnt= document.createElement(\"textarea\"); \n titleEvnt.id=\"titEvnt\";\n titleEvnt.placeholder = \"title\";\n addEvt.appendChild(titleEvnt);\n \n var contentEvnt= document.createElement(\"textarea\"); \n contentEvnt.id=\"contEvnt\";\n contentEvnt.placeholder = \"Events\";\n addEvt.appendChild(contentEvnt);\n \n var addTime = document.createElement('div');\n addTime.id=\"addT\";\n addTime.innerHTML=\"add\";\n\n addEvt.appendChild(addTime);\n \n }", "title": "" }, { "docid": "d5d9207185aeb4d0ede1537432cad02f", "score": "0.5049417", "text": "function optionsHTML(theChoice, index) {\n console.log(theChoice);\n let div = d3.select(\"form\").append(\"div\");\n let theLabel = div.append(\"label\")\n .attr(\"for\", \"select\"+theChoice)\n .text(`Select ${theChoice}`);\n let select = div.append(\"select\")\n .attr(\"id\", \"select\"+theChoice)\n .attr(\"name\", theChoice);\n select.selectAll(\"option\")\n .data(uniqueItemsArray[index])\n .enter()\n .append(\"option\")\n .attr(\"value\", d => d)\n .text(d => d);\n let defaultEmpty = select.append(\"option\")\n .attr(\"value\", \"\")\n .text(\"\")\n .attr(\"selected\", \"selected\");\n}", "title": "" }, { "docid": "1accca8155eedf54267c93ac7b823555", "score": "0.5039046", "text": "function edit_group_size_text()\n{\n\tvar size = jQuery(this).val();\n\tjQuery(\".uos_group_size_text\").html(size);\n}", "title": "" }, { "docid": "3f63e515f56db56e3cd9a3c8a4e99698", "score": "0.503527", "text": "function select() {\n selection.select(swimlane);\n }", "title": "" }, { "docid": "03c0e3ac84be381d74087a1ac7e115cb", "score": "0.50331134", "text": "function newSelectItemValue(text, value) {\r\n //String compilation\r\n ///Correctly formats HTML to be appended to the input box, returned at the end of the function\r\n var option = \"<option value='\" + value + \"'>\" + text + \"</option>\";\r\n\r\n return option\r\n}", "title": "" }, { "docid": "dbfdeed9f2daee6730e031c7cdbe70c6", "score": "0.50319797", "text": "function SetExploreToDefault(){\n document.getElementById(\"explore-select\").textContent=\"Hunt By...\";\n}", "title": "" }, { "docid": "a1a09852ebbb81ffda1303d02a957ccb", "score": "0.50315744", "text": "function changeSelectionbar(bacteria, antibiotics) {\n\n var selections = [];\n\n // Remove old antibiotics selection from bar\n document.getElementById('select').innerHTML = '';\n\n makeChildren(selections, 'Bacteria', bacteria)\n makeChildren(selections, 'Antibiotics', antibiotics)\n\n // Add selection bar with search field\n $(document).ready(function() {\n $('.js-example-basic-single').select2({\n placeholder: 'Select an option',\n allowClear: true,\n data: selections\n });\n });\n}", "title": "" }, { "docid": "351779d00227db35040574b14f170fdd", "score": "0.50313354", "text": "function setPreferredListItem(targetControl, widget)\n{\n var optIndex = widget.selectedIndex;\n if (optIndex)\n {\n var text = widget.options[optIndex].text;\n targetControl.value = text;\n }\n} //setPreferredListItem()", "title": "" }, { "docid": "ad6972fd016c302d8f14639f137d1a2d", "score": "0.5028933", "text": "function updateSelector(e) {\n var w = Math.abs(initialW - e.pageX);\n var h = Math.abs(initialH - e.pageY);\n $(app.config.element.ghostSelect).css({\n 'width': w,\n 'height': h\n });\n if (e.pageX <= initialW && e.pageY >= initialH) {\n $(app.config.element.ghostSelect).css({\n 'left': e.pageX\n });\n } else if (e.pageY <= initialH && e.pageX >= initialW) {\n $(app.config.element.ghostSelect).css({\n 'top': e.pageY\n });\n } else if (e.pageY < initialH && e.pageX < initialW) {\n $(app.config.element.ghostSelect).ecss({\n 'left': e.pageX,\n \"top\": e.pageY\n });\n }\n }", "title": "" }, { "docid": "696aa2345c25173f68758ce857f3601f", "score": "0.5026953", "text": "function CreateZoomMenu() {\n var zoom_list = [0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2.0];\n var zoom_value = document.getElementById(\"zoom_value\");\n\n //create all options as a dropdown menu\n for (var i=0; i< zoom_list.length; i++) {\n //element\n var zoom_option = document.createElement(\"div\");\n document.getElementById(\"top_UI\").appendChild( zoom_option );\n zoom_option.classList.add(\"dropdown_option\", \"zoom_option\");\n\n //position\n var btn_pos = zoom_value.getBoundingClientRect();\n var option_height = zoom_option.getBoundingClientRect().height;\n zoom_option.style.top = `${btn_pos.top + btn_pos.height + option_height*i }px`;\n zoom_option.style.left = `${btn_pos.left}px`;\n\n //value\n zoom_option.innerHTML = `${ zoom_list[i]*100 }%`;\n \n //action\n zoom_option.onclick = function() {\n \n //apply\n var zoom_value = parseFloat( this.innerHTML.replace(\"%\", \"\") ) / 100;\n ApplyZoom(zoom_value);\n KillZoomMenu();\n\n //display\n var zoom_disp = document.getElementById(\"zoom_display\");\n zoom_disp.innerHTML = Math.round(zoom_value*100);\n\n };\n\n\n }\n\n}", "title": "" }, { "docid": "e1810a24fb372781ad7357d6f1d4d1e0", "score": "0.50244904", "text": "function transform_select(selectContainer) {\r\n var result = \"\";\r\n var realselect = $(selectContainer).find(\"select\");\r\n\r\n //read select values, write and add to container\r\n $(selectContainer).find(\"select option\").each(function() {\r\n var text = ($(this).text());\r\n var value = ($(this).val());\r\n result += \"<li rel='\" + value + \"' text='\" + text + \"'>\" + text + \"</li>\";\r\n });\r\n\r\n $(selectContainer).append(\"<ul>\" + result + \"</ul>\");\r\n\r\n if ($(selectContainer).attr(\"class\") == \"short-select\") {\r\n $(selectContainer).find(\"ul\").jScrollPane({scrollbarWidth: 57, showArrows: true});\r\n } else {\r\n $(selectContainer).find(\"ul\").jScrollPane({scrollbarWidth: 14, showArrows: true});\r\n }\r\n\r\n $(selectContainer).find(\"input\").val(realselect.find(\"option[selected]\").text());\r\n $(selectContainer).find(\".select-text\").html(realselect.find(\"option[selected]\").text());\r\n\r\n //base events\r\n $(selectContainer).click(function() {\r\n $(this).find(\"ul\").show();\r\n $(this).find(\".jScrollPaneContainer\").css(\"visibility\", \"visible\").show();\r\n// console.log($(this).find(\".jScrollPaneContainer\"));\r\n })\r\n\r\n\r\n $(selectContainer).bind(\"mouseleave\", function() {\r\n if ($(this).find(\"input\").length == 0) {\r\n $(this).find(\".jScrollPaneContainer\").css(\"visibility\", \"hidden\").hide();\r\n }\r\n\r\n })\r\n\r\n $(selectContainer).find(\"ul li\").live('click', function() {\r\n $(selectContainer).find(\".select-text\").html($(this).text());\r\n $(selectContainer).find(\"input\").val($(this).text());\r\n realselect.val($(this).attr(\"rel\"));\r\n realselect.change();\r\n $(this).parent().parent().css(\"visibility\", \"hidden\");\r\n })\r\n\r\n}", "title": "" }, { "docid": "c6cde4d87eb0ed2e4684c18a7aef2e42", "score": "0.50238186", "text": "static getSelectionBoundingBox(element) {\n\t\t\n\t\tlet savedSelection = SelectionUtils.getSelectionPosition(element);\n\t\t\n\t\tif (savedSelection.length == 0) return []; // Error checking all done in getSelectedPosition, if there is an error it will return an array with length 0 instead of length 2\n\t\t\n\t\tlet currentHTML = element.innerHTML;\n\t\tlet range = document.getSelection().getRangeAt(0);\n\t\tlet result = [0, 0, 0, 0];\n\t\t\n\t\t// Insert a tag and get the start y position\n\t\tlet startDummy = document.createElement(\"SELECTION-DUMMY-ONE\");\n\t\tstartDummy.innerHTML = \"&#8203;\"; // Zero-width space - without this, the first dummy will be positioned (0, 0) in the container if it is at the start of the line.\n\t\trange.insertNode(startDummy);\n\t\tresult[1] = startDummy.getBoundingClientRect().top + window.scrollY;\n\t\t\n\t\t// Insert a tag and get the end y position\n\t\trange.collapse(false);\n\t\tlet endDummy = document.createElement(\"SELECTION-DUMMY-TWO\");\n\t\trange.insertNode(endDummy);\n\t\tlet endRect = endDummy.getBoundingClientRect();\n\t\tresult[3] = endRect.top + endRect.height + window.scrollY;\n\t\t\n\t\t// Wrap a tag around the whole selection to get the width\n\t\tstartDummy.innerHTML = \"\";\n\t\tSelectionUtils.makeSelection(element, savedSelection[0], savedSelection[1]);\n\t\trange = document.getSelection().getRangeAt(0);\n\t\tlet widthDummy = document.createElement(\"SELECTION-DUMMY-THREE\");\n\t\twidthDummy.appendChild(range.extractContents());\n\t\trange.insertNode(widthDummy);\n\t\tlet widthRect = widthDummy.getBoundingClientRect();\n\t\tresult[0] = widthRect.left + window.scrollX;\n\t\tresult[2] = widthRect.left + widthRect.width + window.scrollX;\n\t\t\n\t\t// Revert adding the dummy tags\n\t\telement.innerHTML = currentHTML;\n\t\tSelectionUtils.makeSelection(element, savedSelection[0], savedSelection[1]);\n\t\t\n\t\treturn result;\n\t}", "title": "" }, { "docid": "e219153d9e42ceedfeafb1d60c5d3173", "score": "0.50168437", "text": "function selectSize() {\r\n $(\"mytextarea\").style.fontSize = this.value + \"pt\";\r\n }", "title": "" }, { "docid": "ab726a1c46cbce5026db17372eabbb11", "score": "0.5014648", "text": "function getCurrentSize() {\n\t// list of all available sizes\n\tvar current_size_obj = document.getElementById('native_dropdown_selected_size_name').getElementsByClassName('dropdownSelect')[0];\n\tvar current_size_text = current_size_obj.innerHTML;\n\treturn current_size_text;\n}", "title": "" }, { "docid": "325c67efb2d4c333a3440254cef727b4", "score": "0.50132215", "text": "function mkFixedWidthOptionText(txt,width)\n {\n while ( txt.length < width ) txt = txt + \" \" ;\n return txt.replace(/ /g, \"\\u00a0\") ; // \"\\u00A0\" is non-breaking space\n }", "title": "" }, { "docid": "c9871cae9dc388838cc2d36fb01c3af5", "score": "0.50129944", "text": "function changeLineWidthSelection(){\n var selected_shape_width_index = $(\"#width_selection\").prop('selectedIndex');//Stores the electio of the user\n //Based on the selection of the user, the width of the shape is changed accordingly\n if(selected_shape_width_index == 0){//Small size\n ctx.lineWidth = 2;\n lineW = 2;\n }\n else if(selected_shape_width_index == 1){//Medium size \n ctx.lineWidth = 5;\n lineW = 5;\n }\n else if(selected_shape_width_index == 2){//Large size\n ctx.lineWidth = 10;\n lineW = 10;\n }\n else{//Huge size\n ctx.lineWidth = 15;\n lineW = 15;\n }\n $(\"#width_selection\").prop('selectedIndex', selected_shape_width_index);\n}", "title": "" }, { "docid": "028e98d6118e23cce44549196b165975", "score": "0.5006147", "text": "function MonthWanted() {\n let newInnerInput = '#innerInputDiv1';\n $('#aligner').append($('<div class=\"innerInputDiv\"></div>').attr('id', 'innerInputDiv1'));\n $(newInnerInput).append($('<div class=\"textDiv\"></div>').attr('id', 'text1'));\n let newText = '#text1';\n $(newText).append('Month');\n $(newText).after($('<select id=\"monthSelector\">' +\n '<option></option>' +\n '<option> January </option>' +\n '<option> February </option>' +\n '<option> March </option>' +\n '<option> April </option>' +\n '<option> May </option>' +\n '<option> June </option>' +\n '<option> July </option>' +\n '<option> August </option>' +\n '<option> September </option>' +\n '<option> October </option>' +\n '<option> November </option>' +\n '<option> December </option>' +\n '</select>'));\n $('#monthSelector').selectmenu({\n position: {my: 'center top', at: 'center bottom'},\n width: 150\n })\n $('#monthSelector-button').click(clickOnMonthSelector);\n }", "title": "" }, { "docid": "a5ffd3ecd78c6686c44ab584171bcee2", "score": "0.50030106", "text": "function renderConstituencyState(option) {\r\n document.getElementById('constituencyWise');\r\n $(\"#constituencyWise\").empty();\r\n document.getElementById('constituencyWise').innerHTML = option;\r\n $(\".constit-drop option\").each(function() {\r\n if ($(this).text() == \"NCT OF DELHI\")\r\n $(this).attr(\"selected\", \"selected\");\r\n });\r\n}", "title": "" }, { "docid": "4a6e49ad9b2a116d8c163269f95e6c31", "score": "0.49955752", "text": "function update_select(el) {\r\n\t\t\t\r\n\t\tel.find('.tomb-select-holder').each(function() {\r\n\t\t\t\t\r\n\t\t\tvar $this = $(this),\r\n\t\t\t\tvalue = $this.find('select option:selected').text();\r\n\t\t\t$this.find('.tomb-select-value').text(value);\r\n\t\t\t\t\r\n\t\t\tif (value) {\r\n\t\t\t\t$this.find('.tomb-select-placeholder').hide();\r\n\t\t\t\t$this.find('.tomb-select-clear').show();\r\n\t\t\t} else {\r\n\t\t\t\t$this.find('.tomb-select-placeholder').show();\r\n\t\t\t\t$this.find('.tomb-select-clear').hide();\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t});\r\n\t\t\t\r\n\t}", "title": "" }, { "docid": "59fefc67b97c4bb401dbf2ea63168d5d", "score": "0.49947965", "text": "function clearActiveSelect() {\n message.style.visibility = \"visible\";\n colorSelectBox.style.visibility = \"hidden\";\n clearSelector.style.visibility = \"hidden\";\n if (activeSelection !== undefined) {\n activeSelection.style.border = \"none\";\n activeSelection.style.boxShadow = \"none\";\n activeSelection = undefined;\n }\n}", "title": "" }, { "docid": "88452071defb2e96a7a3cbcc212c4437", "score": "0.4991077", "text": "function updateSelected() {\n var optionsBox = $(this);\n var multiSelectA = optionsBox.next('.multiSelectA');\n var i = 0;\n var display = '';\n optionsBox.find('INPUT:checkbox').not('.selectAll, .optGroup').each( function() {\n if ($(this).attr('checked')) {\n i++;\n display = display +\n '<p class=\"selectedTag\"><span class=\"selectedTag\">' +\n $(this).parent().text() +\n '</span></p>';\n }\n else {\n selectAll = false;\n }\n });\n\n var $container = optionsBox.closest('.tagsContainer');\n if( i === 0 ) {\n $(\".selectedTagsHeading\", $container).html( $(\".noTagsSelected\", $container).text() );\n $(\".selectedTags\", $container).text('');\n } else {\n $(\".selectedTags\", $container).html( display );\n $(\".selectedTagsHeading\", $container).html( $(\".oneOrMoreTagsSelected\", $container).text().replace('%', i) );\n }\n }", "title": "" }, { "docid": "d5386d025bb75fce0c8ced0e1deb5965", "score": "0.4988049", "text": "_cleanup() {\n\t\tthis._sizeView._dismiss();\n\n\t\tconst editingView = this._options.editor.editing.view;\n\n\t\teditingView.change( writer => {\n\t\t\twriter.setStyle( 'width', this._initialViewWidth, this._options.viewElement );\n\t\t} );\n\t}", "title": "" }, { "docid": "a8bf765fe8bf519895af857af9005cd8", "score": "0.49827537", "text": "function createOption(word) {\n const option = document.createElement(\"div\");\n option.textContent = word;\n\n option.addEventListener(\"click\", function (event) {\n searchBox.value = this.textContent;\n optionPannel.innerHTML = \"\";\n\n searchValue = searchBox.value;\n script.displayFullInfo();\n return;\n });\n\n return option;\n}", "title": "" }, { "docid": "a4e6ad8ccd3dd1892594d2aaa3f6b1f1", "score": "0.49796662", "text": "option() {\n \n this.optionPick.innerHTML = `\n <h3 id=\"complete\" class=\"mt-3 optionText\">\n pick an option below!\n </h3>\n `;\n }", "title": "" }, { "docid": "774e225866b284aac84146d8fc81c192", "score": "0.49781072", "text": "function teaSize() {\n let Cappucinosize = [\"Medium\", \"Large\"];\n for (let i = 0; i < Cappucinosize.length; i++) {\n let opt = document.createElement(\"option\");\n opt.value = Cappucinosize[i];\n opt.innerHTML = Cappucinosize[i];\n size.appendChild(opt);\n }\n}", "title": "" } ]
1eed95dd5c9bbeb8f6f0e6ae0af4e175
timer call windown every timer out
[ { "docid": "0b4cf1877acbbd9a7290ed4f52046401", "score": "0.0", "text": "function change_icon(app_status) {\n\tvar icons_list = {'run':'icons/icon_run.png', 'stop':'icons/icon_stop.png'};\n chrome.browserAction.setIcon({path: icons_list[app_status]});\n}", "title": "" } ]
[ { "docid": "fec5cdeb631820099a5264458fd2505a", "score": "0.72104186", "text": "ontimeout() {}", "title": "" }, { "docid": "080c436535164b53604564a391504321", "score": "0.709828", "text": "function timerCallback() {\r\n }", "title": "" }, { "docid": "eec01c146bd1a5bdf0493281760e4744", "score": "0.70304054", "text": "function timer(timetick) { \r\n\t\tfor (var n1 = timetick; n1--> 0;) {\r\n\t\t\t window.setTimeout(removeBanner,n1);\r\n\t\t\t\r\n\t\t\t \t\r\n\t\t\t\t\t}\r\n\t\t\t\t \twindow.setTimeout(ungrey,400);\r\n\t\t\t\t \t window.setTimeout(Reports,800);\r\n\t\t\t\t\t\r\n}", "title": "" }, { "docid": "f96bc1d66d62ada71811b1409a795221", "score": "0.6847692", "text": "function timer_cb () {\n iot.SendEvent('tick', dst, data);\n}", "title": "" }, { "docid": "91381516f48550dda5759243433c00ba", "score": "0.6837774", "text": "function timer()\n {\n if(gameover){\n count = 0;\n }\n count=count-1;\n if (count <= 0)\n {\n clearInterval(counter);\n invertColors(true);\n shroomup = 0;\n //counter ended, do something here\n return;\n }\n\n //Do code for showing the number of seconds here\n }", "title": "" }, { "docid": "91381516f48550dda5759243433c00ba", "score": "0.6837774", "text": "function timer()\n {\n if(gameover){\n count = 0;\n }\n count=count-1;\n if (count <= 0)\n {\n clearInterval(counter);\n invertColors(true);\n shroomup = 0;\n //counter ended, do something here\n return;\n }\n\n //Do code for showing the number of seconds here\n }", "title": "" }, { "docid": "24926ac59f1c19d0f6e9262345e49079", "score": "0.68281883", "text": "function timer()\n{\n}", "title": "" }, { "docid": "de40df0d416b843aa8b48bdde51a134c", "score": "0.6823935", "text": "function timer() {\n clock = setInterval(countDown, 1000);\n function countDown() {\n if (time < 1) {\n clearInterval(clock);\n outOfTime();\n }\n if (time > 0) {\n time--;\n }\n $(\"#timer\").html(time);\n }\n }", "title": "" }, { "docid": "95ff8d295e01a27ffe6c3be2b72bfaf9", "score": "0.6821116", "text": "function timer() {\n\t\tclock = setInterval(countDown, 1000);\n\t\tfunction countDown() {\n\t\t\tif (time < 1) {\n\t\t\t\tclearInterval(clock);\n\t\t\t\tuserTimeout();\n\t\t\t}\n\t\t\tif (time > 0) {\n\t\t\t\ttime--;\n\t\t\t}\n\t\t\t$(\"#timer\").html(\"<strong>\" + time + \"</strong>\");\n\t\t}\n\t}", "title": "" }, { "docid": "abcbf73bc5630463060d71bca53dcb97", "score": "0.6707576", "text": "function timer() \n{ \n t = setTimeout(inc_time, 1000);\n}", "title": "" }, { "docid": "52a968119a052838f9f4bec156c00345", "score": "0.6652891", "text": "function runTimer(){\n\t\tif(shitIsRun){\n\t\t\ttimer--;\n\t\t\t$('#timer h2').text(timer);\n\t\t\tif(timer<=50){\n\t\t\t\t$('#timer h2').css({\n\t\t\t\t\tcolor : '#800'\n\t\t\t\t});\n\t\t\t}\n\t\t\tif(timer <= 0){\n\t\t\t\ttimer = 0;\n\t\t\t\tgameOutcome = 'lost';\n\t\t\t\tfinished();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5a175a7ff5fd57db6d415601bc906faa", "score": "0.6651804", "text": "__start_timer(){\n\tthis.battle_clock = setTimeout(()=>{\t\t\t\n\t\tlet digimon = this.turn_order[this.turn_pointer];\n\t\tlet tamer = this.battlers[digimon].tamer;\n\t\t\n\t\tthis.failure[tamer]++;\n\t\tif(this.failure[tamer] > 2){\n\t\t\t this.left(tamer);\n\t\t\t return;\n\t\t}\n\t\tthis.__verbose('did_nothing', tamer);\n\n\t\tthis.battle_action();\n\t},30500);\n}", "title": "" }, { "docid": "d12887b990613272b7dbed3b6a565b76", "score": "0.66505903", "text": "function timer() {\n var now = new Date().getTime();\n var diff = now - start;\n var seconds = self.countDown - Math.floor(diff / 1000);\n execute(seconds);\n self.timer = seconds;\n\n if (!seconds) {\n window.clearInterval(self.counter);\n callback();\n }\n }", "title": "" }, { "docid": "90b2c20c55e1b38bac628f1c97f3007c", "score": "0.6640284", "text": "CrudeTimer( c ) {\n }", "title": "" }, { "docid": "28fbc3e4eb48d559a0d4364c7195aaf8", "score": "0.6609154", "text": "startTimer() {\n\n }", "title": "" }, { "docid": "c64f079c98a92b834d65559cdf17cd5b", "score": "0.66036737", "text": "function myTimer() {\n if ( t == 0 )\n {\n timeout() ;\n }\n else\n {\n t = t - 1 ;\n document.getElementById(\"timer\").innerHTML = t ;\n }\n}", "title": "" }, { "docid": "60983ac20fb159b4ae1834e7d6934107", "score": "0.6599153", "text": "function timer() {\n counter=setInterval(startTimer, 1000); //1000 will run it every 1 second\n function startTimer(){\n \n if (time <= 0){\n clearInterval(counter);\n answerTimeout();\n }\n if (time > 0){\n time--; \n }\n //took out the reference to gameDisplay, pointed it to the timer span\n $(\"#timer\").html( time );\n }\n }", "title": "" }, { "docid": "13d579ddf684e66c854c6a0f9870aebc", "score": "0.65971434", "text": "function timeOut() {\n callFunc();\n updateValue();\n newInterval();\n }", "title": "" }, { "docid": "01237486fc11e6faa0bde48e4f77c3ac", "score": "0.6593332", "text": "function timer()\n {\n count -= 1;\n if (count <= 0)\n {\n clearInterval(counter);\n //counter ended, do something here\n $('div#gamefield div#gamepad #timebar-inner').attr('style', 'width:0%;');\n if (jabber.client.responseStatus == 'Clear') {\n $('div#gamefield div#gamepad #timebar-outer').addClass('timeout');\n $('div#optionspad div.optionblock').attr(\"enabled\", false);\n jabber.client.responseStatus == 'Timeout'\n };\n return;\n }\n progress = (count / time) * 100\n $('div#gamefield div#gamepad #timebar-inner').attr('style', 'width:' + progress + '%;');\n }", "title": "" }, { "docid": "cc9925c32c165406293101ab0c4dca2c", "score": "0.65929484", "text": "function sigint() {\n //console.log(Date.now() - startTime);\n //startTime = Date.now();\n if (timer) clearTimeout(timer);\n timer = setTimeout(timeout, ControlC.interval);\n\n ++count;\n }", "title": "" }, { "docid": "8f93a4800175a704955d66ba25203c23", "score": "0.6582584", "text": "function timer(time) {\n setTimeout(displayFalse, time);\n}", "title": "" }, { "docid": "4e2f8d9e3078d75ed811264407adc845", "score": "0.65744483", "text": "function timeout() \n {\n setTimeout(function () \n {\n counter -= 2000; \n if (counter > 0) \n {\n m2.edit(\"📢 Temps de parole \" + counter/1000 + \" secondes\\n\");\n timeout(); \n }\n else \n { m2.edit(\"📢 Le temps de parole est fini.\\n\");}\n \n }, 2000);\n }", "title": "" }, { "docid": "7d0a755031d3f512ec1cbaf418a9ac01", "score": "0.6552788", "text": "function stoptimer() {\n clearInterval(interval);\n popup();\n}", "title": "" }, { "docid": "f178c7f6e6e58bfd49f2d95b5c2c4e35", "score": "0.65444255", "text": "function timerDiv() {\n clock = setInterval(thirtySeconds, 1000);\n function thirtySeconds() {\n if (timer === 0) {\n clearInterval(clock);\n unansweredLoss();\n }\n if (timer > 0) {\n timer--;\n }\n $(\".timer\").html(timer);\n }\n }", "title": "" }, { "docid": "e0ead9276a0c0d0d567b793df60a28ec", "score": "0.6539941", "text": "function set_timer(time){\n\t// Initialisation du compte à rebours\n\ttm = setTimeout(function(){\n\t\t// Quand le timer tombe à 0, la partie est terminée, et un message qui le manifeste s’affiche. Le jeu est alors bloqué\n\t\tlose();\n\t},time*1000);\n\t// Affichage du compte à rebours\n\ttxt_timer = setInterval(function(){\n\t\tif (document.querySelector('#timer1')) document.querySelector('#timer1').innerHTML = --time;\n\t\telse clearInterval(txt_timer);\n\t\tif (time == 0) clearInterval(txt_timer);\n\t},1000);\n}", "title": "" }, { "docid": "0df25a355684ad2f6c20088088f0c1cc", "score": "0.6530489", "text": "function displayTimer() {\n push();\n textSize(50);\n fill(255);\n textAlign(CENTER);\n text(`${timer} seconds to find Waldo`,\n width /2, height/2);\n if (frameCount % 60 == 0 && timer > 0) {\n timer--;\n }\n pop();\n}", "title": "" }, { "docid": "0d80f2bd46bc98528e5ce47727399780", "score": "0.65124595", "text": "function timer()//function for the timer\n \t\t\t\t\t{\n \t\t\t\t\t\t$('#timer').text(count + \" secs\");\n \t\t\t\t\t\tcount--;\n \t\t\t\t\t\tif (count <= -1)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tclearInterval(countdown);\n \t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} //<-----Ending of timer", "title": "" }, { "docid": "91efeabf2ac4ce6d259120fd805fde27", "score": "0.6511221", "text": "function timer() {\n\tsetTimeout(display, 6000)\n}", "title": "" }, { "docid": "91e54cdf82a34d13e5a160f8ce38f221", "score": "0.65054107", "text": "function timer() {\n count = count - 1;\n\n if (count <= 0) {\n clearInterval(counter);\n getLamps();\n return;\n }\n }", "title": "" }, { "docid": "708bbbd2022908dfa0178e0c4f04cbbe", "score": "0.64958084", "text": "function timer() {\n t = setTimeout(time, 1000);\n}", "title": "" }, { "docid": "b6ea7cfe3823a1cc9264a77768185fc5", "score": "0.64930063", "text": "function timer() {\n count = count - 1;\n\tvar t = convertTime(count);\n if (count <= 0) {\n clearInterval(counter);\n return;\n\t}\n\t$(\"#timer\").html(t); // watch for spelling\n}", "title": "" }, { "docid": "35dfacd3665af531378f68fa41499098", "score": "0.64871186", "text": "function unrefTimer(timer) { }", "title": "" }, { "docid": "35dfacd3665af531378f68fa41499098", "score": "0.64871186", "text": "function unrefTimer(timer) { }", "title": "" }, { "docid": "255b6a0d3aab2efe2a7766d389c18cac", "score": "0.6475732", "text": "function timerFunction(){\n\ttimer = timer - 1;\n}", "title": "" }, { "docid": "7b10280d64d84e42186246b3305d24f3", "score": "0.64667654", "text": "function mclosetime()\r\n{\r\n\tclosetimer = window.setTimeout(mclose, timeout); //imi executa mclose dupa timeout milisecunde\r\n}", "title": "" }, { "docid": "3ec5266ace0ea901490972b17a12bcdf", "score": "0.6466546", "text": "function Timer(){\n MinutTimer();\n SecondsTimer();\n}", "title": "" }, { "docid": "e5741cb9b9795ff6c398fb9d59b8ed7a", "score": "0.64528674", "text": "function timeron() {\n $('.mainbox').html('<h1 class=\"timer\"></h1>');\n if (startClock === false) {\n timer = 15;\n $('.timer').html(timer);\n timercount = setInterval(decrement, 1000);\n }\n startClock = true;\n}", "title": "" }, { "docid": "59d5a3a15a9dedb42036f7451f755342", "score": "0.6448441", "text": "function countDown(){\n\t$(\"#timer\").text(timer);\n\tif (timer === 0){\n\t\ttimeRanOut();\n\n\t\t}\n\ttimer--;\n}", "title": "" }, { "docid": "51015171a09767adef33e291d8d89a6b", "score": "0.64322925", "text": "function timer(){\r\n\t\tupdateClock();\r\n\t\tstart = setInterval(\"updateClock()\", 10);\r\n\t}", "title": "" }, { "docid": "0947a8eae6cd0b24246133e8d0a67b50", "score": "0.6420398", "text": "function timer() {\n if (game.timer == -1) {//timer esta inicializado a -1\n game.setTimer();\n startTimer();\n }\n}", "title": "" }, { "docid": "bc4dc71c05a2e440bbd35371c314d9b8", "score": "0.64097035", "text": "function onEventTimer() {\n triggerEvents(inbandEvents), triggerEvents(inlineEvents), removeEvents();\n }", "title": "" }, { "docid": "1626dc9721b52f02f29cd9e1900682c0", "score": "0.63993084", "text": "function timer()\n {\n if(gameover){\n count = 0;\n }\n count=count-1;\n if (count <= 0)\n {\n starCanvasContext.clearRect(0, 0, canvas.width, canvas.height);\n powerupMusic.stop();\n backgroundMusic.play();\n clearInterval(counter);\n //invertColors(true);\n powerup = 0;\n //counter ended, do something here\n return;\n }\n\n //Do code for showing the number of seconds here\n }", "title": "" }, { "docid": "8ceb4a825c3a5f35fa99eafe4095212f", "score": "0.6376947", "text": "function timer() {\n count = count - 1;\n document.getElementById('timer').innerHTML = count;\n if (count === 0) {\n clearInterval(counter);\n return;\n }\n }", "title": "" }, { "docid": "3e28fe787bcea758d3ab92a69ce2b7d7", "score": "0.63754535", "text": "function setTimer(callback){\n ovenTimer = callback || ovenTimer;\n if(imageCount>=bakeCount){\n ovenTimer();\n }\n }", "title": "" }, { "docid": "1fa7bfc5d23ea5429818eb3b33ffd00a", "score": "0.63749725", "text": "function tt(){\n window.clearTimeout(time);\n i();\n}", "title": "" }, { "docid": "d42d5a3b8433723e20ddbd6823d513ca", "score": "0.63730866", "text": "timer() {\n let x = 15;\n const cd = setInterval(() => {\n if (x <= 1){\n setTimeout(function() {\n ak.centerM.html('Time is up! Restarting');\n ak.clock.html(`<h2>Click to start timer</h2>`)\n ak.gameOver();\n clearInterval(cd);\n }, 1500)\n }\n \n ak.clock.html(`<h2>Time Left: ${x}</h2>`)\n x--;\n }, 1000);\n }", "title": "" }, { "docid": "c85e445cb8e807e1ec3e48596b4b0c80", "score": "0.636662", "text": "function countDownTimer(){ \r\n\r\n // Figure out the time to launch\r\n timeToLaunch();\r\n\r\n // Write to countdown component\r\n $( \"#days .timer-number\" ).text(days);\r\n $( \"#hours .timer-number\" ).text(hrs);\r\n $( \"#minutes .timer-number\" ).text(min);\r\n $( \"#seconds .timer-number\" ).text(sec);\r\n\r\n // Repeat the check every second\r\n setTimeout(countDownTimer,1000);\r\n }", "title": "" }, { "docid": "4b3771aef27ea00e8f8abff593d08d74", "score": "0.63624173", "text": "function runTimer()\n{\n \n var num = 30;\n $(\"#timer\").html(\"<div>Time Remaining : \"+ num +\" seconds</div>\");\n intervalTimerId = setInterval(function decrement(){\n \n num --;\n $(\"#timer\").html(\"<div>Time Remaining : \"+ num +\" seconds</div>\");\n \n if(num === 0)\n {\n resultFunction(\"TimeOut\");\n }\n \n },1000);\n}", "title": "" }, { "docid": "91db80f8124a94d61d3a64e44a3c07a3", "score": "0.6356397", "text": "function timer() {\n /* Main Timer */\n \n \n \n miliSecOut = checkTime(milisec);\n secOut = checkTime(sec);\n minOut = checkTime(min);\n hourOut = checkTime(hour);\n \n milisec = ++milisec;\n \n if (milisec === 100) {\n milisec = 0;\n sec = ++sec;\n }\n \n if (sec == 60) {\n min = ++min;\n sec = 0;\n }\n \n if (min == 60) {\n min = 0;\n hour = ++hour;\n \n }\n \n \n document.getElementById(\"milisec\").innerHTML = miliSecOut;\n document.getElementById(\"sec\").innerHTML = secOut;\n document.getElementById(\"min\").innerHTML = minOut;\n document.getElementById(\"hour\").innerHTML = hourOut;\n \n }", "title": "" }, { "docid": "bb632b10d373dea01db09eadbc43f1b4", "score": "0.6352754", "text": "function timer() {\n\t\t\tt = setTimeout(add, 10);\n\t\t}", "title": "" }, { "docid": "b4bc61bb758ef9b1807765ead62334bd", "score": "0.63519686", "text": "function timer() {\n\t\tend_time = new Date().getTime();\n\t\tvar time = end_time - start_time;\n\t\tdocument.getElementById(\"timer\").innerHTML = \"Congratulations! You use \" + (time / 1000) + \" seconds to win!\";\n\t\tconsole.log(\"time used:\" + time);\n\t}", "title": "" }, { "docid": "a82d059afecf032e3cade9ad2bbb17e5", "score": "0.63489115", "text": "function setUptimer(){\n\t time = setInterval(function() {\n\t \tsecond++\n\t \tif (second === 60) {\n\t \t\tsecond = 0;\n\t \t\tminuit ++;\n\t \t\tif (minuit === 60) {\n\t \t\t\tminuit = 0 ;\n\t \t\t\thour++;\n\t \t\t} \t\n\t \t}\n\t \trendertime(hour, minuit, second);\n\t },1000);\n }", "title": "" }, { "docid": "ea73e842b9c4ca13a83d914ee27893c8", "score": "0.6346652", "text": "function startTimer()\n {\n clearTimeout(timer);\n timer = setTimeout(close, time);\n }", "title": "" }, { "docid": "55255052ccdda3486340084cdd7f2289", "score": "0.6329136", "text": "function timer()\n {\n if(gameover){\n count = 0;\n }\n count=count-1;\n if (count <= 0)\n {\n starCanvasContext.clearRect(0, 0, canvas.width, canvas.height);\n backgroundMusic.play();\n powerupMusic.stop();\n clearInterval(counter);\n //invertColors(true);\n powerup = 0;\n //counter ended, do something here\n return;\n }\n\n //Do code for showing the number of seconds here\n }", "title": "" }, { "docid": "0a2254888d8789d2b0b4efc834897dc9", "score": "0.6327165", "text": "function _timer(callback)\r\n{\r\n var time = 0; // The default time of the timer\r\n var mode = 0; // Mode: count up or count down\r\n var status = 0; // Status: timer is running or stoped\r\n var timer_id; // This is used by setInterval function\r\n \r\n // this will start the timer ex. start the timer with 1 second interval timer.start(1000) \r\n this.start = function(interval)\r\n {\r\n interval = (typeof(interval) !== 'undefined') ? interval : 1000;\r\n \r\n if(status == 0)\r\n {\r\n status = 1;\r\n timer_id = setInterval(function()\r\n {\r\n switch(mode)\r\n {\r\n default:\r\n if(time)\r\n {\r\n time--;\r\n generateTime();\r\n if(typeof(callback) === 'function') callback(time);\r\n }\r\n break;\r\n \r\n case 1:\r\n if(time < 106400)\r\n {\r\n time++;\r\n generateTime();\r\n if(typeof(callback) === 'function') callback(time);\r\n }\r\n break;\r\n }\r\n }, interval);\r\n }\r\n }\r\n \r\n // Same as the name, this will stop or pause the timer ex. timer.stop()\r\n this.stop = function()\r\n {\r\n if(status == 1)\r\n {\r\n status = 0;\r\n clearInterval(timer_id);\r\n }\r\n }\r\n \r\n // Reset the timer to zero or reset it to your own custom time ex. reset to zero second timer.reset(0)\r\n this.reset = function(sec)\r\n {\r\n sec = (typeof(sec) !== 'undefined') ? sec : 0;\r\n time = sec;\r\n generateTime(time);\r\n }\r\n \r\n // Change the mode of the timer, count-up (1) or countdown (0)\r\n this.mode = function(tmode)\r\n {\r\n mode = tmode;\r\n }\r\n \r\n // This methode return the current value of the timer\r\n this.getTime = function()\r\n {\r\n return time;\r\n }\r\n \r\n // This methode return the current mode of the timer count-up (1) or countdown (0)\r\n this.getMode = function()\r\n {\r\n return mode;\r\n }\r\n \r\n // This methode return the status of the timer running (1) or stoped (1)\r\n this.getStatus\r\n {\r\n return status;\r\n }\r\n \r\n // This methode will render the time variable to minute:second format\r\n function generateTime()\r\n {\r\n var second = time % 60;\r\n var minute = Math.floor(time / 60) % 60;\r\n \r\n second = (second < 10) ? '0'+second : second;\r\n minute = (minute < 10) ? '0'+minute : minute;\r\n \r\n $('div.timer span.second').html(second);\r\n $('div.timer span.minute').html(minute);\r\n }\r\n}", "title": "" }, { "docid": "17d24ced185c6a64bd91a99103d6194d", "score": "0.63230026", "text": "function interGametimer() {\n interGameno = 6;\n $('.remainderTimerContainer').css('background-color', 'black');\n interGame = setInterval(interGamedec, 1000);\n }", "title": "" }, { "docid": "67043299ea4e4c41418e6b549e2a492b", "score": "0.6322657", "text": "function _timeIntervals() {\r\n setInterval(function () {\r\n _setTimer($closeTimer, endwin);\r\n }, 1000)\r\n }", "title": "" }, { "docid": "fcfdbc107643ec5836949e6b3a53c005", "score": "0.6314737", "text": "function timerFun (){\n\t$(\"#timeRemaining\").text(timer);\n\tintervalId = setInterval(decrement, 1000);\n\tfunction decrement() {\n\t if (timer === 0) {\n\t clearInterval(intervalId);\n\t outOfTimeFun();\n\t }\n\t else if (timer > 0) {\n\t \ttimer--;\n\t }\n\t $(\"#timeRemaining\").text(timer);\n\t}\n}", "title": "" }, { "docid": "65ffa47982dd0b988d623b707a919a00", "score": "0.6294532", "text": "function timerListener (){\n\t\t\t// Se acabo el tiempo\n\t\t\t// Pierde el jugador\n\t\t\tscenario.gotoAndStop(3);\n\t\t}", "title": "" }, { "docid": "884f5d8477c82bcfaede6f0bdb9378e3", "score": "0.62892133", "text": "function timer() {\n count = count - 1;\n if (count <= 0) {\n alert('You were logged out because of 5 minutes non activity!');\n onLogout();\n }\n }", "title": "" }, { "docid": "67c1ceb43d4e3ceaec15c481ed2553ef", "score": "0.62826544", "text": "function timerRun() {\n intervalId = setInterval(countdown, 1000);\n }", "title": "" }, { "docid": "911fc772cdff2055fd527fe8ca5b6e61", "score": "0.6281378", "text": "function countDownTimer(){ \n \n // Figure out the time to launch\n timeToLaunch();\n \n // Write to countdown component\n $( \"#days .number\" ).text(days);\n $( \"#hours .number\" ).text(hrs);\n $( \"#minutes .number\" ).text(min);\n $( \"#seconds .number\" ).text(sec);\n \n // Repeat the check every second\n setTimeout(countDownTimer,1000);\n }", "title": "" }, { "docid": "1bc77e75b01ffa93c71433e6b561eea6", "score": "0.6278437", "text": "function timer() {\n t = setTimeout(deduct, 1000);\n}", "title": "" }, { "docid": "f5fa5142e8f027db25b73fac8fcd9600", "score": "0.62779796", "text": "function timer() {\n var timeElapse = 59;\n count = setInterval(function () {\n //console.log(timeElapse);\n var timeToPrint = timeConverter(timeElapse)\n $(time).text(timeToPrint);\n timeElapse--;\n if (timeElapse < 0) {\n clearInterval(count);\n navForDivs($(\"#results\"))\n $(\"#navigator\").hide();\n checkResults();\n }\n }, 1000)\n\n}", "title": "" }, { "docid": "a0b1503aecd816d25aad9b50a014f4b4", "score": "0.62765163", "text": "function countdown () {\n timer = 20;\n //timer countdown\n time = setInterval(showCountdown, 1000);\n\n }", "title": "" }, { "docid": "0bd0229601956331bef113e637d50d8c", "score": "0.6270453", "text": "function startTimer() {\n var timer = setInterval(function() { \n //If in mq-mobile resolution, don't show the regular timer.\n if ($('#pip').css('display') !== 'block') {\n $('#timer').css('display','block');\n } else {\n $('#timer').css('display','hidden');\n }\n //Updates the text shown on the timer.\n $('#timer').text(--sec);\n $('#pip-timer').text(sec);\n if (sec == 5) {\n $('#timer').css('color', '#FF6A62');\n $('#pip-timer').css('color', '#FF6A62');\n }\n if (sec == 0) {\n clearInterval(timer);\n //This function sets the CSS of the interface when a round has ended.\n setInactiveInterface();\n saveImage(); //Calls getRecentDrawings() in callback.\n } \n }, 1000);\n}", "title": "" }, { "docid": "55120683e7ac7870cd02e540f9efb0d3", "score": "0.6270214", "text": "function startTimer() {\n timeoutId = setInterval(reset, 5500) //When 5 seconds has been reached call doIncative()\n}", "title": "" }, { "docid": "609c9288602848ab103726b5696c6dd1", "score": "0.62678087", "text": "function startTimer(){\n \t$(\".startClock\").empty();\n \t$(\".startbox\").empty();\n \tvar counter = 31;\n \tvar internal = setInterval(function() {\n counter--;\n if (counter >= 0) {\n $(\".timereport\").text(\"Time remaining: \" + counter + \" seconds\");\n }\n if (counter === 0 && !done) {\n alert('Sorry, out of time.');\n $(\".timereport\").empty();\n clearInterval(this);\n done=true;\n finish();\n }\n if (done){\n \t $(\".timereport\").empty();\n clearInterval(this);\n }\n // console.log (\"time is: \" + counter);\n }, 1000);\n}", "title": "" }, { "docid": "226e43890f1f137fe89fab4caf4850cd", "score": "0.6267178", "text": "function startTimer(){\n \n if (time <= 0){\n clearInterval(counter);\n answerTimeout();\n }\n if (time > 0){\n time--; \n }\n //took out the reference to gameDisplay, pointed it to the timer span\n $(\"#timer\").html( time );\n }", "title": "" }, { "docid": "26a10bc9ea15393395aab69aa3b90d96", "score": "0.6258684", "text": "function timer() {\n\n countTime--;\n\n if (countTime <= 0)\n {\n clearInterval(counter);\n //counter ended, do something here\n return;\n }\n // document.getElementById(\"timer\").innerHTML=countTime/100 + \" sek\"; // watch for spelling\n }", "title": "" }, { "docid": "23f1e706b49326dfe3ac073d53c610c5", "score": "0.62528473", "text": "function setRunningTC( hh , mm , ss , ms)\n{\n TIMER_setRunningTC( hh , mm , ss ,ms ); \n}", "title": "" }, { "docid": "4cba3f7136247bfdc2abe6072a416122", "score": "0.6251304", "text": "function countDown(time) {\n\tgTimerInterval = setInterval(function () {\n\t\t$('#timer_spn').text(time);\n\t\ttime--;\n\t}, 900)\n}", "title": "" }, { "docid": "a79be34438459b874a0757e1128bba79", "score": "0.6247641", "text": "function runTimer() {\r\n\t\t\t intervalId = setInterval(decrement, 1000)\r\n\r\n\t\t\t function decrement() {\r\n\t\t\t timer--\r\n\t\t\t $(\".timer\").html(timer)\r\n\t\t\t if (timer === 0) {\r\n\t\t\t clearInterval(intervalId);\r\n\t\t\t alert(\"Time Up\");\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t}", "title": "" }, { "docid": "b66d6fe00f04ea8ed8638c69833e8985", "score": "0.62459505", "text": "function countItDown(){\n startTime -= 1\n $el.text(startTime);\n\n if( startTime <= 0 ){\n // Stop the timer and do the callback.\n clearInterval(timer);\n callback();\n return;\n }\n }", "title": "" }, { "docid": "c64f7b0e0a20b734f0f28e77fa6ee073", "score": "0.6243253", "text": "function timerWrapper() {\n\t// Sets the interval of clock in milliseconds.\n\ttheClock = setInterval(twentySeconds, 1000);\n\t// This function determines whether clear out clock.\n\tfunction twentySeconds() {\n\t\tif (counter === 0) {\n\t\t\tclearInterval(theClock);\n\t\t\tgenerateLossDueToTimeOut();\n\t\t};\n\t\t// Counts down the timer if counter is greater than 0.\n\t\tif (counter > 0) {\n\t\t\tcounter--;\n\t\t};\n\t\t// Appends counter to html of .timer.\n\t\t$(\".timer\").html(counter);\n\t};\n}", "title": "" }, { "docid": "457157b1e0d9936b92492b891449abf4", "score": "0.62374544", "text": "function countDownTimer() {\n console.log(\"in countdown \" + showTimer);\n showTimer--;\n if (showTimer === 0) {\n console.log(\"in timer = 0\");\n $(\"#timer\").html(\"<p> Timer: \" + showTimer + \"</p>\");\n youLose();\n }\n $(\"#timer\").html(\"<p> Timer: \" + showTimer + \"</p>\");\n\n }", "title": "" }, { "docid": "98bb95d439d3ae68d65e582f5b848120", "score": "0.62326545", "text": "function timeoutfunc() {}", "title": "" }, { "docid": "6d6df217d33d2bb3101796874ea38806", "score": "0.6231338", "text": "function clockOut() {\n const watchOut = document.querySelector('.time');\n\n setInterval(() => updateTime(watchOut), 1000);\n }", "title": "" }, { "docid": "8f760353c3cbadecad7c966e510770d7", "score": "0.6230812", "text": "function timer() {\n const timerId = (isMyTurn === true) ? 'my-timer' : 'opponent-timer';\n x = setInterval(function () {\n var minutes = Math.floor((time % (60 * 60)) / (60));\n var seconds = Math.floor((time % (60)) / 1);\n // padding with leading 0\n minutes = (\"00\" + minutes).substr(-2, 2);\n seconds = (\"00\" + seconds).substr(-2, 2);\n // If time is less than 10 seconds, turn timer to red\n if (time <= 10) {\n document.getElementById(timerId).classList.toggle('warning');\n }\n time--;\n // Output the time\n document.getElementById(timerId).innerHTML = minutes + \":\" + seconds;\n\n\n \n // If the count down is over, write some text \n if (time < 0) {\n clearInterval(x);\n document.getElementById(timerId).innerHTML = \"Time\";\n if(isMyTurn) {\n isMyTurn = false;\n displayLose();\n } else {\n displayWin();\n }\n }\n }, 1000);\n}", "title": "" }, { "docid": "b1efecac289a6c6727aa4db6898c0d20", "score": "0.6230579", "text": "function checkOccTimer() {\r\n\tvar left = Math.floor((wendtime - getTime()) / 1000);\r\n\tif (left <= 0) window.clearInterval(wid);\r\n\tupdateOccTimer(left);\r\n}", "title": "" }, { "docid": "1c61f2d2c7ce4c493a659de83a7a30b6", "score": "0.6229782", "text": "function timer() {\n\t\t$(\"#countDown\").html(startCount);\n\t\tstartCount = startCount - 1;\n\t\tconsole.log(startCount);\n\t\tmyTimer = setTimeout(function(){ timer() }, 1000);\n\t\tif (startCount === -1) {\n\t\t\tconsole.log(\"we have reached \" + startCount);\n\t\t\tstopTimer();\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "4e4d7bf83e3a6184fb959a7598235420", "score": "0.62228346", "text": "function timer() {\n\t\t\tif (counter == 5) {\n\t\t\t\torecord.value = text + ' in ' + counter;\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t\tsetTimeout(function () {\n\t\t\t\torecord.value = text + ' in ' + counter;\n\t\t\t\t// orecord.getAtrribute('data-delay', counter);\n\t\t\t\tif (counter == 0) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tcounter--;\n\t\t\t\t\ttimer();\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}", "title": "" }, { "docid": "92796240082387fba28951b213749c76", "score": "0.6216757", "text": "function setTimer(){\n var seconds = 31;\n //the timed loop subtract from the number of seconds for every 1000 milliseconds (1000 miliseconds = 1 second)\n timedLoop(1000, function() {\n seconds = seconds - 1;\n setText(\"timer\",seconds);\n //changes the numbers of the timer to red when the seconds are less than or equal to 10\n if(seconds <= 10){\n setProperty(\"timer\", \"text-color\", \"red\");\n }\n \n if(seconds == 0) {\n stopTimedLoop();\n /* \n When the second reach zero, two buttons appear. The \"homeButton\" take thes player back to the home page \n and the \"endButton\" restarts the game. \n \n */\n showElement(\"endButton\");\n showElement(\"homeButton\");\n onEvent(\"endButton\", \"click\", function( ) {\n setScreen(\"level1\");\n hideElement(\"endButton\");\n hideElement(\"homeButton\");\n level1();\n });\n onEvent(\"homeButton\", \"click\", function( ) {\n setScreen(\"homeScreen\");\n hideElement(\"endButton\");\n hideElement(\"homeButton\");\n });\n \n }\n //The console.log displays the amount of seconds left in the code.\n console.log(seconds + \" seconds are left\");\n });\n}", "title": "" }, { "docid": "a7d94c8113b9d9b4f301a2701cc1fd7b", "score": "0.6214211", "text": "function timer() {\n\t\tvar timerStart = 5;\n\t\t$('#timeRemaining').text(timerStart--);\n\t\ttime = setInterval(\n\t\t\tfunction() {\n\t\t\t\tif(timerStart >= 0) {\n\t\t\t\t\t$('#timeRemaining').text(timerStart--);\n\t\t\t\t}else{\n\t\t\t\t\tunAnswered++;\n\t\t\t\t\tj++;\n\t\t\t\t\t$('.gameContainer').hide();\n\t\t\t\t\t$('.outsideGame').show();\n\t\t\t\t\tclearInterval(time);\n\t\t\t\t\t$('#text').text('Out of Time!');\n\t\t\t\t\t$('#answerCheck').text('The Correct Answer Was: '+prompts[j].theAnswers);\n\t\t\t\t\t$('#image').attr('src', 'https://media3.giphy.com/media/1j9lR5RXCgxAnD74dC/giphy.gif');\n\t\t\t\t\ttimer2();\n\t\t\t}\n\t \t}, 1000);\n\t}", "title": "" }, { "docid": "e5abd91dd465110fe1d90f82d3394648", "score": "0.6208555", "text": "function closetime() {\n\tclosetimer = window.setTimeout(close, timeout2);\n}", "title": "" }, { "docid": "4996deea967f8dec1b5b6c85cbd047bf", "score": "0.6202677", "text": "function timer() {\n\n\t\tif(runTimer === true) {\n\t\t\tcountDown = countDown - 1;\n\n\t\t\t$(\"#timeRemaining\").html(\"Time Remaining: \" + countDown);\n\n\t\t\tif (countDown === 0 && questionsIndex < 5) {\n\t\t\t\tquestionsUnanswered++;\n\t\t\t\tcountDown = 11;\n\t\t\t\tquestionsIndex++;\n\t\t\t\tquestionDisplayer();\n\t\t\t\tanswerChoiceClicker();\n\t\t\t}\n\n\t\t\t//this if statement is when quiz reaches its end and class function to display answers correct/incorrect/unasnwered\n\t\t\t//will error if this is taken out\n\t\t\tif (countDown === 0 && questionsIndex === 5) {\n\t\t\t\tquizResults();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "e4e83447eda70089839fde1f07664c32", "score": "0.62004954", "text": "function timer()\n{\n if (count <= 0) {\n clearInterval(counter);\n return;\n }\n count--;\n displayCount(count);\n}", "title": "" }, { "docid": "d4803095815c6abd6727da297033b85c", "score": "0.6197628", "text": "function timer()\n{\n count=count-1;\n if (count <= 0)\n {\n clearInterval(counter);\n document.getElementById(\"timer\").innerHTML=\"Time is up!\";\n stop();\n //counter ended, do something here\n return;\n }\n randMoleUp();\n document.getElementById(\"timer\").innerHTML=count + \" seconds until mole containment\"; // watch for spelling\n //Do code for showing the number of seconds here\n}", "title": "" }, { "docid": "2298e3aafe2dc828ef995ad6c2405717", "score": "0.61887455", "text": "function timer_on(){\r\n millisecond ++;\r\n milTimer.innerHTML = millisecond;\r\n if(millisecond==10){\r\n millisecond=00;\r\n timer += 01;\r\n secTimer.innerHTML= timer;\r\n }\r\n ;}", "title": "" }, { "docid": "92eb44341b1ef2182bca126e158d5b72", "score": "0.61831546", "text": "timer() {\n console.log(\"timer started\");\n }", "title": "" }, { "docid": "6eb8ac0e4fd0d30c79170dad40b8bad2", "score": "0.6183069", "text": "endTimer(){\n this.duration = 0; \n }", "title": "" }, { "docid": "3b592b9ed48554c842da952d8037413f", "score": "0.6182733", "text": "resetTimer() { this.gameboard.timer.resetCount(); }", "title": "" }, { "docid": "8d290cb979d82d58c3373b81ead78f7b", "score": "0.61744523", "text": "function updateTimer() {\n fill(0);\n if( simpleTimer.expired() ) {\n textSize(100);\n text(\"Why didn't you click me\", width/2, 120);\n waitForClick = true;\n frameRate(2);\n }\n\n else{\n text( Math.round(simpleTimer.getRemainingTime()), width/2, 60)\n }\n}", "title": "" }, { "docid": "72c310caf6b06599638e7c4cada66b71", "score": "0.6173423", "text": "function startTimer() {\n time = setInterval(decrementTimer, 10)\n colorInterval = setInterval(changeTextColor, 60)\n }", "title": "" }, { "docid": "304e3359844dc3f1dd610f1a4dc66074", "score": "0.6172815", "text": "startTimer() {\n\n this.test = this._$interval(() => {\n this.time--;\n this.timer(this.time);\n }, 1000);\n\n }", "title": "" }, { "docid": "72da4bad297e3d7ae8bf507148aac56d", "score": "0.61705965", "text": "function countDownSho() {\n\t\tseconds --;\n\t\tif(seconds < 10) {\n\t\t\t$(\"#time\").html(\"00:0\" + seconds);\n\t\t\t$(\"#time\").css({\"color\": \"red\"});\n\t\t} else {\n\t\t\t$(\"#time\").html(\"00:\" + seconds);\n\t\t\t$(\"#time\").css({\"color\": \"#def\"});\n\t\t}\n\n\t\tif (seconds < 1) {\n\t\t\tclearInterval(time);\n\t\t\tanswered = false;\n\t\t\tshoAnswer();\n\t\t}\n\t}", "title": "" }, { "docid": "72da4bad297e3d7ae8bf507148aac56d", "score": "0.61705965", "text": "function countDownSho() {\n\t\tseconds --;\n\t\tif(seconds < 10) {\n\t\t\t$(\"#time\").html(\"00:0\" + seconds);\n\t\t\t$(\"#time\").css({\"color\": \"red\"});\n\t\t} else {\n\t\t\t$(\"#time\").html(\"00:\" + seconds);\n\t\t\t$(\"#time\").css({\"color\": \"#def\"});\n\t\t}\n\n\t\tif (seconds < 1) {\n\t\t\tclearInterval(time);\n\t\t\tanswered = false;\n\t\t\tshoAnswer();\n\t\t}\n\t}", "title": "" }, { "docid": "da27998981a3f3857ecfcba929207e3c", "score": "0.6170229", "text": "function tick() {\n seconds = seconds - 1;\n updateTimerDisplay();\n t = setTimeout(function() { tick(); }, 1000);\n}", "title": "" }, { "docid": "e56b4d5145be2d0092d7aafe90476ef8", "score": "0.6169383", "text": "function timerSetLoose(){\n $(\"#picture\").html(\"<h1>Wrong Answer</h1>\"); \n var annsw = $(\"<div>\");\n annsw.html(\"<h1>\")\n $(\"#picture\").html(\"<h1>correct answer is\"+\"\"+Quiz.data[index].ans+\"</h1>\");\n var timeoutID = window.setTimeout(function(){\n $(\"#picture\").html(\"\");\n stop();\n flag =true;\n }, [5000]); \n}", "title": "" }, { "docid": "ca9ceff5506a6eeaa52585d998b55701", "score": "0.6168812", "text": "function timerMy(counter) {\n if (!isEdned && (counter > 0)) {\n setTimeout(function () { timerMy(counter - 1) }, 1000);\n } else {\n isTimeout = true;\n if (!(counter > 0)) {\n // console.log('resault: ' + isResault);\n // } else {\n throw new Error(\"timeOut_MY\")\n }\n\n }\n}", "title": "" }, { "docid": "85cdb30af0654951394276b28bdd894e", "score": "0.61656076", "text": "function timerMy(counter) {\n if (!isEdned && (counter > 0)) {\n setTimeout(function () { timerMy(counter - 1) }, 1000);\n } else {\n isTimeout = true;\n if (counter > 0) {\n console.log('resault: ' + isResault);\n } else {\n throw new Error(\"timeOut_MY\")\n }\n\n }\n}", "title": "" } ]
32512ee75bbb1662e3409a6512a7f14b
Determine if a user has applied for a grant.
[ { "docid": "431a4ceb0ad1c1bbba8e6c607ec4fb44", "score": "0.61077267", "text": "async applicationExists(userId, grantId) {\n const application = await this.connection.getRepository(ApplicationInformationDBO_1.ApplicationInformationDBO).findOne({ userId: userId, grantId: grantId });\n return application !== undefined;\n }", "title": "" } ]
[ { "docid": "391acad4c0c56aa2acd41ae8f7f02596", "score": "0.6231165", "text": "async validUser() {\n const grantAcess = await this.verify();\n return grantAcess;\n }", "title": "" }, { "docid": "a1099f106ca3985a5b93aeb76138f8c5", "score": "0.57780343", "text": "isUserInApp(user) {\n let roles = this.props.existingUsers;\n let userPresent = _.find(Object.keys(roles), (roleId)=>{\n return _.find(roles[roleId], (existingUser)=>{\n return existingUser.userId === user.userId;\n });\n });\n return Boolean(userPresent);\n }", "title": "" }, { "docid": "0c906be0bed4789b1a32850f9ef24561", "score": "0.5698297", "text": "function hasUserWonMatch() {\n\tif(_selectedFighterObj.healthPoints > 0 && _selectedDefenderObj.healthPoints <= 0) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "62b4d1ac82af88dbd3c435fb8dbd280f", "score": "0.56816036", "text": "hasUser(userId) {\n const result = this.data[userId];\n if (!result) return false;\n return true\n }", "title": "" }, { "docid": "2f2e5ef64db966261fd71b69d2b1b6c6", "score": "0.55957466", "text": "function hasPermissions(user) {\r\n if(user.status == 'admin') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "0dd194218dae900f3c5a2fe5f0053ccc", "score": "0.5567756", "text": "check(user, document) {\n if (options.editCheck) {\n return options.editCheck(user, document);\n }\n\n if (!user || !document) return false;\n // check if user owns the document being edited. \n // if they do, check if they can perform \"foo.edit.own\" action\n // if they don't, check if they can perform \"foo.edit.all\" action\n return Users.owns(user, document) ? Users.canDo(user, `${collectionName.toLowerCase()}.edit.own`) : Users.canDo(user, `${collectionName.toLowerCase()}.edit.all`);\n }", "title": "" }, { "docid": "8932830b3d23738ae016c7aaa0a03c17", "score": "0.55618274", "text": "IsReviewer(){\n\t\tfor (var i = 0; i < this.submissions.length; i++)\n\t\t\tfor (var j = 0; j < this.submissions[i].reviewers.length; j++)\n\t\t\t\tif (this.submissions[i].reviewers[j].includes(userInfo['email']))\n\t\t\t\t\treturn 1;\n\t\t\t\t\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "85c90b9dcc2a4eb992e9ad7967b9ee8c", "score": "0.55011207", "text": "userHasScopes(scopes) {\n const grantedScopes = (_scopes || \"\").split(\" \")\n return scopes.every(scope => grantedScopes.includes(scope))\n }", "title": "" }, { "docid": "281ca03de46d5fde205a2a872dfe86f8", "score": "0.54979366", "text": "check(user, document) {\n if (options.newCheck) {\n return options.newCheck(user, document);\n }\n // if user is not logged in, disallow operation\n if (!user) return false;\n // else, check if they can perform \"foo.new\" operation (e.g. \"movies.new\")\n return Users.canDo(user, `${collectionName.toLowerCase()}.new`);\n }", "title": "" }, { "docid": "3700473497b92109315c1918433b9593", "score": "0.5477466", "text": "needsReview() {\n return this.isLoggedIn() && this.user.settings.needsReview\n }", "title": "" }, { "docid": "3700473497b92109315c1918433b9593", "score": "0.5477466", "text": "needsReview() {\n return this.isLoggedIn() && this.user.settings.needsReview\n }", "title": "" }, { "docid": "bab4926666afce7419a763cceede5f63", "score": "0.54432327", "text": "checkIfCurrentUser(mappedUserId, currentUserId) {\n return mappedUserId === currentUserId;\n }", "title": "" }, { "docid": "4e8b91e231a89e9541369b0d03d4861f", "score": "0.5432199", "text": "async function checkAccess(projectID, userID, userType, userRole) {//userRole is not implemented at ttime of writing\n var permitted = false;\n //if the use is a director, check if they are the director of the project\n if (userType === \"director\") {\n var result = await knex.from(\"project\").count('* AS count').where({\n projectID: projectID.valueOf(),\n userID: userID.valueOf(),\n });\n permitted = (result[0].count > 0);\n //if the user is a user, check if they are a collaborator on the project\n } else if (userType === \"user\") {\n var result = await knex.from(\"collaborators\").count('* AS count').where({\n projectID: projectID.valueOf(),\n userID: userID.valueOf(),\n });\n permitted = (result[0].count > 0);\n }\n return permitted;\n}", "title": "" }, { "docid": "61f1ee537d834a78f87cca7fff9bb181", "score": "0.5410824", "text": "async userInFirestore() {\n let bool = false\n await firestore.collection('userInfo').get().then(snap => {\n snap.forEach(doc => {\n if (doc.id === this.email) {\n bool = true\n }\n })\n })\n return bool;\n }", "title": "" }, { "docid": "2f9c073418d15ea387476024bb188dad", "score": "0.54013294", "text": "static _canModify(user, doc, data) {\n if (user.isGM) return true; // GM users can do anything\n return doc.data.author === user.id; // Users may only update their own created drawings\n }", "title": "" }, { "docid": "98ef873af36e5c88bef50daf463a71cb", "score": "0.5360327", "text": "function hasUserLost() {\n\tif(_selectedFighterObj.healthPoints <= 0 && _selectedDefenderObj.healthPoints > 0) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "ada0e5e98acb3ee0e6622d7c7c8bf65a", "score": "0.5348776", "text": "function hasUserChanged (user) {\n (user.latitude) ||\n (user.longitude) ||\n (user.profileText)\n }", "title": "" }, { "docid": "28fce3b9b5cb48fc7e9804cfb3b00d87", "score": "0.5337324", "text": "static isUserOwner(story) {\n if (!story) return false\n\n // doing string compare because of auth payload \n return story.postedBy._id === Auth.getPayload().sub\n }", "title": "" }, { "docid": "ff11c4a808910484716c6512c7faa1de", "score": "0.53273654", "text": "async allows(action, ...args) {\n this.resolveUser();\n const { authorized } = await this.authorizeAction(action, args);\n return authorized === true;\n }", "title": "" }, { "docid": "42761fe8f87fcee0ec01a500ce44f97a", "score": "0.53221744", "text": "isReassignedToUser(user) {\n return !!this._reassignees.find((reassignee) => {\n if (reassignee) {\n return String(reassignee._id) === String(user._id);\n }\n return false;\n });\n }", "title": "" }, { "docid": "f02196b0759e679c43499733fdc9bf8d", "score": "0.5316233", "text": "isReviewer() {\n return this.isLoggedIn() && this.user.settings.isReviewer\n }", "title": "" }, { "docid": "f02196b0759e679c43499733fdc9bf8d", "score": "0.5316233", "text": "isReviewer() {\n return this.isLoggedIn() && this.user.settings.isReviewer\n }", "title": "" }, { "docid": "1a5cc36cbf75b9983654e97a1d61116e", "score": "0.5316104", "text": "checkPermission(idUser) {\n const profileName = Roles.getScopesForUser(idUser)[0];\n return Roles.userIsInRole(idUser, this._permissions, profileName);\n }", "title": "" }, { "docid": "f7a0db8cf04350bce9d4a1b074ad36f9", "score": "0.5267177", "text": "hasBeenReviewed(peer) {\n const {\n reviewed,\n reviewer,\n userId,\n mainView,\n } = this.props;\n const peerId = peer.id.toString();\n let reviewerId = reviewer.id ? reviewer.id.toString() : userId;\n\n if (mainView === VIEW_ANSWERS_VIEW) {\n reviewerId = reviewer.id && reviewer.id.toString();\n }\n\n return !!reviewed.find(r => {\n return r.reviewedId === peerId && reviewerId === r.reviewerId;\n });\n }", "title": "" }, { "docid": "ec67e125f756602779e74b1d3babfc68", "score": "0.52594006", "text": "function isAuthValid() {\n return getOAuthService().hasAccess();\n}", "title": "" }, { "docid": "71aab907ded8be3cd06a641e2efae7e1", "score": "0.52569646", "text": "function checkRequiredUsers(member, command) {\n return command.requiredUsers.includes(member.id);\n}", "title": "" }, { "docid": "4cfd3be4897c292e7171fd24b4141d26", "score": "0.5246849", "text": "function isEnrolledOrPending(r){ return r.enrolled || r.pending; }", "title": "" }, { "docid": "6f7727727eed82ecbdc527f25b9f6e79", "score": "0.5246799", "text": "hasUserMediaApproval() {\n return this.userMediaApproval || false;\n }", "title": "" }, { "docid": "848d373181014d1925baab31a42c5f46", "score": "0.5242166", "text": "function canComplete() {\n return state.accounts.data.email && state.accounts.data.personId;\n }", "title": "" }, { "docid": "3b8a27c9e3eb5b2667c59d45d60efc38", "score": "0.52059543", "text": "function checkParam() {\n // if course being accessed -> compare user to course\n if (req.params.id) {\n if (user.id === course.userId) {\n return true\n // if there's no match send 403(Forbidden) status code\n } else {\n res.status(403).send(`User: ${credentials.name} not authorized`)\n return false\n }\n // if user being accessed check if user exists\n } else if (user) {\n return true\n } else {\n return false\n }\n }", "title": "" }, { "docid": "203a4a1de67139c474d48140f16af40b", "score": "0.5191346", "text": "function hasUserOptedInOrOut () {\n const insightOptOut = insight.realOptOut === undefined;\n return !(insightOptOut);\n}", "title": "" }, { "docid": "3c2a096ecd581b59372d04e6202990c2", "score": "0.5174612", "text": "@computed get check() {\n return (this.jwt && !_.isEmpty(this.user)) ? true : false;\n }", "title": "" }, { "docid": "7e4e7f534e8ae1bf58b5bea33a99c5f3", "score": "0.51717037", "text": "function IsAlexaPreviewUserRequest(context, sessionHandler) {\n\n let userId = sessionHandler.event.session.user.userId;\n let previewUser = alexaPreviewUsers ? alexaPreviewUsers[userId] : null;\n\n if (previewUser) {\n // alexaPreviewUsers\n\n logger.addProperty(context, \"previewUser\", previewUser);\n return true;\n }\n\n\n return false;\n}", "title": "" }, { "docid": "dcfc7592248969d501de3f12615843b4", "score": "0.51458484", "text": "isUserOwner() {\n this.authService.getCurrentUser().subscribe((user) => Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n this.user = user;\n yield this.projectPromise;\n this.isOwner = this.user.uid === this.project.uid;\n }));\n }", "title": "" }, { "docid": "3bb59ae014477541927cdcdacf927749", "score": "0.5143452", "text": "function authUserTournament(user, tournament) {\n return tournament.userId === user._id\n}", "title": "" }, { "docid": "429a387a63c7a345718dfd143789085a", "score": "0.5141568", "text": "function check_if_user_is_known(doc) {\n\tlog.info(\"Checking is user %s is known.\", doc.owner);\n\treturn new Promise(function(resolve,reject) {\n\t\tusers.findOne({ login: doc.owner }, function(err,user) {\n\t\t\tlog.info(\"Checked if the user %s is known.\", doc.owner);\n\t\t\tif(err)\n\t\t\t\tthrow err;\n\t\t\tif(user)\n\t\t\t\tresolve(true);\n\t\t\telse\n\t\t\t\tresolve(false);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "53b9c7993f8e49ec81463ff5368e9b2a", "score": "0.5132392", "text": "function checkIfUserHasQueryPermission() {\n var index = $scope.permissions.indexOf(Permissions.CONSULTAR_SALIDAS);\n if (index > -1) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "0cabbfcc9f75ba51e3beb0981e4cb0f8", "score": "0.51317215", "text": "isAuthorized(state, getters, rootState) {\n const playSpace = state.current\n if (!playSpace || !playSpace.users) return false\n if (!rootState.user.username) return false\n if (playSpace.users[rootState.user.username] === \"owner\") {\n return true\n }\n return false\n }", "title": "" }, { "docid": "f942610da4d317666990781c51abcdf4", "score": "0.51123774", "text": "function calculateGranted(grants) {\n return grants.reduce((total, grant) => {\n return total.plus(grant.amount)\n }, BigNumber(0))\n}", "title": "" }, { "docid": "f942610da4d317666990781c51abcdf4", "score": "0.51123774", "text": "function calculateGranted(grants) {\n return grants.reduce((total, grant) => {\n return total.plus(grant.amount)\n }, BigNumber(0))\n}", "title": "" }, { "docid": "b599e5b12c50ff633c7f00db9c3f5ca3", "score": "0.5104729", "text": "function userHasScopes(scopes) {\n var savedScopes = JSON.parse(localStorage.getItem('scopes'));\n if (!savedScopes) {\n return false;\n }\n\n var grantedScopes = savedScopes.split(' ');\n\n for (var i = 0; i < scopes.length; i++) {\n if (grantedScopes.indexOf(scopes[i]) < 0) {\n return false;\n }\n }\n \n return true;\n }", "title": "" }, { "docid": "be356394a13c718ab3fa29915e6bba29", "score": "0.508495", "text": "checkIfUserHasAccess(user, eventID){\n return checkIfUserHasAccess(user, eventID);\n }", "title": "" }, { "docid": "ad4505d4188b95adec78e06f45de5e0a", "score": "0.5079128", "text": "function authorizer (name, password) { \n return currentUsers.some(user => user.name === name && user.pass === md5(password)) \n}", "title": "" }, { "docid": "bcb891058ef80180198410555d78571c", "score": "0.5070934", "text": "function permProfile(user, profile){\n\treturn(\n\t\tuser.role === ROLE.ADMIN || \n\t\tprofile.userId === user.id\n\t\t)\n}", "title": "" }, { "docid": "603069878a37e9d0835e7976002e1f79", "score": "0.5065903", "text": "function userHasClass(){\n var tankRole = message.guild.roles.find(\"name\", \"cTank\");\n var mageRole = message.guild.roles.find(\"name\", \"cMage\");\n var archerRole = message.guild.roles.find(\"name\", \"cArcher\");\n var healerRole = message.guild.roles.find(\"name\", \"cHealer\");\n\n if(message.member.roles.has(tankRole.id)) {\n console.log(\"Has tank\");\n return true;\n }\n if(message.member.roles.has(mageRole.id)) {\n console.log(\"Has mage\");\n return true;\n }\n if(message.member.roles.has(archerRole.id)) {\n console.log(\"Has archer\");\n return true;\n }\n if(message.member.roles.has(healerRole.id)) {\n console.log(\"Has healer\");\n return true;\n }\n else {\n console.log(\"User did not have any classes set\");\n return false;\n } \n }", "title": "" }, { "docid": "b69874f9b7a4f0f1c0ae933678fc2c17", "score": "0.50582707", "text": "function IsIngelogd() {\n return (localStorage.getItem('user_id') !== null);\n}", "title": "" }, { "docid": "9f18f236b23eeb01719ffa46a4d19ebc", "score": "0.50438666", "text": "get hasUser() {\n return !!this.props.data.user;\n }", "title": "" }, { "docid": "57652c073f84e2b16b28aa23e1f61e7e", "score": "0.5033842", "text": "function isMe (userId) {\n return (parseInt(userId) === Bkg.account.get('id'));\n}", "title": "" }, { "docid": "581e17740cb28fffd75ca78a7d0255e6", "score": "0.503081", "text": "function isAllowed (user, level) {\n\tswitch (level) {\n\t\tcase 'user':\n\t\t\treturn !!user.name\n\t\tcase 'noUser':\n\t\t\treturn !user.name\n\t\tcase 'mod':\n\t\t\treturn ['mod', 'admin'].includes(user.role)\n\t\tcase 'admin':\n\t\t\treturn user.role === 'admin'\n\t\tdefault:\n\t\t\treturn false\n\t}\n}", "title": "" }, { "docid": "06904a865cd77df9a0a23b8f394a9b44", "score": "0.5026222", "text": "function ownsRoom(user) {\n lunchrooms.forEach(function(room) {\n if (room['creator'] === user) {\n return true;\n }\n });\n return false;\n}", "title": "" }, { "docid": "079f7d4fb9653add8e9b4b92aaef97ec", "score": "0.50059336", "text": "function userCheck(req, res, next) {\n if(new ObjectId(req.params.user_id).equals(req.user._id)){\n next();\n }else {\n res.status(401).send('You trying to access others data');\n }\n }", "title": "" }, { "docid": "fb10b4f111c7c0671aa2af352a8f9720", "score": "0.5003886", "text": "async canAddUser(outing_id, user_id, allowed = false) {\n const querySnapshot = await this.outingsRef.doc(outing_id).get();\n const outingFull =\n querySnapshot.data().max_people <= querySnapshot.data().going_count;\n const userStatus = await this.db.groups.getUserStatus(outing_id, user_id);\n const closedOuting = querySnapshot.data().closed;\n if ((!closedOuting || allowed) && userStatus != \"going\" && !outingFull) {\n this.outingsRef.doc(outing_id).update({\n going_count: querySnapshot.data().going_count + 1\n });\n this.db.users.setOuting(\n outing_id,\n user_id,\n \"going\",\n querySnapshot.data().datetime\n );\n return \"going\";\n } else if (!userStatus) {\n this.db.users.setOuting(\n outing_id,\n user_id,\n \"pending\",\n querySnapshot.data().datetime\n );\n return \"pending\";\n } else {\n return \"\";\n }\n }", "title": "" }, { "docid": "ad7d78576566c75427ff63d2f06dfebd", "score": "0.5002387", "text": "async function awaitingRefereeRequest(user_id){\r\n const user_referee_requests = await DButils.execQuery(\r\n `SELECT * FROM dbo.RequestRole WHERE (userId=${user_id} AND\r\n roleId=${process.env.refereeRole})`\r\n );\r\n if (user_referee_requests.length == 0){\r\n return false\r\n }\r\n return true\r\n}", "title": "" }, { "docid": "b0c6e1b9ee71de2995de535e530cde76", "score": "0.49993688", "text": "function isUserRoleOnlyUser() {\n var roles = Knack.getUserRoles();\n if (roles.length === 1 && roles[0] === \"object_10\") {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "1092ef99f7d885d57e95a4bca2cc1e5f", "score": "0.49973693", "text": "function isAuth(item){\n return suggestion.authsId.includes(item.id);\n }", "title": "" }, { "docid": "4fc8e4295a776721eed062bf99febbeb", "score": "0.49970496", "text": "function basicEligibility (user) {\n let unSubbed = user.contactMeta.unSubbed\n let createdInMs = new Date(user.createdAt).getTime()\n let weekInMs = 7 * 24 * 60 * 60 * 1000\n let tooSoon = createdInMs + weekInMs > Date.now()\n\n // if user has unSubbed or it's too soon, user is not eligible\n return !((unSubbed || tooSoon))\n}", "title": "" }, { "docid": "dd1aa25212fa9c83f3081f2ce5be080d", "score": "0.4993454", "text": "function isUserPresent(response) {\n\n if(response) {\n\n UserService.setCurrentUser(response);\n\n // if success from user present change url to profile\n $location.url(\"/profile\");\n }\n }", "title": "" }, { "docid": "90bdbe76f18b92256483c566274ebfe3", "score": "0.49838036", "text": "userProfileHasLoaded(){\n\t\tif(resources.username().waitForVisible(10000) &&\n\t\tresources.settingsToolBar().waitForVisible(10000)){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "a927725882575ece2f9c1d1bdca2061a", "score": "0.49758187", "text": "function hasPermission(viewId, actionName) {\n var desc = getViewDesc(viewId);\n var state = store.getState();\n var permissions = Object.assign({}, desc.permissions, state.core.permissions[viewId]);\n return typeof permissions[actionName] === 'undefined' || permissions[actionName];\n}", "title": "" }, { "docid": "49e2ebc49f3fa24b49751cd9bbb35e11", "score": "0.49710134", "text": "function tenantExists(tenant, callback) {\n // Create URL for user-manager request\n var userExistsUrl = userURL + '/pool/' + tenant.userName;\n\n // see if the user already exists\n request({\n url: userExistsUrl,\n method: \"GET\",\n json: true,\n headers: {\"content-type\": \"application/json\"}\n }, function(error, response, body) {\n if (error) {\n callback(false);\n } else if ((response != null) && (response.statusCode == 400)) {\n callback(false);\n } else {\n if (body.userName === tenant.userName) {\n callback(true);\n } else {\n callback(false);\n }\n }\n });\n}", "title": "" }, { "docid": "5286ea5b7f0fe2a9bf8d84858b32395f", "score": "0.49633563", "text": "function isUserAuthorized (socialUserId) {\n let result = findInAccessList((authorizedUser) => {\n return authorizedUser.uid === socialUserId\n })\n\n if (result) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "1b61a5d355f49fc7c44dd594d63b836c", "score": "0.4961992", "text": "hasPendingRequest(chatUserKey) {\n return this.pendingRequests[chatUserKey] != null;\n }", "title": "" }, { "docid": "1521e827608364a91de8c8b2a1150487", "score": "0.49604112", "text": "function hasStandup(who, cb) {\n \n var user = who.user;\n var channel = who.channel;\n controller.storage.teams.get('standupData', function(err, standupData) {\n if (!standupData || !standupData[channel] || !standupData[channel][user]) {\n cb(null, false);\n } else {\n cb(null, true);\n }\n });\n}", "title": "" }, { "docid": "292fdca06a0ca626ee4d2ef7828373c1", "score": "0.49457812", "text": "function isAuthenticated() {\n return !!user;\n }", "title": "" }, { "docid": "0218936575ff963ee96de452c443351a", "score": "0.49455202", "text": "can(id, perm) {\n let auth = false;\n if (!id || !perm) {\n throw new Error('no input fields');\n } else {\n this.keys.forEach(key => {\n if (key.userId == id && key.permissionId == perm) {\n auth = true;\n }\n });\n }\n return auth;\n }", "title": "" }, { "docid": "4211fd4bf87d089bb8144bdec049f7c2", "score": "0.4941859", "text": "function checkScope(req) {\n return req.user\n && typeof req.user.scope === 'string'\n && req.user.scope.split(' ').includes('admin');\n}", "title": "" }, { "docid": "ef325570ed8362d50f16db916385bc01", "score": "0.4941701", "text": "async function checkUserExists(userRef) {\n // grab the user doc\n const userDoc = await userRef.get();\n // return true/false\n return userDoc.exists;\n}", "title": "" }, { "docid": "e2844014bf7e9e5586215cf74b14cb10", "score": "0.493385", "text": "function isEveryoneHere(obj) {\n if (users.hasOwnProperty('Alan', 'Jeff', 'Sarah', 'Ryan'))\n {\n return true;\n }\n else \n {\n return false;\n }\n}", "title": "" }, { "docid": "60b3754da6ca4a8ff181a0d6cfaa1433", "score": "0.49295434", "text": "isOneTouchAuthorized(uuid, callback) {\n let url = `/onetouch/json/approval_requests/${uuid}`;\n\n authy._request(\"get\", url, {}, (err, response) => {\n if (err) {\n return callback(err);\n }\n let status = response.approval_request.status;\n\n callback(null, status);\n });\n }", "title": "" }, { "docid": "bd387158008523657f372d092448da7a", "score": "0.49242538", "text": "isUpdatePermitted() {\n return this.checkAdminPermission('update')\n }", "title": "" }, { "docid": "2cfa4d90f67fa70d29c904316f83dae9", "score": "0.49221113", "text": "isSuperUser() {\n return this.isLoggedIn() &&\n !!_find(this.user.grants, {role: ROLE_SUPERUSER})\n }", "title": "" }, { "docid": "4930b5215c6db1eb80b7fb8b6b284cc7", "score": "0.49184507", "text": "isUserLoggedIn() {\n //console.log(`User registered button should be present`);\n return this.userRegisteredButton.isExisting();\n }", "title": "" }, { "docid": "1551924f85d7c3945771de35cf05931d", "score": "0.49160922", "text": "function hasProfile() {\n if (!store.has('ui.profile.url') || !store.has('ui.profile.user') || !store.has('ui.profile.password')) {\n return false;\n }\n if (!store.get('ui.profile.url') || !store.get('ui.profile.user') || !store.get('ui.profile.password')) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "9dc44aacc8f8b026d610760a32bb00ae", "score": "0.49159735", "text": "function r(e) {\n return !!(e && (e.accessToken || e.idToken || e.refreshToken) && Array.isArray(e.scopes));\n }", "title": "" }, { "docid": "91058f3c150ff0a9671ac6a5c472e548", "score": "0.490208", "text": "checkConsent() {\n let isConsentSet = localStorage.getItem('consent');\n return (isConsentSet && isConsentSet === 'true');\n }", "title": "" }, { "docid": "547db3427d1b7fafd84663f6eebcee21", "score": "0.48978537", "text": "function isIntermediateUser(){\n return ISROLE(fieldUserInterRolesGV);\n}", "title": "" }, { "docid": "651dfb2fcf9313628dc2290ee923fc0e", "score": "0.4897415", "text": "function hasUserWonGame() {\n\tif(_selectedFighterObj.healthPoints > 0) {\n\t\tfor(var i=0; i<_availableEnemyObjects.length; i++) {\n\t\t\tvar curObj = _availableEnemyObjects[i];\n\n\t\t\t// If any available enemies with hasBeenDefeated set to true exist\n\t\t\t// the user has not won the game yet, so don't continue checking\n\t\t\tif(!curObj.hasBeenDefeated) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// Execution should only reach here if all available enemies \n\t\t// have been defeated.\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "c81a3d252e374cf4a34a46af2824031c", "score": "0.48969942", "text": "function CheckUserRole(edition, action) {\n var userRoleCheck;\n //Get user role.\n if (edition !== \"M\" || !$.isEmptyObject(edition)) {\n // The selected plan edition is PDM or OPS \n if (edition === \"O\" || edition === \"P\") {\n //Return false if R&D role is null\n if ($scope.userRole.rdRole === null) return false;\n userRoleCheck = $scope.userRole.rdRole;\n } else if (edition === \"A\") {\n //Return false if R&D role is null\n if ($scope.userRole.facRole === null) return false;\n userRoleCheck = $scope.userRole.facRole;\n }\n } else {\n return false;\n }\n\n //If user role is not null then check action permission\n if (!$.isEmptyObject(userRoleCheck)) {\n if (action === AddRole) {\n return userRoleCheck.IsAdd === \"1\";\n } else if (action === UpdateRole) {\n return userRoleCheck.IsUpdate === \"1\";\n } else if (action === DeleteRole) {\n return userRoleCheck.IsDelete === \"1\";\n } else if (action === ConfirmRole) {\n return userRoleCheck.IsConfirm === \"1\";\n } else if (action === ExportRole) {\n return userRoleCheck.IsExport === \"1\";\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "3d1257ef85e03d397645c702187b6cfd", "score": "0.48969308", "text": "function isAuthorized () {\n let {localStorage} = window\n let {user, token} = localStorage\n\n let isAuth = false\n let isStaff = false\n let active = false\n\n if (token && user) {\n // If user exist store user in vuex\n user = JSON.parse(user)\n\n active = user.status !== 'created'\n isAuth = true\n isStaff = user.permissions !== 'user'\n\n store.dispatch('app/isAuth', isAuth)\n store.dispatch('user/setUser', user)\n }\n\n return {\n user,\n token,\n active,\n isAuth,\n isStaff\n }\n}", "title": "" }, { "docid": "83eb373cf3f4b3ecef7c451882b8444c", "score": "0.48953706", "text": "function tellUser(sourceUser, targetUser) {\n var interested = Math.random();\n\n /**\n * This user has already seen the concept.\n **/\n if (pastUsers.hasOwnProperty(targetUser.name)) {\n return false;\n }\n\n /**\n * Did the source user's pitch convince the new user? Does the new\n * user see value in the product?\n **/\n if (interested < getConfig('userValue')) {\n return true;\n }\n \n return false;\n }", "title": "" }, { "docid": "fc4eb448fd61792fdf9cd70e601393fc", "score": "0.48808703", "text": "function shouldFetchUser(state)\n{\n const user = state.user;\n\n if (!user.user) {\n return true;\n } else if (user.isFetching) {\n return false;\n } else {\n return user.didInvalidate;\n }\n}", "title": "" }, { "docid": "320ba2d278399aae98153e6506939486", "score": "0.48790133", "text": "isUserLoggedIn() {\n let user = sessionStorage.getItem('user');\n let userId = sessionStorage.getItem('userId');\n let role = sessionStorage.getItem('role');\n return user !== null && userId !== null && role !== null\n }", "title": "" }, { "docid": "8063406462a1f5455f728edb7189909f", "score": "0.48767683", "text": "function grantTypeAllowed(clientID, grantType, callback) {\n\n callback(false, true);\n}", "title": "" }, { "docid": "177802f330035e5094d1af6f5bc6d172", "score": "0.48606443", "text": "function isCorrect(root, args, context, info) {\n const { userId, isInstructor } = getUserInfo(context);\n // If it’s not an instructor, always return false\n if (!isInstructor) {\n throw Error('Student role can not access isCorrect');\n }\n // Otherwise, return the actual value\n return root.isCorrect;\n}", "title": "" }, { "docid": "3d78ffafebf4566ddd798f175c23e2dd", "score": "0.4853891", "text": "get grantPrincipal() {\n return this.project.grantPrincipal;\n }", "title": "" }, { "docid": "3d78ffafebf4566ddd798f175c23e2dd", "score": "0.4853891", "text": "get grantPrincipal() {\n return this.project.grantPrincipal;\n }", "title": "" }, { "docid": "2daf5c1a05d40f32b0561cac14557b6a", "score": "0.48514953", "text": "checkAdminPageAccess() {\n if (this.state.userLogged == true) {\n if (this.state.userRole == 0) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "4ab97d490f949e9a6a103afc80f6190b", "score": "0.4848719", "text": "function isEqual(user, target) {\n if (user && target) {\n return user === target;\n }\n return false;\n}", "title": "" }, { "docid": "1cc16c0b1fc78d7d12a2a46f2aa335b9", "score": "0.48465604", "text": "function validateUserId() {\r\n if (Meteor.userId()) {\r\n Meteor.clearTimeout(id);\r\n Router.reload();\r\n return roleCheck();\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "eea89da54773894699995f9324eb71e8", "score": "0.48432377", "text": "function checkHasMyRecordsFilter(el, filter) {\n var filterFound = false;\n if (indiciaData.esScope === 'user') {\n return true;\n }\n if (typeof filter.bool_queries !== 'undefined') {\n filter.bool_queries.forEach((qry) => {\n if (qry.bool_clause === 'must' && typeof qry.field !== 'undefined' && qry.field === 'metadata.created_by_id'\n && typeof qry.query_type !== 'undefined' && qry.query_type === 'term'\n && typeof qry.value !== 'undefined' && qry.value == indiciaData.user_id) {\n filterFound = true;\n }\n });\n }\n return filterFound;\n }", "title": "" }, { "docid": "d9ca6c1e09ac2c7c64ff9e8b1dad4c0f", "score": "0.4841366", "text": "function shouldAddUser(user) {\n if (user.type === 'anonymous') {\n return false;\n }\n\n if (typeof user.status === 'undefined') {\n console.error(\"User status is undefined. Not adding to relatedUsers aggregate.\");\n return false;\n }\n return user.status === 'current' && !usernames.has(user.username);\n }", "title": "" }, { "docid": "d9ca6c1e09ac2c7c64ff9e8b1dad4c0f", "score": "0.4841366", "text": "function shouldAddUser(user) {\n if (user.type === 'anonymous') {\n return false;\n }\n\n if (typeof user.status === 'undefined') {\n console.error(\"User status is undefined. Not adding to relatedUsers aggregate.\");\n return false;\n }\n return user.status === 'current' && !usernames.has(user.username);\n }", "title": "" }, { "docid": "44d90016950398ed65745223d3d489c3", "score": "0.48384643", "text": "static async checkUser(userId) {\n const query = 'SELECT * FROM \"Users\" WHERE user_id = $1';\n const user = await pool.connect(query, [userId]);\n if (user[0].is_admin === true) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "5eb3017014647ce2fb5b4db78da80448", "score": "0.48361906", "text": "async function userVerified()\n{\n accessToken = await getToken();\n if(!accessToken)\n {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "190df0e550eef1676195946dc4b83ec7", "score": "0.4832634", "text": "checkUser() {\n let doesExit = false\n this.state.admin.forEach(x => {\n if(x.email === this.state.email) {\n doesExit = true;\n }\n });\n return doesExit;\n }", "title": "" }, { "docid": "30bfb931485dd1e8411d99b17a6e9973", "score": "0.48320773", "text": "async checkGrantAccessAndQuerySessionInfo(){\n let requestAccessResult = \"\"\n await this.requestAccess().then((result)=>{requestAccessResult=result})\n\n let accessGranted = JSON.parse(requestAccessResult)\n console.log(accessGranted)\n \n // check if user is logged in CortexUI\n if (\"error\" in accessGranted){\n console.log('You must login on CortexUI before request for grant access then rerun')\n throw new Error('You must login on CortexUI before request for grant access')\n }else{\n console.log(accessGranted['result']['message'])\n // console.log(accessGranted['result'])\n if(accessGranted['result']['accessGranted']){\n await this.querySessionInfo()\n }\n else{\n console.log('You must accept access request from this app on CortexUI then rerun')\n throw new Error('You must accept access request from this app on CortexUI')\n }\n } \n }", "title": "" }, { "docid": "a86fb1323812059ab384c418d26a70a6", "score": "0.48272645", "text": "facebookIsUserEqual(facebookAuthResponse, firebaseUser) {\n if (firebaseUser) {\n const providerData = firebaseUser.providerData\n for (let i = 0; i < providerData.length; i++) {\n if (\n providerData[i].providerId ===\n this.$fireModule.auth.FacebookAuthProvider.PROVIDER_ID &&\n providerData[i].uid === facebookAuthResponse.userID\n ) {\n // We don't need to re-auth the Firebase connection.\n return true\n }\n }\n }\n return false\n }", "title": "" }, { "docid": "ab4116bf71ae07d766b9584938e1e3fc", "score": "0.4825458", "text": "control(user) {\n return this.tx.every((tx) => {\n if (! user.isInvolvedIn(tx)) {\n return true;\n }\n return user.transactions().includes(tx);\n });\n }", "title": "" }, { "docid": "94896376992260a05e580c77b85d74b4", "score": "0.4823135", "text": "get success() {\n return this.principalStatement !== undefined || this.resourceStatement !== undefined;\n }", "title": "" }, { "docid": "00e43e287bada07522c3ffc51b6cbd15", "score": "0.48229453", "text": "userCreated (project) {\n if (!userStore.data.scitran) {return false;}\n return project.group === userStore.data.scitran._id;\n }", "title": "" } ]
aae79e49b3ac8c4eb07efd58ce58bac4
Variables passed to field arguments conform to type
[ { "docid": "d0e25c58b909fd76cf889359b82eb9c0", "score": "0.0", "text": "function VariablesInAllowedPosition(context) {\n var varDefMap = Object.create(null);\n return {\n OperationDefinition: {\n enter: function enter() {\n varDefMap = Object.create(null);\n },\n leave: function leave(operation) {\n var usages = context.getRecursiveVariableUsages(operation);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref2 = _step.value;\n var node = _ref2.node;\n var type = _ref2.type;\n var defaultValue = _ref2.defaultValue;\n var varName = node.name.value;\n var varDef = varDefMap[varName];\n\n if (varDef && type) {\n // A var type is allowed if it is the same or more strict (e.g. is\n // a subtype of) than the expected type. It can be more strict if\n // the variable type is non-null when the expected type is nullable.\n // If both are list types, the variable item type can be more strict\n // than the expected item type (contravariant).\n var schema = context.getSchema();\n var varType = Object(_utilities_typeFromAST__WEBPACK_IMPORTED_MODULE_5__[\"typeFromAST\"])(schema, varDef.type);\n\n if (varType && !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](badVarPosMessage(varName, Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(varType), Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type)), [varDef, node]));\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(node) {\n varDefMap[node.variable.name.value] = node;\n }\n };\n}", "title": "" } ]
[ { "docid": "8be02ea1770721df43d1631101a2d32c", "score": "0.5711393", "text": "function u(e,t,n){return'Field \"'+e+'\" argument \"'+t+'\" of type \"'+String(n)+'\" is required but not provided.'}", "title": "" }, { "docid": "b13497631e0143d7caa79848d3433e37", "score": "0.55176336", "text": "function typeArgumentDemo(arg1) {\n return arg1;\n}", "title": "" }, { "docid": "4dda55db56eeb9b241242c9e0f5fcafa", "score": "0.53725195", "text": "function _typeCheck () {\n return parg(arguments, {p: 'arg1', t: typeof arguments[0]});\n}", "title": "" }, { "docid": "957a39e62d8109b518f2c764c529120d", "score": "0.5343755", "text": "setFields(args) {\n\t\tfor (let elem in args) {\n\t\t\tthis[elem] = args[elem];\n\t\t}\n\t\treturn this;\n\t}", "title": "" }, { "docid": "147c9fe4a5407eebef9cb5bae9d7fa83", "score": "0.53372264", "text": "function checkField(params){\n\n}", "title": "" }, { "docid": "f13c11599267e78dad3baf308f32a2be", "score": "0.53111273", "text": "function assertTypesOfFields(fields, arr) {\n arr.forEach(function(result, i) {\n for (var key in fields) {\n var type = fields[key],\n value = result[key],\n constructor = value.constructor;\n if (type === Date && !Number.isNaN(Date.parse(value))) {\n constructor = Date;\n }\n assert(constructor === type, \"Field \" + key + \" should be \" + type.name + \", but is \" + constructor.name);\n }\n });\n}", "title": "" }, { "docid": "48c1b4231614fac615e7cbb3eef0c014", "score": "0.52947736", "text": "visitFieldDefinition(field, details) {\n this.ensureFieldsWrapped(details.objectType);\n }", "title": "" }, { "docid": "e98d26dff3987db0be1f2a18dbee6fd8", "score": "0.5212398", "text": "static Field(name, type, def, array) { return ModelFormat.from([name, type, def, array]); }", "title": "" }, { "docid": "7fa371deb2a46fddaec76a1b35fc5652", "score": "0.5184318", "text": "getSqType(fieldObj, attr) {\r\n const attrValue = fieldObj[attr];\r\n if (!attrValue.toLowerCase) {\r\n console.log(\"attrValue\", attr, attrValue);\r\n return attrValue;\r\n }\r\n const type = attrValue.toLowerCase();\r\n const length = type.match(/\\(\\d+\\)/);\r\n const precision = type.match(/\\(\\d+,\\d+\\)/);\r\n let val = null;\r\n let typematch = null;\r\n if (type === \"boolean\" || type === \"bit(1)\" || type === \"bit\" || type === \"tinyint(1)\") {\r\n val = 'DataTypes.BOOLEAN';\r\n // postgres range types\r\n }\r\n else if (type === \"numrange\") {\r\n val = 'DataTypes.RANGE(DataTypes.DECIMAL)';\r\n }\r\n else if (type === \"int4range\") {\r\n val = 'DataTypes.RANGE(DataTypes.INTEGER)';\r\n }\r\n else if (type === \"int8range\") {\r\n val = 'DataTypes.RANGE(DataTypes.BIGINT)';\r\n }\r\n else if (type === \"daterange\") {\r\n val = 'DataTypes.RANGE(DataTypes.DATEONLY)';\r\n }\r\n else if (type === \"tsrange\" || type === \"tstzrange\") {\r\n val = 'DataTypes.RANGE(DataTypes.DATE)';\r\n }\r\n else if (typematch = type.match(/^(bigint|smallint|mediumint|tinyint|int)/)) {\r\n // integer subtypes\r\n val = 'DataTypes.' + (typematch[0] === 'int' ? 'INTEGER' : typematch[0].toUpperCase());\r\n if (/unsigned/i.test(type)) {\r\n val += '.UNSIGNED';\r\n }\r\n if (/zerofill/i.test(type)) {\r\n val += '.ZEROFILL';\r\n }\r\n }\r\n else if (type === 'nvarchar(max)' || type === 'varchar(max)') {\r\n val = 'DataTypes.TEXT';\r\n }\r\n else if (type.match(/n?varchar|string|varying/)) {\r\n val = 'DataTypes.STRING' + (!lodash_1.default.isNull(length) ? length : '');\r\n }\r\n else if (type.match(/^n?char/)) {\r\n val = 'DataTypes.CHAR' + (!lodash_1.default.isNull(length) ? length : '');\r\n }\r\n else if (type.match(/^real/)) {\r\n val = 'DataTypes.REAL';\r\n }\r\n else if (type.match(/text$/)) {\r\n val = 'DataTypes.TEXT' + (!lodash_1.default.isNull(length) ? length : '');\r\n }\r\n else if (type === \"date\") {\r\n val = 'DataTypes.DATEONLY';\r\n }\r\n else if (type.match(/^(date|timestamp)/)) {\r\n val = 'DataTypes.DATE' + (!lodash_1.default.isNull(length) ? length : '');\r\n }\r\n else if (type.match(/^(time)/)) {\r\n val = 'DataTypes.TIME';\r\n }\r\n else if (type.match(/^(float|float4)/)) {\r\n val = 'DataTypes.FLOAT' + (!lodash_1.default.isNull(precision) ? precision : '');\r\n }\r\n else if (type.match(/^(decimal|numeric)/)) {\r\n val = 'DataTypes.DECIMAL' + (!lodash_1.default.isNull(precision) ? precision : '');\r\n }\r\n else if (type.match(/^money/)) {\r\n val = 'DataTypes.DECIMAL(19,4)';\r\n }\r\n else if (type.match(/^smallmoney/)) {\r\n val = 'DataTypes.DECIMAL(10,4)';\r\n }\r\n else if (type.match(/^(float8|double)/)) {\r\n val = 'DataTypes.DOUBLE' + (!lodash_1.default.isNull(precision) ? precision : '');\r\n }\r\n else if (type.match(/^uuid|uniqueidentifier/)) {\r\n val = 'DataTypes.UUID';\r\n }\r\n else if (type.match(/^jsonb/)) {\r\n val = 'DataTypes.JSONB';\r\n }\r\n else if (type.match(/^json/)) {\r\n val = 'DataTypes.JSON';\r\n }\r\n else if (type.match(/^geometry/)) {\r\n const gtype = fieldObj.elementType ? `(${fieldObj.elementType})` : '';\r\n val = `DataTypes.GEOMETRY${gtype}`;\r\n }\r\n else if (type.match(/^geography/)) {\r\n const gtype = fieldObj.elementType ? `(${fieldObj.elementType})` : '';\r\n val = `DataTypes.GEOGRAPHY${gtype}`;\r\n }\r\n else if (type.match(/^array/)) {\r\n const eltype = this.getSqType(fieldObj, \"elementType\");\r\n val = `DataTypes.ARRAY(${eltype})`;\r\n }\r\n else if (type.match(/(binary|image|blob|bytea)/)) {\r\n val = 'DataTypes.BLOB';\r\n }\r\n else if (type.match(/^hstore/)) {\r\n val = 'DataTypes.HSTORE';\r\n }\r\n else if (type.match(/^inet/)) {\r\n val = 'DataTypes.INET';\r\n }\r\n else if (type.match(/^cidr/)) {\r\n val = 'DataTypes.CIDR';\r\n }\r\n else if (type.match(/^oid/)) {\r\n val = 'DataTypes.INTEGER';\r\n }\r\n else if (type.match(/^macaddr/)) {\r\n val = 'DataTypes.MACADDR';\r\n }\r\n else if (type.match(/^enum(\\(.*\\))?$/)) {\r\n const enumValues = this.getEnumValues(fieldObj);\r\n val = `DataTypes.ENUM(${enumValues})`;\r\n }\r\n return val;\r\n }", "title": "" }, { "docid": "41655940497d34b469ce87bbbab4788d", "score": "0.5082679", "text": "function Field(value){\n this.value = value;\n}", "title": "" }, { "docid": "ec115b5e883fbd596fdc8edc71488e3d", "score": "0.50757873", "text": "function Arguments() {}", "title": "" }, { "docid": "919c90280c11caafb8a5218bdf7928eb", "score": "0.50614476", "text": "function assertFields(runner, object, prefix, fields) {\n _.each(fields, function(name) {\n var type = 'string';\n if (_.isArray(name)) {\n type = name[1];\n name = name[0];\n }\n assertField(runner, object[name], prefix + name, type);\n });\n object.prefix = prefix;\n return object;\n}", "title": "" }, { "docid": "c045967796be0228f1281b663110adc8", "score": "0.5059534", "text": "function getValidatedArgs(args, request, response) {\n const fieldErrors = {};\n const values = Object.keys(args).map((key) => {\n const name = args[key].name;\n switch (args[key].in) {\n case 'request':\n return request;\n case 'query':\n return validationService.ValidateParam(args[key], request.query[name], name, fieldErrors, undefined, { \"noImplicitAdditionalProperties\": \"throw-on-extras\" });\n case 'path':\n return validationService.ValidateParam(args[key], request.params[name], name, fieldErrors, undefined, { \"noImplicitAdditionalProperties\": \"throw-on-extras\" });\n case 'header':\n return validationService.ValidateParam(args[key], request.header(name), name, fieldErrors, undefined, { \"noImplicitAdditionalProperties\": \"throw-on-extras\" });\n case 'body':\n return validationService.ValidateParam(args[key], request.body, name, fieldErrors, undefined, { \"noImplicitAdditionalProperties\": \"throw-on-extras\" });\n case 'body-prop':\n return validationService.ValidateParam(args[key], request.body[name], name, fieldErrors, 'body.', { \"noImplicitAdditionalProperties\": \"throw-on-extras\" });\n case 'formData':\n if (args[key].dataType === 'file') {\n return validationService.ValidateParam(args[key], request.file, name, fieldErrors, undefined, { \"noImplicitAdditionalProperties\": \"throw-on-extras\" });\n }\n else if (args[key].dataType === 'array' && args[key].array.dataType === 'file') {\n return validationService.ValidateParam(args[key], request.files, name, fieldErrors, undefined, { \"noImplicitAdditionalProperties\": \"throw-on-extras\" });\n }\n else {\n return validationService.ValidateParam(args[key], request.body[name], name, fieldErrors, undefined, { \"noImplicitAdditionalProperties\": \"throw-on-extras\" });\n }\n case 'res':\n return responder(response);\n }\n });\n if (Object.keys(fieldErrors).length > 0) {\n throw new runtime_1.ValidateError(fieldErrors, '');\n }\n return values;\n }", "title": "" }, { "docid": "d43a3b58561a500ad692523e33e1f1ac", "score": "0.50503886", "text": "function Fields(type, args) {\n this.type = type;\n\n this.country = {\n field: type + '_country',\n wrapper: type + '_country_field'\n };\n\n this.state = {\n field: type + '_state',\n wrapper: type + '_state_field',\n changeCounter: 0 // WooCommerce has bug where State Field trigger its \"change\" event twice\n };\n\n this.city = {\n field: type + '_city',\n wrapper: type + '_city_field',\n newField: type + '_wcis_c',\n newWrapper: type + '_wcis_c_wrapper'\n };\n\n this.dist = {\n newField: type + '_wcis_d',\n newWrapper: type + '_wcis_d_wrapper'\n };\n\n this.destination = type + '_destination_id';\n\n // parse the city value, the format is \"City, District [code]\"\n var cityRaw = $('#' + this.city.field).val();\n\n var cityValue = cityRaw.match(/[\\w\\s]+/);\n this.city.value = cityValue ? cityValue[0] : null;\n\n var distValue = cityRaw.match(/,\\s([\\w\\s]+)\\s*/)\n this.dist.value = distValue ? distValue[1].trim() : null;\n}", "title": "" }, { "docid": "bb020d9ad6a86525fab5499b10de2b76", "score": "0.5049016", "text": "function ArgumentsOfCorrectType(context) {\n\t return {\n\t Argument: function Argument(argAST) {\n\t var argDef = context.getArgument();\n\t if (argDef) {\n\t var errors = (0, _isValidLiteralValue.isValidLiteralValue)(argDef.type, argAST.value);\n\t if (errors && errors.length > 0) {\n\t context.reportError(new _error.GraphQLError(badValueMessage(argAST.name.value, argDef.type, (0, _printer.print)(argAST.value), errors), [argAST.value]));\n\t }\n\t }\n\t return false;\n\t }\n\t };\n\t}", "title": "" }, { "docid": "1cd74be85ebf894f621a001d03439bb2", "score": "0.50140494", "text": "function Field(value){\n this.value = value;\n}", "title": "" }, { "docid": "6634ea6f3b9da712869f04a143218e67", "score": "0.5011045", "text": "function a(e,t){return'Field \"'+e+'\" of type \"'+String(t)+'\" must have a selection of subfields. Did you mean \"'+e+' { ... }\"?'}", "title": "" }, { "docid": "5c39582a8677ed736735a987896cf469", "score": "0.5009038", "text": "function Field(value){\n this.value = value;\n}", "title": "" }, { "docid": "7dbfdba2116facd843dd85c6be1ec93f", "score": "0.5006269", "text": "function ArgumentsOfCorrectType(context) {\n return {\n Argument: function Argument(node) {\n var argDef = context.getArgument();\n if (argDef) {\n var errors = (0, _isValidLiteralValue.isValidLiteralValue)(argDef.type, node.value);\n if (errors && errors.length > 0) {\n context.reportError(new _error.GraphQLError(badValueMessage(node.name.value, argDef.type, (0, _printer.print)(node.value), errors), [node.value]));\n }\n }\n return false;\n }\n };\n}", "title": "" }, { "docid": "7dbfdba2116facd843dd85c6be1ec93f", "score": "0.5006269", "text": "function ArgumentsOfCorrectType(context) {\n return {\n Argument: function Argument(node) {\n var argDef = context.getArgument();\n if (argDef) {\n var errors = (0, _isValidLiteralValue.isValidLiteralValue)(argDef.type, node.value);\n if (errors && errors.length > 0) {\n context.reportError(new _error.GraphQLError(badValueMessage(node.name.value, argDef.type, (0, _printer.print)(node.value), errors), [node.value]));\n }\n }\n return false;\n }\n };\n}", "title": "" }, { "docid": "337db5e955c3bfffa18f2187dad88ac6", "score": "0.49884358", "text": "static isTypeArgumentedNode(node) {\r\n switch (node.getKind()) {\r\n case typescript_1.SyntaxKind.CallExpression:\r\n case typescript_1.SyntaxKind.NewExpression:\r\n case typescript_1.SyntaxKind.ImportType:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "30c7ecfd3d454946fbd4360a64dfa902", "score": "0.49635035", "text": "function checkPushParams() {\n for (var i = 0, j = arguments.length; i < j; i++) {\n var argumentType = arguments[i].constructor.name;\n if (argumentType !== \"Number\") {\n throw new TypeError('input param ' + i + ' must be of type \"Number\", but is ' + argumentType + ' instead');\n }\n }\n }", "title": "" }, { "docid": "5bd647e742f322159abd7c107140009c", "score": "0.4958256", "text": "function isArgConstructorTimeTyped (arg) {\n switch (arg) {\n case 'number':\n case 'number-list':\n case 'number-property':\n case 'category':\n case 'category-list':\n case 'category-property':\n return false;\n default:\n return true;\n }\n}", "title": "" }, { "docid": "db90821a83855fad36c418ac08bd1607", "score": "0.4954399", "text": "parseIdent(liberal, isBinding) {\n const ident = super.parseIdent(liberal, isBinding)\n if (this._inFieldValue && ident.name == \"arguments\") this.raise(ident.start, \"A class field initializer may not contain arguments\")\n return ident\n }", "title": "" }, { "docid": "3a7277a8cde151b26613bf1046024936", "score": "0.49505448", "text": "function Foo(value) { // @arg String = \"\" - comment\n//{@dev\n $valid($type(value, \"String|omit\"), Foo, \"value\");\n//}@dev\n\n this._value = value || \"\";\n}", "title": "" }, { "docid": "4571ed24dd30557d7b058127b285e111", "score": "0.49497312", "text": "function QMField(type, params) {\n this.type = type\n this.params = params\n} //TODO: Migrations!//TODO: Replace concatenations with binds '?'", "title": "" }, { "docid": "7fdc0f429dcdd735bf19ef60b08e26f8", "score": "0.49467355", "text": "function prepareArguments(args) {\n const argNames = [];\n const argTypes = new Map();\n for (const arg of args) {\n if (arg instanceof Object) {\n let { name, type } = arg;\n if (type === undefined) { type = name; }\n argNames.push(name);\n argTypes.set(name, type);\n } else {\n argNames.push(arg);\n // We create a default type for each argument matching its name -- for now.\n // Perhaps we'd want to create an anonymous type here...\n argTypes.set(arg, arg);\n }\n }\n return [argNames, argTypes];\n}", "title": "" }, { "docid": "6ea1978bbaedb6c3af930a1b95466351", "score": "0.49309275", "text": "function __embedType(outerObject, fieldValue, contextInheritorModule)\n{\n var names = Object.getOwnPropertyNames(fieldValue);\n for (var name of names)\n {\n //\n // Do *NOT* overwrite the projected things we place on the objects.\n //\n if (name != \"targetLocation\" && name != \"targetSize\")\n {\n outerObject[name] = fieldValue[name];\n }\n }\n}", "title": "" }, { "docid": "adf9be5544616d3fd8c609eb3debd1a0", "score": "0.492162", "text": "constructor(val1, val2, type){\n this.value1 = val1;\n this.value2 = val2;\n this.type = type;\n }", "title": "" }, { "docid": "f159698240099317e24dabb3ca4ea623", "score": "0.4919204", "text": "field(name: string): ?$Field {\n let index = this.descriptor.findIndex((d) => d.name === name)\n if (inBounds(this.tuple, index)) {\n let {name, type} = this.descriptor[index]\n let value = this.tuple[index]\n return brim.field({name, type, value})\n } else {\n return null\n }\n }", "title": "" }, { "docid": "da2a6ac974aedd4cabdfd061dc003f5b", "score": "0.4911186", "text": "Field() {\n \n }", "title": "" }, { "docid": "b5bb62eaddec5d7119f169149b3dd8c0", "score": "0.4909676", "text": "function gu(t, n) {\n if (n instanceof $r) return n.Ol;\n if (\"string\" == typeof n) return bu(t, n);\n throw new B(L.INVALID_ARGUMENT, \"Function \" + t + \"() called with invalid data. Field path arguments must be of type string or FieldPath.\");\n}", "title": "" }, { "docid": "53b330e55317da15358f5a09d43f5c21", "score": "0.49092087", "text": "function Field() {\n}", "title": "" }, { "docid": "60e1c18ef7f6452bd44c0d2328a7039e", "score": "0.4905216", "text": "function checkBatchParams() {\n for (var i = 0, j = arguments.length; i < j; i++) {\n var argumentType = arguments[i].constructor.name;\n if (argumentType !== \"Array\" && argumentType !== \"Vector\") {\n throw new TypeError('input param ' + i + ' must be of type \"Array\" or \"Vector\", but is ' + argumentType + ' instead');\n }\n }\n }", "title": "" }, { "docid": "fa619e83833049fc2000d7956a5d47a8", "score": "0.4904249", "text": "function t() {\n for (var t = [], e = 0; e < arguments.length; e++) {\n t[e] = arguments[e];\n }\n\n for (var n = 0; n < t.length; ++n) {\n if (0 === t[n].length) throw new U(R.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). Field names must not be empty.\");\n }\n\n this.d_ = new rt(t);\n }", "title": "" }, { "docid": "0ffd08d502bb23703668fa60ad43e81f", "score": "0.4895677", "text": "function addField(params){\n\n}", "title": "" }, { "docid": "a052f48f5ca4ab4e49e02cf44bd42121", "score": "0.48927498", "text": "function ArgumentsOfCorrectType(context) {\n return {\n Argument: function Argument(argAST) {\n var argDef = context.getArgument();\n if (argDef) {\n var errors = (0, _utilitiesIsValidLiteralValue.isValidLiteralValue)(argDef.type, argAST.value);\n if (errors && errors.length > 0) {\n context.reportError(new _error.GraphQLError(badValueMessage(argAST.name.value, argDef.type, (0, _languagePrinter.print)(argAST.value), errors), [argAST.value]));\n }\n }\n return false;\n }\n };\n}", "title": "" }, { "docid": "36055cd3f07ac5b7c13ab675a4905383", "score": "0.48830318", "text": "function getType(arg){\n return typeof arg;\n}", "title": "" }, { "docid": "1969ac0f0ea94d4430ace138b064a472", "score": "0.48757857", "text": "function examine(...args ) {\n const argsTypeArray = args.map(el => Array.isArray(el) ? `\"array\"` : `\"${typeof el}\"`); \n \n console.log(`[${argsTypeArray.join(\", \")}]`);\n}", "title": "" }, { "docid": "7c54e06ed4c9a5984fd67534b044f76b", "score": "0.48669195", "text": "function VarArgDescriptor(name, type, minCount, maxCount, docStream) {\n this.name = name;\n this.type = type;\n this.minCount = minCount;\n this.maxCount = maxCount;\n this.docStream = docStream;\n}", "title": "" }, { "docid": "8a132da1473b972b86b602d4815203de", "score": "0.48640716", "text": "field(v) {\n if (typeof v === 'string') {\n this.fieldName = v;\n }\n return this;\n }", "title": "" }, { "docid": "3b2cb6427d8b5f3e6be40fbb540a9c3f", "score": "0.48624143", "text": "function validate (args, types) {\n\n args = Array.prototype.slice.call(args);\n if (typeof types == 'string') types = [types];\n for (let i in args){\n const value = args[i];\n const type = types[i];\n if (type && !valid(value, type)){\n let err = new Error('Invalid validator to: '+args[i]+' must be '+type);\n err.name = 'InvalidValidator'\n throw err;\n }\n }\n\n }", "title": "" }, { "docid": "d66aaf13e0dfcd3e58b7e7daafddddd9", "score": "0.48509353", "text": "fromObject(input) {\n this.type = input.type;\n this.properties = input.properties;\n }", "title": "" }, { "docid": "b0dec4cfe06ec5a0fba24279cde8d4ae", "score": "0.48494527", "text": "function field3_(){this.field3=(/* new <int>*/[1, 2, 3]);}", "title": "" }, { "docid": "227c786ddc91f0e07cdd59ed04d445ba", "score": "0.48463097", "text": "function typesafe(func,types,self){\n return function (){\n try{\n for(i in arguments){\n if(types[i])\n assert.equal(typeof arguments[i],types[i])\n }\n } catch (e){\n var funcStart = (\"\" + func).split('\\n')[0] + '...'\n e.message = funcStart + \" expected type '\" + types[i] + \"' as arg:\" + i \n + \" instead got type :\" + typeof arguments[i] + \" === typeof \" + arguments[i]\n throw e\n }\n return func.apply(self,arguments)\n }\n}", "title": "" }, { "docid": "f6e31b1b885a8631ca02c4fee6eace8c", "score": "0.48257285", "text": "function missingFieldArgMessage(fieldName, argName, type) {\n\t return 'Field \"' + fieldName + '\" argument \"' + argName + '\" of type ' + ('\"' + String(type) + '\" is required but not provided.');\n\t}", "title": "" }, { "docid": "a3472ad0db4d182d0f35a0af6ebe9497", "score": "0.48174924", "text": "function check(input) {\n Object.entries(input).forEach(([name, [value, type]]) => {\n if (typeof value !== type.toLowerCase())\n throw new TypeError(`Argument ${name} must be a ${type} - it was a ${typeof value} instead.`)\n });\n}", "title": "" }, { "docid": "db2efed14ac17bb0b6398215a3efecb6", "score": "0.4807852", "text": "function test_field(p_field,p_field_name, exp_object_type)\n{\n\n //get the object type based on expected and pass in\n if(exp_object_type=='read_only')\n {\n if (p_field.ObjectType==\"Label\") \n {\n Log.Message(p_field_name + \" \" + \"Field is read only TEST PASS\");\n return true;\n }\n else\n {\n Log.Message(p_field_name + \" \" + \"Field can be edited Field FAIL\");\n return false;\n }\n }\n\n//Going to need to add in other type of fields here at the moment this method only handles drop down or label but other valid ones could be check box, text entry etc\n if(exp_object_type=='editable_field')\n {\n if (p_field.ObjectType==\"Label\") \n {\n Log.Message(p_field_name + \" \" + \"Field is read only TEST FAIL\");\n return false;\n }\n else\n {\n Log.Message(p_field_name + \" \" + \"Field can be edited Field PASS\");\n return true;\n }\n }\n}", "title": "" }, { "docid": "1ff6f17d4a9abe4d20dc8dabecc0144c", "score": "0.4803316", "text": "function vtd(type, arg) {\r\n if (arg === undefined) {\r\n return new ValueTypeDescription(type, undefined, undefined);\r\n }\r\n if (arg instanceof ValueTypeDescription) {\r\n return new ValueTypeDescription(type, undefined, [arg]);\r\n }\r\n if (arg instanceof Array) {\r\n return new ValueTypeDescription(type, undefined, arg);\r\n }\r\n var objVTD = {};\r\n for (var attr in arg) {\r\n objVTD[attr] = arg[attr] instanceof ValueTypeDescription ?\r\n [arg[attr]] : arg[attr];\r\n }\r\n return new ValueTypeDescription(type, objVTD, undefined);\r\n}", "title": "" }, { "docid": "f6942abfa410d566e099b8d8f04e0be1", "score": "0.47639704", "text": "function Field(value) {\n this.value = value;\n}", "title": "" }, { "docid": "f6942abfa410d566e099b8d8f04e0be1", "score": "0.47639704", "text": "function Field(value) {\n this.value = value;\n}", "title": "" }, { "docid": "f6942abfa410d566e099b8d8f04e0be1", "score": "0.47639704", "text": "function Field(value) {\n this.value = value;\n}", "title": "" }, { "docid": "db1d92c5852dbc8962e08217d6d358c8", "score": "0.47573736", "text": "function genericsDemo(args) {\n return args;\n}", "title": "" }, { "docid": "244f631de8a9c7facf447ba8aa228b52", "score": "0.47540525", "text": "function test() {\n console.log(typeof arguments); // 'object'\n}", "title": "" }, { "docid": "06b3336546fb2556508cbee83d110d8d", "score": "0.4752438", "text": "function Arguments(args) {\r\n //convert arguments object to array\r\n this.value = [].slice.call(args);\r\n}", "title": "" }, { "docid": "ff2f172e733364ea774abc86d3d84ed5", "score": "0.4734067", "text": "function provideArgs(block, fn) {\n const fieldDef = block.field;\n block.field = function (...args) {\n let config = args.length === 2 ? Object.assign({ name: args[0] }, args[1]) : args[0];\n const { resolve = graphql_1.defaultFieldResolver } = config;\n fieldDef.call(this, Object.assign(Object.assign({}, config), { resolve(root, args, ctx, info) {\n return resolve(root, mergeArgs(root, args), ctx, info);\n } }));\n };\n fn();\n block.field = fieldDef;\n}", "title": "" }, { "docid": "843309b9c27973ed485f7f4136e68ade", "score": "0.4727672", "text": "function missingFieldArgMessage(fieldName, argName, type) {\n return 'Field \"' + fieldName + '\" argument \"' + argName + '\" of type ' + ('\"' + String(type) + '\" is required but not provided.');\n}", "title": "" }, { "docid": "843309b9c27973ed485f7f4136e68ade", "score": "0.4727672", "text": "function missingFieldArgMessage(fieldName, argName, type) {\n return 'Field \"' + fieldName + '\" argument \"' + argName + '\" of type ' + ('\"' + String(type) + '\" is required but not provided.');\n}", "title": "" }, { "docid": "843309b9c27973ed485f7f4136e68ade", "score": "0.4727672", "text": "function missingFieldArgMessage(fieldName, argName, type) {\n return 'Field \"' + fieldName + '\" argument \"' + argName + '\" of type ' + ('\"' + String(type) + '\" is required but not provided.');\n}", "title": "" }, { "docid": "843309b9c27973ed485f7f4136e68ade", "score": "0.4727672", "text": "function missingFieldArgMessage(fieldName, argName, type) {\n return 'Field \"' + fieldName + '\" argument \"' + argName + '\" of type ' + ('\"' + String(type) + '\" is required but not provided.');\n}", "title": "" }, { "docid": "843309b9c27973ed485f7f4136e68ade", "score": "0.4727672", "text": "function missingFieldArgMessage(fieldName, argName, type) {\n return 'Field \"' + fieldName + '\" argument \"' + argName + '\" of type ' + ('\"' + String(type) + '\" is required but not provided.');\n}", "title": "" }, { "docid": "843309b9c27973ed485f7f4136e68ade", "score": "0.4727672", "text": "function missingFieldArgMessage(fieldName, argName, type) {\n return 'Field \"' + fieldName + '\" argument \"' + argName + '\" of type ' + ('\"' + String(type) + '\" is required but not provided.');\n}", "title": "" }, { "docid": "8c283160e7e084ca50b550c56d9dc283", "score": "0.4724987", "text": "set type(value) {}", "title": "" }, { "docid": "6776c318cdaa8e0f14ef6754207e41a4", "score": "0.47157007", "text": "function validateArgs(args, name, min, max, types) {\n var e, i;\n i = 0;\n if (args.length < min) {\n throw argumentCountError('Too few arguments in function \"' + name\n\t\t\t\t\t+ '\". Requires between ' + min + ' and ' + max);\n }\n if (args.length > max) {\n throw argumentCountError('Too many arguments in function \"' + name\n\t\t\t\t\t+ '\". Requires between ' + min + ' and ' + max);\n }\n if (types !== undefined) {\n for (i = 0; i < args.length; i += 1) {\n if (types[i] !== null && types[i] !== undefined) {\n if (args[i] === undefined && i >= min) {\n continue;\n }\n if (args[i] === null || args[i] === undefined ||\n\t\t\t\t\t\t\targs[i].constructor !== types[i]) {\n e = 'Incorrect argument type in function \"' + name + '\". Argument: '\n\t\t\t\t\t\t\t+ (i + 1) + ' actual: ';\n if (args[i] === null) {\n e += 'null';\n } else if (args[i] === undefined) {\n e += 'undefined';\n } else {\n e += mc.getobjectclass(args[i]) + ' - object = ' + args[i].constructor;\n }\n e += ' expected: ' + types[i].name;\n throw argumentTypeError(e);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "50d8553d2608ae6ec366102b606779e3", "score": "0.4715367", "text": "function parse_name_type(field) {\n var fieldStr = '';\n\n //do switch case\n\n if (field.type === \"Array of...\") {\n if (field.selectedArrType != 'String' && field.selectedArrType != 'Number' && field.selectedArrType != 'Boolean' && field.selectedArrType != 'Buffer' && field.selectedArrType != 'Date' ) {\n fieldStr += field.name + ':[{ type: mongoose.Schema.Types.ObjectId, ref: \"' + field.selectedArrType + '\"' + ' ' + parse_options(field.options) + '}]';\n } else {\n\n fieldStr += field.name + ':{ type: ' + '[' + field.selectedArrType + ']' + ' ' + parse_options(field.options) + '}';\n\n }\n\n } else if (field.type === \"Embed...\") {\n fieldStr += field.name + ':{ type: ' + '[' + field.selectedEmbed + ']' + ' ' + parse_options(field.options) + '}';\n\n } else if (field.type === 'Reference to...') {\n\n fieldStr += field.name + ':{ type: mongoose.Schema.Types.ObjectId, ref: \"' + field.reference + '\"' + parse_options(field.options) + '}';\n\n } else {\n\n fieldStr += field.name + ':{ type: ' + field.type + ' ' + parse_options(field.options) + '}';\n }\n\n return fieldStr;\n\n}", "title": "" }, { "docid": "97719d44216a77c297ed095fd31394c3", "score": "0.4708546", "text": "function parameterValue(def,value$$1,scope){var type=def.type;if(isSignal(value$$1)){return isExpr(type)?error$1('Expression references can not be signals.'):isField(type)?scope.fieldRef(value$$1):isCompare(type)?scope.compareRef(value$$1):scope.signalRef(value$$1.signal);}else{var expr=def.expr||isField(type);return expr&&outerExpr(value$$1)?parseExpression(value$$1.expr,scope):expr&&outerField(value$$1)?fieldRef$1(value$$1.field):isExpr(type)?parseExpression(value$$1,scope):isData(type)?ref(scope.getData(value$$1).values):isField(type)?fieldRef$1(value$$1):isCompare(type)?scope.compareRef(value$$1):value$$1;}}", "title": "" }, { "docid": "0d33f8d8c5a585f427bdd5519c56cf70", "score": "0.4692952", "text": "function missingFieldArgMessage(fieldName, argName, type) {\n return \"Field \\\"\".concat(fieldName, \"\\\" argument \\\"\").concat(argName, \"\\\" of type \") + \"\\\"\".concat(type, \"\\\" is required but not provided.\");\n}", "title": "" }, { "docid": "81dbf63dcadd6b1bc54e9fc6316296e6", "score": "0.46921518", "text": "_validateArgs() {\n if (config.environment === 'test') {\n let argValidations = this.get('argValidations');\n\n for (let argKey in argValidations) {\n let argValidation = argValidations[argKey];\n let argValidationType = argValidation.type;\n let argValue = this.getAttr(argKey);\n\n if (argValidation.isRequired) {\n this._validateIsRequired(argKey, argValue);\n }\n\n if (argValidationType && !isNone(argValue)) {\n this._validateType(argKey, argValue, argValidationType);\n }\n }\n }\n }", "title": "" }, { "docid": "dd7c9dbb0ffe851850d4183eb413cc73", "score": "0.4689067", "text": "function parseFields($fields) {\n for (var\n current,\n fields = Object.keys($fields),\n parsers = [],\n length = fields.length,\n i = 0; i < length; i++\n ) {\n current = $fields[fields[i]];\n parsers[i] = current === Boolean ?\n $Boolean : (\n current === Date ?\n $Date :\n current || String\n )\n ;\n }\n return {f: fields, p: parsers};\n}", "title": "" }, { "docid": "e959764d0109329c9f40b906ba42345c", "score": "0.4684384", "text": "_field(column) {\n var matches = column.type.match(/(\\w+)(?:\\(([\\d,]+)\\))?/);\n var field = {};\n field.type = matches[1];\n field.length = matches[2];\n field.use = field.type;\n\n if (field.length) {\n var length = field.length.split(',');\n field.length = Number.parseInt(length[0]);\n if (length[1]) {\n field.precision = Number.parseInt(length[1]);\n }\n }\n\n field.type = this.dialect().mapped(field);\n return field;\n }", "title": "" }, { "docid": "79f819048a70817614f46abe77e32016", "score": "0.4680678", "text": "visitFieldDefinition(field, details) {\n this.ensureFieldsWrapped(details.objectType);\n field._requiredAuthRole = this.args.role;\n }", "title": "" }, { "docid": "79f819048a70817614f46abe77e32016", "score": "0.4680678", "text": "visitFieldDefinition(field, details) {\n this.ensureFieldsWrapped(details.objectType);\n field._requiredAuthRole = this.args.role;\n }", "title": "" }, { "docid": "7a5f5722c89bf6473802d524d9e18175", "score": "0.46785083", "text": "function getParameters(_fieldObject) {\r\n\tvar _params = {};\r\n\r\n\tfor (var _i = 0; _i < _fieldObject.length; _i ++) {\r\n\t\tvar _fName = _fieldObject[_i].name;\r\n\t\tvar _fValue = _fieldObject[_i].value;\r\n\r\n\t\t_params[_fName] = _fValue;\r\n\t}\r\n\r\n\treturn _params;\r\n}", "title": "" }, { "docid": "020108e991987701abca0d14b44fe8ca", "score": "0.4677672", "text": "function p$e(t){const r=typeof t;return null==t?{value:t}:Array.isArray(t)?{type:[t[0]],value:null}:\"object\"===r?t.constructor&&t.constructor.__accessorMetadata__||t instanceof Date?{type:t.constructor,value:t}:t:\"boolean\"===r?{type:Boolean,value:t}:\"string\"===r?{type:String,value:t}:\"number\"===r?{type:Number,value:t}:\"function\"===r?{type:t,value:null}:void 0}", "title": "" }, { "docid": "0bb979cca9927cad7bb6ce877ab38141", "score": "0.467743", "text": "function missingFieldArgMessage(fieldName, argName, type) {\n return \"Field \\\"\".concat(fieldName, \"\\\" argument \\\"\").concat(argName, \"\\\" of type \") + \"\\\"\".concat(type, \"\\\" is required, but it was not provided.\");\n}", "title": "" }, { "docid": "c9c1ed8e8b0643c3f44ec4a871e6c8aa", "score": "0.46589246", "text": "function MapFieldTransformer(){}", "title": "" }, { "docid": "2393f532a76b7a5c69e0c504a6969e2d", "score": "0.46577644", "text": "function p(t){return this.cast(t)}", "title": "" }, { "docid": "727a2b43b52d6d8f16b890b8ba0c6bc7", "score": "0.46577314", "text": "function typeGuardDemo(arg, ar2) {\n //typeGuard expression\n if (typeof (arg) === \"string\") {\n return arg + ar2;\n }\n if (typeof (arg) === 'number' && typeof (ar2) === 'number') {\n return arg + ar2;\n }\n return arg.toString() + ar2.toString();\n}", "title": "" }, { "docid": "5a26006f6479431cfeb2ca6d246340c4", "score": "0.46547395", "text": "function lazyTyped() {\n\t for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\n\t return math.typed.apply(math.typed, args);\n\t }", "title": "" }, { "docid": "361bc33a1e7d7a59e2acc44cacaaed4d", "score": "0.46444198", "text": "function fixFieldDataTypes(record) {\n\tif ((record.stampTime !== null) && (record.stampTime !== undefined)) {\n\t\trecord.stampTime = String(record.stampTime);\n\t}\n\tif ((record.lastUpdateTime !== null) && (record.lastUpdateTime !== undefined)) {\n\t\trecord.lastUpdateTime = String(record.lastUpdateTime);\n\t}\n\tif ((record.arrivalDateTime !== null) && (record.arrivalDateTime !== undefined)) {\n\t\trecord.arrivalDateTime = String(record.arrivalDateTime);\n\t}\n\tif ((record.dischargeDateTime !== null) && (record.dischargeDateTime !== undefined)) {\n\t\trecord.dischargeDateTime = String(record.dischargeDateTime);\n\t}\n\tif ((record.facilityCode !== null) && (record.facilityCode !== undefined)) {\n\t\trecord.facilityCode = String(record.facilityCode);\n\t}\n\tif ((record.principalDx !== null) && (record.principalDx !== undefined)) {\n\t\trecord.principalDx = String(record.principalDx);\n\t}\n\tif ((record.drg !== null) && (record.drg !== undefined)) {\n\t\trecord.drg = String(record.drg);\n\t}\n}", "title": "" }, { "docid": "161bcc419269ed98b883bb9289dc0bfc", "score": "0.46420068", "text": "function vgField(fieldDef) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var field = fieldDef.field;\n var prefix = opt.prefix;\n var suffix = opt.suffix;\n var argAccessor = ''; // for accessing argmin/argmax field at the end without getting escaped\n\n if (isCount(fieldDef)) {\n field = internalField('count');\n } else {\n var fn;\n\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n } else {\n var bin = fieldDef.bin,\n aggregate = fieldDef.aggregate,\n timeUnit = fieldDef.timeUnit;\n\n if (isBinning(bin)) {\n var _opt$binSuffix, _opt$suffix;\n\n fn = binToString(bin);\n suffix = ((_opt$binSuffix = opt.binSuffix) !== null && _opt$binSuffix !== void 0 ? _opt$binSuffix : '') + ((_opt$suffix = opt.suffix) !== null && _opt$suffix !== void 0 ? _opt$suffix : '');\n } else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n argAccessor = \"[\\\"\".concat(field, \"\\\"]\");\n field = \"argmax_\".concat(aggregate.argmax);\n } else if (isArgminDef(aggregate)) {\n argAccessor = \"[\\\"\".concat(field, \"\\\"]\");\n field = \"argmin_\".concat(aggregate.argmin);\n } else {\n fn = String(aggregate);\n }\n } else if (timeUnit) {\n var _opt$suffix2;\n\n fn = timeUnitToString(timeUnit);\n suffix = (!contains(['range', 'mid'], opt.binSuffix) && opt.binSuffix || '') + ((_opt$suffix2 = opt.suffix) !== null && _opt$suffix2 !== void 0 ? _opt$suffix2 : '');\n }\n }\n }\n\n if (fn) {\n field = field ? \"\".concat(fn, \"_\").concat(field) : fn;\n }\n }\n\n if (suffix) {\n field = \"\".concat(field, \"_\").concat(suffix);\n }\n\n if (prefix) {\n field = \"\".concat(prefix, \"_\").concat(field);\n }\n\n if (opt.forAs) {\n return removePathFromField(field);\n } else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return flatAccessWithDatum(field, opt.expr) + argAccessor;\n } else {\n // We flattened all fields so paths should have become dot.\n return replacePathInField(field) + argAccessor;\n }\n }", "title": "" }, { "docid": "aa05f1afd8119d626da5df6f78c894a8", "score": "0.46332255", "text": "function getArgumentValues(def, node, variableValues) {\n var coercedValues = {};\n var argDefs = def.args;\n var argNodes = node.arguments;\n\n if (!argDefs || !argNodes) {\n return coercedValues;\n }\n\n var argNodeMap = Object(_jsutils_keyMap__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(argNodes, function (arg) {\n return arg.name.value;\n });\n\n for (var i = 0; i < argDefs.length; i++) {\n var argDef = argDefs[i];\n var name = argDef.name;\n var argType = argDef.type;\n var argumentNode = argNodeMap[name];\n var hasValue = void 0;\n var isNull = void 0;\n\n if (argumentNode && argumentNode.value.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_8__[\"Kind\"].VARIABLE) {\n var variableName = argumentNode.value.name.value;\n hasValue = variableValues && hasOwnProperty(variableValues, variableName);\n isNull = variableValues && variableValues[variableName] === null;\n } else {\n hasValue = argumentNode != null;\n isNull = argumentNode && argumentNode.value.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_8__[\"Kind\"].NULL;\n }\n\n if (!hasValue && argDef.defaultValue !== undefined) {\n // If no argument was provided where the definition has a default value,\n // use the default value.\n coercedValues[name] = argDef.defaultValue;\n } else if ((!hasValue || isNull) && Object(_type_definition__WEBPACK_IMPORTED_MODULE_10__[\"isNonNullType\"])(argType)) {\n // If no argument or a null value was provided to an argument with a\n // non-null type (required), produce a field error.\n if (isNull) {\n throw new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" of non-null type \\\"\").concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(argType), \"\\\" \") + 'must not be null.', [argumentNode.value]);\n } else if (argumentNode && argumentNode.value.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_8__[\"Kind\"].VARIABLE) {\n var _variableName = argumentNode.value.name.value;\n throw new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(argType), \"\\\" \") + \"was provided the variable \\\"$\".concat(_variableName, \"\\\" \") + 'which was not provided a runtime value.', [argumentNode.value]);\n } else {\n throw new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(argType), \"\\\" \") + 'was not provided.', [node]);\n }\n } else if (hasValue) {\n if (argumentNode.value.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_8__[\"Kind\"].NULL) {\n // If the explicit value `null` was provided, an entry in the coerced\n // values must exist as the value `null`.\n coercedValues[name] = null;\n } else if (argumentNode.value.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_8__[\"Kind\"].VARIABLE) {\n var _variableName2 = argumentNode.value.name.value;\n !variableValues ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Must exist for hasValue to be true.') : void 0; // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n coercedValues[name] = variableValues[_variableName2];\n } else {\n var valueNode = argumentNode.value;\n var coercedValue = Object(_utilities_valueFromAST__WEBPACK_IMPORTED_MODULE_7__[\"valueFromAST\"])(valueNode, argType, variableValues);\n\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectType validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" has invalid value \").concat(Object(_language_printer__WEBPACK_IMPORTED_MODULE_9__[\"print\"])(valueNode), \".\"), [argumentNode.value]);\n }\n\n coercedValues[name] = coercedValue;\n }\n }\n }\n\n return coercedValues;\n}", "title": "" }, { "docid": "0d9561b8f497ddbbd2c6d56317720e96", "score": "0.46325552", "text": "function ValuesOfCorrectType(context) {\n return {\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n if ((0, _definition.isNonNullType)(type)) {\n context.reportError(new _error.GraphQLError(badValueMessage(String(type), (0, _printer.print)(node)), node));\n }\n },\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = (0, _definition.getNullableType)(context.getParentInputType());\n if (!(0, _definition.isListType)(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = (0, _definition.getNamedType)(context.getInputType());\n if (!(0, _definition.isInputObjectType)(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n }\n // Ensure every required field exists.\n var inputFields = type.getFields();\n var fieldNodeMap = (0, _keyMap2.default)(node.fields, function (field) {\n return field.name.value;\n });\n Object.keys(inputFields).forEach(function (fieldName) {\n var fieldType = inputFields[fieldName].type;\n var fieldNode = fieldNodeMap[fieldName];\n if (!fieldNode && (0, _definition.isNonNullType)(fieldType)) {\n context.reportError(new _error.GraphQLError(requiredFieldMessage(type.name, fieldName, String(fieldType)), node));\n }\n });\n },\n ObjectField: function ObjectField(node) {\n var parentType = (0, _definition.getNamedType)(context.getParentInputType());\n var fieldType = context.getInputType();\n if (!fieldType && (0, _definition.isInputObjectType)(parentType)) {\n var suggestions = (0, _suggestionList2.default)(node.name.value, Object.keys(parentType.getFields()));\n var didYouMean = suggestions.length !== 0 ? 'Did you mean ' + (0, _orList2.default)(suggestions) + '?' : undefined;\n context.reportError(new _error.GraphQLError(unknownFieldMessage(parentType.name, node.name.value, didYouMean), node));\n }\n },\n EnumValue: function EnumValue(node) {\n var type = (0, _definition.getNamedType)(context.getInputType());\n if (!(0, _definition.isEnumType)(type)) {\n isValidScalar(context, node);\n } else if (!type.getValue(node.value)) {\n context.reportError(new _error.GraphQLError(badValueMessage(type.name, (0, _printer.print)(node), enumTypeSuggestion(type, node)), node));\n }\n },\n\n IntValue: function IntValue(node) {\n return isValidScalar(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidScalar(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidScalar(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidScalar(context, node);\n }\n };\n}", "title": "" }, { "docid": "1bca3bd0e30cd68d462c3e4bee45d4ca", "score": "0.46318743", "text": "function La(t, e) {\n if (Pa(\n // Unwrap the API type from the Compat SDK. This will return the API type\n // from firestore-exp.\n t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(t))) return Fa(\"Unsupported field value:\", e, t), Oa(t, e);\n if (t instanceof pa) \n // FieldValues usually parse into transforms (except FieldValue.delete())\n // in which case we do not want to include this field in our parsed data\n // (as doing so will overwrite the field directly prior to the transform\n // trying to transform it). So we don't add this location to\n // context.fieldMask and we return null as our parsing result.\n /**\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\n * context.fieldTransforms.\n */\n return function(t, e) {\n // Sentinels are only supported with writes, and not within arrays.\n if (!wa(e.Nc)) throw e.Lc(t._methodName + \"() can only be used with update() and set()\");\n if (!e.path) throw e.Lc(t._methodName + \"() is not currently supported inside arrays\");\n var n = t._toFieldTransform(e);\n n && e.fieldTransforms.push(n);\n }(t, e), null;\n if (void 0 === t && e.ignoreUndefinedProperties) \n // If the input is undefined it can never participate in the fieldMask, so\n // don't handle this below. If `ignoreUndefinedProperties` is false,\n // `parseScalarValue` will reject an undefined value.\n return null;\n if (\n // If context.path is null we are inside an array and we don't support\n // field mask paths more granular than the top-level array.\n e.path && e.fieldMask.push(e.path), t instanceof Array) {\n // TODO(b/34871131): Include the path containing the array in the error\n // message.\n // In the case of IN queries, the parsed data is an array (representing\n // the set of values to be included for the IN query) that may directly\n // contain additional arrays (each representing an individual field\n // value), so we disable this validation.\n if (e.settings.kc && 4 /* ArrayArgument */ !== e.Nc) throw e.Lc(\"Nested arrays are not supported\");\n return function(t, e) {\n for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {\n var s = La(o[i], e.Mc(r));\n null == s && (\n // Just include nulls in the array for fields being replaced with a\n // sentinel.\n s = {\n nullValue: \"NULL_VALUE\"\n }), n.push(s), r++;\n }\n return {\n arrayValue: {\n values: n\n }\n };\n }(t, e);\n }\n return function(t, e) {\n if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(t))) return {\n nullValue: \"NULL_VALUE\"\n };\n if (\"number\" == typeof t) return le(e.R, t);\n if (\"boolean\" == typeof t) return {\n booleanValue: t\n };\n if (\"string\" == typeof t) return {\n stringValue: t\n };\n if (t instanceof Date) {\n var n = j.fromDate(t);\n return {\n timestampValue: In(e.R, n)\n };\n }\n if (t instanceof j) {\n // Firestore backend truncates precision down to microseconds. To ensure\n // offline mode works the same with regards to truncation, perform the\n // truncation immediately without waiting for the backend to do that.\n n = new j(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\n return {\n timestampValue: In(e.R, n)\n };\n }\n if (t instanceof ya) return {\n geoPointValue: {\n latitude: t.latitude,\n longitude: t.longitude\n }\n };\n if (t instanceof da) return {\n bytesValue: Tn(e.R, t._byteString)\n };\n if (t instanceof $u) {\n n = e.databaseId;\n var r = t.firestore._databaseId;\n if (!r.isEqual(n)) throw e.Lc(\"Document reference is for database \" + r.projectId + \"/\" + r.database + \" but should be for database \" + n.projectId + \"/\" + n.database);\n return {\n referenceValue: Sn(t.firestore._databaseId || e.databaseId, t._key.path)\n };\n }\n throw e.Lc(\"Unsupported field value: \" + Gu(t));\n }(t, e);\n}", "title": "" }, { "docid": "6bd01b92d56f8f437ff98600026e06d1", "score": "0.46318743", "text": "function La(t, e) {\n if (Pa(\n // Unwrap the API type from the Compat SDK. This will return the API type\n // from firestore-exp.\n t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(t))) return Fa(\"Unsupported field value:\", e, t), Oa(t, e);\n if (t instanceof pa) \n // FieldValues usually parse into transforms (except FieldValue.delete())\n // in which case we do not want to include this field in our parsed data\n // (as doing so will overwrite the field directly prior to the transform\n // trying to transform it). So we don't add this location to\n // context.fieldMask and we return null as our parsing result.\n /**\n * \"Parses\" the provided FieldValueImpl, adding any necessary transforms to\n * context.fieldTransforms.\n */\n return function(t, e) {\n // Sentinels are only supported with writes, and not within arrays.\n if (!wa(e.Nc)) throw e.Lc(t._methodName + \"() can only be used with update() and set()\");\n if (!e.path) throw e.Lc(t._methodName + \"() is not currently supported inside arrays\");\n var n = t._toFieldTransform(e);\n n && e.fieldTransforms.push(n);\n }(t, e), null;\n if (void 0 === t && e.ignoreUndefinedProperties) \n // If the input is undefined it can never participate in the fieldMask, so\n // don't handle this below. If `ignoreUndefinedProperties` is false,\n // `parseScalarValue` will reject an undefined value.\n return null;\n if (\n // If context.path is null we are inside an array and we don't support\n // field mask paths more granular than the top-level array.\n e.path && e.fieldMask.push(e.path), t instanceof Array) {\n // TODO(b/34871131): Include the path containing the array in the error\n // message.\n // In the case of IN queries, the parsed data is an array (representing\n // the set of values to be included for the IN query) that may directly\n // contain additional arrays (each representing an individual field\n // value), so we disable this validation.\n if (e.settings.Fc && 4 /* ArrayArgument */ !== e.Nc) throw e.Lc(\"Nested arrays are not supported\");\n return function(t, e) {\n for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {\n var s = La(o[i], e.Mc(r));\n null == s && (\n // Just include nulls in the array for fields being replaced with a\n // sentinel.\n s = {\n nullValue: \"NULL_VALUE\"\n }), n.push(s), r++;\n }\n return {\n arrayValue: {\n values: n\n }\n };\n }(t, e);\n }\n return function(t, e) {\n if (null === (t = (0,_firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance)(t))) return {\n nullValue: \"NULL_VALUE\"\n };\n if (\"number\" == typeof t) return le(e.R, t);\n if (\"boolean\" == typeof t) return {\n booleanValue: t\n };\n if (\"string\" == typeof t) return {\n stringValue: t\n };\n if (t instanceof Date) {\n var n = j.fromDate(t);\n return {\n timestampValue: In(e.R, n)\n };\n }\n if (t instanceof j) {\n // Firestore backend truncates precision down to microseconds. To ensure\n // offline mode works the same with regards to truncation, perform the\n // truncation immediately without waiting for the backend to do that.\n n = new j(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));\n return {\n timestampValue: In(e.R, n)\n };\n }\n if (t instanceof ya) return {\n geoPointValue: {\n latitude: t.latitude,\n longitude: t.longitude\n }\n };\n if (t instanceof da) return {\n bytesValue: Tn(e.R, t._byteString)\n };\n if (t instanceof $u) {\n n = e.databaseId;\n var r = t.firestore._databaseId;\n if (!r.isEqual(n)) throw e.Lc(\"Document reference is for database \" + r.projectId + \"/\" + r.database + \" but should be for database \" + n.projectId + \"/\" + n.database);\n return {\n referenceValue: Sn(t.firestore._databaseId || e.databaseId, t._key.path)\n };\n }\n throw e.Lc(\"Unsupported field value: \" + Gu(t));\n }(t, e);\n}", "title": "" }, { "docid": "8518eb2f9d21117cda4b72ab8f76de7f", "score": "0.46300867", "text": "_validateIsInstanceCall(node) {\n if (node.leftExpression.nodeType !== 38 || node.leftExpression.value !== \"isinstance\" && node.leftExpression.value !== \"issubclass\" || node.arguments.length !== 2) {\n return;\n }\n const callName = node.leftExpression.value;\n const isInstanceCheck = callName === \"isinstance\";\n let arg0Type = this._evaluator.getType(node.arguments[0].valueExpression);\n if (!arg0Type) {\n return;\n }\n arg0Type = (0, typeUtils_1.mapSubtypes)(arg0Type, (subtype) => {\n return (0, typeUtils_1.transformPossibleRecursiveTypeAlias)(subtype);\n });\n const arg1Type = this._evaluator.getType(node.arguments[1].valueExpression);\n if (!arg1Type) {\n return;\n }\n let isValidType = true;\n (0, typeUtils_1.doForEachSubtype)(arg1Type, (arg1Subtype) => {\n if ((0, types_1.isClassInstance)(arg1Subtype) && types_1.ClassType.isTupleClass(arg1Subtype) && arg1Subtype.tupleTypeArguments) {\n if (arg1Subtype.tupleTypeArguments.some((typeArg) => !this._isTypeSupportedTypeForIsInstance(typeArg.type, isInstanceCheck))) {\n isValidType = false;\n }\n } else {\n if (!this._isTypeSupportedTypeForIsInstance(arg1Subtype, isInstanceCheck)) {\n isValidType = false;\n }\n }\n });\n if (!isValidType) {\n const diag = new diagnostic_1.DiagnosticAddendum();\n diag.addMessage(localize_1.Localizer.DiagnosticAddendum.typeVarNotAllowed());\n this._evaluator.addDiagnostic(this._fileInfo.diagnosticRuleSet.reportGeneralTypeIssues, diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, isInstanceCheck ? localize_1.Localizer.Diagnostic.isInstanceInvalidType().format({\n type: this._evaluator.printType(arg1Type)\n }) + diag.getString() : localize_1.Localizer.Diagnostic.isSubclassInvalidType().format({\n type: this._evaluator.printType(arg1Type)\n }) + diag.getString(), node.arguments[1]);\n }\n let curNode = node;\n while (curNode) {\n if (curNode.nodeType === 2) {\n return;\n }\n curNode = curNode.parent;\n }\n const nonstandardClassTypes = [\n \"FunctionType\",\n \"LambdaType\",\n \"BuiltinFunctionType\",\n \"BuiltinMethodType\",\n \"type\",\n \"Type\"\n ];\n const classTypeList = [];\n let arg1IncludesSubclasses = false;\n (0, typeUtils_1.doForEachSubtype)(arg1Type, (arg1Subtype) => {\n if ((0, types_1.isClass)(arg1Subtype)) {\n if (types_1.TypeBase.isInstantiable(arg1Subtype)) {\n if (arg1Subtype.literalValue === void 0) {\n classTypeList.push(arg1Subtype);\n if (types_1.ClassType.isBuiltIn(arg1Subtype) && nonstandardClassTypes.some((name) => name === arg1Subtype.details.name)) {\n isValidType = false;\n }\n if (arg1Subtype.includeSubclasses) {\n arg1IncludesSubclasses = true;\n }\n }\n } else {\n if ((0, typeUtils_1.isTupleClass)(arg1Subtype)) {\n if (arg1Subtype.tupleTypeArguments) {\n arg1Subtype.tupleTypeArguments.forEach((typeArg) => {\n if ((0, types_1.isInstantiableClass)(typeArg.type)) {\n classTypeList.push(typeArg.type);\n if (typeArg.type.includeSubclasses) {\n arg1IncludesSubclasses = true;\n }\n } else {\n isValidType = false;\n }\n });\n }\n } else {\n if (arg1Subtype.includeSubclasses) {\n arg1IncludesSubclasses = true;\n }\n }\n if (types_1.ClassType.isBuiltIn(arg1Subtype) && nonstandardClassTypes.some((name) => name === arg1Subtype.details.name)) {\n isValidType = false;\n }\n }\n } else {\n isValidType = false;\n }\n });\n if (!isValidType) {\n return;\n }\n if (classTypeList.some((type) => types_1.ClassType.isProtocolClass(type) && !types_1.ClassType.isRuntimeCheckable(type))) {\n this._evaluator.addError(localize_1.Localizer.Diagnostic.protocolUsedInCall().format({ name: callName }), node.arguments[1].valueExpression);\n }\n if ((0, typeUtils_1.derivesFromAnyOrUnknown)(arg0Type)) {\n return;\n }\n const finalizeFilteredTypeList = (types) => {\n return (0, types_1.combineTypes)(types);\n };\n const filterType = (varType) => {\n const filteredTypes = [];\n for (const filterType2 of classTypeList) {\n const filterIsSuperclass = (0, typeGuards_1.isIsinstanceFilterSuperclass)(this._evaluator, varType, filterType2, filterType2, isInstanceCheck);\n const filterIsSubclass = (0, typeGuards_1.isIsinstanceFilterSubclass)(this._evaluator, varType, filterType2, filterType2, isInstanceCheck);\n const isClassRelationshipIndeterminate = filterIsSubclass && filterIsSubclass && !types_1.ClassType.isSameGenericClass(varType, filterType2);\n if (isClassRelationshipIndeterminate) {\n filteredTypes.push(types_1.UnknownType.create());\n } else if (filterIsSuperclass) {\n filteredTypes.push(varType);\n } else if (filterIsSubclass) {\n filteredTypes.push(filterType2);\n }\n }\n if (!isInstanceCheck) {\n return filteredTypes;\n }\n return filteredTypes.map((t) => (0, types_1.isInstantiableClass)(t) ? types_1.ClassType.cloneAsInstance(t) : t);\n };\n let filteredType;\n if (isInstanceCheck && (0, types_1.isClassInstance)(arg0Type)) {\n const remainingTypes = filterType(types_1.ClassType.cloneAsInstantiable(arg0Type));\n filteredType = finalizeFilteredTypeList(remainingTypes);\n } else if (!isInstanceCheck && (0, types_1.isInstantiableClass)(arg0Type)) {\n const remainingTypes = filterType(arg0Type);\n filteredType = finalizeFilteredTypeList(remainingTypes);\n } else if ((0, types_1.isUnion)(arg0Type)) {\n let remainingTypes = [];\n let foundAnyType = false;\n (0, typeUtils_1.doForEachSubtype)(arg0Type, (subtype) => {\n if ((0, types_1.isAnyOrUnknown)(subtype)) {\n foundAnyType = true;\n }\n if (isInstanceCheck && (0, types_1.isClassInstance)(subtype)) {\n remainingTypes = remainingTypes.concat(filterType(types_1.ClassType.cloneAsInstantiable(subtype)));\n } else if (!isInstanceCheck && (0, types_1.isInstantiableClass)(subtype)) {\n remainingTypes = remainingTypes.concat(filterType(subtype));\n }\n });\n filteredType = finalizeFilteredTypeList(remainingTypes);\n if (foundAnyType) {\n return;\n }\n } else {\n return;\n }\n const getTestType = () => {\n const objTypeList = classTypeList.map((t) => types_1.ClassType.cloneAsInstance(t));\n return (0, types_1.combineTypes)(objTypeList);\n };\n if (!arg1IncludesSubclasses && (0, types_1.isTypeSame)(filteredType, arg0Type, { ignorePseudoGeneric: true })) {\n this._evaluator.addDiagnostic(this._fileInfo.diagnosticRuleSet.reportUnnecessaryIsInstance, diagnosticRules_1.DiagnosticRule.reportUnnecessaryIsInstance, isInstanceCheck ? localize_1.Localizer.Diagnostic.unnecessaryIsInstanceAlways().format({\n testType: this._evaluator.printType(arg0Type),\n classType: this._evaluator.printType(getTestType())\n }) : localize_1.Localizer.Diagnostic.unnecessaryIsSubclassAlways().format({\n testType: this._evaluator.printType(arg0Type),\n classType: this._evaluator.printType(getTestType())\n }), node);\n }\n }", "title": "" }, { "docid": "ed04e0276ee73e3ef802a95516129ea1", "score": "0.46293098", "text": "function VarType(check) {\n return typeof check;\n}", "title": "" }, { "docid": "a5dc12adaf62c89b730f6f08457b330c", "score": "0.46232897", "text": "function processParameterTypes(data){\n for (i in data) {\n parameterTypes[data[i][0]]={'lname':data[i][1],'uname':data[i][1]};\n }\n \n}", "title": "" }, { "docid": "20be7e9922de3152230972039738f4e0", "score": "0.46216887", "text": "_parseFields (fields) {\n let parsedFields = {}\n for (let key in fields) {\n let field = fields[key]\n if (field.type instanceof Schema) {\n // Using a Schema as a SchemaType is OK.\n parsedFields[key] = field.type\n } else {\n parsedFields[key] = new field.type(field)\n }\n }\n return parsedFields\n }", "title": "" }, { "docid": "9ce3d9d922fee92fbbe7a244506867b1", "score": "0.4619939", "text": "function ValuesOfCorrectType(context) {\n return {\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if ((0, _definition.isNonNullType)(type)) {\n context.reportError(new _GraphQLError.GraphQLError(badValueMessage((0, _inspect.default)(type), (0, _printer.print)(node)), node));\n }\n },\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = (0, _definition.getNullableType)(context.getParentInputType());\n\n if (!(0, _definition.isListType)(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = (0, _definition.getNamedType)(context.getInputType());\n\n if (!(0, _definition.isInputObjectType)(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var inputFields = type.getFields();\n var fieldNodeMap = (0, _keyMap.default)(node.fields, function (field) {\n return field.name.value;\n });\n\n var _arr = Object.keys(inputFields);\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var fieldName = _arr[_i];\n var fieldDef = inputFields[fieldName];\n var fieldNode = fieldNodeMap[fieldName];\n\n if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) {\n var typeStr = (0, _inspect.default)(fieldDef.type);\n context.reportError(new _GraphQLError.GraphQLError(requiredFieldMessage(type.name, fieldName, typeStr), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = (0, _definition.getNamedType)(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && (0, _definition.isInputObjectType)(parentType)) {\n var suggestions = (0, _suggestionList.default)(node.name.value, Object.keys(parentType.getFields()));\n var didYouMean = suggestions.length !== 0 ? \"Did you mean \".concat((0, _orList.default)(suggestions), \"?\") : undefined;\n context.reportError(new _GraphQLError.GraphQLError(unknownFieldMessage(parentType.name, node.name.value, didYouMean), node));\n }\n },\n EnumValue: function EnumValue(node) {\n var type = (0, _definition.getNamedType)(context.getInputType());\n\n if (!(0, _definition.isEnumType)(type)) {\n isValidScalar(context, node);\n } else if (!type.getValue(node.value)) {\n context.reportError(new _GraphQLError.GraphQLError(badValueMessage(type.name, (0, _printer.print)(node), enumTypeSuggestion(type, node)), node));\n }\n },\n IntValue: function IntValue(node) {\n return isValidScalar(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidScalar(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidScalar(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidScalar(context, node);\n }\n };\n}", "title": "" }, { "docid": "9ce3d9d922fee92fbbe7a244506867b1", "score": "0.4619939", "text": "function ValuesOfCorrectType(context) {\n return {\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if ((0, _definition.isNonNullType)(type)) {\n context.reportError(new _GraphQLError.GraphQLError(badValueMessage((0, _inspect.default)(type), (0, _printer.print)(node)), node));\n }\n },\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = (0, _definition.getNullableType)(context.getParentInputType());\n\n if (!(0, _definition.isListType)(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = (0, _definition.getNamedType)(context.getInputType());\n\n if (!(0, _definition.isInputObjectType)(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var inputFields = type.getFields();\n var fieldNodeMap = (0, _keyMap.default)(node.fields, function (field) {\n return field.name.value;\n });\n\n var _arr = Object.keys(inputFields);\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var fieldName = _arr[_i];\n var fieldDef = inputFields[fieldName];\n var fieldNode = fieldNodeMap[fieldName];\n\n if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) {\n var typeStr = (0, _inspect.default)(fieldDef.type);\n context.reportError(new _GraphQLError.GraphQLError(requiredFieldMessage(type.name, fieldName, typeStr), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = (0, _definition.getNamedType)(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && (0, _definition.isInputObjectType)(parentType)) {\n var suggestions = (0, _suggestionList.default)(node.name.value, Object.keys(parentType.getFields()));\n var didYouMean = suggestions.length !== 0 ? \"Did you mean \".concat((0, _orList.default)(suggestions), \"?\") : undefined;\n context.reportError(new _GraphQLError.GraphQLError(unknownFieldMessage(parentType.name, node.name.value, didYouMean), node));\n }\n },\n EnumValue: function EnumValue(node) {\n var type = (0, _definition.getNamedType)(context.getInputType());\n\n if (!(0, _definition.isEnumType)(type)) {\n isValidScalar(context, node);\n } else if (!type.getValue(node.value)) {\n context.reportError(new _GraphQLError.GraphQLError(badValueMessage(type.name, (0, _printer.print)(node), enumTypeSuggestion(type, node)), node));\n }\n },\n IntValue: function IntValue(node) {\n return isValidScalar(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidScalar(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidScalar(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidScalar(context, node);\n }\n };\n}", "title": "" }, { "docid": "ff0462ae9f4a5369a64ad966d776ac73", "score": "0.46170512", "text": "function getArgumentValues(def, node, variableValues) {\n var coercedValues = {};\n var argDefs = def.args;\n var argNodes = node.arguments;\n\n if (!argDefs || !argNodes) {\n return coercedValues;\n }\n\n var argNodeMap = Object(_jsutils_keyMap__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(argNodes, function (arg) {\n return arg.name.value;\n });\n\n for (var i = 0; i < argDefs.length; i++) {\n var argDef = argDefs[i];\n var name = argDef.name;\n var argType = argDef.type;\n var argumentNode = argNodeMap[name];\n var hasValue = void 0;\n var isNull = void 0;\n\n if (argumentNode && argumentNode.value.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_8__[\"Kind\"].VARIABLE) {\n var variableName = argumentNode.value.name.value;\n hasValue = variableValues != null && hasOwnProperty(variableValues, variableName);\n isNull = variableValues != null && variableValues[variableName] === null;\n } else {\n hasValue = argumentNode != null;\n isNull = argumentNode != null && argumentNode.value.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_8__[\"Kind\"].NULL;\n }\n\n if (!hasValue && argDef.defaultValue !== undefined) {\n // If no argument was provided where the definition has a default value,\n // use the default value.\n coercedValues[name] = argDef.defaultValue;\n } else if ((!hasValue || isNull) && Object(_type_definition__WEBPACK_IMPORTED_MODULE_10__[\"isNonNullType\"])(argType)) {\n // If no argument or a null value was provided to an argument with a\n // non-null type (required), produce a field error.\n if (isNull) {\n throw new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" of non-null type \\\"\").concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(argType), \"\\\" \") + 'must not be null.', argumentNode.value);\n } else if (argumentNode && argumentNode.value.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_8__[\"Kind\"].VARIABLE) {\n var _variableName = argumentNode.value.name.value;\n throw new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(argType), \"\\\" \") + \"was provided the variable \\\"$\".concat(_variableName, \"\\\" \") + 'which was not provided a runtime value.', argumentNode.value);\n } else {\n throw new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(argType), \"\\\" \") + 'was not provided.', node);\n }\n } else if (hasValue) {\n if (argumentNode.value.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_8__[\"Kind\"].NULL) {\n // If the explicit value `null` was provided, an entry in the coerced\n // values must exist as the value `null`.\n coercedValues[name] = null;\n } else if (argumentNode.value.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_8__[\"Kind\"].VARIABLE) {\n var _variableName2 = argumentNode.value.name.value;\n !variableValues ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Must exist for hasValue to be true.') : void 0; // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n coercedValues[name] = variableValues[_variableName2];\n } else {\n var valueNode = argumentNode.value;\n var coercedValue = Object(_utilities_valueFromAST__WEBPACK_IMPORTED_MODULE_7__[\"valueFromAST\"])(valueNode, argType, variableValues);\n\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectType validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](\"Argument \\\"\".concat(name, \"\\\" has invalid value \").concat(Object(_language_printer__WEBPACK_IMPORTED_MODULE_9__[\"print\"])(valueNode), \".\"), argumentNode.value);\n }\n\n coercedValues[name] = coercedValue;\n }\n }\n }\n\n return coercedValues;\n}", "title": "" }, { "docid": "734b7c4f9afffda664a6864c3112da19", "score": "0.46165085", "text": "_type(v) {\n if (typeof v === 'number') {\n return 1;\n }\n\n if (typeof v === 'string') {\n return 2;\n }\n\n if (typeof v === 'boolean') {\n return 8;\n }\n\n if (Array.isArray(v)) {\n return 4;\n }\n\n if (v === null) {\n return 10;\n } // note that typeof(/x/) === \"object\"\n\n\n if (v instanceof RegExp) {\n return 11;\n }\n\n if (typeof v === 'function') {\n return 13;\n }\n\n if (v instanceof Date) {\n return 9;\n }\n\n if (EJSON.isBinary(v)) {\n return 5;\n }\n\n if (v instanceof MongoID.ObjectID) {\n return 7;\n } // object\n\n\n return 3; // XXX support some/all of these:\n // 14, symbol\n // 15, javascript code with scope\n // 16, 18: 32-bit/64-bit integer\n // 17, timestamp\n // 255, minkey\n // 127, maxkey\n }", "title": "" }, { "docid": "979dab96a0ff63ecbd34168f889777a1", "score": "0.4610027", "text": "function ProvidedNonNullArguments(context) {\n\t return {\n\t Field: {\n\t // Validate on leave to allow for deeper errors to appear first.\n\t leave: function leave(fieldAST) {\n\t var fieldDef = context.getFieldDef();\n\t if (!fieldDef) {\n\t return false;\n\t }\n\t var argASTs = fieldAST.arguments || [];\n\t\n\t var argASTMap = (0, _keyMap2.default)(argASTs, function (arg) {\n\t return arg.name.value;\n\t });\n\t fieldDef.args.forEach(function (argDef) {\n\t var argAST = argASTMap[argDef.name];\n\t if (!argAST && argDef.type instanceof _definition.GraphQLNonNull) {\n\t context.reportError(new _error.GraphQLError(missingFieldArgMessage(fieldAST.name.value, argDef.name, argDef.type), [fieldAST]));\n\t }\n\t });\n\t }\n\t },\n\t\n\t Directive: {\n\t // Validate on leave to allow for deeper errors to appear first.\n\t leave: function leave(directiveAST) {\n\t var directiveDef = context.getDirective();\n\t if (!directiveDef) {\n\t return false;\n\t }\n\t var argASTs = directiveAST.arguments || [];\n\t\n\t var argASTMap = (0, _keyMap2.default)(argASTs, function (arg) {\n\t return arg.name.value;\n\t });\n\t directiveDef.args.forEach(function (argDef) {\n\t var argAST = argASTMap[argDef.name];\n\t if (!argAST && argDef.type instanceof _definition.GraphQLNonNull) {\n\t context.reportError(new _error.GraphQLError(missingDirectiveArgMessage(directiveAST.name.value, argDef.name, argDef.type), [directiveAST]));\n\t }\n\t });\n\t }\n\t }\n\t };\n\t}", "title": "" }, { "docid": "4d11a8dc9e37e165d8e2939440b8e29d", "score": "0.46086022", "text": "function check_var(incoming){\n if (incoming.constructor === Array) return true;\n return false;\n}", "title": "" }, { "docid": "6ffed32acb6fa8603e931f1a979997c4", "score": "0.46014142", "text": "function validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\r\n}", "title": "" }, { "docid": "6ffed32acb6fa8603e931f1a979997c4", "score": "0.46014142", "text": "function validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\r\n}", "title": "" }, { "docid": "6ffed32acb6fa8603e931f1a979997c4", "score": "0.46014142", "text": "function validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\r\n}", "title": "" }, { "docid": "6ffed32acb6fa8603e931f1a979997c4", "score": "0.46014142", "text": "function validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\r\n}", "title": "" }, { "docid": "a321af3a9a3cafe2b242fbc4c8a93201", "score": "0.45933053", "text": "function prepVararg(ptr, type) {\n if (type === 'double' || type === 'i64') {\n // move so the load is aligned\n if (ptr & 7) {\n assert((ptr & 7) === 4);\n ptr += 4;\n }\n } else {\n assert((ptr & 3) === 0);\n }\n return ptr;\n }", "title": "" }, { "docid": "a321af3a9a3cafe2b242fbc4c8a93201", "score": "0.45933053", "text": "function prepVararg(ptr, type) {\n if (type === 'double' || type === 'i64') {\n // move so the load is aligned\n if (ptr & 7) {\n assert((ptr & 7) === 4);\n ptr += 4;\n }\n } else {\n assert((ptr & 3) === 0);\n }\n return ptr;\n }", "title": "" } ]
e7d4bd1ec3f098b7a0f96bf512afb3a3
specifically close a peer's connection, this should only be called when a peer was disconnected unexpectedly
[ { "docid": "27bbbd97884d99e4a0018611d24b0f92", "score": "0.0", "text": "function _close(p) {\r\n // if pmedchans exits, end it\r\n if (pmedchans[p]) { pmedchans[p].end(); }\r\n\r\n // set pstate to 'left' and notify applicate in a fake response event\r\n pstate[p] = 'left';\r\n if (onconfresponse) {\r\n setTimeout(function() {\r\n onconfresponse({from: p, type: 'conf', data: {cmd: 'response', peers: peers, pstate: pstate}}); \r\n }, 0);\r\n }\r\n _exitcheck();\r\n }", "title": "" } ]
[ { "docid": "7f160a456c5e1815d82df7d38782c4b3", "score": "0.8573323", "text": "close () {\n if (!this.isConnected()) {\n this._debug('Info', 'Not connected, can not close connection')\n return\n }\n\n this.peer.destroy()\n }", "title": "" }, { "docid": "f7539d93e04c935a73b78fab1db4b5ce", "score": "0.75841415", "text": "function close() {\n const { nativePeer, id, emitter, iceLoop, log } = this;\n log.info('Closing Peer.');\n\n if (iceLoop) {\n // Clear the ICE collection loop timeout if it exists.\n clearTimeout(iceLoop);\n }\n\n nativePeer.close();\n emitter.emit('peer:closed', id);\n}", "title": "" }, { "docid": "78a281ed819195598c8488728dbdbb09", "score": "0.74941003", "text": "function disconnect() {\n log(\"disconnecting\");\n connection.close();\n connection = null;\n}", "title": "" }, { "docid": "e3ebbecec4f6598038f2a4efe468116e", "score": "0.74364203", "text": "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "title": "" }, { "docid": "e3ebbecec4f6598038f2a4efe468116e", "score": "0.74364203", "text": "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "title": "" }, { "docid": "43ffa7808b58e6406e01569da0ca74b3", "score": "0.743283", "text": "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "title": "" }, { "docid": "340d306130b791e6e558575209f3812e", "score": "0.74066037", "text": "_onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }", "title": "" }, { "docid": "340d306130b791e6e558575209f3812e", "score": "0.74066037", "text": "_onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }", "title": "" }, { "docid": "340d306130b791e6e558575209f3812e", "score": "0.74066037", "text": "_onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }", "title": "" }, { "docid": "3214571d89d6dfe6adb1e06dafbfef8c", "score": "0.7398776", "text": "disconnect() {\n this.handledClose = true;\n this.socket.close();\n }", "title": "" }, { "docid": "53ad0938e7a4564656d836b212ca7d75", "score": "0.7341236", "text": "disconnect() {\n this.connection.end();\n }", "title": "" }, { "docid": "db2274c6eb27acb0f2aa36bd5cfd1c9e", "score": "0.72156966", "text": "disconnect() {\n debug(`Mediaserver#disconnect - closing connection to ${this.address}`);\n this.closing = true;\n this._server.close() ;\n this.conn.removeAllListeners();\n this.conn.disconnect() ;\n }", "title": "" }, { "docid": "4e48799019ea4806bcae925735456d8f", "score": "0.7200012", "text": "close() {\n if (this._connected) {\n this._connected = false;\n this._socket.close();\n for (let requestResolve of Object.values(this._requestResolves)) {\n requestResolve.reject(new Error('MetaApi connection closed'));\n }\n this._requestResolves = {};\n this._synchronizationListeners = {};\n this._latencyListeners = [];\n this._packetOrderer.stop();\n }\n }", "title": "" }, { "docid": "138e33c1660a6e1a9ae26f40bd12abd0", "score": "0.7161315", "text": "close() {\r\n this.logger.debug(\"SessionDescriptionHandler.close\");\r\n if (this._peerConnection === undefined) {\r\n return;\r\n }\r\n this._peerConnection.getReceivers().forEach((receiver) => {\r\n receiver.track && receiver.track.stop();\r\n });\r\n this._peerConnection.getSenders().forEach((sender) => {\r\n sender.track && sender.track.stop();\r\n });\r\n if (this._dataChannel) {\r\n this._dataChannel.close();\r\n }\r\n this._peerConnection.close();\r\n this._peerConnection = undefined;\r\n }", "title": "" }, { "docid": "8711e939830c0ffa37acf238b326843b", "score": "0.71524996", "text": "disconnect() {\n this.socket.close();\n this.socket = null;\n this.isConnected = false;\n this.callback();\n }", "title": "" }, { "docid": "b040671c4a8fdccccef3d59404051a55", "score": "0.7140211", "text": "function closeConnection(){\n\tif(isConnected){\n\t\tconnection.end();\n\t\tif(timerConnection){\n\t\t\tclearTimeout(timerConnection);\n\t\t\ttimerConnection = undefined;\n\t\t}\n\t\tisConnected = false;\n\t}\n}", "title": "" }, { "docid": "5ccf3bfc98f731579ae295b67f593a6c", "score": "0.71385133", "text": "disconnect() {\n this._sock.close();\n }", "title": "" }, { "docid": "0a822bcd4362f18084357edfd497ec11", "score": "0.711923", "text": "disconnect() {\n\t\tif (this.socket) {\n\t\t\tthis.socket.close();\n\t\t}\n\t\tthis.socket = null;\n\t}", "title": "" }, { "docid": "9bf58040330d33a34336b727e394f244", "score": "0.70955884", "text": "function onClose() {\n console.log(`HuobiDMOrderBook:${symbol} connection close.`);\n\n huobiDMOrderBook.status = 'disconnected';\n\n const waitSeconds = 2 ** connectionCounter;\n\n if (waitSeconds >= 1024) {\n throw new Error(`HuobiDMOrderBook:${symbol} could not`\n + 'reconnect after several tries.');\n }\n\n setTimeout(() => {\n huobiDMOrderBook.disconnect();\n huobiDMOrderBook.connect();\n }, waitSeconds);\n }", "title": "" }, { "docid": "14483287b7d6dd26830572384cb0cfc5", "score": "0.7086444", "text": "function disconnect() {\n if (conn !== null) {\n disconn = 1;\n conn.close();\n }\n }", "title": "" }, { "docid": "c680302f233c9d93a615ea0c8faebc61", "score": "0.7042371", "text": "function closeDataChannelOnPeerConnection() {\n if (global.peerConnection == null)\n error_('Tried to close data channel, but have no peer connection.');\n\n closeDataChannel(global.peerConnection);\n print_('ok-datachannel-close');\n}", "title": "" }, { "docid": "2190867efbae6267ca5d16843cb26b5f", "score": "0.70401645", "text": "disconnect()\n {\n this.isConnected = false;\n this.socket.destroy();\n }", "title": "" }, { "docid": "fb5e94cc67c14658558f4ac345e4058e", "score": "0.7023052", "text": "_ConnectionCloseHandler()\n {\n console.info(`Socket has Closed`);\n this._SocketSrv.end();\n this._SocketSrv.destroy();\n }", "title": "" }, { "docid": "8c7596461c4515216773d1b13c94ed5e", "score": "0.69899297", "text": "function disconnect() {\n try {\n global.clientconn.destroy();\n global.clientconn = null;\n } catch (err) {\n log.error(err);\n }\n}", "title": "" }, { "docid": "e4f39e4cc514d739a5e2f70138a6cf04", "score": "0.697849", "text": "async [PEER_DISCONNECT] ({ state, commit, dispatch }) {\n if (state.peerConnectionStatus !== PEER_DISCONNECTED) {\n commit(PEER_DISCONNECTING)\n const conn = state.peerConnection\n if (conn) {\n try {\n console.debug('Closing Peer DataConnection.', { conn })\n await conn.close()\n } catch (err) {\n console.info('Error while closing peer DataConnection.', err)\n }\n }\n commit(PEER_DISCONNECTED)\n }\n }", "title": "" }, { "docid": "389d382f9a921ca8515489face729c63", "score": "0.69773835", "text": "async function close () {\n try {\n alive = false\n conn.close()\n } catch (err) {\n emitter.emit(err)\n }\n}", "title": "" }, { "docid": "0b62e13f277729e0c5eb8ac43fddacce", "score": "0.6961321", "text": "close() {\n\t\tlogger.debug('close - closing connections');\n\t\tthis._channel_peers.forEach((channel_peer) => {\n\t\t\tchannel_peer.close();\n\t\t});\n\t\tthis._orderers.forEach((orderer) => {\n\t\t\torderer.close();\n\t\t});\n\t}", "title": "" }, { "docid": "336a087e682c8432fa120397b133867b", "score": "0.6959707", "text": "close(err) {\n this._write(Net.pack(err, Net.getCode('disconnect') + COMPRESS));\n this._connected = false;\n this._socket.end();\n this._socket.destroy();\n }", "title": "" }, { "docid": "7be5faff4c9680fd03bc677f1d4f8268", "score": "0.69510794", "text": "function closeConnection() {\n // close socket\n socket.close();\n // end everything\n process.exit();\n}", "title": "" }, { "docid": "66a3757c78e1503257db5968826d5467", "score": "0.69339144", "text": "_close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "title": "" }, { "docid": "bf54c78105ce967536fac9d36c110eb8", "score": "0.69284624", "text": "close() {\n if (this.state_ !== 2\n /* DISCONNECTED */\n ) {\n this.log_('Closing realtime connection.');\n this.state_ = 2\n /* DISCONNECTED */\n ;\n this.closeConnections_();\n\n if (this.onDisconnect_) {\n this.onDisconnect_();\n this.onDisconnect_ = null;\n }\n }\n }", "title": "" }, { "docid": "fb1b995bc9e1caccdf32459e6fb1c313", "score": "0.69084877", "text": "function onConnClose() {\n console.log('connection from %s closed', remoteAddress);\n // sockets.splice(conn.id, 1);\n }", "title": "" }, { "docid": "cc0cbb6658c32cf0b89b4002e4936f71", "score": "0.6891388", "text": "disconnect() {\n var _a, _b;\n this._receiver.disconnect();\n (_a = this._incomingServer) === null || _a === void 0 ? void 0 : _a.close();\n this._incomingServer = null;\n this._sender.disconnect();\n (_b = this._outgoingServer) === null || _b === void 0 ? void 0 : _b.close();\n this._outgoingServer = null;\n }", "title": "" }, { "docid": "2cb728f863fadbdb2d6f40c87e2b8868", "score": "0.68873453", "text": "close()\n\t{\n\t\tif (this._closed)\n\t\t\treturn;\n\n\t\tlogger.debug('close()');\n\n\t\tthis._closed = true;\n\t\tthis._connected = false;\n\n\t\t// Close Transport.\n\t\tthis._transport.close();\n\n\t\t// Close every pending sent.\n\t\tfor (const sent of this._sents.values())\n\t\t{\n\t\t\tsent.close();\n\t\t}\n\n\t\t// Emit 'close' event.\n\t\tthis.safeEmit('close');\n\t}", "title": "" }, { "docid": "c77d41078e98037a5d4d4ec0ddcd6cdc", "score": "0.68817234", "text": "function closeConnection() {\n\tconnection.end()\n}", "title": "" }, { "docid": "20c146eda9e56d8047b759b108ce3e2d", "score": "0.68801033", "text": "function onClose() {\n\t\tconsole.log('Client socket: Connection closed');\n\t\tws = null;\n\t\tcastEvent('onClose', event);\n\t}", "title": "" }, { "docid": "1268af66b6e89c0e880fa102bdf4f97f", "score": "0.6866502", "text": "disconnect() {\n if (this._connection.connected) {\n this._connection.disconnect();\n }\n }", "title": "" }, { "docid": "c5c4092b6a58ac07a6ebd22a9c02c747", "score": "0.68531376", "text": "function destroyPeer()\n{\n if (peer) peer.destroy();\n}", "title": "" }, { "docid": "f9a0cc45835fc16e3fc31f3b1344ebb4", "score": "0.6852595", "text": "onClose() {\n this._closeSocket(constants_1.ERRORS.SocketClosed);\n }", "title": "" }, { "docid": "90b4116f96e65c34eae1deec7046b1c6", "score": "0.68193674", "text": "disconnect() {\n if (this.connected) {\n this.reqSocket.close();\n this.pullSocket.close();\n this.connected = false;\n }\n }", "title": "" }, { "docid": "90d986a66183b5482d315058dd35ece2", "score": "0.6811892", "text": "disconnect() {\n if (!this.__connected) {\n return;\n }\n this.__reconnect = true;\n if (this.__socket) {\n this.__socket.addEventListener(\"close\", () => {\n this.__connecting = false;\n this.__socket = null;\n //Required so we don't have two at once.\n });\n this.__socket.close();\n } else {\n this.__connecting = false;\n }\n }", "title": "" }, { "docid": "776ad6362d86408cfe9d1448b2ba2416", "score": "0.680257", "text": "async disconnect() {\n try {\n if (this.client && this.client.close) {\n await this.client.close();\n }\n } catch (error) {\n appLog.error(error, 'error closing connection after error');\n }\n this.client = null;\n }", "title": "" }, { "docid": "4312b520f08f830139af98daa4bea4d6", "score": "0.68015933", "text": "function _CONNECTION_CLOSE() {\n this.emit('data', Buffer.from('DATA'));\n this.emit('data', Buffer.from('CLOSE'));\n this.emit('close');\n}", "title": "" }, { "docid": "2dae0cac02a47d20a8713abdbd24415f", "score": "0.6799163", "text": "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "title": "" }, { "docid": "17f3242257f6bb4f22baa8025a7d0c7c", "score": "0.67754364", "text": "disconnect() {\n log.debug('Disconnect requested.');\n this._socket.close();\n }", "title": "" }, { "docid": "9c1da642904819471144b5c99a30702e", "score": "0.6774664", "text": "disconnect() {\n this.connection.disconnect();\n }", "title": "" }, { "docid": "8293ad11b38426592185b2db1be9eb78", "score": "0.6771405", "text": "disconnect() {\n if (!this._connected) {\n return;\n }\n\n debug('Disconnect');\n\n this._connected = false;\n this.device.parser.cipher.setSessionKey(null);\n\n // Clear timeouts\n clearTimeout(this._sendTimeout);\n clearTimeout(this._connectTimeout);\n clearTimeout(this._responseTimeout);\n clearInterval(this._pingPongInterval);\n clearTimeout(this._pingPongTimeout);\n\n if (this.client) {\n this.client.destroy();\n }\n\n /**\n * Emitted when a socket is disconnected\n * from device. Not an exclusive event:\n * `error` and `disconnected` may be emitted\n * at the same time if, for example, the device\n * goes off the network.\n * @event TuyaDevice#disconnected\n */\n this.emit('disconnected');\n }", "title": "" }, { "docid": "c9e62df2fee8398d9831b8ba3c2fefa4", "score": "0.67612714", "text": "_close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }", "title": "" }, { "docid": "5ab0a0052e14bab22425dd6e79bf5eaa", "score": "0.6731362", "text": "terminate () {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n if (this._req && !this._req.aborted) {\n this._req.abort();\n this.emit('error', new Error('closed before the connection is established'));\n this.finalize(true);\n }\n return;\n }\n\n this.finalize(true);\n }", "title": "" }, { "docid": "85895d485e88bf134f1af930c17382e7", "score": "0.6727582", "text": "close() {\n if (this._state !== SessionState.closed) {\n if ((this._state !== SessionState.idle) && this._comChannel && this._sessionId) {\n this._comChannel.send({\n type: \"endSession\",\n sessionId: this._sessionId\n });\n }\n\n this._state = SessionState.closed;\n this.dispatchEvent(new Event(\"stateChanged\"));\n\n this._comChannel = null;\n\n if (this._rtcPeerConnection) {\n this._rtcPeerConnection.close();\n this._rtcPeerConnection = null;\n this.dispatchEvent(new Event(\"rtcPeerConnectionChanged\"));\n }\n\n this.dispatchEvent(new Event(\"closed\"));\n }\n }", "title": "" }, { "docid": "3cb7104df871532af2358b9fa08f0326", "score": "0.67195994", "text": "close (callback = () => {}) {\n debug('Closing connection', this.id)\n if (this._openRequests > 0) {\n setTimeout(() => this.close(callback), 1000)\n } else {\n this.agent.destroy()\n callback()\n }\n }", "title": "" }, { "docid": "74c4d654566a9c70da9ccee9939b3052", "score": "0.6716513", "text": "onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n super.emit(\"disconnect\", reason);\n }", "title": "" }, { "docid": "30c3dd74e7d9c98fc6063446e2bca143", "score": "0.671038", "text": "close()\n\t{\n\t\tlogger.debug('close()');\n\n\t\tthis._closed = true;\n\n\t\t// Close the protoo Room.\n\t\tthis._protooRoom.close();\n\n\t\t// Close the mediasoup Router.\n\t\tthis._mediasoupRouter.close();\n\n\t\t// Close the Bot.\n\t\tthis._bot.close();\n\n\t\t// Emit 'close' event.\n\t\tthis.emit('close');\n\n\t\t// Stop network throttling.\n\t\tif (this._networkThrottled)\n\t\t{\n\t\t\tlogger.debug('close() | stopping network throttle');\n\n\t\t\tthrottle.stop({})\n\t\t\t\t.catch((error) =>\n\t\t\t\t{\n\t\t\t\t\tlogger.error(`close() | failed to stop network throttle:${error}`);\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "c111f449ce6605556a46fdee45bffa2e", "score": "0.67101246", "text": "function endConnection(){\n connection.end();\n}", "title": "" }, { "docid": "51bd686e4f63d58a6049f0a121fd2a45", "score": "0.67069876", "text": "doClose() {\n const close = () => {\n debug$3(\"writing close packet\");\n this.write([{ type: \"close\" }]);\n };\n\n if (\"open\" === this.readyState) {\n debug$3(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug$3(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "title": "" }, { "docid": "d1835102126607f0ae125fb0cb57a775", "score": "0.6703146", "text": "onclose(reason) {\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emitReserved(\"disconnect\", reason);\n }", "title": "" }, { "docid": "fb1b09c1c118a616be5aef9f3e7439b6", "score": "0.6700768", "text": "close() {\t\t\t\t//Close server connection from this end\n this.socket.close()\n this.notify(this.addr = '')\n }", "title": "" }, { "docid": "4366330f4ab01f8faeb0dfa1d56db88e", "score": "0.669237", "text": "disconnect () {\n this._socket.end()\n }", "title": "" }, { "docid": "1f00f69abd62540fa939ac6710436edb", "score": "0.66899985", "text": "disconnectedCallback() {\n this.socket.close();\n }", "title": "" }, { "docid": "4c8eb5db91e7302d4c116f2e27de8fdd", "score": "0.6682996", "text": "remoteClose()\n\t{\n\t\tlogger.debug('remoteClose()');\n\n\t\tif (this._closed)\n\t\t\treturn;\n\n\t\tthis._closed = true;\n\n\t\tif (this._transport)\n\t\t\tthis._transport.removeConsumer(this);\n\n\t\tthis._destroy();\n\n\t\tthis.emit('@close');\n\t\tthis.safeEmit('close', 'remote');\n\t}", "title": "" }, { "docid": "5e877b61447be6466aea8a35d5af5711", "score": "0.6678721", "text": "function cleanUpPeerConnection(pc) {\n if (remoteVideoObjectMap.has(pc)) {\n removeVideoElement(remoteVideoObjectMap.get(pc));\n remoteVideoObjectMap.delete(pc);\n }\n pc.close();\n}", "title": "" }, { "docid": "c2ad648c5581acc1c9d4caef7705834e", "score": "0.6673695", "text": "terminate () {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n this._req.abort();\n this.finalize(new Error('closed before the connection is established'));\n return;\n }\n\n this.finalize(true);\n }", "title": "" }, { "docid": "c2ad648c5581acc1c9d4caef7705834e", "score": "0.6673695", "text": "terminate () {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n this._req.abort();\n this.finalize(new Error('closed before the connection is established'));\n return;\n }\n\n this.finalize(true);\n }", "title": "" }, { "docid": "6f9cf84b266b8079d9928800aa40d452", "score": "0.66585904", "text": "onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emitReserved(\"disconnect\", reason);\n }", "title": "" }, { "docid": "1045c51aa0c96fe47ed31d090eebcdfc", "score": "0.6649019", "text": "close () {\n if (!this.wss) {\n throw new Error('already closed')\n }\n\n if (this.host) {\n this.host.close()\n }\n\n this.wss.close()\n this.wss = null\n }", "title": "" }, { "docid": "780f270270669607ec2677bc2b2e7981", "score": "0.6643197", "text": "disconnected() {\n if (this.socket) {\n this.socket.destroy();\n }\n super.disconnected();\n }", "title": "" }, { "docid": "eb43c802205ae5ee58f066d61aca2b21", "score": "0.66347015", "text": "function endConnection() {\n if (qz.websocket.isActive()) {\n qz.websocket.disconnect().catch(function(e) { console.error(e); });\n }\n }", "title": "" }, { "docid": "010568b02b20ea89d67a5587cedba896", "score": "0.6631318", "text": "close() {\n if (this[kClosed]) {\n return;\n }\n\n this[kSocket].removeListener('message', this[kHandleMessage]);\n this[kSocket].removeListener('close', this[kHandleClose]);\n this[kSocket].removeListener('listening', this[kHandleListening]);\n\n this[kSocket] = null;\n this.emit('close');\n }", "title": "" }, { "docid": "2164d1945540f6b81ab06bc24aef5512", "score": "0.66202307", "text": "end() {\n this.status('closed');\n if (typeof this.driver.end !== 'function') {\n this.connection = null;\n return;\n }\n\n this.driver.end(this.connection);\n this.connection = null;\n }", "title": "" }, { "docid": "63f6c27cbda063f1e940cce1626c2840", "score": "0.6616813", "text": "onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emitReserved(\"disconnect\", reason);\n }", "title": "" }, { "docid": "63f6c27cbda063f1e940cce1626c2840", "score": "0.6616813", "text": "onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emitReserved(\"disconnect\", reason);\n }", "title": "" }, { "docid": "27f8011cd9b259127aa3f233baca71aa", "score": "0.65922785", "text": "disconnectPeer(_idRemote) {\n let peer = this.peers[_idRemote];\n if (!peer)\n return;\n peer.close();\n delete this.peers[_idRemote];\n console.log(\"Deleted peer\", _idRemote, \"remaining\", this.peers);\n }", "title": "" }, { "docid": "f7dfa07918545fdb343b4fc0eeee2b78", "score": "0.65813345", "text": "function closeConnection() {\n voxAPI.disconnect();\n}", "title": "" }, { "docid": "f470eaeea9ebfd259196f715faba39bc", "score": "0.6565439", "text": "function close() {\n if (!client) {\n return;\n }\n if (client.connected) {\n client.end(true);\n }\n}", "title": "" }, { "docid": "97893847bf1cfeead91ec2af3e833324", "score": "0.6564179", "text": "close() {\n if (Connection.defaultConnection === this) {\n Connection.defaultConnection = undefined;\n }\n this._adapter.close();\n this._adapter = undefined;\n }", "title": "" }, { "docid": "81108d5fab4a5c30afeb9b414f4b458b", "score": "0.6563783", "text": "close()\n\t{\n\t\tlogger.debug('close()');\n\n\t\tif (this._closed)\n\t\t\treturn;\n\n\t\tthis._closed = true;\n\n\t\tif (this._statsEnabled)\n\t\t{\n\t\t\tthis._statsEnabled = false;\n\n\t\t\tif (this.transport)\n\t\t\t\tthis.transport.disableConsumerStats(this);\n\t\t}\n\n\t\tthis.emit('@close');\n\t\tthis.safeEmit('close', 'local');\n\n\t\tthis._destroy();\n\t}", "title": "" }, { "docid": "7308d31800a4857de6bd66bb8befb339", "score": "0.65469545", "text": "terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n abortHandshake(this, this._req, msg);\n return;\n }\n\n if (this._socket) {\n this._readyState = WebSocket.CLOSING;\n this._socket.destroy();\n }\n }", "title": "" }, { "docid": "8a0f6abc56ee484cb297713cf5f45364", "score": "0.65466326", "text": "function disconnect() {\n if (!sock) {\n throw new Error('Not connected');\n }\n sock.socket.complete();\n sock.socket.unsubscribe();\n sock = null;\n }", "title": "" }, { "docid": "e2e4120b8570424e57448cef82af1d7d", "score": "0.6542973", "text": "function onclose() {\n\t onerror('socket closed');\n\t }", "title": "" }, { "docid": "9c93cb38f9ccbdcc7a587400eb562ad4", "score": "0.6537214", "text": "async disconnect() {\n if (this.connected) {\n try {\n await this.connection.end();\n } catch (error) {\n console.error(\"The connection with the database server could not be stopped gracefully!\\nEnding the connection abruptly...\");\n this.connection.destroy();\n }\n }\n }", "title": "" }, { "docid": "6bb98f5cfdd1db56d77f594775571e3a", "score": "0.6528689", "text": "dispose() {\n\t\tOmUtil.log('Disposing WebRtcPeer');\n\t\tif (this.pc) {\n\t\t\tif (this.pc.signalingState === 'closed') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pc.removeEventListener('icecandidate', this._iceCandidateListener);\n\t\t\tthis._iceCandidateListener = undefined;\n\t\t\tthis.pc.removeEventListener('signalingstatechange', this._signalingStateChangeListener);\n\t\t\tthis._signalingStateChangeListener = undefined;\n\t\t\tif (this._iceConnectionStateChangeListener) {\n\t\t\t\tthis.pc.removeEventListener('iceconnectionstatechange', this._iceConnectionStateChangeListener);\n\t\t\t\tthis._iceConnectionStateChangeListener = undefined;\n\t\t\t}\n\t\t\tif (this.configuration.onConnectionStateChange) {\n\t\t\t\tthis.pc.removeEventListener('connectionstatechange', this.configuration.onConnectionStateChange);\n\t\t\t}\n\t\t\tthis.configuration = {};\n\t\t\tthis.pc.close();\n\t\t\tthis.remoteCandidatesQueue = [];\n\t\t\tthis.localCandidatesQueue = [];\n\t\t}\n\t}", "title": "" }, { "docid": "ce5ca006ef4ba1ca753f9a88780f8d19", "score": "0.65225995", "text": "function close_connection() {\n switch(socket.readyState) {\n case SOCKET_OPEN: \n case SOCKET_CONNECTING:\n console.log(\"Closing connection...\");\n sendSystemMessagetoPebble(\"Closing connection...\");\n send_ws_message(\"Goodbye everybody!\");\n socket.close();\n return;\n }\n console.log(\"Connection has already been closed.\");\n sendErrorMessagetoPebble(\"ALREADY CLOSED\");\n}", "title": "" }, { "docid": "9fd2f8cf9cea03e829ec654b9a595242", "score": "0.6515231", "text": "function onclose () {\n\t onerror('socket closed');\n\t }", "title": "" }, { "docid": "9fd2f8cf9cea03e829ec654b9a595242", "score": "0.6515231", "text": "function onclose () {\n\t onerror('socket closed');\n\t }", "title": "" }, { "docid": "9fd2f8cf9cea03e829ec654b9a595242", "score": "0.6515231", "text": "function onclose () {\n\t onerror('socket closed');\n\t }", "title": "" }, { "docid": "ed82bfe13a091f86ed1f357dd811924a", "score": "0.6501376", "text": "disconnect() {\n this.webSocket.close();\n }", "title": "" }, { "docid": "f4a42c94435c5241ffbd481503d04a9f", "score": "0.64980274", "text": "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "title": "" }, { "docid": "f4a42c94435c5241ffbd481503d04a9f", "score": "0.64980274", "text": "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "title": "" }, { "docid": "f4a42c94435c5241ffbd481503d04a9f", "score": "0.64980274", "text": "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "title": "" }, { "docid": "2513569257fc9c06e2ceb7a525dc811f", "score": "0.64888227", "text": "function disconnect(){\n\tif (socket.end)\n\t\tsocket.end();\n\t\n}", "title": "" }, { "docid": "eddc68205c39148c39a47c1d8b7f34cf", "score": "0.6486525", "text": "function onclose() {\n onerror(\"socket closed\");\n }", "title": "" }, { "docid": "32cdb094df4971b03aa0b5bd88d2b066", "score": "0.64851356", "text": "destroy() {\n\n\t\tif (this._socket === null) {\n\t\t\t// ok\n\t\t}\n\t\telse {\n\n\t\t\tthis._socket.removeAllListeners();\n\t\t\tthis._socket.destroy();\n\t\t\tthis._socket = null;\n\t\t}\n\n\t\tif (this._end_emitted) {\n\t\t\t// ok\n\t\t}\n\t\telse {\n\t\t\tthis.emit(\"end\", this._close_code, this._close_reason);\n\t\t\tthis._end_emitted = true;\n\t\t}\n\t}", "title": "" }, { "docid": "c578cc3a8ef449ed51f732a8c7c41b78", "score": "0.64830166", "text": "function onclose() {\n onerror(\"socket closed\");\n }", "title": "" }, { "docid": "c02f2640213767cc6720935f6991eb5e", "score": "0.64767194", "text": "function ontargetclose() {\n debug.proxyResponse('proxy target %s \"close\" event', req.url);\n cleanup();\n socket.destroy();\n }", "title": "" }, { "docid": "ce69b52da7845fdc8453efcb5f1c72a3", "score": "0.6471679", "text": "onClose(reason, desc) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug('socket close with reason: \"%s\"', reason);\n const self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n\n // set ready state\n this.readyState = \"closed\";\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit(\"close\", reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n }", "title": "" }, { "docid": "c9e0186668f3173e97685fe9dbbaf06c", "score": "0.64604926", "text": "terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this._socket) {\n this.readyState = WebSocket.CLOSING;\n this._socket.destroy();\n }\n }", "title": "" }, { "docid": "4be997277829c7d869f8b979329b6bf2", "score": "0.6458511", "text": "function onclose() {\n onerror(\"socket closed\");\n }", "title": "" }, { "docid": "e6b4a8ec4faefb251f5afe63c9391038", "score": "0.64582884", "text": "terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this._socket) {\n this._readyState = WebSocket.CLOSING;\n\n this._socket.destroy();\n }\n }", "title": "" }, { "docid": "4b061e69e6a3dceac7a1c69a45575ef6", "score": "0.64548796", "text": "terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this._socket) {\n this._readyState = WebSocket.CLOSING;\n this._socket.destroy();\n }\n }", "title": "" }, { "docid": "4b061e69e6a3dceac7a1c69a45575ef6", "score": "0.64548796", "text": "terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this._socket) {\n this._readyState = WebSocket.CLOSING;\n this._socket.destroy();\n }\n }", "title": "" }, { "docid": "4b061e69e6a3dceac7a1c69a45575ef6", "score": "0.64548796", "text": "terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this._socket) {\n this._readyState = WebSocket.CLOSING;\n this._socket.destroy();\n }\n }", "title": "" } ]
1fe834337252abefe985b18bdf70ba8c
Input: "all men are mortal"
[ { "docid": "c2c53641945fda4d89c852f838372d83", "score": "0.0", "text": "function parseNaturalLanguage(str, firstOrder) {\n if (str[0] == '(') {\n if (str[str.length-1] == '?')\n return ['Ask', parseLispTree(str.slice(0, str.length-1))];\n return ['Tell', parseLispTree(str)];\n }\n\n str = str.toLowerCase();\n str = str.replace(/^\\s+/, '').replace(/\\s+$/, '');\n var ask = false;\n if (str[str.length-1] == '?') ask = true;\n str = str.replace(/[,\\.\\?]/g, '');\n str = str.replace(/ +/g, ' ');\n\n function canonicalizeNoun(s) {\n if (s.slice(s.length-3) == 'ies') return s.slice(0, s.length-3) + 'y';\n if (s[s.length-1] == 's') return s.slice(0, s.length-1);\n return s;\n }\n function canonicalizeVerb(s) {\n if (s[s.length-1] == 's') return s.slice(0, s.length-1);\n return s;\n }\n\n function agree(noun, verb) {\n if (noun == 'i' || noun == 'you' || noun == 'we') return noun + ' ' + verb;\n else return noun + ' ' + verb + 's';\n }\n\n function recurse(str) {\n var m;\n\n if (!firstOrder) {\n // Propositional logic\n if (m = str.match(/^did (\\w+) (\\w+)(.*)$/)) return recurse(agree(m[1], m[2]) + m[3]);\n if (m = str.match(/^does (\\w+) (\\w+)(.*)$/)) return recurse(agree(m[1], m[2]) + m[3]);\n if (m = str.match(/^is the (\\w+) (.+)$/)) return recurse('the ' + m[1] + ' is ' + m[2]);\n if (m = str.match(/^is (\\w+) (.+)$/)) return recurse(m[1] + ' is ' + m[2]);\n\n if (m = str.match(/^if (.+) then (.+)$/)) return ['implies', recurse(m[1]), recurse(m[2])];\n if (m = str.match(/^(.+) if and only if (.+)$/)) return ['bicond', recurse(m[1]), recurse(m[2])];\n if (m = str.match(/^(.+) only if (.+)$/)) return ['implies', recurse(m[1]), recurse(m[2])];\n if (m = str.match(/^(.+) if (.+)$/)) return ['implies', recurse(m[2]), recurse(m[1])];\n if (m = str.match(/^(.+) and (.+)$/)) return ['and', recurse(m[1]), recurse(m[2])];\n if (m = str.match(/^(.+) or (.+)$/)) return ['or', recurse(m[1]), recurse(m[2])];\n\n if (m = str.match(/^(.+) do not (\\w+)(.*)$/)) return ['not', recurse(agree(m[1], m[2]) + m[3])];\n if (m = str.match(/^(.+) don't (\\w+)(.*)$/)) return ['not', recurse(agree(m[1], m[2]) + m[3])];\n if (m = str.match(/^(.+) did not (\\w+)(.*)$/)) return ['not', recurse(agree(m[1], m[2]) + m[3])];\n if (m = str.match(/^(.+) didn't (\\w+)(.*)$/)) return ['not', recurse(agree(m[1], m[2]) + m[3])];\n if (m = str.match(/^(.+) does not (\\w+)(.*)$/)) return ['not', recurse(agree(m[1], m[2]) + m[3])];\n if (m = str.match(/^(.+) doesn't (\\w+)(.*)$/)) return ['not', recurse(agree(m[1], m[2]) + m[3])];\n\n if (m = str.match(/^(.+) not (.+)$/)) return ['not', recurse(m[1] + ' ' + m[2])];\n return str.replace(/ /g, '-');\n } else {\n // First-order logic (only support Horn)\n if (m = str.match(/^(\\w+) is an? (\\w+)$/)) return [m[2], m[1]]; // John is a student\n if (m = str.match(/^(\\w+) is (\\w+)$/)) return [m[2], m[1]]; // John is happy\n if (m = str.match(/^(\\w+) is (\\w+)'s (\\w+)$/)) return [m[3], m[2], m[1]]; // John is Tom's father\n if (m = str.match(/^(\\w+) (\\w+) (\\w+)$/)) return [canonicalizeVerb(m[2]), m[1], m[3]]; // John likes Mary\n if (m = str.match(/^all (\\w+) are (\\w+)/)) return [m[2], canonicalizeNoun(m[1])]; // all people are tall\n if (m = str.match(/^all (\\w+) (\\w+)/)) return [m[2], canonicalizeNoun(m[1])]; // all birds fly\n if (m = str.match(/^all (\\w+) (\\w+) (\\w+)/)) return [m[2], canonicalizeNoun(m[1])]; // all birds fly\n }\n\n return null;\n }\n\n var result = recurse(str);\n if (!result) {\n sfig.L(str);\n return ['Error', 'Sorry, I don\\'t understand.'];\n }\n return [ask ? 'Ask' : 'Tell', result];\n}", "title": "" } ]
[ { "docid": "c90247ca360830da8882b7adfb4f1eb3", "score": "0.6181123", "text": "function main() {\n var m_temp = readLine().split(' ');\n var m = parseInt(m_temp[0]);\n var n = parseInt(m_temp[1]);\n magazine = readLine().split(' ');\n ransom = readLine().split(' ');\n magazineStr = magazine.toString();\n \n if( magazine.length === m && ransom.length === n ){\n for(var i=0;i<n;i++){\n if( magazineStr.indexOf(ransom[i]) === -1 ){\n console.log('No');\n return;\n }else{\n magazineStr = magazineStr.replace(ransom[i],'');\n }\n }\n console.log('Yes');\n }else{\n console.log('No');\n }\n\n}", "title": "" }, { "docid": "9094b8fb127f1cf779959cf4925a4524", "score": "0.591505", "text": "function mortal(i){\n if(i>=1 && i<=5){\n\t return men[i-1]+' is mortal';\t\n }\n}", "title": "" }, { "docid": "bf80754041ea78edcbf513a2e8af1c5d", "score": "0.59068155", "text": "static amenities( service ) {\n const {amenities} = service;\n if ( !isEmpty( amenities ) ) {\n let amenities_and = [ ...amenities.map( display ) ];\n\n let seperator;\n if ( amenities.length > 2 ) { // 1, 2, and 3\n amenities_and.push( 'and ' + amenities_and.pop() );\n seperator = ', ';\n } else if ( amenities.length > 1 ) { // 1 and 2\n amenities_and.push( 'and ' + amenities_and.pop() );\n seperator = ' ';\n } else {\n seperator = '';\n }\n\n return 'Amenities include: ' + amenities_and.join( seperator );\n } else {\n return 'Amenities: none listed';\n }\n }", "title": "" }, { "docid": "a260f6a6e3c11070c1c7fc574afaba50", "score": "0.5820295", "text": "function main() {\n var m_temp = readLine().split(' ');\n var m = parseInt(m_temp[0]);\n var n = parseInt(m_temp[1]);\n magazine = readLine().split(' ');\n ransom = readLine().split(' ');\n \n // return 'no' if more note than mag words exist\n if (n > m) return process.stdout.write('No');\n \n var words = {};\n \n // add mag words to dictionary\n for (var i = 0, l = m; i < l; i++) {\n var w = magazine[i];\n if (words[w]) words[w] += 1;\n else words[w] = 1;\n }\n \n // loop through ransom words\n for (var i = 0, l = n; i < l; i++) {\n var w = ransom[i];\n if (words[w]) {\n words[w] === 1 \n ? delete words[w]\n : words[w] -= 1;\n } else {\n return process.stdout.write('No');\n }\n }\n \n return process.stdout.write('Yes');\n}", "title": "" }, { "docid": "9f2f1ce5e27d701058d710f7b4096ca7", "score": "0.57292676", "text": "function teachManners(phrase) {\n return phrase.toLowerCase().replace(exclamations, '');\n\n}", "title": "" }, { "docid": "576573afb5f1c3bda3170c4a0a3f15e1", "score": "0.5626157", "text": "function primerMay(str) {\n\tvar respuesta = '',\n\t\ttrozos = str.split('_');\n\t\n\tfor(var i in trozos) {\n\t\tvar palabra = trozos[i].toLowerCase();\n\t\tpalabra = palabra.substr(0, 1).toUpperCase() + palabra.substr(1);\n\t\ttrozos[i] = palabra;\n\t}\n\treturn trozos.join(' ');\n}", "title": "" }, { "docid": "81c1e8180d23e50968655bba57ccc6ad", "score": "0.56115544", "text": "function status(){\n \n bonMot = result.split('').map(lettre => (deviner.indexOf(lettre) >=0 ? lettre :\" _ \")).join('');\n document.getElementById('goodWord').innerHTML = bonMot;\n \n}", "title": "" }, { "docid": "590ba085d6f13661b286590b29be7465", "score": "0.5551597", "text": "function main() {\n //let s = readLine().toLowerCase();\n\n //let s = 'We promptly judged antique ivory buckles for the next prize'.toLowerCase();\n let s = 'We promptly judged antique ivory buckles for the prize'.toLowerCase();\n\n let mapper = 'qwertyuiopasdfghjklzxcvbnm', flag = true;\n for(let i = 0; i < mapper.length; i++) {\n if(s.indexOf(mapper.charAt(i)) == -1) {\n flag = false;\n break;\n }\n }\n\n console.log(flag ? 'pangram' : 'not pangram');\n}", "title": "" }, { "docid": "5506a2b3c6db2585454db4201137b8d1", "score": "0.5549933", "text": "function marcoPolo(heardWord){\n if(heardWord.toLowerCase() == \"marco\")\n {\n console.log(\"Polo!\");\n }\n else\n {\n console.log(\"Try again!\");\n }\n}", "title": "" }, { "docid": "5506a2b3c6db2585454db4201137b8d1", "score": "0.5549933", "text": "function marcoPolo(heardWord){\n if(heardWord.toLowerCase() == \"marco\")\n {\n console.log(\"Polo!\");\n }\n else\n {\n console.log(\"Try again!\");\n }\n}", "title": "" }, { "docid": "69b02cc3510aa88f9edcc8b48e8b5144", "score": "0.548327", "text": "function ransomNote(magazine, message) {\n const msg = message.split(\" \");\n const mgz = magazine.split(\" \");\n const regex = /^[A-Z]/; // if a letter is uppercase\n if (\n message.length <= magazine.length &&\n regex.test(message) === regex.test(magazine) // test if both true\n ) {\n msg.forEach((el, i) => {\n if (mgz.includes(el)) mgz.splice(i, 1);\n else return false;\n });\n return true;\n } else return false;\n}", "title": "" }, { "docid": "0aaee7f99890721017be00122cb9c9ca", "score": "0.54689324", "text": "function priMay(tx){\n if(tx == undefined){\n return;\n }\n var txtspl = tx.toLowerCase().split(' ');\n var texto = '';\n for (var i=0;i < txtspl.length;i++){\n var splw = txtspl[i].split('');\n splw[0] = splw[0].toUpperCase();\n for (var j = 0;j < splw.length;j++){\n texto += splw[j];\n }\n if(i < txtspl.length-1){\n texto += ' ';\n }\n }\n return texto;\n}", "title": "" }, { "docid": "edf5d224224c1adc55b3d689dfd6b249", "score": "0.5411741", "text": "function mach_mini_iimeil_laesbar(text) {\n var s = text.split('');\n for (var i = 0; i < s.length; i++) { s[i] = luukoeptaibel[text[i]]; }\n return s.join('');\n}", "title": "" }, { "docid": "757cdb3b36557d0006e8aa1339886394", "score": "0.5401511", "text": "function getWords(input){\n const regex = new RegExp('[A-za-z]+', 'g');\n let words = [...('' + input).matchAll(regex)].map(word => word[0].toUpperCase()).join(', ');\n \n let noWordsMsg = 'No words found';\n const isEmpty = words.length === 0;\n console.log(isEmpty ? noWordsMsg : words);\n\n // if(words.length !== 0) {\n // console.log(words);\n // } else {\n // console.log(\"No words found!\")\n // }\n\n}", "title": "" }, { "docid": "4381bdfce73c7c83a1d9a7435a3ef61b", "score": "0.5395495", "text": "function main() {\n const m_temp = readLine().split(' ');\n const m = parseInt(m_temp[0]);\n const n = parseInt(m_temp[1]);\n const magazine = readLine().split(' ');\n const ransom = readLine().split(' ');\n let result = 'Yes';\n\n const hash = {};\n\n magazine.forEach(w => {\n hash[w] = (hash[w] || 0) + 1;\n });\n\n ransom.forEach(w => {\n hash[w] = (hash[w] || 0) - 1;\n });\n\n for (let word in hash) {\n if (hash[word] < 0) {\n result = 'No';\n }\n }\n\n process.stdout.write('' + result + '\\n');\n}", "title": "" }, { "docid": "958dbe2f626970dc50cf636a79898f1d", "score": "0.5372526", "text": "function allWords(area) { return toWords(text(area)); }", "title": "" }, { "docid": "0b5769492c63b7e0be97ef905fdc62bf", "score": "0.5370131", "text": "function BOT_englishStringLemmatization (s) {\r\n\tvar res = s.toLowerCase();\r\n\tres = BOT_deleteStringAccents(res); \r\n\tres = res.replace(/[\\<\\>]/g, \" \"); // deleted chars < and > \r\n\tres = \"< \"+res+\" >\"; // add left and right borders of lemmatized form\r\n\tres = res.replace(/< +/,\"< \"); // deletes multiple withespaces in front\r\n\t//alert(\"|\"+res+\"|\");\r\n\t//res = res.replace(/[\\-]/g, \"_\"); // char - is repaced by char _ for composed keys\r\n\tres = res.replace(/[\\\"]/g, \"¤\"); // char \" is repaced by char ¤ = 164\r\n\tres = res.replace(/[\\!\\?\\,\\.\\;\\:\\#\\\\§\\=\\%\\*\\+\\'\\(\\)\\{\\}\\[\\]\\@\\&\\$]/g, \" \"); // deleted chars\r\n\tres = res.replace(/ +/g, \" \"); // shrink withespaces\r\n\tres = res.replace(/ +>/,\" >\"); // deletes multiple withespaces at the end\r\n\t//alert(\"|\"+res+\"|\");\r\n\treturn res;\r\n}", "title": "" }, { "docid": "54e73c5824dce935c74c26d428d755c3", "score": "0.5366306", "text": "function main() {\n var m_temp = readLine().split(' ');\n var m = parseInt(m_temp[0]);\n var n = parseInt(m_temp[1]);\n magazine = readLine().split(' ');\n ransom = readLine().split(' ');\n\n let result = 'Yes';\n //create a map with keys and number of occurences\n let map = new Map;\n for (let i=0; i<magazine.length; i++) {\n //if word already exists, increase the number of occurrences by 1\n if (map.has(magazine[i])) {\n let value = map.get(magazine[i]);\n value++;\n map.set(magazine[i], value);\n } else {\n //add a key and set number of occurences to 1\n map.set(magazine[i], 1);\n }\n }\n //check if ransom note is in the map and delete it\n for (let i=0; i<ransom.length; i++) {\n if (map.has(ransom[i])) {\n let value = map.get(ransom[i]);\n //if over 1, just lower value and otherwise delete it compeltely\n if (value > 1) {\n value--;\n map.set(ransom[i], value);\n } else {\n map.delete(ransom[i]);\n }\n } else {\n result = \"No\";\n break;\n }\n }\n console.log(result);\n}", "title": "" }, { "docid": "2530afde5c390194c4769aec8dfdb0a9", "score": "0.53501993", "text": "function harmlessRansomNote (noteText, magazineText) {\n\n//PART 1 \n//we will be using the split function using one empty space as the separator making our string into substrings. we will do this for both parameters. \n var noteArr = noteArr = noteText.split(' ');\n var magazineArr = magazineText.split(' ');\n//Using a Hash Table Technique, we want to make each word and object. \n var magazineObj ={};\n \n//With each word as an object, we will increement each word giving it a number for each time that it is in the string. \n magazineArr.forEach(word => {\n// If a word is not present onthe magazine object, then we want to make it make it a property on the object and make it equal to 0. \n if (!magazineObj[word]) magazineObj[word] = 0;\n// And we want to increment everytime we see the word. \n magazineObj[word]++;\n });\n \n// If we type nothing of PART 2, we can test to make sure the function was counting each word from the magazine text. by outputting the magazineObj after running the harmlessRansomNote with a string in the magazineText input. We can leave the noteText empty. \n // console.log(magazineObj);\n\n \n// PART 2\n \n// We will check each word to see if it is present in the magazineObj. If is is not that we will use a Boolean to confirm false. it will be true by default. \n var noteIsPossible = true;\n noteArr.forEach(word => {\n if (magazineObj[word]){\n// If the word exists then we increment the word negativley by 1\n magazineObj[word]--;\n//If the word is present then we need to make sure that we have enough of the word to suffice for the noteText\n if(magazineObj[word] < 0) noteIsPossible = false;\n }\n// If the word doesn't exist at all, then this piece of code will run the Boolean as false. \n else noteIsPossible = false;\n });\n \n// Lastly we run the noteIsPossible regardless however the code plays out. \n return noteIsPossible;\n \n}", "title": "" }, { "docid": "5d18cb2378f666bfea0e3d92696d53f3", "score": "0.5323592", "text": "function bestMangaEver('there are a few in my list') {\r\n console.log(\"Backuman, Naruto Shippuden, Baruto\")\r\n alert(\"these are the best Manga ever\")\r\n}", "title": "" }, { "docid": "a45001fce20d67a2c4e0575e206dc80b", "score": "0.5320791", "text": "function howMuchILoveYou(petals) {\n const phrases = ['I love you', 'a little', 'a lot', 'passionately', 'madly', 'not at all', 'zero %']\n return phrases[(petals - 1) % phrases.length]\n}", "title": "" }, { "docid": "4c44faffc1485433bb19a0ed9e02d14e", "score": "0.5303495", "text": "randomText(positive) {\n const posPhrases = [\n 'Goed gedaan!',\n 'Netjes!',\n 'Je doet het súper!',\n 'Helemaal goed!',\n 'Je bent een topper!'\n ]\n const negPhrases = [\n 'Ik weet dat je het kunt!',\n 'Jammer, probeer het nog eens!',\n 'Bijna goed!',\n 'Helaas pindakaas'\n ]\n\n const phrases = positive ? posPhrases : negPhrases\n const maximumNumber = phrases.length\n const randomNumber = Math.floor(Math.random() * maximumNumber)\n \n return phrases[randomNumber]\n }", "title": "" }, { "docid": "b3cda3463e4af352ae19189370a00b0e", "score": "0.5295428", "text": "function spell(){ \n if(count == 1 ) return ' вопрос';\n if(count == 2 || count == 3 || count == 4 ) { \n return ' вопроса';\n } else {\n return ' вопросов'\n }\n }", "title": "" }, { "docid": "e9d616012fffb07e5468642281312d2b", "score": "0.5286039", "text": "function drawManga('anime stories') {\r\n alert(Bakuman + 'is my favorite anime and Manga of all time');\r\n}", "title": "" }, { "docid": "8c4c13b8663b11ab42db2d671551f16f", "score": "0.52693003", "text": "getQuery(input) {\n let inputArray = input.split(' ');\n\n if (inputArray[0] === 'how') return 'count';\n else if (inputArray[0] === 'what') return 'details';\n }", "title": "" }, { "docid": "5875c5afec619e56ecd56cfcf7ab70e8", "score": "0.52551436", "text": "function treatDispenser(animals) {\n\n var results = [ ];\n var sentence = '';\n\n for (var i = 0; i < animals.length; i++){\n var animal = animals[i];\n if ( animal.charAt(0) == \"M\"){\n sentence = \"no treat for \" + animal;\n results.push(sentence);\n } else {\n sentence = animal + \" loved their treat!\";\n results.push(sentence);\n }\n\n }\n\n return results;\n}", "title": "" }, { "docid": "678d5e701283da3cc65976eaf280afdb", "score": "0.52427584", "text": "modify(str, mod){\n\t\tvar vowels = ['a', 'e', 'i', 'o', 'u', 'y']\n\t\tswitch(mod){\n\t\t\tcase \"cap\":\n\t\t\t//This modification simply capitalizes the string.\n\t\t\treturn str.charAt(0).toUpperCase() + str.substring(1);\n\t\t\tbreak;\n\t\t\tcase \"capAll\":\n\t\t\treturn str.toUpperCase();\n\t\t\tcase \"a\":\n\t\t\t//this modification adds the correct a/an to the string, assumes noun input.\n\t\t\tif (vowels.includes(str.charAt(0).toLowerCase()) && !(str.charAt(0).toLowerCase() ==\"u\" && str.charAt(1).toLowerCase() == \"n\") || (vowels.includes(str.charAt(1).toLowerCase()) && str.charAt(1) != \"u\" && str.charAt(0) == 'h')){\n\t\t\t\treturn \"an \" + str;\n\t\t\t}else{\n\t\t\t\treturn \"a \" + str;\n\t\t\t}\n\t\t\tbreak;\n\t\t\tcase \"ed\":\n\t\t\t//WIP: Convert verb to past tense.\n\t\t\t//NOTE: This assumes input of simple present singular form, and only does simple past tense.\n\t\t\t//This is also only the affirmative.\n\t\t\treturn str + \"ed\";\n\t\t\tbreak;\n\t\t\tcase \"s\":\n\t\t\tvar es_single_cases = ['s', 'x', 'z'];\n\t\t\tvar es_double_cases = ['ch', 'sh', 'ss'];\n\t\t\tvar irregulars = ['woman','man','child','tooth','foot','person','leaf','mouse','goose','half','knife','wife','life','elf','loaf','potato','tomato','cactus','focus','fungus','nucleus','syllabus','analysis','diagnosis','oasis','thesis','crisis','phenomenon','criterion','datum'];\n\t\t\tvar irregulars_pl = ['women','men','children','teeth','feet','people','leaves','mice','geese','halves','knives','wives','lives','elves','loaves','potatoes','tomatoes','cacti','foci','fungi','nuclei','syllabi','analyses','diagnoses','oases','theses','crises','phenomena','criteria','data'];\n\t\t\tvar nonconverts = ['sheep','fish','deer','species','aircraft'];\n\t\t\tif(irregulars.includes(str)){\n\t\t\t\treturn irregulars_pl[irregulars.indexOf(str)];\n\t\t\t}else if(nonconverts.includes(str)){\n\t\t\t\treturn str;\n\t\t\t}else if(str.charAt(-1) == \"y\" && !vowels.includes(str.charAt(-1))){\n\t\t\t\treturn str.substring(0, str.length - 1) + \"ies\";\n\t\t\t}else if(es_single_cases.includes(str.charAt(-1)) || es_double_cases.includes(str.substring(str.length - 2))){\n\t\t\t\treturn str + \"es\";\n\t\t\t}else{\n\t\t\t\treturn str + \"s\";\n\t\t\t}\n\t\t\tbreak;\n\t\t\tcase \"ff\":\n\t\t\t//Fifty-fifty chance of the modified string being included at all\n\t\t\tif(Math.random() > 0.5){\n\t\t\t\treturn str;\n\t\t\t}else{\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\tbreak;\n\t\t\tcase \"uncap\":\n\t\t\t//Just the opposite of the capitalization mod, make the first letter letter.\n\t\t\treturn str.charAt(0).toLowerCase() + str.substring(1);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tthrow \"ERROR: INVALID MODIFIER \" + mod;\n\t\t}\n\t}", "title": "" }, { "docid": "22b8d8808edb7e6ac034b1f420da36cc", "score": "0.52253336", "text": "function spEng(sentence){\n sentence= sentence.toLowerCase()\n for(let i in sentence){\n if(sentence.includes('english')) return true;\n }\n return false;\n}", "title": "" }, { "docid": "e8a88eda144ceae7118951e37f2ac6e4", "score": "0.52153933", "text": "get lemmasList () {\n if (this.homonym && this.homonym.lexemes) {\n return this.homonym.lexemes.map(lexeme => lexeme.lemma.word).filter((value, index, self) => {\n return self.indexOf(value) === index\n }).join(', ')\n }\n return ''\n }", "title": "" }, { "docid": "41f67e81ea3cea449be8f0e8acb67289", "score": "0.51876384", "text": "function ing(string) {\n var arr = string.split(/[^A-Za-z0-9'_\"-]/);\n console.log(arr);\n var newArr = [];\n for (let word of arr) {\n if (/ing$/i.test(word) === false) {\n newArr.push(word);\n }\n }\n return newArr.join(\" \");\n }", "title": "" }, { "docid": "dd9d70754f02746fee326b4619cdbb6f", "score": "0.5180648", "text": "isNotNewDefense(str) {\n let match = /planifiée pour [A-Z]{1}[a-z]{1,}\\s[A-Z]{1}[a-z]{1,}/.exec(str)\n return match\n }", "title": "" }, { "docid": "44740f9adfa0fd5066308379438875d3", "score": "0.51384133", "text": "function mood(str)\r\n{\r\n if (!str)\r\n return `Today , I am Feeling neutral`\r\n else\r\n return `Today , I am Feeling ${str}`\r\n}", "title": "" }, { "docid": "79ee7714633b2b0587778d7ff33e957d", "score": "0.5125694", "text": "function theMan(){\n\tstory(\"You are wandering along a sidewalk at midnight in near pitch black with only streetlights illuminating the path that you have chosen. You have plenty of time that you would want to waste but out of the corner of your eye you see a shadow of a man leaning against a building asking you to go talk with him. What do you want to do?\");\n\tchoices = [\"Walk Away\", \"Walk to him\", \"Call the police\"];\n\tanswer = setOptions(choices);\n}", "title": "" }, { "docid": "94e8d08aad9ac7b58d2a09d36b67b20b", "score": "0.5119024", "text": "function liri() {\n\n switch(input[0]) {\n case \"movie-this\":\n searchOMDb();\n break;\n case \"concert-this\":\n searchBandsInTown();\n break;\n case \"spotify-this-song\":\n searchSpotify();\n break;\n case \"do-what-it-says\":\n doWhat();\n break;\n default:\n console.log(\"Please enter a command....\")\n }\n}", "title": "" }, { "docid": "55d79d8c0cd461a3b8d966f27d20f1e0", "score": "0.5106408", "text": "somenteletras(input) {\n\n let re = /^[A-Za-z]+$/;\n\n let inputValue = input.value;\n\n let mensagem_error = `Este campo não aceita números nem caracteres especiais`;\n\n if (!re.test(inputValue)) {\n this.imprimirMensagem(input, mensagem_error);\n }\n\n }", "title": "" }, { "docid": "2e77a5ce14bf7423f1a96751302265d8", "score": "0.50879693", "text": "function BOT_extractWords() {\r\n\tvar word, matchlist;\r\n\tvar lemstring = BOT_lemString;\r\n\tvar worldlist = [];\r\n\tvar rex = new RegExp(\"< (\\\\w+) (.*)\");\r\n\tfor(var i=0; i<BOT_maxExtractedWords; i++) { // Words extracted is limited\r\n\t\tif(lemstring.search(rex) != -1) {\r\n\t\t\trex.lastIndex = 0;\r\n\t\t\tmatchlist = rex.exec(lemstring);\r\n\t\t\tword = BOT_englishWordCutPlural(matchlist[1]);\r\n\t\t\tworldlist = worldlist.concat(word);\r\n\t\t\tlemstring = \"< \"+matchlist[2];\r\n\t\t}\r\n\t}\r\n\treturn worldlist;\r\n}", "title": "" }, { "docid": "107d646d9610ceadb774ab252219b425", "score": "0.5083561", "text": "function fixMProblem(string) {\n var reversedString = string.split(\"\").reverse().join(\"\");\n reversedString = reversedString.replace(/\\sm(?!ieh)(?!urt)/ig, 'm');\n // reverse back\n return reversedString.split(\"\").reverse().join(\"\");\n }", "title": "" }, { "docid": "c64f237b8c1f733bdc6911db6a3fbf19", "score": "0.50762314", "text": "function sayHiToGrandma(string) {\n if (string.toLowerCase()===string) {\n return \"I can\\'t hear you!\"\n } else if (string.toUpperCase()===string) {\n return \"YES INDEED!\"\n } else if (string===\"I love you, Grandma.\") {\n return \"I love you, too.\"\n }\n\n}", "title": "" }, { "docid": "b7f63f9de670c877597ed4df622ac222", "score": "0.50656855", "text": "function bloddonor(Navn) {\n var Navn = prompt(\"Hvad er dit navn?\");\n if (Navn.indexOf(\" \") > -1) {\n return \"Hej\";\n\n } else {\n alert(\"Er du sikker på at det er dit navn?\");\n var Navn = prompt(\"Hvad er dit navn?\");\n }\n}", "title": "" }, { "docid": "0463be7daceec1021035e7208c6b6150", "score": "0.5063503", "text": "function quita_primer_nom(palabra) {\n return palabra.replace(\"MARIA\", \"\").replace(\"MA.\", \"\").replace(\"MA\", \"\").replace(\"JOSE\", \"\").replace(\"J\", \"\").replace(\"J.\", \"\").trim();\n}", "title": "" }, { "docid": "725a5e0cd7df1ef0bc428afe2bc06628", "score": "0.50597495", "text": "static titleize(string) {\n let splitted = string.split(\" \")\n let sliced = splitted.slice(1)\n let result = [];\n if (splitted[0] !== splitted[0].charAt(0).toUpperCase()) {\n result.push(splitted[0].charAt(0).toUpperCase() + splitted[0].slice(1))\n } else {\n result.push(splitted[0] + splitted[0].slice(1))\n }\n for (var i = 0; i < sliced.length; i++) {\n if (sliced[i] == \"the\" || sliced[i] == \"a\" || sliced[i] == \"an\" || sliced[i] == \"but\" || sliced[i] == \"of\" || sliced[i] == \"and\" || sliced[i] == \"for\" || sliced[i] == \"at\" || sliced[i] == \"by\" || sliced[i] == \"from\"){\n result.push(sliced[i])\n } else {\n result.push(sliced[i].charAt(0).toUpperCase() + sliced[i].slice(1))\n }\n }\n return result.join(\" \");\n }", "title": "" }, { "docid": "bce6710297134a60e2d6d3b21377a38d", "score": "0.5057448", "text": "function monsterFight() {\n let hitTheMonster = prompt(\"Du närmar dig monstret. Du hör det skrika. Plötsligt står du rakt framför det. Ange slå för att slå monstret\").toLowerCase();\n \n if (hitTheMonster === \"slå\") {\n alert(\"Du slog monstret!\")\n monsterFightPartTwo()\n }\n else {\n alert(\"Vänligen ange slå\")\n monsterFight()\n }\n }", "title": "" }, { "docid": "a4c9e9dd4769693998877e32d8fd229f", "score": "0.5056886", "text": "function makeLean(str){\n\treturn (str.replace(/\\s/g, '')).toLowerCase().trim();\n}", "title": "" }, { "docid": "6c3bc48fec153be79ba5b0b24edb0fad", "score": "0.5055637", "text": "function languageFilter(str, teacher){\n var symbols = '!@#$%^&*©æ®√∞Ω∫∆¥ƒ∂ß';\n var arr = str.split(' ');\n for (var i = 0; i < arr.length; i++) {\n var word = arr[i].toLowerCase().replace(/\\W/g, '');\n if(profanities.indexOf(word) != -1 || teacherWords.indexOf(word) != -1){\n var replace = '';\n if(teacher){\n replace = word.strike();\n }\n else{\n for (var j = 0; j <= word.length+2; j++) {\n var index = Math.floor(Math.random() * symbols.length);\n replace += symbols[index];\n j++;\n }\n }\n arr.splice(i, 1, replace);\n }\n }\n return arr.join(' ');\n }", "title": "" }, { "docid": "2ad1e7382d342d9f26858ff454024903", "score": "0.50554", "text": "function semanticRules(words){\n\n var string = \"\";\n var keyword, rule;\n for(var x = 0; x < words.length; x++){\n\n keyword = words[x];\n rule = languageForest[keyword];\n\n if (rule != undefined) string += rule;\n }\n\n return string;\n}", "title": "" }, { "docid": "4764fcf373aa7a55212e7fd05e49c104", "score": "0.50494254", "text": "function harmlessRansomNote(noteText, magazineText){\n const noteArr = noteText.split(' ')\n const magazineArr = magazineText.split(' ')\n const magazineObj = {}\n let noteIsPossible = true\n\n // Add and count word in object from magazine array\n magazineArr.map(word => !magazineObj[word] ? magazineObj[word] = 1 : magazineObj[word]++)\n\n // Verify if all word in note array is in magazine object\n while (noteIsPossible){\n noteArr.map(word => magazineObj[word] ? magazineObj[word]-- : magazineObj[word] < 0 ? noteIsPossible = false : noteIsPossible = false)\n return noteIsPossible\n }\n}", "title": "" }, { "docid": "7cbcd1c73620b54e79cff56ffb230482", "score": "0.5045934", "text": "function checkUserInput() {\n var userInput = document\n .querySelector(\".type-area\")\n .value.replace(minusString, \"\");\n if (userInput[userInput.length - 1] === \" \") {\n handleSpace();\n return;\n }\n let startword = modifiedpara.substr(0, modifiedpara.indexOf(\" \") + 1);\n\n if (document.querySelector(\".type-area\").value == \"\") {\n document.querySelector(\".para-type\").innerText = infinityPara;\n } else if (startword.includes(userInput)) {\n text = modifiedpara;\n text = text.replace(\n userInput,\n '<span class=\"highlight\">' + userInput + \"</span>\"\n );\n document.querySelector(\".para-type\").innerHTML = text;\n } else {\n return;\n }\n}", "title": "" }, { "docid": "c56753dd410440e3533ffc93c1f824ae", "score": "0.50361776", "text": "function determinaTexto (texto){\n if (texto == texto.toUpperCase()){\n console.log(\"El texto está en mayúsculas\");\n }\n else{\n console.log(\"El texto está en minúsculas\");\n }\n}", "title": "" }, { "docid": "f35a143427b4b62dd6b5195e3b76f2e8", "score": "0.50323206", "text": "function main(){\r\n\r\n const letra;\r\n console.log('Digite aqui uma letra do nosso alfabeto alfanumérico português: ', letra)\r\n\r\n if (letra === 'a' || letra === 'e' || letra === 'i' || letra === 'o' || letra === 'u' || letra === 'A' || letra === 'E' || letra === 'I' || letra === 'O' || letra === 'U') {\r\n console.log('É vogal / n')\r\n }else {\r\n console.log('É consoante / n')\r\n }\r\n\r\n}", "title": "" }, { "docid": "e4a6d53ecec6a50668d7b08c17dea9d3", "score": "0.5024995", "text": "function analyseListing(content){\n console.log(content.toLowerCase());\n if (content.includes('accountant')){\n console.log('\\n=======================Contains Accountant============\\n');\n }\n}", "title": "" }, { "docid": "c382e6efb863cbca719d89a73a77a8d0", "score": "0.50154483", "text": "function targil27(str) {\n if(str.indexOf(\" \") == -1){\n console.log(\"cas 1\");\n return str[0].toUpperCase() + str.slice(1).toLowerCase();\n }\n else if ((str.indexOf(\" \") == str.lastIndexOf(\" \")) && (str.indexOf(\" \") != -1 )){\n console.log(\"case 2\");\n return [str.slice(0,str.indexOf(\" \")), str.slice(str.indexOf(\" \")+1)]\n }\n else{\n let name = str.slice(0,str.indexOf(\" \"));\n let nikName = str.slice( str.indexOf(\" \")+1 , str.lastIndexOf(\" \"));\n let lastName = str.slice( str.lastIndexOf(\" \")+1)\n return `the name is: ${name}, last Name: ${lastName}, nik Name: ${nikName}`\n } \n }", "title": "" }, { "docid": "a93e1980f758fbb262654439f2b1d34c", "score": "0.50137377", "text": "function BOT_inputStringProcessing(s) {\r\n\tvar lemstring = (s == \"\") ? \"ping\" : s; // empty output + CR means ping\r\n\tlemstring = BOT_rawStringExtraction(lemstring);\r\n\tBOT_traceString += \"RAW EXTRACT \\\"\" + lemstring + \"\\\"\\n\";\r\n\tlemstring = BOT_englishStringLemmatization(lemstring);\r\n\tBOT_traceString += \"ENGLISH \\\"\" + lemstring + \"\\\"\\n\";\r\n\tBOT_lemString = BOT_mapLemSynonyms(lemstring);\r\n\tBOT_traceString += \"SYNONYMS \\\"\" + lemstring + \"\\\"\\n\";\r\n\tBOT_lemWordList = BOT_extractWords();\r\n}", "title": "" }, { "docid": "2827fc6a24048c0b7e0c1d536b469fd2", "score": "0.5010564", "text": "function verifierMot()\n{\n var lemot = \"\";\n for(let i=0; i<choisi.length; i++)\n {\n lemot += choisi[i].textContent;\n }\n if(lemot == mots[niveau])\n {\n nextlevel();\n }\n else{\n initialiseNiveau(niveau);\n }\n}", "title": "" }, { "docid": "56f59e8114264bb22b2fd011234fab7c", "score": "0.50052035", "text": "function ispisMenija(meni, deoStrane){\n let html = \"\";\n for(let m of meni){\n html += `\n <li class=\"list-group-item border-0\">\n <a href=\"${m.hrefLink}\" data-link=\"${m.id}\" class=\"text-decoration-none\">${m.textLink}</a>\n </li> `;\n }\n $(deoStrane).html(html);\n}", "title": "" }, { "docid": "8e67fee9fd89e5a23f404d8862fa6888", "score": "0.5005048", "text": "function cantidadCaracteres(frase) {\r\n \r\n let i=0;\r\n let nuevaPalabra=\"\";\r\n let nuevaFrase=\"\";\r\n let longitud=frase.length;\r\n let longitudNP=0;\r\n\r\n\r\n for ( i == 0; i < longitud; i++) {\r\n \r\n while (frase[i] ==\" \") {\r\n i++;\r\n } \r\n if (frase[i]==\"a\" || frase[i]==\"A\") {\r\n\r\n while ((frase[i]!=' ') && (i < longitud) ) {\r\n nuevaPalabra = nuevaPalabra+frase[i];\r\n i++;\r\n longitudNP++;\r\n } \r\n if (nuevaPalabra[longitudNP-1]==\"r\" ||nuevaPalabra[longitudNP-1]==\"R\") {\r\n nuevaFrase= nuevaFrase+nuevaPalabra+\" \";\r\n }\r\n nuevaPalabra=\"\";\r\n longitudNP=0;\r\n }else{\r\n if ((frase[i] !=\" \") && (i<longitud)) {\r\n i++;\r\n }\r\n }\r\n } \r\n return nuevaFrase;\r\n \r\n}", "title": "" }, { "docid": "14c4a64e0957784e7e0e57cd012d67bd", "score": "0.49967593", "text": "function mostrarMayor(input){\n\n\t\tvar resultado;\n\t\t\n\t\tinput.sort(Ascendentes);\n\t\tresultado = input[input.length-1];\n\t\t\n\n\t\treturn resultado;\n\t}", "title": "" }, { "docid": "35372a3e8b8e2aad04e429c61b366baf", "score": "0.4995341", "text": "function ital6s() {\n var str = document.querySelector('#box6s p').textContent;\n var arr = str.split(\" \");\n var newArr = arr.map(v => { \n if (v == \"keep\") {\n return `<em>${v}</em>` \n } else \n return v;\n });\n str = newArr.join(\" \");\n document.querySelector('#box6s p').innerHTML = str;\n}", "title": "" }, { "docid": "a8c40652bfafe0a97390e98cdd28bfef", "score": "0.4990044", "text": "menuPrincetonProgram(princetonProgram) {\n return princetonProgramAns.map((name) => (\n <MenuItem\n key={name}\n insetChildren={true}\n checked={princetonProgram && princetonProgram.indexOf(name) > -1}\n value={name}\n primaryText={name}\n />\n ));\n }", "title": "" }, { "docid": "b9e3126d424ae40ba29f1e61a0dc3337", "score": "0.49844605", "text": "function filtername() {\n\n var input, filter, displayMenuItems, gluteninput, vegetarianinput, veganinput;\n\n input = document.getElementById(\"mysearchbox\");\n filter = input.value.toUpperCase();\n displayMenuItems = document.getElementsByClassName(\"menuitem\");\n\n //if there is no input on search bar, keep all menu items hidden.\n if (filter.length === 0) {\n const elementsToHide = document.getElementsByClassName(\"collapse show\");\n for (var i = 0; i < elementsToHide.length; i++) {\n elementsToHide[i].classList.remove(\"show\");\n }\n //else, when there is input, show the menu.\n } else {\n const elementsToShow = document.getElementsByClassName(\"collapse\");\n for (var i = 0; i < elementsToShow.length; i++) {\n elementsToShow[i].classList.add(\"show\");\n }\n }\n\n //goes through all childnodes of each menu item, and displays the items that meet the search and category criteria.\n for (var i = 0; i < displayMenuItems.length; i++) {\n const mi = displayMenuItems[i];\n console.log(mi.dataset.glutenfree);\n for (var j = 0; j < mi.childNodes.length; j++) {\n const node = mi.childNodes[j];\n if (node.className === \"bold\") {\n if(node.innerHTML.toUpperCase().indexOf(filter) > -1) {\n if (meetsDietaryRequirements(mi)) {\n mi.style.display = \"\";\n } else {\n mi.style.display = \"none\";\n }\n\n } else {\n mi.style.display = \"none\";\n }\n }\n }\n }\n}", "title": "" }, { "docid": "80f74c69025b5d9643ac8dcd1e104fb4", "score": "0.4979865", "text": "function BOT_mapLemSynonyms(lem) {\r\n\tvar t = BOT_basicSynonymList;\r\n\tvar res = lem;\r\n\tvar a,la,rex;\r\n\t// replaces synonyms\r\n\tfor (var i in t) {\r\n\t\ta = t[i][0];\r\n\t\tla = t[i][1];\r\n\t\tfor (var j in la) {\r\n\t\t\trex = new RegExp(eval(\"/ \" + la[j] + \" /g\"));\r\n\t\t\tres = res.replace(rex, \" \"+a+\" \");\r\n\t\t}\r\n\t}\r\n\t// delete everything before a command _a // bug with \"b like\"\r\n\tt = BOT_commandList;\r\n\tfor (var i in t) {\r\n\t\trex = new RegExp(eval(\"/(.*) \" + \"_\" + t[i] + \" (.*)/g\"));\r\n\t\tres = res.replace(rex, \"< \"+t[i]+\" $2\");\r\n\t}\r\n\tres = res.replace(/ +/g, \" \"); // shrink extra withespaces \r\n\treturn (res)\r\n}", "title": "" }, { "docid": "fc4efcf2888a12bcdbf10d8ff0f3bf6b", "score": "0.49781322", "text": "function nota_menor(){\n\t\tvar menor = notas.indexOf(Math.min.apply(null, notas ));\n\t\tdocument.getElementById(\"menor\").innerHTML = \"La nota menor del estudiante: <b>\" + nombre_alumno(menor) + \"</b>\";\n\t}", "title": "" }, { "docid": "624860a40d0c12f10d2e6fe7e0f0e1ec", "score": "0.49770725", "text": "function sayHiToGrandma(string){\n\n if((string === string.toLowerCase()) == true){\n return \"I can\\'t hear you!\";\n }\n \n if((string.toUpperCase() === string) == true){\n return \"YES INDEED!\";\n \n }\n\n if(string == \"I love you, Grandma.\"){\n return \"I love you, too.\";\n \n }\n\n\n}", "title": "" }, { "docid": "9b0b70c2a2341bd683f36d244e413157", "score": "0.49760452", "text": "function input(x){\nconsole.log('running input')\n return x.split(\" \"); //[hit,enemy,with,sword]\n}", "title": "" }, { "docid": "475184c21ee6b323dcdbad620730b384", "score": "0.49729058", "text": "function limpiar_nombres(text) {\n var text = text.toLowerCase(); // a minusculas\n text = text.replace(/[áàäâå]/, 'a');\n text = text.replace(/[éèëê]/, 'e');\n text = text.replace(/[íìïî]/, 'i');\n text = text.replace(/[óòöô]/, 'o');\n text = text.replace(/[úùüû]/, 'u');\n text = text.replace(/[ýÿ]/, 'y');\n text = text.replace(/[^a-zA-ZñÑ\\s]/g, '');\n text = text.replace(/\\s{2,}/, ' ');\n text = text.toUpperCase();\n return text;\n}", "title": "" }, { "docid": "bec3ebb802666ecb9d7f4edaa112f19f", "score": "0.4969289", "text": "function sayHiToGrandma(string) {\n if (string == string.toUpperCase()) {\n return ('YES INDEED!')\n }\n else if (string == string.toLowerCase()) {\n return (\"I can\\'t hear you!\")\n }\n else if (string == \"I love you, Grandma.\") {\n return (\"I love you, too.\")\n }\n }", "title": "" }, { "docid": "07f3aa0cef825af2a178ff1fc29577e8", "score": "0.49615097", "text": "function removeM (string) {\n var stringArr = string.split('');\n var newString = \"\";\n for(var i =0; i < stringArr.length; i ++) {\n if(stringArr[i] !== \"m\"){\n newString = newString + stringArr[i];\n }\n } console.log(newString);\n}", "title": "" }, { "docid": "6b87c9900e3ac3fbbe6ea98100938ec3", "score": "0.496023", "text": "function megaFriend(str){\n var array = str; [\"nisha\", \"ox\", \"enjoy\", \"please\", \"jannatulmottakin\", \"moreover\", \"daraz\"];\n var long = array [0];\n if(str.length === 0){\n return \"empty array does not accepted!\";\n }\n else{\n for(i=0;i < array.length; i++){\n if(long.length< array[i].length){\n long = array[i];\n }\n }\n }\n return long;\n }", "title": "" }, { "docid": "b60f2d39fe492693cddf25af4edb024e", "score": "0.49597603", "text": "function DoWords() \n{\n\tvar nWord = 0;\n\tvar nDiff = 0;\n\tvar olex = \"\";\n\n\t// Parse the input lexicon\n\tlex = rewrite(theform.ilex);\n\tnlex = lex.length;\n\n\tvar oldolex;\n\tvar localshowdiff = showDiff;\n\tif (showDiff) {\n\t\tvar sx = document.getElementById(\"olex\").value; //innerHTML;\n\t\tif (sx == \"\") \n\t\t\tlocalshowdiff = false;\n\t\telse {\n\t\t\t//sx = unrewrite(sx, true);\n\t\t\t//sx = sx.replace(new RegExp(\"<(b|/b)>\", \"gi\"), \"\");\n\t\t\toldolex = sx.split(\"\\n\");\n\t\t}\n\t}\n\n\tfor (w = 0; w < nlex; w++) {\n\t\tvar inword= lex[w];\n\n\t\tif (inword.length > 0) {\n\t\t\tif (inword.charCodeAt(inword.length - 1) == 13) {\n\t\t\t\tinword = inword.substr(0, inword.length - 1);\n\t\t\t}\n\t\t\t\n\t\t\tvar outword = Transform(inword);\n\t\t\tvar outs;\n\n\t\t\tvar parts = inword.split(\" \\u2023\");\n\t\t\tif (parts.length > 1) \n\t\t\t\tinword = parts[0];\n\n\t\t\tswitch (outtype) {\n\t\t\tcase 0: \n\t\t\t\touts = outword;\n\t\t\t\tbreak;\n\t\t\tcase 1: \n\t\t\t\touts = inword + \" &#x2192; \" + outword;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\touts = outword + \" [\" + inword + \"]\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (localshowdiff && w < oldolex.length \n\t\t\t\t&& outs != oldolex[w]) {\n\t\t\t\touts = outs.bold();\n\t\t\t}\n\n\t\t\touts += \"\\n\";\n\t\t\tolex += outs;\n\n\t\t\tnWord++;\n\t\t\tif (inword != outword) nDiff++;\n\t\t}\n\t}\n\t\n s += '<ul>'\n\ts += \"<li>Categories found: \" + catindex \n\t\t+ \"</li><li>Valid rules found: \" + nrul \n\t\t+ \"</li><li>Words processed: \" + nWord \n\t\t+ \"</li><li>Words changed by rules: \" + nDiff;\n\n\tdocument.getElementById(\"olex\").value = olex; //unrewrite(olex, false);\n}", "title": "" }, { "docid": "1fbb2cab0940dcc74901cdc2d6cd4aac", "score": "0.49494618", "text": "function determinaTexto(texto){\n if(texto == texto.toUpperCase() ){\n console.log(\"El texto esta en mayuscula \"+texto)\n }\n else if(texto == texto.toLowerCase()){\n console.log(\"El texto esta en + minusculas \"+texto);\n }\n else if(texto!=texto.toUpperCase() ){\n console.log(\"El texto esta combinado\")\n } \n }", "title": "" }, { "docid": "0510c75c9cd8d5a31547e3c24feca352", "score": "0.4946706", "text": "function aORan(comps) {\n article = [];\n for (i = 0; i < comps.length; i++){\n var beg = comps[i].charAt(0);\n beg = beg.toLowerCase();\n if (beg.match(\"a|e|i|o|u|h\")) {\n article.push(\"an\");\n }else{\n article.push(\"a\");\n }\n }\n return article;\n}", "title": "" }, { "docid": "98c6ce8220d07ae0a7d81d242eef498a", "score": "0.49444062", "text": "function inspectText(body, context) {\r\n var toDisplay = [];\r\n console.log(body);\r\n var prev, pref, word;\r\n var prefix = [\"\", \"den \", \"der \", \"de \", \"van \"];\r\n var reg = /[A-Z]+[a-z\\-]*/gm;\r\n var i = 0;\r\n while (word = reg.exec(body)) {\r\n if (word == \"De\" || word == \"Van\" || word == \"Di\" || word == \"Vanden\" || word == \"Ver\") {\t\t//Di Rupo rpz\r\n pref = word;\r\n console.log(\"Prefix found: \" + pref);\r\n continue;\r\n }\r\n var name;\r\n var found = false;\r\n var iter = 0;\r\n while (!found && iter < prefix.length) {\r\n // Search for prefixes\r\n if (pref != null) {\r\n name = pref + \" \" + prefix[iter] + word;\r\n } else {\r\n name = prefix[iter] + word;\r\n }\r\n // Search for the name in the hashmap\r\n if (name in hashmap && !(name in alreadyFoundPoliticians)) {\r\n\t\t\t\t\talreadyFoundPoliticians[name] = true;\r\n found = true;\r\n var matching = [];\r\n var pol = null;\r\n // If only one politician has this name\r\n var twoNames = false;\r\n if (hashmap[name].length == 1) {\r\n pol = 0;\r\n }\r\n // If a politician has his first name cited just before his last name in the text\r\n else for (var i in hashmap[name]) {\r\n matching.push(hashmap[name][i]);\r\n if (prev == hashmap[name][i][4]) { //Matching also firstname\r\n pol = i;\r\n twoNames = true;\r\n }\r\n }\r\n var nameLength = name.length;\r\n if (twoNames) {\r\n prev += \" \";\r\n nameLength += prev.length;\r\n }\r\n else {\r\n prev = \"\";\r\n }\r\n\r\n // Only one politician\r\n if (pol != null) {\r\n display(hashmap, name, pol, context);\r\n }\r\n //Multiple policitians\r\n else {\r\n console.log(\"display multiple\");\r\n display_multiple(hashmap, name, context);\r\n }\r\n pref = null;\r\n }\r\n prev = word;\r\n iter++;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "7f5a49463b816486016dbdc6ee6dc8e3", "score": "0.4936487", "text": "function literaryMutilator() {\n\tlet tacoPara = document.getElementById(\"three\");\n\tlet regex = /taco/;\n\ttacoPara.innerHTML = tacoPara.innerHTML.replace(regex, 'YUM')\n}", "title": "" }, { "docid": "b3f226c02030ed76bfcca4ce6f523678", "score": "0.49363127", "text": "addphrasetoDisplay(){\n const phraseUL = document.querySelector('#phrase ul');\n this.phrase.forEach(letter => {\n if(letter.match(/^\\s+$/)){\n phraseUL.innerHTML += `\n <li class=\"space\"> </li>\n `;\n } else{\n phraseUL.innerHTML += `\n <li class=\"hide letter ${letter}\">${letter.toUpperCase()}</li>`;\n }\n })\n }", "title": "" }, { "docid": "c0c3d07fa8a72a2e13b4c4b726fcb949", "score": "0.493202", "text": "function mM(str) {\nvar array = str.split(\"\");\n\nvar ar = array.map( function(item,index) {\n if (index % 2== 0) {\n return item.toUpperCase();\n }\n\n else {\n return item;\n }\n}\n);\n\nreturn ar.join(\"\");\n}", "title": "" }, { "docid": "353999eeed150c57ee95ca6567c2d9f6", "score": "0.49302837", "text": "function minMay() {\n\t\tvar length = str.length;\n\t\tvar translation = '';\n\t\tvar capitalize = true;\n\t\tfor (var i = 0; i < str.length; i++) {\n\t\t\tvar char = str.charAt(i);\n\t\t\ttranslation += capitalize ? char.toUpperCase() : char.toLowerCase();\n\t\t\tcapitalize = !capitalize;\n\t\t}\n\t\treturn translation;\n\t}", "title": "" }, { "docid": "7d18b7af32719e678ddcdaf49e05fb49", "score": "0.4930131", "text": "function ejercicio02(email){\nvar longitud = email.length;\nvar mayusc = email.toUpperCase();\ncont = 0;\nvar no = \"\";\n\nfor (i=0 ; i<=longitud ; i++)\n{ \n if(email.charAt(i) == \"m\" || email.charAt(i) == \"M\")\n {\n cont++;\n }\n}\nif (cont == 0)\n{\n cont = toString(cont)\n cont = \"ninguna\";\n no = \"no\";\n}\nreturn \"El correo\" + email + \"tiene\" + longitud + \"caracteres y en mayúsculas se quedaría así\" + mayusc + \". Además \" + no + \" contiene \" + cont + \" letras M\";\n\n}", "title": "" }, { "docid": "7a2a065a4cebcfecc66bc2b611f7c3c3", "score": "0.49293637", "text": "function madLibs(str, array) {\n var finalSentence = '';\n //segments [ 'Marching is fun: ', ', ', ', ', ', ', '!' ]\n var segments = str.split('*');\n var nextWordIdx = 0;\n\n for (var i = 0; i < segments.length - 1; i++) {\n //adds element then word at array and then add them to the finalString\n var segment = segments[i];\n segment += array[nextWordIdx];\n finalSentence += segment;\n // increase the counter \n nextWordIdx = nextWordIdx + 1 < array.length ? nextWordIdx + 1 : 0;\n }\n\n finalSentence += segments[segments.length - 1];\n \n return finalSentence;\n }", "title": "" }, { "docid": "7283a7a253dcffcb5a4b1056c1665066", "score": "0.4926054", "text": "function main() {\n var m_temp = readLine().split(' ');\n var m = parseInt(m_temp[0]);\n var n = parseInt(m_temp[1]);\n magazine = readLine().split(' ');\n ransom = readLine().split(' ');\n if (canCreateNote(ransom, magazine)) {\n console.log('Yes');\n } else {\n console.log('No');\n }\n}", "title": "" }, { "docid": "8946581e8d24301c9653938266d4aab0", "score": "0.4924072", "text": "function marsExploration(s) {\n // Write your code here\n let expectedWords = s.length / 3;\n let expectedString = '';\n let changedLetters = 0;\n\n for (let x = 0; x < expectedWords; x++) {\n expectedString += 'SOS';\n }\n console.log('es', expectedString)\n for (let y = 0; y < s.length; y++){\n if (s[y] != expectedString[y]) {\n changedLetters++;\n }\n }\n\n return changedLetters;\n}", "title": "" }, { "docid": "d97888aedd286439bdef29af0050c1e4", "score": "0.49118206", "text": "function makespeakable(phrase) {\n phrase = phrase.replace(/['\"]/g, \"\");\n phrase = phrase.replace(/[-+]/g, \" \");\n phrase = phrase.replace(/([A-Z])(?=[A-Z])/g, \"$1 \"); //split apart capitals\n phrase = phrase.replace(/([A-Za-z])([0-9])/g, \"$1 $2\"); // split letter-number\n phrase = phrase.replace(/([0-9])([A-Za-z])/g, \"$1 $2\"); // split number-letter\n return phrase.replace(/\\b[A-Z](?=[[:space:][:punct:]])/g, function(match) {\n return say_letter[match.toUpperCase()];\n })\n .replace(/[0-9]+ ?(st|nd|rd|th)\\b/g, function(match) {\n return n2w.toOrdinalWords(parseInt(match)).replace(/[-,]/g, \" \");\n })\n .replace(/[0-9]+/g, function(match) {\n return n2w.toWords(match).replace(/[-,]/g, \" \");\n });\n}", "title": "" }, { "docid": "f3d4be11b901c992abac5eca8168d9de", "score": "0.49048826", "text": "function jadenCase(str)\n{\n let tab = str.split(\" \");\n let chaine = \"\";\n let max = tab.length;\n for(let i=0; i<max; i++)\n if(i===max-1)\n chaine += mettreMaj(tab[i]);\n else\n chaine += mettreMaj(tab[i])+\" \";\n return chaine;\n}", "title": "" }, { "docid": "f381ea3debe3da888fbf60d7a5cd6b5c", "score": "0.49030715", "text": "function pluralize()\r\n{\r\n var quantity = Number(document.project4.num1.value);\r\n var noun = document.project4.word1.value;\r\n\r\n if (noun == 'mouse') {\r\n if (quantity > 1) {\r\n return quantity + \" mice \";\r\n }\r\n else {\r\n return quantity + \"mouse\";\r\n }\r\n }\r\n else if (noun == 'deer')\r\n {\r\n return quantity + \"deer\";\r\n }\r\n else if (noun == 'cactus')\r\n {\r\n if (quantity > 1)\r\n return quantity + \"cacti\"\r\n }\r\n\r\n if (quantity > 1)\r\n {\r\n //tacK on an 's' tot the noun aka CONCATENATE\r\n return quantity + \" \" + noun + \"s\";\r\n }\r\n else\r\n {\r\n return quantity + \" \" + noun;\r\n }\r\n}", "title": "" }, { "docid": "a99bca3ca8a1622d25fcaeca90732d2a", "score": "0.49012622", "text": "function getTitle(film) {\n let tytul = film.split(\" (\")[0]; // tniemy po \" (\"\n return tytul;\n}", "title": "" }, { "docid": "b3a6dfac541a001774f5a15b63f2546e", "score": "0.4891864", "text": "function showWords(){\n return profanities;\n }", "title": "" }, { "docid": "de64d3f3803694b3bde02eb9d3bf6a54", "score": "0.48824823", "text": "function categoryCheck (word) {\n switch (word) {\n case \"anniversary\":\n return \"anniversary\"\n break;\n case \"birthday\":\n return \"birthday\"\n break; \n case \"congratulations\":\n return \"congratulations\"\n break; \n case \"well\":\n return \"getWell\"\n break;\n case \"getwell\":\n return \"getWell\"\n break;\n case \"housewarming\":\n return \"housewarming\"\n break; \n case \"warming\":\n return \"housewarming\"\n break; \n case \"sorry\":\n return \"sorry\"\n break; \n case \"patrick\":\n return \"stPatricksDay\"\n break; \n case \"patrick\\'s\":\n return \"stPatricksDay\"\n break; \n case \"because\":\n return \"justBecause\"\n break;\n case \"just\":\n return \"justBecause\"\n break;\n case \"justBecause\":\n return \"justBecause\"\n break;\n case \"baby\":\n return \"newBaby\"\n break;\n case \"newBaby\":\n return \"newBaby\"\n break;\n case \"newborn\":\n return \"newBaby\"\n break; \n case \"romance\":\n return \"loveRomance\"\n break;\n case \"retirement\":\n return \"retirement\"\n break; \n case \"retire\":\n return \"retirement\"\n break; \n case \"funeral\":\n return \"sympathy\"\n break; \n case \"sympathy\":\n return \"sympathy\"\n break; \n case \"thank\":\n return \"thankYou\"\n break; \n case \"thankYou\":\n return \"thankYou\"\n break; \n case \"year\":\n return \"newYear\"\n break;\n case \"valentine\":\n return \"valentinesDay\"\n break;\n case \"valentine\\'s\":\n return \"valentinesDay\"\n break;\n case \"valentines\":\n return \"valentinesDay\"\n break;\n case \"easter\":\n return \"easter\"\n break; \n case \"mother\\'s\":\n return \"mothersDay\"\n break;\n case \"mothers\":\n return \"mothersDay\"\n break;\n case \"mother\":\n return \"mothersDay\"\n break;\n case \"memorial\":\n return \"memorialDay\"\n break; \n case \"fathers\":\n return \"fathersDay\"\n break;\n case \"father\\'s\":\n return \"fathersDay\"\n break;\n case \"father\":\n return \"fathersDay\"\n break; \n case \"july\":\n return \"july4th\"\n break; \n case \"4th\":\n return \"july4th\"\n break; \n case \"fourth\":\n return \"july4th\"\n break; \n case \"labor\":\n return \"laborDay\"\n break;\n case \"laborDay\":\n return \"laborDay\"\n break;\n case \"halloween\":\n return \"halloween\"\n break; \n case \"veteran\":\n return \"veteransDay\"\n break;\n case \"veterans\":\n return \"veteransDay\"\n break;\n case \"veteransDay\":\n return \"veteransDay\"\n break;\n case \"veteran\\'s\":\n return \"veteransDay\"\n break;\n case \"thanksgiving\":\n return \"thanksgiving\"\n break; \n case \"hanukkah\":\n return \"hanukkah\"\n break; \n case \"christmas\":\n return \"christmas\"\n break;\n }\n}", "title": "" }, { "docid": "9b5e0205d5eb19c07f48cc691c9d4f22", "score": "0.48785424", "text": "function quitaBlancos(Input){\t\r\n while(''+Input.value.charAt(0)==' ')\r\n {Input.value=Input.value.substring(1,Input.value.length);}\r\n}", "title": "" }, { "docid": "f20ae30f7d7015458058f5d817d411dd", "score": "0.48769936", "text": "function verse1() {\n let output = 'Would you climb a hill? Anything.<br>Wear a dafodill? Anything.<br>Leave me all your will? Anything.<br>Even fight my bill? What fisticuffs?'\n\n return output\n}", "title": "" }, { "docid": "542713e8574fe82deb87e4809aa99901", "score": "0.48743102", "text": "function parseString(menuString) {\n menuString = menuString.menu;\n\n let menuArray = menuString.split(\"###\");\n let sortedMenuArray = [];\n let menuItems = [];\n let i = 1;\n let keyPointer = -1;\n\n while (i < menuArray.length) {\n let currentStr = menuArray[i];\n let firstChar = currentStr[0];\n\n if (firstChar === \" \") {\n let getStr = menuArray[i];\n let cleanStr = getStr.split(\"/n\");\n let finalStr = cleanStr[0].trim();\n sortedMenuArray.push(finalStr);\n keyPointer += 1;\n }\n\n if (firstChar === \"#\") {\n let dishInfo = [];\n let currentKey = sortedMenuArray[keyPointer];\n dishInfo.push(currentKey);\n let getStr = menuArray[i];\n let strArray = [];\n strArray = getStr.split(\"\\n\\n\");\n let dishName = strArray[0];\n let dishNameArray = dishName.split(\"#\");\n dishName = dishNameArray[1];\n dishName = dishName.trim();\n dishInfo.push(dishName);\n\n if (strArray.length === 4) {\n dishInfo.push(strArray[1]);\n dishInfo.push(strArray[2]);\n }\n if (strArray.length === 3) {\n dishInfo.push(strArray[1]);\n }\n menuItems.push(dishInfo);\n }\n i++;\n }\n menuItems = getAllMenuItems(menuItems);\n\n return menuItems; //formattedMenu;\n}", "title": "" }, { "docid": "4f40ee58847e078765230591158d9766", "score": "0.48733506", "text": "function vacio(q){ \n for ( i = 0; i< q.length; i++ ) \n \t\t{ \n if ( q.charAt(i)== \" \" ) \n \t\t{ return false; \n \t\t} \n \t\t}; \n return true; \n \t\t\t\t\t\t}", "title": "" }, { "docid": "4f40ee58847e078765230591158d9766", "score": "0.48733506", "text": "function vacio(q){ \n for ( i = 0; i< q.length; i++ ) \n \t\t{ \n if ( q.charAt(i)== \" \" ) \n \t\t{ return false; \n \t\t} \n \t\t}; \n return true; \n \t\t\t\t\t\t}", "title": "" }, { "docid": "ef1fc88caa2615bf204c89ecb10e4cb1", "score": "0.48732123", "text": "function allBeforeWords(area) { return toWords(before(area)); }", "title": "" }, { "docid": "c65179266baf727348ca95aaead70b4a", "score": "0.48729908", "text": "function setMenu() {\n var menu = gId('menu');\n var menu_elements = menu.children;\n for (var i = 0; i < menu_elements.length; i++) {\n if (menu_elements[i].textContent != \"my stories\") {\n menu_elements[i].style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "e481e7f731dd745169cb655ef100d41c", "score": "0.4870369", "text": "function cleanInput(input) {\n var arr = input.split(' ');\n var msg = arr[0] + \" \" + arr[1]; //take off |bb and <command>\n\n var midCommand = false;\n var i = 2;\n for (; i < arr.length; ++i) {\n //escape any existing parentheses\n if (arr[i].indexOf(\"'\") !== -1) {\n var aposIndex = arr[i].indexOf(\"'\");\n if (aposIndex > 0 && arr[i].charAt(aposIndex - 1) != \"\\\\\") {\n arr[i] = arr[i].replace(\"'\", \"\\\\'\");\n }\n }\n\n //we haven't reached another command, so keep concatenating\n if (arr[i].indexOf(\"--\") == -1) {\n if (!midCommand) {\n msg += \" \\\"\" + arr[i];\n midCommand = true;\n } else {\n msg += \" \" + arr[i];\n }\n } else {//found a command\n //convert l to list and p to print\n if (arr[i].indexOf(\"--l_\") > -1) {\n arr[i] = arr[i].replace(\"--l_\", \"--list_\");\n } else if (arr[i].indexOf(\"--p_\") > -1) {\n arr[i] = arr[i].replace(\"--p_\", \"--print_\");\n }\n\n // if (arr[i].indexOf(\"hitcount\") > 1 && arr[i].indexOf(\"hitcounts\") === -1) {\n // arr[i] = arr[i].replace(\"hitcount\", \"hitcounts\");\n // }\n if (midCommand) {\n msg += \"\\\"\";\n midCommand = false;\n }\n msg += \" \" + arr[i];\n }\n }\n //close query, if necessary\n if (midCommand) {\n msg += \"\\\"\";\n }\n\n return msg;\n}", "title": "" }, { "docid": "7bfb38c3476fec193a3a26efd6ad172c", "score": "0.48683202", "text": "function createGoodness() {\n\n var numPhrases = 100\n\n //get starting word\n var newShit = getNewWord()\n \n\n //Save last word for key \n var lastWord = newShit\n \n\n for(var i = 0; i < numPhrases - 1; i++) {\n\n var newWord = \"\"\n\n if(words.has(lastWord)) {\n newWord = words.get(lastWord).getWord()\n }\n else {\n var newWord = getNewWord()\n }\n\n newShit += \" \"\n newShit += newWord\n lastWord = newWord\n \n }\n\n //console.log(newShit)\n document.getElementById(\"MarkovText\").innerHTML = newShit\n\n var longest = 0\n words.forEach(item => {\n if(item.getNumFollowers() > longest) {\n longest = item.getNumFollowers() \n }\n })\n\n console.log(longest)\n}", "title": "" }, { "docid": "2152779c9296560bd1a9fca2203c801f", "score": "0.48677647", "text": "function processSentence(name,age,alamat,hobby){\n return 'Nama saya ' + name + ', umur saya ' + age + ' tahun' + ', alamat saya di ' + alamat + ', dan saya punya hobby yaitu ' + hobby + ' !' \n }", "title": "" }, { "docid": "8fbfbd1ea6bd7e1fa10bf590866da0ab", "score": "0.48674276", "text": "function antiSpam(input){\n let string = input\n console.log(string)\n if(string.toLowerCase().includes(\"spam\") || string.toLowerCase().includes(\"scam\")){\n return true\n }else{\n return false\n }\n}", "title": "" }, { "docid": "cdf2ea2398f74c7d89bd8d17096c82ab", "score": "0.4867172", "text": "function masculineForms(lastChar, inputWord, secondToLastChar) {\n \n if (secondToLastChar === \"c\") {\n newWord = inputWord.slice(0, -2) + \"quito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"k\") {\n newWord = inputWord.slice(0, -1) + \"quito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"g\") {\n newWord = inputWord.slice(0, -1) + \"uito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"z\") {\n newWord = inputWord.slice(0, -1) + \"cecito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"u\") {\n newWord = inputWord.slice(0, -2) + \"üito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"t\") {\n newWord = \"1: \" + inputWord.slice(0, -1) + \"ito\"; \n dimunutive.innerHTML = newWord;\n \n newWord = \"2: \" + inputWord.slice(0, -1) + \"ico\"; \n specialIco.innerHTML = newWord;\n } else if (lastChar === \"o\") {\n newWord = inputWord.slice(0, -1) + \"ito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"l\" || lastChar === \"s\" && secondToLastChar === \"e\") {\n newWord = inputWord + \"ito\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"r\" || lastChar === \"n\" || lastChar === \"e\") {\n newWord = inputWord + \"cito\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"s\") {\n newWord = inputWord.slice(0, -2) + \"itos\"; \n dimunutive.innerHTML = newWord;\n } else {\n newWord = inputWord + \"ito\";\n dimunutive.innerHTML = newWord;\n }\n }", "title": "" }, { "docid": "4e3bde0aa0ab51fa3a686372a139545f", "score": "0.48659414", "text": "function kungfoo(input) {\n var array = input.split(' ').map(function(item, i){\n if(i%2 !== 0 && i !== 0){\n return item.toUpperCase()\n } else {\n return item\n }\n })\n return array.join(' ');\n}", "title": "" }, { "docid": "ccba221da488279dac5570145c5ad02e", "score": "0.48652628", "text": "function bonus2(){ \n for(word in wordList) {\n morse = smorse(wordList[word])\n if(/-{15}/.test(morse)){\n console.log(morse + ' is ' + wordList[word])\n break\n }\n }\n}", "title": "" }, { "docid": "567dfab151cf28865483deb27ba2eb46", "score": "0.48637992", "text": "function fancifyNoun(noun) {\n\treturn noun.split(' ').map((token, index, tokens) => {\n\t\tconst isLastToken = index === tokens.length - 1;\n\t\tif (token.toUpperCase() === 'OF' || token.toUpperCase() === 'AND') {\n\t\t\treturn [<span key=\"heuoatohuheo\" className=\"sm-caps\">{token}</span>, !isLastToken ? ' ' : ''];\n\t\t}\n\n\t\treturn token + (!isLastToken ? ' ' : '');\n\t});\n}", "title": "" }, { "docid": "973b08837f7b6d81015be5930e95d2f0", "score": "0.48628366", "text": "function harmlessRansomeNote(noteText, magazineText) {\n let noteArray = noteText.split(\" \")\n let magazineArray = magazineText.split(\" \")\n let magazineObj = {}\n let result = true\n \n magazineArray.forEach(word => {\n if (!magazineObj[word]) magazineObj[word] = 0;\n magazineObj[word]++\n })\n \n noteArray.forEach(word => {\n if (magazineObj[word] > 0) magazineObj[word]--;\n else result = false \n })\n \n console.log(result)\n}", "title": "" } ]
07c227076759eb8868b219e3547eb037
count the occurences of letters and update letters object which acts as a hash map
[ { "docid": "b30104ba99f64b1e882ca40a8ff99f7e", "score": "0.72119856", "text": "function countLetters(){\n for (let i = 0; i < textInput.length; i++){\n if (checkLetter(textInput.charAt(i)) === false){\n letters[textInput.charAt(i)] = 1;\n }else{\n current = letters[textInput.charAt(i)];\n letters[textInput.charAt(i)] = current + 1;\n }\n }\n}", "title": "" } ]
[ { "docid": "114f1c777d6275081f993c60181d23a5", "score": "0.7193972", "text": "function letterCounts(word) {\n let counterHash = word.split('').reduce( (acc, ch) => {\n acc[ch] = 0;\n return acc;\n }, {});\n\n let result = word.split('').reduce( (acc, ch) => {\n acc[ch] += 1;\n return acc;\n }, counterHash);\n\n return result;\n}", "title": "" }, { "docid": "e872f771401ecc50a558ea336ec87229", "score": "0.7163783", "text": "function countABC1(sentence) {\n let letterCounter = {};\n for (letter of sentence) {\n if (letter !== \" \") {\n if (!letterCounter[letter]) {\n letterCounter[letter] = 1;\n }\n else letterCounter[letter] += 1;\n }\n }\n return letterCounter;\n}", "title": "" }, { "docid": "1738a56e4306be93f42eca172333aac0", "score": "0.71473473", "text": "function countAllCharacters(str) {\n // your code here\n var letters = {};\n\n for (var i = 0; i < str.length; i++) {\n var char = str[i];\n letters[char] = (letters[char] + 1) || 1;\n \n }\n return letters; \n}", "title": "" }, { "docid": "c6393e26dd373a8aa98aa5723d85c7f8", "score": "0.70726925", "text": "function letterCount(str){\r\n\tvar amount = {};\r\n\tvar len = str.length;\r\n\t//clear the key and value arrays\r\n\tkeyArray=[];\r\n\tvalueArray=[];\r\n\twhile (len--){\r\n\t\tamount[str[len]] = amount[str[len]] + 1 || 1;\r\n\t}\r\n\tamount = sortObjAlpha(amount);\r\n\tfor (var key in amount) {\r\n\t\tkeyArray.push(key);\r\n\t\tvalueArray.push(amount[key]);\r\n\t}\r\n\treturn amount;\r\n}", "title": "" }, { "docid": "5af28210e132a598cd4cf8f3f613f56e", "score": "0.7051849", "text": "function countABC(sentence) {\n sentence = sentence.replace(/\\s/g, \"\");\n let letterCounter = {};\n for (letter of sentence) {\n if (!letterCounter[letter]) {\n letterCounter[letter] = 1;\n }\n else letterCounter[letter] += 1;\n }\n return letterCounter;\n}", "title": "" }, { "docid": "871a337eecfb927b4dd05e238934df3c", "score": "0.70386213", "text": "function countLetters(string) {\n // var strWithoutSpace = allLetters(string);\n var strWithoutSpace = string.split(' ').join('');\n var result = {};\n for (var i = 0; i < strWithoutSpace.length; i++) {\n var currentLetter = strWithoutSpace[i];\n // 1. If letter already inside result we add one to the count\n if (result[currentLetter]) {\n // testing to see if current letter already exists/is it true\n // object key operator value\n result[currentLetter] = result[currentLetter] + 1;\n } else {\n // 2. If letter is not inside the result we just set it to 1\n result[currentLetter] = 1;\n }\n }\n return result;\n }", "title": "" }, { "docid": "29e0133459a101dd047912b0b0ca4ac1", "score": "0.7019973", "text": "function letterCount (x) {\n\tx = x.toLowerCase();\n\tvar object = {};\n\tvar char;\n\t\n\tfor (var i = 0; i < x.length; i++) {\n\t\tchar = x[i];\n\t\t// As long as the character isn't a space\n\t\tif (char !== ' ') {\n\t\t\t// If we have encountered the character before\n\t\t\tif (object[char]) {\n\t\t\t\t// increment it\n\t\t\t\tobject[char]++;\n\t\t\t} else {\n\t\t\t\t// set the property equal to 1\n\t\t\t\tobject[char] = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}", "title": "" }, { "docid": "907f8bee913e17d8b5c27ca8c01c9c12", "score": "0.7004119", "text": "function countLetter (word){\n let obj={}\n let str=word.toLowerCase()\n for(let i=0 ; i<str.length;i++){\n if(str[i] in obj){\n \n obj[str[i]]=obj[str[i]]+1\n }\n else{\n obj[str[i]]= 1\n }\n }\n return obj\n}", "title": "" }, { "docid": "5571b332238927c0f6d011d57171d1bb", "score": "0.7002028", "text": "function countLetters(word) {\n\tvar letters = {};\n\tvar l = word.length;\n\tfor (var i=0; i<l; i++) {\n\t if (!letters[word[i]]) {\n\t\t letters[word[i]] = 1;\n\t } else {\n\t\t\tletters[word[i]]++;\n\t\t}\n\t}\n\treturn letters;\n}", "title": "" }, { "docid": "a947d7caa1748a2cac3beb063f29fe70", "score": "0.6989382", "text": "function count_letters(str) {\n let count = {};\n str.replace(/\\S/g, \n function(new_str){\n count[new_str] = (isNaN(count[new_str]) ? 1 : count[new_str] + 1);\n });\n console.log(count);\n }", "title": "" }, { "docid": "91c015c0bcad29934a20a6d39cf6cdb6", "score": "0.69798183", "text": "function countLetters(str) {\n var characters = str.split(' ').join('');\n var objectArray = {}\n // var charCount = 1;\n // for (occurences of characters) {\n for (var i = 0; i < characters.length; i++) {\n // for (char of characters) {\n if (objectArray[characters[i]]) {\n objectArray[characters[i]] += 1;\n } else {\n objectArray[characters[i]] = 1;\n }\n }\n return objectArray;\n}", "title": "" }, { "docid": "ae12e4df2e4357e1e34788b031825823", "score": "0.6961353", "text": "function countLetters(str){\n str = str.split(' ').join(\"\");\n var objLetterCount = {};\n //console.log(str);\n //var obj = Object.assign({},str);\n //3. for loop to count each letter\n for (var i = 0; i < str.length; i++){\n\n var letterCount = 0;\n\n for (var j = 0; j < str.length; j++){\n if (str[i] === str[j]){\n letterCount += 1;\n }\n }\n objLetterCount[str[i]] = letterCount;\n\n }\n //console.log(objLetterCount)\n return objLetterCount;\n}", "title": "" }, { "docid": "0c78cfd4f8caf1327a06d9b3bdd63634", "score": "0.6947216", "text": "function o(str){\n\tvar letters = {}\n\tstr = str.replace(/\\s+/g,\"\");\n\tfor(var i=0,l=str.length;i<0;i++){\n\t\tif(letters[str[i]]){\n\t\t\tletters[str[i]] + 1;\n\t\t}else{\n\t\t\tletters[str[i]] = 1;\n\t\t}\n\t}\n\treturn letters;\n}", "title": "" }, { "docid": "85e9af4b332abc4a6a9cf9db74956992", "score": "0.6926757", "text": "function letterTallyHelper(str) {\n let map = {}\n function helper(word) {\n if(word.length === 0) return map \n if(map.hasOwnProperty(word[0])) map[word[0]]++\n if(!map.hasOwnProperty(word[0])) map[word[0]] = 1\n helper(word.slice(1))\n }\n helper(str)\n return map \n}", "title": "" }, { "docid": "551a5352c8e72cb6a3993ea88d092d94", "score": "0.686758", "text": "function countLetters(word) {\n var letters = {};\n if (!word) {\n return letters;\n }\n word = exports.keepOnlyLowerAlpha(word);\n for (var i = 0; i < word.length; ++i) {\n var letter = word[i];\n if (!letters[letter]) {\n letters[letter] = 1;\n } else {\n letters[letter]++;\n }\n }\n return letters;\n}", "title": "" }, { "docid": "6f2a41a67844aa2d393d14bca532c991", "score": "0.6858717", "text": "function countLetters(smashingText) {\n const counts = smashingText.split(\"\").reduce(\n (counts, letter) => ({\n ...counts,\n [letter]: letter in counts ? counts[letter] + 1 : 1\n }),\n {}\n );\n return Object.entries(counts).map(([letter, count]) => ({letter, count}));\n}", "title": "" }, { "docid": "9420e0c05ceb8a0ff55c43c20015dd66", "score": "0.6814296", "text": "function countAllCharacters(str) {\n // your code here\n var result = {};\n for (var i = 0; i < str.length; i++) {\n let letter = str[i];\n if (result.hasOwnProperty(letter)) {\n result[letter] = ++result[letter];\n } else {\n result[letter] = 1;\n }\n }\n return result;\n}", "title": "" }, { "docid": "d44d7c2bccde03ee8f2a87085b49645a", "score": "0.6796394", "text": "function letterFreq(str) {\n var output = {};\n for (var i = 0;i < str.length; i++) {\n if (output.hasOwnProperty(str[i])) {\n output[str[i]]++;\n } else {\n output[str[i]] = 1;\n }\n }\n return output;\n}", "title": "" }, { "docid": "0a233620bc52e1c4718a013615103745", "score": "0.67943543", "text": "function countWords (str, letterCount, mult) {\n\tfor (idx in str) {\n\t\tletter = str[idx]\n\n\t\t// if the letter is in the dictionary, increase the count by 1 * multiplier\n\t\tif (letterCount[letter] == undefined) {\n\t\t\tletterCount[letter] = 1 * mult\n\t\t// if not, add the letter to to the dictionary with count 1 * multiplier\n\t\t} else {\n\t\t\tletterCount[letter] += 1 * mult\n\t\t}\n\t}\n\treturn letterCount\n}", "title": "" }, { "docid": "4cc1d236d32b36cce8146e5d6e665bad", "score": "0.67765677", "text": "function countLetters(string) {\n var noSpaces = string.split(\" \").join(\"\");\n\n//console.log(noSpaces);\n var letterCounter = {};\n for (var i = 0; i < noSpaces.length; i++) {\n if (letterCounter[noSpaces[i]] === undefined) {\n letterCounter[noSpaces[i]] = 1;\n } else {\n letterCounter[noSpaces[i]] += 1;\n }\n }\n return letterCounter;\n\n}", "title": "" }, { "docid": "4baea626c46e326176d54b9a3426eed0", "score": "0.67587906", "text": "function countLetters(string) {\n\tvar letterCountList = {};\n\tvar splitString = string.split('')\n\tsplitString.forEach(function(letter) {\n if (letterCountList[letter] === undefined){\n \tletterCountList[letter] = 0;\n }\n letterCountList[letter]++\n });\n return letterCountList\n}", "title": "" }, { "docid": "6f9f1aa3c23ad6307decc6c081130b5b", "score": "0.67503464", "text": "function duplicateCount(text){\n text = text.toLowerCase().split(\"\")\n const countedletters = text.reduce((allLetters, letter) => {\n if(letter in allLetters) {\n allLetters[letter]++\n } \n else {\n allLetters[letter] = 1\n }\n return allLetters \n }, {})\n const filterDup = Object.values(countedletters).filter((duplicate) => duplicate >=2)\n return filterDup.length\n }", "title": "" }, { "docid": "cc4a26366f864abc86cf7419c3b2a7d8", "score": "0.6722367", "text": "function countLetters(str) {\n let result = {};\n for (let i = 0; i < str.length; i++) {\n let currentLetter = str[i];\n if (result[currentLetter]) {\n result[currentLetter] += 1;\n } else {\n result[currentLetter] = 1;\n }\n }\n return result\n}", "title": "" }, { "docid": "590cd201d268f789dffd37db825b5d99", "score": "0.6704146", "text": "function countLetters(input) {\n\tvar letterCount = {};\n\tvar outputArray=[];\n\tfor(var i=0; i <input.length; i++) {\n\n\t\tvar currentLetter = input.charAt(i);\n\n\t\tif(!letterCount.hasOwnProperty(currentLetter)) {\n\t\t\tletterCount[currentLetter] = 1;\n\t\t}\n\t\telse{\n\t\t\tletterCount[currentLetter]++;\n\t\t} \n\t}\n\tfor(var propertyName in letterCount) {\n\t\tvar count=letterCount[propertyName]; \n\t\toutputArray.push(' '+propertyName + ': '+ count );\n\t}\n\treturn outputArray;\n}", "title": "" }, { "docid": "4f9079ae2ce280a26d9cdb0fd4a090d6", "score": "0.6700497", "text": "function countDuplicate(chars) {\n let charsArray = [...chars.toLowerCase()];\n const count = 1;\n const charsObject = {};\n for (let char of charsArray) {\n charsObject[char]\n ? (charsObject[char] += count)\n : (charsObject[char] = count);\n }\n for (let [key, value] of Object.entries(charsObject)) {\n const result =\n value > 1 ? console.log(`The ${key} repeats ${value} times`) : \"\";\n }\n}", "title": "" }, { "docid": "34d39dd01b483461b0015bcc89811c93", "score": "0.66884285", "text": "function countLetters(str) {\n // 3. initialize a return value of the correct type\n var letterCounts = {};\n\n // 4. iterate over the arguments\n for (var i = 0; i < str.length; i++) {\n // 5. modify the return value\n var letter = str[i];\n // skip the spaces\n if (letter === ' ') {\n continue;\n }\n // if the letter has not been seen yet...\n if (letterCounts[letter] === undefined) {\n // set the count for the letter to 1\n letterCounts[letter] = 1;\n } else {\n // if the output already has the letter then increment by 1\n letterCounts[letter] = letterCounts[letter] + 1;\n }\n }\n // 6. Return the result\n return letterCounts;\n}", "title": "" }, { "docid": "ab552ef730d859d676aed106d5a83a64", "score": "0.6665178", "text": "function countRepLetters(myName){\n\n\t const spelledOut = [];\n\n/*1*/let nameLetters = myName.split(' ').map(word => { word.toUpperCase().split('').forEach(letter => spelledOut.push(letter)) });\n\n/*2*/const countLetters = spelledOut.reduce((allLetters, letter) => (!allLetters[letter] ? allLetters[letter] = 1 : allLetters[letter]++, allLetters), {});\n\n/*3*/let filtered = Object.keys(countLetters).filter( key => countLetters[key] > 1)\n\t\t\t\t\t\t\t\t\t\t.reduce((newObj, key) => (newObj[key] = countLetters[key], newObj), {} );\n\n/*4*/filtered = Object.entries(filtered);\n\n\t let answer = filtered.forEach(function(element){\n\t\t\t\tconsole.log(`${myName.toString()}, the letter '${element[0]}' => ${element[1]} times `)\n\t\t\t\t});\n\n console.log(answer) \n\n}", "title": "" }, { "docid": "095f21e0f272e6abd5950b96c6f20a87", "score": "0.66536623", "text": "function collectLetters(str) {\n let = { obj };\n for (let letter of str) {\n if (!obj[letter]) {\n obj[letter] = 1;\n } else {\n obj[letter]++;\n }\n }\n return obj;\n}", "title": "" }, { "docid": "d2a939c5cfa4b81938bec431af64bad1", "score": "0.6614218", "text": "usesAvailableLetters(input, lettersInHand) {\n\n let count = lettersInHand.reduce((tally, letter) => {\n // ????? I don't know exactly how this next line works but it does :| ?????????\n tally[letter] = (tally[letter] || 0) + 1;\n return tally;\n }, {});\n // I learned that using string interpolation requires interpolating specifics\n // or else js just prints 'object' to the console\n console.log(`hash object of tallied available letters in hand: ${Object.entries(count)}`);\n // logging without string interp. gives me what i want tho\n console.log(count);\n // split letters into an array\n const checkLetters = input.split('');\n // loop through checkLetters array\n // decrement count for each letter used\n // return false if a letter is overused or not in checkLetters hash\n for (let letter of checkLetters) {\n // console.log(letter);\n // console.log(count[letter]);\n if (letter in count && count[letter] >= 1) {\n count[letter] -= 1\n } else {\n return false;\n }\n }\n // console.log(count);\n return true\n\n }", "title": "" }, { "docid": "d4d86360b621cd4d512a0297ea8fa6d6", "score": "0.65951896", "text": "function check_letter() {\n var sentence = prompt(\"type a sentence\"); // \"test\"\n const output = {}\n\n for (let i = 0; i < sentence.length; i++) {\n const letter = sentence[i]\n\n // const val = ++this._nextId[letter];\n // //this needs to check the value of each letter, add a new variable if one dosent already exsist\n if (output[letter]) { \n // if the letter was previously added, increment count by 1\n output[letter]++\n } else {\n output[letter] = 1\n }\n }\n\n return output\n}", "title": "" }, { "docid": "5b8efa6d672c83289eb8ba75b34b4ebe", "score": "0.6585705", "text": "function Nivel1Ejercicio3() {\n document.getElementById('text').innerHTML='';\n let nombre =prompt('Su nombre?:').toUpperCase() ;\n var noNumberNames = nombre.replace(expRegular1,\"\");\n var arrNoNumberNames = noNumberNames.split(\"\");\n var listedCounts = {};\n var nameMaped = arrNoNumberNames.map(letter =>{\n if (listedCounts[letter]) {\n listedCounts[letter] = listedCounts[letter]+1\n } else {\n listedCounts[letter] = 1; \n }\n });\n for (const leter in listedCounts) {\n if (Object.hasOwnProperty.call(listedCounts, leter)) {\n document.getElementById('text').innerHTML+= leter + ':' + listedCounts[leter] + ' </br>';\n \n }\n }\n\n}", "title": "" }, { "docid": "024a79d13692ca7bc97bdf401c5025f7", "score": "0.6550016", "text": "function countLetters(string) {\n let letterCount = {};\n for (let i = 0; i < string.length; i++) {\n if (letterCount[string[i]] === undefined) {\n letterCount[string[i]] = 1;\n } else {\n letterCount[string[i]]++;\n }\n }\n return letterCount;\n}", "title": "" }, { "docid": "57bff9d38effb0b566a91676fa1cccb8", "score": "0.6539573", "text": "function duplicateCount(text){\n // Define an empty Object characterTally\n let characterTally = {};\n // Define an variable count\n let count = 0;\n // Convert the input sting to uppercase\n text = text.toUpperCase()\n\n // Iterate through the input string and populate the Object with distinct characters and their count \n for (let i=0; i<text.length; i+=1){\n let character = text[i];\n characterTally[character] = characterTally[character] + 1 || 1\n }\n // Iterate through the Object and return the key whose value is > 1\n for (const key in characterTally){\n if (characterTally[key] > 1){\n count +=1;\n }\n }\n return count\n}", "title": "" }, { "docid": "d7b9608d2a30f6e68a210945ef97ef33", "score": "0.6532208", "text": "add(letter) {\n\t\t\tif (this.memState[letter] === undefined) {\n\t\t\t\t// We haven't seen this letter so far.\n\t\t\t\tthis.memState[letter] = 1;\n\t\t\t} else {\n\t\t\t\t// We've seen this letter at least once, so let's add one to the count.\n\t\t\t\tthis.memState[letter]++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "0dbbbd73479d0e5cc82b19ece05521f0", "score": "0.6467043", "text": "function charMap(str) {\n const charMap={};\n //iterate through each char of string\n for(let char of str.replace(/[^\\w]/g, '').toLowerCase()){\n /* check if key value exist and increment\n else initialize to 1\n */\n if(charMap[char]){\n charMap[char]= charMap[char]+1\n } else{\n charMap[char]= 1;\n }\n }\nreturn charMap;\n}", "title": "" }, { "docid": "eba8316d5cb294fa51f047cd30fe0370", "score": "0.64669865", "text": "function charCount(str){\n let result ={};\n for(let i=0;i<str.length;i++){\n if(/[a-zA-Z0-9]/.test(str[i].toLowerCase())){\n \n console.log(\"ASdadadsads\",result[str[i]] == undefined)\n result[str[i]] = result[str[i]] == undefined ? 1 : ++result[str[i]] \n }\n }\n return result;\n}", "title": "" }, { "docid": "1ef1f4f1c173800d66420a76fac557e2", "score": "0.64587104", "text": "function duplicateCount(text){\n const charCount = text.toLowerCase().split('').reduce((acc, char) => {\n acc[char] = acc[char] + 1 || 1; \n return acc;\n }, {});\n console.log(charCount);\n console.log(Object.keys(charCount));\n return Object.values(charCount).reduce((acc, curr) => curr > 1 ? acc+1 : acc, 0);\n}", "title": "" }, { "docid": "e4e58f0a278d50d179d99263aa3402d2", "score": "0.64571327", "text": "function letterFrequency(txt) {\n const arr = txt.split(\"\"),\n obj = {};\n arr.forEach((val) => {\n if (obj[val]) {\n obj[val]++;\n } else {\n obj[val] = 1;\n }\n });\n return Object.entries(obj).sort();\n}", "title": "" }, { "docid": "ffd0f0619a31167b07028db585ca4688", "score": "0.6441051", "text": "function charactersOccurencesCount(word) \n{\n var letterAndNumber = [];\n \n for(let i = 0; i < word.length; i++)\n {\n for (let j = 0; j < letterAndNumber.length; j++)\n {\n if (word[i] === letterAndNumber[j][0])\n {\n letterAndNumber[j][1]++;\n break;\n }\n else if (word[i] !== letterAndNumber[j][0] && j === letterAndNumber.length - 1)\n {\n letterAndNumber[letterAndNumber.length][0] = word[i];\n letterAndNumber[letterAndNumber.length][1] = 1;\n }\n }\n }\n\n return letterAndNumber;\n}", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.642714", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.642714", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.642714", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "3e9560096ed75fd97f882fbb97610e6b", "score": "0.642714", "text": "function charactersOccurencesCount() {\n \n}", "title": "" }, { "docid": "15a61a72934c8feba646c21d0ed3d6da", "score": "0.64050364", "text": "function charCount(str){\n // do something\n // return an object with keys that are lowercase alphanumeric characters in the string; values should be the counts for those characters in the string\n // only keeping track of lowercased alphanumeric characters \n}", "title": "" }, { "docid": "abbc65988e454a9645272ad3ca5b2a20", "score": "0.6386338", "text": "function charactersOccurencesCount() {\n\n}", "title": "" }, { "docid": "abbc65988e454a9645272ad3ca5b2a20", "score": "0.6386338", "text": "function charactersOccurencesCount() {\n\n}", "title": "" }, { "docid": "abbc65988e454a9645272ad3ca5b2a20", "score": "0.6386338", "text": "function charactersOccurencesCount() {\n\n}", "title": "" }, { "docid": "abbc65988e454a9645272ad3ca5b2a20", "score": "0.6386338", "text": "function charactersOccurencesCount() {\n\n}", "title": "" }, { "docid": "abbc65988e454a9645272ad3ca5b2a20", "score": "0.6386338", "text": "function charactersOccurencesCount() {\n\n}", "title": "" }, { "docid": "4ece4f1d8b51462b4b1174167ecc317f", "score": "0.6365158", "text": "function charCount2(str) {\n var obj = {}\n for (var char of str) {\n if (isAlphaNumeric(char)) {\n char = char.toLowerCase()\n // combine if else to single line\n // obj[char] = obj[char] + 1 or if falsy set equal to one\n obj[char] = ++obj[char] || 1;\n }\n }\n console.log(obj)\n return obj;\n}", "title": "" }, { "docid": "271ef7fb7ca5a89532364506aa80cb9a", "score": "0.63575834", "text": "function charCount(str) {\n let result = {};\n // for (let i = 0; i < str.length; i++) {\n for (let char of str) {\n char = char.toLowerCase();\n if (/[a-z0-9]/.test(char)) {\n if (result[char] > 0) {\n result[char]++;\n } else {\n result[char] = 1;\n } \n }\n }\n return result;\n}", "title": "" }, { "docid": "26d4449ae5242220d1fb5f9be9392258", "score": "0.6354842", "text": "function duplicateCount(text){\n disctinctObj = {}\n dupCount = 0\n\n text.split(\"\").forEach(char => {\n console.log(char.toLowerCase())\n if (!disctinctObj[char.toLowerCase()]) {\n disctinctObj[char.toLowerCase()] = 1\n } else {\n disctinctObj[char.toLowerCase()] += 1\n }\n })\n\n for (key in disctinctObj) {\n if (disctinctObj[key] > 1) {\n dupCount += 1\n }\n }\n return dupCount\n }", "title": "" }, { "docid": "7f8678cbc89bdeecbb7fe33a4ba424af", "score": "0.6322537", "text": "function charFreq(word) {\n var freqListing = {};\nvar charArray=word.split('');\nfor (var i = 0; i<charArray.length; i ++){\n if (freqListing[charArray[i]]){\n freqListing[charArray[i]]+=1;\n }else{\n freqListing[charArray[i]]=1;\n }\n}\nreturn freqListing;\n}", "title": "" }, { "docid": "4feb704dd32aeca7ca872a9301e643a1", "score": "0.63183343", "text": "updateWordMap(word, wordMap, letter) {\n for (let i = 0; i < word.length; i++) {\n if (word[i] === letter) {\n wordMap[i] = letter;\n }\n }\n return wordMap;\n }", "title": "" }, { "docid": "2e79074cc91764abb095a871e197e4b2", "score": "0.62937623", "text": "function charCount3(str) {\n let result = {};\n for (let char of str) {\n char = char.toLowerCase();\n if (/[a-z0-9]/.test(char)) {\n result[char] = result[char]++ || 1;\n }\n }\n return result;\n}", "title": "" }, { "docid": "e66e4e49ca89c55a67129a7ca23fd9a5", "score": "0.62922585", "text": "function charCount1(str) {\n// make object to return at end\n let result = {};\n// loop over string, for each character\n for (let i = 0; i < str.length; i++) {\n let char = str[i].toLowerCase();\n //if the char is a number/letter and is a key in object, add one to count\n if (result[char] > 0) {\n result[char]++;\n } \n //if the char is not a number/letter and not a an object, add it and set value to 1\n else {\n result[char] = 1;\n }\n //if char is something (space, period, etc), don't do anything\n}\n// return object at end\nreturn result;\n}", "title": "" }, { "docid": "2522b46eb22c0d09ac7b588ca6e7c3b5", "score": "0.62868536", "text": "function charCount3(str) {\n let result = {};\n for(let char of str) {\n char = char.toLowerCase();\n if(/[a-z0-9]/.test(char)) {\n if(result[char] > 0 ) {\n result[char]++;\n } else {\n result[char] = 1;\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "86fb98a5b2e04c20f004c64b621920ee", "score": "0.6254806", "text": "function storeNumberOfOccurrencesInAWord(text){\r\n\tvar my_array=text.split(\" \");\r\n\tvar freqDict=new Dictionary();\r\n\tfor(var i=0;i<my_array.length;i++)\r\n\t{\r\n\t\tif(freqDict.find(my_array[i])==undefined)\r\n\t\t{\r\n\t\t\tfreqDict.add(my_array[i],1);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tfreqDict.add(my_array[i],freqDict.find(my_array[i])+1);\r\n\t\t}\t\r\n\t\t\r\n\t}\r\n\treturn freqDict;\r\n\r\n}", "title": "" }, { "docid": "f539da2b6a0d56801337a5eb8b384a9a", "score": "0.6246981", "text": "function countLetters (s) {\n return s.split('')\n .filter(c => c !== '-')\n .reduce((counts, c) => {\n const count = counts[c] || 0\n return Object.assign(counts, { [c]: count + 1 })\n }, {})\n}", "title": "" }, { "docid": "622eaa87070996e706be3032859eca5d", "score": "0.62384874", "text": "function charCount(str) {\n var result = {};\n for(let i = 0; i < str.length; i++) {\n var char = str[i].toLowerCase();\n if(/[a-z0-9]/.test(char)){ //this regular expression filters for alphanumeric\n if(result[char] > 0) {\n result[char]++;\n } else {\n result[char] = 1;\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "14633ccc4929a925d243ecef4e5eee35", "score": "0.6234578", "text": "function commonLetter(word,guess){\n\tlet count = 0;\n\tlet map = [];\n\tfor (let letter of word) {\n\t\tif (!map[letter]){\n\t\t\tmap[letter] = 0;\n\t\t}\n\t\tmap[letter]++;\t\n\t}\n\t//console.log(map);\n\tfor (let i = 0; i < guess.length; i++) {\n\t\tif ( map[guess[i]] && map[guess[i]] != 0) {\n\t\t\tmap[guess[i]]--;\n\t\t\tcount++;\n\t\t}else{\n\t\t\tcontinue;\n\t\t}\n\t}\n\t//console.log(map);\n\treturn count;\n}", "title": "" }, { "docid": "6dbe71194cbc08cc6b34d0354d51c1f0", "score": "0.62188745", "text": "function letterOccurencesInString(word, letter) {\n let counter = 0;\n for (let a of word) {\n if (a === letter) {\n counter++\n }\n }\n console.log(counter);\n}", "title": "" }, { "docid": "fa7124edc7fe487c74d9648560625f5d", "score": "0.621505", "text": "function numOfOccurences(letter)\n{\n let counter = 0;\n let word = document.getElementsByClassName(\"join-message\");\n word = word[0].innerText;\n for(let i=0;i<word.length;i++)\n {\n if(letter.toLowerCase() == word[i].toLowerCase()) counter++;\n }\n return counter;\n}", "title": "" }, { "docid": "6468187f17a44a57d76f0bad067d9f97", "score": "0.61996853", "text": "function charCount(string3, letter) {\n let letterCount = [];\n for (let i = 0; i < string3.length; i++) {\n if (string3[i] === letter) {\n letterCount ++;\n }\n }\n let output5 = `Occurrences of \"${letter}\": ${letterCount}`;\n console.log(output5);\n}", "title": "" }, { "docid": "21f159d16537d28e81adab334814bdb5", "score": "0.6189608", "text": "function charCount(str) {\n let obj = {}\n for (let char of str) {\n if(isAlphaNumberic(char)) {\n char = char.toLowerCase()\n obj[char] = ++obj[char] || 1\n }\n }\n return obj\n}", "title": "" }, { "docid": "8ad20d74cb76c78f00314f320acf18c1", "score": "0.61835206", "text": "function charCount(str) {\n //make object to return at end\n var result = {}\n //loop over string, for each caracter\n for (var i = 0; i < str.length; i++) {\n // make keys lowercase\n var char = str[i].toLowerCase()\n //if the char is a number/letter AND key in object, add one to count\n // (check to see if input is alphanumeric)\n if (/[a-z0-9]/.test(char)) {\n if (result[char] > 0) {\n result[char]++\n }\n //if the char is a number/letter AND is not in object, add it and set value to 1\n else {\n result[char] = 1;\n };\n }\n }\n //if the char is something else (space, period, etc) dont do anything\n //return object at end\n console.log(result)\n return result;\n}", "title": "" }, { "docid": "84b0d11b6ebd9951541630d7ff3fd6e9", "score": "0.6174413", "text": "function charCount(str) {\n let obj = {};\n for (let char of str) {\n char = char.toLowerCase();\n if (/[a-z0-9]/.test(char)) {\n if (obj[char] > 0) {\n obj[char]++;\n } else {\n obj[char] = 1;\n };\n }\n }\n return obj;\n}", "title": "" }, { "docid": "20fa0c1db7bc457b62569323894a90f1", "score": "0.61727226", "text": "function LetterCountI(str){\n // remove special characters from string\n str = str.replace(/[&\\!/\\\\#,+()$~%.:*?<>{}]/g, '');\n var strNew = [];\n // str to array\n var strArray = str.split(' ');\n // loop through each word of array\n for (var x = 0; x < strArray.length; x++) {\n var newWord = \"\";\n // declare variable for each word of strArray\n var strArrayWord = strArray[x];\n // loop through each letter of each word of strArray\n for (var y = 0; y < strArrayWord.length; y++) {\n // declare variable for letter this loop\n var letterThisLoop = strArrayWord[y];\n // use indexOf to determine if letter has been repeated \n if (newWord.indexOf(letterThisLoop) > -1) {\n return strArray[x];\n }\n newWord += letterThisLoop;\n }\n strNew.push(newWord);\n }\n return -1;\n}", "title": "" }, { "docid": "02151388937efc3b5bd366ca065f8e7c", "score": "0.6172067", "text": "function charCount(str) {\n let obj = {}\n for(let i = 0; i < str.length; i++) {\n let char = str[i].toLowerCase()\n if (/[a-z0-9]/.test(char)) {\n if(obj[char] > 0) {\n obj[char]++\n } else {\n obj[char] = 1\n }\n }\n }\n return obj\n}", "title": "" }, { "docid": "72340ead204e528e8755a41272554a7c", "score": "0.61543876", "text": "function charCount(str) {\n let result = {}\n for (let char of str) {\n char = char.toLowerCase()\n if (/[a-z0-9]/.test(char)) {\n if (result[char] > 0) {\n result[char]++\n } else {\n result[char] = 1\n }\n }\n }\n return result\n}", "title": "" }, { "docid": "d9214b2aee3d668113dffc8565206bd6", "score": "0.61454487", "text": "function charCount(str) {\n //make object to return at end\n let result = {}\n //loop over string, for each character\n for (let i = 0; i < str.length; i++) {\n let char = str[i].toLowerCase()\n //if the char is a num/letter && is a key in object, add one to count\n if (result[char] > 0) {\n result[char]++;\n //if the char is a num/letter && not in object, add it to object and set value to 1\n } else {\n result[char] = 1;\n }\n }\n //if char is something else (space, period, etc.) don’t do anything\n //return object at end\n return result;\n}", "title": "" }, { "docid": "47c4942414fd1fac252e34a4bb87d142", "score": "0.6144102", "text": "function countLetters(counter, sample_text) {\n let lower = sample_text.toLowerCase();\n if (sample_text.length === 0) {\n return;\n }\n let addLetters = lower.charAt(0);\n if ([addLetters]) {\n counter[addLetters]++;\n }\n countLetters(counter, lower.slice(1));\n}", "title": "" }, { "docid": "ab0994c97859ce2f328990a68e59b5e2", "score": "0.61420023", "text": "function getLetterCounts(board) {\n const count = {X: 0, O: 0};\n board.forEach(function(ele) {\n if (ele === 'X') {\n count.X ++;\n }\n else if (ele === 'O') {\n count.O ++;\n }\n });\n return count;\n}", "title": "" }, { "docid": "50efc378f6f578830b73c5d22bdf59c8", "score": "0.61413705", "text": "function process_string(string) {\n const alph = \"abcdefghijklmnopqrstuvwxyz\";\n let hash_table = {};\n\n for (let i = 0; i < string.length; i++) {\n let char = alph.indexOf(string[i]);\n if (i === 0) {\n hash_table[i] = new Array(26).fill(0);\n hash_table[i][char]++;\n } else {\n hash_table[i] = hash_table[i - 1].slice(0);\n hash_table[i][char]++;\n };\n };\n return hash_table;\n}", "title": "" }, { "docid": "f5a132f847f31ff1125ffa82f9f5c803", "score": "0.61295307", "text": "function makeData(val){\n let data = []\n const arr = Array.from(val).sort()\n arr.map(l => {\n if(!data.find(d => d.letter === l)){\n data.push({ letter: l, count: 1 })\n } else {\n data.find(d => {\n if(d.letter === l){\n d.count++\n }\n })\n }\n })\n return data\n}", "title": "" }, { "docid": "f8caf116c9dacb6ee5710f1516648302", "score": "0.61243266", "text": "function charCount(str) {\n var result = {};\n for(let eachChar of str){\n if(isAlphaNumeric(eachChar)){ //see function below\n eachChar = eachChar.toLowerCase();\n result[eachChar] = ++result[eachChar] || 1;\n }\n }\n return result;\n}", "title": "" }, { "docid": "7c11f11551ec3fc6e7e4f93dfe07ec2d", "score": "0.6114687", "text": "function charCounting(string) {\n const result = {};\n for (let character of string) {\n character = character.toLowerCase();\n if (/[a-z0-9]/.test(character)) {\n obj[character] = ++obj[character] || 1;\n };\n }\n return result\n}", "title": "" }, { "docid": "a3cea9e875858dc026d938c329c30cf1", "score": "0.61125344", "text": "function wordObj(str) {\n let counterObj = {}; \n\n for (let i = 0; i < str.length; i ++) {\n let char = str[i]; \n\n if (counterObj[char]) {\n counterObj[char] += 1; \n } else {\n counterObj[char] = 1; \n }\n }\n return counterObj;\n}", "title": "" }, { "docid": "6176c8ff73cbf296b28d46e23c3379b7", "score": "0.6111036", "text": "function collectAndSetChars() {\n var charsS = new Set();\n var charsA;\n var cc;\n dictionary.reset();\n println(\"collecting chars…\");\n while (!dictionary.eof()) {\n cc = dictionary.data[1].charCodeAt(dictionary.data[0]);\n if (cc === 45 || cc >= 65) {\n charsS.add(cc);\n }\n dictionary.data[0] += 1;\n }\n charsA = Array.from(charsS);\n charsA.sort((a, b) => a - b);\n charsA.forEach(function setChar(cc) {\n var c = String.fromCharCode(cc);\n var i = xint[cc];\n if (i === undefined) {\n if (c === c.toUpperCase()) {\n //c is upperCase -> try lowerCase\n i = xint[c.toLowerCase().charCodeAt(0)];\n } else if (c.toUpperCase().length === 1) { //test for length is necessary because \"ß\".toUpperCase() -> \"SS\"\n //c ist lowerCase -> try upperCase\n i = xint[c.toUpperCase().charCodeAt(0)];\n }\n if (i === undefined) {\n i = xext.push(c.toLowerCase()) - 1;\n xint[cc] = i;\n xclass[cc] = letter_class;\n } else {\n //other case already exists:\n xint[cc] = i;\n xclass[cc] = letter_class;\n }\n }\n });\n xdig = xext.slice(0, 10);\n cmax = xext.length - 1;\n cnum = xext.length;\n}", "title": "" }, { "docid": "9d49d89403db96a1242ef4b826e9b176", "score": "0.60961896", "text": "function charCount2(str) {\n let result = {};\n for ( let i = 0; i < str.length; i++) {\n let char = str[i].toLowerCase();\n if(/[a-z0-9]/.test(char)) {\n if(result[char] > 0) {\n result[char]++;\n } else {\n result[char] = 1;\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "8a09a2f9f17364fa3799f414b1831996", "score": "0.60841936", "text": "function charCount(str) {\n let obj = {};\n for (let i = 0; i < str.length; i++) {\n let char = str[i].toLowerCase();\n if (/[a-z0-9]/.test(char)) {\n if (obj[char] > 0) {\n obj[char]++;\n } else {\n obj[char] = 1;\n };\n }\n }\n return obj;\n}", "title": "" }, { "docid": "ba114b5f7de4161a47a100550afa60af", "score": "0.6079254", "text": "function countOccurrences(wordArr) {\n let wordObj = {};\n\n wordArr.forEach(word => {\n wordObj[word] = wordObj[word] || 0;\n wordObj[word] += 1;\n }) \n \n logOccurrences(wordObj);\n return undefined;\n}", "title": "" }, { "docid": "ca8e77a57bb2d69e9cf4268a35cbaab7", "score": "0.6071945", "text": "function countLetter(letter,word){\n var count = 0;\n for(i=0 ; i < word.length ; i++){\n if(letter === word[i]){\n count++;\n }\n }\n return count; \n }", "title": "" }, { "docid": "742db3a7d222e7abdfba5086e2d65a0f", "score": "0.6063115", "text": "function charCount(str) {\n var result = {};\n for(let eachChar of str){\n eachChar = eachChar.toLowerCase();\n if(/[a-z0-9]/.test(eachChar)){ //this regular expression filters for alphanumeric\n result[eachChar] = ++result[eachChar] || 1;\n }\n }\n return result;\n}", "title": "" }, { "docid": "09c29f99bb415c0de331c7c26ff1a3ed", "score": "0.6054569", "text": "function freqCounter(str) {\n const freq = new Map();\n\n for (let el of str) {\n let elCount = freq.get(el) || 0;\n freq.set(el, elCount + 1);\n }\n return freq;\n}", "title": "" }, { "docid": "a6ed29d0ce1264444bfadf9f2b5106d2", "score": "0.60429966", "text": "set countLetters(y) {\r\n\t\tthis.numLetters =+ y;\r\n\t}", "title": "" }, { "docid": "f9309b10a5ad3901b63159c90752367e", "score": "0.60395634", "text": "function alphaCount(alphabet, text) {\n var alphabet = alphabet.toLowerCase();\n var text = text.toLowerCase();\n var result = [];\n for (i = 0; i < alphabet.length; i++) {\n var counter = 0;\n for (j = 0; j < text.length; j++) {\n\n if (text[j] === alphabet[i]) {\n counter = counter + 1;\n }\n }\n if (counter !== 0) {\n result.push(alphabet[i] + \":\" + counter);\n }\n }\n\n return String(result);\n}", "title": "" }, { "docid": "adbdfcfd29d7dd29519ea69fef4aaf5a", "score": "0.6027561", "text": "function charCount(str) {\n // Make object to return at the end\n const result = {};\n // Loop over the string, for each character...\n for (let i = 0; i < str.length; i++) {\n let char = str[i].toLowerCase();\n // if the character is a number/letter AND key in the object, add 1 to count\n if (/[a-z0-9]/.test(char)) {\n if (result[char] > 0) {\n result[char]++;\n // if the character is a number/letter AND not a key in the object, add it and set value to 1\n\n } else {\n result[char] = 1;\n };\n };\n }\n // if character is something else (space, period, etc) dont do anything\n // return object at the end\n return result;\n}", "title": "" }, { "docid": "2f22dde2fa47ff111f194f1edf2acaba", "score": "0.60248226", "text": "function vowelCount(str) {\n\tvar splitArr = str.toLowerCase().split(\"\");\n\tvar vowels = 'aeiou';\n\tvar obj = {};\n\n\tsplitArr.forEach(function(letter){\n\t\tif(vowels.indexOf(letter) !== -1) {\n\t\t\tif(obj[letter]) {\n\t\t\t\tobj[letter]++;\n\t\t\t} else {\n\t\t\t\tobj[letter] = 1;\n\t\t\t}\n\t\t}\n\t});\n\treturn obj;\n}", "title": "" }, { "docid": "cb64b22027478b08c3a10ae43990b1ff", "score": "0.60231245", "text": "function charCount(str){\n let result = {};\n\n for(var i = 0;i < str.length; i++){\n let char = str[i];\n if(result[char]){\n result[char]++;\n }\n else{\n result[char] = 1;\n }\n }\n return result;\n }", "title": "" }, { "docid": "10fdad1be4435b371e0e417521c7013c", "score": "0.6021002", "text": "function countOccurences(array, limit) {\n var result = {};\n array.forEach(function(element) {\n // Check if word has 2 letters or more\n if(element.length >= limit) {\n if(element in result) {\n // Increment if the word is already in the object\n result[element] = ++result[element];\n } else {\n // Push the word in the object\n result[element] = 1;\n }\n }\n });\n return result;\n}", "title": "" }, { "docid": "13c924976f7f48c4e8dbf7e8d628cff7", "score": "0.6017384", "text": "function countOcc (str,letter) {\n\tvar count = 0;\n\tfor (var i = 0 ; i< str.length; i++){\n\t\tif (str[i] === letter) {\n\t\t\tcount ++; \n\t\t}\n\t}\n\treturn count; \n}", "title": "" }, { "docid": "afbc2d2f997fd8424e7019b468df2183", "score": "0.6016886", "text": "function vowelCount(str) {\n let splitArr = str.split(\"\")\n let obj = {};\n const vowels = 'aeiou';\n\n splitArr.forEach(function(val) {\n let lowerCasedLetter = val.toLowerCase();\n if(vowels.indexOf(lowerCasedLetter) !== -1) {\n if (obj[lowerCasedLetter]) {\n obj[lowerCasedLetter]++;\n } else {\n obj[lowerCasedLetter] = 1;\n }\n }\n })\n\n}", "title": "" }, { "docid": "89bcf77bc8c285ba1f18b018d510c91f", "score": "0.60131884", "text": "function sherlockAndAnagrams(s) {\n \n var map = new Map();\n var totalCount = 0;\n\n for(var i = 0 ; i < s.length; i++) {\n for(var j=i+1 ; j <= s.length; j++) {\n var SubString = s.substring(i,j);\n\n var chars = [...SubString];\n chars.sort();\n \n SubString = String(chars);\n\n if(map.has(SubString)) {\n var value = map.get(SubString);\n totalCount = totalCount + value;\n\n map.set(SubString, value+1);\n } \n else {\n map.set(SubString, 1);\n }\n }\n }\n return totalCount;\n\n\n}", "title": "" }, { "docid": "5c8554199e03ee2fda663b1c0b110704", "score": "0.5995946", "text": "function countCharacters(string){\n const temp = {}\n const tempStringArray = string.split(\"\");\n tempStringArray.forEach((item) =>{\n temp.hasOwnProperty(item) ? temp[item] += 1 : temp[item] = 1;\n })\n\n\n return temp;\n }", "title": "" }, { "docid": "3689d82205bcffaa19e98389a1c3dddb", "score": "0.59924525", "text": "function letOccur(str, a){\n var countletter = 0;\n \n for (var i=0; i < str.length; i++) {\n if (str[i] === a) {\n countletter ++\n }\n }\n return countletter;\n}", "title": "" }, { "docid": "bbfa9c586c5074b61026510088829f12", "score": "0.5985528", "text": "function countTheLettersAndDigit(str) {\n let result = {};\n let letters = 0;\n let digits = 0;\n for (let i = 0; i < str.length; i++) {\n let reL = /[a-z]/gi;\n let reD = /[0-9]/g;\n if (reL.test(str[i])) {\n letters++;\n } else if (reD.test(str[i])) {\n digits++\n }\n\n }\n result['LETTERS'] = letters;\n result['DIGITS'] = digits\n return result;\n}", "title": "" }, { "docid": "145b8838e6ee69b6c8631a49b1f718a9", "score": "0.5978828", "text": "function countOccurrences(string, letter) {\n let occurrences = 0;\n for (let i = 0; i < string.length; i++) {\n if (string[i] === letter) occurrences++\n }\n return occurrences\n}", "title": "" }, { "docid": "546b5697e77a537fb0429691bd33b934", "score": "0.59730434", "text": "function letterCounter (x) {\n\t return x.replace(/[^a-zA-Z]/g, '').length;\n\t}", "title": "" }, { "docid": "7d85b0ea46687de630ac70bc883070a3", "score": "0.59636354", "text": "function totalLetterCount(array) {\n return array.length;\n }", "title": "" } ]
8289843d5ca5cb6d9254ecee4bb5208a
Configure the viewport to follow the player's character
[ { "docid": "d4f9d71fc29401a77252481654377ecd", "score": "0.7045719", "text": "setupCamera() {\n let offsetX = -(this.game.scale.width / 2) + GAMESETTINGS.player.initialX * GAMESETTINGS.scaleFactor;\n let offsetY = -(this.game.scale.height / 2) + GAMESETTINGS.player.initialY * GAMESETTINGS.scaleFactor;\n\n this.viewport = this.cameras.main;\n this.viewport.startFollow(\n this.player,\n true,\n 1, 0,\n offsetX, offsetY\n );\n }", "title": "" } ]
[ { "docid": "2fe19f0a9ede2d148890b19a7cd3dce3", "score": "0.61209947", "text": "function setPlayerPos() {\n player.x = HUD_WIDTH + (WIDTH - HUD_WIDTH)/2;\n player.y = 600;\n}", "title": "" }, { "docid": "d097ddd67dc5e02d3564c76f1ed6cf30", "score": "0.61164963", "text": "constructor() {\n this._viewport = { offset: { x: 0, y: 0 } };\n }", "title": "" }, { "docid": "7ef3ba89079593069ac4d0ebe7e6fa0e", "score": "0.6115759", "text": "constrain() {\n this.pos.x = constrain(user.pos.x, 0 - this.r, 6000 - this.r);\n this.pos.y = constrain(user.pos.y, 0 + this.r, 6000 - this.r);\n }", "title": "" }, { "docid": "e71dd71de97544109aa1700821964d6a", "score": "0.60498315", "text": "function resizeAndCenter() {\n\trenderer.resize(window.innerWidth, window.innerHeight);\n \tcam.x = -(window.innerWidth - 960) / 2;\n \tcam.y = -(window.innerHeight - 560) / 2;\n}", "title": "" }, { "docid": "29bd1a21b731da554122bcc1f541e781", "score": "0.6020804", "text": "updateCameraPosition() {\n const targetPivot = new PIXI.Point(\n this.followedObject.x - Game.app.renderer.width / 2,\n this.followedObject.y - Game.app.renderer.height / 2,\n );\n this.world.pivot.copyFrom(targetPivot);\n }", "title": "" }, { "docid": "f9d4005a5d87c22559e23f47adee3dec", "score": "0.6016176", "text": "viewport() {\n let viewport = this.camera.rect;\n\n this.viewer.gl.viewport(viewport[0], viewport[1], viewport[2], viewport[3]);\n }", "title": "" }, { "docid": "3b3ad0d9464c4b935c4d6a835655ea75", "score": "0.6014085", "text": "setViewPort() {\n gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\n }", "title": "" }, { "docid": "089b84799763df9483d42036b4e57af5", "score": "0.5989305", "text": "function setAssistantWindowPosition() {\r\n ipcRenderer.send('set-assistant-window-position');\r\n}", "title": "" }, { "docid": "22387348e86fdcb75864c43bdb0336ba", "score": "0.5941503", "text": "function initCamera()\n{\n\tcamera = new THREE.PerspectiveCamera(90, window.innerWidth / window.innerHeight, 0.01, 100000);\n\tcamera.position.set(0, 5, -10);\n\tcamera.aspect = 2;\n\tcamera.lookAt(character.position);\n}", "title": "" }, { "docid": "831256e23b6b9270ea6324aa38e3e5db", "score": "0.5874684", "text": "function setup(){\n createCanvas(windowWidth, windowHeight);\n playerX = width/2\n playerY = height-150;\n dx = 9;\n dy = 9;\n}", "title": "" }, { "docid": "e022ab89148d109f6029a3e2147b8b78", "score": "0.58431107", "text": "function updateCamera() {\n camera.position.y = CAMERA_Y - window.scrollY * SCROLL_SPEED / 50.0\n}", "title": "" }, { "docid": "31422d0f5cd0eb9fbdeb505957c313ac", "score": "0.5813729", "text": "function updateCamera() {\n\tcamera.x = player.x.position - width * 0.5;\n\tcamera.y = player.y.position - height * 0.5;\n}", "title": "" }, { "docid": "9f3e1225893417ced3759ac005ebc7e4", "score": "0.57950354", "text": "setDimensions() {\n this.pixelsPerSpaceUnit = window.innerWidth / this.gameEngine.spaceWidth;\n if (window.innerHeight < game.spaceHeight * this.pixelsPerSpaceUnit) {\n this.pixelsPerSpaceUnit = window.innerHeight / game.spaceHeight;\n }\n this.viewportWidth = game.spaceWidth * this.pixelsPerSpaceUnit;\n this.viewportHeight = game.spaceHeight * this.pixelsPerSpaceUnit;\n }", "title": "" }, { "docid": "02241261a39aabd9e6242874d423e056", "score": "0.57907414", "text": "setPlayerStartPosition() {\n this.x = Helper.playerStartPositionX;\n this.y = Helper.playerStartPositionY;\n }", "title": "" }, { "docid": "d41529a2f3dd0d7555d5ec36375490b5", "score": "0.57857084", "text": "function setPolarisView (){\t\n\tvar scene = graphDiv._fullLayout.scene._scene;\n\tvar camera = scene.getCamera();\n\tcamera.eye = {x:-1.75,y:0,z:0,};\n\tscene.setCamera(camera);\n}", "title": "" }, { "docid": "29dd5e683cb88afe3f2cdc529b6060f0", "score": "0.5785408", "text": "function setViewport(x,y)\n{\n\tif((x > 0)&&(x < heightmap.width-viewport.size)) {\n\t\tviewport.x = x;\n\t}\n\t\n\tif((y > 0)&&(y < heightmap.height-viewport.size)) {\n\t\tviewport.y = y;\n\t}\n}", "title": "" }, { "docid": "419f50fb37ae079fc06a542b1490ad52", "score": "0.57665324", "text": "function setPos(params) {\n\tvar params = params || {};\n\tCamera.duration = 0;\n\tCamera.easing = platino.ANIMATION_CURVE_LINEAR;\n\tCamera.lookAt_eyeX = params.eyeX || params.centerX;\n\tCamera.lookAt_centerX = params.centerX;\n\tCamera.lookAt_eyeY = params.eyeY || params.centerY;\n\tCamera.lookAt_centerY = params.centerY;\n\tCamera.lookAt_eyeZ = params.eyeZ;\n\tCamera.skipOnComplete = params.skipOnCompleteListener || false;\n\tgame.moveCamera(Camera);\n}", "title": "" }, { "docid": "40c1de2ab59ed26c670fce5af968671f", "score": "0.5758097", "text": "function Start () {\n\t\ttransform.position.x = -1.0f*(parseFloat(Screen.width)/parseFloat(Screen.height)*ratio+adjustment);\n\t}", "title": "" }, { "docid": "6acb5d6f910bee7f92c47bc80a25d418", "score": "0.5741457", "text": "move() {\n // Update position\n //Since I created a foreground that I want my playable character to interact with, I constrained its movement\n // to the dimensions of the foreground (minus width and height of player)\n this.x += this.vx;\n this.x = constrain(this.x, 0, 940);\n this.y += this.vy;\n}", "title": "" }, { "docid": "6a18656f470be0a8c34d99fc01ac65fc", "score": "0.5736346", "text": "function setupCamera(){\n const near = 0.1;\n const far = 1000;\n const camera = new THREE.OrthographicCamera(-canvas.width, canvas.width, canvas.height, -canvas.height, near, far);\n this.camera = camera;\n camera.zoom = 2;\n camera.position.set(52.5, 25, -52.5);\n camera.rotation.x = 0.71681469;\n camera.rotation.y = 2.5;\n camera.rotation.z = 5.83362938;\n }", "title": "" }, { "docid": "a941f6dd8ba895782657e8cfb34b868b", "score": "0.5732681", "text": "function configureCameraSettings(){\n camera = new THREE.PerspectiveCamera( 10, window.innerWidth / window.innerHeight, 1, 4000 );\n camera.position.z = 2750;\n renderer = new THREE.WebGLRenderer({ antialias: true });\n renderer.setPixelRatio( window.devicePixelRatio );\n renderer.setSize( window.innerWidth, window.innerHeight );\n controls = new THREE.OrbitControls( camera, renderer.domElement );\n container.appendChild( renderer.domElement );\n window.addEventListener( 'resize', onWindowResize, false );\n }", "title": "" }, { "docid": "ae545313e68a74a20371124f598f1d50", "score": "0.5730589", "text": "function Viewport() {\n this.x = this.y = 0;\n this.scale = 1;\n this.callerScale = 1.0;\n this.canvasBoundry = 400; /* Same as reloadDistance really. */\n}", "title": "" }, { "docid": "4c33a2efe18b5bb2e3eae5782468f554", "score": "0.5729984", "text": "setCentredPos() {\n this.pos = {\n x: window.innerWidth / 2 - this.size.width / 2,\n y: window.innerHeight / 2 - this.size.height / 2,\n };\n }", "title": "" }, { "docid": "20cc4e4ce03770e19df12dad18e92fa6", "score": "0.56998223", "text": "WorldToViewportPoint() {}", "title": "" }, { "docid": "1bf86501453cf97cc30303e25bfcb20f", "score": "0.56478274", "text": "function setupCamera() {\n camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.set(3, 4, 5);\n camera.lookAt(new THREE.Vector3(0, 0, 0));\n angleCamera();\n }", "title": "" }, { "docid": "53f41cd49417fc9f1f49e7b365eca07e", "score": "0.5642864", "text": "repositionCamera() {\r\n let y1 = -1.3 * packit.cameraDistanceFactor * this.bounds.boundingSphere.radius / (Math.tan(Math.PI * this.camera.fov / 360));\r\n let y2 = -1.1 * packit.cameraDistanceFactor * this.bounds.boundingSphere.radius / (this.camera.aspect * Math.tan(Math.PI * this.camera.fov / 360));\r\n this.camera.position.y = Math.min(y1,y2);\r\n this.camera.lookAt(new THREE.Vector3(0,0,0));\r\n }", "title": "" }, { "docid": "0cabeb91cbfddc8296c1e9e8559bb938", "score": "0.56345874", "text": "ScreenToViewportPoint() {}", "title": "" }, { "docid": "90ec46a6614afd6fa345323c6a43a65e", "score": "0.5634099", "text": "function setupFollowWindow () {\n document.addEventListener('mousemove', function (e) {\n window.moveTo(e.screenX - (WIN_WIDTH / 2), e.screenY - (WIN_HEIGHT / 2))\n })\n}", "title": "" }, { "docid": "6d97bcbef2ff140386285faa1d0b0916", "score": "0.5631612", "text": "function changeCameraView(e) {\n var movementX = e.movementX ||\n e.mozMovementX ||\n e.webkitMovementX ||\n 0;\n var movementY = e.movementY ||\n e.mozMovementY ||\n e.webkitMovementY ||\n 0;\n yAxisRot += movementX * lookSpeed * 0.005;\n xAxisRot += movementY * lookSpeed * 0.005;\n}", "title": "" }, { "docid": "84d3b28d3172dd3e4df9684eabd58404", "score": "0.5607689", "text": "update() {\n this.gl.clear(this.gl.COLOR_BUFFER_BIT)\n // Mapping from clip-space coords to the viewport in pixels\n this.gl.viewport(0, 0, this.canvas.width, this.canvas.height)\n }", "title": "" }, { "docid": "22561042dee576b5f8cc0d92b5d48702", "score": "0.5605322", "text": "resize() {\r\n this.renderer.setSize(this.container.clientWidth, this.container.clientHeight);\r\n this.renderer.setViewport(0, 0, this.container.clientWidth, this.container.clientHeight);\r\n this.camera.aspect = this.container.clientWidth / this.container.clientHeight;\r\n this.camera.updateProjectionMatrix();\r\n this.controller.repositionCamera();\r\n }", "title": "" }, { "docid": "d67afda6339617d8fb2807831f515401", "score": "0.56040025", "text": "function updateCamera() {\n // Corrects the \"camera\" from scrolling outside the x-bounds of the level\n activeLevel.x = HALF_SCREEN_WIDTH - player.x;\n if (player.x - HALF_SCREEN_WIDTH < 0) activeLevel.x = 0;\n if (player.x + HALF_SCREEN_WIDTH > activeLevel.actualWidth) activeLevel.x = SCREEN_WIDTH - activeLevel.actualWidth;\n\n // Corrects the \"camera\" from scrolling outside the y-bounds of the level\n activeLevel.y = HALF_SCREEN_HEIGHT - player.y;\n if (player.y - HALF_SCREEN_HEIGHT < 0) activeLevel.y = 0;\n if (player.y + HALF_SCREEN_HEIGHT > activeLevel.actualHeight) activeLevel.y = SCREEN_HEIGHT - activeLevel.actualHeight;\n}", "title": "" }, { "docid": "4483718961cb48c8df7145aa2e6d546f", "score": "0.5597937", "text": "function initCamera () {\n camera = new THREE.PerspectiveCamera(70, worldCanvas.width / worldCanvas.height, 1, 1000);\n camera.position.y = 1.75;\n camera.position.z = 1.5;\n}", "title": "" }, { "docid": "6de3fe078a2925b1010db41d0e411842", "score": "0.55695647", "text": "function Viewport() {}", "title": "" }, { "docid": "14db52ab79a96829e85dda6b6d565bbb", "score": "0.55614847", "text": "function setupCamera() {\r\n\t\t//console.log(GameLogic.angle);\r\n\t\tmat4.identity(wvMatrix);\t\t\r\n\t\tmat4.rotate(wvMatrix, wvMatrix, GameLogic.getAngle()-Math.PI/2, [0,1,0,0]); \r\n\t\tmat4.translate(wvMatrix, wvMatrix, vec4.fromValues(-GameLogic.getLocation()[0],-1, -GameLogic.getLocation()[1], 0));\r\n\t}", "title": "" }, { "docid": "6edc2d9cb31d3b555a51ba74b54f970a", "score": "0.55577016", "text": "function drawCamera() {\r\n\t\tvar x = translate ( ci * SQUARESIZE ); \t\r\n\t\tvar z = translate ( cj * SQUARESIZE ); \t\r\n\t\tvar y = agentFloor+350;\t\t\t// set the camera above Bugs Bunny\r\n\t\t\r\n\t\tthecamera.position.x = x;\r\n\t\tthecamera.position.y = y;\r\n\t\tthecamera.position.z = z;\r\n\t\tthreeworld.scene.add(thecamera);\r\n \r\n\t\tthreeworld.follow.copy ( thecamera.position );\r\n\t}", "title": "" }, { "docid": "bcee6b6ff5538e4707e0356a3b0dc675", "score": "0.55515915", "text": "function setupCamera(){\n var near = 1;\n var far = 700;\n var someStrangeFactor = 5;\n var left = window.innerWidth / - someStrangeFactor;\n var right = window.innerWidth / someStrangeFactor;\n var top = window.innerHeight / someStrangeFactor;\n var bottom = window.innerHeight / - someStrangeFactor;\n if(!camera){\n camera = new THREE.OrthographicCamera(left, right, top, bottom, near, far );\n }else{\n camera.left = left;\n camera.right = right;\n camera.top = top;\n camera.bottom = bottom;\n }\n }", "title": "" }, { "docid": "8a317a1baba16e6842106397c47bacc7", "score": "0.55466926", "text": "function newPos() {\n player.x += player.dx;\n player.y += player.dy;\n\n detectWallCollision();\n}", "title": "" }, { "docid": "b54fe6bb90e6844e76d20c6fc8fd6f4f", "score": "0.55464315", "text": "function ViewportScrollPosition() { }", "title": "" }, { "docid": "0e80ea3a3a308c3ddd3b269c8d148c4e", "score": "0.55424917", "text": "function draw() {\n if (!freecam && !fixed_camera.used) {\n //3rd person view\n let eye = character.localToGlobal([0, 220, -180]);\n let center = character.localToGlobal([0, 180, 100]);\n\n vec3.lerp(eye, camera.position, eye, 0.1);\n vec3.lerp(center, camera.target, center, 0.1);\n\n eye = walk_area.adjustPosition(eye); //retain the cam inside*\n camera.lookAt(eye, center, [0, 1, 0]);\n }\n\n\n var parent = canvas.parentNode;\n var rect = parent.getBoundingClientRect();\n canvas.width = rect.width;\n canvas.height = rect.height;\n camera.perspective(camera.fov, canvas.width / canvas.height, 0.1, 1000); //to render in perspective mode\n\n //clear\n gl.viewport(0, 0, canvas.width, canvas.height); //adjust size\n gl.clearColor(0, 0, 0, 1);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n drawWorld(camera);\n}", "title": "" }, { "docid": "e977f8569e6807a667ccc254d5bc29e8", "score": "0.55340797", "text": "function scroll_map(){\n\tvisual_map.eq_x = Math.min( Math.max( my_character.eq_x - visual_map.width/2 , 0 ) , map_utilities.limit_x - visual_map.width);\n\tvisual_map.eq_y = Math.min( Math.max( my_character.eq_y - visual_map.height/2 , 0 ) , map_utilities.limit_y - visual_map.height);\n\t\n\tif(my_character.eq_x >= visual_map.width/2 && my_character.eq_x <= map_utilities.limit_x - visual_map.width/2 - 1){\n\t\tvisual_map.x = my_character.x\n\t}\n\telse{\n\t\tvisual_map.x = 0;\n\t}\n\tif(my_character.eq_y >= visual_map.height/2 && my_character.eq_y <= map_utilities.limit_y - visual_map.height/2 - 1){\n\t\tvisual_map.y = my_character.y\n\t}\n\telse{\n\t\tvisual_map.y = 0;\n\t}\n\tvisual_map.to_scroll_x = visual_map.scrolled_x - (visual_map.eq_x * visual_map.ratio + visual_map.x);\n\tvisual_map.to_scroll_y = visual_map.scrolled_y - (visual_map.eq_y * visual_map.ratio + visual_map.y);\n\t\n\tcontext.translate( visual_map.to_scroll_x , visual_map.to_scroll_y);\n\tvisual_map.scrolled_x = visual_map.eq_x * visual_map.ratio + visual_map.x;\n\tvisual_map.scrolled_y = visual_map.eq_y * visual_map.ratio + visual_map.y;\n}", "title": "" }, { "docid": "2a433c2b59985a98b745020d26a6b8f2", "score": "0.5526134", "text": "function updateViewport() {\n threshold._viewport.height = window.innerHeight;\n threshold._viewport.width = window.innerWidth;\n }", "title": "" }, { "docid": "9d31fed454b9957d80c792a1db9b79c1", "score": "0.55245787", "text": "setCamera() {\n let canvas = document.getElementById(\"canvas\");\n this.camera = new THREE.PerspectiveCamera(70, canvas.offsetWidth / canvas.offsetWidth, 1, 10000);\n this.camera.position.z = 1000;\n }", "title": "" }, { "docid": "9d31fed454b9957d80c792a1db9b79c1", "score": "0.55245787", "text": "setCamera() {\n let canvas = document.getElementById(\"canvas\");\n this.camera = new THREE.PerspectiveCamera(70, canvas.offsetWidth / canvas.offsetWidth, 1, 10000);\n this.camera.position.z = 1000;\n }", "title": "" }, { "docid": "5d1b9074ecab9dd4f723feb6673305d3", "score": "0.5523972", "text": "function panCamera(){\n\n\tif(curLevel.ready){\n\t\t//camera displacement\n\t\tif((kyle.x >= camMove) && ((kyle.x+pixelSize) <= (curLevel.width - camMove)))\n\t\t\tcamera.x = kyle.x - camMove;\n\t}\n\t\n}", "title": "" }, { "docid": "12e4bb4faedce22f29aef573d2654953", "score": "0.5511308", "text": "updateRealPosition() {\n this.bounds.x = this.positionX * 50;\n this.bounds.y = this.positionY * 50;\n }", "title": "" }, { "docid": "3eba91f03c6d0f659b1e2528cc628117", "score": "0.550533", "text": "function setupCamera(x, y, z) {\n camera.position.set(x, y, z)\n}", "title": "" }, { "docid": "a2fe19265fbcf0db98540b74bf227940", "score": "0.5501518", "text": "function windowResize()\r\n{\r\n console.log('windowResize function');\r\n windowHeight = window.innerHeight;\r\n windowWidth = window.innerWidth;\r\n player.top = window.innerHeight - 50;\r\n}", "title": "" }, { "docid": "21727facbc3761b1173a55cfbc52eba9", "score": "0.549461", "text": "viewport(a, b, c, d) {\n this.webgl.viewport(a, b, c, d);\n }", "title": "" }, { "docid": "72dd495ef073e0ca5210410be86c97c9", "score": "0.5487086", "text": "function onResize() {\n windowHalfX = window.innerWidth/2;\n windowHalfY = window.innerHeight/2;\n camera.aspect = window.innerWidth/window.innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize(window.innerWidth, window.innerHeight);\n }", "title": "" }, { "docid": "dc13dd71decc02c278d86fbdd856d822", "score": "0.548132", "text": "viewport(a, b, c, d) {\n this.webgl.viewport(a, b, c, d);\n }", "title": "" }, { "docid": "4005f763169dfea1eb482d699f2be25e", "score": "0.5477038", "text": "function setupCamera() {\n // camera = new PerspectiveCamera(60, ratio, 0.1, 1000);\n camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = -700;\n camera.position.y = 100;\n camera.position.z = -25.5;\n camera.lookAt(new Vector3(0, -50, 0));\n console.log(\"Finished setting up Camera...\");\n }", "title": "" }, { "docid": "b7e4364e72ca32ed5a09eff7541c496f", "score": "0.54698455", "text": "function setupCamera() {\r\n camera = new PerspectiveCamera(45, config.Screen.RATIO, 0.1, 1000);\r\n //camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\r\n camera.position.x = 0.6;\r\n camera.position.y = 60;\r\n camera.position.z = -180.5;\r\n camera.lookAt(new Vector3(0, 0, 0));\r\n console.log(\"Finished setting up Camera...\");\r\n}", "title": "" }, { "docid": "7f5c0809dcd43fd9cd68df7c9c3cef7d", "score": "0.5466873", "text": "function setCamera()\n{\n// // rotate the camera around the y-axis\n var rotation = 0.0025 * camRotation;\n camera.position.x = 250 * Math.sin(rotation * Math.PI);\n camera.position.z = 250 * Math.cos(rotation * Math.PI);\n camera.position.y = 30;\n\n // aim the camera at the origin\n camera.lookAt(new THREE.Vector3(0,0,0));\n}", "title": "" }, { "docid": "29f5ec1eac76c28304f576b743132e0c", "score": "0.5464916", "text": "setupPosition()\n {\n if (typeof this.options.position !== 'undefined')\n {\n this.startX = this.parent.center.x;\n this.startY = this.parent.center.y;\n this.deltaX = this.options.position.x - this.parent.center.x;\n this.deltaY = this.options.position.y - this.parent.center.y;\n this.keepCenter = false;\n }\n else\n {\n this.keepCenter = true;\n }\n }", "title": "" }, { "docid": "cac624bb62ac81b19a5497b6327ee71b", "score": "0.5458246", "text": "function setupCamera() {\n camera = new PerspectiveCamera(35, config.Screen.RATIO, 0.1, 100);\n}", "title": "" }, { "docid": "288d3746012bda32abdea32fa546d43e", "score": "0.5448702", "text": "fixPosition() {\n const scale = this.defaultWidth ?\n Math.min(1, this.app.renderer.width / this.defaultWidth,\n this.app.renderer.height / this.defaultHeight)\n : 1;\n\n if(this.wheel) {\n // Fix the position of the wheel\n this.wheel.x = this.app.renderer.width / 2;\n this.wheel.y = this.app.renderer.height / 2;\n\n // Scale wheel based on browser size\n this.wheel.scale.x = scale;\n this.wheel.scale.y = scale;\n }\n\n if(this.arrow) {\n // Fix the position of the arrow\n this.arrow.x = (this.app.renderer.width / 2) + (this.wheel.width / 2);\n this.arrow.y = this.app.renderer.height / 2;\n\n // Scale arrow based on browser size\n this.arrow.scale.x = scale;\n this.arrow.scale.y = scale;\n }\n\n this.scale = scale;\n }", "title": "" }, { "docid": "843ee5dd2f0808124142fa44321f35e7", "score": "0.54388773", "text": "function onResize() {\n var dimension = window.innerWidth / window.innerHeight;\n \n if (window.innerHeight > 0 && window.innerWidth > 0) { // dividing by zero error preventer\n if (cameraOn == 0) {\n camera.left = - trunk*dimension/2;\n\t camera.right = trunk*dimension/2;\n\t camera.top = trunk/2;\n camera.bottom = - trunk/2;\n }\n \n else if (cameraOn == 1 || cameraOn == 2) {\n if (window.innerHeight > 0 && window.innerWidth > 0) {\n camera.aspect = renderer.getSize().width / (renderer.getSize().height);\n }\n }\n }\n \n\tcamera.updateProjectionMatrix();\n \n renderer.setSize( window.innerWidth, window.innerHeight);\n}", "title": "" }, { "docid": "cf2d093c85899a053d2cdaba72550cb3", "score": "0.5434151", "text": "function render() {\n context.clearRect(0, 0, canvas.width, canvas.height);\n \n // if(keyboard.getRightPressed() && !(hero.getXLocation() + hero.getHeroWidth() >= canvas.width)) {\n if(keyboard.getRightPressed()) {\n hero.setXLocation(hero.getXLocation() + hero.getXHeroMovementSpeed());\n }\n // else if(keyboard.getLeftPressed() && !(hero.getXLocation() <= 0)) {\n else if(keyboard.getLeftPressed()) {\n hero.setXLocation(hero.getXLocation() - hero.getXHeroMovementSpeed());\n }\n\n if(keyboard.getJumpPressed()) {\n hero.setYLocation(hero.getYLocation() - hero.getJumpSpeed());\n } else if(hero.getYLocation() < canvas.height - hero.getHeroHeight()) {\n hero.setYLocation(hero.getYLocation() + hero.getFallSpeed());\n }\n\n worldEngine.check();\n colliderEngine();\n colliderResolution();\n\n hero.draw();\n wall.draw();\n\n setTimeout(() => {\n requestAnimationFrame(render)\n }, 1000/fps);\n}", "title": "" }, { "docid": "30a700ef8ed55b2043899ce760125199", "score": "0.54236394", "text": "function ShowPlayer()\n{\n\tGameObject.Find(\"rootJoint\").GetComponent(SkinnedMeshRenderer).enabled = true; // start rendering the player again.\n\tisControllable = true;\t// allow player to control the character again.\n}", "title": "" }, { "docid": "f410e6c8bb1556e750943f0da558999e", "score": "0.5420384", "text": "function onWindowResize() {\r\n\twindowHalfX = window.innerWidth / 2;\r\n\twindowHalfY = window.innerHeight / 2;\r\n\tcamera.aspect = window.innerWidth / window.innerHeight;\r\n\tcamera.updateProjectionMatrix();\r\n\trenderer.setSize( window.innerWidth, window.innerHeight );\r\n}", "title": "" }, { "docid": "96a7e32c7f86d44f1b060997f222153d", "score": "0.54188734", "text": "function setUpEnterScreen() {\n enterScreen.x = width / 2;\n enterScreen.y = 200;\n enterScreen.size = 15;\n}", "title": "" }, { "docid": "09ca6973693746cb490a88e8a2ae7e3e", "score": "0.5417644", "text": "manageCameraPosition() {\n this.camera.lookAt(this.focusPoint)\n\n if (this.camera.position.x >= - this.cameraBound && this.camera.position.x <= this.cameraBound) {\n this.camera.position.x += (this.mouseX - this.camera.position.x) * 0.05\n if (this.camera.position.x < - this.cameraBound) this.camera.position.x = - this.cameraBound\n if (this.camera.position.x > this.cameraBound) this.camera.position.x = this.cameraBound\n }\n if (this.camera.position.y >= - this.cameraBound && this.camera.position.y <= this.cameraBound) {\n this.camera.position.y += (-this.mouseY - this.camera.position.y) * 0.05\n if (this.camera.position.y < - this.cameraBound) this.camera.position.y = - this.cameraBound\n if (this.camera.position.y > this.cameraBound) this.camera.position.y = this.cameraBound\n }\n\n if (this.cameraBound !== window.config.user.cameraBound.value) {\n this.camera.position.y = 0\n this.camera.position.x = 0\n this.cameraBound = window.config.user.cameraBound.value\n }\n }", "title": "" }, { "docid": "1ab7436919e82aaf9188c2021683544b", "score": "0.5406148", "text": "function setCamera() {\n let fov = Math.PI / 2000;\n let projection = perspectiveProjectionFov(fov, fov, 1, 1000)\n gl.uniformMatrix4fv(M_projection, false, flatten(projection));\n\n let eyeVector = vec3(\n WORLD_CENTER_X,\n WORLD_CENTER_Y + WORLD_DEPTH * -2.2,\n WORLD_CENTER_Z + WORLD_HEIGHT * 0.2\n );\n let lookAtVector = vec3(\n WORLD_CENTER_X,\n WORLD_CENTER_Y,\n WORLD_CENTER_Z - WORLD_HEIGHT * 0.1\n );\n let upVector = vec3(0, 0, 1);\n\n let camera = lookAt(eyeVector, lookAtVector, upVector);\n gl.uniformMatrix4fv(M_camera, false, flatten(camera));\n}", "title": "" }, { "docid": "0dc1c8935a0a45e8d4b025d095fd8f38", "score": "0.54030955", "text": "function onWindowResize(){\n\t\tvar WWidth = window.innerWidth;\n\t\tvar WHeight = window.innerHeight;\n\t\t\n\t\tvar height,width;\n\t\t\n\t\twidth = WWidth - WWidth*3/10;\n\t\theight = width *0.75;\n \t\t\n\t\tif(height>WHeight-100){\n\t\t\theight = WHeight-100;\n\t\t\twidth = height/0.75;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tcamera.aspect = width/height;\n\t\t\t\n\t\trenderer.setSize( width,height );\n\t\trenderer.setPixelRatio(window.devicePixelRatio);\t\t\t\t\t\n\t\tcamera.updateProjectionMatrix();\n\t\t\n\t\trenderCanvas.style.marginLeft = ((WWidth - width ) /2) + \"px\";\n\t\t\t\t\n\t\tdocument.getElementById(\"composerRenderer\").style.height = height+\"px\";\n\t\tdocument.getElementById(\"composerRenderer\").style.maxHeight = (window.innerHeight-100)+\"px\";\n\t\t\n\t\t\n\t\tdocument.getElementById(\"menu\").style.top = (document.getElementById(\"canvasRender\").offsetTop+document.getElementById(\"canvasRender\").offsetHeight-document.getElementById(\"menu\").offsetHeight-10)+\"px\";\n\t\tdocument.getElementById(\"menu\").style.left = document.getElementById(\"canvasRender\").offsetLeft+\"px\";\n\t\tdocument.getElementById(\"menu\").style.width = width+\"px\";\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "802ddc655baf90180064ec08a0120e7a", "score": "0.5384474", "text": "function updateCamera() {\n\n /* // Don't let the player escape outside the screen!\n if ( plr.x + plr.w + camera.x > scr.w - camera.border ) {\n camera.x = scr.w - camera.border - plr.x - plr.w;\n }\n else if ( plr.x + camera.x < camera.border ) {\n camera.x = camera.border - plr.x;\n }\n if ( plr.y + plr.h + camera.y > scr.h - camera.border ) {\n camera.y = scr.h - camera.border - plr.y - plr.h;\n }\n else if ( plr.y + camera.y < camera.border ) {\n camera.y = camera.border - plr.y;\n }\n */\n\n // Glue the camera to the player\n camera.x = scr.w/2 - plr.x;\n camera.y = scr.h/2 - plr.y;\n\n // Camera can't go outside the worlds boundaries. If the world is smaller than\n // the screen, center the camera to the middle of the screen.\n var level = levels[levels.current];\n\n if( scr.w < level.w*16 ) {\n if ( camera.x > 0 ) camera.x = 0;\n if ( camera.x < scr.w - level.w*16 ) camera.x = scr.w - level.w*16;\n }\n else {\n camera.x = scr.w/2 - level.w*8;\n }\n if( scr.h < level.h*24 ) {\n if ( camera.y > 0 ) camera.y = 0;\n if ( camera.y < scr.h - level.h*24 ) camera.y = scr.h - level.h*24;\n }\n else {\n camera.y = scr.h/2 - level.h*12;\n }\n}", "title": "" }, { "docid": "320f74670aded7bb449efe017fd5f0e8", "score": "0.5381451", "text": "function adjustSize() {\n WIDTH = window.innerWidth;\n HEIGHT = window.innerHeight;\n\n aspect = WIDTH / HEIGHT;\n\n renderer.setSize(WIDTH, HEIGHT);\n\n camera.aspect = aspect;\n camera.updateProjectionMatrix();\n }", "title": "" }, { "docid": "87bc892f0c8c56623122ae59f583dac7", "score": "0.5379561", "text": "function changeLocation() {\n clearTimeout(trollFaceTimeoutID);\n clearInterval(trollFaceIntervalID);\n\n topVal = getRandomPositionVal(viewportHeight);\n leftVal = getRandomPositionVal(viewportWidth);\n\n trollFaceElem.style.top = `${topVal.toString()}px`;\n trollFaceElem.style.left = `${leftVal.toString()}px`;\n\n showTrollFace();\n trollFaceTimeoutID = setTimeout(() => hideTrollFace(), 1000);\n trollFaceIntervalID = setInterval(() => changeLocation(), getRandomPeriod());\n}", "title": "" }, { "docid": "68f6ef2d141c7cb8ed0459c466a6c9ec", "score": "0.5374655", "text": "function updateView() {\r\n //window.scrollTo(player.leftPos - (window.innerWidth / 2 - (window.innerWidth / 2 % 100)), player.topPos - (window.innerHeight / 2 - (window.innerHeight / 2 % 100)));\r\n window.scrollTo({\r\n left: player.leftPos - (window.innerWidth / 2 - (window.innerWidth / 2 % 100)),\r\n top: player.topPos - (window.innerHeight / 2 - (window.innerHeight / 2 % 100)),\r\n behavior: 'smooth'\r\n });\r\n var playerElem = document.getElementById(\"player\");\r\n playerElem.style.left = player.leftPos + \"px\";\r\n playerElem.style.top = player.topPos + \"px\";\r\n document.getElementById(\"position\").innerHTML = \"<img src='assets/compass.png'> (\" + (player.xCoord) + \",\" + (player.yCoord) + \")\";\r\n console.log(players.length);\r\n for (var i = 0; i < players.length; i++) {\r\n console.log(i);\r\n var otherPlayer = players[i];\r\n console.log(otherPlayer);\r\n var otherPlayerElem = document.getElementById(otherPlayer.id);\r\n otherPlayerElem.style.left = otherPlayer.leftPos + \"px\";\r\n otherPlayerElem.style.top = otherPlayer.topPos + \"px\";\r\n }\r\n}", "title": "" }, { "docid": "74e64d451d2800a3d180153a22e8f54f", "score": "0.5374204", "text": "function moveCamera() {\n document.documentElement.style.setProperty(\"--cameraZ\", window.pageYOffset);\n}", "title": "" }, { "docid": "664ba846bbef73cdda6c109c5e62941e", "score": "0.5370621", "text": "setCameraToCenter() {\n let center_pos = (this.max_val - this.min_val) / 2;\n this.sigInst.camera.goTo({x:center_pos, y:center_pos, ratio:1});\n }", "title": "" }, { "docid": "664ba846bbef73cdda6c109c5e62941e", "score": "0.5370621", "text": "setCameraToCenter() {\n let center_pos = (this.max_val - this.min_val) / 2;\n this.sigInst.camera.goTo({x:center_pos, y:center_pos, ratio:1});\n }", "title": "" }, { "docid": "632c33851522e2bf5ca6968ed3650a5b", "score": "0.5361825", "text": "function setUpCamera() {\n \n // set up your projection\n // defualt is orthographic projection\n let projMatrix = glMatrix.mat4.create();\n glMatrix.mat4.perspective(projMatrix, radians(90), 1.0, 1, 50);\n gl.uniformMatrix4fv (program.uProjT, false, projMatrix);\n\n // set up your view\n // defaut is at (0,0,-5) looking at the origin\n let viewMatrix = glMatrix.mat4.create();\n // 1st list: location of the camera in 3d space (eye)\n // 2nd list: where to look at\n // 3rd list: tilt and inversion of the camera\n glMatrix.mat4.lookAt(viewMatrix, [0, 3, -9], [0, 0, 0], [0, 1, 0]);\n gl.uniformMatrix4fv (program.uViewT, false, viewMatrix);\n}", "title": "" }, { "docid": "2587f33125e7f6ed6037f7ebc3ae6e0e", "score": "0.5357277", "text": "walk() {\r\n \tlet vx = random(-1, 1);\r\n\t \tlet vy = random(-1, 1);\r\n\t \tthis.x += vx;\r\n\t \tthis.y += vy;\r\n\r\n\t\t// Stay on the screen\r\n\t\tthis.x = constrain(this.x, this.size/2, width - this.size/2);\r\n\t\tthis.y = constrain(this.y, this.size/2, height - this.size/2);\r\n \t}", "title": "" }, { "docid": "9a0b26205bf04c2c864c8da28489ff44", "score": "0.5357053", "text": "constructor() {\n this.rowStep = 83; //values for x/y coor taken from engine where it specifies col=101, row =83 *MOVES ALONG Y AXIS (UP/DOWN)\n this.colStep = 101; //step over columns on x-axis, step up and down row on y-axis *MOVES ALONG X AXIS (RIGHT/LEFT)\n this.startY = (this.rowStep * 4) + 55; //moves player 5 rows down, -20 adds padding to help center the player\n this.startX = (this.colStep * 2); //moves player 2 columns to the right\n this.x = this.startX; //puts player at bottom center of game, will use in our reset method later\n this.y = this.startY;\n this.sprite = 'images/char-boy.png';\n this.winGame = false; //initially false when object created, will switch to true when conditions met inside update() method\n }", "title": "" }, { "docid": "e2616d6745b15af2f55970d0bec5e886", "score": "0.5356011", "text": "facePlayer(humanPlayer) {\n this.cursorDirection = new Pair(humanPlayer.playerPositionX - this.x, humanPlayer.playerPositionY - this.y);\n this.cursorDirection.normalize();\n }", "title": "" }, { "docid": "98171eb7105c05498a782ec83c774a64", "score": "0.53552645", "text": "update() {\n // move\n this.pos.add(this.vel);\n\n // wrap screen\n const margin = 100;\n if (this.pos.x < -margin - worldHalfWidth) { this.pos.x = worldHalfWidth + margin; }\n else if (this.pos.x > worldHalfWidth + margin) { this.pos.x = -margin - worldHalfWidth; }\n if (this.pos.y < -margin - worldHalfHeight) { this.pos.y = worldHalfHeight + margin; }\n else if (this.pos.y > worldHalfHeight + margin) { this.pos.y = -margin - worldHalfHeight; }\n }", "title": "" }, { "docid": "63f61e1c3f552b2907dbd675f4d0a1cf", "score": "0.53547496", "text": "function onWindowResize(){\n width = window.innerWidth;\n height = window.innerHeight - 50 - 44;\n\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n\n renderer.setSize( width, height );\n }", "title": "" }, { "docid": "28d1e281aaaa0205ca0f29fcd68598f3", "score": "0.5353062", "text": "function onWindowResize () {\n scene.setCameraAspect (window.innerWidth / window.innerHeight);\n renderer.setSize (window.innerWidth, window.innerHeight);\n}", "title": "" }, { "docid": "932381f11f173b989fea13778059476a", "score": "0.53478885", "text": "function FindMe() {\n\tCamera.main.transform.position = new Vector3(this.transform.position.x,\n\t\t\t\t\t\t\t\t\tthis.transform.position.y,\n\t\t\t\t\t\t\t\t\tCamera.main.transform.position.z);\n}", "title": "" }, { "docid": "e03731d319ad522c81e450ff30f95a56", "score": "0.5346882", "text": "function setupPlayer() {\n player.x = mouseX;\n player.y = mouseY;\n}", "title": "" }, { "docid": "da6f386f5bcfa1317cd28aabbb4d9754", "score": "0.534321", "text": "constructor() {\n this.viewportWidth = window.innerWidth\n this.viewportHeight = window.innerHeight\n\n this.setup()\n this.handleResize()\n }", "title": "" }, { "docid": "3c34d79bf9ab584d26623aeb49bf901f", "score": "0.53423256", "text": "function updateOrtho() {\r\n\t\tvar halfH = Math.tan(this.fov.current / 2) * this.distance,\r\n\t\t\thalfW = halfH * this.fov.aspect;\r\n\r\n\t\tthis.threeCamera.bottom = halfH * -1;\r\n\t\tthis.threeCamera.left = halfW * -1;\r\n\t\tthis.threeCamera.right = halfW;\r\n\t\tthis.threeCamera.top = halfH;\r\n\t\tthis.threeCamera.updateProjectionMatrix();\r\n\t}", "title": "" }, { "docid": "91cc7d49da053f4f35e3b0a0780e940c", "score": "0.5339586", "text": "initControlsAndCams() {\r\n this.cursors = this.input.keyboard.createCursorKeys();\r\n //Größere Welt als der Bildausschnitt - Kamera folgt dem Player\r\n this.cameras.main.startFollow(this.player);\r\n this.physics.world.setBounds(0,0,2000,600);\r\n this.cameras.main.setBounds(0,0,2000,600);\r\n //this.addMiniMap();\r\n }", "title": "" }, { "docid": "7141152634c5d281b7055c14375c90a5", "score": "0.53334826", "text": "ViewportToWorldPoint() {}", "title": "" }, { "docid": "fa39850436375ba91888cdf8f8ce0757", "score": "0.5333138", "text": "jump() {\n if (this.pos.y === height - this.r) {\n this.vy = this.jumpHeight;\n }\n }", "title": "" }, { "docid": "4fab869ec318a0df7458b0306ef8e8ff", "score": "0.53315926", "text": "function setDimensions() {\n var rw, rh, r;\n rw = window.innerWidth / WORLD.width;\n rh = window.innerHeight / WORLD.height;\n r = Math.min(rw, rh);\n\n canvas.height = WORLD.height * r;\n canvas.width = WORLD.width * r;\n\n canvas.style.marginTop = rw <= rh ? String((window.innerHeight - canvas.height) / 2) + 'px' : 0;\n\n ctx.scale(r, r);\n}", "title": "" }, { "docid": "c0e8df92134f7676472077f98cbdc72b", "score": "0.5330362", "text": "function setupCamera() {\n camera = new PerspectiveCamera(45, config.Screen.RATIO, 0.1, 1000);\n camera.position.x = 0;\n camera.position.y = 15;\n camera.position.z = 45;\n // camera.rotation.set(-1.10305, 0.49742, -0.1396);\n camera.lookAt(new Vector3(0, 13, 0));\n console.log(\"Finished setting up Camera...\");\n }", "title": "" }, { "docid": "52420ff43fc27360af14e41c6f4762bf", "score": "0.53303194", "text": "function setup() {\n var cnv = createCanvas(windowWidth, windowHeight*3);\n cnv.parent(\"faceCan\");\n \n //p5 method for creating video stream\n vidCapt = createCapture(VIDEO);\n// vidCapt.size(600, 300);\n vidCapt.size(vidCapt.width*2, vidCapt.height*3); //bro what are these measurements, if i change them it zooms in the camera??? \n vidCapt.hide();\n \n //creat, initialize, start tracker\n ctrack = new clm.tracker();\n ctrack.init();\n ctrack.start(vidCapt.elt); //video tracker element it uses\n drawcan = document.getElementById('defaultCanvas0'); //default name from p5 when we use createCanvas method\n \n}", "title": "" }, { "docid": "623b90ae00abf3274ba77ae75982713a", "score": "0.5322208", "text": "ViewportToScreenPoint() {}", "title": "" }, { "docid": "35c8a4f70f63a13876893be3eb79818d", "score": "0.5313622", "text": "function setup() {\n\n center = new Vector(\n g.canvas.width / 2,\n g.canvas.height / 2\n );\n\n state = generateInitialState();\n sprites = generateSprites(state);\n\n characterBaseY = sprites.character.y;\n\n\n\n\n\n const rightKey = g.keyboard(68);\n const leftKey = g.keyboard(65);\n const upKey = g.keyboard(87);\n const downKey = g.keyboard(88);\n const pauseKey = g.keyboard(27);\n const spaceKey = g.keyboard(32);\n\n rightKey.press = function() {\n if (g.paused) {\n return;\n }\n\n if (state.player.isJumping()) {\n return;\n }\n\n state.player.turnRight();\n state.wheel.runRight();\n };\n\n rightKey.release = function() {\n if (leftKey.isUp) {\n state.wheel.stopRunning();\n } else {\n state.player.turnLeft();\n state.wheel.runLeft();\n }\n };\n\n leftKey.press = function() {\n if (g.paused) {\n return;\n }\n\n if (state.player.isJumping()) {\n return;\n }\n\n state.player.turnLeft();\n state.wheel.runLeft();\n };\n\n leftKey.release = function() {\n if (rightKey.isUp) {\n state.wheel.stopRunning();\n } else {\n state.player.turnRight();\n state.wheel.runRight();\n }\n };\n\n upKey.press = function() {\n if (g.paused) {\n return;\n }\n\n if (state.player.canJump()) {\n state.player.jump();\n state.wheel.pauseRunning();\n\n const sfx = g.sound('../assets/sounds/jump.mp3');\n sfx.play();\n }\n };\n\n upKey.release = function() {\n state.player.stopJumping();\n };\n\n pauseKey.press = function() {\n if (g.paused) {\n g.resume();\n } else {\n g.pause();\n }\n };\n\n spaceKey.press = () => {\n if (g.paused) {\n return;\n }\n\n if (sprites.introScene.visible) {\n g.state = play;\n } else if (sprites.playScene.visible) {\n if (state.player.canJump()) {\n state.player.jump();\n state.wheel.pauseRunning();\n\n const sfx = g.sound('../assets/sounds/jump.mp3');\n sfx.play();\n }\n }\n };\n\n spaceKey.release = () => {\n if (sprites.playScene.visible) {\n state.player.stopJumping();\n }\n };\n\n g.backgroundColor = 0xf6ddc4;\n\n\n //Set the game state to play. This is very important! Whatever\n //function you assign to Hexi's `state` property will be run by\n //Hexi in a loop.\n g.state = intro;\n\n}", "title": "" }, { "docid": "292a9d8c9d6a21198e40d3a7f5c83212", "score": "0.5308958", "text": "onResize() {\r\n this.text.x = this.stage.bounds.x;\r\n this.text.y = this.stage.bounds.y;\r\n }", "title": "" }, { "docid": "5f66b7c3d4008754c8f86a5a15306924", "score": "0.5307849", "text": "function centerCameraOnPlayer()\n{\n\tcamera[0] = playersTank.gameX - 0.5*canvasWidth+ 0.5*playersTank.size;\n\tcamera[1] = playersTank.gameY - 0.5*canvasHeight+ 0.5*playersTank.size;\n}", "title": "" }, { "docid": "02c8727386cbfe2ef0b52dfe356481fd", "score": "0.5306362", "text": "function onWindowResize() {\r\n\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n\r\n}", "title": "" }, { "docid": "802aaa08e0759af103d6be57007bb7ac", "score": "0.5304053", "text": "function position() {\n const rect = $element[0].getBoundingClientRect()\n\n if (isGlobal) {\n viewElem.css({\n top: (rect.top - viewElem[0].offsetHeight - 6) + $window.scrollY + 'px',\n left: (rect.left + ((rect.width - viewElem[0].offsetWidth) / 2)) + $window.scrollX + 'px'\n })\n } else {\n viewElem.css({\n left: ((rect.width - viewElem[0].offsetWidth) / 2) + 'px'\n })\n }\n }", "title": "" }, { "docid": "a99eb39624480fd40dfafd03ac0a0e2b", "score": "0.53001565", "text": "function onWindowResize() { // event listener located in init() function\n camera.aspect = window.innerWidth / window.innerHeight; // get the new viewport size for the camera\n camera.updateProjectionMatrix(); // update camera with new dimensions\n \n renderer.setSize( window.innerWidth, window.innerHeight ); // update renderer with new viewport dimensions\n}", "title": "" }, { "docid": "94b2f10942293ddea03081b93af56528", "score": "0.5296899", "text": "function on_window_resize() {\n\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n\n renderer.setSize(window.innerWidth, window.innerHeight);\n\n controls.handleResize();\n\n render();\n\n}", "title": "" }, { "docid": "da03b5076bfa5b7dcfbb1e2d0ec3a9f8", "score": "0.5287361", "text": "function onResize() \n{\n\tcamera.aspect = window.innerWidth / window.innerHeight;\n\tcamera.updateProjectionMatrix();\n\trenderer.setSize(window.innerWidth, window.innerHeight);\n}", "title": "" }, { "docid": "bec77bff120b3683163f19d09d04a802", "score": "0.52849954", "text": "setPosition(position){\n this.phaserCharacter.x = position[0] * 16 + 8;\n this.phaserCharacter.y = position[1] * 16 + 6;\n\n }", "title": "" }, { "docid": "dd0b0c0c38017071a77a6931f88492e5", "score": "0.528388", "text": "function onWindowResize() {\n\tcamera.aspect = ((window.innerWidth - 315) / (window.innerHeight - 25));\n\tcamera.updateProjectionMatrix();\n\n\trenderer.setSize(window.innerWidth - 315, window.innerHeight - 25);\n\n\tcontrols.handleResize();\n\n\trender();\n}", "title": "" } ]
1d832e16e3b3a406ff4394360b004d9b
from parse server code
[ { "docid": "c63ef4e4ba4f043bcf91b7214173d789", "score": "0.0", "text": "function newObjectId() {\n var chars = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ' +\n 'abcdefghijklmnopqrstuvwxyz' +\n '0123456789');\n var objectId = '';\n for (var i = 0; i < 10; ++i) {\n objectId += chars[Math.floor(Math.random() * chars.length)];\n }\n return objectId;\n}", "title": "" } ]
[ { "docid": "aa47ac573f0d85afcd1c26f5cbaeb053", "score": "0.6907609", "text": "parse() {\n }", "title": "" }, { "docid": "43551783aa4f3a472e727280a9d5c703", "score": "0.67419374", "text": "function ParseClient(){\n\t\n}", "title": "" }, { "docid": "70819e26b9be24469d6ab99960275ffb", "score": "0.64736646", "text": "parse () {\n throw new Error('Not yet implemented');\n }", "title": "" }, { "docid": "23428d70371f9e932faef586f68faa30", "score": "0.5891139", "text": "parse (record) {\n\n }", "title": "" }, { "docid": "4cdf83fc3c8537bf347e49bc5b4cbf63", "score": "0.5700292", "text": "function parse(method) {\n\n }", "title": "" }, { "docid": "a4d38890c5cc1ca1b0f4df60f7d1bb87", "score": "0.56849676", "text": "postParse() {\n return;\n }", "title": "" }, { "docid": "9d0b32f8c7954702158509b85f0dd5db", "score": "0.5655954", "text": "function _OnlineNowNodeParser_run()\n\t{\n\t\tthis.locateNodes();\t\n\t\tvar UserIDList = \"\";\n\t\tif (this.NodeArray.length > 0)\n\t\t{\n\t\t\tfor (var i=0; i < this.NodeArray.length; i++)\n\t\t\t{\n\t\t\t\tif (UserIDList.indexOf(\":\" + this.NodeArray[i].UserID + \":\") == -1) UserIDList += \":\" + this.NodeArray[i].UserID + \":,\";\n\t\t\t}\n\t\t\tUserIDList = UserIDList.replace(/[:]/g, \"\").replace(/[,]$/gi, \"\");\n\t\t\tthis.remotingClient.addRequestParameter(\"UserIDList\", UserIDList);\n\t\t\tthis.remotingClient.sendRequest();\n\t\t}\n\t}", "title": "" }, { "docid": "ab671b06a757b5cae97154800920b5f7", "score": "0.55891293", "text": "function Parser() {}", "title": "" }, { "docid": "903198a38236aec0c92c2893144cc219", "score": "0.55645347", "text": "parse(resp, options) {\n return resp;\n }", "title": "" }, { "docid": "e01749693a8f94adb965653b0a2158ac", "score": "0.55019045", "text": "parsingDidStart(requestContext) {\n console.log('Parsing started!');\n }", "title": "" }, { "docid": "88fcd742d2af5ab6682125cac3e90fbd", "score": "0.5481712", "text": "function spark_parse(data) {\n\t_log('>>>', data);\n\tvar path = data.name.replace('\\/', '.');\n\n\tstats_send(SPARK_PATH+'.'+data.coreid+'.'+path+'.'+data.data+':1|c');\n}", "title": "" }, { "docid": "0f7112c45e79100960f444e3bcb119d9", "score": "0.5449737", "text": "parse() {\n return program;\n }", "title": "" }, { "docid": "bf9ff862876f925474d1eabcbc1ef66e", "score": "0.544093", "text": "async parse(url) {\n throw new Error('parse must be implemented')\n }", "title": "" }, { "docid": "eb293fbc7581423ccbb732c83077494d", "score": "0.5393426", "text": "async parsingDidStart(requestContext) {\n console.log('Parsing started!');\n }", "title": "" }, { "docid": "f3f6734640cb9d1b6350713b37c7d872", "score": "0.53895956", "text": "function startParsing() {\n let types = new Array(Object.keys(fields).length);\n let values = new Array(Object.keys(fields).length);\n let tagName = \"\";\n for (i in Object.values(fields))\n {\n if (window.wrappedJSObject.prev[i].id !== \"\") {\n types[i] = \"id\";\n values[i] = window.wrappedJSObject.prev[i].id;\n } else if (window.wrappedJSObject.prev[i].className !== \"\") {\n types[i] = \"class\";\n values[i] = window.wrappedJSObject.prev[i].className;\n } else {\n if (i === fields.BODY.toString()) {\n alert(\"The text body has no identifier, can't download this book\");\n return;\n }\n if (i === fields.NEXT.toString()) {\n types[i] = \"content\";\n values[i] = window.wrappedJSObject.prev[fields.NEXT].textContent.replace(/\\n| /g, \"\");\n tagName = window.wrappedJSObject.prev[fields.NEXT].tagName;\n }\n }\n }\n\n let identifiers = { command: \"identifiers\", titleType: types[fields.TITLE], title: values[fields.TITLE],\n bodyType: types[fields.BODY], body: values[fields.BODY], nextType: types[fields.NEXT],\n nextTag: tagName, next: values[fields.NEXT], href: window.location.href }\n\n port.postMessage(identifiers);\n }", "title": "" }, { "docid": "17c0450e6542dc077483f7c4674aec13", "score": "0.5370721", "text": "parse() {\n\t\treturn this.parseRSS(this.page.url);\n\t}", "title": "" }, { "docid": "58b8242558b2802089a8eafc1b01a8d9", "score": "0.53647786", "text": "parse(message) {\n if(typeof message === 'undefined' || message === null) {\n throw new Error(\"A null or undefined message was provided.\")\n }\n\n return sendRequest({q: message})\n .then(response => {\n return Promise.resolve(NLPResponse.fromRasaResponse(response));\n }).catch(err => {\n sails.log.error(err);\n console.log('NLP Request Error: ', err);\n return Promise.reject(err);\n });\n }", "title": "" }, { "docid": "0cdf65f25a53f2e02ba12b01b9a392c2", "score": "0.5357506", "text": "function ImbaServerDocument(){ }", "title": "" }, { "docid": "0cdf65f25a53f2e02ba12b01b9a392c2", "score": "0.5357506", "text": "function ImbaServerDocument(){ }", "title": "" }, { "docid": "369eaa56c89b844c0c02be3ef61b2841", "score": "0.5351536", "text": "static parse(context, json) {\n // TODO parse whatever came from the other side\n }", "title": "" }, { "docid": "23a558b24e1ef129f6e5dd54b72abccc", "score": "0.53465897", "text": "enterParse(ctx) {\n\t}", "title": "" }, { "docid": "4d0a6a111b910bea17aabe3c4435a37e", "score": "0.5299274", "text": "function parseQueryData() {\n // ...\n}", "title": "" }, { "docid": "c815afe8f2fb6c38ca4cd4f0eb45433d", "score": "0.5251011", "text": "parseResponse(response){\n\tif(response.startsWith('a55a00'))\n\t{\n\t\tvar data = response.split('a55a00')[1].slice(2,-6), // Removing the startfram , length , checkcode and end frame.\n\t\tcommand = data.slice(0,-(data.length-2)), // slicing the command in the data.\n\t\tself = this;\n\t\n\t\tswitch(command){\n\t\t\tcase '83': // Continous inventory reponse.\n\t\t\t\treturn self.getEPCData(data);\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tconsole.log('default response',data);\n\t\t}\n\t}\n\n\tconsole.log(\"Unknown response :\" + response);\n}", "title": "" }, { "docid": "dec5cebe23201c45137f2a02c67959fe", "score": "0.5236484", "text": "preParse() {\n return;\n }", "title": "" }, { "docid": "31f7023115591e8b3d3eff1d7f648770", "score": "0.5232356", "text": "parseMessage(msg) {\n let something = msg.split(\": \");\n\n if (msg.startsWith(\"DEV\") ||\n msg.toLowerCase().startsWith(\"server:\") ||\n msg[0] === \"<\" ||\n something.length < 2) return [null, null, null, msg];\n\n let before = something.shift();\n let message = something.join(\": \").trim();\n\n let user = {\n rank: 0,\n id: null,\n nick: \"\"\n }\n let tell = false;\n\n if (before.startsWith(\"[D]\")) {\n user.rank = 4; // rank 4 is discord\n user.nick = before.slice(4).trim(); // two ways one is spliting by space second is by just slicing 4 letters\n\n } else if (before.startsWith(\"(M)\")) {\n user.nick = before.slice(4).trim();\n user.rank = 2;\n } else if (before.startsWith(\"(A)\")) {\n user.nick = before.slice(4).trim();\n user.rank = 3;\n } else if (before.startsWith(\"[\") || /[0-9]/g.test(before[0])) {\n if (before.startsWith(\"[\")) {\n user.id = +before.split(\"]\")[0].substr(1);\n user.nick = before.split(\"]\");\n user.nick.shift();\n user.nick = user.nick.join(\"]\").trim();\n } else {\n user.id = +before;\n user.nick = before.trim(); // trim is not needed i think\n }\n\n user.rank = 0; //that.players[user.id] ? that.players[user.id].rank : 0;\n } else if (before.startsWith(\"-> \") && /[0-9]/g.test(before[4])) {\n tell = true;\n user.id = +before.split(\" \")[1];\n user.nick = user.id.toString();\n\n user.rank = 0 //that.players[user.id] ? that.players[user.id].rank : 0;\n } else if (before.toLowerCase().startsWith(\"-> you tell\")) {\n user.id = that.player.id;\n user.nick = that.player.nick;\n tell = true;\n }\n return [user, message, tell, msg];\n }", "title": "" }, { "docid": "806b41d968a50af530dc4c15e473f34b", "score": "0.5226646", "text": "_parse() {\n // these are questions we can ask to the SM to understand its state.\n let queries = [];\n // the states that the SM can be in.\n let states = [];\n // operations we can do to the SM to change its state.\n let operations = [];\n\n // n.b. params below are pass by reference because of array types\n this._parseStates(states, queries);\n this._parseTransitions(states, operations);\n\n // store the parsed values for later\n this.specification = {\n operations: operations,\n queries: queries,\n states: states,\n };\n }", "title": "" }, { "docid": "10fc4a99766e25c067d18d9f751688a3", "score": "0.51810086", "text": "function parse(cadena, index, respuesta) { //Funcion para separa mensaje tipo a:9999;b:8888\n var val = new Array ();\n var val1 = new Array ();\n var def = new Array ();\n var i;\n var j;\n var pos = cadena.indexOf(\"{\");\n var pos1 = cadena.lastIndexOf(\"}\");\n if (pos != -1 && pos1 != -1){\n var mensaje = cadena.substring(pos+1,pos1);\n var vari = mensaje.split(';');\n for (i = 0; i < vari.length; i++) { \n val = vari[i].split(':');\n for (j = 0; j < val.length; j++) {\n if (j == 1){val1 = val[j];} \n }\n def = def.concat(val1);\n } \n respuesta(def[index]);\n } \n }", "title": "" }, { "docid": "1433441dc783b36848644954feec5ce1", "score": "0.5158407", "text": "function OnlineNowNodeParser(bufferID)\n\t{\n\t\t/* Members. */\n\t\tthis.UserArray = new Array();\n\t\tthis.NodeArray = new Array();\n\t\tthis.requestURL = onlineNowInfoURL;\n\t\t/* Methods. */\n\t\tthis.run = _OnlineNowNodeParser_run;\n\t\tthis.locateNodes = _OnlineNowNodeParser_locateNodes;\n\t\tthis.replaceUserNode = _OnlineNowNodeParser_replaceUserNode;\n\t\tthis.processResults = _OnlineNowNodeParser_processResults;\n\t\t/* Remoting Client Initialization. */\n\t\tvar me = this;\n\t\tvar CallbackFunction = function(Results) {me.processResults(Results);};\n\t\tthis.remotingClient = new WDDXRemotingClient(this.requestURL, CallbackFunction, bufferID);\n\t}", "title": "" }, { "docid": "9d923fdc9807284c944dfc6299950913", "score": "0.51479775", "text": "parse( data ) {\n\t\t\t\treturn data.rows[0];\n\t\t\t}", "title": "" }, { "docid": "e97dd9c5a6929fe53c585c1d9e1f9441", "score": "0.5126824", "text": "static parse( command ) {\n command = command.replace(new RegExp(' ', 'g'), '')\n\n switch( command.length ) {\n case 16:\n return this.parseRequestCommand( command );\n case 34:\n return this.parseResponse34Command( command );\n case 290:\n return this.parseResponse290Command( command );\n default:\n return this.parseUnknowCommand( command );\n }\n }", "title": "" }, { "docid": "8feda80bbbe1707b8b74dc76d86b5e5a", "score": "0.51230043", "text": "parse(input) {\n return this.parser.parse(input);\n }", "title": "" }, { "docid": "841a11ab33b387a719938c8d995871b4", "score": "0.51113284", "text": "function parseQueryPortNameResponseFromNameserver(buffer) {\n var response = handleBottle(buffer);\n response[\"value\"][1];\n if (getKeyValue(\"value\")(response)[1][\"value\"][0][\"value\"].toString() == \"error\") {\n console.log(\"port does not exists\");\n return { \"ip\": \"\", \"port\": \"\" };\n }\n var bottleItem = getKeyValue(\"value\")(response);\n var ip;\n var port;\n for (var x in bottleItem) {\n var type = getKeyValue(\"type\")(bottleItem[x]);\n var value = getKeyValue(\"value\")(bottleItem[x]);\n if (type == bottleTags.BOTTLE_TAG_LIST\n || type == (bottleTags.BOTTLE_TAG_LIST + bottleTags.BOTTLE_TAG_STRING)) {\n var elementName = value[0][\"value\"];\n var elementValue = value[1][\"value\"];\n if (elementName == \"ip\") {\n ip = elementValue;\n }\n else if (elementName == \"port_number\") {\n port = elementValue;\n }\n }\n }\n return { \"ip\": ip, \"port\": port };\n}", "title": "" }, { "docid": "21fb1fa7b003f343d577abae9170f65a", "score": "0.5095216", "text": "function _processTagHistoryMessageRequest(parsedPacketObject){\n }", "title": "" }, { "docid": "5cea585cf5ca589996bdc7ff455775f5", "score": "0.5091559", "text": "parse( ) {\n let json = JSON.parse( this.handle.responseText );\n if ( json[ 'success' ] == true ) { this.ready( json ); }\n else { this.failure( json ); };\n }", "title": "" }, { "docid": "365daa094cdfbce9a59058e792e9e609", "score": "0.5071652", "text": "parse() {\n\n\t\t// First of all we need to read the header, and only the header. From \n\t\t// this we can derive where to find the index so that we can parse the \n\t\t// entries from it.\n\t\tthis.parseHeader(this.readBytes(0, 96));\n\n\t\t// Header is parsed which means we now know the offset of the index. \n\t\t// Let's parse the index as well then.\n\t\tlet buffer = this.readBytes(this.indexOffset, this.indexSize);\n\t\tlet rs = new Stream(buffer);\n\t\tthis.index.parse(rs);\n\n\t}", "title": "" }, { "docid": "a517bd8d7cc9e522a16d4b206bb83723", "score": "0.50684047", "text": "_onCloudCodeMessage(type, request) {\n _logger2.default.verbose('Raw request from cloud code current : %j | original : %j', request.object, request.original);\n // We need the full JSON which includes className\n const message = {\n currentParseObject: request.object._toFullJSON()\n };\n if (request.original) {\n message.originalParseObject = request.original._toFullJSON();\n }\n this.parsePublisher.publish(type, JSON.stringify(message));\n }", "title": "" }, { "docid": "8f43ab7d4f6239f93103147edb068e15", "score": "0.50359756", "text": "parseResponse(response) {\n\t\tresponse = this.cleanupXML(response);\n\t\tparseString(response, (err, result) => {\n\t\t\tconst sessionId = result.length;\n\t\t\t// console.log('sessionId',sessionId);\n\t\t\t// console.log(result);\n\t\t\treturn (result);\n\t\t});\n\t}", "title": "" }, { "docid": "6a1ef60d13091787b6d0a3d4026d4ef6", "score": "0.5020952", "text": "function realtimeParsingUpdate(){\n\n // Enable pusher logging - don't include this in production\n Pusher.log = function(message) {\n if (window.console && window.console.log) {\n window.console.log(message);\n }\n };\n\n var pusher = new Pusher('295955d8e06f90740986');\n var channel = pusher.subscribe('parsing_log');\n channel.bind('parse_operations', function(data) {\n id = data.id\n $(\"#success_rows\" + id).text(data.success_rows);\n $(\"#failed_rows\" + id).text(data.failed_rows);\n $(\"#total_rows\" + id).text(data.total_rows);\n $(\"#status\" + id).text(data.status);\n }); \n }", "title": "" }, { "docid": "a8b0b60e26334ca6db73da48f21abe79", "score": "0.50177985", "text": "function parse(m){\nconsole.log(\"Parsing: \" + m);\nif(m.substr(0,4) == \"help\"){\n\thelp();\n}\nelse if(m.substr(0,2) == \"gl\"){\n\tgl(m.substr(2,m.length));\n}\nelse{\n\tinvalid();\n}\n}", "title": "" }, { "docid": "391f819933ffd62c8124216abd79245a", "score": "0.49972108", "text": "function parse(item) {\n if (!item) return null;\n\n return {\n message_id: item.message_id.S,\n audio_url: item.audio_url.S,\n sender_email: item.sender_email.S,\n sender_name: item.sender_name && item.sender_name.S,\n recipient_email: item.recipient_email.S,\n created: +item.created.N,\n handled: item.handled && +item.handled.N,\n handled_by: item.handled_by && item.handled_by.S,\n outcome: item.outcome && item.outcome.S,\n read: item.read && +item.read.N,\n };\n}", "title": "" }, { "docid": "fa90396a1323c9dbdad324ff8dcf5a58", "score": "0.4988825", "text": "function ParserPrototype() {}", "title": "" }, { "docid": "d7e906ef7f58f27db79f7a58e98b1459", "score": "0.4980532", "text": "componentWillMount() {\n // need something to replace parse??\n }", "title": "" }, { "docid": "acbb91ae020a7d0b10c31a4e89d52440", "score": "0.49777287", "text": "getParser(){\n \treturn this.parser;\n }", "title": "" }, { "docid": "0644e8fb45e84f1f98dde409ae58590f", "score": "0.49702936", "text": "_parse()\n {\n switch (this._mode) {\n case HTMLParser.Mode.Data:\n return this._parseData();\n case HTMLParser.Mode.ScriptData:\n return this._parseScriptData();\n case HTMLParser.Mode.TagOpen:\n return this._parseTagOpen();\n case HTMLParser.Mode.Attr:\n return this._parseAttr();\n case HTMLParser.Mode.CData:\n return this._parseCData();\n case HTMLParser.Mode.Doctype:\n return this._parseDoctype();\n case HTMLParser.Mode.Comment:\n return this._parseComment();\n case HTMLParser.Mode.BogusComment:\n return this._parseBogusComment();\n }\n\n throw \"Missing parser mode\";\n }", "title": "" }, { "docid": "86cabd28046e55b62fab4846b3188ddb", "score": "0.49584797", "text": "onConnect() {}", "title": "" }, { "docid": "f6fad7dcfc1e22a695bf6bd2ed6b1340", "score": "0.49403748", "text": "function cb (_error, _response, _context) {\r\n var errorResponse;\r\n if (_error) {\r\n errorResponse = _BaseController.validateResponse(_context, \"sendString\");\r\n callback(errorResponse.error, errorResponse.response, errorResponse.context);\r\n } else if (_response.statusCode >= 200 && _response.statusCode <= 206) {\r\n var parsed = JSON.parse(_response.body);\r\n parsed = new _ServerResponse(parsed);\r\n callback(null, parsed, _context);\r\n } else {\r\n errorResponse = _BaseController.validateResponse(_context, \"sendString\");\r\n callback(errorResponse.error, errorResponse.response, errorResponse.context);\r\n }\r\n }", "title": "" }, { "docid": "1a13b68713b281b6efb59c55a6969047", "score": "0.49350363", "text": "function handleParsing(input) {\n var tempReturnObj = {\"ipaddress\": null, \"language\": null, \"software\": null};\n tempReturnObj.ipaddress = input.headers.host;\n tempReturnObj.language = input.headers['accept-language'].split(',')[0];\n tempReturnObj.software = input.headers['user-agent'].split('(')[1].split(')')[0];\n\n return tempReturnObj;\n}", "title": "" }, { "docid": "53fdfdc340ae18e1f22fd7b318192e5b", "score": "0.49330223", "text": "function TextParser() { }", "title": "" }, { "docid": "397dc975a7d1cab91eea1c0fa4ab5a70", "score": "0.49289098", "text": "function parseData() {\n\tif (pos_reqs.readyState == 4 && pos_reqs.status == 200) {\n\t\tpos_data = JSON.parse(pos_reqs.responseText);\n\t\tfor (elem in pos_data) {\n\t\t\tdisplayPos(elem);\n\t\t}\n\t} else if (pos_reqs.readyState == 4 && pos_reqs.status != 200){\n\t\talert(\"Oh no, an error occurred!\");\n\t}\t\n}", "title": "" }, { "docid": "eb68071947d417037d3450f18367ab64", "score": "0.4928189", "text": "function parse ( $this, href )\r\n\t\t {\r\n\t\t\t// Regular expression taken from phpjs\r\n\t\t\tvar\tre\t\t= /^(?:([^:\\/?#]+):)?(?:\\/\\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\\/?#]*)(?::(\\d*))?))?()(?:(()(?:(?:[^?#\\/]*\\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/ ;\r\n\t\t\tvar\tmatch\t\t= re. exec ( href ) ;\t\t\t// Get pattern matches\r\n\t\t\tvar\tpath\t\t= match [9] ;\t\t\t\t// Get path, including requested page\r\n\t\t\tvar\tlast_slash\t= path. lastIndexOf ( '/' ) ;\t\t// Index of last slash before the requested page, or -1\r\n\t\t\tvar\tquery\t\t= match [12] ;\t\t\t\t// Get query string, without the leading '?'\r\n\t\t\tvar\tanchor\t\t= match [13] ;\r\n\r\n\t\t\t// Get components that do not need any interpretation\r\n\t\t\tif ( anchor )\r\n\t\t\t\t$this. __components. anchor\t\t= anchor ;\r\n\r\n\t\t\tif ( match [6] )\r\n\t\t\t\t$this. __components. host\t\t= match [6] ;\r\n\r\n\t\t\tif ( match [5] )\r\n\t\t\t\t$this. __components. password\t\t= match [5] ;\r\n\r\n\t\t\tif ( match [4] )\r\n\t\t\t\t$this. __components. user\t\t= match [4] ;\r\n\r\n\t\t\tif ( match [7] )\r\n\t\t\t\t$this. __components. port\t\t= match [7] ;\r\n\r\n\t\t\tif ( match [1] )\r\n\t\t\t\t$this. __components. protocol\t\t= match [1] ;\r\n\r\n\t\t\t// Process the part path of the url\r\n\t\t\tif ( last_slash == -1 )\r\n\t\t\t {\r\n\t\t\t\t// No directory separator ; just store the requested page name if one exists\r\n\t\t\t\tif ( path. length )\r\n\t\t\t\t\t$this. __components. page\t= path ;\r\n\t\t\t }\r\n\t\t\t// Directory separator has been found before the end of the path string : split directory and page parts\r\n\t\t\telse if ( last_slash < path. length - 1 )\r\n\t\t\t {\r\n\t\t\t\t$this. __components. directory\t= path. substring ( 0, last_slash + 1 ) ;\r\n\t\t\t\t$this. __components. page\t= path. substring ( last_slash + 1 ) ;\r\n\t\t\t }\r\n\t\t\t// A directory separator has been found, but at the end of the string : this means that there is a path\r\n\t\t\t// but no page name\r\n\t\t\telse \r\n\t\t\t\t$this. __components. directory\t= path ;\r\n\r\n\t\t\t// Parse the query string if specified\r\n\t\t\tquery && query . length && parse_query ( $this, query , '?', 'query' , '__parameters'\t, false, true ) ;\r\n\t\t\tanchor && anchor. length && parse_query ( $this, anchor, '#', 'anchor', '__anchorParameters', false, true ) ;\r\n\r\n\t\t\t// Rebuild computed fields\r\n\t\t\trebuild_computed_fields ( $this ) ;\r\n\t\t }", "title": "" }, { "docid": "638aea225bda26d674f780296d8904c2", "score": "0.49257746", "text": "function parseXML(resp)\n{\n\treturn resp;\n}", "title": "" }, { "docid": "505e0be59234dd8cd19c8a357e7e2c5a", "score": "0.492467", "text": "function getSongEndpoint(){\t\t\n}", "title": "" }, { "docid": "698d9c97c36c294862687a9f89e6478d", "score": "0.49236995", "text": "function requestSuccess( msg )\n{\n\tparseResult( msg );\n}", "title": "" }, { "docid": "695e5910a8c7e1fd240e0fe82c62a5b1", "score": "0.49007732", "text": "function parse_in(data) {\n\t// Bounce if not enabled\n\tif (config.emulate.nbt !== true) return data;\n\n\treturn data;\n}", "title": "" }, { "docid": "94e41266e78f322db12290295d8cdbe8", "score": "0.48999047", "text": "parse() {\n commander.parse(process.argv);\n }", "title": "" }, { "docid": "805f2ec6c259d6fe7f425a32f7be904c", "score": "0.48992875", "text": "function ServerInfo(serverInfo$){\n}", "title": "" }, { "docid": "39f4569f6e1b6258089c97178440eb3d", "score": "0.48903897", "text": "function TextParser() {\n}", "title": "" }, { "docid": "566f6e944bd6ebe0dda334cb21c2b7bd", "score": "0.4883944", "text": "function parse_out(data) {\n\t// Bounce if not enabled\n\tif (config.emulate.nbt !== true && config.retrofit.nbt !== true) return data;\n\n\tswitch (data.src.id) {\n\t\tcase 0x273 :\n\t\tcase 0x563 : return decode_status_module(data);\n\n\t\tcase 0x277 : { // NBT ACK to rotational initialization message\n\t\t\tdata.command = 'rep';\n\t\t\tdata.value = 'CON => NBT : ACK init';\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 0x34E : { // NBT navigation information\n\t\t\tdata.command = 'bro';\n\t\t\tdata.value = 'Navigation system information';\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 0x38D : return;\n\t\tcase 0x5E3 : {\n\t\t\tdata.command = 'bro';\n\t\t\tdata.value = 'Services';\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 0x12F :\n\t\tcase 0x4F8 : return decode_ignition(data);\n\t}\n\n\treturn data;\n}", "title": "" }, { "docid": "b22f486c5e9eb882d931b7efad755ed9", "score": "0.4878639", "text": "function respondError(err) {\n var error = self.server.error(Server.errors.PARSE_ERROR, null, String(err));\n var response = utils.response(error, undefined, undefined, self.options.version);\n utils.JSON.stringify(response, options, function(strErr, body) {\n if(strErr) {\n body = ''; // we tried our best.\n }\n wsock.send(body);\n });\n }", "title": "" }, { "docid": "f7da559f8782b4a0446b165b6d52b9cd", "score": "0.48772374", "text": "function parseURL(request, response){\n\tvar parseQuery = true; //parseQueryStringIfTrue\n var slashHost = true; //slashDenoteHostIfTrue\n var urlObj = url.parse(request.url, parseQuery , slashHost );\n console.log('path:');\n console.log(urlObj.path);\n console.log('query:');\n console.log(urlObj.query);\n //for(x in urlObj.query) console.log(x + ': ' + urlObj.query[x]);\n\treturn urlObj;\n\n}", "title": "" }, { "docid": "948e5f2f3712513234860c194766e3ae", "score": "0.48720276", "text": "function run(){\n \n //AttributeDecl server at run.ceylon (3:1-3:36)\n var $2jr=getHapi().createServer();\n $2jr.connection(getServerOptions());\n $2jr.start(m$2jq.$JsCallable((function($2js){\n /*BEG dynblock*/\n (typeof console==='undefined'||console===null?m$2jq.throwexc(m$2jq.Exception(\"Undefined or null reference: console\"),'9:3-9:9','run.ceylon'):console).log(\"Server running at:\",$2jr.info.uri);\n /*END dynblock*/\n }),[{nm:'error',mt:'prm',$t:{t:m$2jq.$_Object}}],{Arguments$Callable:{t:'T',l:[{t:m$2jq.$_Object}]},Return$Callable:{t:m$2jq.Anything}}));\n ($2jt=\"GET\",$2ju=\"/\",$2jv=(function($2jw,$2jx){\n \n //AttributeDecl res at run.ceylon (21:3-21:47)\n var $2jy=ceylonReply($2jx,\"success\");\n $2jy.type(\"text/plain\");\n $2jy.header(\"X-Custom\",\"some-value\");\n }),($2jz=$2jr,m$2jq.JsCallable($2jz,m$2jq.nn$($2jz)?$2jz.route:null))($2jt,$2ju,$2jv));\n var $2jt,$2ju,$2jv,$2jz;\n}", "title": "" }, { "docid": "0523cc04000b953696b4447ca9b7b7fa", "score": "0.48648062", "text": "function TextParser() {}", "title": "" }, { "docid": "0523cc04000b953696b4447ca9b7b7fa", "score": "0.48648062", "text": "function TextParser() {}", "title": "" }, { "docid": "0523cc04000b953696b4447ca9b7b7fa", "score": "0.48648062", "text": "function TextParser() {}", "title": "" }, { "docid": "0523cc04000b953696b4447ca9b7b7fa", "score": "0.48648062", "text": "function TextParser() {}", "title": "" }, { "docid": "0523cc04000b953696b4447ca9b7b7fa", "score": "0.48648062", "text": "function TextParser() {}", "title": "" }, { "docid": "32eea45e884e7356710306d77d3a1be3", "score": "0.48641318", "text": "function parseQuery() {\n // test or yaml file?\n var url = getQueryVariable(\"1\");\n if (url !== \"\") {\n slot1.value = url;\n }\n url = getQueryVariable(\"2\");\n if (url !== \"\") {\n slot2.value = url;\n }\n // tangram version\n var lib = getQueryVariable(\"lib1\");\n if (lib !== \"\") {\n library1.value = lib;\n }\n lib = getQueryVariable(\"lib2\");\n if (lib !== \"\") {\n library2.value = lib;\n }\n // use prerendered images checkbox\n var check = getQueryVariable(\"useimages1\");\n if (check) {\n useImages1.checked = true;\n }\n check = getQueryVariable(\"useimages2\");\n if (check) {\n useImages2.checked = true;\n }\n // start immediately\n url = getQueryVariable(\"go\");\n if (url !== \"\") {\n get('goButton').click();\n }\n}", "title": "" }, { "docid": "21bed966b796f6bd53b9e62bcb4338d5", "score": "0.48606065", "text": "function defaultParser(data) { return data; }", "title": "" }, { "docid": "3b33fbeee95d1398c9c565e82c2d1fd8", "score": "0.4845264", "text": "parse(attrs) {\n return {\n baseCommitID: attrs.base_commit_id || null,\n interdiffRevision: attrs.interdiff_revision,\n isDraftDiff: attrs.is_draft_diff,\n isInterdiff: attrs.is_interdiff,\n latestRevision: attrs.latest_revision,\n revision: attrs.revision,\n tipCommitID: attrs.tip_commit_id || null,\n };\n }", "title": "" }, { "docid": "721f4d29f59825fc1e8fd3ab6c379757", "score": "0.48420894", "text": "function parseDocument(){\n\t\n\tconsole.log(\"portal.ver: \"+portal.ver);\n\n\tvar pdid = localStorage[\"pdid\"];\n\tconsole.log(\"pdid: \"+pdid);\n\n\tvar drid = localStorage[\"drid\"];\n\tconsole.log(\"drid: \"+drid);\n\n\tif(pdid == null || drid == null){\n\t\tconsole.log(\"pdid or drid is null, now trying to get pdid from backend\");\n\t\tvar drid = acak(1,100000000000,0);\n\t\tvar parameters = {};\n\t\tparameters.ver = portal.ver;\n\t\tparameters.drid = drid;\n\t\tparameters.userDevice = checkDevice();\n\n\t\tgetData(portal.url_api+'registerNewDevice', 'POST', 'json', parameters, drid, registerNewDevice);\n\t\t\n\t}else{\n\t\tparseWidget();\n\t}// end pdid drid null\n\n}", "title": "" }, { "docid": "fd2b55b4bc44ae921133afdefae84be5", "score": "0.48348397", "text": "function handleResult(response){\n parseResult(response.responseXML)\n}", "title": "" }, { "docid": "bde1a6f50ed31c1b2a2f90e8931eeb72", "score": "0.4819056", "text": "static getServers(Parse, ownerPointer, callback) {\n\t\t\tlet Server = Parse.Object.extend('Server');\n\t\t\tlet query = new Parse.Query(Server);\n\n\t\t\tquery.equalTo('accountPointer', ownerPointer);\n\t\t\tquery.find({\n\t\t\t\tsuccess(results) {\n\t\t\t\t\treturn callback(null, results);\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\treturn callback(error);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "9883dfff2e02fda7f6c2a0e79abb6b1d", "score": "0.48008078", "text": "parse(generator, line) {\n throw new Error('Not implemented!');\n }", "title": "" }, { "docid": "880e99b6b44399ab4f735c79fd8bfe00", "score": "0.48007545", "text": "function EfwServerCmd() {}", "title": "" }, { "docid": "9bfde7be4ad02d64256f392d8b1c2d9a", "score": "0.4797465", "text": "onConn() {}", "title": "" }, { "docid": "37a07e230c648c562bde66d7a32b8c61", "score": "0.4793034", "text": "function BinaryParser() {}", "title": "" }, { "docid": "37a07e230c648c562bde66d7a32b8c61", "score": "0.4793034", "text": "function BinaryParser() {}", "title": "" }, { "docid": "37a07e230c648c562bde66d7a32b8c61", "score": "0.4793034", "text": "function BinaryParser() {}", "title": "" }, { "docid": "37a07e230c648c562bde66d7a32b8c61", "score": "0.4793034", "text": "function BinaryParser() {}", "title": "" }, { "docid": "37a07e230c648c562bde66d7a32b8c61", "score": "0.4793034", "text": "function BinaryParser() {}", "title": "" }, { "docid": "37a07e230c648c562bde66d7a32b8c61", "score": "0.4793034", "text": "function BinaryParser() {}", "title": "" }, { "docid": "55ec47975ffe3e38dff63638d49e45f7", "score": "0.47881308", "text": "function parseSeg(parseState, u8view){\n\tlet lastoffs = parseState.offset;\n\tif(parseState.inclus && parseState.readingId === false){\n\t\treturn lastoffs;// need to call parseClus first\n\t}\n\twhile(parseState.offset < u8view.length){\n\t\tlet id = readId(parseState, u8view);\n\t\tif(id === false){\n\t\t\treturn lastoffs; // end of bytes while reading ID\n\t\t}\n\t\tlastoffs = parseState.offset;\n\t\tlet elLen = readWebmSize(parseState, u8view);\n\t\tparseState.postChunk = (elLen === null ? null : parseState.offset + elLen);\n\t\tif(id == 0x1A45DFA3){\n\t\t\tconsole.log('WEBM: EBML start '+lastoffs+'-'+JSON.stringify(parseState.postChunk));\n\t\t}else if(id == 0x1549a966){\n\t\t\tconsole.log('WEBM: Info '+lastoffs+'-'+JSON.stringify(parseState.postChunk));\n\t\t}else if(id == 0x1654ae6b){\n\t\t\tconsole.log('WEBM: Tracks '+lastoffs+'-'+JSON.stringify(parseState.postChunk));\n\t\t}else if(id == 0x114d9b74){\n\t\t\tconsole.log('WEBM: SeekHead '+lastoffs+'-'+JSON.stringify(parseState.postChunk));\n\t\t}else if(id == 0x1F43B675){\n\t\t\tparseState.inclus = true;\n\t\t\tif(parseState.postChunk !== null){ //just ate a cluster opening\n\t\t\t\tpegWebmSize(lastoffs, u8view);//Peg it to undetermined size, so we don't worry about lost segments messing up cluster size\n\t\t\t\tparseState.postChunk = null;\n\t\t\t}\n\t\t\tbreak;// now you need to call parseClus again\n\t\t}else{\n\t\t\tconsole.log('WEBM: unknown id ' + id.toString(16));\n\t\t\tif(!id)\n\t\t\t\tbreak;\n\t\t}\n\t\tif(elLen === null){\n\t\t\tbreak;\n\t\t}\n\t\tparseState.offset = parseState.postChunk;\n\t}\n\treturn lastoffs;\n}", "title": "" }, { "docid": "c8250e9b1d96f4a464192a4e69226f47", "score": "0.47870168", "text": "static parse(uri)\r\n {\r\n uri = Grammar.parse(uri, 'SIP_URI');\r\n\r\n if (uri !== -1)\r\n {\r\n return uri;\r\n }\r\n else\r\n {\r\n return undefined;\r\n }\r\n }", "title": "" }, { "docid": "8afbfbbb4a7e46180a2dfd116a149e96", "score": "0.47802538", "text": "function parse_message(msg, socket, user){\n let user_name = undefined;\n let color = undefined;\n \n if (msg[0] === '/'){\n\tmsgParts = msg.split(\" \");\n\tmessage = parse_command(msgParts, socket, user);\n\tuser_name = \"server\";\n\tcolor = \"#e24646\";\n }\n else if (msg == ''){\n\tmessage = undefined;\n }else{\n\tmessage = msg;\n }\n \n return {'message': message, 'user': user_name, 'color': color };\n}", "title": "" }, { "docid": "eb169c8c1f2682e7e744e0198d3bdf36", "score": "0.4779515", "text": "function respond(parsedData, callback) {\n //console.log('responding... socketId: ' + socketId + ' requestUri: '+parsedData.RequestURI);\n\n var userCallBack = null;\n var request = null;\n var response = null;\n var parameters = null;\n var requestMapKey = '';\n\n isKeepAlive = !((parsedData.httpVersion === '1.0' && parsedData['connection'].toString().toLowerCase() === 'keep-alive') || parsedData['connection'] === 'close');\n\n //console.log('isKeepAlive = ' + isKeepAlive);\n //console.log('parsedData.RequestURI: ' + parsedData.RequestURI);\n\n // TODO: add the status event to the requestMap (both to POST and GET)\n if (parsedData.RequestURI === '/status') {\n writeStatus(callback);\n return;\n }\n\n //check if requestURI matches key's format\n function matches(key, requestURI) {\n //remove leading and trailing whitespace\n key = key.toString().trim();\n requestURI = requestURI.toString().trim();\n\n if (key.charAt(0)==='/') {\n key = key.slice(1);//remove the / from the beginning of the string\n }\n if (requestURI.charAt(0)==='/') {\n requestURI = requestURI.slice(1);//remove the / from the beginning of the string\n }\n\n //TODO Don't remove the / from the end of the string\n // if (key.charAt(key.length-1)==='/') {\n // key = key.slice(0, -1);//remove the / from the end of the string\n // }\n // if (requestURI.charAt(requestURI.length-1)==='/') {\n // requestURI = requestURI.slice(0, -1);//remove the / from the end of the string\n // }\n\n var splitKey = key.split('/');\n var splitRequestURI = requestURI.split('/');\n if (splitKey.length!==splitRequestURI.length) {\n // console.log('lengths dont match');\n return false;\n }\n\n for (var i=0; i<splitKey.length; ++i) {\n // console.log('splitRequestURI[i]: ' + splitRequestURI[i]);\n // console.log('splitKey[i]: ' + splitKey[i]);\n if (splitKey[i].charAt(0)===':') {\n //console.log('continue');\n continue;\n }\n if (splitKey[i]!==splitRequestURI[i]) {\n // console.log('params dont match');\n return false;\n }\n }\n\n return true;\n }\n\n if (parsedData.Method === 'GET') {\n for (var key in requestMapGet) {\n // console.log('KEY: ' + key);\n // console.log('parsedData.RequestURI: ' + parsedData.RequestURI);\n if (matches(key, parsedData.RequestURI)) {\n // console.log('matches');\n requestMapKey = key;\n break;\n }\n // console.log('doesnt match');\n }\n }\n\n if (parsedData.Method === 'POST') {\n for (var key in requestMapPost) {\n if (matches(key, parsedData.RequestURI)) {\n requestMapKey = key;\n break;\n }\n }\n }\n\n //console.log('requestMapKey: ' + requestMapKey);\n //console.log('parsedData.Method: ' + parsedData.Method);\n\n if (requestMapGet[requestMapKey] && parsedData.Method === 'GET') {\n userCallBack = requestMapGet[requestMapKey];\n // invoke the user-callback\n request = createRequestObject(parsedData);\n response = createResponseObject(callback);\n parameters = createParameters(parsedData['RequestURI'], requestMapKey);\n try {\n userCallBack.call(request, response, parameters);\n }\n catch(e) {\n reportError(500, e.message , callback);\n }\n return;\n } else if (requestMapPost[requestMapKey] && parsedData.Method === 'POST') {\n userCallBack = requestMapPost[requestMapKey];\n // invoke the user-callback\n request = createRequestObject(parsedData);\n response = createResponseObject(callback);\n parameters = createParameters(parsedData['RequestURI'], requestMapKey);\n try {\n userCallBack.call(request,response,parameters);\n }\n catch(e) {\n reportError(500, e.message, callback);\n }\n return;\n }\n\n staticResponse(parsedData, callback);\n }", "title": "" }, { "docid": "80981f1ef89b4dbd369884be1679b4a3", "score": "0.47738978", "text": "processRespone(response) {\r\n console.log(response)\r\n }", "title": "" }, { "docid": "d5b32ad7d9c09831b171b13c166f6683", "score": "0.4765871", "text": "parse(buffer) {\n this.checkBuffer(buffer);\n return this._parse(buffer.slice(0, this.size));\n }", "title": "" }, { "docid": "86f5db12120f715a256ac157285e787a", "score": "0.4764995", "text": "function cb (_error, _response, _context) {\r\n var errorResponse;\r\n if (_error) {\r\n errorResponse = _BaseController.validateResponse(_context, \"sendDynamic\");\r\n callback(errorResponse.error, errorResponse.response, errorResponse.context);\r\n } else if (_response.statusCode >= 200 && _response.statusCode <= 206) {\r\n var parsed = JSON.parse(_response.body);\r\n parsed = new _ServerResponse(parsed);\r\n callback(null, parsed, _context);\r\n } else {\r\n errorResponse = _BaseController.validateResponse(_context, \"sendDynamic\");\r\n callback(errorResponse.error, errorResponse.response, errorResponse.context);\r\n }\r\n }", "title": "" }, { "docid": "2f1eb5b0beecbe65b11d6a652607f99b", "score": "0.47603583", "text": "state_change() {\n let status = this.handle.status;\n if ( this.handle.readyState == 4 && status == 200 ) {\n this.parse();\n //this.ready( this.parse() ); // format the data as JSON\n } // end if ready\n }", "title": "" }, { "docid": "e992566e816de80b9a19b6b203497669", "score": "0.47567424", "text": "function parseFrame(frame){\n\t//console.log('fame', frame);\n\ttry {\n\t\tvar o = eval(\"(\"+frame /*.replace(/\\\\u[0-9A-F]{4}/gi, function(a){ return a.substring(1); }) */ +\")\"); //JSON.parse(frame);\n\t\tswitch(o.action){\n\t\t\tcase 'res':\n\t\t\t\t//console.log('gonna send!', o.res);\n\t\t\t\tclient && client.send({ action: 'res', res: o.res });\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'puts':\n\t\t\tcase 'print':\n\t\t\t\t//console.log(o.msg.split(\"\").map(function(c){ return c.charCodeAt(0); }).join(\", \"));\n\t\t\t\tsys[o.action](o.msg /*.replace(/u0{0,4}([A-Za-a-z1-9]{0,4})/g, function($0, $1){ \n\t\t\t\t\treturn String.fromCharCode(parseInt($1, 16)); \n\t\t\t\t})*/);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'notify':\n\t\t\t\tvar opts = {};\n\t\t\t\tif(o.title){ opts.title = (o.title||\"\").replace(/([\\(\\)])/g, '\\\\$1'); }\n\t\t\t\tgrowl.notify(o.msg, opts);\n\t\t\t\tbreak;\n\t\t}\n\t} catch(e){\n\t\tconsole.log(e);\n\t}\n}", "title": "" }, { "docid": "ba0f86f223d872a7d248a59452fb3449", "score": "0.4750626", "text": "function processReply(ev) {\n latestMsg = ev\n if (ev.type == \"pong\") {\n //just ignore these\n console.log(\"Recieved hb\")\n }\n else if (ev.type == \"hello\") {\n //sets up initial info about railroad\n JMRIhellomsg = ev\n layoutRailroadName = ev.data.railroad\n }\n else if (ev.type == \"throttle\") {\n //send to throttle info handler\n JSONhandleType_throttle(ev)\n }\n else if (ev.type == \"sensor\") {\n //send to sensor info handler\n }\n \n else if (ev.type == \"turnout\") {\n //send to turnout info handler\n }\n else if (ev.type == \"power\") {\n //send to layout power info handler\n JSONhandleType_power(ev)\n }\n else if (ev.list) {\n //send to list handler\n }\n}", "title": "" }, { "docid": "1ca5afae2ca5802e333c840f1ec823d0", "score": "0.47498563", "text": "function wikiResponseParser(broker, responseStatus, xmlDoc) {\r\n if (responseStatus == 200 && xmlDoc != null) {\r\n\t\t// for compatibility with rss\r\n\t\tvar lastModified = new Date();\r\n\t\t\r\n // init result items array\r\n var items = [];\r\n\r\n\t\tvar elements = xmlDoc.getElementsByTagName(\"p\");\r\n\r\n\t\tfor (var i = 0; i < elements.length; i++) {\r\n\t\t\tvar pagetitle = elements[i].getAttribute(\"title\");\r\n items.push({ id: \"\"+i, title: pagetitle});\r\n\t\t}\r\n\r\n\t\tlastWikiSearchResultCountWas = elements.length;\r\n // update was completed successfully\r\n return { status: \"ok\", lastModified: lastModified, items: items };\r\n } else {\r\n // update failed\r\n return { status: \"error\" };\r\n }\r\n}", "title": "" }, { "docid": "30b980f090daa6186980c269c8aa29c3", "score": "0.4748644", "text": "extract(){ \n\t\tif(this.str.match(/\\d+[.]\\d+|\\d+\\d+|[+]\\d{12}|[0]\\d{12}|\\d{1,2}[:][0-5][0-9]|\\d{1,4}[-]\\d{1,2}[-]\\d{1,4}|\\d{1,4}\\d{1,2}\\d{1,4}/)){\n\t\t\tthis.specNum=this.str;\n\t\t\tconst obj2=new SpecialCharNum(this.ref,this.specNum);\n\t\t\tobj2.check();\n\t\t}\n\t\telse if(this.str.match(/^\\d+$/)){\n\t\t\tthis.card=this.str;\n\t\t\tconst obj1=new Cardinal(this.ref,this.card);\n\t\t\tobj1.send();\n\t\t}\n\t\telse{\n\t\t\tthis.prepost=this.str;\n\t\t\tconst obj3=new PrePostfix(this.ref,this.prepost);\n\t\t\tobj3.extract();\n\t\t}\n\t}", "title": "" }, { "docid": "584f4a6e5dfd4cbbba4486a45d0bd252", "score": "0.47439557", "text": "function postParseOptions(options) {\n //\n }", "title": "" }, { "docid": "affe72c6e07bad647823c435a8799416", "score": "0.47438768", "text": "function parsePCPostElement(e) {\n return {\n no: parseInt([e.find('.gall_tit a').first().attr('href').split(/[&?]/gi).find((c) => c.startsWith('no='))].map(s => s ? s : 'no=-1')[0].split('no=')[1]),\n url: location.origin + e.find('.gall_tit a').attr('href'),\n gall_subject: e.find('.gall_subject').text(),\n subject: e.find('.gall_tit a').first().text(),\n subject_type: e.find('.gall_tit em').first().attr('class').split(' ').pop(),\n comments: e.find('.gall_tit .reply_num')[0] ? (e.find('.gall_tit .reply_num').text().split('/')[0] ? parseInt(e.find('.gall_tit .reply_num').text().split('/')[0].replace(/[\\[\\]]/g, '')) : 0) : 0,\n voice_comments: e.find('.gall_tit .reply_num')[0] ? (e.find('.gall_tit .reply_num').text().split('/')[1] ? parseInt(e.find('.gall_tit .reply_num').text().split('/')[1].replace(/[\\[\\]]/g, '')) : 0) : 0,\n uid: e.find('.gall_writer').data('uid'),\n ip: e.find('.gall_writer').data('ip'),\n nick: e.find('.gall_writer').data('nick'),\n nick_type: e.find('.writer_nikcon img')[0] ? e.find('.writer_nikcon img').attr('src').split('.').slice(-2).shift().split('/').slice(-1).pop() : void 0,\n date: e.find('.gall_date').attr('title'),\n count: parseInt(e.find('.gall_count').text()),\n recommends: parseInt(e.find('.gall_recommend').text()),\n }\n }", "title": "" }, { "docid": "ce7adbe0ea4885996c9569cdad128283", "score": "0.47435227", "text": "function BinaryParser() { }", "title": "" }, { "docid": "7987a1b04ee7d61e39628d84ebb1422b", "score": "0.47397205", "text": "_parseStateUpdate(lines, i)\n {\n i = this._parseInventory(lines, i);\n i = this._parseDropOrTake(lines, i);\n return this._parseMessage(lines, i);\n }", "title": "" }, { "docid": "fc89cc254be0bb744129b66565ea70a0", "score": "0.47380415", "text": "function lrequest() {}", "title": "" }, { "docid": "332df15cca74941979f89cd321412326", "score": "0.47366604", "text": "function Parser() {\n this.i = 0;\n this._buf = new Buffer(4);\n this.state = 'meta';\n this.format('none');\n}", "title": "" }, { "docid": "a9f4efb0d900f9a28bdfd5a4526d019a", "score": "0.47364336", "text": "async parse() {\n return new Promise((resolve, reject) => {\n let body = [];\n let { headers, method } = this.request;\n\n if (method === 'POST' || method === 'PUT') {\n this.request.on('error', err => {\n this.emit('error', err);\n reject(err);\n }).on('data', chunk => {\n body.push(chunk);\n }).on('end', () => {\n body = Buffer.concat(body).toString();\n if (headers['content-type'] && headers['content-type'].toLowerCase() === 'application/json') {\n body = JSON.parse(body);\n }\n\n this.payload = body;\n resolve();\n });\n } else {\n // ready without parsing the body\n resolve();\n }\n });\n }", "title": "" }, { "docid": "d5a78b0f58e109b01080318492de03cc", "score": "0.47316086", "text": "parse(instance, content) {\n\t\tlet rawDraftContentState = instance.getRawDraftContentState(content);\n\t\t//console.log(rawDraftContentState);\n\t\t\n\t\tinstance.props.socket.send(`${window.dest}/editor/push`, { }, rawDraftContentState);\n\t}", "title": "" } ]
80ed8b39cb576b2c681517b9a6899531
A list item can contain a description.
[ { "docid": "5c49831af160c178301261c1728333b2", "score": "0.70696783", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'description');\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(ListDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(children) ? content : children\n );\n}", "title": "" } ]
[ { "docid": "ab5dbb6a9129e7333ba09b9b4a4c2c7b", "score": "0.71695894", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = (0, _classnames.default)(className, 'description');\n var rest = (0, _lib.getUnhandledProps)(ListDescription, props);\n var ElementType = (0, _lib.getElementType)(ListDescription, props);\n return _react.default.createElement(ElementType, (0, _extends2.default)({}, rest, {\n className: classes\n }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "title": "" }, { "docid": "e30be1698d884a7f19bfa3e803e51e77", "score": "0.7142133", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, 'description');\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(ListDescription, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(ListDescription, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "e30be1698d884a7f19bfa3e803e51e77", "score": "0.7142133", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, 'description');\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(ListDescription, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(ListDescription, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "7e382f36ed528bbbcf24d1d7ff543824", "score": "0.71400684", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = (0, _classnames2.default)(className, 'description');\n var rest = (0, _lib.getUnhandledProps)(ListDescription, props);\n var ElementType = (0, _lib.getElementType)(ListDescription, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "title": "" }, { "docid": "76701bb7b03378769ec8e9e0c05a7e8e", "score": "0.7119242", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'description');\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(ListDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "3e75d2cfe757bc18f8f341114429b450", "score": "0.71133775", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'description');\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"s\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getElementType */])(ListDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "3e75d2cfe757bc18f8f341114429b450", "score": "0.71133775", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'description');\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"s\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getElementType */])(ListDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "b2ed4e63c6c829df34e0f4f3bfd0eec8", "score": "0.7108343", "text": "function ListDescription(props) {\n\t var children = props.children,\n\t className = props.className,\n\t content = props.content;\n\t\n\t var classes = (0, _classnames2.default)(className, 'description');\n\t var rest = (0, _lib.getUnhandledProps)(ListDescription, props);\n\t var ElementType = (0, _lib.getElementType)(ListDescription, props);\n\t\n\t return _react2.default.createElement(\n\t ElementType,\n\t (0, _extends3.default)({}, rest, { className: classes }),\n\t _lib.childrenUtils.isNil(children) ? content : children\n\t );\n\t}", "title": "" }, { "docid": "50ee7fc890c62d6d9d224cf0cac926a0", "score": "0.7106454", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'description');\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(ListDescription, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "50ee7fc890c62d6d9d224cf0cac926a0", "score": "0.7106454", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'description');\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(ListDescription, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "60bc3f7add18602053226f8efddbaf0b", "score": "0.71061426", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, 'description');\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(ListDescription, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(ListDescription, props);\n\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(\n ElementType,\n babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, { className: classes }),\n _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "f8a843dd4af0501dabfacb3f24633fe9", "score": "0.7102926", "text": "function ItemDescription(props) {\n\t var children = props.children;\n\t var className = props.className;\n\t var content = props.content;\n\t\n\t var classes = (0, _classnames2.default)(className, 'description');\n\t var rest = (0, _lib.getUnhandledProps)(ItemDescription, props);\n\t var ElementType = (0, _lib.getElementType)(ItemDescription, props);\n\t\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: classes }),\n\t children || content\n\t );\n\t}", "title": "" }, { "docid": "cfbedc70d509b82af785a410c9637a1f", "score": "0.7102883", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = (0, _classnames2.default)(className, 'description');\n var rest = (0, _lib.getUnhandledProps)(ListDescription, props);\n var ElementType = (0, _lib.getElementType)(ListDescription, props);\n\n return _react2.default.createElement(\n ElementType,\n (0, _extends3.default)({}, rest, { className: classes }),\n _lib.childrenUtils.isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "9d3ed8325bca27ef8bb900575cf1d3cd", "score": "0.70993936", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'description');\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"o\" /* getElementType */])(ListDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "a08ab72b7a8ab758063d06f5ded318ce", "score": "0.7096944", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'description');\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(ListDescription, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "a08ab72b7a8ab758063d06f5ded318ce", "score": "0.7096944", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'description');\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(ListDescription, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "a08ab72b7a8ab758063d06f5ded318ce", "score": "0.7096944", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'description');\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(ListDescription, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "9950289d0cb20e0affd31d43644e41a0", "score": "0.7096145", "text": "function ItemDescription(props) {\n\t var children = props.children,\n\t className = props.className,\n\t content = props.content;\n\n\t var classes = (0, _classnames2.default)(className, 'description');\n\t var rest = (0, _lib.getUnhandledProps)(ItemDescription, props);\n\t var ElementType = (0, _lib.getElementType)(ItemDescription, props);\n\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: classes }),\n\t (0, _isNil3.default)(children) ? content : children\n\t );\n\t}", "title": "" }, { "docid": "9ef507a11ecea86602fbb54e35236cdc", "score": "0.7085447", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = (0, _classnames.default)('description', className);\n var rest = (0, _lib.getUnhandledProps)(ItemDescription, props);\n var ElementType = (0, _lib.getElementType)(ItemDescription, props);\n return _react.default.createElement(ElementType, (0, _extends2.default)({}, rest, {\n className: classes\n }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "title": "" }, { "docid": "e53ce06c844fd4917fb05b901211666b", "score": "0.70671403", "text": "function ListDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'description');\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"b\" /* getUnhandledProps */])(ListDescription, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"c\" /* getElementType */])(ListDescription, props);\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_1_lodash_isNil___default()(children) ? content : children\n );\n}", "title": "" }, { "docid": "e11f4075ba86ca6a5ba7e7311fc62e93", "score": "0.7056136", "text": "function ItemDescription(props) {\n\t var children = props.children,\n\t className = props.className,\n\t content = props.content;\n\t\n\t var classes = (0, _classnames2.default)('description', className);\n\t var rest = (0, _lib.getUnhandledProps)(ItemDescription, props);\n\t var ElementType = (0, _lib.getElementType)(ItemDescription, props);\n\t\n\t return _react2.default.createElement(\n\t ElementType,\n\t (0, _extends3.default)({}, rest, { className: classes }),\n\t _lib.childrenUtils.isNil(children) ? content : children\n\t );\n\t}", "title": "" }, { "docid": "0bbe8e11a06d24420e52e9ebb014bfaa", "score": "0.7056093", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('description', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(ItemDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "fcab1eb02df42ee2081984ec29c8f9da", "score": "0.70480084", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('description', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(ItemDescription, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "fcab1eb02df42ee2081984ec29c8f9da", "score": "0.70480084", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('description', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(ItemDescription, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "c09746be5ea02d5c7499c49af7ea28f1", "score": "0.7043141", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = (0, _classnames2.default)('description', className);\n var rest = (0, _lib.getUnhandledProps)(ItemDescription, props);\n var ElementType = (0, _lib.getElementType)(ItemDescription, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "title": "" }, { "docid": "0ca54e1ddd785c829bfe5aac6b1a7406", "score": "0.70431155", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('description', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"s\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getElementType */])(ItemDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "0ca54e1ddd785c829bfe5aac6b1a7406", "score": "0.70431155", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('description', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"s\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getElementType */])(ItemDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "86ffdf09650f2277f7e7197decd7747a", "score": "0.703911", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('description', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(ItemDescription, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(ItemDescription, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "86ffdf09650f2277f7e7197decd7747a", "score": "0.703911", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('description', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(ItemDescription, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(ItemDescription, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "ba94602245ab5cec3f485ad6425b8d2f", "score": "0.70361125", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('description', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"o\" /* getElementType */])(ItemDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "48e83dcdba079e58d928eb2475802e3d", "score": "0.70318186", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('description', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(ItemDescription, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "48e83dcdba079e58d928eb2475802e3d", "score": "0.70318186", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('description', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(ItemDescription, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "48e83dcdba079e58d928eb2475802e3d", "score": "0.70318186", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('description', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(ItemDescription, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "132da464b23217f623d46638025c7dce", "score": "0.7012834", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()('description', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"b\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"c\" /* getElementType */])(ItemDescription, props);\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_1_lodash_isNil___default()(children) ? content : children\n );\n}", "title": "" }, { "docid": "66c811f00fcd2a268c02727b34294d99", "score": "0.7011144", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()('description', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(ItemDescription, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(ItemDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(children) ? content : children\n );\n}", "title": "" }, { "docid": "42c0db3ea8b2a98e4b76aaca38fafc5d", "score": "0.70045644", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = (0, _classnames2.default)('description', className);\n var rest = (0, _lib.getUnhandledProps)(ItemDescription, props);\n var ElementType = (0, _lib.getElementType)(ItemDescription, props);\n\n return _react2.default.createElement(\n ElementType,\n (0, _extends3.default)({}, rest, { className: classes }),\n _lib.childrenUtils.isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "e11cfb477cea4b673579f21aa952deee", "score": "0.6998569", "text": "function ItemDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('description', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(ItemDescription, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(ItemDescription, props);\n\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(\n ElementType,\n babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, { className: classes }),\n _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "fc4591051c298779d00df323c2ec0f2f", "score": "0.68813145", "text": "showDescPart(listItemNo, listItems) {\n return listItemNo !== null ? (\n <div className=\"desc\">{listItems[listItemNo].description}</div>\n ) : null;\n }", "title": "" }, { "docid": "fb59b3faa2f7e6019dc0e60dc43526b6", "score": "0.67079735", "text": "function item(name,description)\n {\n this.name = name;\n this.description = description;\n }", "title": "" }, { "docid": "5959aeea7e70bceb30f6ccab55925703", "score": "0.65031505", "text": "get description() {\n return this.getStringAttribute('description');\n }", "title": "" }, { "docid": "5959aeea7e70bceb30f6ccab55925703", "score": "0.65031505", "text": "get description() {\n return this.getStringAttribute('description');\n }", "title": "" }, { "docid": "5959aeea7e70bceb30f6ccab55925703", "score": "0.65031505", "text": "get description() {\n return this.getStringAttribute('description');\n }", "title": "" }, { "docid": "5959aeea7e70bceb30f6ccab55925703", "score": "0.65031505", "text": "get description() {\n return this.getStringAttribute('description');\n }", "title": "" }, { "docid": "5959aeea7e70bceb30f6ccab55925703", "score": "0.65031505", "text": "get description() {\n return this.getStringAttribute('description');\n }", "title": "" }, { "docid": "85dbea57de649546e72ebecb19ffefd8", "score": "0.6489746", "text": "function Description(props){\r\n return(\r\n <dd>\r\n {props.content}\r\n </dd>\r\n );\r\n}", "title": "" }, { "docid": "dd764bfd91b48dc2470e646ddf9ba7b9", "score": "0.6434916", "text": "function formatItem(term, description) {\n if (description) {\n const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;\n return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);\n }\n return term;\n }", "title": "" }, { "docid": "90421cb00c4a716339206d4fcb612090", "score": "0.6352654", "text": "function writeDescriptions(body, descriptions, listItems){\n var multipleDescription = descriptions.split('; ');\n writeMultipleDescription(body,multipleDescription, listItems);\n}", "title": "" }, { "docid": "0b7d80f1133c5010152c8a1fdbef1602", "score": "0.6323178", "text": "function createDescriptionCol(item) {\n\treturn '<td align=\"left\" class=\"description\">' + item.name + '</td>';\n}", "title": "" }, { "docid": "5506b715a31af2d55472899926216388", "score": "0.6301678", "text": "get description () {\r\n\t\treturn this._description;\r\n\t}", "title": "" }, { "docid": "461f1bf67a058782e7d1c79e9fece7dd", "score": "0.625543", "text": "set description(value) {\n this._description = value ? String(value) : null;\n }", "title": "" }, { "docid": "8370e1cbfa5af1c4c07eeb15ca5c8b20", "score": "0.6248815", "text": "function Description() {\n\t\t\n\t\tthis.addWord = function () {\n\t\t\t\n\t\t};\n\t\t\n\t\tthis.getSmellDescription = function () {\n\t\t\t\n\t\t};\n\t\t\n\t\tthis.equals = function(other) {\n\t\t\treturn this.constructor === other.constructor;\n\t\t};\n\t}", "title": "" }, { "docid": "5fd03a0b2cf68bbe6a97d0b79e22b293", "score": "0.6241143", "text": "changeDescription(title, newDescription) {\n\t\tif (!this.listed(title)) {\n\t\t\tthrow new Error(`Todo: '${title}' is not listed in the project display.`);\n\t\t}\n\n\t\tthis._listings[title].querySelector('.description').value = newDescription;\n\t}", "title": "" }, { "docid": "cde0052b33bd3b178777bf809c166eca", "score": "0.623556", "text": "listDesc() {\n const desc = this.st.lists[t.getKey(this.path.key)];\n return desc || null;\n }", "title": "" }, { "docid": "af823d7961d70c385259fcf2f7880b03", "score": "0.6220806", "text": "function listItemDescriptionDirective(){\r\n\t\tconsole.log(\"listItemDescriptionDirective fired!\")\r\n\t\tvar ddo = {\r\n\t\t\ttemplate: \"{{ item.quantity }} of {{ item.name }}\"\r\n\t\t};\r\n\t\treturn ddo;\r\n\t}", "title": "" }, { "docid": "9b2d3f3bc0fb2399d86534b5bb8db680", "score": "0.6198312", "text": "function renderListItem(nameId, name, description) {\n var liListItem = document.createElement('li');\n liListItem.className = 'mdc-list-item';\n liListItem.setAttribute('data-nameId', nameId);\n\n var spanListText = document.createElement('span');\n spanListText.className = 'mdc-list-item__text';\n\n var spanPrimaryText = document.createElement('span');\n spanPrimaryText.className = 'mdc-list-item__primary-text';\n spanPrimaryText.appendChild(document.createTextNode(name));\n \n var spanSecondaryText = document.createElement('span');\n spanSecondaryText.className = 'mdc-list-item__secondary-text';\n spanSecondaryText.appendChild(document.createTextNode(description));\n\n liListItem.appendChild(spanListText);\n spanListText.append(spanPrimaryText, spanSecondaryText);\n\n listCategoriesHTML.appendChild(liListItem);\n\n // Thêm li đó vào mdc list\n addNewItemsToList(liListItem);\n}", "title": "" }, { "docid": "a830f12cd4ddd7f49d7ae19b0290a79b", "score": "0.6189167", "text": "get description () {\n\t\treturn this._description;\n\t}", "title": "" }, { "docid": "a830f12cd4ddd7f49d7ae19b0290a79b", "score": "0.6189167", "text": "get description () {\n\t\treturn this._description;\n\t}", "title": "" }, { "docid": "a830f12cd4ddd7f49d7ae19b0290a79b", "score": "0.6189167", "text": "get description () {\n\t\treturn this._description;\n\t}", "title": "" }, { "docid": "a830f12cd4ddd7f49d7ae19b0290a79b", "score": "0.6189167", "text": "get description () {\n\t\treturn this._description;\n\t}", "title": "" }, { "docid": "a830f12cd4ddd7f49d7ae19b0290a79b", "score": "0.6189167", "text": "get description () {\n\t\treturn this._description;\n\t}", "title": "" }, { "docid": "92522eebe658e96452dc97433b69552c", "score": "0.615925", "text": "get description() {\n const { details } = this.props;\n const { newDescriptionContent, shouldDisplayFullDescription } = this.state;\n const description = propOrDefault(details, 'description.content');\n const plainTextDescription = newDescriptionContent.value || description || '';\n let formattedDescription = description || newDescriptionContent.value ?\n shortenString(plainTextDescription) :\n NO_POSITION_DESCRIPTION;\n if (description && shouldDisplayFullDescription) {\n formattedDescription = plainTextDescription;\n }\n return { plainTextDescription, formattedDescription };\n }", "title": "" }, { "docid": "b6584ec181895e7ae9c67949e56f2e6a", "score": "0.6149505", "text": "addDescriptionText(text){}", "title": "" }, { "docid": "8c162c890e66ff82eb17422f176bc7af", "score": "0.6147302", "text": "function getDescriptionListItems(words) {\n var descriptions = [];\n dataModel[`${version}`].forEach(function(item) {\n const description = item[\"description\"];\n console.log(\"hitting item\", description);\n if (description.indexOf(words) > -1) {\n descriptions.push(\" \" + description);\n }\n });\n return getDescriptionResponse(descriptions, words);\n}", "title": "" }, { "docid": "c7a541aeaaab89dd7e5f47b4c06d54a2", "score": "0.61388826", "text": "function checkDescription(x){\r\n\tvar descriptionSection = \"\";\r\n\tif(Menu['Menu'][x].IsDescriped == true){ //if found, have a label to be displayed\r\n\t\tdescriptionSection = \"<label class='text-muted itemDescription'>- \"+descriptionRslt + \"</label>\";\r\n\t}else{\r\n\t\tdescriptionSection = \"\"; //keep empty\r\n\t}\r\n\treturn descriptionSection;\r\n}", "title": "" }, { "docid": "2097116e97b4d7efccdb1148e9869dc7", "score": "0.612952", "text": "get description() {\n return this._description;\n }", "title": "" }, { "docid": "35c461e7b81a482d59bada256f34db04", "score": "0.60086316", "text": "set description(description) {\n this._description = description;\n }", "title": "" }, { "docid": "0022d24a6a258ba8c770c738ee03576b", "score": "0.6006147", "text": "updateDescription(newDesc) {\n this.description = newDesc;\n }", "title": "" }, { "docid": "e0fe42519a7d898e5a3e267346d63229", "score": "0.6004347", "text": "renderDescription() {\n const { library, expanded } = this.props\n\n if (expanded) {\n return (\n <CardSection>\n <Text>{library.item.description}</Text>\n </CardSection>\n );\n }\n }", "title": "" }, { "docid": "b9b4a34870a31c0e352a15ee4a47a83a", "score": "0.5968367", "text": "function addOccupationDescription() {\n let h2 = document.getElementById('occupationdescription');\n let p = document.createElement('p');\n p.textContent = parsedItem[0].description;\n h2.appendChild(p);\n }", "title": "" }, { "docid": "c5b6d62e13595234d5cbccde0e4a8537", "score": "0.5963444", "text": "getDescription() {\r\n\t\treturn this.description;\r\n\t}", "title": "" }, { "docid": "be8980853508bd5dc07de1484afacf73", "score": "0.594142", "text": "function addOccupationDescription() {\n let h2 = document.getElementById('occupationdescription');\n let p = document.createElement('p');\n p.textContent = parsedItem[0].description;\n h2.appendChild(p);\n}", "title": "" }, { "docid": "07a2da7ab4c0cc1903be0de25ee87ab2", "score": "0.5940161", "text": "get description() {\n return this._description;\n }", "title": "" }, { "docid": "ba112015021516b8ad64bd2400490e0b", "score": "0.5937409", "text": "function toggleDescription() {\n self.showingDescription = !self.showingDescription;\n }", "title": "" }, { "docid": "98ddbadea5f5d37575ddcb0c8b6cc25d", "score": "0.59355253", "text": "function CardDescription(props) {\n\t var children = props.children,\n\t className = props.className,\n\t content = props.content;\n\n\t var classes = (0, _classnames2.default)(className, 'description');\n\t var rest = (0, _lib.getUnhandledProps)(CardDescription, props);\n\t var ElementType = (0, _lib.getElementType)(CardDescription, props);\n\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: classes }),\n\t (0, _isNil3.default)(children) ? content : children\n\t );\n\t}", "title": "" }, { "docid": "b489f727398b3deb4dfed2b97cf13d62", "score": "0.5935244", "text": "setDescription(description) {\n this.description = description;\n }", "title": "" }, { "docid": "b489f727398b3deb4dfed2b97cf13d62", "score": "0.5935244", "text": "setDescription(description) {\n this.description = description;\n }", "title": "" }, { "docid": "b489f727398b3deb4dfed2b97cf13d62", "score": "0.5935244", "text": "setDescription(description) {\n this.description = description;\n }", "title": "" }, { "docid": "207ab417e63fa560501064981d262635", "score": "0.5934871", "text": "getNameDescription(instance, element, defaultValue='') {\n instance.name = this.v(element, 'meta.title', defaultValue);\n instance.description = this.v(element, 'meta.description', '');\n\n instance.nameSourcemap = this.s(element, 'meta.title');\n instance.descriptionSourcemap = this.s(element, 'meta.description');\n\n for (const item of this.v(element, 'content', [])) {\n switch (item.element) {\n case 'copy':\n instance.description = `${instance.description}\\n${this.v(item)}`.trim();\n // Resetting the sourcemap isn't technically correct, but it works\n // in practice and is easier than combining them.\n instance.descriptionSourcemap = this.s(item);\n break;\n }\n }\n }", "title": "" }, { "docid": "b84cf609c150074517ce0d4b11994916", "score": "0.59142685", "text": "get description() {\n\t\treturn this.__description;\n\t}", "title": "" }, { "docid": "b84cf609c150074517ce0d4b11994916", "score": "0.59142685", "text": "get description() {\n\t\treturn this.__description;\n\t}", "title": "" }, { "docid": "b84cf609c150074517ce0d4b11994916", "score": "0.59142685", "text": "get description() {\n\t\treturn this.__description;\n\t}", "title": "" }, { "docid": "b84cf609c150074517ce0d4b11994916", "score": "0.59142685", "text": "get description() {\n\t\treturn this.__description;\n\t}", "title": "" }, { "docid": "b84cf609c150074517ce0d4b11994916", "score": "0.59142685", "text": "get description() {\n\t\treturn this.__description;\n\t}", "title": "" }, { "docid": "b84cf609c150074517ce0d4b11994916", "score": "0.59142685", "text": "get description() {\n\t\treturn this.__description;\n\t}", "title": "" }, { "docid": "b84cf609c150074517ce0d4b11994916", "score": "0.59142685", "text": "get description() {\n\t\treturn this.__description;\n\t}", "title": "" }, { "docid": "b84cf609c150074517ce0d4b11994916", "score": "0.59142685", "text": "get description() {\n\t\treturn this.__description;\n\t}", "title": "" }, { "docid": "b84cf609c150074517ce0d4b11994916", "score": "0.59142685", "text": "get description() {\n\t\treturn this.__description;\n\t}", "title": "" }, { "docid": "f484e16ece7ed5a7bd8048d0c4f9ae04", "score": "0.5913616", "text": "function CardDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'description');\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getUnhandledProps */])(CardDescription, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"o\" /* getElementType */])(CardDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "efc5dc7fd6c0cd26d5210ddf0cd386a3", "score": "0.59035087", "text": "setDescription(newDescription) {\n\t\tthis.description = newDescription\n\t}", "title": "" }, { "docid": "c65074a9cf375c8e7aefee888e0b6f37", "score": "0.5899884", "text": "function CardDescription(props) {\n\t var className = props.className;\n\t var children = props.children;\n\t var content = props.content;\n\t\n\t var classes = (0, _classnames2.default)(className, 'description');\n\t var rest = (0, _lib.getUnhandledProps)(CardDescription, props);\n\t var ElementType = (0, _lib.getElementType)(CardDescription, props);\n\t\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: classes }),\n\t children || content\n\t );\n\t}", "title": "" }, { "docid": "20bbb9df069d7b14648d696b60d98d91", "score": "0.58967257", "text": "function CardDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n textAlign = props.textAlign;\n var classes = (0, _classnames.default)((0, _lib.useTextAlignProp)(textAlign), 'description', className);\n var rest = (0, _lib.getUnhandledProps)(CardDescription, props);\n var ElementType = (0, _lib.getElementType)(CardDescription, props);\n return _react.default.createElement(ElementType, (0, _extends2.default)({}, rest, {\n className: classes\n }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "title": "" }, { "docid": "0220f7d98f734e52575e4679821bf485", "score": "0.58956164", "text": "loadItemIntoList(list, description, due_date, assigned_to, completed) {\n let newItem = new ToDoListItem();\n newItem.setDescription(description);\n newItem.setDueDate(due_date);\n newItem.setAssignedTo(assigned_to);\n newItem.setCompleted(completed);\n this.addItemToList(list, newItem);\n\n }", "title": "" }, { "docid": "a083556cd566a844c17b3182304fdc1b", "score": "0.5892124", "text": "function CardDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'description');\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(CardDescription, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(CardDescription, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(children) ? content : children\n );\n}", "title": "" }, { "docid": "1d23f78cabd2893f1061b387d2098beb", "score": "0.5891431", "text": "function CardDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'description');\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"b\" /* getUnhandledProps */])(CardDescription, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"c\" /* getElementType */])(CardDescription, props);\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_1_lodash_isNil___default()(children) ? content : children\n );\n}", "title": "" }, { "docid": "9eb05cc257f2b9160123f6f876978f27", "score": "0.5891429", "text": "function show_product_description() {\n\tif (postbody.match(/Description:/gi)){\n\t\tproduct_description = extract_text(postbody, 'Description:', '<!--');\n\t\tif (show_if_enabled(product_description) !== false && product_description.length > 5) {\n\t\t\tdocument.write('<div class=\"item_description\"><center><b>' + translate_sentence('Description') + '</b></center><br/>' + translate_sentence(product_description) + '</div>');\n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "d2e4257042a6661254975c2add22080c", "score": "0.58905107", "text": "function CardDescription(props) {\n\t var children = props.children,\n\t className = props.className,\n\t content = props.content,\n\t textAlign = props.textAlign;\n\t\n\t var classes = (0, _classnames2.default)((0, _lib.useTextAlignProp)(textAlign), 'description', className);\n\t var rest = (0, _lib.getUnhandledProps)(CardDescription, props);\n\t var ElementType = (0, _lib.getElementType)(CardDescription, props);\n\t\n\t return _react2.default.createElement(\n\t ElementType,\n\t (0, _extends3.default)({}, rest, { className: classes }),\n\t _lib.childrenUtils.isNil(children) ? content : children\n\t );\n\t}", "title": "" }, { "docid": "68662083375b7b25ed7f22ee157724cb", "score": "0.5882633", "text": "function getDescription(it){\r\n ap = $(it).find('.item');\r\n\r\n comment = $(ap).attr('alt');\r\n author= $(ap).data('author');\r\n count = $(ap).data('count');\r\n //comment= $(itemsContainer).find('.active .item').attr('alt'); \r\n //author= $(itemsContainer).find('.active .item').data('author');\r\n //count = $(itemsContainer).find('.active .item').data('count');\r\n description = $(desc).find('.description');\r\n //kk = $(it).find('.item');\r\n //cmm2 = $(kk).attr('alt');\r\n if (comment) {\r\n \t$(description).html(comment);\r\n }\r\n\r\n var separator = '';\r\n if(comment.length > 65) { \r\n $(desc).find('.author').css({'display':'block'}); \r\n } else { \r\n separator = '&#8226;&#160;';\r\n $(desc).find('.author').css({'display':'inline'}); \r\n }\r\n\r\n if (author) {\r\n\t $(desc).find('.author').html('<em>' + separator + 'FOTO: ' + author + '</em>');\r\n }\r\n\r\n if (count) {\r\n \t$(settings.count).text(count);\r\n }\r\n }", "title": "" }, { "docid": "ff3bd18f25f53afefaf70e0889973cfa", "score": "0.58734465", "text": "function CardDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n textAlign = props.textAlign;\n\n var classes = (0, _classnames2.default)((0, _lib.useTextAlignProp)(textAlign), 'description', className);\n var rest = (0, _lib.getUnhandledProps)(CardDescription, props);\n var ElementType = (0, _lib.getElementType)(CardDescription, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "title": "" }, { "docid": "fe0cc5bc909076ca4930e68f33ff6189", "score": "0.58714825", "text": "handleDescriptionChange(newDescription, index) {\n\t\tlet items = this.state.items;\n\t\titems[index].description = newDescription;\n\t\tthis.setState({\n\t\t\titems: items\n\t\t})\n\t}", "title": "" }, { "docid": "94b2b472bfd26a65da1883fe6f9fe311", "score": "0.58697057", "text": "get descriptionText() {\n return \"\";\n }", "title": "" } ]
912ebfc20f73d3ea901ba496109e4ae8
Adds an event listener to the current node. If an output exists on one of the node's directives, it also subscribes to the output and saves the subscription for later cleanup.
[ { "docid": "ecdbc76036ce3691ac26099d1bd7004f", "score": "0.6801555", "text": "function listener(eventName, listenerFn, useCapture) {\n if (useCapture === void 0) {\n useCapture = false;\n }\n var tNode = previousOrParentTNode;\n ngDevMode && assertNodeOfPossibleTypes(tNode, 3 /* Element */, 0 /* Container */, 4 /* ElementContainer */);\n // add native event listener - applicable to elements only\n if (tNode.type === 3 /* Element */) {\n var native = getNativeByTNode(previousOrParentTNode, viewData);\n ngDevMode && ngDevMode.rendererAddEventListener++;\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n if (isProceduralRenderer(renderer)) {\n var cleanupFn = renderer.listen(native, eventName, listenerFn);\n storeCleanupFn(viewData, cleanupFn);\n }\n else {\n var wrappedListener = wrapListenerWithPreventDefault(listenerFn);\n native.addEventListener(eventName, wrappedListener, useCapture);\n var cleanupInstances = getCleanup(viewData);\n cleanupInstances.push(wrappedListener);\n if (firstTemplatePass) {\n getTViewCleanup(viewData).push(eventName, tNode.index, cleanupInstances.length - 1, useCapture);\n }\n }\n }\n // subscribe to directive outputs\n if (tNode.outputs === undefined) {\n // if we create TNode here, inputs must be undefined so we know they still need to be\n // checked\n tNode.outputs = generatePropertyAliases(tNode.flags, 1 /* Output */);\n }\n var outputs = tNode.outputs;\n var outputData;\n if (outputs && (outputData = outputs[eventName])) {\n createOutput(outputData, listenerFn);\n }\n}", "title": "" } ]
[ { "docid": "49fcc61e9853284c2c8cdbd9eaeb3321", "score": "0.6697117", "text": "function listener(eventName, listenerFn, useCapture) {\n if (useCapture === void 0) { useCapture = false; }\n var lView = getLView();\n var tNode = getPreviousOrParentTNode();\n var tView = lView[TVIEW];\n var firstTemplatePass = tView.firstTemplatePass;\n var tCleanup = firstTemplatePass && (tView.cleanup || (tView.cleanup = []));\n ngDevMode && assertNodeOfPossibleTypes(tNode, 3 /* Element */, 0 /* Container */, 4 /* ElementContainer */);\n // add native event listener - applicable to elements only\n if (tNode.type === 3 /* Element */) {\n var native = getNativeByTNode(tNode, lView);\n ngDevMode && ngDevMode.rendererAddEventListener++;\n var renderer = lView[RENDERER];\n var lCleanup = getCleanup(lView);\n var lCleanupIndex = lCleanup.length;\n var useCaptureOrSubIdx = useCapture;\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n if (isProceduralRenderer(renderer)) {\n var cleanupFn = renderer.listen(native, eventName, listenerFn);\n lCleanup.push(listenerFn, cleanupFn);\n useCaptureOrSubIdx = lCleanupIndex + 1;\n }\n else {\n var wrappedListener = wrapListenerWithPreventDefault(listenerFn);\n native.addEventListener(eventName, wrappedListener, useCapture);\n lCleanup.push(wrappedListener);\n }\n tCleanup && tCleanup.push(eventName, tNode.index, lCleanupIndex, useCaptureOrSubIdx);\n }\n // subscribe to directive outputs\n if (tNode.outputs === undefined) {\n // if we create TNode here, inputs must be undefined so we know they still need to be\n // checked\n tNode.outputs = generatePropertyAliases(tNode, 1 /* Output */);\n }\n var outputs = tNode.outputs;\n var props;\n if (outputs && (props = outputs[eventName])) {\n var propsLength = props.length;\n if (propsLength) {\n var lCleanup = getCleanup(lView);\n for (var i = 0; i < propsLength; i += 2) {\n ngDevMode && assertDataInRange(lView, props[i]);\n var subscription = lView[props[i]][props[i + 1]].subscribe(listenerFn);\n var idx = lCleanup.length;\n lCleanup.push(listenerFn, subscription);\n tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1));\n }\n }\n }\n}", "title": "" }, { "docid": "49fcc61e9853284c2c8cdbd9eaeb3321", "score": "0.6697117", "text": "function listener(eventName, listenerFn, useCapture) {\n if (useCapture === void 0) { useCapture = false; }\n var lView = getLView();\n var tNode = getPreviousOrParentTNode();\n var tView = lView[TVIEW];\n var firstTemplatePass = tView.firstTemplatePass;\n var tCleanup = firstTemplatePass && (tView.cleanup || (tView.cleanup = []));\n ngDevMode && assertNodeOfPossibleTypes(tNode, 3 /* Element */, 0 /* Container */, 4 /* ElementContainer */);\n // add native event listener - applicable to elements only\n if (tNode.type === 3 /* Element */) {\n var native = getNativeByTNode(tNode, lView);\n ngDevMode && ngDevMode.rendererAddEventListener++;\n var renderer = lView[RENDERER];\n var lCleanup = getCleanup(lView);\n var lCleanupIndex = lCleanup.length;\n var useCaptureOrSubIdx = useCapture;\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n if (isProceduralRenderer(renderer)) {\n var cleanupFn = renderer.listen(native, eventName, listenerFn);\n lCleanup.push(listenerFn, cleanupFn);\n useCaptureOrSubIdx = lCleanupIndex + 1;\n }\n else {\n var wrappedListener = wrapListenerWithPreventDefault(listenerFn);\n native.addEventListener(eventName, wrappedListener, useCapture);\n lCleanup.push(wrappedListener);\n }\n tCleanup && tCleanup.push(eventName, tNode.index, lCleanupIndex, useCaptureOrSubIdx);\n }\n // subscribe to directive outputs\n if (tNode.outputs === undefined) {\n // if we create TNode here, inputs must be undefined so we know they still need to be\n // checked\n tNode.outputs = generatePropertyAliases(tNode, 1 /* Output */);\n }\n var outputs = tNode.outputs;\n var props;\n if (outputs && (props = outputs[eventName])) {\n var propsLength = props.length;\n if (propsLength) {\n var lCleanup = getCleanup(lView);\n for (var i = 0; i < propsLength; i += 2) {\n ngDevMode && assertDataInRange(lView, props[i]);\n var subscription = lView[props[i]][props[i + 1]].subscribe(listenerFn);\n var idx = lCleanup.length;\n lCleanup.push(listenerFn, subscription);\n tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1));\n }\n }\n }\n}", "title": "" }, { "docid": "d2f49c00db9e22af4784249d079d19d6", "score": "0.66751957", "text": "function listener(eventName,listenerFn,useCapture){if(useCapture===void 0){useCapture=false;}var lView=getLView();var tNode=getPreviousOrParentTNode();var tView=lView[TVIEW];var firstTemplatePass=tView.firstTemplatePass;var tCleanup=firstTemplatePass&&(tView.cleanup||(tView.cleanup=[]));ngDevMode&&assertNodeOfPossibleTypes(tNode,3/* Element */,0/* Container */,4/* ElementContainer */);// add native event listener - applicable to elements only\nif(tNode.type===3/* Element */){var _native14=getNativeByTNode(tNode,lView);ngDevMode&&ngDevMode.rendererAddEventListener++;var renderer=lView[RENDERER];var lCleanup=getCleanup(lView);var lCleanupIndex=lCleanup.length;var useCaptureOrSubIdx=useCapture;// In order to match current behavior, native DOM event listeners must be added for all\n// events (including outputs).\nif(isProceduralRenderer(renderer)){var cleanupFn=renderer.listen(_native14,eventName,listenerFn);lCleanup.push(listenerFn,cleanupFn);useCaptureOrSubIdx=lCleanupIndex+1;}else{var wrappedListener=wrapListenerWithPreventDefault(listenerFn);_native14.addEventListener(eventName,wrappedListener,useCapture);lCleanup.push(wrappedListener);}tCleanup&&tCleanup.push(eventName,tNode.index,lCleanupIndex,useCaptureOrSubIdx);}// subscribe to directive outputs\nif(tNode.outputs===undefined){// if we create TNode here, inputs must be undefined so we know they still need to be\n// checked\ntNode.outputs=generatePropertyAliases(tNode,1/* Output */);}var outputs=tNode.outputs;var props;if(outputs&&(props=outputs[eventName])){var propsLength=props.length;if(propsLength){var lCleanup=getCleanup(lView);for(var i=0;i<propsLength;i+=2){ngDevMode&&assertDataInRange(lView,props[i]);var subscription=lView[props[i]][props[i+1]].subscribe(listenerFn);var idx=lCleanup.length;lCleanup.push(listenerFn,subscription);tCleanup&&tCleanup.push(eventName,tNode.index,idx,-(idx+1));}}}}", "title": "" }, { "docid": "2465c361f11f1d603694e0b9187f39a8", "score": "0.6168191", "text": "function addNewOutputListener(name) {\n $('#newOutput' + name).on('keyup', function() {\n answerHasChanges(name);\n });\n}", "title": "" }, { "docid": "e1accab62537ed4d2406ee5ba26107b1", "score": "0.5595037", "text": "function addListeners(node) {\n node.addEventListener(\"DOMNodeInserted\", function() {\n onDOMModified();\n });\n\n node.addEventListener(\"DOMNodeRemoved\", function() {\n onDOMModified();\n });\n\n node.addEventListener(\"DOMAttrModified\", function() {\n onDOMModified();\n });\n\n function onDOMModified() {\n var jsonmlNode = JsonML.fromHTML(node);\n replicateDOMChanges(jsonmlNode);\n };\n }", "title": "" }, { "docid": "285b505d8b07da062544659ca995ad0b", "score": "0.5567884", "text": "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "title": "" }, { "docid": "285b505d8b07da062544659ca995ad0b", "score": "0.5567884", "text": "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "title": "" }, { "docid": "285b505d8b07da062544659ca995ad0b", "score": "0.5567884", "text": "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "title": "" }, { "docid": "285b505d8b07da062544659ca995ad0b", "score": "0.5567884", "text": "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "title": "" }, { "docid": "285b505d8b07da062544659ca995ad0b", "score": "0.5567884", "text": "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "title": "" }, { "docid": "285b505d8b07da062544659ca995ad0b", "score": "0.5567884", "text": "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "title": "" }, { "docid": "7ed6d914ca937f6ffdf18f985c77ed53", "score": "0.55639726", "text": "function addComponentNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions) {\n return;\n }\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "title": "" }, { "docid": "7ed6d914ca937f6ffdf18f985c77ed53", "score": "0.55639726", "text": "function addComponentNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions) {\n return;\n }\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "title": "" }, { "docid": "59363d883d3a7c060d303a4d10367cc1", "score": "0.5548545", "text": "function addComponentNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions) {\n return;\n }\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n }", "title": "" }, { "docid": "5bab45a9427a4cbde990108a3e3ae794", "score": "0.55139726", "text": "function addListeners (node) {\n var model = findModel(node);\n // cache the input eventName.\n this._inputEventName = this._inputEventName || getInputEventName(node, model);\n\n onRenderUpdate.call(this, model);\n\n var ref = createCommonHandlers(this);\n var onInput = ref.onInput;\n var onBlur = ref.onBlur;\n var onValidate = ref.onValidate;\n addVNodeListener(node, this._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n\n // add the validation listeners.\n this.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n\n this.initialized = true;\n}", "title": "" }, { "docid": "5bab45a9427a4cbde990108a3e3ae794", "score": "0.55139726", "text": "function addListeners (node) {\n var model = findModel(node);\n // cache the input eventName.\n this._inputEventName = this._inputEventName || getInputEventName(node, model);\n\n onRenderUpdate.call(this, model);\n\n var ref = createCommonHandlers(this);\n var onInput = ref.onInput;\n var onBlur = ref.onBlur;\n var onValidate = ref.onValidate;\n addVNodeListener(node, this._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n\n // add the validation listeners.\n this.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n\n this.initialized = true;\n}", "title": "" }, { "docid": "5bab45a9427a4cbde990108a3e3ae794", "score": "0.55139726", "text": "function addListeners (node) {\n var model = findModel(node);\n // cache the input eventName.\n this._inputEventName = this._inputEventName || getInputEventName(node, model);\n\n onRenderUpdate.call(this, model);\n\n var ref = createCommonHandlers(this);\n var onInput = ref.onInput;\n var onBlur = ref.onBlur;\n var onValidate = ref.onValidate;\n addVNodeListener(node, this._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n\n // add the validation listeners.\n this.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n\n this.initialized = true;\n}", "title": "" }, { "docid": "5bab45a9427a4cbde990108a3e3ae794", "score": "0.55139726", "text": "function addListeners (node) {\n var model = findModel(node);\n // cache the input eventName.\n this._inputEventName = this._inputEventName || getInputEventName(node, model);\n\n onRenderUpdate.call(this, model);\n\n var ref = createCommonHandlers(this);\n var onInput = ref.onInput;\n var onBlur = ref.onBlur;\n var onValidate = ref.onValidate;\n addVNodeListener(node, this._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n\n // add the validation listeners.\n this.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n\n this.initialized = true;\n}", "title": "" }, { "docid": "5bab45a9427a4cbde990108a3e3ae794", "score": "0.55139726", "text": "function addListeners (node) {\n var model = findModel(node);\n // cache the input eventName.\n this._inputEventName = this._inputEventName || getInputEventName(node, model);\n\n onRenderUpdate.call(this, model);\n\n var ref = createCommonHandlers(this);\n var onInput = ref.onInput;\n var onBlur = ref.onBlur;\n var onValidate = ref.onValidate;\n addVNodeListener(node, this._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n\n // add the validation listeners.\n this.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n\n this.initialized = true;\n}", "title": "" }, { "docid": "5bab45a9427a4cbde990108a3e3ae794", "score": "0.55139726", "text": "function addListeners (node) {\n var model = findModel(node);\n // cache the input eventName.\n this._inputEventName = this._inputEventName || getInputEventName(node, model);\n\n onRenderUpdate.call(this, model);\n\n var ref = createCommonHandlers(this);\n var onInput = ref.onInput;\n var onBlur = ref.onBlur;\n var onValidate = ref.onValidate;\n addVNodeListener(node, this._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n\n // add the validation listeners.\n this.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n\n this.initialized = true;\n}", "title": "" }, { "docid": "6700fb9c610978847a68a5b7342d8505", "score": "0.54971087", "text": "add() {\n this.target.addEventListener(this.eventType, this.fn, false);\n }", "title": "" }, { "docid": "bef221677c94afe757b461afd9d676fc", "score": "0.5496668", "text": "function newListener(outputFunction) {\n var dataStart = true;\n var recievedData = new Array;\n return function reciever(signal) {\n if (dataStart) {\n if (!signal) {\n dataStart = false;\n } else {\n return 1;\n };\n };\n if (signal) {\n recievedData[recievedData.length-1] += 1;\n } else {\n recievedData.push(-1);\n }\n area.innerText = recievedData.join(\"|\");\n \n }\n}", "title": "" }, { "docid": "a0e0603c4bdb3969fe248778aceda128", "score": "0.53877056", "text": "function addListener(el, eventName, handler) {\n if(typeof(el) == \"string\"){\n el = document.querySelectorAll(el);\n if(el.length == 1){\n el = el[0]; // if only one set it properly\n }\n }\n\n if (el == null || typeof(el) == 'undefined') return;\n\n if(el.length !== undefined && el.length > 1 && el != window){ // it's a NodeListCollection\n for (var i = 0; i < el.length; ++i) {\n attachListener(el[i], eventName, handler);\n }\n }else { // it's a single node\n // console.log(el);\n attachListener(el, eventName, handler);\n }\n }", "title": "" }, { "docid": "32808039f8433d625dc8f39a959748ac", "score": "0.53789353", "text": "function addListeners(vm, node) {\n var _a;\n var value = findValue(node);\n // cache the input eventName.\n vm._inputEventName = vm._inputEventName || getInputEventName(node, findModel(node));\n onRenderUpdate(vm, (_a = value) === null || _a === void 0 ? void 0 : _a.value);\n var _b = createCommonHandlers(vm), onInput = _b.onInput, onBlur = _b.onBlur, onValidate = _b.onValidate;\n addVNodeListener(node, vm._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n // add the validation listeners.\n vm.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n vm.initialized = true;\n}", "title": "" }, { "docid": "32808039f8433d625dc8f39a959748ac", "score": "0.53789353", "text": "function addListeners(vm, node) {\n var _a;\n var value = findValue(node);\n // cache the input eventName.\n vm._inputEventName = vm._inputEventName || getInputEventName(node, findModel(node));\n onRenderUpdate(vm, (_a = value) === null || _a === void 0 ? void 0 : _a.value);\n var _b = createCommonHandlers(vm), onInput = _b.onInput, onBlur = _b.onBlur, onValidate = _b.onValidate;\n addVNodeListener(node, vm._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n // add the validation listeners.\n vm.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n vm.initialized = true;\n}", "title": "" }, { "docid": "d6dd0fb994e293a5f543f8e23ce180bd", "score": "0.5370858", "text": "function addListeners(vm, node) {\n var _a;\n var value = findValue(node);\n // cache the input eventName.\n vm._inputEventName = vm._inputEventName || getInputEventName(node, findModel(node));\n onRenderUpdate(vm, (_a = value) === null || _a === void 0 ? void 0 : _a.value);\n var _b = createCommonHandlers(vm), onInput = _b.onInput, onBlur = _b.onBlur, onValidate = _b.onValidate;\n addVNodeListener(node, vm._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n // add the validation listeners.\n vm.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n vm.initialized = true;\n }", "title": "" }, { "docid": "37f6a59a38ca22de8b399504aec4e229", "score": "0.5327138", "text": "$on(event, fn) {\n const unsub = this.emitter.subscribe(event, fn)\n // 238-3\n this.unsubscribers.push(unsub)\n }", "title": "" }, { "docid": "e8ebdbcbd507775bfa5fd895bfbbc068", "score": "0.5323719", "text": "on(ev, fn) {\n this.emitter.on(ev, fn);\n }", "title": "" }, { "docid": "30400068e831d747e017acffee82176d", "score": "0.5298575", "text": "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "title": "" }, { "docid": "30400068e831d747e017acffee82176d", "score": "0.5298575", "text": "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "title": "" }, { "docid": "30400068e831d747e017acffee82176d", "score": "0.5298575", "text": "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "title": "" }, { "docid": "30400068e831d747e017acffee82176d", "score": "0.5298575", "text": "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "title": "" }, { "docid": "30400068e831d747e017acffee82176d", "score": "0.5298575", "text": "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "title": "" }, { "docid": "30400068e831d747e017acffee82176d", "score": "0.5298575", "text": "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "title": "" }, { "docid": "a8b876ddbf2f4c81aa87b3a6e7953932", "score": "0.52803886", "text": "attachListeners() {\n this.#outInterface.on('line', this.lineListener);\n this.#errInterface.on('line', this.errorListener);\n this.#child.on('exit', this.exitListener);\n this.#child.on('close', () => {});\n }", "title": "" }, { "docid": "f544f98c345fca9c040418d40ece9177", "score": "0.52763987", "text": "function addNativeNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.data) {\n node.data = {};\n }\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "title": "" }, { "docid": "f544f98c345fca9c040418d40ece9177", "score": "0.52763987", "text": "function addNativeNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.data) {\n node.data = {};\n }\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "title": "" }, { "docid": "6dbcdea4176abde2d355a0d7f04bce1d", "score": "0.5271542", "text": "function addNativeNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.data) {\n node.data = {};\n }\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n mergeVNodeListeners(node.data.on, eventName, handler);\n }", "title": "" }, { "docid": "eabba885fba0324500549684ea36984d", "score": "0.51928854", "text": "function addEventListeners() {\n\n}", "title": "" }, { "docid": "a09966b2ff7cb0ea4e1ba6b2c859235d", "score": "0.5190996", "text": "function on(eventName, callback) {\n $svg.node().addEventListener(eventName, callback)\n }", "title": "" }, { "docid": "5b41bd3758e690dca18ed5464ee42ce8", "score": "0.516788", "text": "listenTo(node, event, scope, callback, context) {\n\t var _context5;\n\n\t // scope is optional param\n\t if (typeof node == \"string\") {\n\t context = callback;\n\t callback = scope;\n\t scope = event;\n\t event = node;\n\t node = this.el;\n\t }\n\n\t if (typeof scope != \"string\") {\n\t context = callback;\n\t callback = scope;\n\t scope = false;\n\t }\n\n\t context || (context = this);\n\t var listen = [node, event, bind$1(_context5 = function (e) {\n\t if (!scope || e.target.matches(scope) || e.target.closest(scope)) {\n\t return bind$1(callback).call(callback, context)(...arguments);\n\t }\n\t }).call(_context5, context)];\n\t this.eventListens.push(listen);\n\t node.addEventListener(event, listen[2]);\n\t }", "title": "" }, { "docid": "d2fb6f16371ec2c8dd2e7c71907d6823", "score": "0.5163593", "text": "addListener(event, listener) {\n this.ee.addListener(event, listener);\n }", "title": "" }, { "docid": "0a25ce0e19118b56276f1ce1aea9d794", "score": "0.51600456", "text": "on(event, listener, emitter = this._defaultEmitter()) {\n emitter.on(event, listener);\n }", "title": "" }, { "docid": "4acde137a4fa107a42e31e8eb15171aa", "score": "0.5156659", "text": "addHikeListener() {\n // We need to loop through the children of our list and attach a listener to each, remember though that children is a nodeList...not an array. So in order to use something like a forEach we need to convert it to an array.\n }", "title": "" }, { "docid": "c7fd381175822c90d982dee561ede943", "score": "0.5147674", "text": "_addEventListener() {\n this.editor.eventListener.on('nodecreate', (node, persistent) => {\n try {\n window.callNative('AddNewNode', parseInt(node.id, 10), node.title);\n\n this._addToggleBtnToNode(node);\n } catch (e) {\n console.error(`Error: AddNewNode #${node.id} (${node.title})`, e);\n }\n });\n\n this.editor.eventListener.on('noderemove', (node, persistent) => {\n try {\n window.callNative('DeleteNode', parseInt(node.id, 10), node.title);\n } catch (e) {\n console.error(`Error: DeleteNode #${node.id} (${node.title})`, e);\n }\n });\n\n this.editor.eventListener.on(\n 'connectioncreate', (connection, persistent) => {\n // TODO: Re-Enable\n if (connection.output.node.title === 'IncidentNode') {\n return;\n }\n\n try {\n window.callNative(\n 'AddConnection',\n parseInt(connection.output.node.id, 10),\n parseInt(connection.input.node.id, 10),\n connection.output.node.outputs.findIndex(\n (output) => output === connection.output),\n connection.input.node.inputs.findIndex(\n (input) => input === connection.input),\n );\n } catch (e) {\n console.error(\n `Error: AddConnection In #${connection.input.node.id} Out #${\n connection.output.node.id}`,\n e);\n }\n });\n\n this.editor.eventListener.on('connectionremove', (connection,\n persistent) => {\n // TODO: Re-Enable\n if (connection.output.node.title === 'IncidentNode') {\n return;\n }\n\n try {\n window.callNative(\n 'DeleteConnection',\n parseInt(connection.output.node.id, 10),\n parseInt(connection.input.node.id, 10),\n connection.output.node.outputs.findIndex(\n (output) => output === connection.output),\n connection.input.node.inputs.findIndex(\n (input) => input === connection.input),\n );\n } catch (e) {\n console.error(\n `Error: DeleteConnection In #${connection.input.node.id} Out #${\n connection.output.node.id}`,\n e);\n }\n });\n\n this.editor.eventListener.on('change', async () => {\n await this.engine.abort();\n await this.engine.process(this.editor.toJSON());\n });\n }", "title": "" }, { "docid": "bd245c293d67506ceee6fa6fbb962ce5", "score": "0.5134442", "text": "function addEventListenerForEmittingChangedEvents(elementRef, polymerEventName, angularEventEmmiter) {\n return __awaiter(this, void 0, void 0, function* () {\n Promise.resolve().then(() => {\n const nativeElement = elementRef.nativeElement;\n return nativeElement.addEventListener(polymerEventName, (e) => {\n angularEventEmmiter.emit(e.detail.value);\n });\n });\n });\n}", "title": "" }, { "docid": "c7fcc03f7d52159c40c8f0fc16b9e0fa", "score": "0.5122562", "text": "addMuteOutputListner(moduleOutput) {\n moduleOutput.moduleView.fModuleContainer.ontouchstart = () => { this.dbleTouchOutput(); };\n moduleOutput.moduleView.fModuleContainer.ondblclick = () => { this.dispatchEventMuteUnmute(); };\n }", "title": "" }, { "docid": "5637ab5332493c5843037f1e9429d91b", "score": "0.5119543", "text": "function receiveInput() {\n document.addEventListener('keyup', listen);\n document.addEventListener('click', listen);\n}", "title": "" }, { "docid": "c98fd9df448826c2ba47751d18839484", "score": "0.51095766", "text": "function _addEventListeners(target) {\n\t for (var i in this._eventOutput.listeners) {\n\t target.addEventListener(i, this.eventForwarder);\n\t }\n\t }", "title": "" }, { "docid": "db2ea903690758ae8f06714f89d9cb39", "score": "0.51046586", "text": "AttachListener(){\n\t\tthis.node.addEventListener('mousedown', this.OnMouseDownBind)\n\t}", "title": "" }, { "docid": "a583b7fff0c0985177392227d8c2caa0", "score": "0.5102261", "text": "function addDisposableDomListener(node, type, handler, options) {\n node.addEventListener(type, handler, options);\n let disposed = false;\n return {\n dispose: () => {\n if (disposed) {\n return;\n }\n disposed = true;\n node.removeEventListener(type, handler, options);\n }\n };\n}", "title": "" }, { "docid": "ba883a929faa2e067d4ce7015c88e5ed", "score": "0.510163", "text": "function addListener(selector,eventName,cb){\r\n document.querySelector(selector).addEventListener(eventName,cb)\r\n}", "title": "" }, { "docid": "6f69c0dd4d3b5154137abcf8559288f0", "score": "0.50981224", "text": "function subscribe(listener) {\n listeners.push(listener);\n }", "title": "" }, { "docid": "6a13ff3bad1f510eba4744a1bc76d126", "score": "0.50817496", "text": "function add_ev(node, event, f) {\n var eventHandler = function(e) { change_world(function(w, k) { f(w, e, k); },\n doNothing); };\n attachEvent(node, event, eventHandler);\n eventDetachers.push(function() { detachEvent(node, event, eventHandler); });\n }", "title": "" }, { "docid": "6a13ff3bad1f510eba4744a1bc76d126", "score": "0.50817496", "text": "function add_ev(node, event, f) {\n var eventHandler = function(e) { change_world(function(w, k) { f(w, e, k); },\n doNothing); };\n attachEvent(node, event, eventHandler);\n eventDetachers.push(function() { detachEvent(node, event, eventHandler); });\n }", "title": "" }, { "docid": "12ab9fa50e0779cb4c2b72c7a75e8170", "score": "0.50737405", "text": "_addEventListener(eventName, callback, uuid) {\n\t\tif (uuid) {\n\t\t\teventName = eventName + '.' + uuid;\n\t\t}\n\n\t\t$(document).on(eventName, callback);\n\t}", "title": "" }, { "docid": "b305203aa8d57f8c9653111e8438b896", "score": "0.5069714", "text": "addEventListener(event, callback, useCapture) {\n\t\tthis.$pwMain.subscribe({event: event, fn: callback, useCapture: useCapture});\n\t}", "title": "" }, { "docid": "b305203aa8d57f8c9653111e8438b896", "score": "0.5069714", "text": "addEventListener(event, callback, useCapture) {\n\t\tthis.$pwMain.subscribe({event: event, fn: callback, useCapture: useCapture});\n\t}", "title": "" }, { "docid": "db3a47598a55009b681382fd91df05c3", "score": "0.5069353", "text": "function handleNode(node) {\n var handledEvents = [], listenerBinding, DOMEventListeners = [];\n\n listenerBinding = on('emitter.listener', function(event) {\n if(handledEvents.indexOf(event) > -1) { return; }\n handledEvents.push(event);\n\n try {\n\n //W3C\n if(node.addEventListener) {\n node.addEventListener(event, nodeListener, false);\n DOMEventListeners.push({\n \"event\": event,\n \"listener\": nodeListener\n });\n }\n\n //MICROSOFT\n else if(node.attachEvent) {\n node.attachEvent('on' + event, nodeListener);\n DOMEventListeners.push({\n \"event\": event,\n \"listener\": nodeListener\n });\n }\n\n } catch(e) {\n console.error(e);\n }\n\n function nodeListener(eventObj ) {\n var args = Array.prototype.slice.apply(arguments);\n args.unshift([event, 'dom.' + event]);\n if(trigger.apply(this, args) === false) {\n eventObj.preventDefault();\n eventObj.stopPropagation();\n }\n }\n });\n\n emitter.clearNodeEmitter = clearNodeEmitter;\n\n function clearNodeEmitter() {\n var DI;\n for(DI = 0; DI < DOMEventListeners.length; DI += 1) {\n try {\n\n //W3C\n if(node.removeEventListener) {\n node.removeEventListener(DOMEventListeners[DI].event, DOMEventListeners[DI].listener, false);\n }\n\n //MICROSOFT\n else if(node.detachEvent) {\n node.detachEvent('on' + DOMEventListeners[DI].event, DOMEventListeners[DI].listener);\n }\n\n } catch(e) {\n console.error(e);\n }\n }\n\n handledEvents = [];\n listenerBinding.clear();\n }\n }", "title": "" }, { "docid": "33b6422e9581cbfb8512135f3151244b", "score": "0.50679374", "text": "addListener(listener) {\n this.listeners.push(listener);\n }", "title": "" }, { "docid": "33b6422e9581cbfb8512135f3151244b", "score": "0.50679374", "text": "addListener(listener) {\n this.listeners.push(listener);\n }", "title": "" }, { "docid": "f2ac5433ff6b14e3d4bc29ca90e87a89", "score": "0.50626624", "text": "_addGlobalListener() {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n return fromEvent(window.document, 'scroll').subscribe(() => this._scrolled.next());\n });\n }", "title": "" }, { "docid": "3e493825e032c0e139e90d6104b7d17b", "score": "0.50572854", "text": "listen() {\n [\"change\"].forEach(name => {\n this.el_.addEventListener(name, this.handler_, false)\n })\n }", "title": "" }, { "docid": "7750790a84ea74d4f75920eea3ee3285", "score": "0.5038812", "text": "subscribeEvents(uuid) {\n logManagement.log(uuid, 'Start: DeviceUtility.subscribeEvents', 'debug');\n deviceSystem.on('attach', this.emitEvent.bind(this, 'attach'));\n deviceSystem.on('detach', this.emitEvent.bind(this, 'detach'));\n logManagement.log(uuid, 'End: DeviceUtility.subscribeEvents', 'debug');\n }", "title": "" }, { "docid": "6095657b8adaabae0fd6040711b4bdf8", "score": "0.5035541", "text": "function l(e) {\n var o = d3_v3.event; // Events can be reentrant (e.g., focus).\n d3_v3.event = e;\n try {\n listener.call(node, node.__data__, i);\n } finally {\n d3_v3.event = o;\n }\n }", "title": "" }, { "docid": "86ac716640998d3cce4aae99efcf4ef9", "score": "0.5031496", "text": "[addDivListener](event, listener) {\n this.htmlDiv.addEventListener(event, listener);\n }", "title": "" }, { "docid": "b4a99e26bf852fffc247b9574e53c9f2", "score": "0.5022671", "text": "on(event, callback) {\n const id = this._seq();\n this._subscribers.push({id, event, callback});\n return {\n unsubscribe: this._unsubscribe.bind(this)\n };\n }", "title": "" }, { "docid": "d9ec561a61b892fd8a6a9a482c0764cc", "score": "0.50167775", "text": "function addListeners() {\n\t\t// TODO remove inline comments, just example code.\n\t\t// To attach an event, use one of the following methods.\n\t\t// No need remove the listener in `instance.detached`\n\t\t// instance.addEventListener('click', onClick); //attached to `instance.element`\n\t\t// instance.addEventListener('click', onClick, myEl); //attached to `myEl`\n\t}", "title": "" }, { "docid": "b215f43198facac6597db98b2cb0e1ea", "score": "0.50058526", "text": "_addGlobalListener() {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"fromEvent\"])(window.document, 'scroll').subscribe(() => this._scrolled.next());\n });\n }", "title": "" }, { "docid": "b215f43198facac6597db98b2cb0e1ea", "score": "0.50058526", "text": "_addGlobalListener() {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"fromEvent\"])(window.document, 'scroll').subscribe(() => this._scrolled.next());\n });\n }", "title": "" }, { "docid": "ed89aa28863ed6790dbac6dc45b5ddf5", "score": "0.49948826", "text": "listen (observable, callback) {\n observable.addObserver(this);\n // la vue devient un observer\n this.update = callback;\n }", "title": "" }, { "docid": "7745e963f8230f57bdf3d92476ebabf4", "score": "0.4987688", "text": "function createOutput(outputs, listener) {\n for (var i = 0; i < outputs.length; i += 2) {\n ngDevMode && assertDataInRange(outputs[i], viewData);\n var subscription = viewData[outputs[i]][outputs[i + 1]].subscribe(listener);\n storeCleanupWithContext(viewData, subscription, subscription.unsubscribe);\n }\n}", "title": "" }, { "docid": "62e7a7f209f42046f0843bf0e0130d42", "score": "0.49871713", "text": "function _on (event, listener) {\n if (typeof _events[event] !== 'object') {\n _events[event] = [];\n }\n\n _events[event].push(listener);\n }", "title": "" }, { "docid": "9833fc07622df4f6d6e0617767305efe", "score": "0.49854487", "text": "function _addEventListeners(target) {\n for (var i in this._eventOutput.listeners) {\n target.addEventListener(i, this.eventForwarder);\n }\n }", "title": "" }, { "docid": "e7beb0aa7fdbe0a9709b382b8b3e4369", "score": "0.49820298", "text": "registerSpanEventListener(listener) {\n this.eventListenersLocal.push(listener);\n }", "title": "" }, { "docid": "1c94eb66603553d198e350982e668cc2", "score": "0.49773556", "text": "function main() {\n addEventListeners();\n}", "title": "" }, { "docid": "366c714108ab4f217d851d4c29ded748", "score": "0.49766687", "text": "inserted(el, binding) {\n const onClick = e => directive(e, el, binding);\n\n const onMousedown = e => {\n el._clickOutside.lastMousedownWasOutside = checkEvent(e, el, binding);\n };\n\n handleShadow(el, app => {\n app.addEventListener('click', onClick, true);\n app.addEventListener('mousedown', onMousedown, true);\n });\n el._clickOutside = {\n lastMousedownWasOutside: true,\n onClick,\n onMousedown\n };\n }", "title": "" }, { "docid": "ebe967bb043dbc78109b02d4883593fb", "score": "0.49623585", "text": "function l(e) {\n var o = d3.event; // Events can be reentrant (e.g., focus).\n d3.event = e;\n try {\n listener.call(node, node.__data__, i);\n } finally {\n d3.event = o;\n }\n }", "title": "" }, { "docid": "ebe967bb043dbc78109b02d4883593fb", "score": "0.49623585", "text": "function l(e) {\n var o = d3.event; // Events can be reentrant (e.g., focus).\n d3.event = e;\n try {\n listener.call(node, node.__data__, i);\n } finally {\n d3.event = o;\n }\n }", "title": "" }, { "docid": "e7a0c0c3c2e2a1b161752af66a867cf8", "score": "0.49575564", "text": "addListener(listener) {\n listeners.push(listener);\n }", "title": "" }, { "docid": "a12d81f44a90d558545c7f07224acc50", "score": "0.49525398", "text": "function addListenersTo(elementToListenTo) {window.addEventListener(\"keydown\",kdown);window.addEventListener(\"keyup\",kup);elementToListenTo.addEventListener(\"mousedown\",mdown);elementToListenTo.addEventListener(\"mouseup\",mup);elementToListenTo.addEventListener(\"mousemove\",mmove);elementToListenTo.addEventListener(\"contextmenu\",cmenu);elementToListenTo.addEventListener(\"wheel\",scrl);}", "title": "" }, { "docid": "f083187504efefc7759a7abda428b6d8", "score": "0.4947112", "text": "_addGlobalListener() {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n\n return (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.fromEvent)(window.document, 'scroll').subscribe(() => this._scrolled.next());\n });\n }", "title": "" }, { "docid": "4f7fac71ef0f846dfe23d5601bcd5fe5", "score": "0.4943237", "text": "function updateDOMListeners (oldVnode, vnode) {\n if (!oldVnode.data.on && !vnode.data.on) {\n return\n }\n var on = vnode.data.on || {};\n var oldOn = oldVnode.data.on || {};\n var add = vnode.elm._v_add || (vnode.elm._v_add = function (event, handler, capture) {\n vnode.elm.addEventListener(event, handler, capture);\n });\n var remove = vnode.elm._v_remove || (vnode.elm._v_remove = function (event, handler) {\n vnode.elm.removeEventListener(event, handler);\n });\n updateListeners(on, oldOn, add, remove, vnode.context);\n}", "title": "" }, { "docid": "40f0314ffbceef766a48fe658b94610d", "score": "0.4942593", "text": "function listen(event){\n return obj.elem.addEventListener(event, function(e){return obj[event](e)});\n }", "title": "" }, { "docid": "7bee98229889551161f4ec8168f755cf", "score": "0.49401656", "text": "function EventEmitter(){}// Shortcuts to improve speed and size", "title": "" }, { "docid": "eb19a9adf1d7d7125b36e9c6b27cc20b", "score": "0.49332395", "text": "function updateDOMListeners (oldVnode, vnode) {\n\t if (!oldVnode.data.on && !vnode.data.on) {\n\t return\n\t }\n\t var on = vnode.data.on || {}\n\t var oldOn = oldVnode.data.on || {}\n\t var add = vnode.elm._v_add || (vnode.elm._v_add = function (event, handler, capture) {\n\t vnode.elm.addEventListener(event, handler, capture)\n\t })\n\t var remove = vnode.elm._v_remove || (vnode.elm._v_remove = function (event, handler) {\n\t vnode.elm.removeEventListener(event, handler)\n\t })\n\t updateListeners(on, oldOn, add, remove)\n\t}", "title": "" }, { "docid": "4d61ee24d81fe3b72c26a99c48fd3369", "score": "0.4930123", "text": "function addE(n){\n n.addEventListener(\"mouseover\", over);\n n.addEventListener(\"mouseout\", out);\n n.addEventListener(\"click\", click);\n}", "title": "" }, { "docid": "cb5a945ac640ee272cecef00e04cd164", "score": "0.49219516", "text": "subscribeToEvent(eventName, listener){\n this._eventEmmiter.on(eventName, listener);\n }", "title": "" }, { "docid": "dbdfcbd2f719b5c3b133cb4bcd6049a3", "score": "0.4918604", "text": "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "title": "" }, { "docid": "dbdfcbd2f719b5c3b133cb4bcd6049a3", "score": "0.4918604", "text": "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "title": "" }, { "docid": "9e9b58c31bdab3051bc7cfe0a53d17d9", "score": "0.4916818", "text": "add(part) {\n const listener = super.add(part);\n if (!listener)\n return null;\n listener._listen();\n return listener;\n }", "title": "" }, { "docid": "63d07e9971e2742853bae8f8c0f84a28", "score": "0.4915268", "text": "addEventListener(event, callback) {\n const RNAliyunEmitter = Platform.OS === 'ios' ? new NativeEventEmitter(RNAliyunOSS) : DeviceEventEmitter;\n switch (event) {\n case 'uploadProgress':\n subscription = RNAliyunEmitter.addListener(\n 'uploadProgress',\n e => callback(e)\n );\n break;\n case 'downloadProgress':\n subscription = RNAliyunEmitter.addListener(\n 'downloadProgress',\n e => callback(e)\n );\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "7ce8cb816c835bea9796772cf5def76f", "score": "0.49121445", "text": "function subscribe(listener) {\r\n subscribers.push(listener);\r\n }", "title": "" }, { "docid": "4efb2ad2ea1152853b63e7031f41ad54", "score": "0.48997995", "text": "bind() {\n if (this.hook && this.docElementNS) {\n this.hook.appendChild(this.docElementNS);\n }\n }", "title": "" }, { "docid": "4efb2ad2ea1152853b63e7031f41ad54", "score": "0.48997995", "text": "bind() {\n if (this.hook && this.docElementNS) {\n this.hook.appendChild(this.docElementNS);\n }\n }", "title": "" }, { "docid": "5bf3aabfd028739527e9ec2cfa0a2ca9", "score": "0.4896688", "text": "function wrap(node) {\r\n node.on = function(name, callback) {\r\n node.addEventListener(name, callback);\r\n };\r\n}", "title": "" }, { "docid": "0b5148055c13562648d29dc8b515a9e4", "score": "0.48854166", "text": "subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on(io, \"open\", this.onopen.bind(this)),\n on(io, \"packet\", this.onpacket.bind(this)),\n on(io, \"error\", this.onerror.bind(this)),\n on(io, \"close\", this.onclose.bind(this)),\n ];\n }", "title": "" }, { "docid": "5150ba541cae7f25452f25b291b0e18e", "score": "0.48853838", "text": "function updateDOMListeners (oldVnode, vnode) {\n\t if (!oldVnode.data.on && !vnode.data.on) {\n\t return\n\t }\n\t var on = vnode.data.on || {};\n\t var oldOn = oldVnode.data.on || {};\n\t var add = vnode.elm._v_add || (vnode.elm._v_add = function (event, handler, capture) {\n\t vnode.elm.addEventListener(event, handler, capture);\n\t });\n\t var remove = vnode.elm._v_remove || (vnode.elm._v_remove = function (event, handler) {\n\t vnode.elm.removeEventListener(event, handler);\n\t });\n\t updateListeners(on, oldOn, add, remove, vnode.context);\n\t}", "title": "" }, { "docid": "5150ba541cae7f25452f25b291b0e18e", "score": "0.48853838", "text": "function updateDOMListeners (oldVnode, vnode) {\n\t if (!oldVnode.data.on && !vnode.data.on) {\n\t return\n\t }\n\t var on = vnode.data.on || {};\n\t var oldOn = oldVnode.data.on || {};\n\t var add = vnode.elm._v_add || (vnode.elm._v_add = function (event, handler, capture) {\n\t vnode.elm.addEventListener(event, handler, capture);\n\t });\n\t var remove = vnode.elm._v_remove || (vnode.elm._v_remove = function (event, handler) {\n\t vnode.elm.removeEventListener(event, handler);\n\t });\n\t updateListeners(on, oldOn, add, remove, vnode.context);\n\t}", "title": "" }, { "docid": "68656eb5fe381fd03bba1cc287462c97", "score": "0.48822588", "text": "addListener(listener) {\n if (!activeListeners.includes(listener)) {\n activeListeners.push(listener);\n }\n }", "title": "" } ]
9f01e6d2f3e01cdf22556e9ccc5030fd
Handles scrolling with easing
[ { "docid": "812a4ef442bbb03c13a7b9a556b9d986", "score": "0.0", "text": "scrollToPosition(newPosition, position = this.scrollContainer.scrollLeft) {\n if (this.scrolling) {\n return;\n }\n\n this.scrolling = true;\n const steps = [];\n const direction = position < newPosition ? 1 : -1;\n const scrollDistance = Math.abs(newPosition - position);\n const seconds = scrollDistance / this.speed;\n const stepCount = Math.floor(this.framesPerSecond * seconds);\n\n if (stepCount < 1) {\n this.scrolling = false;\n return;\n }\n\n for (let i = 0; i < stepCount; i++) {\n const progress = i / stepCount;\n const easingFactor = this.getEasedFactor(this.easing, progress);\n const travel = scrollDistance * easingFactor * direction;\n steps.push(travel + position);\n }\n\n steps.push(newPosition);\n this.move(steps, this.frameTime);\n }", "title": "" } ]
[ { "docid": "e851998c69043b1cbd026db4769b52bb", "score": "0.7476111", "text": "function scroll(){\n scrollTop = window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop;\n diff = elTop - scrollTop;\n // console.log(diff);\n // console.log(scrollTop);\n // console.log(diff);\n // var f = 1;\n if(diff>70 && !((window.innerHeight + scrollTop) >= document.body.offsetHeight)){\n if(diff > totalScroll/2){\n if(easeScroll<1){\n easeScroll+=0.01;\n }\n }else{\n if(easeScroll>0){\n easeScroll-=0.01;\n }\n }\n window.scroll(0,scrollTop+(totalScroll/100*easeScroll));\n scrollingTimeout = setTimeout(scroll,2);\n }\n }", "title": "" }, { "docid": "14511cafb94267bf09a74eb992249f2f", "score": "0.7098876", "text": "function scroll() {\r\n const now = 'now' in window.performance ? performance.now() : new Date().getTime();\r\n const time = Math.min(1, ((now - startTime) / duration));\r\n const timeFunction = easings[easing](time);\r\n window.scroll(0, Math.ceil((timeFunction * (destinationOffsetToScroll - start)) + start));\r\n\r\n // Stop requesting animation when window reached its destination\r\n // And run a callback function\r\n if (window.pageYOffset === destinationOffsetToScroll) {\r\n if (callback) {\r\n callback();\r\n }\r\n return;\r\n }\r\n\r\n // If window still needs to scroll to reach destination\r\n // Request another scroll invokation\r\n requestAnimationFrame(scroll);\r\n }", "title": "" }, { "docid": "6e6675ff0d4bf7bccf7fbcb96456f302", "score": "0.70733935", "text": "function ScrollHandler(pageId) { \n var page = document.getElementById(pageId);\n var pageStart = page.offsetTop;\n var pageJump = false;\n var viewStart;\n var duration = 1000;\n var scrolled = document.getElementById('wrapper');\n\n function scrollToPage() {\n pageJump = true;\n\n // Calculate how far to scroll\n var startLocation = viewStart;\n var endLocation = pageStart;\n var distance = endLocation - startLocation;\n\n var runAnimation;\n \n // Set the animation variables to 0/undefined.\n var timeLapsed = 0;\n var percentage, position;\n\n var easing = function (progress) {\n return progress < 0.5 ? 4 * progress * progress * progress : (progress - 1) * (2 * progress - 2) * (2 * progress - 2) + 1; // acceleration until halfway, then deceleration\n };\n \n function stopAnimationIfRequired(pos) {\n if (pos == endLocation) {\n cancelAnimationFrame(runAnimation);\n setTimeout(function() {\n pageJump = false;\n }, 500); \n }\n }\n \n var animate = function () {\n timeLapsed += 16;\n percentage = timeLapsed / duration;\n if (percentage > 1) {\n percentage = 1;\n position = endLocation; \n } else {\n position = startLocation + distance * easing(percentage);\n }\n scrolled.scrollTop = position;\n runAnimation = requestAnimationFrame(animate);\n stopAnimationIfRequired(position);\nconsole.log('position=' + scrolled.scrollTop + '(' + percentage + ')');\n };\n // Loop the animation function\n runAnimation = requestAnimationFrame(animate);\n }\n \n window.addEventListener('wheel', function(event) {\n viewStart = scrolled.scrollTop; \n if (!pageJump) { \n var pageHeight = page.scrollHeight;\n var pageStopPortion = pageHeight / 2;\n var viewHeight = window.innerHeight;\n\n var viewEnd = viewStart + viewHeight;\n var pageStartPart = viewEnd - pageStart;\n var pageEndPart = (pageStart + pageHeight) - viewStart;\n \n var canJumpDown = pageStartPart >= 0; \n var stopJumpDown = pageStartPart > pageStopPortion; \n \n var canJumpUp = pageEndPart >= 0; \n var stopJumpUp = pageEndPart > pageStopPortion; \n\n var scrollingForward = event.deltaY > 0;\n if ( ( scrollingForward && canJumpDown && !stopJumpDown) \n || (!scrollingForward && canJumpUp && !stopJumpUp)) {\n event.preventDefault();\n scrollToPage();\n } false;//\n } else {\n event.preventDefault();\n } \n })\n}", "title": "" }, { "docid": "180109b56c330e7743cfcaffd7bcd207", "score": "0.70252526", "text": "function _scroll() {\n \n }", "title": "" }, { "docid": "bf9c6858a05e15da47091c4084b40292", "score": "0.7016709", "text": "animateScroll(targetPos) {\n const duration = speeds.BASE_DURATION * this.scrollSpeed\n if (this.scrolling || !targetPos)\n return\n\n // Get start time and initial position\n const ts = performance.now()\n const scrollY = window.scrollY\n\n const step = start => current => {\n const progress = current - start\n const stepDistance = this.easeInOutQuad(\n progress,\n scrollY,\n targetPos - scrollY,\n duration\n )\n\n window.scroll(0, stepDistance)\n if (progress < duration)\n window.requestAnimationFrame(step(start))\n else {\n window.scroll(0, targetPos)\n this.scrolling = false\n }\n }\n\n this.scrolling = true\n step(ts)(ts)\n }", "title": "" }, { "docid": "528694476a6b27b8f9a3888f7fbce8e1", "score": "0.7009498", "text": "function scroll() {\n const now = 'now' in window.performance ? performance.now() : new Date().getTime();\n const time = Math.min(1, ((now - startTime) / duration));\n const timeFunction = easings[easing](time);\n window.scroll(0, Math.ceil((timeFunction * (destinationOffsetToScroll - start)) + start));\n \n // Stop requesting animation when window reached its destination\n // And run a callback function\n if (window.pageYOffset === destinationOffsetToScroll) {\n if (callback) {\n callback();\n }\n return;\n }\n \n // If window still needs to scroll to reach destination\n // Request another scroll invokation\n requestAnimationFrame(scroll);\n }", "title": "" }, { "docid": "6e9c887f6420d1c2a183ee416e67fa9a", "score": "0.6941552", "text": "function scrollAnimation() {\r\n // Animate Scroll\r\n AOS.init({\r\n offset: 80\r\n });\r\n }", "title": "" }, { "docid": "9ae25781c49b645043c15016d8a9d031", "score": "0.693851", "text": "function MouseWheelHandler(e) {\n e.preventDefault(); // prevent default browser scroll\n clearInterval(interval); // cancel previous animation\n ++mult; // we are going to scroll faster\n var delta = -Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n if(dir!=delta) { // scroll direction changed\n mult = 1; // start slowly\n dir = delta;\n }\n for(var tgt=e.target; tgt!=document.documentElement; tgt=tgt.parentNode) {\n var oldScroll = tgt.scrollTop;\n tgt.scrollTop+= delta;\n if(oldScroll!=tgt.scrollTop) break;\n }\n var start = tgt.scrollTop;\n var end = start + length*mult*delta; // where to end the scroll\n var change = end - start; // base change in one step\n var step = 0; // current step\n interval = setInterval(function() {\n var pos = Math.easeOut(step++,start,change,steps);\n //window.scrollTo(0,pos);\n tgt.scrollTop = pos;\n if(step>=steps) { // scroll finished without speed up - stop by easing out\n mult = 0;\n clearInterval(interval);\n }\n },10);\n}", "title": "" }, { "docid": "521bbed61e6e91c600a9c0ad2f2f0b6f", "score": "0.69287276", "text": "_onScroll(e) {\n\n\t\tif (e.deltaY > 0) {\n\t\t\tthis.vars.direction = 1;\n\t\t} else {\n\t\t\tthis.vars.direction = -1;\n\t\t}\n\n\t\tthis.vars.scrollTarget += e.deltaY * -1;\n\t\tthis.vars.scrollTarget = Math.round(Math.max(this.vars.scrollLeft, Math.min(this.vars.scrollTarget, this.vars.scrollRight)));\n\n\t}", "title": "" }, { "docid": "1befb8555eb955d05be8410f4ee35e3c", "score": "0.68860435", "text": "function scrollEvent(e){\n e.preventDefault()\n const targetID = e.currentTarget.getAttribute('href');\n\nconst targetPosition = document.querySelector(targetID).offsetTop-140;\nconst startPosition = window.pageYOffset;\nconst distance = targetPosition - startPosition;\nconst duration = 900;\nlet start = null;\n\nfunction step(timestamp) {\n if (!start) start = timestamp;\n const progress = timestamp - start;\n window.scrollTo(0, ease(progress, startPosition, distance, duration));\n if (progress < duration) {\n window.requestAnimationFrame(step);\n }\n}\nwindow.requestAnimationFrame(step);\n}", "title": "" }, { "docid": "0df3089778863adadb7ac4aaa7f150c3", "score": "0.68171924", "text": "function animate () {\n // get the position of the section\n const height = sectionsArray[o].offsetTop;\n // get the screen's scroll\n const scroll = window.scrollY;\n //check if the scroll is right\n if (scroll >= height && scroll <= height + 20) {\n clearInterval(an);\n } else {\n if (scroll <= height)\n document.body.scrollTop += 20;\n else \n document.body.scrollTop -= 20;\n }\n }", "title": "" }, { "docid": "6ca6f7cec94bdb58a0c770d46a7bc7c9", "score": "0.6807021", "text": "function handleScroll() {\n\tconst scrolled = getScroll();\n\t// shrink logo animation slightly\n\tconst logoScale = 1 - scrolled * 0.7;\n\tlogoAnimationElement.style.transform = `scale(${logoScale}, ${logoScale})`;\n\t// fade down triangle slightly\n\tconst downArrow = document.querySelector('.triangle-down');\n\tconst arrowScale = 1 - scrolled * 3;\n\tdownArrow.style.opacity = arrowScale;\n\t// change transition animation progress\n\tscrollAnimation.seek(scrollAnimation.duration * scrolled);\n}", "title": "" }, { "docid": "8550b44950d1711392f9df2257498223", "score": "0.6803001", "text": "scrollTo() {\n scroller.scrollTo(\"scroll-to-element\", {\n duration: 800,\n delay: 0,\n //**** to change animation below, look into documentation ****\\\\\n smooth: \"easeInOutQuart\"\n });\n }", "title": "" }, { "docid": "8550b44950d1711392f9df2257498223", "score": "0.6803001", "text": "scrollTo() {\n scroller.scrollTo(\"scroll-to-element\", {\n duration: 800,\n delay: 0,\n //**** to change animation below, look into documentation ****\\\\\n smooth: \"easeInOutQuart\"\n });\n }", "title": "" }, { "docid": "87be945962ce93777b8a43bbaf1aab61", "score": "0.68007815", "text": "function smoothScroll(eID) {\n var startY = currentYPosition();\n var stopY = elmYPosition(eID);\n var distance = stopY > startY ? stopY - startY : startY - stopY;\n if (distance < 100) {\n scrollTo(0, stopY); return;\n }\n var speed = Math.round(distance / 100);\n if (speed >= 20) speed = 20;\n var step = Math.round(distance / 25);\n var leapY = stopY > startY ? startY + step : startY - step;\n var timer = 0;\n if (stopY > startY) {\n for (var i = startY; i < stopY; i += step) {\n setTimeout(\"window.scrollTo(0, \" + leapY + \")\", timer * speed);\n leapY += step; if (leapY > stopY) leapY = stopY; timer++;\n } return;\n }\n for (var i = startY; i > stopY; i -= step) {\n setTimeout(\"window.scrollTo(0, \" + leapY + \")\", timer * speed);\n leapY -= step; if (leapY < stopY) leapY = stopY; timer++;\n }\n}", "title": "" }, { "docid": "5c8eafb2f222c07457f2e9ef019f41ee", "score": "0.67981344", "text": "onScroll () {\n if (!this.tickScroll) {\n this.tickScroll = true;\n window.requestAnimationFrame(() => {\n this.updateScroll(this.scrollSource.scrollTop);\n this.tickScroll = false;\n });\n }\n }", "title": "" }, { "docid": "a284fdc1b1e023a56514309d38199841", "score": "0.67945206", "text": "function smoothScroll(e, dur){\n var e = document.querySelector(e),\n ePos = e.getBoundingClientRect().top,\n startPos = window.pageYOffset,\n d = ePos,\n startTime = null;\n \n function animation(currentTime){\n if(startTime === null) startTime = currentTime;\n var elapsed = currentTime - startTime,\n run = easing(elapsed, startPos, d, dur);\n window.scrollTo(0, run);\n if(elapsed < dur) requestAnimationFrame(animation);\n };\n \n requestAnimationFrame(animation);\n}", "title": "" }, { "docid": "33c6479f242849034d025cb215de57a0", "score": "0.67413807", "text": "function mdb_us4_scrollSmooth( $ ) {\n console.log(\"ScrollSmooth load\");\n\n $('.scroll-arrow').click(function( event) {\n console.log(\"Scroll smooth\");\n var sectionTo = $(this).attr('href');\n //sectionTo.animatedScroll({easing: \"easeOutExpo\"});\n $('html, body').animate({\n scrollTop: $(sectionTo).offset().top\n }, 1000);\n event.preventDefault();\n });\n}", "title": "" }, { "docid": "bcffd6de6aa5496e879f64bbbd24bfe9", "score": "0.672733", "text": "function scrollArray(elem,left,top){directionCheck(left,top);if(options.accelerationMax!=1){var now=Date.now();var elapsed=now-lastScroll;if(elapsed<options.accelerationDelta){var factor=(1+50/elapsed)/2;if(factor>1){factor=Math.min(factor,options.accelerationMax);left*=factor;top*=factor;}}lastScroll=Date.now();}// push a scroll command\nque.push({x:left,y:top,lastX:left<0?0.99:-0.99,lastY:top<0?0.99:-0.99,start:Date.now()});// don't act if there's a pending queue\nif(pending){return;}var scrollRoot=getScrollRoot();var isWindowScroll=elem===scrollRoot||elem===document.body;// if we haven't already fixed the behavior, \n// and it needs fixing for this sesh\nif(elem.$scrollBehavior==null&&isScrollBehaviorSmooth(elem)){elem.$scrollBehavior=elem.style.scrollBehavior;elem.style.scrollBehavior='auto';}var step=function step(time){var now=Date.now();var scrollX=0;var scrollY=0;for(var i=0;i<que.length;i++){var item=que[i];var elapsed=now-item.start;var finished=elapsed>=options.animationTime;// scroll position: [0, 1]\nvar position=finished?1:elapsed/options.animationTime;// easing [optional]\nif(options.pulseAlgorithm){position=pulse(position);}// only need the difference\nvar x=item.x*position-item.lastX>>0;var y=item.y*position-item.lastY>>0;// add this to the total scrolling\nscrollX+=x;scrollY+=y;// update last values\nitem.lastX+=x;item.lastY+=y;// delete and step back if it's over\nif(finished){que.splice(i,1);i--;}}// scroll left and top\nif(isWindowScroll){window.scrollBy(scrollX,scrollY);}else{if(scrollX)elem.scrollLeft+=scrollX;if(scrollY)elem.scrollTop+=scrollY;}// clean up if there's nothing left to do\nif(!left&&!top){que=[];}if(que.length){requestFrame(step,elem,1000/options.frameRate+1);}else{pending=false;// restore default behavior at the end of scrolling sesh\nif(elem.$scrollBehavior!=null){elem.style.scrollBehavior=elem.$scrollBehavior;elem.$scrollBehavior=null;}}};// start a new queue of actions\nrequestFrame(step,elem,0);pending=true;}", "title": "" }, { "docid": "b288b7581ec30bbfc0bfaf587ecd0125", "score": "0.67075855", "text": "function smoothScroll(eID) {\n var startY = currentYPosition();\n var stopY = elmYPosition(eID);\n var distance = stopY > startY ? stopY - startY : startY - stopY;\n if (distance < 100) {\n scrollTo(0, stopY);\n return;\n }\n var speed = Math.round(distance / 100);\n if (speed >= 20) speed = 20;\n var step = Math.round(distance / 25);\n var leapY = stopY > startY ? startY + step : startY - step;\n var timer = 0;\n if (stopY > startY) {\n for (var i = startY; i < stopY; i += step) {\n setTimeout(\"window.scrollTo(0, \" + leapY + \")\", timer * speed);\n leapY += step;\n if (leapY > stopY) leapY = stopY;\n timer++;\n }\n return;\n }\n for (var i = startY; i > stopY; i -= step) {\n setTimeout(\"window.scrollTo(0, \" + leapY + \")\", timer * speed);\n leapY -= step;\n if (leapY < stopY) leapY = stopY;\n timer++;\n }\n return false;\n}", "title": "" }, { "docid": "abd59a56311571bd4790dfe08ee05e56", "score": "0.67022794", "text": "function smoothScroll(target, duration){\r\n var target = document.querySelector(target); //target element: next-previous chapter\r\n var targetPosition = target.getBoundingClientRect().top; //elements relative position to the screen\r\n var startPosition = window.pageYOffset; //relative to the window\r\n var distance = targetPosition;\r\n var startTime = null;\r\n\r\n function animation(currentTime){\r\n if(startTime === null){\r\n startTime = currentTime;\r\n }\r\n var timeElapsed = currentTime - startTime;\r\n var run = ease(timeElapsed, startPosition, distance, duration);\r\n window.scrollTo(0, run);\r\n if(timeElapsed < duration){\r\n requestAnimationFrame(animation);\r\n }\r\n }\r\n \r\n //gizma.com/easing\r\n function ease(t,b,c,d){\r\n t /= d / 2;\r\n if (t < 1) return c / 2 * t * t + b;\r\n t--;\r\n return -c / 2 * (t* (t - 2) -1) + b;\r\n }\r\n //requestAnimationFrame(Loop);\r\n\r\n requestAnimationFrame(animation);\r\n \r\n }", "title": "" }, { "docid": "3c0df67e69e5922c225ba461cd39393d", "score": "0.6625035", "text": "function smoothScroll(eID) {\n const startY = currentYPosition();\n let stopY = elmYPosition(eID);\n if(eID !== '#contact') {\n stopY = stopY - 120;\n };\n const distance = stopY > startY ? stopY - startY : startY - stopY;\n if (distance < 100) {\n scrollTo(0, stopY);\n return;\n }; \n let speed = Math.round(distance / 100);\n if (speed >= 20) speed = 20;\n const step = Math.round(distance / 25);\n let leapY = stopY > startY ? startY + step : startY - step;\n let timer = 0;\n\n // PERFORMS downward scroll\n if (stopY > startY) {\n for (let i = startY; i < stopY; i += step) {\n setTimeout(`window.scrollTo(0, ${leapY})`, timer * speed);\n leapY += step;\n if (leapY > stopY) leapY = stopY;\n timer++;\n }; \n return;\n };\n // PERFORMS upward scroll\n for (let i = startY; i > stopY; i -= step) {\n setTimeout(`window.scrollTo(0, ${leapY})`, timer * speed);\n leapY -= step; \n if (leapY < stopY) leapY = stopY;\n timer++;\n };\n}", "title": "" }, { "docid": "2ca3aba75158f2b42e196c2a36174bf7", "score": "0.6618213", "text": "function smoothScroll(target,duration){\n var target = document.querySelector(target);\n var targetPosition = target.getBoundingClientRect();\n var startPosition = window.pageYOffset;\n var distance = targetPosition.y - startPosition;\n var startTime = null;\n\n console.log(\"TargetPosition.y: \" + targetPosition.y);\n console.log(\"StartPosition \" + startPosition);\n console.log(\"Distance: \" + distance);\n\n function animation(currentTime){\n console.log(\"startTime: \" + startTime);\n console.log(\"currentTime: \" + currentTime);\n\n if(startTime === null) startTime = currentTime;\n var timeElapsed = currentTime - startTime;\n var run = ease(timeElapsed, startPosition, distance, duration);\n window.scrollTo(0, run);\n if(timeElapsed < duration) window.requestAnimationFrame(animation);\n }\n\n function ease(t, b, c, d) {\n t /= d/2;\n if ( t < 1 ) return c / 2 * t * t + b;\n t--;\n var result = -c / 2 * (t * (t - 2) - 1) + b;\n console.log(result);\n return result;\n }\n\n window.requestAnimationFrame(animation);\n}", "title": "" }, { "docid": "4a6f1c996189cc86f4928dc15f9885f6", "score": "0.65870076", "text": "function animatedScroll() {\n\t\n\t\tjQuery('a').click(function() {\n\t\t\tvar elementClicked = jQuery(this).attr(\"href\");\n\t\t\tvar destination = jQuery(elementClicked).offset().top;\n\t\t\tjQuery(\"html:not(:animated),body:not(:animated)\").animate({ scrollTop: destination}, 500 );\n\t\t\treturn false;\n\t\t});\n\t\n\t}", "title": "" }, { "docid": "a12272ebb17a1ddffa9d5267628def5b", "score": "0.6584879", "text": "function citeScroll(t){jQuery(\"html, body\").animate({scrollTop:jQuery(t).offset().top-citeproFront.citeOffset},citeproFront.citeSpeed)}", "title": "" }, { "docid": "b0e3b22ac12d02529f5a5b79e31bf88e", "score": "0.65800625", "text": "function smoothScroll (targetElement) {\n\t//you can change the duration of the animation with this\n\tvar duration = 750;\n\t//stop the current animation\n\t$(\"html, body\").stop(true,false);\n\t$(\"html, body\").animate({\n\t\tscrollTop:$(targetElement).offset().top\n\t},duration,\"swing\");\n\t//see https://api.jquery.com/scrollTop/ for reference and more information on scrollTop\n}", "title": "" }, { "docid": "8c05c57c1351f04ab7535bc04733cae4", "score": "0.65761507", "text": "function animateScroll() {\n\tif(window.scrollY > 0) {\n\t\twindow.scrollBy(0, -100);\n\t\tsetTimeout(animateScroll, 25);\n\t} \n}", "title": "" }, { "docid": "ab7fe50e8ea7fd9f3cda847bfc65c615", "score": "0.65535563", "text": "function scrollTo(target) {\n g_animatingScroll = true;\n\n var windowHeight = $(window).height();\n var documentHeight = $(document).height();\n var maxScrollDest = documentHeight - windowHeight;\n\n g_scrollDest = target;\n if (g_scrollDest < 0) {\n g_scrollDest = 0;\n } else if (g_scrollDest > maxScrollDest) {\n g_scrollDest = maxScrollDest;\n }\n\n if (g_scrollInterval) {\n return;\n }\n\n g_currentScroll = $(window).scrollTop();\n\n g_scrollInterval = setInterval(function() {\n var scrollDiff = (g_scrollDest - g_currentScroll) * SCROLL_EASE;\n var way = scrollDiff / Math.abs(scrollDiff);\n g_speed += MAX_ACCELERATION * way;\n\n if (Math.abs(scrollDiff) > Math.abs(g_speed)) {\n scrollDiff = g_speed;\n } else {\n g_speed = scrollDiff;\n }\n g_currentScroll += scrollDiff;\n $(window).scrollTop(g_currentScroll);\n\n if (Math.abs(g_currentScroll - g_scrollDest) < .5) {\n g_animatingScroll = false;\n g_currentScroll = g_scrollDest;\n\n clearInterval(g_scrollInterval);\n\n g_scrollInterval = undefined;\n g_scrollToSection = false;\n }\n }, 1000 / 60);\n }", "title": "" }, { "docid": "3d5e571f4a484f81f8cda8bf403aec5e", "score": "0.65502757", "text": "onScroll() {\n this.lastScrollY = window.scrollY;\n this.requestTick();\n }", "title": "" }, { "docid": "c7fb68d2d3dde2cc3287fdc4011a4908", "score": "0.6545723", "text": "_onScroll( e ) {\n this._lastScroll = window.scrollY;\n this._requestTick();\n }", "title": "" }, { "docid": "e4a91d5d593da3240169266fc5e851ce", "score": "0.6529759", "text": "function smoothScrollTo(e) {\n if (portAllowScroll) {\n TweenMax.to(window, 0.7, {\n scrollTo: scrollTo,\n onStart: function() {\n if (sectionActive === 3) {\n portAllowScroll = false;\n }\n },\n onComplete: function() {}\n });\n } else {\n portSliderMove(e);\n }\n}", "title": "" }, { "docid": "c70a6903615ce3da6474ae695ef23052", "score": "0.6511494", "text": "function scrollDown(val) {\n\t\tif(!animating){\t\t\t\n\t\t\tanimating = true;\n\t\t\tif(!$(\"footer\").hasClass(\"fInactive\")){\n\t\t\t\tanimating = false;\n\t\t\t\tconsole.log(\"already at end\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if($(window).scrollTop() == $(\".page:last-child\").offset().top) {\n\t\t\t\t$(\"footer\").removeClass(\"fInactive\");\n\t\t\t\tif($(window).height() < 750){\n\t\t\t\t\t$(\".navigation\").animate({\n\t\t\t\t\t\ttop: \"-25%\"\n\t\t\t\t\t}, 1000)\n\t\t\t\t}\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(document).height()\n\n\t\t\t\t}, 1000, \"easeInOutQuint\", function(){\n\t\t\t\t\tanimating = false;\n\t\t\t\t}, 300);\n\t\t\t\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\telse {\t\t\t\n\t\t\t\tval++;\n\t\t\t\tinView = val;\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(\".page:nth-child(\" + val +\")\").offset().top\n\t\t\t\t}, 1000, \"easeInOutQuint\", function(){\t\t\t\t\n\t\t\t\t\t$(\".page:nth-child(\" + (val- 1) +\")\").children(\".image\").removeClass(\"pActive\");\n\t\t\t\t\t$(\".page:nth-child(\" + val +\")\").children(\".image\").addClass(\"pActive\");\n\t\t\t\t\tanimating = false;\t\n\t\t\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "e04cf5b0591c0c78ebc0884ddf5571ae", "score": "0.6496612", "text": "function updateScroll () {\n\t if (!elements.li[0]) return;\n\t var height = elements.li[0].offsetHeight,\n\t top = height * ctrl.index,\n\t bot = top + height,\n\t hgt = elements.scroller.clientHeight,\n\t scrollTop = elements.scroller.scrollTop;\n\t if (top < scrollTop) {\n\t scrollTo(top);\n\t } else if (bot > scrollTop + hgt) {\n\t scrollTo(bot - hgt);\n\t }\n\t }", "title": "" }, { "docid": "b143b210343b2324193163cc45e98955", "score": "0.64918363", "text": "function animateScroll(targetScrollPosition){\n var currentTop = $(window).scrollTop(), rate = 2;\n var distance = Math.abs(currentTop - targetScrollPosition);\n var scrollDuration = distance / rate;\n $(\"HTML, BODY\").animate({scrollTop: targetScrollPosition }, scrollDuration);\n}", "title": "" }, { "docid": "76d8d69db366518a0d147920e28e9aba", "score": "0.6490944", "text": "function scrollArray(elem, left, top) {\n \n directionCheck(left, top);\n\n if (options.accelerationMax != 1) {\n var now = Date.now();\n var elapsed = now - lastScroll;\n if (elapsed < options.accelerationDelta) {\n var factor = (1 + (50 / elapsed)) / 2;\n if (factor > 1) {\n factor = Math.min(factor, options.accelerationMax);\n left *= factor;\n top *= factor;\n }\n }\n lastScroll = Date.now();\n } \n \n // push a scroll command\n que.push({\n x: left, \n y: top, \n lastX: (left < 0) ? 0.99 : -0.99,\n lastY: (top < 0) ? 0.99 : -0.99, \n start: Date.now()\n });\n \n // don't act if there's a pending queue\n if (pending) {\n return;\n } \n\n var scrollRoot = getScrollRoot();\n var isWindowScroll = (elem === scrollRoot || elem === document.body);\n \n // if we haven't already fixed the behavior, \n // and it needs fixing for this sesh\n if (elem.$scrollBehavior == null && isScrollBehaviorSmooth(elem)) {\n elem.$scrollBehavior = elem.style.scrollBehavior;\n elem.style.scrollBehavior = 'auto';\n }\n\n var step = function (time) {\n \n var now = Date.now();\n var scrollX = 0;\n var scrollY = 0; \n \n for (var i = 0; i < que.length; i++) {\n \n var item = que[i];\n var elapsed = now - item.start;\n var finished = (elapsed >= options.animationTime);\n \n // scroll position: [0, 1]\n var position = (finished) ? 1 : elapsed / options.animationTime;\n \n // easing [optional]\n if (options.pulseAlgorithm) {\n position = pulse(position);\n }\n \n // only need the difference\n var x = (item.x * position - item.lastX) >> 0;\n var y = (item.y * position - item.lastY) >> 0;\n \n // add this to the total scrolling\n scrollX += x;\n scrollY += y; \n \n // update last values\n item.lastX += x;\n item.lastY += y;\n \n // delete and step back if it's over\n if (finished) {\n que.splice(i, 1); i--;\n } \n }\n\n // scroll left and top\n if (isWindowScroll) {\n window.scrollBy(scrollX, scrollY);\n } \n else {\n if (scrollX) elem.scrollLeft += scrollX;\n if (scrollY) elem.scrollTop += scrollY; \n }\n \n // clean up if there's nothing left to do\n if (!left && !top) {\n que = [];\n }\n \n if (que.length) { \n requestFrame(step, elem, (1000 / options.frameRate + 1)); \n } else { \n pending = false;\n // restore default behavior at the end of scrolling sesh\n if (elem.$scrollBehavior != null) {\n elem.style.scrollBehavior = elem.$scrollBehavior;\n elem.$scrollBehavior = null;\n }\n }\n };\n \n // start a new queue of actions\n requestFrame(step, elem, 0);\n pending = true;\n}", "title": "" }, { "docid": "880cd1af40da8de7730d6de554aca1bf", "score": "0.64853394", "text": "function scroll(id) {\n $(htmlBodySelector).animate(\n {\n scrollTop: $(`#${id}`).offset().top - 700,\n },\n 600\n ); //speed//\n}", "title": "" }, { "docid": "77855ccb3d7fdbdd0f189ee4286437f3", "score": "0.6482826", "text": "function animate (step) {\n var element,\n style,\n pos,\n isEventSet;\n\n if (Math.abs(totalScroll + step) > overflow) {\n step = 0;\n }\n\n// if (isAnimating) {\n// return;\n// }\n\n isAnimating = true;\n totalScroll += step;\n\n scroll += step;\n if (scroll < 0) {\n scroll += length;\n }\n else if (scroll >= length) {\n scroll -= length;\n }\n\n for (var i = 0; i < length; i++) {\n pos = realIndex(i);\n element = elements[i];\n style = element.style;\n if (isVisible(i, step)) {\n style.webkitTransition = style.transition = '';\n style.webkitTransform = style.transform = 'translate3d(' + pos * elementWidth + 'px, 0, 0)';\n if (!isEventSet) {\n isEventSet = true;\n element.addEventListener(transitionend, afterAnimate);\n }\n }\n else if (step) {\n style.webkitTransition = style.transition = 'none';\n style.webkitTransform = style.transform = 'translate3d(' + (pos * elementWidth) + 'px, 0, 0)';\n }\n }\n }", "title": "" }, { "docid": "d138d9effc2472418b8ae8e0a804d3b6", "score": "0.6475229", "text": "function updateScroll () {\r\n if (!elements.li[0]) return;\r\n var height = elements.li[0].offsetHeight,\r\n top = height * ctrl.index,\r\n bot = top + height,\r\n hgt = elements.scroller.clientHeight,\r\n scrollTop = elements.scroller.scrollTop;\r\n if (top < scrollTop) {\r\n scrollTo(top);\r\n } else if (bot > scrollTop + hgt) {\r\n scrollTo(bot - hgt);\r\n }\r\n }", "title": "" }, { "docid": "fb830b553fcf9249b829da132bc3d35d", "score": "0.64696914", "text": "scrollTo(element, to, duration) {\n const start = element.scrollTop; // current scroll postion\n const change = to - start; // differents between current postion and destination postion\n let currentTime = 0;\n const increment = 20;\n const easeInOutQuad = (t, b, c, d) => { // function for calculating easeInout animation\n t /= d / 2;\n if (t < 1) return (c / 2) * t * t + b;\n t -= 1;\n return -(c / 2) * (t * (t - 2) - 1) + b;\n };\n const animateScroll = () => { // actual function to scrolling\n currentTime += increment;\n element.scrollTop = easeInOutQuad(currentTime, start, change, duration);\n if (currentTime < duration) {\n setTimeout(animateScroll, increment);\n }\n };\n animateScroll();\n }", "title": "" }, { "docid": "3fde9e701df1c998ed989fcdd16da1e1", "score": "0.645911", "text": "function scrollHandler() {\n slides.forEach((slide, i) => {\n const thing = things[i];\n const x = (slide.target + flkty.x) * 0.53;\n thing.style.transform = `translateX(${-x}px)`;\n });\n }", "title": "" }, { "docid": "b480ca988296525adc2c5a72375fda7a", "score": "0.6456095", "text": "scrolldown (event) {\n var article = this.article.wrapper.getBoundingClientRect()\n this.article.wrapper.scrollBy({\n top: article.height / 2,\n behavior: 'smooth'\n })\n event.stopPropagation()\n }", "title": "" }, { "docid": "99e3e53d56bb04b65ac3bbffba18b67e", "score": "0.6453916", "text": "function onScroll() {\n requestTick();\n}", "title": "" }, { "docid": "2c5205b9e3b0e66e2b9e4bcf8256d67e", "score": "0.64524174", "text": "onMouseWheel (event) {\n // normalize the vertical scroll amount across browsers\n const { pixelY } = NormalizeWheel(event)\n\n // pixelY is essentially the speed of how many pixels we scroll\n this.scroll.target += pixelY\n }", "title": "" }, { "docid": "0a9614ef4baa2f906a998821efc81ebb", "score": "0.64500546", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "title": "" }, { "docid": "0a9614ef4baa2f906a998821efc81ebb", "score": "0.64500546", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "title": "" }, { "docid": "0a9614ef4baa2f906a998821efc81ebb", "score": "0.64500546", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "title": "" }, { "docid": "292ef6b10bf3c701b9d79bbd3bdc6dac", "score": "0.64448303", "text": "function scrollTo() {\n $('a[href^=\"#\"]').on('click', function(e) {\n e.preventDefault();\n \n //IMPORTANT, SETS TIME OF SCROLL\n var scroll_speed = 800;\n \n var target = this.hash;\n var $target = $(target);\n \n //If the position of page, does not equal where were going, we can animate\n if(position != target){\n \n position = target;\n //Scroll to\n $('html, body').animate({\n 'scrollTop': $target.offset().top\n }, scroll_speed, 'swing', function() {\n\n });\n \n //Else wiggle the dots/a links \n } else {\n if(!isMobile) {\n wiggleElement($(\"nav ul\"));\n }\n }\n \n });\n}", "title": "" }, { "docid": "5a110a4d34c49f07d0dd13b34afef769", "score": "0.64355135", "text": "function onScroll() {\n active = true;\n latestKnownScrollY = getScrollPosition();\n requestTick();\n }", "title": "" }, { "docid": "f042f92e52d65437d268c51b4f670f1f", "score": "0.6433658", "text": "scrollWebPage(e) {\r\n const target = e.target ? e.composedPath()[0] : e.target;\r\n if (target.classList.contains('dxp-down-arrow')) {\r\n const bottom = e.target.parentElement.getClientRects()[0].bottom + 3;\r\n const scrollStep = 10;\r\n let sum = 0;\r\n const scrollInterval = setInterval(() => {\r\n sum += scrollStep;\r\n if (bottom >= sum) {\r\n window.scrollBy(0, scrollStep);\r\n }\r\n else {\r\n clearInterval(scrollInterval);\r\n this.currentPos(target);\r\n }\r\n }, 0);\r\n }\r\n }", "title": "" }, { "docid": "09c232029e0b44640932f16016083997", "score": "0.64334375", "text": "function scrollDown() {\n\t\tvar height = $(document).height();\t\t\n\t\tvar scrollTime = .6*height;\t\t\t// dynamically calculate scroll time dependent on distance to travel\n\t\t$(\"html, body\").animate({scrollTop: height-$(window).height()}, scrollTime);\n\t}", "title": "" }, { "docid": "8e82bd86536907392eba4e4650f4ebb4", "score": "0.64271003", "text": "function scrollTop() {\n\t\t$(\"html, body\").animate({\n\t\t\tscrollTop: 0\n\t\t}, 1000, \"easeInOutQuint\");\n\t}", "title": "" }, { "docid": "5c26273960930681cafb5788ee8cfab0", "score": "0.6414574", "text": "function performMovement(v){\n var isFastSpeed = options.scrollingSpeed < 700;\n var transitionLapse = isFastSpeed ? 700 : options.scrollingSpeed; \n\n // using CSS3 translate functionality\n if (options.css3 && options.autoScrolling && !options.scrollBar) {\n\n // The first section can have a negative value in iOS 10. Not quite sure why: -0.0142822265625\n // that's why we round it to 0.\n var translate3d = 'translate3d(0px, -' + Math.round(v.dtop) + 'px, 0px)';\n transformContainer(translate3d, true);\n\n //even when the scrollingSpeed is 0 there's a little delay, which might cause the\n //scrollingSpeed to change in case of using silentMoveTo();\n if(options.scrollingSpeed){\n clearTimeout(afterSectionLoadsId);\n afterSectionLoadsId = setTimeout(function () {\n afterSectionLoads(v);\n\n //disabling canScroll when using fastSpeed\n canScroll = !isFastSpeed;\n }, options.scrollingSpeed); \n }else{\n afterSectionLoads(v);\n }\n }\n\n // using JS to animate\n else{\n var scrollSettings = getScrollSettings(v.dtop);\n FP.test.top = -v.dtop + 'px';\n\n scrollTo(scrollSettings.element, scrollSettings.options, options.scrollingSpeed, function(){\n if(options.scrollBar){\n\n /* Hack!\n The timeout prevents setting the most dominant section in the viewport as \"active\" when the user\n scrolled to a smaller section by using the mousewheel (auto scrolling) rather than draging the scroll bar.\n\n When using scrollBar:true It seems like the scroll events still getting propagated even after the scrolling animation has finished.\n */\n setTimeout(function(){\n afterSectionLoads(v);\n },30);\n }else{\n \n afterSectionLoads(v);\n\n //disabling canScroll when using fastSpeed\n canScroll = !isFastSpeed;\n }\n });\n }\n\n // enabling canScroll after the minimum transition laps\n if(isFastSpeed){\n clearTimeout(g_transitionLapseId);\n g_transitionLapseId = setTimeout(function(){\n canScroll = true;\n }, transitionLapse);\n }\n }", "title": "" }, { "docid": "06d27ed8d8a629f3a15ac4eed980c196", "score": "0.64104235", "text": "function goScrolling(x, y, startLocationX, startLocationY, maxX, maxY, speed, easing, scrollingComplete, render) {\n // deltaX,\n // deltaY,\n var deltaX = x - startLocationX;\n var deltaY = y - startLocationY;\n var positionX = startLocationX;\n var positionY = startLocationY;\n /**\n * keep the limit of scroll delta.\n */\n /* istanbul ignore next */\n if (startLocationY + deltaY < 0) {\n deltaY = -startLocationY;\n }\n if (startLocationY + deltaY > maxY) {\n deltaY = maxY - startLocationY;\n }\n if (startLocationX + deltaX < 0) {\n deltaX = -startLocationX;\n }\n if (startLocationX + deltaX > maxX) {\n deltaX = maxX - startLocationX;\n }\n\n var easingMethod = createEasingFunction(easing, easingPattern);\n\n var stepCallback = function stepCallback(percentage) {\n positionX = startLocationX + deltaX * percentage;\n positionY = startLocationY + deltaY * percentage;\n render(Math.floor(positionX), Math.floor(positionY));\n };\n\n var verifyCallback = function verifyCallback() {\n return Math.abs(positionY - startLocationY) <= Math.abs(deltaY) || Math.abs(positionX - startLocationX) <= Math.abs(deltaX);\n };\n\n core.effect.Animate.start(stepCallback, verifyCallback, scrollingComplete, speed, easingMethod);\n }", "title": "" }, { "docid": "d136968b558714ead337844d272d6a6f", "score": "0.6408234", "text": "addSmoothScrolling(){\n this.headerLinks.smoothScroll();\n }", "title": "" }, { "docid": "cc1835fbe45bed4e2fee142f1ed9fb9e", "score": "0.64027846", "text": "function animateScroll() {\n if (docWidth >= 900) {\n animate();\n animateTwo();\n hidden.style.opacity = 1;\n } else if (docWidth < 899) {\n animate();\n animateDos();\n animateThree();\n animateFour();\n hidden.style.opacity = 1;\n } else {\n console.log(`nothing happened`);\n }\n }", "title": "" }, { "docid": "febccc398072f1788bffaf6634eb6f18", "score": "0.63977087", "text": "function smooth_scroll(dest_y,expected_scroll_y,dir,event_after)\n{\n\t/*{+START,IF,{$NOT,{$CONFIG_OPTION,enable_animations}}}*/\n\t\ttry\n\t\t{\n\t\t\twindow.scrollTo(0,dest_y);\n\t\t}\n\t\tcatch (e) {}\n\t\tif (true) return;\n\t/*{+END}*/\n\n\tvar scroll_y=get_window_scroll_y();\n\tif (typeof dest_y=='string') dest_y=find_pos_y(document.getElementById(dest_y),true);\n\tif (dest_y<0) dest_y=0;\n\tif ((typeof expected_scroll_y!='undefined') && (expected_scroll_y!=null) && (expected_scroll_y!=scroll_y)) return; // We must terminate, as the user has scrolled during our animation and we do not want to interfere with their action -- or because our last scroll failed, due to us being on the last scroll screen already\n\tif (typeof dir=='undefined' || !null) var dir=(dest_y>scroll_y)?1:-1;\n\n\tvar distance_to_go=(dest_y-scroll_y)*dir;\n\tvar dist=Math.round(dir*(distance_to_go/25));\n\tif (dir==-1 && dist>-25) dist=-25;\n\tif (dir==1 && dist<25) dist=25;\n\n\tif (((dir==1) && (scroll_y+dist>=dest_y)) || ((dir==-1) && (scroll_y+dist<=dest_y)) || (distance_to_go>2000))\n\t{\n\t\ttry\n\t\t{\n\t\t\twindow.scrollTo(0,dest_y);\n\t\t}\n\t\tcatch (e) {}\n\t\tif (event_after) event_after();\n\t\treturn;\n\t}\n\ttry\n\t{\n\t\twindow.scrollBy(0,dist);\n\t}\n\tcatch (e) { return; } // May be stopped by popup blocker\n\n\twindow.setTimeout(function() { smooth_scroll(dest_y,scroll_y+dist,dir,event_after); } , 30);\n}", "title": "" }, { "docid": "8d617c2dc443d6df0f0360b92458f7da", "score": "0.63934785", "text": "function onScroll() {\n\t var scrollTop = contentEl.prop('scrollTop');\n\t var isScrollingDown = scrollTop > (onScroll.prevScrollTop || 0);\n\t\n\t // Store the previous scroll so we know which direction we are scrolling\n\t onScroll.prevScrollTop = scrollTop;\n\t\n\t //\n\t // AT TOP (not scrolling)\n\t //\n\t if (scrollTop === 0) {\n\t // If we're at the top, just clear the current item and return\n\t setCurrentItem(null);\n\t return;\n\t }\n\t\n\t //\n\t // SCROLLING DOWN (going towards the next item)\n\t //\n\t if (isScrollingDown) {\n\t\n\t // If we've scrolled down past the next item's position, sticky it and return\n\t if (self.next && self.next.top <= scrollTop) {\n\t setCurrentItem(self.next);\n\t return;\n\t }\n\t\n\t // If the next item is close to the current one, push the current one up out of the way\n\t if (self.current && self.next && self.next.top - scrollTop <= self.next.height) {\n\t translate(self.current, scrollTop + (self.next.top - self.next.height - scrollTop));\n\t return;\n\t }\n\t }\n\t\n\t //\n\t // SCROLLING UP (not at the top & not scrolling down; must be scrolling up)\n\t //\n\t if (!isScrollingDown) {\n\t\n\t // If we've scrolled up past the previous item's position, sticky it and return\n\t if (self.current && self.prev && scrollTop < self.current.top) {\n\t setCurrentItem(self.prev);\n\t return;\n\t }\n\t\n\t // If the next item is close to the current one, pull the current one down into view\n\t if (self.next && self.current && (scrollTop >= (self.next.top - self.current.height))) {\n\t translate(self.current, scrollTop + (self.next.top - scrollTop - self.current.height));\n\t return;\n\t }\n\t }\n\t\n\t //\n\t // Otherwise, just move the current item to the proper place (scrolling up or down)\n\t //\n\t if (self.current) {\n\t translate(self.current, scrollTop);\n\t }\n\t }", "title": "" }, { "docid": "a16bcd9313c34af8a6743927184dc337", "score": "0.6383087", "text": "function momentumScroll() {\r\n /*Determining the scroll distance for the current iteration*/\r\n /*Here the constant 1 determines the rate at which scrolling slows down and maybe changed as required*/\r\n //momentumScrollPx = pixelsDifference - momentumScrollIter * 1;\r\n momentumScrollPx = pixelsDifference - momentumScrollIter;\r\n\r\n /*Check if the scroll distance has reduced to 0 or below*/\r\n if (momentumScrollPx < 0) {\r\n clearInterval(timeIntervalMomentumScroll);\r\n } else {\r\n /*Applying the scroll to the required container*/\r\n currentScrollObj.scrollLeft -= (momentumScrollPx * momentumScrollDir);\r\n\r\n /*Incrementing the iteration number*/\r\n momentumScrollIter += 2;\r\n }\r\n }", "title": "" }, { "docid": "49e39eb142c5a9378d3b167d94a4a2cf", "score": "0.6377017", "text": "function scrollArray(elem, left, top) {\n \n directionCheck(left, top);\n\n if (options.accelerationMax != 1) {\n var now = Date.now();\n var elapsed = now - lastScroll;\n if (elapsed < options.accelerationDelta) {\n var factor = (1 + (50 / elapsed)) / 2;\n if (factor > 1) {\n factor = Math.min(factor, options.accelerationMax);\n left *= factor;\n top *= factor;\n }\n }\n lastScroll = Date.now();\n } \n \n // push a scroll command\n que.push({\n x: left, \n y: top, \n lastX: (left < 0) ? 0.99 : -0.99,\n lastY: (top < 0) ? 0.99 : -0.99, \n start: Date.now()\n });\n \n // don't act if there's a pending queue\n if (pending) {\n return;\n } \n\n var scrollWindow = (elem === document.body);\n \n var step = function (time) {\n \n var now = Date.now();\n var scrollX = 0;\n var scrollY = 0; \n \n for (var i = 0; i < que.length; i++) {\n \n var item = que[i];\n var elapsed = now - item.start;\n var finished = (elapsed >= options.animationTime);\n \n // scroll position: [0, 1]\n var position = (finished) ? 1 : elapsed / options.animationTime;\n \n // easing [optional]\n if (options.pulseAlgorithm) {\n position = pulse(position);\n }\n \n // only need the difference\n var x = (item.x * position - item.lastX) >> 0;\n var y = (item.y * position - item.lastY) >> 0;\n \n // add this to the total scrolling\n scrollX += x;\n scrollY += y; \n \n // update last values\n item.lastX += x;\n item.lastY += y;\n \n // delete and step back if it's over\n if (finished) {\n que.splice(i, 1); i--;\n } \n }\n\n // scroll left and top\n if (scrollWindow) {\n window.scrollBy(scrollX, scrollY);\n } \n else {\n if (scrollX) elem.scrollLeft += scrollX;\n if (scrollY) elem.scrollTop += scrollY; \n }\n \n // clean up if there's nothing left to do\n if (!left && !top) {\n que = [];\n }\n \n if (que.length) { \n requestFrame(step, elem, (1000 / options.frameRate + 1)); \n } else { \n pending = false;\n }\n };\n \n // start a new queue of actions\n requestFrame(step, elem, 0);\n pending = true;\n}", "title": "" }, { "docid": "b3988711830e120222782dfbf209bf99", "score": "0.63710797", "text": "function scrollHandler() {\n\t\t\tupdateMaxScrolls();\n\t\t\tactivityHandler();\n\t\t}", "title": "" }, { "docid": "6ccd74d43dc5178ba608ede56336e87c", "score": "0.6365939", "text": "function animateOnScroll(){\n var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,\n sectionTitles = document.querySelectorAll(\"section h3.title\"),\n sectionHRs = document.querySelectorAll(\"section hr\"),\n sectionParagraphs = document.querySelectorAll(\"section p\"),\n destImages = document.querySelectorAll(\".destinations .grid li\"),\n packagesInfo = document.querySelectorAll(\".packages .grid li\");\n\n animateElements(sectionTitles, \"slide-in\");\n animateElements(sectionHRs, \"slide-in\");\n animateElements(sectionParagraphs, \"fade-in\");\n animateElements(destImages, \"slide-in\");\n animateElements(packagesInfo, \"rotate-and-fade-in\");\n}", "title": "" }, { "docid": "83c6ed25aa1affbb9e37b63b8cfdead5", "score": "0.6361661", "text": "function smoothScroll (duration) {\n\t$('a[href^=\"#\"]').on('click', function(event) {\n\n\t var target = $( $(this).attr('href') );\n var scrollTo = (target.offset().top) - 200;\n\n\t if( target.length ) {\n\t event.preventDefault();\n\t $('html, body').animate({\n\t scrollTop: scrollTo\n\t }, duration);\n\t }\n\t});\n}", "title": "" }, { "docid": "f288ec092fc25de218719c5eef6f0b42", "score": "0.63611203", "text": "function scroll(){\n $('a[href^=\"#\"]').on('click', function(e) {\n e.preventDefault();\n\n var target = this.hash;\n var $target = $(target);\n\n $('html, body').animate({\n 'scrollTop': $target.offset().top\n }, 500, 'swing');\n });\n}", "title": "" }, { "docid": "81fc7a12f05dd8bcff57140856863bc2", "score": "0.63553506", "text": "function scrollTo($el) {\n $(\"html, body\").animate({scrollTop: $el.offset().top}, 300);\n}", "title": "" }, { "docid": "1f96282323f6c931d1af04a8c39d2903", "score": "0.63470215", "text": "function smooth(){\n window.scroll({\n top: 200, \n left: 0, \n behavior: 'smooth'\n });\n }", "title": "" }, { "docid": "3bb94678bb22ddb8b8c4ba1d6bfb884f", "score": "0.6345521", "text": "wheel(e) {\n if(!__.ePrevent(e) && this.scrollWidth > this.clientWidth &&\n (this.clss('bar') || e.target == this))\n $$.animation.scroll({ el: this, duration: 200, delta: e.deltaY * 2 });\n }", "title": "" }, { "docid": "f936e7bf6f95cb153f9ec4593a78a0c8", "score": "0.6341459", "text": "function animateTargetSlideScroll() {\n var targetSlideElPadding = 40,\n targetAnimateDuration = 1000,\n $htmlBody = angular.element('html, body'),\n targetOffsetDifference = 0;\n\n // If targetSlideEl exists, animate scroll from the targetSlideEl offset.top minus targetSlideElpadding\n if ($targetSlideEl !== undefined && $targetSlideEl.length > 0) {\n targetOffsetDifference = $targetSlideEl.offset().top - targetSlideElPadding;\n $htmlBody.animate({scrollTop: targetOffsetDifference}, targetAnimateDuration);\n }\n }", "title": "" }, { "docid": "d41056234bae89229116241fb24cc2f4", "score": "0.6335239", "text": "function scrollArray(elem, left, top) {\n \n directionCheck(left, top);\n \n if (options.accelerationMax != 1) {\n var now = Date.now();\n var elapsed = now - lastScroll;\n if (elapsed < options.accelerationDelta) {\n var factor = (1 + (50 / elapsed)) / 2;\n if (factor > 1) {\n factor = Math.min(factor, options.accelerationMax);\n left *= factor;\n top *= factor;\n }\n }\n lastScroll = Date.now();\n } \n \n // push a scroll command\n que.push({\n x: left, \n y: top, \n lastX: (left < 0) ? 0.99 : -0.99,\n lastY: (top < 0) ? 0.99 : -0.99, \n start: Date.now()\n });\n \n // don't act if there's a pending queue\n if (pending) {\n return;\n } \n \n var scrollWindow = (elem === document.body);\n \n var step = function (time) {\n \n var now = Date.now();\n var scrollX = 0;\n var scrollY = 0; \n \n for (var i = 0; i < que.length; i++) {\n \n var item = que[i];\n var elapsed = now - item.start;\n var finished = (elapsed >= options.animationTime);\n \n // scroll position: [0, 1]\n var position = (finished) ? 1 : elapsed / options.animationTime;\n \n // easing [optional]\n if (options.pulseAlgorithm) {\n position = pulse(position);\n }\n \n // only need the difference\n var x = (item.x * position - item.lastX) >> 0;\n var y = (item.y * position - item.lastY) >> 0;\n \n // add this to the total scrolling\n scrollX += x;\n scrollY += y; \n \n // update last values\n item.lastX += x;\n item.lastY += y;\n \n // delete and step back if it's over\n if (finished) {\n que.splice(i, 1); i--;\n } \n }\n \n // scroll left and top\n if (scrollWindow) {\n window.scrollBy(scrollX, scrollY);\n } \n else {\n if (scrollX) elem.scrollLeft += scrollX;\n if (scrollY) elem.scrollTop += scrollY; \n }\n \n // clean up if there's nothing left to do\n if (!left && !top) {\n que = [];\n }\n \n if (que.length) { \n requestFrame(step, elem, (1000 / options.frameRate + 1)); \n } else { \n pending = false;\n }\n };\n \n // start a new queue of actions\n requestFrame(step, elem, 0);\n pending = true;\n }", "title": "" }, { "docid": "08497cfd43dc54b001ee8b9cc91a5c9f", "score": "0.63293904", "text": "function smoothScroll (duration) {\n\t$('a[href^=\"#\"]').on('click', function(event) {\n\n\t var target = $( $(this).attr('href') );\n\n\t if( target.length ) {\n\t event.preventDefault();\n\t $('html, body').animate({\n\t scrollTop: target.offset().top-50\n\t }, duration);\n\t }\n\t});\n}", "title": "" }, { "docid": "cd1e329c312c972e5fb8c9d3497db115", "score": "0.63251597", "text": "function onScroll() {\r\n var scrollTop = contentEl.prop('scrollTop');\r\n var isScrollingDown = scrollTop > (onScroll.prevScrollTop || 0);\r\n\r\n // Store the previous scroll so we know which direction we are scrolling\r\n onScroll.prevScrollTop = scrollTop;\r\n\r\n //\r\n // AT TOP (not scrolling)\r\n //\r\n if (scrollTop === 0) {\r\n // If we're at the top, just clear the current item and return\r\n setCurrentItem(null);\r\n return;\r\n }\r\n\r\n //\r\n // SCROLLING DOWN (going towards the next item)\r\n //\r\n if (isScrollingDown) {\r\n\r\n // If we've scrolled down past the next item's position, sticky it and return\r\n if (self.next && self.next.top <= scrollTop) {\r\n setCurrentItem(self.next);\r\n return;\r\n }\r\n\r\n // If the next item is close to the current one, push the current one up out of the way\r\n if (self.current && self.next && self.next.top - scrollTop <= self.next.height) {\r\n translate(self.current, scrollTop + (self.next.top - self.next.height - scrollTop));\r\n return;\r\n }\r\n }\r\n\r\n //\r\n // SCROLLING UP (not at the top & not scrolling down; must be scrolling up)\r\n //\r\n if (!isScrollingDown) {\r\n\r\n // If we've scrolled up past the previous item's position, sticky it and return\r\n if (self.current && self.prev && scrollTop < self.current.top) {\r\n setCurrentItem(self.prev);\r\n return;\r\n }\r\n\r\n // If the next item is close to the current one, pull the current one down into view\r\n if (self.next && self.current && (scrollTop >= (self.next.top - self.current.height))) {\r\n translate(self.current, scrollTop + (self.next.top - scrollTop - self.current.height));\r\n return;\r\n }\r\n }\r\n\r\n //\r\n // Otherwise, just move the current item to the proper place (scrolling up or down)\r\n //\r\n if (self.current) {\r\n translate(self.current, scrollTop);\r\n }\r\n }", "title": "" }, { "docid": "1ec7f215324d6388d560fd64b2933a9e", "score": "0.6320315", "text": "function handleScrolling() {\n if(scrolling === false) {\n sections.each(function() {\n var hash = $(this).attr('id');\n if (isElementInViewport($(this), 'top')) {\n var parralax = $(\"#\" + hash).find(\".parallax-background\");\n if(parralax.length > 0) {\n parralax.css('opacity', 1);\n }\n }\n if (isElementInViewport($(this))) {\n if(hash === 'contact') {\n hash = 'contact-form';\n }\n currentHash = hash;\n setActiveLink('#' + currentHash, true);\n }\n })\n }\n }", "title": "" }, { "docid": "b18e8f8eed6f3864c6c8251297c90222", "score": "0.63146776", "text": "function scroll()\n{\n\tSceneTop.x -= scrollSpeed * dt;\n\tif(SceneTop.x < -(SceneTop.topImage.width - 640))\n\t{\n\t\tSceneTop.x = 0;\n\t}\n\n\tSceneMedian.x -= scrollSpeed * dt;\n\tif(SceneMedian.x < -(SceneMedian.medianImage.width + 300))\n\t{\n\t\tSceneMedian.x = 640;\n\t}\n\n\tSceneBottom.x -= scrollSpeed * dt;\n\tif(SceneBottom.x < -(SceneBottom.bottomImage.width - 640))\n\t{\n\t\tSceneBottom.x = 0;\n\t}\t\n}", "title": "" }, { "docid": "ab8bff777f1195483a3a1c53c74c6fc8", "score": "0.6311047", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n if (mode === MODE_STANDARD) {\n updateStandardScroll();\n } else {\n updateVirtualScroll();\n }\n }", "title": "" }, { "docid": "ab8bff777f1195483a3a1c53c74c6fc8", "score": "0.6311047", "text": "function updateScroll () {\n if (!elements.li[0]) return;\n if (mode === MODE_STANDARD) {\n updateStandardScroll();\n } else {\n updateVirtualScroll();\n }\n }", "title": "" }, { "docid": "d78dce325ca63194032ebc2736de27fd", "score": "0.6307084", "text": "function scrollTo(c,e,d){d||(d=easeOutCuaic);var a=document.documentElement;if(0===a.scrollTop){var b=a.scrollTop;++a.scrollTop;a=b+1===a.scrollTop--?a:document.body}b=a.scrollTop;0>=e||(\"object\"===typeof b&&(b=b.offsetTop),\"object\"===typeof c&&(c=c.offsetTop),function(a,b,c,f,d,e,h){function g(){0>f||1<f||0>=d?a.scrollTop=c:(a.scrollTop=b-(b-c)*h(f),f+=d*e,setTimeout(g,e))}g()}(a,b,c,0,1/e,20,d))}", "title": "" }, { "docid": "106b847dc38247384681df38c396247d", "score": "0.6304794", "text": "function animateScroll (target, duration, callback) {\n if (typeof $ === 'undefined' && typeof scribd !== \"undefined\" ) {\n DocumentManager.setJQuery(scribd.jQuery);\n }\n $('html, body').animate({\n scrollTop: $(target).offset().top\n }, {\n queue: false,\n duration: duration,\n easing: 'linear',\n complete: callback\n });\n }", "title": "" }, { "docid": "14511eb4413cd47b798cbabd7de96367", "score": "0.6299637", "text": "scrollPage() {\n\t\tconst self = this;\n\n\t\tthis.sections.forEach((section, index) => {\n\t\t\tif( inViewport(section, self.options.viewportFactor) ) {\n\t\t\t\tsection.classList.add(\"animate\");\n\t\t\t} else {\n\t\t\t\t//This adds class initial-state-of-section if it doesn't have it.\n\t\t\t\t//This will ensure that the items initially in the viewport will also animate on scroll\n\t\t\t\tsection.classList.add(\"initial-state-of-section\");\n\t\t\t\tsection.classList.remove(\"animate\");\n\t\t\t}\n\t\t});\n\n\t\tthis.didScroll = false;\n\t}", "title": "" }, { "docid": "482309ebfaee202462524fb73c514362", "score": "0.6295898", "text": "function smoothScroll(event, head) {\n if (head == 'top' || event.originalEvent.deltaY < 0) {\n blockLocation--;\n } else {\n blockLocation++;\n }\n if (blockLocation < 0) blockLocation = 0;\n if (blockLocation >= $scope.parts) blockLocation = ($scope.parts - 1);\n animate();\n }", "title": "" }, { "docid": "ad9e94ba3ca6eccebee9d1ed0e4649c4", "score": "0.6285402", "text": "function scroller(event) {\n event.preventDefault()\n let element = document.getElementById(this.dataset.id)\n element.scrollIntoView(\n {\n behavior : 'smooth'\n }\n );\n}", "title": "" }, { "docid": "2e433b1eb5c279335f297d0a3c645206", "score": "0.6282651", "text": "function smoothScroll(eID){\n\tvar headerH = document.querySelector('header').offsetHeight; //size of header\n\tvar startY = window.scrollY;\n\tvar endY = getYPosition(eID) - headerH - 10; //10px of white space\n\n\tanimate({\n\t\tdelay: 10,\n\t\tduration: 800,\n\t\tdelta: easeInQuint,\n\t\tstep: function(delta) {\n\t\t\twindow.scrollTo(0,(startY + delta*(endY - startY)));\n\t\t}\n\t});\n}", "title": "" }, { "docid": "05e78563a1bf07b3badea3d31f3d8c89", "score": "0.6280022", "text": "function scrollTo() {\n $('a[href^=\"#\"]').on('click', function(e) {\n e.preventDefault();\n\n //Sets time and delay of scroll.\n var scroll_speed = 1000;\n var scroll_delay;\n if (!isMobile) {\n scroll_delay = 0;\n }\n else {\n scroll_delay = navMobileTL.duration() * 1000;\n }\n\n var target = this.hash;\n var $target = $(target);\n\n //If the position of page, does not equal where were going, we can animate\n if (position != target) {\n position = target;\n //Scroll to\n setTimeout(function() {\n $('html, body').animate({\n 'scrollTop': $target.offset().top\n }, scroll_speed, 'swing', function() {});\n }, scroll_delay);\n //Else wiggle the dots/a links \n }\n else {\n if (!isMobile) {\n wiggleElement($(\"nav ul\"));\n }\n }\n });\n}", "title": "" }, { "docid": "81faba41efe50e3f8c942dda97e7b05b", "score": "0.6278707", "text": "function goToByScroll(dataslide) {\n\t\tvar offset_top = ( dataslide == 1 ) ? '0px' : $('.slide[data-slide=\"' + dataslide + '\"]').offset().top;\n\t\t\n\t\thtmlbody.stop(false, false).animate({\n\t\t\tscrollTop: offset_top\n\t\t}, 1500, 'easeInOutQuart');\n\t}", "title": "" }, { "docid": "a134bcd512a9cc5338743c10ee8577b5", "score": "0.6276256", "text": "function updateSmoothScroll() {\n \n if(smoothScrollButton.checked == true) {\n setSmoothScroll('true');\n disableSmoothCSS(false);\n } else {\n setSmoothScroll('false');\n disableSmoothCSS(true);\n }\n}", "title": "" }, { "docid": "0ca67d7a9f2185d82c3063e27a601964", "score": "0.6270263", "text": "function animateScroll() {\n if (window.pageYOffset > 0) {\n window.scrollBy(0, -20);\n setTimeout(animateScroll, 10);\n }\n}", "title": "" }, { "docid": "dab0dca7ab233a53a5aef28df856cac8", "score": "0.6267817", "text": "function scrollArray(elem, left, top, delay) {\n \n delay || (delay = 1000);\n directionCheck(left, top);\n\n if (options.accelerationMax != 1) {\n var now = +new Date;\n var elapsed = now - lastScroll;\n if (elapsed < options.accelerationDelta) {\n var factor = (1 + (30 / elapsed)) / 2;\n if (factor > 1) {\n factor = Math.min(factor, options.accelerationMax);\n left *= factor;\n top *= factor;\n }\n }\n lastScroll = +new Date;\n } \n \n // push a scroll command\n que.push({\n x: left, \n y: top, \n lastX: (left < 0) ? 0.99 : -0.99,\n lastY: (top < 0) ? 0.99 : -0.99, \n start: +new Date\n });\n \n // don't act if there's a pending queue\n if (pending) {\n return;\n } \n\n var scrollWindow = (elem === document.body);\n \n var step = function (time) {\n \n var now = +new Date;\n var scrollX = 0;\n var scrollY = 0; \n \n for (var i = 0; i < que.length; i++) {\n \n var item = que[i];\n var elapsed = now - item.start;\n var finished = (elapsed >= options.animationTime);\n \n // scroll position: [0, 1]\n var position = (finished) ? 1 : elapsed / options.animationTime;\n \n // easing [optional]\n if (options.pulseAlgorithm) {\n position = pulse(position);\n }\n \n // only need the difference\n var x = (item.x * position - item.lastX) >> 0;\n var y = (item.y * position - item.lastY) >> 0;\n \n // add this to the total scrolling\n scrollX += x;\n scrollY += y; \n \n // update last values\n item.lastX += x;\n item.lastY += y;\n \n // delete and step back if it's over\n if (finished) {\n que.splice(i, 1); i--;\n } \n }\n\n // scroll left and top\n if (scrollWindow) {\n window.scrollBy(scrollX, scrollY);\n } \n else {\n if (scrollX) elem.scrollLeft += scrollX;\n if (scrollY) elem.scrollTop += scrollY; \n }\n \n // clean up if there's nothing left to do\n if (!left && !top) {\n que = [];\n }\n \n if (que.length) { \n requestFrame(step, elem, (delay / options.frameRate + 1)); \n } else { \n pending = false;\n }\n };\n \n // start a new queue of actions\n requestFrame(step, elem, 0);\n pending = true;\n}", "title": "" }, { "docid": "dab0dca7ab233a53a5aef28df856cac8", "score": "0.6267817", "text": "function scrollArray(elem, left, top, delay) {\n \n delay || (delay = 1000);\n directionCheck(left, top);\n\n if (options.accelerationMax != 1) {\n var now = +new Date;\n var elapsed = now - lastScroll;\n if (elapsed < options.accelerationDelta) {\n var factor = (1 + (30 / elapsed)) / 2;\n if (factor > 1) {\n factor = Math.min(factor, options.accelerationMax);\n left *= factor;\n top *= factor;\n }\n }\n lastScroll = +new Date;\n } \n \n // push a scroll command\n que.push({\n x: left, \n y: top, \n lastX: (left < 0) ? 0.99 : -0.99,\n lastY: (top < 0) ? 0.99 : -0.99, \n start: +new Date\n });\n \n // don't act if there's a pending queue\n if (pending) {\n return;\n } \n\n var scrollWindow = (elem === document.body);\n \n var step = function (time) {\n \n var now = +new Date;\n var scrollX = 0;\n var scrollY = 0; \n \n for (var i = 0; i < que.length; i++) {\n \n var item = que[i];\n var elapsed = now - item.start;\n var finished = (elapsed >= options.animationTime);\n \n // scroll position: [0, 1]\n var position = (finished) ? 1 : elapsed / options.animationTime;\n \n // easing [optional]\n if (options.pulseAlgorithm) {\n position = pulse(position);\n }\n \n // only need the difference\n var x = (item.x * position - item.lastX) >> 0;\n var y = (item.y * position - item.lastY) >> 0;\n \n // add this to the total scrolling\n scrollX += x;\n scrollY += y; \n \n // update last values\n item.lastX += x;\n item.lastY += y;\n \n // delete and step back if it's over\n if (finished) {\n que.splice(i, 1); i--;\n } \n }\n\n // scroll left and top\n if (scrollWindow) {\n window.scrollBy(scrollX, scrollY);\n } \n else {\n if (scrollX) elem.scrollLeft += scrollX;\n if (scrollY) elem.scrollTop += scrollY; \n }\n \n // clean up if there's nothing left to do\n if (!left && !top) {\n que = [];\n }\n \n if (que.length) { \n requestFrame(step, elem, (delay / options.frameRate + 1)); \n } else { \n pending = false;\n }\n };\n \n // start a new queue of actions\n requestFrame(step, elem, 0);\n pending = true;\n}", "title": "" }, { "docid": "5ec870f5187f52666ac8f3c1734dfa47", "score": "0.6261095", "text": "addSmoothScrolling() {\n\t\tthis.headerLinks.smoothScroll();\n\t}", "title": "" }, { "docid": "51363c6b533ad70d633bd2b8aa4ebda1", "score": "0.62466073", "text": "function doScroll(scrollTop)\r\n {\r\n if (scrollTop >= 0)\r\n {\r\n $htmlBody.animate({\r\n scrollTop: scrollTop\r\n }, 1000);\r\n }\r\n }", "title": "" }, { "docid": "fc4805801ba02253c1a4f3d4431336ee", "score": "0.6244658", "text": "debouncedHandleScroll() {\n\t\t// bail out if page is still updating\n\t\tif (this.updating) {\n\t\t\treturn;\n\t\t}\n\n\t\t// schedule our handleScroll method\n\t\trequestAnimationFrame(this.handleScroll.bind(this));\n\n\t\t// telling the components that it is currently updating\n\t\tthis.updating = true;\n\t}", "title": "" }, { "docid": "47673634d40e997ea95615c9712c8ff8", "score": "0.62408346", "text": "function scrollHandler(e) {\n if (is.mobile()) {\n //Handle mobile scrolling\n } else if (e.type == \"wheel\" || !is.mobile()) {\n //Handle Desktop scrolling\n if (e.deltaY > 0) {\n //scrolling down\n scrollDir = \"down\";\n } else if (e.deltaY < 0) {\n //scrolling up\n scrollDir = \"up\";\n }\n }\n if (allowSectionsHandler) {\n sectionsHandler();\n }\n}", "title": "" }, { "docid": "fe02fed1731e28abd108113becabe4ef", "score": "0.62356955", "text": "function scroller(){\n\tvar scrolling = document.getElementById('cont');\n\tscrolling.scrollIntoView({behavior: \"smooth\", block: \"end\", inline: \"nearest\"});\n}", "title": "" }, { "docid": "df4bef8816b49a0ec93b88ea8962181c", "score": "0.62354535", "text": "updateScroll(e) {\n set(this, 'scrollLeft', e.target.scrollLeft);\n\n if(get(this, 'infinityScroll')) {\n this.checkInfinityScroll(e);\n }\n }", "title": "" }, { "docid": "002940bb0c0e7e150900e899a8fc4c7e", "score": "0.62353563", "text": "function handleWheel(e) {\n\t\tif (!ready) return;\n\t\tif (isDocAtScrollEnd() && e.deltaY > 0) {\n\t\t\tdebouncedMessage(\"down\");\n\t\t} else if (isDocAtScrollStart() && e.deltaY < 0) {\n\t\t\tdebouncedMessage(\"up\");\n\t\t}\n\t}", "title": "" }, { "docid": "b6d72db35b58e4563cb057ed555c519f", "score": "0.62317306", "text": "function scrollTo(element, height, direction)\n{\n if (direction == 'top') {\n $('html,body').animate({\n scrollTop: $(element).offset().top - height\n }, 1000);\n } else if (direction == 'bottom') {\n $('html,body').animate({\n scrollTop: $(element).offset().top - $(element).height() - height\n }, 1000);\n }\n}", "title": "" }, { "docid": "bb24b0ff58f4657ec3e53e601a5cfbd8", "score": "0.62239283", "text": "function animateScroll(top, duration) {\n\t\tvar scrollTop = getScrollTop();\n\t\tanimate(duration, function(progress) {\n\t\t\twindow.scroll(0, easeInOutQuad(progress, scrollTop, top, duration));\n\t\t});\n\t}", "title": "" }, { "docid": "12fa13754b8bf20a33d3dc6620256091", "score": "0.6223751", "text": "scrollTo(target) {\n if( target.length ) {\n $(\"html, body\").stop().animate( { scrollTop: target.offset().top }, 1500);\n }\n }", "title": "" }, { "docid": "d08d663f7a92ade6a3f5e4d94ae626a9", "score": "0.62203306", "text": "function smoothScroll (duration) {\n\t$('a[href^=\"#\"]').on('click', function(event) {\n\n\t var target = $( $(this).attr('href') );\n\n\t if( target.length ) {\n\t event.preventDefault();\n\t $('html, body').animate({\n\t scrollTop: target.offset().top\n\t }, duration);\n\t }\n\t});\n}", "title": "" }, { "docid": "d08d663f7a92ade6a3f5e4d94ae626a9", "score": "0.62203306", "text": "function smoothScroll (duration) {\n\t$('a[href^=\"#\"]').on('click', function(event) {\n\n\t var target = $( $(this).attr('href') );\n\n\t if( target.length ) {\n\t event.preventDefault();\n\t $('html, body').animate({\n\t scrollTop: target.offset().top\n\t }, duration);\n\t }\n\t});\n}", "title": "" }, { "docid": "d08d663f7a92ade6a3f5e4d94ae626a9", "score": "0.62203306", "text": "function smoothScroll (duration) {\n\t$('a[href^=\"#\"]').on('click', function(event) {\n\n\t var target = $( $(this).attr('href') );\n\n\t if( target.length ) {\n\t event.preventDefault();\n\t $('html, body').animate({\n\t scrollTop: target.offset().top\n\t }, duration);\n\t }\n\t});\n}", "title": "" }, { "docid": "d08d663f7a92ade6a3f5e4d94ae626a9", "score": "0.62203306", "text": "function smoothScroll (duration) {\n\t$('a[href^=\"#\"]').on('click', function(event) {\n\n\t var target = $( $(this).attr('href') );\n\n\t if( target.length ) {\n\t event.preventDefault();\n\t $('html, body').animate({\n\t scrollTop: target.offset().top\n\t }, duration);\n\t }\n\t});\n}", "title": "" }, { "docid": "d08d663f7a92ade6a3f5e4d94ae626a9", "score": "0.62203306", "text": "function smoothScroll (duration) {\n\t$('a[href^=\"#\"]').on('click', function(event) {\n\n\t var target = $( $(this).attr('href') );\n\n\t if( target.length ) {\n\t event.preventDefault();\n\t $('html, body').animate({\n\t scrollTop: target.offset().top\n\t }, duration);\n\t }\n\t});\n}", "title": "" } ]
047cc47aa04d672ef38ec44a2804e54e
Get a VoteInterval by: 1. if interval is supplied, by that interval 2. on going interval 3. previous interval if in AFTER_TALLY_BLOCKS 4. previous interval if next does not exist 4. next block
[ { "docid": "462117b5b3877d9be167f5bfa89e2548", "score": "0.67048514", "text": "async function getCurrentInterval({ interval, phase, currentBlock } = {}) {\n if (interval && phase) {\n return intervalsDAL.findByIntervalAndPhase(interval, phase);\n }\n\n const [current, next, prev] = await Promise.all([\n intervalsDAL.findCurrent(currentBlock),\n intervalsDAL.findNext(currentBlock),\n intervalsDAL.findPrev(currentBlock),\n ]);\n\n return current\n ? current\n : prev && currentBlock - prev.endBlock < AFTER_TALLY_BLOCKS\n ? prev\n : !next && prev\n ? prev\n : next;\n}", "title": "" } ]
[ { "docid": "902a9074b0bd7370e82690dae6bd87d4", "score": "0.67680174", "text": "function getRelevantIntervalBlocks({ chain, interval, phase, currentBlock } = {}) {\n let chosenInterval = interval;\n let chosenPhase = phase;\n\n if (!chosenInterval) {\n const afterTallyBlocks = config.get(`cgp:${chain}:afterTallyBlocks`);\n const currentInterval = getIntervalByBlockNumber(chain, currentBlock);\n const intervalLength = getIntervalLength(chain);\n const shouldGetPrevInterval =\n currentInterval > 1 &&\n currentBlock - intervalLength * (currentInterval - 1) <= afterTallyBlocks;\n chosenInterval =\n currentInterval === 1 ? 1 : shouldGetPrevInterval ? currentInterval - 1 : currentInterval;\n }\n const chosenIntervalBlocks = getIntervalBlocks(chain, chosenInterval);\n if (!chosenPhase) {\n const { snapshot, tally } = chosenIntervalBlocks;\n const middlePoint = snapshot + (tally - snapshot) / 2;\n /**\n * in case both interval and block was given, block should be ignored\n * return phase = vote if currentBlock > tally (prev interval)\n */\n chosenPhase = interval\n ? 'Nomination'\n : currentBlock > 0\n ? currentBlock < middlePoint\n ? 'Nomination'\n : 'Vote'\n : 'Nomination';\n }\n\n return mergeAll([{ interval: chosenInterval }, chosenIntervalBlocks, { phase: chosenPhase }]);\n}", "title": "" }, { "docid": "44418c7eb90332318331853f6a93393e", "score": "0.57831997", "text": "function getCurrentInterval() {\n\tneeds_maintenance = true;\n\tvar now = moment();\n\tfor (var i = 0; i < intervals.length; i++) {\n\t\tcurrent_start = intervals[i][0];\n\t\tcurrent_end = intervals[i][1];\n\n\t\t// if currently in interval\n\t\tif (!now.isBefore(current_start) && !now.isAfter(current_end)) {\n\t\t\tneeds_maintenance = false;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ce40515938c4a088b7dc55228e2dc1bc", "score": "0.57417625", "text": "function calculateInterval(){\n\t\t// algorithm says 1 and 6 days is interval for 1st and 2nd times\n\t\tif(times===1) return 1;\n\t\telse if(times===2) return 6;\n\t\telse if(times>2){\n\t\t\treturn oldEasyF*lastInterval;\n\t\t}\n\t}", "title": "" }, { "docid": "684fb632cae3db9e34fe9b35679ceccf", "score": "0.5604356", "text": "function getInterval() {\n if (count < 5) {\n return 1000;\n }\n if (count >= 5 && count < 9) {\n return 800;\n }\n if (count >= 9 && count < 13) {\n return 600;\n }\n if (count >= 13) {\n return 500;\n } \n}", "title": "" }, { "docid": "5ab26fa6cd46dc96a24e6d77bcb1337d", "score": "0.556505", "text": "function nextInterval(diff) {\n var rst = 1, i = 0, d = Math.abs(diff);\n for (; diff >= SEC_ARRAY[i] && i < SEC_ARRAY.length; i++) {\n diff /= SEC_ARRAY[i];\n rst *= SEC_ARRAY[i];\n }\n d = d % rst;\n d = d ? rst - d : rst;\n return Math.ceil(d);\n}", "title": "" }, { "docid": "7d366f903bdd0d816b87e346370ab592", "score": "0.53219754", "text": "_getSectionInterval(dataInterval) {\n const _segmentLength = this._segmentLength(dataInterval);\n\n const startOfThirdSegment = Math.floor(dataInterval.start / _segmentLength)\n * _segmentLength;\n const startOfFirstSegment = startOfThirdSegment - 2*_segmentLength;\n const endOflastSegment = startOfFirstSegment + 4*_segmentLength;\n\n return new Interval(startOfFirstSegment, endOflastSegment);\n }", "title": "" }, { "docid": "06649337ed739efa91e63a09716a4309", "score": "0.5239547", "text": "function interval() {\n var lastTime = new Date().getTime() / 1000;\n\n return function getInterval() {\n var newTime = new Date().getTime() / 1000;\n var delta = newTime - lastTime;\n lastTime = newTime;\n return delta;\n };\n }", "title": "" }, { "docid": "37888a32710b301a29025b1b784b51d7", "score": "0.52322185", "text": "updateBlockIntervals() {\n while ( this.touchedBlocks.length ) {\n const block = this.touchedBlocks.pop();\n\n if ( block.used ) {\n sceneryLog && sceneryLog.Stitch && sceneryLog.Stitch( `update interval: ${block.toString()} ${\n block.pendingFirstDrawable.toString()} to ${block.pendingLastDrawable.toString()}` );\n\n block.updateInterval();\n\n // mark it dirty, since its drawables probably changed?\n //OHTWO TODO: is this necessary? What is this doing?\n this.backbone.markDirtyDrawable( block );\n\n if ( assertSlow ) {\n this.intervalsNotified.push( {\n block: block,\n firstDrawable: block.pendingFirstDrawable,\n lastDrawable: block.pendingLastDrawable\n } );\n }\n }\n else {\n sceneryLog && sceneryLog.Stitch && sceneryLog.Stitch( `skipping update interval: ${block.toString()}, unused` );\n }\n }\n }", "title": "" }, { "docid": "91646c68831992e37a3da677f231bf19", "score": "0.52066845", "text": "get_interval(){\n\t\t\treturn this.interval;\n\t\t}", "title": "" }, { "docid": "2b30a0fbd9284943d90f0de00a5e490f", "score": "0.5137328", "text": "function readInterval() {\n const interval = self._i;\n if (moment.isDuration(interval)) return interval;\n return calcAuto.near(self.barTarget, duration);\n }", "title": "" }, { "docid": "78ba35ec00ff8ea0d73d2175c03b123d", "score": "0.4969178", "text": "function subInterval(startInterval, index, round) {\n var nextInterval = [[startInterval[index][0], startInterval[0][1], startInterval[index][0] + (startInterval[index][2] - startInterval[index][0]) * (probabillities[0][2] - probabillities[0][0])]];\n for (let i = 1; i < startInterval.length; i++) {\n nextInterval.push([nextInterval[i - 1][2], startInterval[i][1], nextInterval[i - 1][2] + (startInterval[index][2] - startInterval[index][0]) * (probabillities[i][2] - probabillities[i][0])]);\n }\n return nextInterval;\n}", "title": "" }, { "docid": "861b80b15c170c5d838843e86019f0d9", "score": "0.49082494", "text": "noteAbove(interval) {\n return new NullNote();\n }", "title": "" }, { "docid": "ef11aab24898c604a67cb39276be3281", "score": "0.49080095", "text": "static of(a, b) {\n // cache just a..a\n if (a !== b || a < 0 || a > INTERVAL_POOL_MAX_VALUE) {\n return new Interval(a, b);\n }\n if (Interval.cache[a] == null) {\n Interval.cache[a] = new Interval(a, a);\n }\n return Interval.cache[a];\n }", "title": "" }, { "docid": "423ca2d48a074bea1a2cb24a88243b3c", "score": "0.48800123", "text": "function sol(intervals) {\n // sort by start times\n intervals.sort(([s1], [s2]) => (s1 < s2 ? -1 : 1));\n const q = [intervals.shift()];\n let max = 1;\n while (intervals.length) {\n const newMeet = intervals.shift();\n const [s2, e2] = newMeet;\n const firstmeet = q.shift();\n const [s1, e1] = firstmeet;\n if (e1 > s2) q.push(firstmeet);\n q.push(newMeet);\n console.log(q);\n max = Math.max(max, q.length);\n // sort by ending time\n q.sort((a, b) => (a[1] < b[1] ? -1 : 1));\n }\n return max;\n}", "title": "" }, { "docid": "a92b16ab8b55005bd9ac4f25472c75af", "score": "0.48232293", "text": "function setSlideInterval(i){\n var interval = timestamps[i] * 1000 + (timestamps[i+1] * 1000) - (timestamps[i] * 1000);\n if (timestamps[i+1] == null){\n interval = document.getElementById(\"player\").duration * 1000;\n }\n console.log(\"Interval for \" + i + \" is \" + interval); \n return interval;\n}", "title": "" }, { "docid": "fa0d543db296f496e724d73aa231b72c", "score": "0.48090604", "text": "poll(interval) {\n return __awaiter(this, void 0, void 0, function* () {\n interval && this.configure({ interval }, false, false);\n this.handle && clearTimeout(this.handle);\n yield util_1.safelyExecute(() => this.updateBalances());\n this.handle = setTimeout(() => {\n this.poll(this.config.interval);\n }, this.config.interval);\n });\n }", "title": "" }, { "docid": "e30d2a015b164a8f6947bf68c7e81ea5", "score": "0.4736334", "text": "enterSession_boundary_interval_expr(ctx) {\n\t}", "title": "" }, { "docid": "dd8f24bb898c8e59898c6ff7d0680932", "score": "0.46986863", "text": "function insertInterval(interval, schedule) {\r\n // loop through schedule and change interval and remove old intervals\r\n for (let i = 0; i<schedule.length; i++) {\r\n let removeOriginalInterval = false;\r\n\r\n\r\n //if data is equal\r\n if(dataIsEqual(schedule[i], interval))\r\n {\r\n // date 1 is within original interval\r\n if (dateWithin(interval.start, schedule[i].start, schedule[i].end)) {\r\n // expand interval left\r\n interval.start = schedule[i].start;\r\n removeOriginalInterval = true;\r\n }\r\n // date 2 is within original interval\r\n if (dateWithin(interval.end, schedule[i].start, schedule[i].end)) {\r\n // expand interval right\r\n interval.end = schedule[i].end;\r\n removeOriginalInterval = true;\r\n }\r\n // original interval is inside new interval\r\n if (dateBetween(schedule[i].start, interval.start, interval.end) && dateBetween(schedule[i].end, interval.start, interval.end)) {\r\n // proceed as if original interval wasn't there\r\n removeOriginalInterval = true;\r\n }\r\n //if new interval is inside original interval, proceed as if new interval wasn't there\r\n }\r\n\r\n\r\n //if data is not equal\r\n else\r\n {\r\n // date 1 is within original interval\r\n if (dateWithin(interval.start, schedule[i].start, schedule[i].end)) {\r\n //shorten original interval on right side\r\n schedule[i].end = interval.start;\r\n }\r\n // date 2 is within original interval\r\n if (dateWithin(interval.end, schedule[i].start, schedule[i].end)) {\r\n //shorten original interval on left side\r\n schedule[i].start = interval.end;\r\n }\r\n // original interval is inside new interval\r\n if (dateBetween(schedule[i].start, interval.start, interval.end) && dateBetween(schedule[i].end, interval.start, interval.end)) {\r\n // proceed as if original interval wasn't there\r\n removeOriginalInterval = true;\r\n }\r\n // new interval is inside original interval\r\n if (dateWithin(interval.start, schedule[i].start, schedule[i].end) && dateWithin(interval.end, schedule[i].start, schedule[i].end)) {\r\n // split original interval in 2 by shortening it to one side and inserting another interval\r\n const newInterval = [interval.end, schedule[i].end];\r\n schedule[i].end = interval.start;\r\n schedule.splice(i+1, 0, newInterval);\r\n i++;\r\n }\r\n }\r\n\r\n\r\n if (removeOriginalInterval) {\r\n schedule.splice(i, 1);\r\n i--;\r\n }\r\n }\r\n\r\n // add interval in front of largest index\r\n schedule.splice(largestIndex(interval.start, schedule) + 1, 0, interval);\r\n}", "title": "" }, { "docid": "be14946bda53845447d40432682b89fd", "score": "0.46825632", "text": "static _isOpenYesterday(intervals, time) {\n for (let interval of intervals) {\n if (time < interval.end && interval.end <= interval.start) {\n return { isOpen: true, interval };\n }\n }\n return { isOpen: false };\n }", "title": "" }, { "docid": "ddd3809f83d975b486a62ee3e22707a6", "score": "0.46664914", "text": "function generateInterval () {\n\treturn _INTERVAL_RANGE[0] + Math.random() * (_INTERVAL_RANGE[1] - _INTERVAL_RANGE[0]);\n}", "title": "" }, { "docid": "a6ff4f0b968f020332ae8bedf2c89c2a", "score": "0.46326315", "text": "function returnCellBlock(iCurPos, iDiceOut){\n let iNextPos = iCurPos + iDiceOut;\n\n iCellCount = aCells.length;\n // Logic to get the block number in circular fashion and fetch its value\n if(iNextPos >= iCellCount + 1){ \n iNextPos = iNextPos - iCellCount;\n }\n\n return iNextPos;\n }", "title": "" }, { "docid": "c7c2db2be858a84807c3c7e8539cb16b", "score": "0.46299803", "text": "function interval(test) {\n for (let i = 100; i > 30; i -= 5) {\n if (i - test < 5) {\n return i\n }\n }\n}", "title": "" }, { "docid": "96abd27bd8a03c9a3be5f8447cf750f4", "score": "0.46122795", "text": "function throttle(wait, onLast, onFirst, interval, timestamps){\n const result = [];\n\n function push(obj){\n if(onFirst){\n result.push(obj.start);\n }\n if(interval){\n const end = (onLast) ? obj.end: obj.end - wait;\n for(let i = obj.start + interval; i < end; i += interval){\n result.push(i);\n }\n }\n if(onLast){\n result.push(obj.end);\n }\n }\n\n const clusters = timestamps.reduce((arr, time) => {\n const prev = arr[arr.length - 1];\n if(prev && time <= prev.end){ // within cluster\n prev.end = Math.max(time + wait, prev.end);\n }\n else {\n if(prev) push(prev)\n arr.push({\n start: time,\n end: time + wait\n })\n }\n return arr;\n }, []);\n\n push(clusters[clusters.length - 1])\n return result;\n}", "title": "" }, { "docid": "0fa3d4900c3159ebf5831c56987fad6f", "score": "0.46078038", "text": "transitionInterval(index) {\n let somethingChanged = false;\n\n let intervalEndGroup = $(\".interval.num\"+index+\" .end-group\", this.divePlan).val();\n if (\n intervalEndGroup != \"\" &&\n $(\".dive.num\"+(index+1)+\" .start-group\", this.divePlan).val() == \"\"\n ) {\n this._setCalculatedValue($(\".dive.num\"+(index+1)+\" .start-group\", this.divePlan), intervalEndGroup);\n somethingChanged = true;\n }\n\n return somethingChanged;\n }", "title": "" }, { "docid": "0fae29783b05b44005e9d9662df73ab3", "score": "0.46042275", "text": "constructor(start, interval, node) {\n this.start = start;\n this.interval = interval;\n this.node = node;\n }", "title": "" }, { "docid": "e848bc0ab0331bd0a20c8fdd594e61b8", "score": "0.45920834", "text": "static _getNextInterval(yextDays, tomorrow) {\n for (let i = 0; i < 7; i++) {\n let index = (tomorrow + i) % 7;\n for (let interval of yextDays[index].intervals) {\n return { status: OpenStatusTypes.OPENS_NEXT, nextTime: interval.start, nextDay: this._intToDay(index) };\n }\n }\n }", "title": "" }, { "docid": "6ada9776a95f347dd902a676b44937c2", "score": "0.45828682", "text": "function toInterval(ivl) {\n var i = asIvlPitch(ivl);\n return i ? strIvl(i) : null;\n}", "title": "" }, { "docid": "f477047830de114ce8ff35cdf49e8390", "score": "0.4574604", "text": "get interval () {\n return this.interval\n }", "title": "" }, { "docid": "4b1c4de69523a3385c744119bfdd8d06", "score": "0.4563325", "text": "noteBelow(interval) {\n return this.noteAbove(interval.inverse());\n }", "title": "" }, { "docid": "1a26ea266dc07df4a83ae7b22e008eb4", "score": "0.45488673", "text": "async function getShortestAvailableInterval(symbol, startDateObj, interval, validIntervals){\n \n //specific mode\n let intervalIndex = validIntervals.indexOf(interval);\n //stops iterating at 1day interval\n for(intervalIndex; intervalIndex < 9; intervalIndex++){\n let dataIsAvailable = await dataAvailable(symbol, startDateObj, validIntervals[intervalIndex]);\n console.log(\"index = \" + intervalIndex);\n console.log(\"Checking if data available for symbol: \" + symbol + \" for interval \" + validIntervals[intervalIndex]);\n if(dataIsAvailable){\n console.log(\"INTERVAL FOUND!! \" + validIntervals[intervalIndex]);\n return validIntervals[intervalIndex];\n }\n }\n\n // //low API call mode\n // used during testing to minimize API calls, defaults to 1day interval if ideal interval unavailable\n // let dataIsAvailable = await dataAvailable(symbol, startDateObj, interval);\n // if(dataIsAvailable){\n // return interval;\n // }\n \n // dataIsAvailable = await dataAvailable(symbol, startDateObj, \"1day\");\n // if(dataIsAvailable){\n // return \"1day\";\n // }\n\n //no data whatsoever for specified symbol/start\n console.log(\"ERROR: no data available for \" + symbol + \" at start date \" + stringify(startDateObj));\n throw \"no data for start date\";\n}", "title": "" }, { "docid": "42e5e403945fac3dabcccf9a64375034", "score": "0.45330408", "text": "function computeLabelInterval(slotDuration) {\n let i;\n let labelInterval;\n let slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) {\n labelInterval = createDuration(STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = wholeDivideDurations(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n }", "title": "" }, { "docid": "0c2c6dacbd329886285b6a194c8649ba", "score": "0.45180807", "text": "function computeLabelInterval(slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) {\n labelInterval = common.createDuration(STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = common.wholeDivideDurations(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n }", "title": "" }, { "docid": "e91b31c7d94280f85bcb63a7fcccc381", "score": "0.4517849", "text": "nextTTE() {\r\n this.tte = this.interval;\r\n if (this.jitter) {\r\n let ij = this.jitter * this.interval;\r\n this.tte += ((Math.random() * ij * 2) - ij);\r\n }\r\n if (this.tte < .1) this.tte = .1; // minimum interval;\r\n }", "title": "" }, { "docid": "e91b31c7d94280f85bcb63a7fcccc381", "score": "0.4517849", "text": "nextTTE() {\r\n this.tte = this.interval;\r\n if (this.jitter) {\r\n let ij = this.jitter * this.interval;\r\n this.tte += ((Math.random() * ij * 2) - ij);\r\n }\r\n if (this.tte < .1) this.tte = .1; // minimum interval;\r\n }", "title": "" }, { "docid": "80aaf736a728df69be93649a0d97fb8c", "score": "0.4515879", "text": "function intervals(start, end) {\n var obj = {};\n obj.val = [{start: start, end: end}];\n obj.is_free = function (point) {\n return find_point(obj.val, point) > -1;\n };\n obj.reserve = function (point) {\n return remove_point(obj.val, point);\n };\n obj.create_free = function () {\n return get_first_point(obj.val);\n };\n return obj;\n}", "title": "" }, { "docid": "73c3b592a68bf8f35592c614a4c66cbe", "score": "0.45049042", "text": "static getInterval() {\n return game.settings.get(modName, interval);\n }", "title": "" }, { "docid": "aa05c109fe502faa045de9213b8787d0", "score": "0.44849703", "text": "getPollingIntervalFromConfig() {\n const interval = this.props.baseInfo.appNavConfigMap.completedJobsPollingInterval\n if(! interval) {\n // return the default\n return default_api_polling_intervals_milliseconds \n } else {\n return parseInt(interval)\n }\n }", "title": "" }, { "docid": "afd9b7d7978409b0df041bf767a8d908", "score": "0.44798622", "text": "static getInterval() {\r\n return game.settings.get(modName, interval);\r\n }", "title": "" }, { "docid": "10e4a427bec9de671a9e768c82ec3452", "score": "0.44724727", "text": "getBend() {\n let etDistance = tune.ETInterval(this.maxNote.pitch - this.minNote.pitch)\n return this.interval.abs().subtract(etDistance).cents() / 100;\n }", "title": "" }, { "docid": "0381a84ecf83c0973f565e184904309e", "score": "0.44672439", "text": "function insertInterval(intervals, newInterval) {\n let mergedInterval = [];\n let i = 0;\n\n while (i < intervals.length && intervals[i][1] < newInterval[0]) {\n mergedInterval.push(intervals[i]);\n i++;\n }\n\n while (i < intervals.length && intervals[i][0] <= newInterval[1]) {\n newInterval[0] = Math.min(intervals[i][0], newInterval[0]);\n newInterval[1] = Math.max(intervals[i][1], newInterval[1]);\n i++;\n }\n\n mergedInterval.push([newInterval[0], newInterval[1]]);\n\n while (i < intervals.length) {\n mergedInterval.push(intervals[i]);\n i++;\n }\n return mergedInterval;\n}", "title": "" }, { "docid": "42cc2ea0fd01a41d773c7fdd2639208f", "score": "0.4461462", "text": "function find_point(intervals, point) {\n if(intervals.length == 0) return -1; // empty intervals\n \n function interval_contains(index) {\n return (intervals[index].start <= point && point <= intervals[index].end);\n }\n \n function go_left(index) {\n return point < intervals[index].start;\n }\n\n // special case optimization\n if(interval_contains(0)) return 0;\n \n // binary search\n var st = 0; var nd = intervals.length;\n while(st < nd) {\n var mid = Math.floor(st / 2 + nd / 2);\n if(interval_contains(mid)) return mid;\n else if(go_left(mid)) nd = mid;\n else st = mid + 1;\n }\n\n return -1;\n}", "title": "" }, { "docid": "a8305474da38a310afc6f87e33c9bd23", "score": "0.44360152", "text": "function computeIntervalNote(baseNote, interval) {\n let tone = baseNote.slice(0, 1);\n let octave = parseInt(baseNote.slice(baseNote.length - 1, baseNote.length));\n let intervalNumber = parseInt(interval.slice(0, 1));\n let intervalNote = naturalNotes[(naturalNotes.indexOf(tone) + intervalNumber - 1) % naturalNotes.length];\n if (naturalNotes.indexOf(intervalNote) <= naturalNotes.indexOf(tone))\n octave += 1;\n let semitonesSum = 0;\n for (i = naturalNotes.indexOf(tone); i < naturalNotes.indexOf(tone) + intervalNumber - 1; i++)\n semitonesSum = semitonesSum + semitones[i % semitones.length];\n let accidentalsNumber = baseNote.length - 2;\n if (accidentalsNumber > 0 && baseNote.slice(1, 2) == 'b')\n accidentalsNumber = -accidentalsNumber;\n let intervalSemitones = intervals.indexOf(interval) + 1;\n let shift = intervalSemitones - semitonesSum + accidentalsNumber;\n if (shift < 0)\n for (i = 0; i < -shift; i++)\n intervalNote += 'b';\n if (shift > 0)\n for (i = 0; i < shift; i++)\n intervalNote += '#';\n return intervalNote + octave;\n}", "title": "" }, { "docid": "db51ad8a9185694477e5ae6c1a2e8784", "score": "0.44357157", "text": "function confidence_interval(v1, conf=0.9) {\n // Check if input params are valid\n if (!Array.isArray(v1)) {\n throw \"Parameter is not a valid array\";\n }\n if (conf == 0.9 || conf == 0.95 || conf == 0.98) {\n //OK\n }\n else {\n throw \"Confidence level must be 0.90, 0.95 or 0.98\";\n }\n \n // Sample mean\n let mean = jStat.mean(v1);\n // Sample size\n let n = v1.length;\n // Standard deviations for the samples\n let std = jStat.stdev(v1, true);\n // Standard error\n let stderr = std / Math.sqrt(n);\n // Degrees of freedom\n let DF = n - 1;\n // Alpha\n let alpha = 0.1;\n if (conf == 0.9) alpha = 0.05;\n if (conf == 0.95) alpha = 0.025;\n if (conf == 0.98) alpha = 0.01;\n \n if (n >= 30) {\n // Larg n -> use normal distribution as approximation\n let Z = jStat.normal.inv(1 - alpha, 0, 1);\n // Confidence interval\n let boundary = Z * stderr;\n // Range\n let lower = mean - boundary;\n let upper = mean + boundary;\n return [boundary, lower, upper, alpha];\n }\n else {\n // Small n -> use t-distribution\n let T = jStat.studentt.inv(1 - alpha, DF);\n // Confidence interval\n let boundary = T * stderr;\n // Range\n let lower = mean - boundary;\n let upper = mean + boundary;\n return [boundary, lower, upper, alpha];\n }\n}", "title": "" }, { "docid": "4b333ab1ee00bae1e56dd2f4430d3509", "score": "0.44325498", "text": "_addInterval() {\n // Create interval area\n let newI = $(templateInterval);\n $(this.divePlan).append(newI);\n let counter = $(\".interval\", this.divePlan).length;\n newI.addClass(\"num\" + counter);\n // Decorate interval area\n RDPCalculatorStyler.decorateInterval(newI);\n // Add auto-calculate events\n let that = this;\n $(\"input\", newI).on(\"input\", function(e) { that.recalculate(this); } );\n }", "title": "" }, { "docid": "a35fb4eb2f60b1b47490e6edfcc42834", "score": "0.44268075", "text": "static _is24Hours(intervals) {\n for (let interval of intervals) {\n if (interval.start == 0 && interval.end == 2359) {\n return { is24: true, interval };\n }\n }\n return { is24: false };\n }", "title": "" }, { "docid": "8384d210668e51a56ad949ffc5b0dd9f", "score": "0.44198233", "text": "function intervalWithin(firstInterval, secondInterval) {\n return firstInterval[0] > secondInterval[0] && firstInterval[1] < secondInterval[1];\n}", "title": "" }, { "docid": "a06e8e90eef941462bd330f2e4a90468", "score": "0.4408089", "text": "function intervals(start, end) {\n var obj = {};\n obj.val = [ { \"start\": start, \"end\": end} ];\n obj.find = function(point) { return find_point(obj.val, point); };\n obj.remove = function(point) { return remove_point(obj.val, point); };\n obj.first = function() { return get_and_remove_first_point(obj.val); };\n return obj;\n}", "title": "" }, { "docid": "4aef766e037c8eccaf94e42dca28387a", "score": "0.43957567", "text": "dividedNotesBelow(interval, div) {\n return this.dividedNotesAbove(interval.inverse(), div);\n }", "title": "" }, { "docid": "ebaac23fe45fd22126d6c58674cec96d", "score": "0.43907416", "text": "function find_point(intervals, point) {\n if (intervals.length === 0) {\n return -1; // empty intervals\n }\n\n function interval_contains(index) {\n return (intervals[index].start <= point && point <= intervals[index].end);\n }\n\n function go_left(index) {\n return point < intervals[index].start;\n }\n\n // special case optimization\n if (interval_contains(0)) {\n return 0;\n }\n\n // binary search\n var st = 0;\n var nd = intervals.length;\n while (st < nd) {\n var mid = Math.floor((st + nd) / 2);\n if (interval_contains(mid)) {\n return mid;\n } else if (go_left(mid)) {\n nd = mid;\n } else {\n st = mid + 1;\n }\n }\n\n return -1;\n}", "title": "" }, { "docid": "d2283659682a9ce8a4d6b0655b0d828c", "score": "0.43817815", "text": "static adjustDiff(prevBlock, currentTimestamp) {\n let { difficulty } = prevBlock;\n difficulty = prevBlock.timestamp + MINE_RATE > currentTimestamp ? \n difficulty + 1 : difficulty - 1;\n return difficulty;\n }", "title": "" }, { "docid": "294483d4b2554ee1b268657edc27eedb", "score": "0.43703312", "text": "async function getInterval(symbol, start_date, end_date){ \n try {\n const startYear = parseInt(start_date.substring(0, 4));\n const endYear = parseInt(end_date.substring(0, 4));\n\n const startMonth = parseInt(start_date.substring(5, 7));\n const endMonth = parseInt(end_date.substring(5, 7));\n\n const startDay = parseInt(start_date.substring(8, 10));\n const endDay = parseInt(end_date.substring(8, 10));\n\n const startDateObj = new Date(startYear, startMonth-1, startDay);\n const endDateObj = new Date(endYear, endMonth-1, endDay);\n\n const differenceInMinutes = (endDateObj.getTime() - startDateObj.getTime()) / (1000 * 60);\n\n console.assert(\n differenceInMinutes >= 0,\n `Start date must come before end date in getInterval()`\n );\n\n console.assert(\n differenceInMinutes > 59,\n `Difference between start and end too small in getInterval()`\n ); \n \n let interval = \"\";\n\n if(differenceInMinutes >= 525600){ //duration over a year\n interval = \"4h\";\n }\n else if(differenceInMinutes >= 43800){ //duration one month - one year\n interval = \"2h\";\n } \n else if(differenceInMinutes >= 10080){ //duration one week - one month\n interval = \"15min\";\n }\n else if(differenceInMinutes >= 1440){ //duration one day - one week\n interval = \"15min\";\n }\n\n console.assert(SERVER_DBC.VALID_INTERVALS.includes(interval));\n interval = await getShortestAvailableInterval(symbol, startDateObj, interval, SERVER_DBC.VALID_INTERVALS);\n console.log(\"Calculated interval: \" + interval);\n return interval;\n } catch (error) {\n console.log(\"ERROR CAUGHT: \" + error);\n if(error === \"no data for start date\"){\n throw error;\n }\n else{\n console.log(\"Unhandled error: \" + error);\n }\n }\n \n}", "title": "" }, { "docid": "cc88d061d34fd56f7a085fc80ec6887d", "score": "0.43633702", "text": "function computeLabelInterval(slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) {\n labelInterval = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createDuration)(STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.wholeDivideDurations)(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n}", "title": "" }, { "docid": "cc88d061d34fd56f7a085fc80ec6887d", "score": "0.43633702", "text": "function computeLabelInterval(slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) {\n labelInterval = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createDuration)(STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.wholeDivideDurations)(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n}", "title": "" }, { "docid": "cc88d061d34fd56f7a085fc80ec6887d", "score": "0.43633702", "text": "function computeLabelInterval(slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) {\n labelInterval = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createDuration)(STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.wholeDivideDurations)(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n}", "title": "" }, { "docid": "cc88d061d34fd56f7a085fc80ec6887d", "score": "0.43633702", "text": "function computeLabelInterval(slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) {\n labelInterval = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createDuration)(STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.wholeDivideDurations)(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n}", "title": "" }, { "docid": "33df87f42a2f42cd6d763f3a4e767c4c", "score": "0.4357728", "text": "function getDiamondInterval() {\n timeElapsed = new Date().getTime() - startTime;\n return (diamondMax - Math.floor((timeElapsed / roundLength) * diamondRateOfChange) + 1) * 1000;\n}", "title": "" }, { "docid": "7381645c2bc5a4cd2090cee67f615b51", "score": "0.4353396", "text": "function getUserIntervals(userChord) {\n\t//console.log(\"userChord Length: \" + userChord.length)\n\tlet index = 0,\n\t\tintervals = [],\n\t\tnum_of_intervals = userChord.length - 1\n\n\t// store intervals\n\twhile (num_of_intervals > 0) {\n\t\tintervals.push(\n\t\t\tgetInterval(\n\t\t\t\tgetNoteId(userChord[index]),\n\t\t\t\tgetNoteId(userChord[index + 1])\n\t\t\t)\n\t\t)\n\t\tnum_of_intervals--\n\t\tindex++\n\t}\n\treturn intervals\n}", "title": "" }, { "docid": "e65321caf0cfca0913ecf3656c0971e6", "score": "0.4352014", "text": "static get GROUP_INTERVAL() {\r\n return 35;\r\n }", "title": "" }, { "docid": "4fdbe138c929193f236073dd03f526d8", "score": "0.43483406", "text": "getChordTones() {\n const intervalNums = [];\n const rootNum = this.root.toNoteNum();\n intervalNums.push(math.mod(rootNum, 12));\n const thirdIncr = this.getThirdInterval();\n intervalNums.push(math.mod(rootNum + thirdIncr, 12));\n intervalNums.push(math.mod(rootNum + this.getFifthInterval(), 12));\n intervalNums.sort(function(a, b){return a-b});\n return intervalNums;\n }", "title": "" }, { "docid": "ede18aaee959ea88483494abfb0b0363", "score": "0.43387243", "text": "blocksTravelled(){\n let eastWest = ['1st Avenue', '2nd Avenue', '3rd Avenue', 'Lexington Avenue', 'Park', 'Madison Avenue', '5th Avenue'];\n return (this.endingLocation.vertical - this.beginningLocation.vertical) + (eastWest.indexOf(this.endingLocation.horizontal) - eastWest.indexOf(this.beginningLocation.horizontal))\n }", "title": "" }, { "docid": "dae942957348b3544973962648e4bdda", "score": "0.43384102", "text": "static restrictToInterval(x, a, b) {\n if (a <= b) {\n if (x < a)\n return a;\n if (x > b)\n return b;\n return x;\n }\n // reversed interval ....\n if (x < b)\n return b;\n if (x > a)\n return a;\n return x;\n }", "title": "" }, { "docid": "92e4789dd6143257f6a980b8367ef191", "score": "0.4334022", "text": "getIndexOfTime(time_in){\r\n var len = this.sampleList.length;\r\n\r\n if(time_in <= this.firstSampleTime){\r\n return 0; //Edge case - user asks for sample before known time\r\n } else if (time_in >= this.latestSampleTime){\r\n return this.sampleList.length - 1; //Edge case - user asks for sample after known range\r\n } else {\r\n if(len >= 3){\r\n\r\n //Main algorithm - assume the points are roughly equally spaced and start guessing about where\r\n // we'd expect the requested point to be.\r\n var signalTimeSpan = this.latestSampleTime - this.firstSampleTime;\r\n if(signalTimeSpan > 0){\r\n var guessIdx = Math.floor( (this.sampleList.length-1) * (time_in-this.firstSampleTime) / (signalTimeSpan));\r\n\r\n while(true){ //return statements expected to kick out out of this loop.\r\n var guessTime = this.sampleList[guessIdx].time;\r\n\r\n if(guessTime > time_in){\r\n //Guessed too high, look backward in list\r\n var guessTimeNext = this.sampleList[guessIdx-1].time;\r\n if(guessTimeNext < time_in){\r\n //We found the right interval, return the upper bound.\r\n return guessIdx;\r\n } else {\r\n //Not in this interval, keep going.\r\n guessIdx = guessIdx - 1;\r\n continue;\r\n }\r\n\r\n } else if (guessTime < time_in){\r\n //Guessed too low, move forward in list\r\n var guessTimeNext = this.sampleList[guessIdx+1].time;\r\n if(guessTimeNext > time_in){\r\n //We found the right interval, return the upper bound.\r\n return guessIdx + 1;\r\n } else {\r\n //Not in this interval, keep going.\r\n guessIdx = guessIdx + 1;\r\n continue;\r\n }\r\n\r\n } else {\r\n //hot dog got it spot on!\r\n return guessIdx;\r\n }\r\n }\r\n\r\n\r\n } else {\r\n return len-1; //Edge case - samples provided are all on the same timestamp - just return the most recently submitted one\r\n }\r\n } else if (len == 1 || len == 2){\r\n return len-1; //Edge Case - only one or two samples in the list. Above algorithm won't work well, so just return latest sample\r\n } else if(len == 0) {\r\n return null; //Edge case - no samples in list - return null\r\n }\r\n\r\n }\r\n\r\n\r\n }", "title": "" }, { "docid": "8c69aedef9d2cf5c0f8acf63c4b58992", "score": "0.43314183", "text": "static _hasOpenIntervalToday(intervals, time) {\n for (let interval of intervals) {\n if (time < interval.start) {\n return { hasOpen: true, interval };\n }\n }\n return { hasOpen: false };\n }", "title": "" }, { "docid": "dc01232e78294cc2c468ef5a3a6b76e4", "score": "0.4322387", "text": "function getLines(stops) {\n let lines = Object.keys(json.linjastot);\n var interval;\n lines.forEach(line => {\n for (let i = 1; i < json.linjastot[line].length; i++) {\n if ((stops[0] === json.linjastot[line][i-1] && stops[1] === json.linjastot[line][i]) || \n (stops[1] === json.linjastot[line][i-1] && stops[0] === json.linjastot[line][i])) {\n interval = {\n from: stops[0],\n to: stops[1],\n line: line\n }\n }\n };\n });\n return interval;\n}", "title": "" }, { "docid": "73a6ab8538049bedd93cae9c6154d341", "score": "0.43166515", "text": "setInterval(callback, interval) {\r\n var interval = setInterval(callback, interval);\r\n this._intervals.push(interval);\r\n return interval;\r\n }", "title": "" }, { "docid": "b8af57474fa930ca0c3ede3a33dc88e8", "score": "0.43127418", "text": "getThirdInterval() {\n if (this.suspension == 2) {\n return 2;\n }\n if (this.suspension == 4) {\n return 5;\n }\n if (this.quality == 'dim' || this.quality == 'm' || this.quality == 'mM') {\n return 3;\n }\n return 4;\n }", "title": "" }, { "docid": "87603ec768ef67bb4c9acfd0ad2620a7", "score": "0.43116874", "text": "static ET(base, root = new NullNote()) {\n let result = (root instanceof NullNote) ? new IntervalTree(root) : new RootedIntervalTree(root);\n let curr = root;\n for (let i = 0; i < base - 1; i++) {\n curr = result.connectAbove(curr, new ETInterval(1, base));\n }\n return result;\n }", "title": "" }, { "docid": "75c1117e3365ecfe7497d58853595abc", "score": "0.43060538", "text": "static _isOpen(intervals, time) {\n for (let interval of intervals) {\n if ((interval.start <= time && time < interval.end) || (interval.start <= time && interval.end <= interval.start) || (interval.start == 0 && interval.end == 2359)) {\n return { isOpen: true, interval };\n }\n }\n return { isOpen: false };\n }", "title": "" }, { "docid": "b02d948cdbe6075858fdaf4a358ab8ed", "score": "0.42902967", "text": "function handleNegative (interval) {\n if (interval.lo < 0) {\n if (interval.lo === -Infinity) {\n interval.lo = 0\n interval.hi = Infinity\n } else {\n var n = Math.ceil(-interval.lo / constants.PI_TWICE_LOW)\n interval.lo += constants.PI_TWICE_LOW * n\n interval.hi += constants.PI_TWICE_LOW * n\n }\n }\n return interval\n}", "title": "" }, { "docid": "b02d948cdbe6075858fdaf4a358ab8ed", "score": "0.42902967", "text": "function handleNegative (interval) {\n if (interval.lo < 0) {\n if (interval.lo === -Infinity) {\n interval.lo = 0\n interval.hi = Infinity\n } else {\n var n = Math.ceil(-interval.lo / constants.PI_TWICE_LOW)\n interval.lo += constants.PI_TWICE_LOW * n\n interval.hi += constants.PI_TWICE_LOW * n\n }\n }\n return interval\n}", "title": "" }, { "docid": "b02d948cdbe6075858fdaf4a358ab8ed", "score": "0.42902967", "text": "function handleNegative (interval) {\n if (interval.lo < 0) {\n if (interval.lo === -Infinity) {\n interval.lo = 0\n interval.hi = Infinity\n } else {\n var n = Math.ceil(-interval.lo / constants.PI_TWICE_LOW)\n interval.lo += constants.PI_TWICE_LOW * n\n interval.hi += constants.PI_TWICE_LOW * n\n }\n }\n return interval\n}", "title": "" }, { "docid": "53b47049341796878c47308f252db9fb", "score": "0.42861316", "text": "function Interval(start, end) {\n this.start = start;\n this.end = end;\n}", "title": "" }, { "docid": "81b890894f8990a906f7d3a906a0b165", "score": "0.42814243", "text": "function myIntervalFunction(startValue, endValue) {\n this.startValue = startValue;\n this.endValue = endValue;\n}", "title": "" }, { "docid": "38efe2a29035e9260389ca0bc6c7ce39", "score": "0.42772627", "text": "function getUpdateInterval(feedback){\n\tvar maxInt = 180;\n\tvar min = 30;\n\tvar first = 5;\n\tif(!NW.updateInterval){\n\t\tNW.updateInterval = first;\n\t} else if(feedback){\n\t\tNW.updateInterval = min;\n\t} else if(NW.updateInterval>=maxInt){\n\t\tNW.updateInterval = maxInt;\n\t} else {\n\t\tNW.updateInterval++;\n\t}\n return NW.updateInterval;\n}", "title": "" }, { "docid": "b8507110f8d875d8c04b453b1e27b9fd", "score": "0.42744845", "text": "get intervalDurationSpan () {\n return this._intervalDurationSpan;\n }", "title": "" }, { "docid": "805456c23df1eb3dd8348c5629f56836", "score": "0.42702216", "text": "success () {\n if (this.interval === 0.0) return\n\n this.shortInterval = this.shortInterval.minus(this.shortUnit)\n this.longInterval = this.longInterval.minus(this.longUnit)\n this.shortInterval = max(this.shortInterval, new BigNumber(0))\n this.longInterval = max(this.longInterval, new BigNumber(0))\n\n this.updateInterval()\n }", "title": "" }, { "docid": "a89972367b9ad912ca05acb879ee7d96", "score": "0.42640388", "text": "function remove_from_interval(index) {\n var current_interval = intervals[index];\n if(current_interval.start == current_interval.end)\n intervals.splice(index, 1);\n\n else if(current_interval.start == point)\n intervals[index] = { \"start\": current_interval.start + 1, \"end\": current_interval.end };\n\n else if(current_interval.end == point)\n intervals[index] = { \"start\": current_interval.start, \"end\": current_interval.end - 1 };\n \n else {\n intervals[index] = { \"start\": current_interval.start, \"end\": point - 1 };\n intervals.splice(index, 0, { \"start\": point + 1, \"end\": current_interval.end });\n }\n\n return true;\n }", "title": "" }, { "docid": "f86cc0cd5c1e1c6c53d0cc29eac64cb4", "score": "0.42600608", "text": "function mergeIntervals(intervals) {\n if(intervals.length <= 1) {\n return intervals;\n }\n\n var answerArray = [];\n intervals.sort(sortIntervals); \n\n for (let i = 0; i < intervals.length; i++) {\n if(answerArray.length == 0 || intervals[i][0] - answerArray[answerArray.length-1][1] > 1) {\n answerArray.push(intervals[i])\n } else {\n answerArray[answerArray.length - 1][1] = Math.max(intervals[i][1], answerArray[answerArray.length-1][1])\n }\n }\n return answerArray; \n\n}", "title": "" }, { "docid": "f7306d74d3bfa71c6cf3a3041a9dbc8c", "score": "0.42591786", "text": "constructor(interval = 5, referenceLine, bbox) {\n this.interval = interval;\n this.bbox = bbox;\n this.referenceLine = referenceLine;\n this.lines = [];\n this.computeDerivedParams();\n }", "title": "" }, { "docid": "d194c2c78935486aa4e4bb4e6ad57b7d", "score": "0.42416483", "text": "static CUMIPMT(rate, periods, value, start, end, type) {\n if (!Formula.valid(rate, periods, value, start, end)) {\n throw new Error('Wrong parameter format');\n }\n // Return error if either rate, periods, or value are lower than or equal to zero\n if (rate <= 0 || periods <= 0 || value <= 0) {\n throw Error('Rate, periods, or value are lower than or equal to zero');\n }\n // Return error if start < 1, end < 1, or start > end\n if (start < 1 || end < 1 || start > end) {\n throw Error('start < 1, end < 1, or start > end');\n }\n // Compute cumulative interest\n const payment = Formula.PMT(rate, periods, value, 0, type);\n let interest = Big(0);\n if (start === 1) {\n if (type === FormulaType.ZERO) {\n interest = interest.minus(value);\n start++;\n }\n }\n for (let i = start; i <= end; i++) {\n if (type === FormulaType.ONE) {\n interest = interest.plus(Formula.FV(rate, i - 2, payment, value, 1)).minus(payment);\n }\n else {\n interest = interest.plus(Formula.FV(rate, i - 1, payment, value, 0));\n }\n }\n interest = interest.times(rate);\n // Return cumulative interest\n return +interest;\n }", "title": "" }, { "docid": "c5b301466486ed788ee9944a90b4a3c3", "score": "0.42412812", "text": "function Interval(start, stop) {_classCallCheck(this, Interval);\n this.start = start;\n this.stop = stop;}", "title": "" }, { "docid": "6485fc9d2bc7c20e095cc97684a9db7d", "score": "0.42398074", "text": "async validateDoubleVotesInDb({ interval, type, address, votesToAdd } = {}) {\n const { snapshot, tally } = cgpUtils.getIntervalBlocks(this.chain, interval);\n const votes = await cgpDAL.findAllVotesInPhaseByAddress({\n address,\n type: type.toLowerCase(),\n beginBlock: snapshot,\n endBlock: tally,\n transaction: this.dbTransaction,\n });\n\n if (votes.length) return false;\n\n // check double votes in same execution (votes are added to db per execution)\n if (\n votesToAdd.some(\n (vote) =>\n vote.address === address && vote.check.interval === interval && vote.check.type === type\n )\n ) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "d271ff04d15ed7b8724584a312337f76", "score": "0.4231554", "text": "getCurrentSegment() {\n let p1, p2, segment;\n switch (this.placement) {\n case PLACEMENT.CORNER:\n p1 = this.lines[this.segment_index - 1];\n p2 = this.lines[this.segment_index];\n let p3 = this.lines[this.segment_index + 1];\n segment = [ p1, p2, p3 ];\n break;\n case PLACEMENT.MID_POINT:\n p1 = this.lines[this.segment_index];\n p2 = this.lines[this.segment_index + 1];\n segment = [ p1, p2 ];\n break;\n }\n\n return segment;\n }", "title": "" }, { "docid": "6a03103ee075c2cb7a0f7c607cc32793", "score": "0.4221657", "text": "function rigTimer() {\n\t\tvar date = new Date(lastTimerSet = Date.now())\n\t\tvar isInterval\n\t\tvar timeLeft\n\n\t\tswitch (period.schedule) {\n\t\tcase 'second': // every opts.every seconds since launch\n\t\t\tisInterval = true\n\t\t\tlastTimeval = opts.every * period.interval\n\t\t\tbreak\n\t\tcase 'minute': // every opts.every minutes\n\t\tcase 'hour': // first period opts.every hours + until at the following hour, then opts.every hours\n\t\tcase 'day': // first period opts.every days + until at in the day, then opts.every days\n\t\t\tvar periodTimeval = opts.every * period.interval // the time between two invocations\n\t\t\t// first invocation: isTimeout undefined -> isInterval false\n\t\t\t// second invocation: isTimeout true -> isInterval true\n\t\t\tisInterval = !!isTimeout\n\t\t\tif (!isInterval) { // it's the first period\n\t\t\t\tvar inPeriod = lastTimerSet % periodTimeval // time elapsed in current epoch-based period\n\t\t\t\tvar atTime = (opts.at % periodTimeval) * period.atUnit // at time in each period\n\t\t\t\tvar timeLeft = atTime - inPeriod // time left to the next at time in this period\n\t\t\t\tif (timeLeft <= 0) timeLeft += periodTimeval // it's passed, go to the next period\n\t\t\t\tlastTimeval = timeLeft\n\t\t\t} else lastTimeval = periodTimeval\n\t\t\tbreak\n\t\tcase 'month': // at is fixed timeunit\n\t\t\t// figure out start of the current period and the next two periods\n\t\t\tvar ymPeriod = linearcalendar.encodeMonths(opts.every)\n\t\t\tvar ymNow = linearcalendar.encodeDate(date)\n\t\t\tvar ymPeriodStart = ymNow - ymNow % ymPeriod\n\t\t\tvar period0 = linearcalendar.getTimeval(ymPeriodStart)\n\t\t\tvar period1 = linearcalendar.getTimeval(ymPeriodStart + ymPeriod)\n\t\t\tvar period2 = linearcalendar.getTimeval(ymPeriodStart + 2 * ymPeriod)\n\t\t\tvar atLeft = period0 + opts.at * period.atUnit - lastTimerSet\n\t\t\tif (atLeft <= 0) {\n\t\t\t\tvar nextAt = period1 + opts.at * period.atUnit\n\t\t\t\tif (nextAt >= period2) nextAt = period2 - time1day\n\t\t\t\tatLeft = nextAt - lastTimerSet\n\t\t\t}\n\t\t\tlastTimeval = atLeft\n\t\t\tbreak\n\t\tcase 'year': // always setTimeout\n\t\t\tvar ymPeriod = linearcalendar.encodeYears(opts.every)\n\t\t\tvar ymNow = linearcalendar.encodeDate(date)\n\t\t\tvar ymPeriodStart = ymNow - ymNow % ymPeriod\n\t\t\tvar period0 = linearcalendar.getDate(ymPeriodStart)\n\t\t\tvar period1 = linearcalendar.getDate(ymPeriodStart + ymPeriod)\n\t\t\tvar period2 = linearcalendar.getDate(ymPeriodStart + 2 * ymPeriod)\n\n\t\t\tvar period0At = linearcalendar.getDate(ymPeriodStart + opts.at)\n\t\t\tif (period0At > period1) period0At = period1 - time1day\n\t\t\tif (lastTimerSet < period0At) lastTimeval = period0At - lastTimerSet\n\t\t\telse {\n\t\t\t\tvar period1At = linearcalendar.getDate(ymPeriodStart + ymPeriod + opts.at)\n\t\t\t\tif (period1At > period2) period1At = period2 - time1day\n\t\t\t\tlastTimeval = period1At - lastTimerSet\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\t// rig the timer\n\t\ttimer = new anytimer.AnyTimer(fire, lastTimeval, isTimeout = !isInterval)\n\t}", "title": "" }, { "docid": "e6ee3b4dad922eee4d0def3abd093180", "score": "0.42202413", "text": "enterIntervalLiteral(ctx) {\n\t}", "title": "" }, { "docid": "c6239e49e2369160e24e80d4def11d15", "score": "0.4216228", "text": "timeUntilEndOfInterval(sensor) {\n let currentSeconds = this.currentSeconds();\n let time = 0;\n\n let activeInterval = sensor.activeSeconds[sensor.activePeriod];\n\n // start / end w/in same day, e.g. 08:00 - 20:00\n if (activeInterval.start <= activeInterval.end) {\n if ((activeInterval.start < currentSeconds) && (currentSeconds < activeInterval.end)) {\n time = activeInterval.end - currentSeconds;\n }\n }\n\n // start / end span days, e.g. 20:00 - 08:00\n else {\n if ((activeInterval.start < currentSeconds) || (currentSeconds < activeInterval.end)) {\n const secondsPerDay = 86400;\n\n // before midnight --> seconds remaining in current day + seconds in next day\n if (activeInterval.start < currentSeconds) {\n time = (secondsPerDay - currentSeconds) + activeInterval.end;\n }\n\n // after midnight --> seconds remaining in current day\n else {\n time = activeInterval.end - currentSeconds;\n }\n }\n }\n\n return time;\n }", "title": "" }, { "docid": "d792c0644fa1925bc118be4fdb4f1d65", "score": "0.42148137", "text": "function compareByInterval(node, otherNode) {\n\treturn node.source.startIdx - otherNode.source.startIdx;\n}", "title": "" }, { "docid": "d792c0644fa1925bc118be4fdb4f1d65", "score": "0.42148137", "text": "function compareByInterval(node, otherNode) {\n\treturn node.source.startIdx - otherNode.source.startIdx;\n}", "title": "" }, { "docid": "ff806481f489c7b5f406044c6255fdd5", "score": "0.4213137", "text": "function rn(interval) {\n\tconst min = interval[0];\n\tconst max = interval[1];\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "d58843c6777241aa1305782dad0e6934", "score": "0.42063093", "text": "function getMergedIntervals(intervals) {\n // Write your code here\n if (intervals.length === 0) return [];\n\n intervals.sort((a, b) => a[0] - b[0]);\n\n let mergedIntervals = [intervals[0]];\n\n for (let i = 1; i < intervals.length; i++) {\n let lastMerged = mergedIntervals[mergedIntervals.length - 1];\n let current = intervals[i];\n if (lastMerged[1] >= current[0]) {\n lastMerged[1] = Math.max(lastMerged[1], current[1]);\n } else {\n mergedIntervals.push(current);\n }\n }\n\n return mergedIntervals;\n}", "title": "" }, { "docid": "8493d6b5e00b33d031d51d7ef6274abe", "score": "0.42024773", "text": "getRange(total) {\n let range = []\n for (let i=0; i<5; i++) {\n range.push(this.toMinutes((total/5)*i))\n }\n range.push(this.toMinutes(total))\n return range\n }", "title": "" }, { "docid": "44e6497388d9ea4549ce6778835ab518", "score": "0.41965672", "text": "static setupIntervals() {\n // Processes announcements and election events.\n EventsHelper.runInterval(() => this.checkProgress(), baseTickDur);\n\n // Ensure leadership and commander based on items so they are treated seriously.\n EventsHelper.runInterval(() => this.ensureItemSeriousness(), baseTickDur * 6);\n }", "title": "" }, { "docid": "cd619f406f8a4cd46304098cde158f43", "score": "0.41840097", "text": "setIntervalHooks() {\n this.intervals.hooks.tatums = (i) => {\n console.log('Tatum: ' + i)\n }\n\n this.intervals.hooks.segments = (i) => {\n console.log('Segment: ' + i)\n }\n\n this.intervals.hooks.beats = (i) => { \n console.log('Beat: ' + i)\n }\n\n this.intervals.hooks.bars = (i) => {\n console.log('Bar: ' + i)\n }\n\n this.intervals.hooks.sections = (i) => {\n console.log('Section: ' + i)\n }\n }", "title": "" }, { "docid": "b5b119ff3f663edd11efab7cc78dbb32", "score": "0.41809818", "text": "function getInterval(timeTable, bus) {\n if (routeToKey[bus] == null || timeTable[routeToKey[bus]] == null) {\n return false\n }\n const schedule = timeTable[routeToKey[bus]][\"schedule\"]\n\n if (Object.keys(schedule).length <= 2) {\n return false\n } \n\n // In the JSON file, each scheudle object is given as a string\n // Regex is used to extract the time information\n // We look for a loop to determine the interval of the bus\n \n var visitedStops = []\n var stopTimes = []\n\n var r = false\n Object.keys(schedule).forEach(function(key) {\n var descRegex = /Departs ([a-zA-Z\\s]*) at ([0-9]{1,2}):([0-9]{2}) ([PMA]{2})/g\n \n // If we have found the interval already then ignore the loop\n if (r != false) {\n return\n }\n\n var desc = schedule[key];\n var matches = descRegex.exec(desc)\n\n if (matches != null) {\n var stop = matches[1]\n\n // convert hours into 24 hour clock\n var hour = parseInt(matches[2]) + 12 * (matches[4] == \"PM\" ? 1 : 0)\n var minute = parseInt(matches[3])\n\n var stopIndex = -1;\n for (var i = 0; i < visitedStops.length; i++) {\n if (visitedStops[i] == stop) {\n stopIndex = i\n break\n }\n }\n\n if (stopIndex != -1) {\n var timeIndex = 2 * stopIndex\n var hour0 = stopTimes[timeIndex]\n var minute0 = stopTimes[timeIndex + 1]\n\n var d0 = new Date()\n d0.setHours(hour0, minute0)\n var d1 = new Date()\n d1.setHours(hour,minute)\n\n var dT = d1.getTime() - d0.getTime();\n\n r = dT/(60 * 1000)\n return\n }\n\n visitedStops.push(stop)\n stopTimes.push(hour)\n stopTimes.push(minute)\n } else {\n console.log(\"No match at '\" + desc + \"'\");\n }\n\n\n })\n\n return r\n\n}", "title": "" }, { "docid": "ace558cffc960a2373b348d40548c4ae", "score": "0.41737515", "text": "function remove_from_interval(index) {\n var current_interval = intervals[index];\n if (current_interval.start === current_interval.end) {\n intervals.splice(index, 1);\n } else if (current_interval.start === point) {\n intervals[index] = {start: current_interval.start + 1, end: current_interval.end};\n } else if (current_interval.end === point) {\n intervals[index] = {start: current_interval.start, end: current_interval.end - 1};\n } else {\n intervals[index] = {start: current_interval.start, end: point - 1};\n intervals.splice(index+1, 0, {start: point + 1, end: current_interval.end});\n }\n\n return true;\n }", "title": "" }, { "docid": "b389dcb8dc5d90cdbb4b2ea17bc70bbb", "score": "0.41654328", "text": "async function getBalanceInRange(address, startBlock, endBlock) {\n // Number of points to fetch between block range\n var pointCount = 20;\n\n // Calculate the step size given the range of blocks and the number of points we want\n //var step = Math.floor((endBlock - startBlock) / pointCount)\n var step = 1;\n // Make sure step is at least 1\n /* if (step < 1) {\n step = 1;\n }*/\n\n // Store the final result here\n var balances = []\n\n /* // Loop over the blocks, using the step value\n for (let i = startBlock; i < endBlock; i = i + step) {\n // Get the ETH value at that block\n let wei = await promisify(cb => web3.eth.getBalance(address, i, cb));\n let ether = parseFloat(web3.fromWei(wei, 'ether'))\n // Add result to final output \n balances.push({\n block: i,\n balance: ether\n });\n } */\n\n // Loop over the blocks, using the step value\n for (let i = (endBlock - 5000); i <= endBlock; i = i + 100) {\n // Get the ETH value at that block\n let wei = await promisify(cb => web3.eth.getBalance(address, i, cb));\n let ether = parseFloat(web3.fromWei(wei, 'ether'))\n // Add result to final output \n balances.push({\n block: i,\n balance: ether\n });\n }\n\n return balances;\n}", "title": "" }, { "docid": "ef971d81adbd9288ce4744a0daf67593", "score": "0.41580382", "text": "yInterval (y) { return Math.floor((this.north() - y) / this.ySpacing()) }", "title": "" }, { "docid": "1a62224d993c1852b04857998334d214", "score": "0.4152732", "text": "function getEmailInterval(enableEmailNotification\n/*: boolean*/\n, enableEmailBatching\n/*: number*/\n, emailIntervalPreference\n/*: number*/\n)\n/*: number*/\n{\n var INTERVAL_NEVER = _constants.Preferences.INTERVAL_NEVER,\n INTERVAL_IMMEDIATE = _constants.Preferences.INTERVAL_IMMEDIATE,\n INTERVAL_FIFTEEN_MINUTES = _constants.Preferences.INTERVAL_FIFTEEN_MINUTES,\n INTERVAL_HOUR = _constants.Preferences.INTERVAL_HOUR;\n var validValuesWithEmailBatching = [INTERVAL_IMMEDIATE, INTERVAL_NEVER, INTERVAL_FIFTEEN_MINUTES, INTERVAL_HOUR];\n var validValuesWithoutEmailBatching = [INTERVAL_IMMEDIATE, INTERVAL_NEVER];\n\n if (!enableEmailNotification) {\n return INTERVAL_NEVER;\n } else if (enableEmailBatching && validValuesWithEmailBatching.indexOf(emailIntervalPreference) === -1) {\n // When email batching is enabled, the default interval is 15 minutes\n return INTERVAL_FIFTEEN_MINUTES;\n } else if (!enableEmailBatching && validValuesWithoutEmailBatching.indexOf(emailIntervalPreference) === -1) {\n // When email batching is not enabled, the default interval is immediately\n return INTERVAL_IMMEDIATE;\n }\n\n return emailIntervalPreference;\n}", "title": "" }, { "docid": "4862e57fcb8bde0d3efb094554a6fd59", "score": "0.41433406", "text": "dividedNotesAbove(interval, div) {\n let innerCount = Math.ceil(div) - 1, divided = interval.divide(div), result = [], curr = this;\n // add all divided bits\n for (let i = 0; i < innerCount; i++) {\n curr = curr.noteAbove(divided);\n result.push(curr);\n }\n // add the top note\n result.push(this.noteAbove(interval));\n return result;\n }", "title": "" }, { "docid": "6892d1cdd986bc911d19d2761d2abb7a", "score": "0.41397625", "text": "function intervalConstructor(from, to) {\n // Construct a Interval object from string representation\n if (typeof from === 'string')\n return Interval.toCoord(from);\n\n if (typeof to === 'string' && from instanceof Note)\n return Interval.from(from, Interval.toCoord(to));\n\n if (to instanceof Interval && from instanceof Note)\n return Interval.from(from, to);\n\n if (to instanceof Note && from instanceof Note)\n return Interval.between(from, to);\n\n throw new Error('Invalid parameters');\n}", "title": "" } ]
db1cd3f5c0f4b64d67d6925c8837662d
render our actual elements
[ { "docid": "2843e91b921090c279af05f4ae3b948d", "score": "0.0", "text": "function render(){\r\nrespList.innerHTML = \"\";\r\n// note, foreach needs a modern browser but can easily be shimmed\r\nresponsibilities.forEach(function(responsibility,i){\r\n var el = renderResponsibility(responsibilities[i],function(){\r\n responsibilities.splice(i,1);//remove the element\r\n abc();\r\n //alert(\"chuoi:\" + temp.toString());\r\n render();//re-render\r\n // alert(\"foi ham\");\r\n \r\n });\r\n respList.appendChild(el);\r\n abc();\r\n //alert(\"chuoi:\" + temp.toString());\r\n});\r\n}", "title": "" } ]
[ { "docid": "4e73539d964fefeb5c38cd91baee3df6", "score": "0.84335536", "text": "render() {\n this._create_elements()\n this._render_elements()\n }", "title": "" }, { "docid": "45c29c837a2cfc13c6e63c839d241579", "score": "0.78597564", "text": "function _render() {\n \n \n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.7595868", "text": "render() {\n }", "title": "" }, { "docid": "ff9e12b79b7f8c88a57bb23353aa4de0", "score": "0.74367017", "text": "function render() {\n \n mugine.render(element, templates[options.style], {\n preview: preview, \n views: views, \n buttons: buttons\n });\n \n }", "title": "" }, { "docid": "2b28a71ad1b16bb1942e78a77c177533", "score": "0.7412767", "text": "function render() {\n\n // render the nodes\n renderNodes();\n\n // render links\n renderLinks();\n\n // render the reveal arrow\n renderReveal();\n }", "title": "" }, { "docid": "c3648699c252708001bc88e293365eb6", "score": "0.7191342", "text": "render() {\n\n \t}", "title": "" }, { "docid": "1dceee68ea3e8b0d5fe157aa47b6d758", "score": "0.71491945", "text": "onRender(){\n // TODO: put DOM manipulations here...\n // Call this.render() to update UI.\n }", "title": "" }, { "docid": "f843a79d4a86f26d3d456e3bf5b6e871", "score": "0.71380186", "text": "function renderElements() {\n\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\tdrawElement( elements[i] );\n\t}\n}", "title": "" }, { "docid": "b47cd9e1ec2ede09b4215041e24a1ba0", "score": "0.7137594", "text": "_render_elements() {\n throw new Error('Method « _render_elements » should be implemented by the engine.')\n }", "title": "" }, { "docid": "55a471b24674cd3c488584140711ea11", "score": "0.7093063", "text": "render () {}", "title": "" }, { "docid": "d41d96159621c2116937ffbb2cf68b1a", "score": "0.70829976", "text": "selfRender() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.7080492", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.7080492", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.7080492", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.7080492", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.7080492", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.7080492", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.7080492", "text": "render() {}", "title": "" }, { "docid": "a7807ef5f8b612be02f0d3d09fe230fa", "score": "0.70648426", "text": "static render() {\n this.renderText();\n this.renderNodes();\n }", "title": "" }, { "docid": "2477a8dd0d889ee21b3159fdf273dc44", "score": "0.70563364", "text": "render() {\n return super.render();\n }", "title": "" }, { "docid": "280f5bbcce6e9ffb2c64c614d6238e3e", "score": "0.70531267", "text": "render () {\n\t\tsuper.render();\n\t}", "title": "" }, { "docid": "db2a8dd3f0618c85a6fad7c423a3b53c", "score": "0.7043282", "text": "render() {\n super.render();\n }", "title": "" }, { "docid": "aacfa5734be3686f16f7216494948380", "score": "0.7009927", "text": "render() {\n //create the output\n\n //don't append repetitively to the dom since that will increase reflow,\n //(https://developers.google.com/speed/docs/insights/browser-reflow)\n const fragment = document.createDocumentFragment(\"div\");\n\n // create a row for the currency select boxes\n\n const $currencies = document.createElement(\"div\");\n\n $currencies.className = \"row\";\n\n this.app.iterateCurrencyInputs(input => {\n $currencies.appendChild(input.getRoot());\n });\n\n fragment.appendChild($currencies);\n\n //amount\n const $div = document.createElement(\"div\");\n $div.className = \"conversion\";\n $div.appendChild(this.app.amount.$input);\n $div.appendChild(this.app.$button);\n fragment.appendChild($div);\n\n //append error for amount error\n const $amountError = document.createElement(\"div\");\n $amountError.appendChild(this.app.amount.$error);\n $amountError.className = \"amount-error\";\n fragment.appendChild($amountError);\n\n //add the result\n this.app.$result.className = \"result\";\n\n fragment.appendChild(this.app.$result);\n\n //append everything to the dom\n this.$rootNode.appendChild(fragment);\n }", "title": "" }, { "docid": "6d0636f12d991f0746dd763ff5d0351f", "score": "0.6977482", "text": "render() { // it describes what the UI should look like\n\n }", "title": "" }, { "docid": "5143aca8f61b57d10b76653033b010c3", "score": "0.69611216", "text": "render()\n {\n // render index\n this.manager.renderIndex();\n \n // render toolbox\n this.manager.renderToolbox();\n \n // render main\n this.manager.renderMain();\n\n }", "title": "" }, { "docid": "ce93e60513953e9b5e1a6bc4d9606a7f", "score": "0.69427425", "text": "function render() {\n // TODO\n}", "title": "" }, { "docid": "19782922638c7de637ae19324d444e46", "score": "0.69217247", "text": "_render () {}", "title": "" }, { "docid": "9e9299b846f7c18ce7b6cfd82586e2be", "score": "0.69176453", "text": "function _render(ctx) {\n\t\tvar _this = ctx;\n\t\t$('body').append(_this.$el);\n\t\tfor (var i = 0; i < cards.length; i++) {\n\t\t\t_this.$box.append(cards[i].$el);\n\t\t}\n\t}", "title": "" }, { "docid": "6273be5f746874a9bcc8987e9600a70f", "score": "0.68873066", "text": "render()\n {\n var html_builder = [];\n var data = this.view_data_provider.getData(this);\n\n // both are common cases\n if ($.isArray(data))\n {\n for (var i = 0; i < data.length; i++)\n {\n html_builder.push(Utils.render(this.template, data[i]));\n }\n }\n else\n {\n html_builder.push(Utils.render(this.template, data));\n }\n\n if (this.append)\n {\n this.$target.append(html_builder.join(''));\n }\n else\n {\n this.$target.html(html_builder.join(''));\n }\n }", "title": "" }, { "docid": "29415372892ded2522c3b7a2520a9f84", "score": "0.6880192", "text": "_render () {\n super._render();\n this._addElements();\n this._getMaxWidth();\n this._hammerTime();\n }", "title": "" }, { "docid": "87b4825ad5f7d437128d0519d49f15c1", "score": "0.6876108", "text": "function render () {\n\t\tfilterArticles();\n\t\tsortArticles();\n\t\tappendArticles();\n\t\tcountArticles();\n\t}", "title": "" }, { "docid": "3fedd69596405e9d03740d40ec2fc5a8", "score": "0.68588233", "text": "function Render()\n\t{\n\t}", "title": "" }, { "docid": "150d509b8d7a86067d35b2a5349b3f8f", "score": "0.6848329", "text": "render() {\n\n // Turn receiptItems into receipt list item markup\n const receiptMarkup = this.items.map((data, index) => {\n return this.template(data, index)\n }).join('');\n\n this.element.forEach(function (receiptListGroup) {\n receiptListGroup.querySelector('.receipt-list-item').innerHTML = receiptMarkup;\n });\n\n // Render the discounts\n this.renderDiscount();\n\n // Render total at checkout\n this.renderTotalDue();\n\n // Render Total Item\n this.renderTotalItem();\n\n }", "title": "" }, { "docid": "8eb8db28e66248acb71321a989d5415a", "score": "0.6807629", "text": "render() {\n\t\tthis.recursiveRender(this.toBeRendered);\n\t}", "title": "" }, { "docid": "6193e3f1cb7634ecd7d53999fbf575cf", "score": "0.6767738", "text": "function renderDOM() {\n renderNavList(mainState, '.struct'); \n renderContent(mainState, '#content_title'); \n renderAboutContent(mainState, '.content'); \n fetchData();\n renderApiData('#content', data); \n renderApiDataImg('#picture', data);\n \n}", "title": "" }, { "docid": "d7a5932522608a3a1bd88e22122467a3", "score": "0.6759962", "text": "function _render() {\n\n list.innerHTML = pages.reduce((html, page, index) => {\n return html + template(page, index);\n }, '');\n\n }", "title": "" }, { "docid": "f563ccd3faac529e5daaf02fe9e8ed24", "score": "0.67532384", "text": "render() {\n\t\tif (!this.component_.element) {\n\t\t\tthis.component_.element = document.createElement('div');\n\t\t}\n\t\tthis.emit('rendered', !this.isRendered_);\n\t}", "title": "" }, { "docid": "bcafa375babd11c8602a3709dfeb56e5", "score": "0.67469954", "text": "render() {\n // This returns the element that was saved with the class\n // It relies on the calling code to attach it to the DOM.\n return this.element;\n }", "title": "" }, { "docid": "a617b89644c14ed5dc1a3433b51771d1", "score": "0.6726066", "text": "function render(){\n let html = '';\n \n // add the different parts\n html += generateMealDetailsForm();\n html += generateInfoSection();\n html += generateResetButton();\n\n // put it out there\n $('main').html(html);\n}", "title": "" }, { "docid": "c505c7b7c20c1b42e35a4ac45d3875ef", "score": "0.67189777", "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": "2eb8c9f790a2854a7ee7e2700bc10fbb", "score": "0.6716759", "text": "function _render($$) {\n var el = $$('div')\n var parent = el\n el.append('AAAA')\n if (this.props.extraLayer) {\n var middle = $$(Simple).ref('selection')\n el.append(middle)\n parent = middle\n }\n parent.append($$(Simple).ref('foo').append('BBBB'))\n el.append('CCCC')\n return el\n }", "title": "" }, { "docid": "6daa980cb5ed560971429fe4a1a7110d", "score": "0.67159146", "text": "render() {\n\t\tthis.container = document.getElementById(this.props.container);\n\t\tthis.container.innerHTML = this.template();\n\t\t// set container accordion item in order to append accordion item\n\t\tthis.accordionElement = this.container.querySelector('.accordion__items');\n\t\tthis.props.panels.forEach((value, index) => {\n\t\t\t// instance Accordion item anc render it\n\t\t\tthis.accordionItems[index] = new AccordionItem({\n\t\t\t\tcontainer:this.accordionElement,\n\t\t\t\titem:value,\n\t\t\t\tindexList:index\n\t\t\t}, {\n\t\t\t\tonclick: (index) => this.onclickOnItem(index)\n\t\t\t});\n\t\t\tthis.accordionItems[index].render();\n\t\t});\n\t}", "title": "" }, { "docid": "1ba4ae90586ea1055881cd03dcbd1765", "score": "0.6703256", "text": "function render(){\n console.log('`render function` ran');\n const createdHtml = generateHtml(STORE); \n $('main').html(createdHtml);\n}", "title": "" }, { "docid": "253ab2afcf018c97a0e3b2d0e3dd301d", "score": "0.66968536", "text": "renderContent() {\n this._updateBounds();\n\n if (this.model.canUpdateBounds()) {\n this.$el.addClass('can-update-bound');\n\n this._$resizeIcon = $('<div class=\"resize-icon\" />')\n .appendTo(this.$el);\n }\n\n this._$flag = $('<div class=\"selection-flag\" />')\n .appendTo(this.$el);\n\n this._updateCount();\n }", "title": "" }, { "docid": "a446d1920da2aa4edf860667ca4b9d20", "score": "0.6689478", "text": "render () {\n this.renderArcs()\n .renderText();\n }", "title": "" }, { "docid": "d627b40d987e01286cce23191caca048", "score": "0.66868126", "text": "function _render() {\n\t\tvar footHtml = $footer.html();\n\t\tif ( !_isLogged() ) {\n\t\t\t$middle.html(registerTemplate);\n\t\t\t$footer.empty();\n\t\t\t$header.find('a#logout').hide();\n\t\t} else {\n\t\t\t$middle.html(tableOfProducts);\n\t\t\t$footer.html(footHtml);\n\t\t\t$header.find('a#logout').show();\n\t\t\t_getProducts();\n\t\t}\n\t}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.6685035", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.6685035", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.6685035", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.6685035", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.6685035", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.6685035", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "ca868d6a8d4122595376b5804299ffa7", "score": "0.66767824", "text": "function render() {\n contentContainer.append('<div class=\"col-md-1-5 col-sm-3 col-centered news-articles centered\">' +\n '<div class=\"content-image\"><a href=\"' + articleLink + '\" target=_\"blank\"</a> <img src=\"' + userImgURL + '\"/></div>' +\n '<div class=\"content-details \">' +\n '<a href=\"' + articleLink + '\" target=_\"blank\" class=\"headline\">' + headline + '</a>' +\n '<a href=\"'+ profileUrl +'\" class=\"user-name\">By ' + username + '</a>' +\n '<div class=\"clearfix\"><p class=\"upvotes pull-left\"><i class=\"fa fa-heart\"></i>' + articleVotes + '</p>' +\n '<a href=\"' + discussButton + '\" target=\"_blank\" class=\"btn btn-info btn-xs pull-right\">discuss</a></div>' +\n '<p class=\"post-date\">Posted On: ' + postDate + '</p>' +\n '</div>' +\n\n '</div>');\n }", "title": "" }, { "docid": "8804901f97c69dbf1369f64428127605", "score": "0.66590774", "text": "render() {\r\n this.moviesContainer.innerHTML = this.movies.map(movie => movie.renderLi()).join(' ')\r\n }", "title": "" }, { "docid": "f2972cf748d7a64e9188a6ba92a6117c", "score": "0.6657231", "text": "render() {\n }", "title": "" }, { "docid": "a0e3741bee58ffe20a99d924d32d03a6", "score": "0.66555274", "text": "render() {\n this.container.insertAdjacentHTML('beforeend', template());\n this.mapManager.render(this.container.getElementsByClassName('map')[0]);\n this.widgetManager.container = this.container.getElementsByClassName('widget-panel')[0];\n this.widgetManager.render();\n }", "title": "" }, { "docid": "cc254be19e5e93d0b57da6e4861bd22e", "score": "0.66522896", "text": "function render(){ \n\n\n}", "title": "" }, { "docid": "8dbc98cdc105ca219645a60e74ce7882", "score": "0.6645983", "text": "render() {\n this.renderBrowseButton();\n this.initializeUpload();\n this.wireEvents();\n this.setMultipleSelection();\n this.setExtensions(this.allowedExtensions);\n this.setRTL();\n this.renderPreLoadFiles();\n this.setControlStatus();\n }", "title": "" }, { "docid": "f31ae0263291e485e41bf57636892bbf", "score": "0.66356003", "text": "render() {\n let div = document.createElement(\"div\");\n\n div.setAttribute('id', this.elementID());\n div.setAttribute('doze', this.componentType());\n\n if (this.classes.count > 0) {\n div.setAttribute('class', this.htmlClasses());\n }\n\n this.element = div;\n\n return this.element;\n }", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.6633821", "text": "_onRender() {}", "title": "" }, { "docid": "857954ca78a7ee737c8ca663c1b1fc03", "score": "0.6624704", "text": "render() {\n\t\tif (this._initialized && !this.isRenderingSkipped()) {\n\n\t\t\tconst initialRendering = !this._rendered;\n\t\t\tthis.onBeforeRender(initialRendering);\n\t\t\tconst template = this.createView(this._model);\n\t\t\tif (this._isNothing(template)) {\n\t\t\t\trenderLitHtml(template, this.getRenderTarget());\n\t\t\t}\n\t\t\telse {\n\t\t\t\trenderLitHtml(html`${this.defaultCss()} ${template}`, this.getRenderTarget());\n\t\t\t}\n\n\t\t\tthis._rendered = true;\n\t\t\tthis.onAfterRender(initialRendering);\n\t\t}\n\t}", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.6614755", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "59bc47845901671ae4e073004e6acc8a", "score": "0.6610702", "text": "render() {\n let addClasses = [];\n let removeClasses = [];\n addClasses.push(ROOT);\n if (this.enableRtl) {\n addClasses.push(RTL);\n }\n else {\n removeClasses.push(RTL);\n }\n if (this.isAdaptive) {\n addClasses.push(DEVICE_CLASS);\n }\n else {\n removeClasses.push(DEVICE_CLASS);\n }\n if (this.cssClass) {\n addClasses.push(this.cssClass);\n }\n classList(this.element, addClasses, removeClasses);\n this.validateDate();\n this.eventTooltipTemplateFn = this.templateParser(this.eventSettings.tooltipTemplate);\n this.editorTemplateFn = this.templateParser(this.editorTemplate);\n this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);\n this.quickInfoTemplatesContentFn = this.templateParser(this.quickInfoTemplates.content);\n this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);\n createSpinner({ target: this.element });\n this.scrollModule = new Scroll(this);\n this.scrollModule.setWidth();\n this.scrollModule.setHeight();\n this.renderModule = new Render(this);\n this.eventBase = new EventBase(this);\n this.workCellAction = new WorkCellInteraction(this);\n this.initializeDataModule();\n this.on(dataReady, this.resetEventTemplates, this);\n this.on(eventsLoaded, this.updateEventTemplates, this);\n this.element.appendChild(this.createElement('div', { className: TABLE_CONTAINER_CLASS }));\n this.activeViewOptions = this.getActiveViewOptions();\n this.initializeResources();\n }", "title": "" }, { "docid": "db08056ec70605efd7573f9917fa6f72", "score": "0.66088104", "text": "render() {\n return <div className=\"red-border\">{this.renderContent()}</div>\n\n }", "title": "" }, { "docid": "f36481c1a342c20f9c238739757175b0", "score": "0.66047734", "text": "_render(timestamp) {\n this._elementManager.applyImperativeNodeProperties(this)\n }", "title": "" }, { "docid": "09110985bd7230b747e8fdd50bee8e38", "score": "0.6595432", "text": "_render()\n {\n for (let i = 0; i < this.children.length; i++)\n {\n let child = this.children[i];\n\n child._render();\n }\n }", "title": "" }, { "docid": "b5da7afe20c35026609597e8db7558b4", "score": "0.65929615", "text": "render(){\n super.render();\n }", "title": "" }, { "docid": "b5da7afe20c35026609597e8db7558b4", "score": "0.65929615", "text": "render(){\n super.render();\n }", "title": "" }, { "docid": "7e2a94854524f993ba2c1f5e9191a042", "score": "0.65535915", "text": "render() {\n this.initialize();\n this.initRender();\n this.wireEvents();\n this.setZindex();\n }", "title": "" }, { "docid": "0ac86a938c3f306900cfc912a2244a87", "score": "0.654957", "text": "render() {\n\t\tlet that = this;\n\t\tfor (let i=0; i<this.items.length; i++) {\n\t\t\tlet itm = this.items[i];\n\t\t var tmpl = document.querySelector(this.templateId);\n\t\t\tvar clone = document.importNode(tmpl.content, true);\n\t\t\tclone.querySelector(this.labelPath).innerHTML = itm.label;\n\t\t\tif ( this.selected != null ) {\n\t\t\t\tif ( this.selected.name == itm.name ) {\n\t\t\t\t\tclone.querySelector(this.selectedPath).classList.add(this.selectedClass);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( this.selectHandler != null ) {\n\t\t\t\tclone.querySelector(this.clickPath).onclick = function(){\n\t\t\t\t\tthat.selected = itm;\n\t\t\t\t\tthat.selectHandler(itm);\n\t\t\t\t};\n\t\t\t}\n\t\t\tdocument.querySelector(this.domId).appendChild(clone);\n\t\t}\n\n\t}", "title": "" }, { "docid": "a6f9d490a73a21a668ce6e2a1f299ffb", "score": "0.6546281", "text": "renderElement(elem, pos, len){\n\t\tif ('groups' in this.state.nodes[elem]){\n\t\t\treturn(//GROUP\n\t\t\t\tthis.renderGroup(elem, pos, len)\n\t\t\t)\n\t\t}else{//GROUPITEM\n\t\t\treturn(\n\t\t\t\tthis.renderItem(elem,pos,len)\n\t\t\t)\n\t\t}\n\t}", "title": "" }, { "docid": "96a3a23e7ad41883decca999255b9da2", "score": "0.6546252", "text": "function render() {\r\n\t\t\t\t\tisRendered = true;\r\n\t\t\t\t\trenderSource();\r\n\t\t\t\t}", "title": "" }, { "docid": "9f65ccc5f39304837c47c5aa9b202c06", "score": "0.6545836", "text": "render() {\n return super.render();\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.65425396", "text": "render() {\n\n }", "title": "" }, { "docid": "1a4933b849821343f3b190089f3b50e8", "score": "0.6537943", "text": "render() {\n return <div className=\"border red\">{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "c783cd8da152cd50fabc9aa135b747a7", "score": "0.6533428", "text": "render() {\n // Empty parent element\n\n\n // Create and render a new form\n\n // Append puppy list element to parent (in a wrapper div)\n\n }", "title": "" }, { "docid": "075d62fb457e856ad437ce49956192a5", "score": "0.6529488", "text": "render() {\n this.DOM = document.querySelector(this.selector);\n\n const HTML = `<h1>TOP 5</h1>\n <div class=\"results\">${this.generateTableList()}</div>`;\n\n this.DOM.innerHTML = HTML;\n }", "title": "" }, { "docid": "4b36efe39f811fb609e4e040c9cc3b16", "score": "0.65293753", "text": "function render() {\n // Set up the story\n $('#story').val('');\n $('#story').val(input[idx]);\n\n // Set up the text area\n $('#text-area').val(descriptions[idx]);\n\n // Refresh the counter\n $('.counter-top').text(idx + 1);\n $('.counter-bottom').text(input.length);\n\n // If the UI is enabled, enable or disable the buttons depending on\n // the index.\n if (enabled) {\n var prev_btn = $('#prev-btn');\n var next_btn = $('#next-btn');\n prev_btn.prop('disabled', true);\n next_btn.prop('disabled', true);\n if (idx > 0) {\n prev_btn.prop('disabled', false);\n }\n if (idx < input.length - 1) next_btn.prop('disabled', false);\n }\n }", "title": "" }, { "docid": "fdcfea16fdfc00da71b3d63be865fcdc", "score": "0.6529293", "text": "render() {\n return(\n <div className=\"display\">\n {this.renderContent()}\n </div>\n )\n \n }", "title": "" }, { "docid": "7af7a0d09a3a9c5af4b8b34eca76e8e0", "score": "0.65284157", "text": "renderChildElements() {\n return null;\n }", "title": "" }, { "docid": "741843df26e190e09f4f152d47022536", "score": "0.6520618", "text": "render() {\n console.log('render start')\n return (\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n );\n }", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.6517075", "text": "function render() {\n\n}", "title": "" }, { "docid": "7367ed49a0d43011b560e5cffea6d2d0", "score": "0.6516881", "text": "function render()\n\t{\n\t\trenderLastDefense();\n\t\trenderPlayer();\n\t\trenderMissiles();\n\t\trenderBoss();\n\t\trenderExplosions();\n\t\trenderUI();\n\t}", "title": "" }, { "docid": "c6486a06ee28c9fe946e9dfebd543cca", "score": "0.65075874", "text": "function render() {\n\n renderCards();\n\n renderValue();\n}", "title": "" }, { "docid": "d1f66b4d4f2ef4597d51881e21e49873", "score": "0.65050983", "text": "render () {\n\n }", "title": "" }, { "docid": "4ebc818606cb534b313b5d19e8fa02b0", "score": "0.6505035", "text": "render() {\n\n return(\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n )\n }", "title": "" }, { "docid": "d17fe598c1ae4cdf7990d49f1efb16b0", "score": "0.6495188", "text": "function render() {\n utils.updateDom(\"root\", template.contact);\n }", "title": "" }, { "docid": "90112c89a0cb81a6907ccebee52f15e7", "score": "0.64944756", "text": "render() {\n // make a new empty div with id frame, not yet in the dom\n let frame = document.createElement('div');\n $(frame).attr('id', 'frame');\n\n // insert a h2 node for the title\n let title = document.createElement('h2');\n $(title).text(this.title);\n frame.appendChild(title);\n\n // insert a h5 node for the header1\n let header = document.createElement('h5');\n $(header).text('When to do this activity');\n frame.appendChild(header);\n\n // insert a p node for the content of header1\n let content = document.createElement('p');\n $(content).text(this.text);\n frame.appendChild(content);\n\n // insert graphic\n if (this.graphic.length > 0) {\n var graphic = document.createElement('img');\n graphic.setAttribute('src', this.graphic);\n graphic.setAttribute('height', '228');\n frame.appendChild(graphic);\n }\n \n let old_frame = $('#frame')[0];\n old_frame.replaceWith(frame);\n }", "title": "" }, { "docid": "53cc813e7f0ef3b99256bba4a6f43e5d", "score": "0.64935106", "text": "function render(controller) {\n document.getElementById('main').innerHTML = controller.generateHTML();\n addClickListeners(controller);\n highlightCurrentBoard(controller);\n changeBoardMenuVisibility(controller);\n changeEditableTaskCardVisibility(controller);\n setCurrentBoardSize(controller);\n} // end render", "title": "" }, { "docid": "e2145b768cf0f7dda820b591f1f5df91", "score": "0.6491837", "text": "render() {\n return html`\n <div>\n Soy otro elemento\n </div>\n `;\n }", "title": "" }, { "docid": "4306e2df2df23efb4ad48a1f5c8a6eeb", "score": "0.6486722", "text": "function render() {\n // de redux.html\n const $container = document.getElementById('playlist');\n // constante de estado store.metodo getState obtener la lista de informacion\n const playlist = store.getState();\n // borrar todo lo que haya dentro del contenedor antes de iterar\n $container.innerHTML = '';\n // Imprimir la iteracion de los datos\n playlist.forEach((item) => {\n // crear etiqueta\n const template = document.createElement('p');\n // textContent es una propiedad recibira el title de initialState\n template.textContent = item.title;\n // appenChild añadir nuevos hijos html\n $container.appendChild(template);\n })\n}", "title": "" }, { "docid": "d248db92734ccd2e182d292dc749965f", "score": "0.6484936", "text": "async render(){\n\n\t\tlet view = await this.loadTemplate(this.getView());\n\t\tpage.components = [];\n\n\t\t$(\"#content\").html(view);\n\n\n\t\tfor (let [key, component] of Object.entries(this.getComponents())) {\n\t\t\ttry{\n\n\t\t\t\tcomponent.render(key);\n\t\t\t}catch(err){\n\t\t\t\tconsole.error(err);\n\t\t\t\tnew ErrorComponent(err).render(key);\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "e5bad7621e9deea1ba58dab988c297b3", "score": "0.6475728", "text": "render() {\n this.set_background();\n\n // make a new empty div with id frame, not yet in the dom\n let frame = document.createElement('div'); \n $(frame).attr('id', 'frame');\n\n // insert a h2 node for the title\n let title = document.createElement('h5');\n $(title).text(this.title);\n $(title).attr('class', 'text-info text-uppercase');\n frame.appendChild(title);\n\n let flex_div = document.createElement('div');\n $(flex_div).attr('class', 'summary_flex');\n frame.appendChild(flex_div);\n\n // if there is a graphic, make a two-column layout and put the graphic on the left. \n if (this.has_graphic) {\n let graphic_col = document.createElement('div');\n $(graphic_col).attr('class', 'summary_graphic');\n let graphic_img = document.createElement('img');\n $(graphic_img).attr('src', this.graphic);\n $(graphic_img).attr('class', 'summary_img');\n graphic_col.appendChild(graphic_img);\n flex_div.appendChild(graphic_col);\n }\n \n // If no graphic, match list text will be the whole width.\n let text_col = document.createElement('div');\n $(text_col).attr('class', 'summary_body');\n flex_div.appendChild(text_col);\n\n let instruction = document.createElement('h2');\n $(instruction).text(this.instruction);\n $(instruction).attr('class', 'font-weight-light mb-4');\n text_col.appendChild(instruction);\n\n // insert at text node for the description\n let description = document.createElement('div');\n $(description).html(this.description);\n $(description).attr('class', 'font-weight-light mb-4');\n text_col.appendChild(description);\n\n let emotion_list = this.render_emotion_list();\n text_col.appendChild(emotion_list);\n\n let follow_text = document.createElement('div');\n $(follow_text).text(this.follow_text);\n $(follow_text).attr('class', 'font-weight-light');\n text_col.appendChild(follow_text);\n\n let old_frame = $('#frame')[0];\n old_frame.replaceWith(frame);\n }", "title": "" }, { "docid": "6512f7fbee450d2cde3dadef8bbc1c4d", "score": "0.6467436", "text": "render() {\n\t\tif (!this.component_.element) {\n\t\t\tthis.component_.element = document.createElement('div');\n\t\t}\n\t}", "title": "" }, { "docid": "bb305915fd837a8b59eeab998cf738b1", "score": "0.64672047", "text": "renderUI () {\n let indexMin = this.currentIndexMin;\n let indexMax = this.currentIndexMax;\n\n this.ctx.clearRect(0, 0, this.ctxWidth, this.bigCtxHeight + this.smallCtxHeight + this.canvasIndent + 30);\n this.ctx.save();\n this.ctx.lineWidth = 2;\n var data = this.renderGraphList(this.visibleNames, this.x, this.y, this.ctxWidth, this.bigCtxHeight, indexMin, indexMax, 4, this.currentMultiplierBig);\n data.targetIndexMin = this.targetIndexMin;\n data.targetIndexMax = this.targetIndexMax;\n data.currentMultiplier = this.currentMultiplierBig;\n data.targetMultiplier = this.targetMultiplierBig;\n this.inscriptionRender.setData(data);\n this.inscriptionRender.repaint();\n this.ctx.restore();\n\n this.renderGraphList(this.visibleNames, this.x, this.smallY, this.ctxWidth, this.smallCtxHeight, 0, this.xAxis.length - 1, 2);\n }", "title": "" }, { "docid": "b5c1ae356522f027b4482cc54d40a3d3", "score": "0.64614487", "text": "render(ctx) {}", "title": "" }, { "docid": "63bf726650dce353e16c1253fb129db6", "score": "0.6456897", "text": "function _render() {\n list.innerHTML = template(menuItems);\n }", "title": "" }, { "docid": "3d53879c342828fe7a1251bec48fe4d8", "score": "0.64566857", "text": "function render() {\n\t// Current Pickaxe\n\tdocument.querySelector('#pickaxe').textContent = stats.pickaxe.name;\n\n\t// Buy Pickaxe Button\n\tlet nextPickaxe = document.querySelector('#nextPickaxe');\n\tlet pickaxeDetails = document.querySelector('#pickaxeDetails');\n\tswitch (stats.pickaxe) {\n\t\tcase pickaxes.WOODEN:\n\t\t\tnextPickaxe.textContent = pickaxes.STONE.name.toUpperCase();\n\t\t\tpickaxeDetails.textContent = pickaxes.STONE.details;\n\t\t\tbreak;\n\t\tcase pickaxes.STONE:\n\t\t\tbreak;\n\t}\n\n\t// Money\n\tdocument.querySelector('#moneyAmt').textContent = inv.money;\n\n\t// Mining Amounts\n\tdocument.querySelector('#miningAmtStone').textContent =\n\t\tstats.miningAmounts.stone;\n\tdocument.querySelector('#miningAmtCoal').textContent =\n\t\tstats.miningAmounts.coal;\n\n\t// Inventory Items\n\tswitch (stats.pickaxe) {\n\t\tcase pickaxes.STONE:\n\t\t\tdocument.getElementById('coal').style.display = 'unset';\n\t\t\tdocument.querySelector('#coalAmt').textContent = inv.coal;\n\t\tcase pickaxes.WOODEN:\n\t\t\tdocument.querySelector('#stoneAmt').textContent = inv.stone;\n\t}\n\n\trenderNextPickaxe();\n}", "title": "" }, { "docid": "c7398d23ae42dffa6634fa494fca9924", "score": "0.645551", "text": "_render() {\n this.partContainer = this.container.group();\n\n // Renders each part of the charset into the part container.\n return Promise.all(_.map(this.elements,\n part => part.render(this.partContainer.group())\n ))\n .then(() => {\n // Space the parts of the charset vertically in the part container.\n util.spaceVertically(this.elements, {\n padding: 5\n });\n\n // Label the part container.\n return this.renderLabeledBox(this.label, this.partContainer, {\n padding: 5\n });\n });\n }", "title": "" }, { "docid": "3995c9e4c8225348eed7c09a935c0423", "score": "0.6454482", "text": "render() {\n\n // sebelum merender kita harus mengecheck property dari \n // object components nya (1:5)\n\n // mengecheck semua property dari components\n for (let $property of this.property_basic) {\n\n // melakukan pengechekan (1:6)\n if (!(this.components.hasOwnProperty($property))) {\n\n console.warn(`cannot find the property ${$property}`);\n\n }\n\n if ($property === \"element\") {\n // membuat element dari object components (1:8)\n this.parent = document.createElement(this.components[$property])\n\n }\n\n if ($property === \"inner\") {\n\n // membuat inner dari object dan memasukan nya ke dalam element\n // (1:9)\n if (this.parent instanceof HTMLElement) this.parent.append(this.components[$property].replace(/\\\"/igm, \"\"));\n\n }\n\n if ($property === \"attribute\") {\n\n // mengecheck apakah attribute nya merupakan array\n // kemudian mengecheck apakah attribute nya berupa object\n // dan melakukan check dari variabel property_attribute (1:10)\n\n if (this.components[$property] instanceof Array) {\n\n for (let $child_attr of this.components[$property]) {\n\n for (let $child_attr_value in $child_attr) {\n\n this.parent.setAttribute($child_attr_value, $child_attr[$child_attr_value].value);\n\n }\n\n }\n\n }\n\n\n }\n\n if ($property === \"child\") {\n\n // mengecheck apakah child nya merupakan array\n // kemudian mengecheck apakah child nya berupa object\n // dan rekrusif fungsi (1:12)\n\n if (this.components[$property] instanceof Array) {\n\n for (let $child of this.components[$property]) {\n\n new draw($child, this.parent).render();\n\n }\n\n }\n\n }\n\n }\n\n // // mendaftarkan jika inner berisi bind value (1:15)\n if (/\\{.*?\\}/igm.test(this.parent.innerHTML)) {\n\n // variabel binding (1:16)\n let bind = this.parent.innerHTML.match(/\\{.*?\\}/igm);\n\n this.binding.push({\n element: this.parent,\n bind,\n inner: this.parent.innerHTML\n });\n\n }\n\n // merender element yang telah di buat ke dalam element target\n if (this.parent.nodeName !== \"CONFIG\") {\n this.target.appendChild(this.parent)\n }\n\n this.parents = this.parent;\n\n\n }", "title": "" }, { "docid": "889238afae22372d08c3b882c48e2950", "score": "0.6449586", "text": "function renderUI () {\n renderLifeBar();\n renderGemBar();\n renderTimer();\n }", "title": "" } ]
960dfa39908904d1762177b3d71fbbd0
encode method ABI object with values in an array, output bytecode
[ { "docid": "0592cb93c38fb2ba4803f52b0abd346f", "score": "0.59556973", "text": "function encodeMethod(method, values) {\n var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + signatureEncoded + paramsEncoded;\n}", "title": "" } ]
[ { "docid": "6586ee4ad1bb01b97bbc1291f11a32f6", "score": "0.6046841", "text": "function encodeMethod(method, values) {\n\t var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n\t var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n\t var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n\t return '' + signatureEncoded + paramsEncoded;\n\t}", "title": "" }, { "docid": "3eba7d4ed78e640c6ba603b6ad62de25", "score": "0.60306853", "text": "function encodeAbi(input, allocations) {\n //errors can't be encoded\n if (input.kind === \"error\") {\n return undefined;\n }\n let bytes;\n //TypeScript can at least infer in the rest of this that we're looking\n //at a value, not an error! But that's hardly enough...\n switch (input.type.typeClass) {\n case \"mapping\":\n case \"magic\":\n case \"type\":\n //none of these can go in the ABI\n return undefined;\n case \"bytes\":\n switch (input.type.kind) {\n case \"static\":\n return Basic.Encode.encodeBasic(input);\n case \"dynamic\":\n bytes = Bytes.Encode.encodeBytes((input));\n return padAndPrependLength(bytes);\n }\n case \"string\":\n bytes = Bytes.Encode.encodeBytes(input);\n return padAndPrependLength(bytes);\n case \"function\": {\n switch (input.type.visibility) {\n case \"internal\":\n return undefined; //internal functions can't go in the ABI!\n //Yes, technically we could defer to encodeBasic here, but,\n //c'mon, that's not how the function's supposed to be used\n case \"external\":\n return Basic.Encode.encodeBasic(input);\n }\n }\n //now for the serious cases\n case \"array\": {\n let coercedInput = (input);\n if (coercedInput.reference !== undefined) {\n return undefined; //circular values can't be encoded\n }\n let staticEncoding = encodeTupleAbi(coercedInput.value, allocations);\n switch (input.type.kind) {\n case \"static\":\n return staticEncoding;\n case \"dynamic\":\n let encoded = new Uint8Array(Evm.Utils.WORD_SIZE + staticEncoding.length); //leave room for length\n encoded.set(staticEncoding, Evm.Utils.WORD_SIZE); //again, leave room for length beforehand\n let lengthBytes = Conversion.toBytes(coercedInput.value.length, Evm.Utils.WORD_SIZE);\n encoded.set(lengthBytes); //and now we set the length\n return encoded;\n }\n }\n case \"struct\": {\n let coercedInput = (input);\n if (coercedInput.reference !== undefined) {\n return undefined; //circular values can't be encoded\n }\n return encodeTupleAbi(coercedInput.value.map(({ value }) => value), allocations);\n }\n case \"tuple\":\n //WARNING: This case is written in a way that involves a bunch of unnecessary recomputation!\n //(That may not be apparent from this one line, but it's true)\n //I'm writing it this way anyway for simplicity, to avoid rewriting the encoder\n //However it may be worth revisiting this in the future if performance turns out to be a problem\n return encodeTupleAbi(input.value.map(({ value }) => value), allocations);\n default:\n return Basic.Encode.encodeBasic(input);\n }\n}", "title": "" }, { "docid": "03eda2670394f5fa025be7bf3b32ab6e", "score": "0.5952933", "text": "constructor(abiArray) {\n this.abiArray = abiArray;\n this.methodIDs = {};\n if (Array.isArray(this.abiArray)) {\n // Iterate new abi to generate method id's\n this.abiArray.forEach((abi) => {\n if (abi.type === 'constructor') {\n this.methodIDs.constructor = abi;\n return this.methodIDs.constructor;\n } else if (abi.name) {\n const signature = sha3(`${abi.name}(${abi.inputs.map(input => input.type).join(',')})`);\n if (abi.type === 'event') {\n this.methodIDs[signature] = abi;\n return this.methodIDs[signature];\n }\n this.methodIDs[signature.slice(0, 8)] = abi;\n return this.methodIDs[signature.slice(0, 8)];\n }\n return null;\n });\n } else {\n throw new Error(`Expected ABI array, got ${typeof abiArray}`);\n }\n }", "title": "" }, { "docid": "aad61b56900f35a833243d57525c630e", "score": "0.5741446", "text": "function encodeMethod$1(method, values) {\n var paramsEncoded = encodeParams$1(utils$1.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + encodeSignature(method) + paramsEncoded;\n}", "title": "" }, { "docid": "4300bc2c29a4813e848f0a5ae0a6eceb", "score": "0.55400056", "text": "abiJSONToBin(code, action, args) {\n return this.CALL(mtd_1.EOSModules.chain, mtd_1.EOSMethods.chain.atob, {\n action,\n args,\n code\n });\n }", "title": "" }, { "docid": "f41c34cc4da2bd4bb65320a10964f881", "score": "0.54680586", "text": "function getBytecode() {\n console.log(web3.eth.getCode(crowdsale.address));\n//\"0x\"\n//data: '0x' + bytecode\n}", "title": "" }, { "docid": "f41c34cc4da2bd4bb65320a10964f881", "score": "0.54680586", "text": "function getBytecode() {\n console.log(web3.eth.getCode(crowdsale.address));\n//\"0x\"\n//data: '0x' + bytecode\n}", "title": "" }, { "docid": "0111ea5c51caaf97a86e5543dd2666e3", "score": "0.54628617", "text": "function _agb_opcodes() {\n\tthis.bytecodes = \"\";\n\tthis.count = 0;\n\tthis.pc = 0;\n\tthis.op_vm_half = function() {\n\t\tthis.op(_AGB_GP_VM, _AGB_OP_VM_HALF);\n\t};\n\tthis.op_vm_gc = function() {\n\t\tthis.op(_AGB_GP_VM, _AGB_OP_VM_GC);\n\t};\n\tthis.op_stack_push = function(count) {\n\t\tif (count > 0) {\n\t\t\tthis.opd(_AGB_GP_STACK, _AGB_OP_STACK_PUSH, count);\n\t\t\tthis.count += count;\n\t\t}\n\t};\n\tthis.op_stack_pop = function(count) {\n\t\tif (count > 0) {\n\t\t\tthis.opd(_AGB_GP_STACK, _AGB_OP_STACK_POP, count);\n\t\t\tthis.count -= count;\n\t\t}\n\t};\n\tthis.op_stack_dup = function(index) {\n\t\tthis.op_stack_dup_abs(index + this.count);\n\t};\n\tthis.op_stack_dup_abs = function(index) {\n\t\tthis.op_stack_load_abs(index);\n\t};\n\tthis.op_stack_load = function(index) {\n\t\tthis.op_stack_load_abs(index + this.count);\n\t};\n\tthis.op_stack_load_abs = function(index) {\n\t\tthis.opd(_AGB_GP_STACK, _AGB_OP_STACK_LOAD, index);\n\t\tthis.count++;\n\t};\n\tthis.op_stack_store = function(index) {\n\t\tthis.op_stack_store_abs(index + this.count);\n\t};\n\tthis.op_stack_store_abs = function(index) {\n\t\tthis.opd(_AGB_GP_STACK, _AGB_OP_STACK_STORE, index);\n\t\tthis.count--;\n\t};\n\tthis.op_stack_int = function(index) {\n\t\tthis.opd(_AGB_GP_STACK, _AGB_OP_STACK_INT, index);\n\t\tthis.count++;\n\t};\n\tthis.op_def_num = function(value) {\n\t\tvar text = value.toString();\n\t\tthis.opd(_AGB_GP_DEF, _AGB_OP_DEF_NUM, text);\n\t\tthis.op1(text.indexOf(\".\") - 1);\n\t\tthis.opstr(text);\n\t};\n\tthis.op_def_str = function(value) {\n\t\tthis.opd(_AGB_GP_DEF, _AGB_OP_DEF_STR, value.length);\n\t\tthis.opstr(value);\n\t};\n\tthis.op_def_class = function(c) {\n\t\tthis.op(_AGB_GP_DEF, _AGB_OP_DEF_CLASS);\n\t\tthis.op1(c.id);\n\t\tthis.op1(c.fields.length);\n\t};\n\tthis.op_def_cast = function() {\n\t\tthis.op(_AGB_GP_DEF, _AGB_OP_DEF_CAST);\n\t};\n\tthis.op_def_num_len = function(count) {\n\t\tthis.opd(_AGB_GP_DEF, _AGB_OP_DEF_NUM_LEN, count);\n\t};\n\tthis.op_def_str_len = function(count) {\n\t\tthis.opd(_AGB_GP_DEF, _AGB_OP_DEF_STR_LEN, count);\n\t};\n\tthis.op_def_cast_len = function(count) {\n\t\tthis.opd(_AGB_GP_DEF, _AGB_OP_DEF_CAST_LEN, count);\n\t};\n\tthis.op_def_class_len = function(count) {\n\t\tthis.opd(_AGB_GP_DEF, _AGB_OP_DEF_CLASS_LEN, count);\n\t};\n\tthis.op_load_true = function() {\n\t\tthis.op(_AGB_GP_LOAD, _AGB_OP_LOAD_TRUE);\n\t\tthis.count++;\n\t};\n\tthis.op_load_false = function() {\n\t\tthis.op(_AGB_GP_LOAD, _AGB_OP_LOAD_FALSE);\n\t\tthis.count++;\n\t};\n\tthis.op_load_num = function(index) {\n\t\tthis.opd(_AGB_GP_LOAD, _AGB_OP_LOAD_NUM, index);\n\t\tthis.count++;\n\t};\n\tthis.op_load_str = function(index) {\n\t\tthis.opd(_AGB_GP_LOAD, _AGB_OP_LOAD_STR, index);\n\t\tthis.count++;\n\t};\n\tthis.op_load_null = function() {\n\t\tthis.op(_AGB_GP_LOAD, _AGB_OP_LOAD_NULL);\n\t\tthis.count++;\n\t};\n\tthis.op_load_new = function(id) {\n\t\tthis.op(_AGB_GP_LOAD, _AGB_OP_LOAD_NEW);\n\t\tthis.op1(id);\n\t\tthis.count++;\n\t};\n\tthis.op_jump_stack = function() {\n\t\tthis.op(_AGB_GP_JUMP, _AGB_OP_JUMP_STACK);\n\t};\n\tthis.op_jump_int_next = function(index) {\n\t\tthis.op_jump_int(index + this.pc + 3);\n\t};\n\tthis.op_jump_int = function(index) {\n\t\tthis.opd(_AGB_GP_JUMP, _AGB_OP_JUMP_INT, index);\n\t};\n\tthis.op_jump_true_next = function(index) {\n\t\tthis.op_jump_true(index + this.pc + 3);\n\t};\n\tthis.op_jump_false_next = function(index) {\n\t\tthis.op_jump_false(index + this.pc + 3);\n\t};\n\tthis.op_jump_true = function(index) {\n\t\tthis.opd(_AGB_GP_JUMP, _AGB_OP_JUMP_TRUE, index);\n\t\tthis.count--;\n\t};\n\tthis.op_jump_false = function(index) {\n\t\tthis.opd(_AGB_GP_JUMP, _AGB_OP_JUMP_FALSE, index);\n\t\tthis.count--;\n\t};\n\tthis.op_jump_call = function(index) {\n\t\tthis.opd(_AGB_GP_JUMP, _AGB_OP_JUMP_CALL, index);\n\t};\n\tthis.op_jump_return = function(count) {\n\t\tthis.opd(_AGB_GP_JUMP, _AGB_OP_JUMP_RETURN, count);\n\t};\n\tthis.op_equal = function(left) {\n\t\tvar type = left.type;\n\t\tif (type.is_number()) {\n\t\t\tthis.op_num_equal();\n\t\t} else if (type.is_string()) {\n\t\t\tthis.op_str_equal();\n\t\t} else if (type.is_boolean()) {\n\t\t\tthis.op_bool_equal();\n\t\t} else {\n\t\t\tthrow new _agb_semantic_error(left.token, \"illegal operator\");\n\t\t}\n\t};\n\tthis.op_nequal = function(left) {\n\t\tvar type = left.type;\n\t\tif (type.is_number()) {\n\t\t\tthis.op_num_nequal();\n\t\t} else if (type.is_string()) {\n\t\t\tthis.op_str_nequal();\n\t\t} else if (type.is_boolean()) {\n\t\t\tthis.op_bool_nequal();\n\t\t} else {\n\t\t\tthrow new _agb_semantic_error(left.token, \"illegal operator\");\n\t\t}\n\t};\n\tthis.op_gt = function(left) {\n\t\tvar type = left.type;\n\t\tif (type.is_number()) {\n\t\t\tthis.op_num_gt();\n\t\t} else if (type.is_string()) {\n\t\t\tthis.op_str_gt();\n\t\t} else {\n\t\t\tthrow new _agb_semantic_error(left.token, \"illegal operator\");\n\t\t}\n\t};\n\tthis.op_egt = function(left) {\n\t\tvar type = left.type;\n\t\tif (type.is_number()) {\n\t\t\tthis.op_num_egt();\n\t\t} else if (type.is_string()) {\n\t\t\tthis.op_str_egt();\n\t\t} else {\n\t\t\tthrow new _agb_semantic_error(left.token, \"illegal operator\");\n\t\t}\n\t};\n\tthis.op_lt = function(left) {\n\t\tvar type = left.type;\n\t\tif (type.is_number()) {\n\t\t\tthis.op_num_lt();\n\t\t} else if (type.is_string()) {\n\t\t\tthis.op_str_lt();\n\t\t} else {\n\t\t\tthrow new _agb_semantic_error(left.token, \"illegal operator\");\n\t\t}\n\t};\n\tthis.op_elt = function(left) {\n\t\tvar type = left.type;\n\t\tif (type.is_number()) {\n\t\t\tthis.op_num_elt();\n\t\t} else if (type.is_string()) {\n\t\t\tthis.op_str_elt();\n\t\t} else {\n\t\t\tthrow new _agb_semantic_error(left.token, \"illegal operator\");\n\t\t}\n\t};\n\tthis.op_bool_not = function() {\n\t\tthis.op(_AGB_GP_BOOL, _AGB_OP_BOOL_NOT);\n\t};\n\tthis.op_bool_or = function() {\n\t\tthis.op(_AGB_GP_BOOL, _AGB_OP_BOOL_OR);\n\t\tthis.count--;\n\t};\n\tthis.op_bool_and = function() {\n\t\tthis.op(_AGB_GP_BOOL, _AGB_OP_BOOL_AND);\n\t\tthis.count--;\n\t};\n\tthis.op_bool_equal = function() {\n\t\tthis.op(_AGB_GP_BOOL, _AGB_OP_BOOL_EQUAL);\n\t\tthis.count--;\n\t};\n\tthis.op_bool_nequal = function() {\n\t\tthis.op(_AGB_GP_BOOL, _AGB_OP_BOOL_NEQUAL);\n\t\tthis.count--;\n\t};\n\tthis.op_bool_to_str = function() {\n\t\tthis.op(_AGB_GP_BOOL, _AGB_OP_BOOL_TO_STR);\n\t};\n\tthis.op_num_neg = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_NEG);\n\t};\n\tthis.op_num_sum = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_SUM);\n\t\tthis.count--;\n\t};\n\tthis.op_num_sub = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_SUB);\n\t\tthis.count--;\n\t};\n\tthis.op_num_mul = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_MUL);\n\t\tthis.count--;\n\t};\n\tthis.op_num_div = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_DIV);\n\t\tthis.count--;\n\t};\n\tthis.op_num_equal = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_EQUAL);\n\t\tthis.count--;\n\t};\n\tthis.op_num_nequal = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_NEQUAL);\n\t\tthis.count--;\n\t};\n\tthis.op_num_gt = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_GT);\n\t\tthis.count--;\n\t};\n\tthis.op_num_egt = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_EGT);\n\t\tthis.count--;\n\t};\n\tthis.op_num_lt = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_LT);\n\t\tthis.count--;\n\t};\n\tthis.op_num_elt = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_ELT);\n\t\tthis.count--;\n\t};\n\tthis.op_num_to_str = function() {\n\t\tthis.op(_AGB_GP_NUM, _AGB_OP_NUM_TO_STR);\n\t};\n\tthis.op_str_len = function() {\n\t\tthis.op(_AGB_GP_STR, _AGB_OP_STR_LEN);\n\t};\n\tthis.op_str_sum = function() {\n\t\tthis.op(_AGB_GP_STR, _AGB_OP_STR_SUM);\n\t\tthis.count--;\n\t};\n\tthis.op_str_equal = function() {\n\t\tthis.op(_AGB_GP_STR, _AGB_OP_STR_EQUAL);\n\t\tthis.count--;\n\t};\n\tthis.op_str_nequal = function() {\n\t\tthis.op(_AGB_GP_STR, _AGB_OP_STR_NEQUAL);\n\t\tthis.count--;\n\t};\n\tthis.op_str_gt = function() {\n\t\tthis.op(_AGB_GP_STR, _AGB_OP_STR_GT);\n\t\tthis.count--;\n\t};\n\tthis.op_str_egt = function() {\n\t\tthis.op(_AGB_GP_STR, _AGB_OP_STR_EGT);\n\t\tthis.count--;\n\t};\n\tthis.op_str_lt = function() {\n\t\tthis.op(_AGB_GP_STR, _AGB_OP_STR_LT);\n\t\tthis.count--;\n\t};\n\tthis.op_str_elt = function() {\n\t\tthis.op(_AGB_GP_STR, _AGB_OP_STR_ELT);\n\t\tthis.count--;\n\t};\n\tthis.op1 = function(value) {\n\t\tthis.bytecodes += this.write32(value);\n\t\tthis.pc++;\n\t};\n\tthis.opstr = function(text) {\n\t\tvar result = \"\";\n\t\tvar len = text.length;\n\t\tfor ( var n = 0; n < len; n++) {\n\t\t\tvar c1 = null, c2 = null, c3 = null, c4 = null;\n\t\t\tif (n * 4 < len) {\n\t\t\t\tc1 = text[n * 4];\n\t\t\t}\n\t\t\tif (n * 4 + 1 < len) {\n\t\t\t\tc2 = text[n * 4 + 1];\n\t\t\t}\n\t\t\tif (n * 4 + 2 < len) {\n\t\t\t\tc3 = text[n * 4 + 2];\n\t\t\t}\n\t\t\tif (n * 4 + 3 < len) {\n\t\t\t\tc4 = text[n * 4 + 3];\n\t\t\t}\n\t\t\tthis.op1(c1 == null ? 0 : c1.charCodeAt(0));\n\t\t\tif (c1 == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.op1(c2 == null ? 0 : c2.charCodeAt(0));\n\t\t\tif (c2 == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.op1(c3 == null ? 0 : c3.charCodeAt(0));\n\t\t\tif (c3 == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.op1(c4 == null ? 0 : c4.charCodeAt(0));\n\t\t\tif (c4 == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t};\n\tthis.op = function(group, bytecode) {\n\t\tthis.op1(group);\n\t\tthis.op1(bytecode);\n\t};\n\tthis.opd = function(group, bytecode, data) {\n\t\tthis.op(group, bytecode);\n\t\tthis.bytecodes += this.write32(data);\n\t\tthis.pc += 1;\n\t};\n\tthis.write8 = function(byte) {\n\t\tvar hex = 'ABCDEFGHIJKLMNOP';\n\t\treturn (hex[(byte & 240) >> 4] + hex[byte & 15]);\n\t};\n\tthis.write16 = function(value) {\n\t\treturn this.write8((value & 65280) >> 8) + this.write8(value & 255);\n\t};\n\tthis.write32 = function(value) {\n\t\treturn this.write16((value & 4294901760) >> 16)\n\t\t\t\t+ this.write16(value & 65535);\n\t};\n}", "title": "" }, { "docid": "e365da8735e2be335edbfd745b1ac4a8", "score": "0.5451732", "text": "abiBinToJSON(code, action, binargs) {\n return this.CALL(mtd_1.EOSModules.chain, mtd_1.EOSMethods.chain.btoa, {\n action,\n binargs,\n code\n });\n }", "title": "" }, { "docid": "59e764b4bb3a7f0b7df53bf97757da8b", "score": "0.5402525", "text": "encodeArray(arr) {\n return this.encode(stringFromArray(arr));\n }", "title": "" }, { "docid": "0e9701c0252bb17dab7b0f38ce7409d1", "score": "0.5394213", "text": "function decodeMethod(method, data) {\n\t var outputNames = utils.getKeys(method.outputs, 'name', true);\n\t var outputTypes = utils.getKeys(method.outputs, 'type');\n\n\t return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n\t}", "title": "" }, { "docid": "7ebc0d5941ef8d580f5d445449fd8e71", "score": "0.53525114", "text": "encodeFunctionResult(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return Object(_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__[\"hexlify\"])(this._abiCoder.encode(functionFragment.outputs, values || []));\n }", "title": "" }, { "docid": "ae55bfa84648257859e729b8081c165f", "score": "0.5349555", "text": "getABI() {\n return this.abiArray;\n }", "title": "" }, { "docid": "c8ac8666c8ea823cec2b422be452dc27", "score": "0.53385556", "text": "encodeFunctionResult(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_7__.hexlify)(this._abiCoder.encode(functionFragment.outputs, values || []));\n }", "title": "" }, { "docid": "c8ac8666c8ea823cec2b422be452dc27", "score": "0.53385556", "text": "encodeFunctionResult(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_7__.hexlify)(this._abiCoder.encode(functionFragment.outputs, values || []));\n }", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "eead6ea303025e33996fd520670af0ea", "score": "0.53341895", "text": "function decodeMethod$1(method, data) {\n var outputNames = utils$1.getKeys(method.outputs, 'name', true);\n var outputTypes = utils$1.getKeys(method.outputs, 'type');\n\n return decodeParams$1(outputNames, outputTypes, utils$1.hexOrBuffer(data));\n}", "title": "" }, { "docid": "b90cb947645d374b180f1ddfe128f815", "score": "0.5327145", "text": "function Assembler() {\n\t\"use strict\";\n\n\tthis.assemble = function (assemblyString){\n\t\tvar assembly = assemblyString.split(\"\\n\");\n\t\tvar binary = new Int32Array();\n\t\tvar symbolTable = {};\t// Holds the line number of labels\n\n\t\t// First pass. Construct symbol table\n\t\tfor(var i = 0; i < assembly.length; i++){\n\t\t\tassembly[i] = assembly[i].split('#')[0].trim(); // remove comments and whitespace\n\t\t\tif (assembly[i] === '')\n\t\t\t\tcontinue;\n\n\t\t}\n\n\t\t// Second pass. Translate to binary.\n\t\tfor(i = 0; i < assembly.length; i++){\n\t\t\tvar line = assembly[i].replace(/,/g,' ').split(/\\s+/);\n\t\t\tswitch(line[0]){\n\t\t\t\tcase 'add':\n\t\t\t\tcase 'addi':\n\t\t\t\tcase 'addiu':\n\t\t\t\tcase 'addu':\n\t\t\t\tcase 'and':\n\t\t\t\tcase 'andi':\n\t\t\t\tcase 'beq':\n\t\t\t\tcase 'bgez':\n\t\t\t\tcase 'bgezal':\n\t\t\t\tcase 'bgtz':\n\t\t\t\tcase 'blez':\n\t\t\t\tcase 'bltz':\n\t\t\t\tcase 'bltzal':\n\t\t\t\tcase 'bne':\n\t\t\t\tcase 'div':\n\t\t\t\tcase 'divu':\n\t\t\t\tcase 'j':\n\t\t\t\tcase 'jal':\n\t\t\t\tcase 'jr':\n\t\t\t\tcase 'lb':\n\t\t\t\tcase 'lui':\n\t\t\t\tcase 'lw':\n\t\t\t\tcase 'mfhi':\n\t\t\t\tcase 'mflo':\n\t\t\t\tcase 'mult':\n\t\t\t\tcase 'multu':\n\t\t\t\tcase 'nop':\n\t\t\t\tcase 'noop':\n\t\t\t\tcase 'or':\n\t\t\t\tcase 'ori':\n\t\t\t\tcase 'sb':\n\t\t\t\tcase 'sll':\n\t\t\t\tcase 'sllv':\n\t\t\t\tcase 'slt':\n\t\t\t\tcase 'slti':\n\t\t\t\tcase 'sltiu':\n\t\t\t\tcase 'sltu':\n\t\t\t\tcase 'sra':\n\t\t\t\tcase 'srl':\n\t\t\t\tcase 'srlv':\n\t\t\t\tcase 'sub':\n\t\t\t\tcase 'subu':\n\t\t\t\tcase 'sw':\n\t\t\t\tcase 'syscall':\n\t\t\t\tcase 'xor':\n\t\t\t\tcase 'xori':\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow \"'\"+line[0]+\"' is not a valid instruction.\";\n\t\t\t}\n\n\t\t}\n\n\n\t\t/**\n\t\t * Supported instuctions:\n\t\t * \n\t\t */\n\n\t};\n}", "title": "" }, { "docid": "4662c9f621d90796a41cc554c19e4181", "score": "0.5293873", "text": "function _generateSwizzle(maxDepth, maxItems, array)\n{\n if (!array)\n array = [];\n if (array.length == maxDepth) {\n let result = `vec${array.length}<T> operator.${array.join(\"\")}<T>(vec${maxItems}<T> v)\n{\n vec${array.length}<T> result;\n`;\n for (let i = 0; i < array.length; ++i) {\n result += ` result.${intToString(i)} = v.${array[i]};\n`;\n }\n result += ` return result;\n}\n`;\n return result;\n }\n let result = \"\";\n for (let i = 0; i < maxItems; ++i) {\n array.push(intToString(i));\n result += _generateSwizzle(maxDepth, maxItems, array);\n array.pop();\n }\n return result;\n}", "title": "" }, { "docid": "95beeaa5f1720b91c7bbe881734f88ea", "score": "0.5285427", "text": "function abiEncode(value, typeName) {\n let type = types.get(typeName);\n if (!type) {\n throw new Error(`No such type: ${typeName}`);\n }\n let buf = new eosjs_1.Serialize.SerialBuffer();\n type.serialize(buf, value);\n return buf.asUint8Array();\n}", "title": "" }, { "docid": "d3bda3a201f967b228b2521b1851d8a0", "score": "0.52070826", "text": "function array(encoder, value) {\n var length = value.length;\n var type = (length < 16) ? (0x90 + length) : (length <= 0xFFFF) ? 0xdc : 0xdd;\n token[type](encoder, length);\n \n var encode = encoder.codec.encode;\n for (var i = 0; i < length; i++) {\n encode(encoder, value[i]);\n }\n }", "title": "" }, { "docid": "a5374378ed30bd7fdcbf02d74f9a5115", "score": "0.52060544", "text": "function toCode(values) {\n if (Array.isArray(values)) {\n return toCodeArray(values)\n }\n if (typeof values === \"object\") {\n return toCodeObject(values)\n }\n if (typeof values === \"string\" && !isRequire(values)) {\n return `\"${values}\"`\n }\n return `${values}`\n}", "title": "" }, { "docid": "1c4ffa55cc2d78f9ef63247a299537ba", "score": "0.5196542", "text": "function array(encoder, value) {\n\t var length = value.length;\n\t var type = (length < 16) ? (0x90 + length) : (length <= 0xFFFF) ? 0xdc : 0xdd;\n\t token[type](encoder, length);\n\t\n\t var encode = encoder.codec.encode;\n\t for (var i = 0; i < length; i++) {\n\t encode(encoder, value[i]);\n\t }\n\t }", "title": "" }, { "docid": "a90dfe98ae7ef964523285487f33ecdd", "score": "0.5157726", "text": "function encode(array) {\n let o = {};\n _.each(array, (item, index) => {\n o[`${index + 1}:args${index}`] = item;\n });\n return o;\n}", "title": "" }, { "docid": "6cb3726fd77dba4a11615a329244cd4e", "score": "0.5146196", "text": "function instruction(field, value, serializer) {\n return Buffer.concat([\n fieldBuffers[field], toBuffer(value, serializer), eolBuf\n ]);\n}", "title": "" }, { "docid": "4c496134fed117e2bbfa76abf73f1878", "score": "0.51365083", "text": "function encodeArray(array, proto, offset, buffer, protos){\n\tvar i = 0;\n\tif(util.isSimpleType(proto.type)){\n\t\toffset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));\n\t\toffset = writeBytes(buffer, offset, codec.encodeUInt32(array.length));\n\t\tfor(i = 0; i < array.length; i++){\n\t\t\toffset = encodeProp(array[i], proto.type, offset, buffer);\n\t\t}\n\t}else{\n\t\tfor(i = 0; i < array.length; i++){\n\t\t\toffset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));\n\t\t\toffset = encodeProp(array[i], proto.type, offset, buffer, protos);\n\t\t}\n\t}\n\n\treturn offset;\n}", "title": "" }, { "docid": "4fc83622741bd55f41de181c7409c7ea", "score": "0.5128951", "text": "static encode(domain, types, value) {\n return (0, index_js_4.concat)([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value)\n ]);\n }", "title": "" }, { "docid": "695774ebbc9484766f03e80651dd80ed", "score": "0.51085126", "text": "function array(encoder, value) {\n var length = value.length;\n var type = (length < 16) ? (0x90 + length) : (length <= 0xFFFF) ? 0xdc : 0xdd;\n token[type](encoder, length);\n\n var encode = encoder.codec.encode;\n for (var i = 0; i < length; i++) {\n encode(encoder, value[i]);\n }\n }", "title": "" }, { "docid": "e5d3754de8476f74164f8f18037fe576", "score": "0.5076709", "text": "function encode_arr(arr) {\n var arr_out = []\n for (let i of arr) {\n arr_out.push(encoder(i))\n }\n return arr_out\n}", "title": "" }, { "docid": "b2d1b2c5f727c70a716b453649aa442f", "score": "0.50753015", "text": "function encodeEvent$1(eventObject, values) {\n return encodeMethod$1(eventObject, values);\n}", "title": "" }, { "docid": "89d6cbdf05315688a81031ea892f16cf", "score": "0.5075277", "text": "encodeFunctionData(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return Object(_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__[\"hexlify\"])(Object(_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__[\"concat\"])([\n this.getSighash(functionFragment),\n this._encodeParams(functionFragment.inputs, values || [])\n ]));\n }", "title": "" }, { "docid": "82378d9836516f7ebf28f2a3ea7316ca", "score": "0.5069391", "text": "function methodToAbi(method) {\n var length = method.length;\n var typesStart = method.indexOf('(');\n var typesEnd = method.indexOf(')');\n\n if (typesStart === -1) {\n throw new Error('Missing start ( in call to decodeMethod with ' + method);\n } else if (typesEnd === -1) {\n throw new Error('Missing end ) in call to decodeMethod with ' + method);\n } else if (typesEnd < typesStart) {\n throw new Error('End ) is before start ( in call to decodeMethod with ' + method);\n } else if (typesEnd !== length - 1) {\n throw new Error('Extra characters after end ) in call to decodeMethod with ' + method);\n }\n\n var name = method.substr(0, typesStart);\n var types = method.substr(typesStart + 1, length - (typesStart + 1) - 1).split(',');\n var inputs = types.filter(function (_type) {return _type.length;}).map(function (_type) {\n var type = fromParamType(toParamType(_type));\n\n return { type: type };\n });\n\n return { type: 'function', name: name, inputs: inputs };\n}", "title": "" }, { "docid": "2f027933ebb611f03138db6ef74fd66c", "score": "0.5067766", "text": "encodeFunctionData(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_7__.hexlify)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_7__.concat)([\n this.getSighash(functionFragment),\n this._encodeParams(functionFragment.inputs, values || [])\n ]));\n }", "title": "" }, { "docid": "2f027933ebb611f03138db6ef74fd66c", "score": "0.5067766", "text": "encodeFunctionData(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return (0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_7__.hexlify)((0,_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_7__.concat)([\n this.getSighash(functionFragment),\n this._encodeParams(functionFragment.inputs, values || [])\n ]));\n }", "title": "" }, { "docid": "04036f2b2f9db5ed27c1050e9b2403f1", "score": "0.5039114", "text": "decodeArgs(method: ABIMethod, argData: string): Array<any> {\n // Remove method selector from data, if present\n argData = argData.replace(`0x${this.getMethodSelector(method)}`, '');\n // Convert argdata to a hex buffer for ethereumjs-abi\n const argBuffer = new Buffer(argData, 'hex');\n // Decode!\n return abi.rawDecode(this.getMethodTypes(method), argBuffer);\n }", "title": "" }, { "docid": "f0f354f851970d18ff7c925872e47de8", "score": "0.5034362", "text": "function $d1b55b8926880d84b69a83a791$var$decodeCodePointsArray(codePoints) {\n var len = codePoints.length;\n\n if (len <= $d1b55b8926880d84b69a83a791$var$MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints); // avoid extra slice()\n } // Decode in chunks to avoid \"call stack size exceeded\".\n\n\n var res = '';\n var i = 0;\n\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, i += $d1b55b8926880d84b69a83a791$var$MAX_ARGUMENTS_LENGTH));\n }\n\n return res;\n }", "title": "" }, { "docid": "c50d4db6a82977c096ceb4ecba46dd4f", "score": "0.5029838", "text": "function Module(stdlib, imports, buffer) {\n \"use asm\";\n var x = new stdlib.Int8Array(buffer);\n function f() {\n return x[0] | 0;\n }\n return { f:f };\n}", "title": "" }, { "docid": "1ec9d8cf4a38f5a28d09e56d29634c4b", "score": "0.50220186", "text": "function codeCreation (state) {\n return function (row, cb) {\n const [\n /* event */, tag, kind, ts, start, size, ...rest\n ] = row\n\n // Handler addresses get in the way,\n // causing unhelpful tick address resolution\n if (tag === 'Handler') {\n cb()\n return\n }\n\n var [name, func, cs] = rest\n if (name[0] === '\"') {\n name = name.substr(1, name.length - 2)\n }\n const type = !func && !cs ? 'CODE' : 'JS'\n const entry = {\n name,\n tag,\n ts,\n cs,\n type,\n [KIND]: kind,\n [START]: start,\n [SIZE]: size,\n [FUNC]: func\n }\n const addr = parseInt(start, 16)\n if (addr in state.code) {\n // nameless frame duplicates are essentially noise\n if (name === '') {\n cb()\n return\n }\n if (entry.name !== state.code[addr].name) {\n state.code[addr].alts = state.code[addr].alts || []\n if (state.code[addr].alts.indexOf(state.code[addr].name) === -1) {\n state.code[addr].alts.push(state.code[addr].name)\n }\n state.code[addr].name = entry.name\n }\n } else {\n state.code[addr] = entry\n sorted.add(state.addresses, addr)\n }\n if (func) {\n const addr = parseInt(func, 16)\n if (!(addr in state.code)) {\n state.code[addr] = entry\n sorted.add(state.addresses, addr)\n }\n }\n cb()\n }\n}", "title": "" }, { "docid": "684297f311a7531993a373efa7d9b15d", "score": "0.50207686", "text": "get value() { return [this.bits,this.val] }", "title": "" }, { "docid": "684297f311a7531993a373efa7d9b15d", "score": "0.50207686", "text": "get value() { return [this.bits,this.val] }", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" } ]
3e360a2e127f00d050b9f33717a99e0c
Creacion del objeto item
[ { "docid": "293bcf09f63fd42682839af261133601", "score": "0.0", "text": "function item(x,y,v){\r\n\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n\tthis.v = v;\r\n\tthis.color = \"red\";\r\n\tthis.number = Math.floor(Math.random() * 9) + 1;\r\n\r\n\tthis.dibuja = function(){\r\n\t\tthis.y -= -1*this.v;\r\n\t\tctx.fillStyle = \"red\";\r\n\t ctx.fillRect(this.x,this.y,anchoF,altoF);\r\n\t ctx.font = \"90px Helvetica\";\r\n\t ctx.fillStyle = \"black\";\r\n\t ctx.fillText(this.number, this.x+8,this.y + 85);\r\n\t ctx.fill();\r\n\t if(this.y>100 && this.y<103){\r\n\t \tconsole.log(\"crear nuevo item\")\r\n\t \tcreaInst()\r\n\t }\r\n\t \r\n\t}\r\n\r\n\t\r\n}", "title": "" } ]
[ { "docid": "0ba52d336d6f0d48335aacdf24c8004d", "score": "0.80985683", "text": "function createItem(data) {\n return new model.Item(data);\n }", "title": "" }, { "docid": "8e9960901f7c3d6416f5627b5a7d18ed", "score": "0.80360806", "text": "function createItem(item) {\n return {\n label: item.name,\n value: item._id\n }\n }", "title": "" }, { "docid": "ada90a8fe39a4500444a221ca4b40278", "score": "0.7953673", "text": "createItems(){}", "title": "" }, { "docid": "f644fb9c80f27ea2c8d5b47d4e22f40e", "score": "0.7247283", "text": "function makeItem(){\r\n\treturn{\r\n\t\tdata:{\r\n\t\t\titem:{\r\n\t\t\t\tname: 'Hoodies',\r\n\t\t\t\tsize:{\r\n\t\t\t\t\tXL: 42,\r\n\t\t\t\t\tXXL: 44\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tstatus: 'available'\r\n\t}\r\n}", "title": "" }, { "docid": "9657e46c5a4b26095f1ceb1fc221b779", "score": "0.71488196", "text": "_addItem(data) {\n if (isUndefined(data.id)) data.id = this._idGenerator.generate()\n let item = new PoeItem(data)\n this.items.push(item)\n\n if (item.watchFlag) this._watchItem(item);\n return item;\n }", "title": "" }, { "docid": "9cb403f338d24b0112231616de204738", "score": "0.7093045", "text": "function createItem(item) {\n return {\n name: item,\n isChecked: false,\n unCheck: function() {\n this.isChecked=!(this.isChecked);\n }\n }\n }", "title": "" }, { "docid": "d03a8a0e14c98baf47346292ae2eb986", "score": "0.7047337", "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": "7a92f6a98a5e4c4e6bb0a02c50203504", "score": "0.70369774", "text": "makeItem(name, price, description, onBuy, onUse){\n var item = Object();\n item.name = name;\n item.price = price;\n item.inShop = true;\n item.description = description;\n item.onUse = onUse;\n item.onBuy = onBuy;\n return item;\n }", "title": "" }, { "docid": "7fc102a7bb0f8cd78bf94a24fece54f2", "score": "0.70240283", "text": "function _factoryItem (title, start, end, options) {\n\t\t\treturn this.items[this.items.length] = new Item(this, title, start, end, options);\n\t\t}", "title": "" }, { "docid": "1a4a0fe321dabdeabe787ee0749d8756", "score": "0.6985627", "text": "createItem(data) {\n // Sets the id number for the item.\n let idNb = null;\n\n if(data !== undefined && data.id_nb !== undefined) {\n // Uses the given id number.\n idNb = data.id_nb;\n }\n else {\n // Gets a brand new id number for the item.\n idNb = this.getNewIdNumber();\n }\n\n // Means that a new item has been created from the \"Add\" button.\n if(data === undefined) {\n // Displays the last page to show the newly created item. (used for pagination). \n this.toLastPage = true;\n }\n\n // Creates the item div then its inner structure.\n let attribs = {'id':this.itemType+'-item-'+idNb, 'class':this.itemType+'-item'};\n let item = this.createElement('div', attribs);\n this.container.appendChild(item);\n this.createItemStructure(item, idNb);\n\n if(this.ordering) {\n // N.B: No need to add the new item id number to the list as it is updated \n // in the itemReordering function. The item pagination is reset as well.\n this.setItemOrdering(idNb);\n }\n else {\n // Adds the new item id number to the list.\n this.idNbList.push(idNb);\n\n // Reset the item pagination if required.\n if(this.nbItemsPerPage !== null) {\n\tthis.updatePagination(this.currentPageNb);\n }\n }\n\n this.setOddEven();\n\n // Concatenates the callback function name.\n let callback = 'populate'+this.itemTypeUpperCase+'Item';\n // Calls the callback function to add the specific elements to the item.\n window[callback](idNb, data);\n }", "title": "" }, { "docid": "5882007c0daafc388dbf852e6dcb383e", "score": "0.6966968", "text": "createItem (text) {\n\t\treturn {\n\t\t\tlabel: text,\n\t\t\timportant: false,\n\t\t\tdone: false,\n\t\t\tid: (new Date).getTime()\n\t\t}\n\t}", "title": "" }, { "docid": "1d00c4eb6655826f8ab18da6045209e0", "score": "0.6918746", "text": "function Item() {\n defObjProp(this, \"id\", Item.nextItemId++, false, true, true)\n defObjProp(this, \"parent\", null, false, true)\n defObjProp(this, \"selected\", false, true)\n defObjProp(this, \"visible\", true, true, true, true)\n defObjProp(this, \"cursorStyle\", \"pointer\", true, true, true)\n // add item to the items list... do we still need to keep a separate list of all items..?\n if (items) items.add(this)\n defObjProp(Item, \"count\", ++Item.count, false, true)\n}", "title": "" }, { "docid": "cdfbaf4a9fa4cdfae2ffa1829225bf6d", "score": "0.6888386", "text": "__construct()\n {\n this.id = 'item-' + uuidv4();\n this.indent = 0;\n this.location = '';\n this.slug = '';\n this.order = 0;\n this.parent = '';\n this.title = 'New item';\n this.description = '';\n this.metadata = {};\n }", "title": "" }, { "docid": "6221f6e1f9b63aa152c89981d4d187f7", "score": "0.6839899", "text": "static initialize(obj, item) { \n obj['item'] = item;\n }", "title": "" }, { "docid": "f3fcc36ae4702eee41515d6ff01fc765", "score": "0.6836774", "text": "async createItem({ typeName, item, user } = {}) {\n if (!user)\n throw new Error(\"a user is required to create on object in the DB\");\n const { database } = await this.client.databases.createIfNotExists({\n id: databaseName,\n });\n const { container } = await database.containers.createIfNotExists({\n id: containerName,\n });\n item._typeName = typeName;\n item._typeId = item.id;\n item.id = this.createUid(typeName, item);\n item.created = new Date().toISOString();\n item.created_by = user.id;\n item.modified = new Date().toISOString();\n item.modified_by = user.id;\n const { resource } = await container.items.create(item);\n //console.log(resource);\n resource.id = resource._typeId;\n return resource;\n }", "title": "" }, { "docid": "ef2309dcf0e92efdf8f958a6bca89bea", "score": "0.6805875", "text": "function Item(){\n/*-----------------------------------------------------------------------\nLLAMADA\n var ndia = new Item('Dom','Lun','Mar','Mie','Jue','Vie','Sab')\n\t\t \nFECHA DE CREACION\n\t12/10/2004\n*-----------------------------------------------------------------------*/\nthis.length = Item.arguments.length \nfor (var i = 0; i < this.length; i++)\n this[i] = Item.arguments[i]\n}", "title": "" }, { "docid": "296059049f438e44d2ad4592c0f2256d", "score": "0.6788444", "text": "function makeItem(type, data) {\r\n var itemObject = { type: type, data: data };\r\n return JSON.stringify(itemObject);\r\n}", "title": "" }, { "docid": "dd092aefab72acd039869f208b0eb6d6", "score": "0.6786073", "text": "static createTargetItem(item) {\n return cardCreation(item)\n }", "title": "" }, { "docid": "ee2c293af6820bd588f569d969180beb", "score": "0.67582226", "text": "function createItem(req, res) {\n\t(new DB.Item(req.body)).save((err, newItem) => {\n\t\tres.json(newItem);\n\t});\n}//end of createItem()", "title": "" }, { "docid": "c7795f9a1c03e8d7870feba287229a0c", "score": "0.67389655", "text": "createItem(data) {\n const keyName = data.keyName;\n const value = data.value;\n return {\n keyName,\n value,\n valueError: false,\n validationRule: null\n };\n }", "title": "" }, { "docid": "07c9f01976dbae1a635544634b20068e", "score": "0.66988975", "text": "createOneListAndItemObject(data) {\n //console.log(data)\n let newList = new List() \n newList.title = data.attributes.title\n newList.id = data.attributes.id // non string id. -- string version is listObj.id \n\n let listLength = data.attributes.items.length\n\n // Instanciate Item, add attributes\n if (listLength == 1) {\n let newItem = new Item()\n newItem.name = data.attributes.items[0].name\n newItem.id = data.attributes.items[0].id \n newItem.list_id = data.attributes.items[0].list_id \n newList.items.push(newItem)\n\n } else {\n data.attributes.items.map( (item) => {\n let newItem = new Item()\n newItem.name = item.name\n newItem.id = item.id \n newItem.list_id = item.list_id \n newList.items.push(newItem)\n //console.log(\"iteratinggggg\")\n })\n \n }\n // console.log(newList)\n // console.log(\"this is new list ^^\")\n return newList\n }", "title": "" }, { "docid": "bfd1826f6f25791e82ba8f2ae3a36d4a", "score": "0.66948813", "text": "createPublishingItem(publishingItem) {\n let id = shortid.generate();\n publishingItem.id = id;\n publishingItems[id] = publishingItem;\n return publishingItem;\n }", "title": "" }, { "docid": "231a925105a8cba7a42300c0711350f7", "score": "0.6683865", "text": "addItem()\n {\n var newItem = new itembas({\n\n Owner:this.item_id,\n Type:this.type,\n Price: this.price,\n Description:this.description,\n Stock: this.no_stock\n });\n\n itembas.addItem(newItem, function(error, user){\n if(error)throw error;\n console.log(user);\n });\n }", "title": "" }, { "docid": "b46f4b47537af4a0dd3513f8162cc4a0", "score": "0.6675463", "text": "function create$item(item) {\n var $li = $('<li />');\n var $div = $('<div />').addClass('itinerary-item');\n var $span = $('<span />').text(item).addClass(\"title\");\n var $removeButton = $('<button class=\"btn btn-xs btn-danger remove btn-circle\">x</button>');\n\n return $li.append($div.append($span).append($removeButton))\n\n }", "title": "" }, { "docid": "53417ca2523162a760f2872ddf1fad27", "score": "0.66636336", "text": "function createEventbject(_item) {\n var object = {\n \"date\": _item.date,\n \"time\": _item.time,\n \"description\": _item.desciption\n }\n return object;\n}", "title": "" }, { "docid": "3a04f87923db77acddccb4245e38f801", "score": "0.66539294", "text": "function ItemObj(name) {\n\n this.name = name;\n }", "title": "" }, { "docid": "ff1713da66bce4f2cad745d9feabf30c", "score": "0.6618159", "text": "function createItem(props, template) {\n\t\t// duplicate the template object\n\t\tvar item = cloneObject(template);\n\t\tfor (var key in props) {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'api_method':\n\t\t\t\tcase 'api_output':break;\n\t\t\t\tcase 'item_type':\n\t\t\t\t\titem[key] = props[key];\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\titem.properties[key] = props[key];\n\t\t\t}\n\t\t}\n\n\t\treturn item;\n\t}", "title": "" }, { "docid": "e8427f43786737c257f9f39a9b77f043", "score": "0.6589591", "text": "addItem(count, unit, ingredient) {\n // object to hold 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": "771ce045b361d5db7d514d48e8a07ab7", "score": "0.65861773", "text": "create(item) {\n this._isLoading$.next(true);\n this._errorMessage.next('');\n return this.http.post(this.API_URL, item).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__[\"catchError\"])(err => {\n this._errorMessage.next(err);\n console.error('CREATE ITEM', err);\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_0__[\"of\"])({ id: undefined });\n }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__[\"finalize\"])(() => this._isLoading$.next(false)));\n }", "title": "" }, { "docid": "70ebf1a133a46684730275ce51b001f2", "score": "0.657803", "text": "function createItem(items) {\n items.map(item => {\n return <AnimalItem key={item.name} item={item}/>\n })\n }", "title": "" }, { "docid": "eb58a39b3a6709534ba65ffb29664edb", "score": "0.6541957", "text": "function JSONOutlineSchemaItem() {\n babelHelpers.classCallCheck(this, JSONOutlineSchemaItem);\n this.id = \"item-\" + this.generateUUID();\n this.title = \"New item\";\n this.location = \"\";\n this.slug = \"\";\n this.description = \"\";\n this.parent = \"\";\n this.metadata = {};\n this.order = 0;\n this.indent = 0;\n }", "title": "" }, { "docid": "83e6ed4f59e35476e33950acd8ac4eb3", "score": "0.65411663", "text": "_createItem(options) {\n let factory = this.contentFactory;\n let item = factory.createOutputModel(options);\n item.changed.connect(this._onGenericChange, this);\n return item;\n }", "title": "" }, { "docid": "83e6ed4f59e35476e33950acd8ac4eb3", "score": "0.65411663", "text": "_createItem(options) {\n let factory = this.contentFactory;\n let item = factory.createOutputModel(options);\n item.changed.connect(this._onGenericChange, this);\n return item;\n }", "title": "" }, { "docid": "5ea315349560732bfe6bf7ae104567ee", "score": "0.65370405", "text": "addItem(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": "d9d7eb21f1eb34c64e8ee4a9b1ef43c6", "score": "0.6536845", "text": "function createItem(title, done, priority, date, estimated, tags, description, time) {\n var id = vm.items.length;\n if(time!=null){\n date.setHours(time.getHours());\n date.setMinutes(time.getMinutes());\n }\n \n vm.items.push({\n title: title,\n done: done || false,\n priority: priority || 0,\n date: date || Date.now(),\n estimated: estimated || 0,\n tags: tags,\n description: description,\n id: id\n });\n storageService.set(vm.items);\n }", "title": "" }, { "docid": "bb320f9b1b91ebb13c29870d83bb1b81", "score": "0.6532574", "text": "constructor(item){\n\n //An item is an existing note\n if(item !== null){\n const { \n type, \n title, \n category, \n content, \n list_items, \n list_bools, \n array_collaboratos, \n is_everyday, \n start_date, \n use_secondary, \n end_date, \n time \n } = item\n\n this.type = type\n this.title = title\n this.category = category\n this.content = content\n this.list_items = list_items\n this.list_bools = list_bools\n this.array_collaboratos = array_collaboratos\n this.is_everyday = is_everyday\n this.start_date = start_date\n this.use_secondary = use_secondary\n this.end_date = end_date\n this.time = time\n }\n\n }", "title": "" }, { "docid": "876432b8bfa381c3d114cb4332307f9f", "score": "0.6504862", "text": "function item(name, image, descr, price, type) {\r\n this.name = name;\r\n this.image = image;\r\n this.descr = descr;\r\n this.price = price;\r\n this.type = type;\r\n\r\n}", "title": "" }, { "docid": "12820ca13b9cfa9c392ff3ddfd929b07", "score": "0.6495895", "text": "constructor() {\n this.name = \"Unnknown\";\n this.owner = \"Unknown\";\n this.index = 0;\n this.newItem = false;\n this.items = new Array();\n }", "title": "" }, { "docid": "61f212b4c746e4ca99cbbbf6dcb1d808", "score": "0.64893615", "text": "newFieldItem(owner, name, desc) {\r\n this.key3.set(ClassWriter.FIELD, owner, name, desc);\r\n let result = this.get(this.key3);\r\n if (result == null) {\r\n this.put122(ClassWriter.FIELD, this.newClass(owner), this.newNameType(name, desc));\r\n result = new Item(this.index++, this.key3);\r\n this.put(result);\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "aa5306b9905670a05e2cee7dcd155c95", "score": "0.64850193", "text": "function createItem(name, ingredients, preparation) {\n const item = {\n name,\n ingredients,\n preparation,\n };\n data.push(item);\n return item;\n}", "title": "" }, { "docid": "8ff1c9da33e56a898345ee4c4b23691c", "score": "0.64785314", "text": "newMethodItem(owner, name, desc, itf) {\r\n let type = itf ? ClassWriter.IMETH : ClassWriter.METH;\r\n this.key3.set(type, owner, name, desc);\r\n let result = this.get(this.key3);\r\n if (result == null) {\r\n this.put122(type, this.newClass(owner), this.newNameType(name, desc));\r\n result = new Item(this.index++, this.key3);\r\n this.put(result);\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "278df6c605abe0263eb29c9dd755fbfd", "score": "0.6470992", "text": "function Item(settings) {\n this.id = settings.id;\n this.type = settings.type || '';\n this.createdAt = settings.createdAt || new Date().getTime();\n this.position = settings.position;\n this.position.z = 0;\n}", "title": "" }, { "docid": "adce03d1628f4c5f4fb739df0ae5991b", "score": "0.64701605", "text": "function item(name)\n { \n return {\n \"name\": name,\n \"type\": name,\n \"price\": 4\n }\n }", "title": "" }, { "docid": "4351e98e91e43f0813b18c4626bd87c4", "score": "0.64678013", "text": "function createClosetItem(itemName, itemImg, itemBrand, itemColor, itemCategory) {\n // Get accountID {email} for cur user.\n\n var user = firebase.auth().currentUser;\n var getUserEmail = user.email;\n $rootScope.email = getUserEmail.replace(/[&\\/\\\\#,+()$~%.'\":*?<>{}@]/g, '');\n\n newItemId = ID();\n var itemObj = new Item(itemName, newItemId, itemImg, itemBrand, itemColor);\n //getAllItems();\n\n //console.log($rootScope.completeContent);\n addItemToCloset(itemObj, itemCategory);\n }", "title": "" }, { "docid": "bc2aa051fd9bce85017399c707e54b59", "score": "0.64655083", "text": "function createNewItem(req) {\n\n // get request information and create item\n var name = req.query.name;\n\n var caption = req.query.caption;\n var url = req.query.url;\n var faviconUrl = req.query.faviconUrl;\n var owner;\n var newItem;\n\n // find name to get owner ID\n User.findOne({'name' : name}, function (err, user) {\n if (err)\n console.log(err);\n\n if (user) {\n owner = user._id;\n \n newItem = new Item({\n 'owner': owner,\n 'caption': caption,\n 'url': url,\n 'faviconUrl': faviconUrl\n });\n\n // pass new item to next function, which saves relevant database documents\n saveNewItem(name, newItem);\n } else {\n console.log('User not found');\n }\n });\n }", "title": "" }, { "docid": "29c86603eeb3f226130b391c173f1471", "score": "0.64467853", "text": "addItem(_item) { }", "title": "" }, { "docid": "27cffba187c6fdf32a248f5f28be120e", "score": "0.644428", "text": "add(item) {\n }", "title": "" }, { "docid": "bf8aacb9d13ec5ccd0fc970aab8a0655", "score": "0.6441232", "text": "function createItem(_i) {\r\n var itemId;\r\n // step 2.1: create item\r\n sq.push(function (args, next) {\r\n var tag = $scope.items[_i].tag;\r\n $http({\r\n method: 'POST',\r\n url: 'item/create',\r\n data: {\r\n markId: markId,\r\n date: new Date($scope.items[_i].date).getTime(),\r\n post: $scope.items[_i].post,\r\n title: $scope.items[_i].title,\r\n tag: tag.tagId\r\n }\r\n }).\r\n success(function (data) {\r\n if (data.status === 1) {\r\n itemId = data.data.itemId;\r\n next(null, data.data.itemId);\r\n }\r\n }).\r\n error(function () {\r\n next(new Error('Upload failed.'));\r\n });\r\n });\r\n // step 3.2: upload pictures\r\n $scope.items[_i].pictures.forEach(function (val, i) {\r\n uploadPicture(itemId, val, i);\r\n $scope.demoUploadFinished++;\r\n });\r\n }", "title": "" }, { "docid": "cde4252146a625e19dd8b7305e8275d8", "score": "0.64401823", "text": "function Item(code, title, price, category,image){\n this.code = code;\n this.title = title;\n this.price = price;\n this.category = category;\n this.image = image;\n this.user = \"luis\";\n}", "title": "" }, { "docid": "5abcef5bbd8336b35464ad7b9e42e1eb", "score": "0.64344746", "text": "function item() { }", "title": "" }, { "docid": "8a4935805e888ed787d9fe25798ae2ed", "score": "0.6425415", "text": "function TodoItem(item) {\n if (item) {\n this.Post(item);\n }\n this.Get();\n }", "title": "" }, { "docid": "323e530e5dd4ac6abfc157dbb74af4ad", "score": "0.6416981", "text": "function mItem_Item(id, name, description, type, url, expanded, visible, window, imageOff, imageOn) {\n this.id = id;\n this.name = name;\n this.description = description;\n this.type = type;\n this.url = url;\n this.expanded = expanded;\n this.visible = visible;\n this.window = window;\n this.imageOff = imageOff;\n this.imageOn = imageOn;\n \n\n this.parents = new Array();\n this.subItems = new Array();\n\n this.addItem = _mItem_addItem;\n this.delItem = _mItem_delItem;\n this.getItem = _mItem_getItem;\n this.getItems = _mItem_getItems;\n this.getDescription = _mItem_getDescription;\n this.setDescription = _mItem_setDescription;\n this.isExpanded = _mItem_isExpanded;\n this.setExpanded = _mItem_setExpanded;\n this.getId = _mItem_getId;\n this.getName = _mItem_getName;\n this.setName = _mItem_setName;\n this.addParent = _mItem_addParent;\n this.getParents = _mItem_getParents;\n this.getType = _mItem_getType;\n this.setType = _mItem_setType;\n this.getUrl = _mItem_getUrl;\n this.setUrl = _mItem_setUrl;\n this.isVisible = _mItem_isVisible;\n this.setVisible = _mItem_setVisible;\n this.getWindow = _mItem_getWindow;\n this.setWindow = _mItem_setWindow;\n this.getImageOff = _mItem_getImageOff;\n this.setImageOff = _mItem_setImageOff;\n this.getImageOn = _mItem_getImageOn;\n this.setImageOn = _mItem_setImageOn;\n}", "title": "" }, { "docid": "fa4f60aa202fa96eb95c872b0e250ca3", "score": "0.6401488", "text": "function createItem() {\n let min = 0;\n let max = items.length - 2;\n return {\n ...clone(items[Math.floor(Math.random() * (max - min + 1)) + min]),\n position: randomPosition(),\n };\n}", "title": "" }, { "docid": "27f23a6283935baff6cec39bca6a571b", "score": "0.6397771", "text": "function createItemInDb()\n {\n var newItem = new ItemsService(); //new resource object\n\n //set item values from input boxes\n newItem.itemName = ctrl.selectedItem.itemName;\n newItem.count = ctrl.selectedItem.count;\n\n //resource $save method on instance of resource class objects\n newItem.$save(function(item){\n //successfull callback\n \n //show dialog\n ctrl.modalDialog.setType(\"message\",\"Item successfully saved!\");\n ctrl.modalDialog.showDialog();\n\n //add item to list\n ctrl.existingItems.push(item);\n clearSelected();\n },function(err){\n //if err show err\n if(err)\n {\n ctrl.modalDialog.setType(\"warningMessage\",\"Error: \"+err.message);\n ctrl.modalDialog().showDialog();\n }\n else{\n ctrl.modalDialog.setType(\"warningMessage\",\"Error\");\n ctrl.modalDialog.showDialog();\n }\n });\n }", "title": "" }, { "docid": "a8c87dbcbce92493b9dbadd66f91d5ed", "score": "0.6383996", "text": "function createItem(commands, options) {\r\n return new CommandItem(commands, options);\r\n }", "title": "" }, { "docid": "66387eeab1489d3258fac609c0e8795c", "score": "0.6372217", "text": "function Item(item) {\n this.item = item;\n this.completed = false;\n}", "title": "" }, { "docid": "327c98b127aa73f0b75026357ba857b5", "score": "0.636985", "text": "function MakeObjectToAddInList(success) {\n return {\n \"itemId\": success.data.data.id,\n \"itemName\": success.data.data.itemName,\n \"itemPrice\": null,\n \"collection\": null,\n \"images\": [],\n \"quantity\": null,\n \"dateOfPurchase\": success.data.data.dateOfPurchase,\n \"category\": null,\n \"rooms\": null,\n \"currentValue\": null,\n \"brand\": success.data.data.brand,\n \"model\": success.data.data.model,\n \"description\": success.data.data.description,\n \"roomId\": null,\n \"collectionId\": null,\n \"price\": success.data.data.quotedPrice,\n \"categoryId\": success.data.data.category.id,\n \"categoryName\": GetCategoryOrSubCategoryOnId(true, success.data.data.category.id),\n \"subCategoryId\": success.data.data.subCategory.id,\n \"subCategoryName\": GetCategoryOrSubCategoryOnId(false, success.data.data.subCategory.id),\n \"templateType\": null,\n \"itemWorth\": 0,\n \"policyNumber\": null,\n \"appraisalValue\": null,\n \"productSerialNo\": null,\n \"imageId\": null,\n \"jwelleryTypeId\": null,\n \"jwelleryType\": null,\n \"claimed\": false,\n \"claimId\": success.data.data.claimId,\n \"vendorId\": null,\n \"age\": success.data.data.age,\n \"status\": null,\n \"statusId\": success.data.data.statusId,\n \"itemCategory\": null,\n \"contact\": null,\n \"notes\": null,\n \"additionalInfo\": null,\n \"approved\": false,\n \"scheduled\": success.data.data.isScheduledItem\n }\n }", "title": "" }, { "docid": "f724eb9580cb96ad8ca3b76663570689", "score": "0.636815", "text": "function handleAddItem() {\n setIsPostingItem(true);\n axios\n .post(`/item`, {\n itens: [{ idProjeto: id, posicao: itens.length }],\n })\n .then((response) => {\n setItens([...itens, response.data.results[0]]);\n })\n .catch(() => {\n alert(\"Não foi possível criar o novo item.\");\n })\n .finally(() => setIsPostingItem(false));\n }", "title": "" }, { "docid": "3fe1b6ac7cdb19947ad4cbc6d012b9b0", "score": "0.63491046", "text": "function makeItems(partNum,desc,status){\n var newItem = {\n partNum: partNum,\n desc: desc,\n status: status,\n getInfo: function(){console.log(`Part No: ${partNum}\\nDesc: ${desc}\\nStatus: ${status}`)}\n }\n}", "title": "" }, { "docid": "70ca50a1271472e7ed7b52349ac7e06f", "score": "0.63433546", "text": "_create (type, name = '', obj = {}, id = null) {\n // If we didn't get a type, stop processing.\n if (typeof type === \"undefined\") {\n return false;\n }\n\n // Get a date.\n let d = new Date();\n let createDate = d.toISOString();\n\n // If no id supplied, generate one based on the date.\n if (typeof id === \"undefined\" || id === null) {\n id = d.getTime(); // ms since 1970\n }\n\n // Build a unique key for this item.\n let key = this.appPrefix + type + id;\n\n // Populate the data object.\n let data = {};\n data.id = '' + id; // convert to string\n data.name = name;\n data.createdDate = createDate;\n data.modifiedDate = createDate;\n data.objData = obj;\n data = angular.toJson(data);\n\n return mflyCommands.putValue(key, data)\n .then((result, status) => {\n return data;\n });\n }", "title": "" }, { "docid": "8c3d2321b69a1635be11633515962f37", "score": "0.63345814", "text": "function createItem(commands, options) {\n return new CommandItem(commands, options);\n }", "title": "" }, { "docid": "8c3d2321b69a1635be11633515962f37", "score": "0.63345814", "text": "function createItem(commands, options) {\n return new CommandItem(commands, options);\n }", "title": "" }, { "docid": "2965458c90f81ccb28b353a48e67a8f7", "score": "0.63325953", "text": "createItemNode() {\n let node = document.createElement('li');\n let icon = document.createElement('span');\n let text = document.createElement('span');\n let modified = document.createElement('span');\n icon.className = ITEM_ICON_CLASS;\n text.className = ITEM_TEXT_CLASS;\n modified.className = ITEM_MODIFIED_CLASS;\n node.appendChild(icon);\n node.appendChild(text);\n node.appendChild(modified);\n return node;\n }", "title": "" }, { "docid": "a61d2e4412bdf6d0c64131edab359644", "score": "0.63249904", "text": "constructor() {\r\n this.items = {};\r\n }", "title": "" }, { "docid": "bc6bf2bfb9e0388d6480a68b4ff5c15b", "score": "0.6315731", "text": "function newItemObject(newToDoValue) {\n if (newToDoValue !== \"\") {\n const item = new ToDoItem(newToDoValue);\n \n toDoListArr.push(item);\n displayItems(newToDoValue, item);\n }\n }", "title": "" }, { "docid": "72df55e896b10f9ad5da8b3019f22511", "score": "0.63148934", "text": "function createClosetItem(itemName, itemImg, itemBrand, itemColor, itemCategory) {\n // Get accountID {email} for cur user.\n\n var user = firebase.auth().currentUser;\n var getUserEmail = user.email;\n $rootScope.email = getUserEmail.replace(/[&\\/\\\\#,+()$~%.'\":*?<>{}@]/g, '');\n\n newItemId = ID();\n var itemObj = new Item(itemName, newItemId, itemImg, itemBrand, itemColor);\n\n addItemToCloset(itemObj, itemCategory);\n }", "title": "" }, { "docid": "f6bb28f66a5796fbefa0300a75e32635", "score": "0.6313057", "text": "function createClosetItem(itemName, itemImg, itemBrand, itemColor, itemCategory) {\n // Get accountID {email} for cur user.\n\n var user = firebase.auth().currentUser;\n var getUserEmail = user.email;\n $rootScope.email = getUserEmail.replace(/[&\\/\\\\#,+()$~%.'\":*?<>{}@]/g, '');\n\n\n var itemObj = new Item(itemName, newItemId, itemImg, itemBrand, itemColor);\n\n addItemToCloset(itemObj, itemCategory);\n }", "title": "" }, { "docid": "945b6c9169d3883c2747dd322522ccbe", "score": "0.63060606", "text": "constructor() { \n \n Item.initialize(this);\n }", "title": "" }, { "docid": "31dc1540102881d07cf4e4531371af23", "score": "0.6292642", "text": "newItem()\n {\n let item = new JSONOutlineSchemaItem();\n return item;\n }", "title": "" }, { "docid": "b28387bec4a71a3a63ded8b3b5524fd0", "score": "0.62860876", "text": "function createAddedContentItem(json, parentContentItem) {\r\n var contentItem = new ContentItem({\r\n id: json.Id,\r\n beginDate: json.BeginDate,\r\n endDate: json.EndDate,\r\n title: json.Title,\r\n children: 0,\r\n description: json.Description,\r\n hasChildren: json.HasChildren,\r\n sourceURL: json.SourceURL,\r\n sourceRef: json.SourceRef,\r\n pictureURLs: json.PictureURLs,\r\n }, parentContentItem);\r\n\r\n return contentItem;\r\n }", "title": "" }, { "docid": "50526578b815c2f022f865ac42544d42", "score": "0.62842804", "text": "function _createItem(item, border) {\n\t\t\t\t// generate container\n\t\t\t\tvar timetable = this._timetable,\n\t\t\t\t\tvocab = getVocab.call(timetable),\n\t\t\t\t\titemPos = _valToPos.call(this, item.start),\n\t\t\t\t\titemLength = _valToPos.call(this, item.end) - itemPos,\n\t\t\t\t\titemElm = $dom.create(itemHolderTemplate),\n\t\t\t\t\titemContent = item.getContent() || _itemDefaultContent(item);\n\n\t\t\t\t// add class name & id\n\t\t\t\titemElm.attr(\"id\", item.id);\n\t\t \t\titemContent[0].className = \"timetable-itemContent \" + item._opts.className;\n\n\t\t \t\tvar self = this;\n\n\t\t\t\titem.element = this.items[item.id] = itemElm;\n\t\t\t\tthis.itemContent[item.id] = itemContent;\n\t\t\t\tthis.itemInstance[item.id] = item;\n\n\t\t\t\t// we need to deduct borders from the item length. We deduct 2 borders if we're not collapsing. One otherwise.\n\t\t\t\titemLength -= border * ((!timetable._opts.collapseItemBorders) + 1);\n\t\t\t\t// size and position\n\n\t\t\t\titemElm.css(vocab.pos, itemPos)\n\t\t\t\t\t.css(vocab.length, itemLength);\n\n\t\t\t\t// add content\n\t\t \t\titemElm.append(itemContent);\n\t\t\t\t// return container\n\t\t\t\treturn itemElm;\n\t\t\t}", "title": "" }, { "docid": "2b11866955265090e39bf98077466f4d", "score": "0.62756944", "text": "function createNewItem(title) {\n const colorIndex = Number(title.substring(5));\n return {\n title: title,\n color: colors[colorIndex - 1]\n };\n}", "title": "" }, { "docid": "d5ae9f9d007b12f7ac3441415841285b", "score": "0.62601554", "text": "add (element) {\n\t\tvar item = Mavo.Node.create(element, this.mavo, {\n\t\t\tcollection: this,\n\t\t\ttemplate: this.template?.children?.[this.length] ?? null,\n\t\t\tproperty: this.property,\n\t\t\ttype: this.type\n\t\t});\n\n\t\titem.index = this.length;\n\t\tthis.children.push(item);\n\n\t\t// item may have tried to propagate updates to us when we created it,\n\t\t// but that wouldn't have worked since item was not yet in\n\t\t// this.children, so we need to update manually.\n\t\tthis.liveData.update();\n\n\t\treturn item;\n\t}", "title": "" }, { "docid": "7f6d08001e25c0e01bbb7e5372f08abc", "score": "0.625705", "text": "function newItem() {\n setAddItem({isAddingItem: true})\n }", "title": "" }, { "docid": "2f944ae3d0834f276b8a45da1180d3fa", "score": "0.6252643", "text": "initItem(item) {\n item = super.initItem(item);\n if (!item.name) item.name = \"\";\n if (!item.password) item.password = \"\";\n if (!item.confirmPassword) item.confirmPassword = \"\";\n if (!item.enabled) item.enabled = 0;\n if (!item.roles) item.roles = [];\n return item;\n }", "title": "" }, { "docid": "b8828f81acd6b24fd9870da559888304", "score": "0.6248377", "text": "function createRow(item) {\n\t// creo una riga\n\tlet row = document.createElement(\"div\");\n\trow.className = \"row\"; // setto la classe\n\trow.setAttribute(\"data-id\", item.id); // setto l'attrituto data-id\n\treturn createRowElements(item, row); \n}", "title": "" }, { "docid": "a890616af188a1b2100a8348c3b2a491", "score": "0.6247182", "text": "function _addItem(item, forceID) {\n\t\tvar itemNode = document.createElement(\"listitem\");\n\n\t\tvar itemDataID;\n\t\tif (!forceID) {\n\t\t\tserial_number += 1;\n\t\t\titemDataID = item.id + \":\" + serial_number;\n\t\t} else {\n\t\t\titemDataID = forceID;\n\t\t}\n\n\t\titemNode.setAttribute(\"value\", itemDataID);\n\t\titemNode.setAttribute(\"label\", item.getDisplayTitle());\n\t\titemNode.setAttribute(\"class\", \"listitem-iconic\");\n\t\titemNode.setAttribute(\"image\", item.getImageSrc());\n\t\t_citationList.appendChild(itemNode);\n\t\treturn itemNode;\n\t}", "title": "" }, { "docid": "a2090e4f2ae3d089d1f89cfa2996b375", "score": "0.62297803", "text": "addItem(type, des, val) {\n let newItem;\n let ID;\n\n // To avoid conflicting IDs numbers, we will make our ID#s equal to the LAST ID#, plus 1\n data.allItems[type].length > 0\n ? (ID = data.allItems[type][data.allItems[type].length - 1].id + 1)\n : (ID = 0);\n // The second set of [], [data.allItems[type].length - 1], determines the number/index location of the last item\n\n // For the type parameter, the UIController has a getInput method which returns the type of the item, so we can check for that here\n if (type === 'exp') {\n newItem = new Expense(ID, des, val);\n } else if (type === 'inc') {\n newItem = new Income(ID, des, val);\n }\n\n // Push the item onto the appropriate items array\n data.allItems[type].push(newItem);\n // Now since the type string is either exp or inc, and our array names are also exp and inc, we can dynamically select the array from our allItems object\n\n // Now simply return the new item\n return newItem;\n }", "title": "" }, { "docid": "894747a2b5aeaabc0e0157ace409a49a", "score": "0.6219594", "text": "function Item(val) {\n this.value = val;\n}", "title": "" }, { "docid": "9fd7071a9776c1376bcafdea118bee23", "score": "0.6219335", "text": "function createItem(inv)\n {\n // check if this person exists already\n app.models.Item.findOne({where: {name: inv.name}}, function(error, req)\n {\n // mongo/search error\n if (error)\n {\n console.log((\"Boot Script: Error while searching db for item \" + inv.name).red);\n return;\n }\n // item already exists\n if (req)\n {\n console.log(\"Boot Script: \".blue + (\"Item already created \" + inv.name).magenta);\n inv.id = req.id;\n objCreated(0, 1);\n return;\n }\n\n // item doesnt exist, so create it\n console.log(\"Boot Script: \".blue + (\"Item not yet created: \" + inv.name).magenta);\n console.log(\"Boot Script: \".blue + (\"Creating Item: \" + inv.name).magenta);\n app.models.Item.create(inv, function(err, res)\n {\n // mongo/write error\n if (err)\n {\n console.log((\"Boot Script: Error while writing item to db \" + inv.name).red);\n return;\n }\n\n // item successfully added to database\n console.log(\"Boot Script: \".blue + (\"Successfully created Item: \" + inv.name).magenta);\n inv.id = res.id;\n objCreated(0, 1);\n return;\n });\n });\n }", "title": "" }, { "docid": "dfbb102ee3046f18c0988a0d965d1649", "score": "0.6218314", "text": "function attachItem(){}", "title": "" }, { "docid": "c3e85d4de7614606e65b64d64f5a1fdf", "score": "0.621244", "text": "function ListItem() {}", "title": "" }, { "docid": "c3e85d4de7614606e65b64d64f5a1fdf", "score": "0.621244", "text": "function ListItem() {}", "title": "" }, { "docid": "c3e85d4de7614606e65b64d64f5a1fdf", "score": "0.621244", "text": "function ListItem() {}", "title": "" }, { "docid": "c3e85d4de7614606e65b64d64f5a1fdf", "score": "0.621244", "text": "function ListItem() {}", "title": "" }, { "docid": "418ace8bcf1780e36ed5e9b9dbbf4c52", "score": "0.6206845", "text": "_createItem(options) {\n let factory = this.contentFactory;\n let item = factory.createAttachmentModel(options);\n item.changed.connect(this._onGenericChange, this);\n return item;\n }", "title": "" }, { "docid": "a35ea576e9a8663317236657be4a1a27", "score": "0.6205021", "text": "function addItem(){\n const item = new ToDoItem()\n todoList.selectedProject.items.push(item)\n const itemView = makeToDoItemView(item)\n todoListView.todoContainer.insertBefore(itemView.todoItemDiv, todoListView.todoContainer.lastChild)\n addToDoItemEventHandlers(item, itemView)\n}", "title": "" }, { "docid": "085633c8ece14586ae0fb36fa046fe37", "score": "0.62010425", "text": "addItemToData(type, description,amount){\n let id = uniqid();\n let item = {\n type,\n id, \n description,\n amount,\n }\n\n this.data[type].push(item); \n return item;\n }", "title": "" }, { "docid": "f17a5341e5446beeb1f1f5f62a924458", "score": "0.6185958", "text": "constructor() {\n super();\n this.items = {\n \"id\": 1,\n \"items\": [\n {\n \"id\": 2,\n \"items\": [\n {\"id\": 4},\n {\"id\": 5},\n {\"id\": 6},\n {\"id\": 7},\n ]\n },\n {\n \"id\": 3,\n \"items\": [\n {\"id\": 8},\n {\"id\": 9},\n ]\n }\n ]\n };\n }", "title": "" }, { "docid": "be664e681ba8bb9e5fd5a0487d8f059b", "score": "0.61846423", "text": "add(itemObject) {\n this.items.push(itemObject)\n }", "title": "" }, { "docid": "319cbac4614d3d607709814806183fc0", "score": "0.6179144", "text": "addItem(item) {\n if (typeof item === 'undefined' || item == null) {\n throw new Error('can\\'t add empty Book')\n }\n this._items.push(item);\n }", "title": "" }, { "docid": "95d12df0dbd1a00f9832d02717469c8d", "score": "0.6163613", "text": "static _makeModel(item)\n {\n // Return a new instance of this Model, populated with the data from the driver.\n var inst = new this(item);\n\n // The instance isn't dirty, as we've just loaded it from the DB.\n inst.$dirty = false;\n\n // The instance exists in the database. (Required for some drivers.)\n inst.$exists = true;\n\n return inst;\n }", "title": "" }, { "docid": "c0880a712a247f77e5df1c804c6938c1", "score": "0.61563", "text": "addItem(name, description,imageUrl) {\n const item = {\n // Increment the currentId property\n id: this.currentId++,\n name: name,\n description: description,\n imageUrl: imageUrl\n };\n\n // Push the item to the items property\n this.items.push(item);\n }", "title": "" }, { "docid": "c0880a712a247f77e5df1c804c6938c1", "score": "0.61563", "text": "addItem(name, description,imageUrl) {\n const item = {\n // Increment the currentId property\n id: this.currentId++,\n name: name,\n description: description,\n imageUrl: imageUrl\n };\n\n // Push the item to the items property\n this.items.push(item);\n }", "title": "" }, { "docid": "bb86f12583d6ab08c3d3f47c9f118b91", "score": "0.61441374", "text": "async addItem (rootObj, { name, desc, ownerId }) {\n // you'd have to implement this method yourself, would insert the item into a db\n return await addNewItem({ name, desc, ownerId })\n }", "title": "" }, { "docid": "2c4385d3a63a94a29ee4845173e4e53b", "score": "0.61300534", "text": "function getItem() {\n // get all data from form and wrap in a data object\n // return ToDoItem\n // casting HTML Input Element of document then get the .value\n var title = document.getElementById(\"title\").value;\n var item = new ToDoItem(title);\n var deadline = document.getElementById(\"deadline\").value;\n item.deadline = new Date(deadline);\n item.isComplete = false;\n return item;\n}", "title": "" }, { "docid": "d4a8303fd0011741e3507c9c0cf9197f", "score": "0.61260796", "text": "static add(item, object) {\n return {\n ...object,\n ...item\n };\n }", "title": "" }, { "docid": "dc392aafd861f0437c63898fede5866d", "score": "0.61217934", "text": "async create(item) {\n const obj = new generatedModel.model(item);\n return await obj.save();\n }", "title": "" }, { "docid": "985d274939afcaec7f56a1020e396734", "score": "0.61184645", "text": "function addItem ()\n {\n showEditItemModal(new Item()).then(\n function (item)\n {\n itemService.addItem(item).then(\n function (item)\n {\n vm.items.push(item);\n }\n );\n }\n );\n }", "title": "" }, { "docid": "7d84be7b58bc61f0f5fc0715ff651631", "score": "0.6113281", "text": "function itemGeneric() {\nthis.shape,\nthis.Ori,\nthis.Pos,\nthis.scale = new THREE.Vector3(0,0,0)\nthis.w,\nthis.h,\nthis.d,\nthis.color = 0xFFFFFF,\nthis.texture,\nthis.childItems = new Array(),\nthis.lockXTranslation = false,\nthis.lockYTranslation = false,\nthis.lockZTranslation = false\n\nreturn this\n}", "title": "" }, { "docid": "664f52a71c4a7177ef7f22d55f674887", "score": "0.6101564", "text": "addItem(context, item) {\n context.commit('ADD_NEW_ITEM', item);\n }", "title": "" } ]
93949ea1e5d98a241959db60a2169368
Adds the display=block property for the passed element/s
[ { "docid": "87c4a6fe92b4cfbf4e35de7744aba0e1", "score": "0.57885456", "text": "function show(el){\n el = getList(el);\n\n for(var i = 0; i<el.length; i++){\n el[i].style.display = 'block';\n }\n return el;\n }", "title": "" } ]
[ { "docid": "6166d5ee206a59f766dfc2bfad28e6f2", "score": "0.85816175", "text": "function displayBlock(element){\n element.setAttribute(\"style\", \"display: block\");\n}", "title": "" }, { "docid": "9be40a65e21098a4693173d0972bcdd2", "score": "0.7094955", "text": "show() {\n\t\tthis.element.classList.add('display-block');\n\t}", "title": "" }, { "docid": "636de1e267bcd4cb694e304c8848f83a", "score": "0.6987302", "text": "function show(element) {\n element.style.display = \"block\";\n}", "title": "" }, { "docid": "8c43651bb660784f0fe576b9ee443b26", "score": "0.6895385", "text": "function showElement(elm) {\n elm.style.display = \"block\";\n}", "title": "" }, { "docid": "a565b848ce0acc710eed5edac099abee", "score": "0.6674782", "text": "function displayDiv(ele) {\r\n\tele.style.display = 'block';\r\n}", "title": "" }, { "docid": "88bc8820f914b467a20f63269d94dd0b", "score": "0.6640623", "text": "function displayOn(me){\n\t\t\tvar elem = getElement(me);\n\t\t\tif(elem){\n\t\t\t\telem.style.display=\"block\";\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c9d64b4dda5eba8b158b9b1c83e9e0e2", "score": "0.6624875", "text": "function show(elem) {\n elem.style.display = 'block';\n}", "title": "" }, { "docid": "9094754c7236a6a2ca10fc40ac288c3e", "score": "0.6605771", "text": "function showBlock(element) {\n element.toggleClass(\"hidden\");\n }", "title": "" }, { "docid": "67bcd082fd4809da52230d689bbd114e", "score": "0.65573823", "text": "function showEl(el, displayProp) {\n el.style.display = [displayProp];\n}", "title": "" }, { "docid": "f647e531bec337884720fc64edb65458", "score": "0.65419924", "text": "displayOn(tag) {\n tag.style.display = 'block'\n }", "title": "" }, { "docid": "da20ddf22e281d6ea08c758e2e58eba0", "score": "0.65381676", "text": "function displayElement(element) {\n var x = document.getElementById(element);\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n } else {\n x.style.display = \"none\";\n }\n }", "title": "" }, { "docid": "356a3c03fe7699f26cff682295ea977a", "score": "0.64885753", "text": "function showElement(el){\n\t\t\tvar t=[].concat(el);\n\t\t\tfor(var l=0;l<t.length;l++)\n\t\t\t\tt[l].style.display=\"block\";\n\t\t}", "title": "" }, { "docid": "ae7f76ebb1f0c0f9ade1b2ba17494bb3", "score": "0.6487977", "text": "function displayNone(element){\n element.setAttribute(\"style\", \"display: none\");\n}", "title": "" }, { "docid": "841191cb2e4222e496e225f73846ccd6", "score": "0.64776105", "text": "static showInlineBlockStuffs(){\r\n\t\tstuff.style.display = \"inline-block\";\r\n\t}", "title": "" }, { "docid": "ff4b8a2e0c093bdba711f42f111642b7", "score": "0.6435795", "text": "function show(elm) {\r\n\telm.style.display = 'block';\r\n}", "title": "" }, { "docid": "5b059be21d5225bb28a9cae2e1818373", "score": "0.64311653", "text": "function show( elem ) {\n // Set the display property back to what it use to be, or use\n // ‘block’, if no previous display had been saved\n elem.style.display = elem.$oldDisplay || 'block';\n}", "title": "" }, { "docid": "7750d784177266e0a2050566def25173", "score": "0.6427171", "text": "function setElementCss(element) {\n var elementCss = {\n // no margin or it'll screw up the height calculations.\n margin: '0'\n };\n if (!isTagNameInList(element[0], DONT_SET_DISPLAY_BLOCK)) {\n // display: block if it's safe to do so\n elementCss.display = 'block';\n }\n if (rowHeight) {\n elementCss.height = rowHeight + 'px';\n }\n element.css(elementCss);\n }", "title": "" }, { "docid": "d2c3ab22a33befa493469611d56f2b46", "score": "0.63658375", "text": "set display(v) {\r\n if (v === lastDisplay)\r\n return;\r\n lastDisplay = v;\r\n updateTooltip({ display: v == 'block' });\r\n }", "title": "" }, { "docid": "1c830776411133843fe0daf449ca28c1", "score": "0.6356991", "text": "function block(color) {\n color.style.display = 'block';\n}", "title": "" }, { "docid": "59cc89893b1856777d607cf2dffa6e43", "score": "0.6345121", "text": "function ShowElement(element) {\n\telement.style.display = '';\n}", "title": "" }, { "docid": "90abe43d4908240b1f17a6f98ef6cd71", "score": "0.63239276", "text": "displayElement(){\n for(var i = 0; i != this.numberElementsDiapo; i++){\n if(this.elements[i].style.display === \"block\"){\n this.elements[i].style.display = \"none\";\n if(i === this.numberElementsDiapo - 1){\n this.elements[i].style.display = \"block\";\n }else{\n this.elements[i + 1].style.display = \"block\";\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "26abb5cc1cdbcb619071d864cc146fd5", "score": "0.6246298", "text": "function lisha_set_style_display(el,val)\r\n{\r\n\tdocument.getElementById(el).style.display = val;\r\n}", "title": "" }, { "docid": "e40219ceb9a4aaf73d4fa7543c5a3884", "score": "0.6240724", "text": "function showHideElement(element, display) {\n document.getElementById(element).style.display = display == 'show' ? 'block' : 'none';\n}", "title": "" }, { "docid": "837e43621d41b5dbebfecdb9f7bf1e57", "score": "0.6217163", "text": "function displaystat (element) {\n if(!element.parentElement.parentElement.nextElementSibling.style.display) {\n element.parentElement.parentElement.nextElementSibling.style.display = 'block';\n element.nextElementSibling.style.display = 'block';\n element.style.display = 'none';\n }\n else {\n element.parentElement.parentElement.nextElementSibling.style.display = '';\n element.previousElementSibling.style.display = 'block';\n element.style.display = 'none';\n }\n}", "title": "" }, { "docid": "6fddbe436d602e8c5f910995c8ec80b9", "score": "0.61918855", "text": "function displayElement(elementId, display) {\n\t\tvar element = document.getElementById(elementId);\n\t\tif (element) {\n\t\t\telement.style.display = (display ? 'block' : 'none');\n\t\t\telement.style.visibility = (display ? 'visible' : 'hidden');\n\t\t}\n\t}", "title": "" }, { "docid": "061f8ea08dc0e163bec3f3953c4305c0", "score": "0.61802316", "text": "updateDisplayedBlock()\n {\n if (this.editing)\n {\n this.refs.editingBlock.style.display = \"block\"\n this.refs.viewingBlock.style.display = \"none\"\n }\n else\n {\n this.refs.editingBlock.style.display = \"none\"\n this.refs.viewingBlock.style.display = \"block\"\n }\n\n this.updatePopupPosition()\n\n this.updateDisplayedScheme()\n }", "title": "" }, { "docid": "514bea9f54bbae28126ac57233b72966", "score": "0.6176611", "text": "show() {\n return this.css(\"display\", \"block\");\n }", "title": "" }, { "docid": "6ca9c2b3899c9a69a426466235a61d81", "score": "0.61307526", "text": "function ChangeDisplayValue(element, value){\n element.style.display = value;\n}", "title": "" }, { "docid": "7bba6bae8c6ad14b1552385be4a70520", "score": "0.61276895", "text": "function show(element){ \n if (element.style.display == \"none\") {\n element.style.display = \"grid\";\n} else {\n element.style.display = \"none\";\n}}", "title": "" }, { "docid": "8a47e4fc7d651e596cf4bf147964feb9", "score": "0.6088442", "text": "function display(elem, on )\n{\n if (elem != null)\n elem.style.display = on ? '' : 'none';\n}", "title": "" }, { "docid": "aa67a3a5b8710b0a00262fc66e8c04f4", "score": "0.60865396", "text": "function show(element) {\n element.style.visibility = \"visible\";\n}", "title": "" }, { "docid": "e671b59ae4a67b9e824c06c15d6f0aef", "score": "0.6067923", "text": "function setDisplay(elementName, visible) {\r\n document.getElementById(elementName).style.display = (visible ? 'unset' : 'none');\r\n}", "title": "" }, { "docid": "71c8407903b8b8f75f3c820fa24cf67e", "score": "0.6048321", "text": "function changeVisibility(element, visible, display) {\n if (visible) {\n element.style.display = display || \"block\";\n }\n else {\n element.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "de1c9c1650e4ff60078602476ab37810", "score": "0.6025575", "text": "function showElement(element){\n\treturn element.style.display=\"\";\n}", "title": "" }, { "docid": "469fd8d8702961e17646709e2b366e23", "score": "0.600651", "text": "function showElement(elementClass) {\n document.querySelector(elementClass).style.display = \"flex\";\n}", "title": "" }, { "docid": "1839febdff0fdcbad997c59d9dd600c2", "score": "0.5989366", "text": "function showElements(inputEl)\n{\n inputEl.setAttribute(\"class\",\"display\");\n\n}", "title": "" }, { "docid": "43ee6e5c2f7ada20d091d8c82bf3f9a0", "score": "0.5980019", "text": "function show(elt)\n{\n\tdocument.getElementById(elt).style.display = 'block';\n\treturn true;\n}", "title": "" }, { "docid": "c8da4e62e59ab456466fa574a03ee00d", "score": "0.5974156", "text": "show(element) {\n element.attr('visibility', 'visible');\n }", "title": "" }, { "docid": "8b1e5a0a9fab9377109f50aa8026a1e3", "score": "0.5971608", "text": "function changeDisplay (element, displayType, onlyShow) {\n if (onlyShow) {\n removeHide(element);\n addDisplay(element, displayType);\n } else if (displayType === 'flex') {\n removeHide(element)\n addDisplay(element, displayType);\n } else if (displayType === 'block') {\n removeHide(element);\n addDisplay(element, displayType);\n } else if (displayType === 'toggleFlex' || displayType === 'toggleBlock') {\n toggleDisplay(element, displayType);\n } else {\n removeDisplay(element, displayType);\n addHide(element);\n } \n }", "title": "" }, { "docid": "55221cb11ffb265cdb385b964ed2f410", "score": "0.5946979", "text": "function setElementDisplay(elemArray, mode) {\n elemArray.forEach(function (v) {\n v.style.display = mode;\n });\n}", "title": "" }, { "docid": "4c02fc219b934fa3d24e531e0db89380", "score": "0.5940827", "text": "function showElement(nom) {\r\n\tvar element = document.getElementById(nom);\r\n\telement.style.display=\"block\";\r\n}", "title": "" }, { "docid": "211607989f40bd49e10d8a67d2dfc252", "score": "0.59329623", "text": "function showElement( elementSelector, displayStyle ) {\n var element;\n if ( elementSelector && displayStyle ) {\n element = $( elementSelector );\n if ( element && element.length == 1 ) {\n debug && console.log( \"UIFrame.showElement: Showing \" + elementSelector +\n \" using style \" + displayStyle );\n element[0].style.display = displayStyle;\n }\n }\n }", "title": "" }, { "docid": "7bdaffc044a2f4c16d6d3cb520b44de6", "score": "0.5914241", "text": "function ATGSetStyleDisplay(element, display) {\n // display can be any string that can legitimately be set as a value on the \"display\" style for css.\n var error = 0;\n if (getElt(element).style) {\n try {\n getElt(element).style.display = display;\n } catch(e) {\n error = 1;\n }\n } else {\n // Can not access style collection on element.\n error = 2;\n }\n return error;\n}", "title": "" }, { "docid": "ebd471cca3b6f27d20c39c3faaa116a1", "score": "0.5902222", "text": "function show(el_id)\r\n{\r\n\tdocument.getElementById(el_id).style.display='inline';\r\n}", "title": "" }, { "docid": "1a6685523ef41e65bf6b7db43fd91d1f", "score": "0.59015197", "text": "function Insfunc() {\n var x = document.getElementById(\"instructions\");\n // if the is no style display assign to block i.e put the text there\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n }\n // if block or anything else assign to none\n else {\n x.style.display = \"none\"\n }\n }", "title": "" }, { "docid": "52f00a6ce2837347d87e2380919c5f87", "score": "0.58811975", "text": "function trigger(element) {\n if (element.css('display') !== 'none') {\n element.hide();\n } else {\n element.show();\n }\n }", "title": "" }, { "docid": "ab4f8dbb10807df99d44043a795de894", "score": "0.5875718", "text": "function w3_show(el_id, display)\n{\n\tvar el = w3_el(el_id);\n\tw3_remove(el, 'w3-hide');\n\tw3_add(el, display? display : 'w3-show-inline-block');\n\treturn el;\n}", "title": "" }, { "docid": "d2bd83781e05d76d83e38a474794c2d1", "score": "0.58714205", "text": "function showAll(elementID)\n{\n\tvar elementID;\n\tchangeDiv(elementID, \"block\");\n}", "title": "" }, { "docid": "9218b118bdcef7afd0366be67fdf9114", "score": "0.5870855", "text": "function show(el) {\n\tel.width = WIDTH;\n\tel.height = HEIGHT;\n\tel.style.display = \"inline\";\n\topennedElement = el;\n}", "title": "" }, { "docid": "7f7b4b1148735b2894be2f79020a2436", "score": "0.5866368", "text": "hide() {\n\t\tthis.element.classList.remove('display-block');\n\t}", "title": "" }, { "docid": "983d1f3aa0210e5e8aa0bddd41d6b0be", "score": "0.5865394", "text": "function display(element, message) {\n element.innerText = message;\n element.hidden = false;\n}", "title": "" }, { "docid": "1b5f33b45a3c962e642f6f68657ee0bc", "score": "0.58617544", "text": "function displayElGui( el )\n {\n resources.elGui.style.display = \"block\";\n resources.elGui.zindex.value = el.zindex;\n resources.elGui.x.value = el.position.x;\n resources.elGui.y.value = el.position.y;\n resources.elGui.z.value = el.position.z || 0;\n if ( el.isLocked )\n resources.elGui.lock.innerHTML = \"Unlock\";\n else\n resources.elGui.lock.innerHTML = \"Lock\";\n }", "title": "" }, { "docid": "1ddda2f5437379c2c000bbc8f59012ad", "score": "0.5849977", "text": "function show(element){\n if(element.style.display != 'none')\n\treturn false;\n if(element.dataset.style_display){\n\telement.style.display = element.dataset.style_display;\n\tdelete element.dataset.style_display;\n }else{\n\telement.style.display = '';\n }\n return true;\n}", "title": "" }, { "docid": "3e196fd914e392eff07789176b2cfe9d", "score": "0.5849797", "text": "function desplegarBlock () {\n\tblock.style.display = \"block\";\n\tsetTimeout(function () {\n\t\tblock.style.opacity = \"1\";\n\t},150);\n}", "title": "" }, { "docid": "8a555be1b8dbdf06a32c26465a0b8b01", "score": "0.5844825", "text": "function show(el) {\n\t\tel.style.display = '';\n\t}", "title": "" }, { "docid": "40a8d57b27f26e20dfd44712de7c6c2d", "score": "0.5832932", "text": "function hideAndShow(element) {\n element.hide = function() {\n element.DOMElement.style.display = \"none\";\n };\n element.show = function() {\n element.DOMElement.style.display = \"block\";\n };\n }", "title": "" }, { "docid": "86f0f4668898608e38397d0c74eacbca", "score": "0.5827766", "text": "function showElement(elementId)\n{\n var element = document.getElementById(elementId);\n if (element) {\n element.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "51a5bbe35c46de80d3903020c8412b1c", "score": "0.5814108", "text": "function show(el){\r\n el = getList(el);\r\n\r\n for(var i = 0; i<el.length; i++){\r\n el[i].style.display = 'block';\r\n }\r\n return el;\r\n }", "title": "" }, { "docid": "51a5bbe35c46de80d3903020c8412b1c", "score": "0.5814108", "text": "function show(el){\r\n el = getList(el);\r\n\r\n for(var i = 0; i<el.length; i++){\r\n el[i].style.display = 'block';\r\n }\r\n return el;\r\n }", "title": "" }, { "docid": "25596d77e0904cdaa491456a2050776b", "score": "0.58091676", "text": "setVisible(visible) {\n if(visible) {\n this.element.setAttributeNS(null, 'display', 'inline');\n }\n else {\n this.element.setAttributeNS(null, 'display', 'none');\n }\n }", "title": "" }, { "docid": "19585698670a1a3c4f7822fd83f48013", "score": "0.5806298", "text": "function _showPopButtonOnBlock(){\n var htPosition = _getPopButtonPosition();\n\n htElement.welPopButtonOnBlock.show();\n htElement.welPopButtonOnBlock.css({\n \"top\" : htPosition.top + \"px\",\n \"left\": htPosition.left + \"px\"\n });\n }", "title": "" }, { "docid": "660b13312ea0ccb0c3e7ab19dcf1c61f", "score": "0.57607013", "text": "function Muestra(id){\n \n document.getElementById(id).style.display=\"block\";\n \n}", "title": "" }, { "docid": "998c89b93183b1021c61f16965f8d432", "score": "0.5755179", "text": "function div_show() {\n\n document.getElementById('abc').style.display = \"block\";\n}", "title": "" }, { "docid": "98f25171745049a2dc052680afc314ce", "score": "0.5738026", "text": "function div_show() {\n document.getElementById(\"abc\").style.display = \"block\";\n}", "title": "" }, { "docid": "eae2d599358f011e9399a21ac995a5b6", "score": "0.57292503", "text": "function showElement(elem, width, height) {\n\t\t\n\t\t$(elem).show();\n\t\t$(elem).css('visibility', 'visible');\n\t\t$(elem).attr('aria-hidden', 'false');\n\t\t$(elem).attr('aria-expanded', 'true');\n\t\t$(elem).css('left', width);\n\t\t$(elem).css('top', height);\n\t\t\t\n\t\t// mobile toggle of plus/minus squares\n\t\t// FOR 2011 INSTANCE, DISABLE NEXT TWO LINES\t\n\t\t$(elem).parent('li').children('div.togglechild').children('a').children('span.fa').removeClass('fa-plus-square');\n\t\t$(elem).parent('li').children('div.togglechild').children('a').children('span.fa').addClass('fa-minus-square');\n\t\t\n\t\t//console.log($(elem).text());\n\t}", "title": "" }, { "docid": "c25cff30a041cd8d9a49989ef56bb41e", "score": "0.5728069", "text": "function showOrHideElement(element) {\n if (element.hidden == true) {\n showElement(element);\n } else {\n hiddenElement(element);\n }\n}", "title": "" }, { "docid": "bfebcd68ef0361add66165669badeb53", "score": "0.5721523", "text": "function show(elt){\n\telt = getElement(elt);\n\tif(elt){\n\t\telt.style.visibility = 'visible';\n\t}\n}", "title": "" }, { "docid": "bfebcd68ef0361add66165669badeb53", "score": "0.5721523", "text": "function show(elt){\n\telt = getElement(elt);\n\tif(elt){\n\t\telt.style.visibility = 'visible';\n\t}\n}", "title": "" }, { "docid": "fb22923fe17eebc906af45376fed84da", "score": "0.57134753", "text": "function div_show() {\n document.getElementById('abc').style.display = \"block\";\n}", "title": "" }, { "docid": "126f1cdc1f27c08a1b319ee84d7a4449", "score": "0.57059145", "text": "function show(el){el=getList(el);for(var i=0;i<el.length;i++){el[i].style.display='block';}return el;}", "title": "" }, { "docid": "e77623f4547addf8fb62628643c22e72", "score": "0.5703871", "text": "function div_show() {\ndocument.getElementById('abc').style.display = \"block\";\n}", "title": "" }, { "docid": "dbaffa76b562b8439e6b4279822e4c50", "score": "0.5697794", "text": "show(){\n\tthis.node.style.display = \"block\";\n }", "title": "" }, { "docid": "e05c65151955e6b415fda3297fcc03e7", "score": "0.5695985", "text": "function Display(id)\n{\n document.getElementById(id.id).style.display = \"block\";\n}", "title": "" }, { "docid": "e37bd266cad42da037eb8766f64eb674", "score": "0.567511", "text": "function changeElementVisibility(element, show) {\n if (show) {\n element.classList.remove(\"hidden\");\n } else {\n element.classList.add(\"hidden\");\n }\n}", "title": "" }, { "docid": "8d35f4bb0d79a7109d7f98042ca35515", "score": "0.56631297", "text": "function toggleVisibility(element) {\n if(element.style.display != \"block\") {\n element.style.display = \"block\";\n } else {\n element.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "6888aaf1db93902532c02a2e6f2c63c3", "score": "0.5661669", "text": "function isShowing(el) {\n var style = window.getComputedStyle(el);\n return (style.display === 'block');\n}", "title": "" }, { "docid": "25d25bffd03068e901e7a228e0f62a05", "score": "0.5651554", "text": "function $show(id){\r\n\t$(id).style.display = \"inline-block\";\r\n}", "title": "" }, { "docid": "f71d4a5d51b3fbccbea86a330cb4c38a", "score": "0.5649419", "text": "show() {\n return this.each(function() {\n this.style.display = 'block';\n });\n }", "title": "" }, { "docid": "f254260e8a8468a25a52a6155b8e174d", "score": "0.5632892", "text": "__setupBlockerElement() {\n this.__blockerElement = qx.dom.Element.create(\"div\");\n qx.bom.element.Style.setStyles(this.__blockerElement, {\n display: \"block\",\n opacity: this.__defaultBlockerOpacity,\n backgroundColor: this.__defaultBlockerColor\n });\n\n this.setBlockerZIndex(this.__defaultZIndex);\n }", "title": "" }, { "docid": "d9f972b1ae1ffe6583a2945b7d99004a", "score": "0.56298345", "text": "showHiddenElement(element) {\n // check display of actual element and add custom style class for display block etc\n if (getComputedStyle(element, null).display === \"none\") {\n element.classList.add(this.getModalOption(\"targetToggleClass\"));\n }\n // check if element have parent and element is not hidden\n if (element.parentNode && getComputedStyle(element, null).display !== \"none\") {\n if (getComputedStyle(element.parentNode, null).display === \"none\") {\n return element.parentNode.classList.add(this.getModalOption(\"targetToggleClass\"));\n }\n // loop function if nothing founded\n return this.showHiddenElement(element.parentNode);\n }\n }", "title": "" }, { "docid": "fe36a5b32db8125c9950b35bd843f3e5", "score": "0.5615651", "text": "function hideDisplay(element) {\n element.classList.add(\"hidden\");\n}", "title": "" }, { "docid": "e73c3ec09f837efd50c0dec07e36c7ed", "score": "0.5614808", "text": "function div_show() {\n\t\tdocument.getElementById('abc').style.display = \"block\";\n\t}", "title": "" }, { "docid": "f2eb928d3e50d0cff6acefc66cc6b1c0", "score": "0.5612924", "text": "function doFormatting(elementToFormat, displayIcon) {\n if (displayIcon === true) {\n notificationIcon.style.display = \"block\";\n }\n var i;\n for (i = 0; i < elementToFormat.length; i++) {\n var txt = elementToFormat[i].innerHTML;\n elementToFormat[i].innerHTML = txt;\n elementToFormat[i].style.fontWeight = \"bold\";\n }\n}", "title": "" }, { "docid": "b607a204737a8db7491e5f2b0e237e17", "score": "0.5604645", "text": "function show(Id){\n document.getElementById(Id).style.display =\"block\";\n}", "title": "" }, { "docid": "b515bbf67b2326dbb83271f27020e686", "score": "0.5603361", "text": "function block(){\n\tfor (var i = 0; i < button.length; i++){\n\t\tbutton[i].classList.add(\"block\");\n\t}\n}", "title": "" }, { "docid": "25a2cfbcf7f0565286c6ea7811ce75ea", "score": "0.5599492", "text": "function toggleVisibility(element, display) {\n let isInvisible = element.style.display === \"none\";\n element.style.display = isInvisible ? (display || \"block\") : \"none\";\n}", "title": "" }, { "docid": "a4e491223295083d0754653ad04c81d4", "score": "0.5590207", "text": "function show( el, l, t ) {\r\n el.css({ display: 'block', left: l + 'px', top: t + 'px' })\r\n}", "title": "" }, { "docid": "5fb4083855bde737334d01c278900a9a", "score": "0.5589384", "text": "function Display(id)\r\n{\r\n document.getElementById(id.id).style.display = \"block\";\r\n}", "title": "" }, { "docid": "afd19bfdd9913438c4d63e8c89cf17eb", "score": "0.5579469", "text": "function show_important_elements(){\n\tdocument.getElementById('segment_middle_part').style.display\t= \"block\";\n\tdocument.getElementById('groupe_add_container').style.display\t= \"block\";\n\tdocument.getElementById('segment_send_part').style.display\t= \"block\";\n}", "title": "" }, { "docid": "1e06ff51f8d904695d80698a3e0ce068", "score": "0.5578762", "text": "function show(name) {\n let container = document.getElementById(`${name}_real`);\n if (container.getAttribute('style') == \"display:none\") {\n container.setAttribute('style', \"display:block\");\n }\n else if (container.getAttribute('style') == \"display:block\") {\n container.setAttribute('style', 'display:none');\n }\n else {\n container.setAttribute('style', 'display:block');\n }\n}", "title": "" }, { "docid": "e580329eb4eaef70ba09ce54eab58a16", "score": "0.5571654", "text": "function improveClickability(node)\r\n{\r\n\tnode.setAttribute('style', 'display:block');\r\n\tnode.setAttribute('width', '100%');\r\n\tnode.setAttribute('height', '100%');\r\n}", "title": "" }, { "docid": "346fff2cfb52d804527b107e7829a522", "score": "0.55700433", "text": "function toggleDisplay(me){\n\t\t\tif (me.style.display==\"inline\" || me.style.display==\"block\"){\n\t\t\t\tme.style.display=\"none\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tme.style.display=\"block\";\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "9e63b42270b59afdcb328a5f1b4687c8", "score": "0.5568889", "text": "function toggleButton(element) {\n if(element.css('display') === 'none') {\n element.css('display','inline-block') \n } else {\n element.css('display','none');\n }\n}", "title": "" }, { "docid": "c352b34a026ef2bf681ca4e31aef5856", "score": "0.55682856", "text": "function thmrIsBlock(obj) {\n if (obj.style.display == 'block') {\n return true;\n }\n else if (obj.style.display == 'inline' || obj.style.display == 'none') {\n return false;\n }\n if (obj.tagName != undefined) {\n var i = blocks.length;\n if (i > 0) {\n do {\n if (blocks[i] === obj.tagName) {\n return true;\n }\n } while (i--);\n }\n }\n return false;\n }", "title": "" }, { "docid": "6ef184b3b39692dc6a1d098bb40c7d0c", "score": "0.55628437", "text": "function show(x){\n document.getElementById(x).style.display='block';\n}", "title": "" }, { "docid": "18330d1a83e19a056156a4c735551a9b", "score": "0.55617124", "text": "function setPropertySelector(display) {\n propertySelector.style.display = display;\n}", "title": "" }, { "docid": "b13ef3f7f26344c47041326430f1d203", "score": "0.55580914", "text": "function toggleDisplay(element, isSelected) {\n if (isSelected) {\n element.style.display = \"block\";\n }\n else {\n element.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "f78e9f60e512f73d53c39c739fe5fe60", "score": "0.5556338", "text": "function showElement(el, innerEl, zIndex = \"1\") {\n\tel.style.opacity = \"100%\";\n\tif (innerEl) {\n\t\tinnerEl.style.zIndex = zIndex;\n\t} else {\n\t\tel.style.zIndex = zIndex;\n\t}\n}", "title": "" }, { "docid": "4f989f2c6bf12e6d2c08bc9d2df1c118", "score": "0.5552545", "text": "function show(ele) {\n ele.style.visibility = \"visible\";\n ele.style.right = \"0px\";\n }", "title": "" } ]
f2abe0973c3cb62856466b7a0b70c454
Populate buffers with data im going to mess with this to try and draw a second triangle!
[ { "docid": "39e80ccb4f74bc619a352a6eefcee7d9", "score": "0.7161087", "text": "function setupBuffers(triVertices, itemSize, numItems) {\r\n vertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\r\n \r\n var triangleVertices = triVertices; \r\n\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.STATIC_DRAW); // static draw probably isn't great for animated shits!\r\n vertexPositionBuffer.itemSize = itemSize;\r\n vertexPositionBuffer.numberOfItems = numItems;\r\n}", "title": "" } ]
[ { "docid": "96d1b5c4ca657cda4c2f0855eda11974", "score": "0.73977864", "text": "function initialiseBuffer2() {\n \n var vertexData = [\n -0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0,//3\n 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0,//1\n 0.5, 0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0,//2\n\n -0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0,//3\n 0.5, 0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0,//2\n -0.5, 0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 1.0,//4\n //상\n\n -0.5, -0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 2.0, 2.0,//8\n 0.5, -0.5, -0.5, 0.0, 0.0, 1.0, 1.0, -1.0, 2.0,//6\n 0.5, 0.5, -0.5, 0.0, 0.0, 1.0, 1.0, -1.0, -1.0,//2\n\n -0.5, -0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 2.0, 2.0,//8\n 0.5, 0.5, -0.5, 0.0, 0.0, 1.0, 1.0, -1.0, -1.0,//2\n -0.5, 0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 2.0, -1.0,//4\n //옆1\n\n 0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0,//5\n 0.5, -0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0,//6\n 0.5, 0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0,//2\n\n 0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0,//5\n 0.5, 0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0,//2\n 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 1.0,//1\n //옆2\n\n -0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0,//7\n -0.5, -0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0,//8\n -0.5, 0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0,//4\n\n -0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0,//7\n -0.5, 0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0,//4\n -0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0,//3\n //옆3\n\n -0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 2.0, 2.0,//7\n 0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, -1.0, 2.0,//5\n 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 1.0, -1.0, -1.0,//1\n\n -0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 2.0, 2.0,//7\n 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 1.0, -1.0, -1.0,//1\n -0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 2.0, -1.0,//3\n //옆4\t\t\n\n -0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0,//7\n 0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0,//5\n 0.5, -0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0,//6\n\n -0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0,//7\n 0.5, -0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0,//6\n -0.5, -0.5, -0.5, 0.0, 0.0, 1.0, 1.0, 0.0, 1.0,//8\n //하\n\t\n ];\n\n // Generate a buffer object\n gl.vertexBuffer = gl.createBuffer();\n\n // Bind buffer as a vertex buffer so we can fill it with data\n gl.bindBuffer(gl.ARRAY_BUFFER, gl.vertexBuffer);\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexData), gl.STATIC_DRAW);\n\n \n // Create a texture.\n // texture 생성\n\n var animal_texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, animal_texture);\n\n\n\n var animal_images = [\n { location: gl.TEXTURE_CUBE_MAP_POSITIVE_X, src: cuty_cat_src },\n { location: gl.TEXTURE_CUBE_MAP_NEGATIVE_X, src: cuty_cat_src },\n { location: gl.TEXTURE_CUBE_MAP_POSITIVE_Y, src: cuty_dog_src },\n { location: gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, src: cuty_dog_src },\n { location: gl.TEXTURE_CUBE_MAP_POSITIVE_Z, src: cuty_rabbit_src },\n { location: gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, src: cuty_rabbit_src },\n ];\n\n animal_images.forEach(function (animal_image) {\n const location = animal_image.location;\n const src = animal_image.src;\n\n gl.texImage2D(location, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0, 0, 255, 255]));\n\n const image = new Image();\n image.src = src;\n image.addEventListener('load', function () {\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, animal_texture);\n gl.texImage2D(location, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n gl.generateMipmap(gl.TEXTURE_CUBE_MAP);\n });\n });\n\n\n gl.generateMipmap(gl.TEXTURE_CUBE_MAP);\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);\n\n\n return testGLError(\"initialiseBuffers\");\n}", "title": "" }, { "docid": "1f83f97dc5a6d3dc608411365cc927ac", "score": "0.7232913", "text": "function setupBuffers() {\r\n vertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\r\n\r\n var triangleVertices = [\r\n // x y z \r\n // TULISAN C\r\n 0.0, 0.65, 0.0,\r\n -0.60, 0.65, 0.0,\r\n -0.4, 0.4, 0.0,\r\n \r\n // patokan\r\n -0.4, 0.4, 0.0, //R\r\n -0.60, 0.65, 0.0, // G\r\n -0.75, -0.75, 0.0, // B\r\n\r\n -0.75, -0.75, 0.0,\r\n -0.5, -0.5, 0.0,\r\n -0.4, 0.4, 0.0,\r\n\r\n -0.75, -0.75, 0.0,\r\n 0.1, -0.75, 0.0,\r\n -0.5, -0.5, 0.0,\r\n\r\n -0.5, -0.5, 0.0,\r\n 0.1, -0.75, 0.0,\r\n 0.0, -0.5, 0.0,\r\n \r\n //lanjutan atas\r\n 0.0, 0.65, 0.0,\r\n -0.4, 0.4, 0.0,\r\n -0.1, 0.4, 0.0,\r\n\r\n // Tulisan E\r\n //atas\r\n 0.75, 0.65, 0.0,\r\n 0.0, 0.4, 0.0,\r\n 0.65, 0.4, 0.0,\r\n\r\n 0.75, 0.65, 0.0,\r\n 0.1, 0.65, 0.0,\r\n 0.0, 0.4, 0.0,\r\n\r\n //cabang 1\r\n 0.0, 0.4, 0.0,\r\n 0.2, 0.4, 0.0,\r\n 0.1, 0.1, 0.0,\r\n\r\n 0.0, 0.4, 0.0,\r\n -0.115, 0.1, 0.0,\r\n 0.1, 0.1, 0.0,\r\n\r\n // tengah\r\n 0.7, 0.1, 0.0,\r\n -0.38, 0.1, 0.0,\r\n -0.403, -0.1, 0.0,\r\n \r\n 0.7, 0.1, 0.0,\r\n -0.403, -0.1, 0.0,\r\n 0.66, -0.1, 0.0,\r\n\r\n // cabang 2\r\n 0.2, -0.1, 0.0,\r\n 0.0, -0.1, 0.0,\r\n 0.22, -0.75, 0.0,\r\n\r\n 0.2, -0.1, 0.0,\r\n 0.22, -0.75, 0.0,\r\n 0.42, -0.75, 0.0,\r\n \r\n //bawah\r\n 0.60, -0.55, 0.0,\r\n 0.35, -0.55, 0.0,\r\n 0.42, -0.75, 0.0,\r\n\r\n 0.60, -0.55, 0.0,\r\n 0.42, -0.75, 0.0,\r\n 0.5, -0.75, 0.0,\r\n\r\n ];\r\n \r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.STATIC_DRAW);\r\n vertexPositionBuffer.itemSize = 3;\r\n vertexPositionBuffer.numberOfItems = triangleVertices.length / 3;\r\n \r\n vertexColorBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\r\n\r\n //var colors = MultiplyArray([0.0, 0.0, 0.0, 1.0],15);\r\n \r\n var colors = [\r\n //R G B A\r\n // warna C\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0, // 0\r\n\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0, // 1\r\n\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0, // 2\r\n\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0,// 3\r\n\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0, // 4\r\n\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0,\r\n 0.0, 0.0, 0.0, 1.0, // 5\r\n\r\n //Warna E\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,//6\r\n\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 0.0, 1.0,\r\n\r\n ];\r\n \r\n \r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\r\n vertexColorBuffer.itemSize = 4;\r\n vertexColorBuffer.numItems = colors.length/4; \r\n}", "title": "" }, { "docid": "d3141da054c4b12788f8ee57f9f8b685", "score": "0.70351034", "text": "function initBuffers( )\n{\n\n // Generates one triangle complete with vertex normals and vertex colors.\n\n function triangle( p1, p2, p3, isosurface_function, resolution, invert_normals )\n {\n\n // Push the vertices to this triangle face.\n // Pushing point 3, then 2, and then 1 so that the front face of the triangle\n // points outward from the surface.\n\n // Push point 1, then 2, and then 3 so that the front front face of the triangle\n // points inward from the surface.\n\n vertices.push( p3[ 0 ] ); vertices.push( p3[ 1 ] ); vertices.push( p3[ 2 ] );\n vertices.push( p2[ 0 ] ); vertices.push( p2[ 1 ] ); vertices.push( p2[ 2 ] );\n vertices.push( p1[ 0 ] ); vertices.push( p1[ 1 ] ); vertices.push( p1[ 2 ] );\n\n // Calculate the isosurface gradient at point 1, 2, and 3 of the triangle.\n // These three gradient vectors are the vertex normals of this triangle.\n // This will provide a nice smooth appearance when the lighting is calculated.\n // These three gradient vectors will also be the vertex colors.\n\n var invert_normal = 1;\n\n if ( invert_normals === true ) invert_normal = -1;\n\n var vertext_color_alpha = 0.2;\n\n // Point 3.\n\n vertex_normal_x = 0.5 * ( isosurface_function( p3[ 0 ] + 1, p3[ 1 ], p3[ 2 ] ) - isosurface_function( p3[ 0 ] - 1, p3[ 1 ], p3[ 2 ] ) ) / resolution;\n vertex_normal_y = 0.5 * ( isosurface_function( p3[ 0 ], p3[ 1 ] + 1, p3[ 2 ] ) - isosurface_function( p3[ 0 ], p3[ 1 ] - 1, p3[ 2 ] ) ) / resolution;\n vertex_normal_z = 0.5 * ( isosurface_function( p3[ 0 ], p3[ 1 ], p3[ 2 ] + 1 ) - isosurface_function( p3[ 0 ], p3[ 1 ], p3[ 2 ] - 1 ) ) / resolution;\n\n vertex_normal_length = Math.sqrt( ( vertex_normal_x * vertex_normal_x ) + ( vertex_normal_y * vertex_normal_y ) + ( vertex_normal_z * vertex_normal_z ) );\n\n if ( vertex_normal_length !== 0 )\n {\n\n vertex_normal_x = vertex_normal_x / vertex_normal_length;\n vertex_normal_y = vertex_normal_y / vertex_normal_length;\n vertex_normal_z = vertex_normal_z / vertex_normal_length;\n\n }\n\n vertex_normals.push( invert_normal * vertex_normal_x ); vertex_normals.push( invert_normal * vertex_normal_y ); vertex_normals.push( invert_normal * vertex_normal_z );\n\n // Push the vertex colors for this triangle face point.\n\n vertex_colors.push( 1.0 - vertex_normal_x ); vertex_colors.push( 1.0 - vertex_normal_y ); vertex_colors.push( 1.0 - vertex_normal_z ); vertex_colors.push( vertext_color_alpha );\n\n // Point 2.\n\n vertex_normal_x = 0.5 * ( isosurface_function( p2[ 0 ] + 1, p2[ 1 ], p2[ 2 ] ) - isosurface_function( p2[ 0 ] - 1, p2[ 1 ], p2[ 2 ] ) ) / resolution;\n vertex_normal_y = 0.5 * ( isosurface_function( p2[ 0 ], p2[ 1 ] + 1, p2[ 2 ] ) - isosurface_function( p2[ 0 ], p2[ 1 ] - 1, p2[ 2 ] ) ) / resolution;\n vertex_normal_z = 0.5 * ( isosurface_function( p2[ 0 ], p2[ 1 ], p2[ 2 ] + 1 ) - isosurface_function( p2[ 0 ], p2[ 1 ], p2[ 2 ] - 1 ) ) / resolution;\n\n vertex_normal_length = Math.sqrt( ( vertex_normal_x * vertex_normal_x ) + ( vertex_normal_y * vertex_normal_y ) + ( vertex_normal_z * vertex_normal_z ) );\n\n if ( vertex_normal_length !== 0 )\n {\n\n vertex_normal_x = vertex_normal_x / vertex_normal_length;\n vertex_normal_y = vertex_normal_y / vertex_normal_length;\n vertex_normal_z = vertex_normal_z / vertex_normal_length;\n\n }\n\n vertex_normals.push( invert_normal * vertex_normal_x ); vertex_normals.push( invert_normal * vertex_normal_y ); vertex_normals.push( invert_normal * vertex_normal_z );\n\n // Push the vertex colors for this triangle face point.\n\n vertex_colors.push( 1.0 - vertex_normal_x ); vertex_colors.push( 1.0 - vertex_normal_y ); vertex_colors.push( 1.0 - vertex_normal_z ); vertex_colors.push( vertext_color_alpha );\n\n // Point 1.\n\n var vertex_normal_x = 0.5 * ( isosurface_function( p1[ 0 ] + 1, p1[ 1 ], p1[ 2 ] ) - isosurface_function( p1[ 0 ] - 1, p1[ 1 ], p1[ 2 ] ) ) / resolution;\n var vertex_normal_y = 0.5 * ( isosurface_function( p1[ 0 ], p1[ 1 ] + 1, p1[ 2 ] ) - isosurface_function( p1[ 0 ], p1[ 1 ] - 1, p1[ 2 ] ) ) / resolution;\n var vertex_normal_z = 0.5 * ( isosurface_function( p1[ 0 ], p1[ 1 ], p1[ 2 ] + 1 ) - isosurface_function( p1[ 0 ], p1[ 1 ], p1[ 2 ] - 1 ) ) / resolution;\n\n // Normalize.\n\n var vertex_normal_length = Math.sqrt( ( vertex_normal_x * vertex_normal_x ) + ( vertex_normal_y * vertex_normal_y ) + ( vertex_normal_z * vertex_normal_z ) );\n\n if ( vertex_normal_length !== 0 )\n {\n\n vertex_normal_x = vertex_normal_x / vertex_normal_length;\n vertex_normal_y = vertex_normal_y / vertex_normal_length;\n vertex_normal_z = vertex_normal_z / vertex_normal_length;\n\n }\n\n vertex_normals.push( invert_normal * vertex_normal_x ); vertex_normals.push( invert_normal * vertex_normal_y ); vertex_normals.push( invert_normal * vertex_normal_z );\n\n // Push the vertex colors for this triangle face point.\n\n vertex_colors.push( 1.0 - vertex_normal_x ); vertex_colors.push( 1.0 - vertex_normal_y ); vertex_colors.push( 1.0 - vertex_normal_z ); vertex_colors.push( vertext_color_alpha );\n\n }\n\n // The marching cubes algorithm.\n\n function marching_cubes( grid_min, grid_max, resolution, iso_level, isosurface_function, invert_normals )\n {\n\n // Cube grid dimensions.\n\n var cube_grid_axis_min = grid_min;\n var cube_grid_axis_max = grid_max;\n\n // Generate the cube grid scalar field.\n\n /*\n\n j\n |\n | k\n | .\n | .\n | .\n | .\n | .\n |._________________i\n\n */\n\n function Scalar_Point( x, y, z, value )\n {\n\n this.id = x.toFixed( 2 ) + y.toFixed( 2 ) + z.toFixed( 2 );\n\n this.x = x;\n this.y = y;\n this.z = z;\n this.value = value;\n\n }\n\n var scalar_points = { };\n\n for ( var k = cube_grid_axis_min; k <= ( cube_grid_axis_max + resolution ); k += resolution )\n {\n\n for ( var j = cube_grid_axis_min; j <= ( cube_grid_axis_max + resolution ); j += resolution )\n {\n\n for ( var i = cube_grid_axis_min; i <= ( cube_grid_axis_max + resolution ); i += resolution )\n {\n\n var x = i;\n var y = j;\n var z = k;\n\n var value = isosurface_function( x, y, z );\n\n var scalar_point = new Scalar_Point( x, y, z, value );\n\n scalar_points[ scalar_point.id ] = scalar_point;\n\n }\n\n }\n\n }\n\n function edge_intersection_interpolation( cube_va, cube_vb )\n {\n\n if ( Math.abs( iso_level - cube_va.value ) < 0.00001 ) return [ cube_va.x, cube_va.y, cube_va.z ];\n\n if ( Math.abs( iso_level - cube_vb.value ) < 0.00001 ) return [ cube_vb.x, cube_vb.y, cube_vb.z ];\n\n if ( Math.abs( cube_va.value - cube_vb.value ) < 0.00001 ) return [ cube_va.x, cube_va.y, cube_va.z ];\n\n var mean = ( iso_level - cube_va.value ) / ( cube_vb.value - cube_va.value );\n\n var point = [ ];\n\n point.push( cube_va.x + mean * ( cube_vb.x - cube_va.x ) );\n point.push( cube_va.y + mean * ( cube_vb.y - cube_va.y ) );\n point.push( cube_va.z + mean * ( cube_vb.z - cube_va.z ) );\n\n return point;\n }\n\n for ( var k = cube_grid_axis_min; k < cube_grid_axis_max; k += resolution )\n {\n\n for ( var j = cube_grid_axis_min; j < cube_grid_axis_max; j += resolution )\n {\n\n for ( var i = cube_grid_axis_min; i < cube_grid_axis_max; i += resolution )\n {\n\n // Perform the algorithm on one cube in the grid.\n\n // The cube's vertices.\n // There are eight of them.\n\n // 4---------5\n // /| /|\n // / | / |\n // 7---------6 |\n // | | | |\n // | 0------|--1\n // | / | /\n // |/ |/\n // 3---------2\n\n var cube_v3 = scalar_points[ i.toFixed( 2 ) + j.toFixed( 2 ) + k.toFixed( 2 ) ]; // Lower left front corner.\n var cube_v2 = scalar_points[ ( i + resolution ).toFixed( 2 ) + j.toFixed( 2 ) + k.toFixed( 2 ) ]; // Lower right front corner.\n var cube_v6 = scalar_points[ ( i + resolution ).toFixed( 2 ) + ( j + resolution ).toFixed( 2 ) + k.toFixed( 2 ) ]; // Upper right front corner.\n var cube_v7 = scalar_points[ i.toFixed( 2 ) + ( j + resolution ).toFixed( 2 ) + k.toFixed( 2 ) ]; // Upper left front corner\n\n var cube_v0 = scalar_points[ i.toFixed( 2 ) + j.toFixed( 2 ) + ( k + resolution ).toFixed( 2 ) ]; // Lower left back corner.\n var cube_v1 = scalar_points[ ( i + resolution ).toFixed( 2 ) + j.toFixed( 2 ) + ( k + resolution ).toFixed( 2 ) ]; // Lower right back corner.\n var cube_v5 = scalar_points[ ( i + resolution ).toFixed( 2 ) + ( j + resolution ).toFixed( 2 ) + ( k + resolution ).toFixed( 2 ) ]; // Upper right back corner.\n var cube_v4 = scalar_points[ i.toFixed( 2 ) + ( j + resolution ).toFixed( 2 ) + ( k + resolution ).toFixed( 2 ) ]; // Upper left back corner.\n\n var cube_index = 0;\n\n if ( cube_v0.value < iso_level ) cube_index |= 1;\n if ( cube_v1.value < iso_level ) cube_index |= 2;\n if ( cube_v2.value < iso_level ) cube_index |= 4;\n if ( cube_v3.value < iso_level ) cube_index |= 8;\n if ( cube_v4.value < iso_level ) cube_index |= 16;\n if ( cube_v5.value < iso_level ) cube_index |= 32;\n if ( cube_v6.value < iso_level ) cube_index |= 64;\n if ( cube_v7.value < iso_level ) cube_index |= 128;\n\n // Does the isosurface not intersect any edges of the cube?\n\n if ( marching_cubes_edge_table[ cube_index ] === 0 ) continue;\n\n // What edges of the cube does the isosurface intersect?\n // For each cube edge intersected, interpolate an intersection vertex between the edge's incident vertices.\n // These vertices of intersection will form the triangle(s) that approximate the isosurface.\n\n // There are 12 edges in a cube.\n\n // 4----5----5\n // 8 /| 6/|\n // / |9 / | 10\n // 7----7----6 |\n // | | | |\n // 12 | 0---1--|--1\n // | / | /\n // |/ 4 11 |/ 2\n // 3----3----2\n //\n // 1={0,1}, 2={1,2}, 3={2,3}, 4={3,0},\n // 5={4,5}, 6={5,6}, 7={6,7}, 8={7,4},\n // 9={0,4}, 10={5,1}, 11={2,6}, 12={3,7}\n\n // Base ten slot: 2048 | 1024 | 512 | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1\n // Base two slot: 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0\n // Edge slot: 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1\n\n var vertices_of_intersection = [ ];\n\n // Fill allocate the array.\n\n for ( var c = 0; c < 12; ++c )\n {\n\n vertices_of_intersection.push( [ 0, 0, 0 ] );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 1 ) // Intersects edge one.\n {\n\n vertices_of_intersection[ 0 ] = edge_intersection_interpolation( cube_v0, cube_v1 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 2 ) // Intersects edge two.\n {\n\n vertices_of_intersection[ 1 ] = edge_intersection_interpolation( cube_v1, cube_v2 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 4 ) // Intersects edge three.\n {\n\n vertices_of_intersection[ 2 ] = edge_intersection_interpolation( cube_v2, cube_v3 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 8 ) // Intersects edge four.\n {\n\n vertices_of_intersection[ 3 ] = edge_intersection_interpolation( cube_v3, cube_v0 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 16 ) // Intersects edge five.\n {\n\n vertices_of_intersection[ 4 ] = edge_intersection_interpolation( cube_v4, cube_v5 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 32 ) // Intersects edge six.\n {\n\n vertices_of_intersection[ 5 ] = edge_intersection_interpolation( cube_v5, cube_v6 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 64 ) // Intersects edge seven.\n {\n\n vertices_of_intersection[ 6 ] = edge_intersection_interpolation( cube_v6, cube_v7 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 128 ) // Intersects edge eight.\n {\n\n vertices_of_intersection[ 7 ] = edge_intersection_interpolation( cube_v7, cube_v4 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 256 ) // Intersects edge nine.\n {\n\n vertices_of_intersection[ 8 ] = edge_intersection_interpolation( cube_v0, cube_v4 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 512 ) // Intersects edge ten.\n {\n\n vertices_of_intersection[ 9 ] = edge_intersection_interpolation( cube_v1, cube_v5 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 1024 ) // Intersects edge eleven.\n {\n\n vertices_of_intersection[ 10 ] = edge_intersection_interpolation( cube_v2, cube_v6 );\n\n }\n\n if ( marching_cubes_edge_table[ cube_index ] & 2048 ) // Intersects edge twelve.\n {\n\n vertices_of_intersection[ 11 ] = edge_intersection_interpolation( cube_v3, cube_v7 );\n\n }\n\n // Create the triangles.\n // Three vertices make up a triangle per iteration.\n\n for ( var a = 0; marching_cubes_triangle_table[ cube_index ][ a ] != -1; a = a + 3 )\n {\n\n var v1 = vertices_of_intersection[ marching_cubes_triangle_table[ cube_index ][ a ] ];\n var v2 = vertices_of_intersection[ marching_cubes_triangle_table[ cube_index ][ a + 1 ] ];\n var v3 = vertices_of_intersection[ marching_cubes_triangle_table[ cube_index ][ a + 2 ] ];\n\n triangle( v1, v2, v3, isosurface_function, resolution, invert_normals );\n\n }\n\n }\n\n }\n\n }\n\n }\n\n // Begin creating the isosurfaces.\n\n // First isosurface.\n\n // Temporary arrays to hold all of the data that will be read into the buffers.\n\n var vertices = [ ];\n var vertex_normals = [ ];\n var vertex_colors = [ ];\n\n function isosurface_function( x, y, z )\n {\n\n // Goursat's surface.\n\n var x2 = x * x;\n var y2 = y * y;\n var z2 = z * z;\n\n var x4 = x2 * x2;\n var y4 = y2 * y2;\n var z4 = z2 * z2;\n\n var a = -1.0;\n var b = 0.0;\n var c = 0.5;\n\n var d = x2 + y2 + z2;\n var d2 = d * d;\n\n var value = x4 + y4 + z4 + a * d2 + b * d + c;\n\n return value;\n\n }\n\n // Grid min, grid max, resolution, iso-level, isosurface function, and invert normals.\n // Do not set the resolution to small.\n\n marching_cubes( -1.0, 1.0, 0.07, 0, isosurface_function, false );\n\n // Create the vertex buffer and bind it getting it ready to read in the vertices to the isosurface.\n\n isosurfaceVertexPositionBuffer = gl.createBuffer( );\n\n gl.bindBuffer( gl.ARRAY_BUFFER, isosurfaceVertexPositionBuffer );\n\n // Bind and fill the isosurface vertices.\n\n gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( vertices ), gl.STATIC_DRAW );\n isosurfaceVertexPositionBuffer.itemSize = 3;\n isosurfaceVertexPositionBuffer.numItems = vertices.length / 3;\n\n // Bind and fill the isosurface vertex normals.\n\n isosurfaceVertexNormalBuffer = gl.createBuffer( );\n gl.bindBuffer( gl.ARRAY_BUFFER, isosurfaceVertexNormalBuffer );\n\n gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( vertex_normals ), gl.STATIC_DRAW );\n isosurfaceVertexNormalBuffer.itemSize = 3;\n isosurfaceVertexNormalBuffer.numItems = vertex_normals.length / 3;\n\n // Bind and fill the isosurface vertex colors.\n\n isosurfaceVertexColorBuffer = gl.createBuffer( );\n gl.bindBuffer( gl.ARRAY_BUFFER, isosurfaceVertexColorBuffer );\n\n gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( vertex_colors ), gl.STATIC_DRAW );\n isosurfaceVertexColorBuffer.itemSize = 4;\n isosurfaceVertexColorBuffer.numItems = vertex_colors.length / 4;\n\n // Second isosurface.\n\n if ( init_buffers_called === 0 )\n {\n\n vertices = [ ];\n vertex_normals = [ ];\n vertex_colors = [ ];\n\n function isosurface_function1( x, y, z )\n {\n\n // The Taubin (heart) surface.\n\n // Swapped y and z from the standard formula.\n\n var x2 = x * x;\n var z2 = z * z;\n var y2 = y * y;\n var y3 = y * y * y;\n\n var a = x2 + ( 9 / 4 ) * z2 + y2 - 1;\n var a3 = a * a * a;\n\n var value = a3 - ( x2 * y3 ) - ( ( 9 / 80 ) * z2 * y3 );\n\n return value;\n\n }\n\n // Grid min, grid max, resolution, iso-level, isosurface function, and invert normals.\n // Do not set the resolution to small.\n\n marching_cubes( -1.5, 1.5, 0.08, 0, isosurface_function1, false );\n\n // Create the vertex buffer and bind it getting it ready to read in the vertices to the isosurface.\n\n isosurface1VertexPositionBuffer = gl.createBuffer( );\n\n gl.bindBuffer( gl.ARRAY_BUFFER, isosurface1VertexPositionBuffer );\n\n // Bind and fill the isosurface vertices.\n\n gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( vertices ), gl.STATIC_DRAW );\n isosurface1VertexPositionBuffer.itemSize = 3;\n isosurface1VertexPositionBuffer.numItems = vertices.length / 3;\n\n // Bind and fill the isosurface vertex normals.\n\n isosurface1VertexNormalBuffer = gl.createBuffer( );\n gl.bindBuffer( gl.ARRAY_BUFFER, isosurface1VertexNormalBuffer );\n\n gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( vertex_normals ), gl.STATIC_DRAW );\n isosurface1VertexNormalBuffer.itemSize = 3;\n isosurface1VertexNormalBuffer.numItems = vertex_normals.length / 3;\n\n // Bind and fill the isosurface vertex colors.\n\n isosurface1VertexColorBuffer = gl.createBuffer( );\n gl.bindBuffer( gl.ARRAY_BUFFER, isosurface1VertexColorBuffer );\n\n gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( vertex_colors ), gl.STATIC_DRAW );\n isosurface1VertexColorBuffer.itemSize = 4;\n isosurface1VertexColorBuffer.numItems = vertex_colors.length / 4;\n\n }\n\n // Point light representation.\n\n if ( init_buffers_called === 0 ) // Do not recreate the point light sphere more than once.\n {\n\n vertices = [ ];\n vertex_normals = [ ];\n vertex_colors = [ ];\n\n function isosurface_function2( x, y, z )\n {\n\n // A sphere.\n\n var value = ( ( x - 0 ) * ( x - 0 ) ) +\n ( ( y - 0 ) * ( y - 0 ) ) +\n ( ( z - 0 ) * ( z - 0 ) ) -\n ( ( 0.5 ) * ( 0.5 ) );\n\n return value;\n\n }\n\n // Grid min, grid max, resolution, iso-level, isosurface function, and invert normals.\n // Do not set the resolution to small.\n\n marching_cubes( -2, 2, 0.2, 0, isosurface_function2, false );\n\n // Make the sphere bright white.\n\n for ( var i = 0; i < vertex_colors.length; i += 4 )\n {\n\n vertex_colors[ i ] = 200.0;\n vertex_colors[ i + 1 ] = 200.0;\n vertex_colors[ i + 2 ] = 200.0;\n vertex_colors[ i + 3 ] = 1.0;\n\n }\n\n // Create the vertex buffer and bind it getting it ready to read in the vertices to the isosurface.\n\n pointLightSphereVertexPositionBuffer = gl.createBuffer( );\n\n gl.bindBuffer( gl.ARRAY_BUFFER, pointLightSphereVertexPositionBuffer );\n\n // Bind and fill the isosurface vertices.\n\n gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( vertices ), gl.STATIC_DRAW );\n pointLightSphereVertexPositionBuffer.itemSize = 3;\n pointLightSphereVertexPositionBuffer.numItems = vertices.length / 3;\n\n // Bind and fill the isosurface vertex normals.\n\n pointLightSphereVertexNormalBuffer = gl.createBuffer( );\n gl.bindBuffer( gl.ARRAY_BUFFER, pointLightSphereVertexNormalBuffer );\n\n gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( vertex_normals ), gl.STATIC_DRAW );\n pointLightSphereVertexNormalBuffer.itemSize = 3;\n pointLightSphereVertexNormalBuffer.numItems = vertex_normals.length / 3;\n\n // Bind and fill the isosurface vertex colors.\n\n pointLightSphereVertexColorBuffer = gl.createBuffer( );\n gl.bindBuffer( gl.ARRAY_BUFFER, pointLightSphereVertexColorBuffer );\n\n gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( vertex_colors ), gl.STATIC_DRAW );\n pointLightSphereVertexColorBuffer.itemSize = 4;\n pointLightSphereVertexColorBuffer.numItems = vertex_colors.length / 4;\n\n }\n\n init_buffers_called += 1;\n\n}", "title": "" }, { "docid": "6ca0e407dc25504884485579c7fca4a8", "score": "0.70016384", "text": "function initTriangleBuffers(){\n let vertices;\n let colors;\n \n triangleVertexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexBuffer);\n vertices = [\n 0.0, 1.0, 0.0,\n -1.0, -1.0, 0.0,\n 1.0, -1.0, 0.0\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n triangleVertexBuffer.itemSize = 3;\n triangleVertexBuffer.numItems = 3;\n \n triangleVertexColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexColorBuffer);\n colors = [\n 1.0, 0.0, 0.0, 1.0,\n 0.0, 1.0, 0.0, 1.0,\n 0.0, 0.0, 1.0, 1.0\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n triangleVertexColorBuffer.itemSize = 4;\n triangleVertexColorBuffer.numItems = 3;\n}", "title": "" }, { "docid": "3a7bb129e7082c2fb0c5619592c9d00a", "score": "0.6978711", "text": "function makeTriangleAndBuffer(){\n var trianglePoints = []; //empty array\n\n //create 3 vertices and add them to the array\n //since we haven't talked about projection yet, we need to stay between -1 and 1 since that's the default volume\n trianglePoints.push(vec4(-0.5, -0.5, 0, 1));\n trianglePoints.push(vec4(0, 0.5, 0, 1));\n trianglePoints.push(vec4(0.5, -0.5, 0, 1));\n\n //we need some graphics memory for this information\n var bufferId = gl.createBuffer();\n //tell WebGL that the buffer we just created is the one we want to work with right now\n gl.bindBuffer(gl.ARRAY_BUFFER, bufferId);\n //send the local data over to this buffer on the graphics card. Note our use of Angel's \"flatten\" function\n gl.bufferData(gl.ARRAY_BUFFER, flatten(trianglePoints), gl.STATIC_DRAW);\n\n //What is this data going to be used for?\n //The vertex shader has an attribute named \"vPosition\". Let's associate this data to that attribute\n var vPosition = gl.getAttribLocation(program, \"vPosition\");\n //attribute location we just fetched, 4 elements in each vector, data type float, don't normalize this data,\n //data has no gaps, and starts right away at index 0\n gl.vertexAttribPointer(vPosition, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(vPosition);\n}", "title": "" }, { "docid": "da74b95bdddd5878d1d4bd88efe78ae7", "score": "0.69164723", "text": "function initBuffers() {\r\n // TODO: The vertices and colors of the triangle\r\n let coords = [0, 1, -1, -1, 1, -1];\r\n let colors = [1, 0, 0, 0, 1, 0, 0, 0, 1];\r\n\r\n // TODO: Create and bind VAO\r\n gl.triangleVAO = gl.createVertexArray();\r\n gl.bindVertexArray(gl.triangleVAO);\r\n\r\n // TODO: Load the vertex coordinate data onto the GPU and associate with attribute\r\n let posBuffer = gl.createBuffer(); // create a new buffer\r\n gl.bindBuffer(gl.ARRAY_BUFFER, posBuffer); // bind to the new buffer\r\n gl.bufferData(gl.ARRAY_BUFFER, Float32Array.from(coords), gl.STATIC_DRAW); // load the data into the buffer\r\n gl.vertexAttribPointer(gl.program.aPosition, 2, gl.FLOAT, false, 0, 0); // associate the buffer with \"aPosition\" as length-2 vectors of floats\r\n gl.enableVertexAttribArray(gl.program.aPosition); // enable this set of data\r\n\r\n // TODO: Load the vertex color data onto the GPU and associate with attribute\r\n let colorBuffer = gl.createBuffer(); // create a new buffer\r\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer); // bind to the new buffer\r\n gl.bufferData(gl.ARRAY_BUFFER, Float32Array.from(colors), gl.STATIC_DRAW); // load the data into the buffer\r\n gl.vertexAttribPointer(gl.program.aColor, 3, gl.FLOAT, false, 0, 0); // associate the buffer with \"aColor\" as length-3 vectors of floats\r\n gl.enableVertexAttribArray(gl.program.aColor); // enable this set of data\r\n\r\n // TODO: Cleanup\r\n gl.bindVertexArray(null);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\r\n}", "title": "" }, { "docid": "16acefce5658372a0378240d96d0ea5f", "score": "0.68783784", "text": "generateTriangles()\r\n{\r\n //Your code here\r\n var x_amount = (this.maxX - this.minX) / this.div\r\n var y_amount = (this.maxY - this.minY) / this.div\r\n\r\n for (var i = 0; i <= this.div; i++) {\r\n for (var j = 0; j <= this.div; j++) {\r\n this.vBuffer.push(j*x_amount + this.minX)\r\n this.vBuffer.push(this.minY + i*y_amount)\r\n this.vBuffer.push(0)\r\n\r\n this.nBuffer.push(0)\r\n this.nBuffer.push(0)\r\n this.nBuffer.push(1)\r\n }\r\n }\r\n\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 vid = i*(this.div+1) + j\r\n\r\n this.fBuffer.push(vid)\r\n this.fBuffer.push(vid + this.div+1)\r\n this.fBuffer.push(vid + this.div+2)\r\n\r\n this.fBuffer.push(vid)\r\n this.fBuffer.push(vid+1)\r\n this.fBuffer.push(vid + this.div+2)\r\n }\r\n }\r\n \r\n this.numVertices = this.vBuffer.length/3;\r\n this.numFaces = this.fBuffer.length/3;\r\n}", "title": "" }, { "docid": "7952887894cf40f5a5da0515a8477701", "score": "0.6864369", "text": "function initBuffers() {\t\n\t\n\t// Coordinates Cube\n\t\t\n\tcubeVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\tcubeVertexPositionBuffer.itemSize = 3;\n\tcubeVertexPositionBuffer.numItems = vertices.length / 3;\t\n\t\n\t// Coordinates Parede\n\t\n\tParedeVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, ParedeVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verticesParede63), gl.STATIC_DRAW);\n\tParedeVertexPositionBuffer.itemSize = 3;\n\tParedeVertexPositionBuffer.numItems = verticesParede63.length / 3;\t\n\n\t// Colors Cube\n\t\t\n\tcubeVertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n\tcubeVertexColorBuffer.itemSize = 3;\n\tcubeVertexColorBuffer.numItems = vertices.length / 3;\n\t//Colors Background\n\tbackVertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, backVertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors1), gl.STATIC_DRAW);\n\tbackVertexColorBuffer.itemSize = 3;\n\tbackVertexColorBuffer.numItems = vertices.length / 3;\n\t//Colors Background2\n\tback2VertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, back2VertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors2), gl.STATIC_DRAW);\n\tback2VertexColorBuffer.itemSize = 3;\n\tback2VertexColorBuffer.numItems = vertices.length / 3;\n\n\t// Colors Parede\n\t\n\tParedeVertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, ParedeVertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colorsp63), gl.STATIC_DRAW);\n\tParedeVertexColorBuffer.itemSize = 3;\n\tParedeVertexColorBuffer.numItems = verticesParede63.length / 3;\t\n\n\t// Vertex indices Cube\n\t\n cubeVertexIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeVertexIndexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(cubeVertexIndices), gl.STATIC_DRAW);\n cubeVertexIndexBuffer.itemSize = 1;\n cubeVertexIndexBuffer.numItems = 36;\n \n\n\t// Vertex indices Parede\n\t\n ParedeVertexIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ParedeVertexIndexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(parede63VertexIndx), gl.STATIC_DRAW);\n ParedeVertexIndexBuffer.itemSize = 1;\n ParedeVertexIndexBuffer.numItems = 72;\n}", "title": "" }, { "docid": "a1bcc77dc9d1e1349dd310c8ea697d1a", "score": "0.6861261", "text": "initBuffers() {\n this.vertices = [];\n\n\t\t//Counter-clockwise reference of vertices\n\t\tthis.indices = [];\n\n\t\t//Facing Z positive\n this.normals = [];\n\n this.texCoords = [];\n\n var s1 = this.sl + 1;\n var l1 = this.lp + 1;\n \n for(var phi = 0,slices = 0; slices < s1 ; phi+=this.dp,slices+=1){\n for(var thetha = 0 + Math.PI, loops = 0; loops<l1; thetha+= this.dt,loops+=1){\n var R = (this.r1 + this.r2 * Math.cos(thetha));\n\n var nx = Math.cos(phi)*Math.cos(thetha);\n var ny = Math.sin(phi)*Math.cos(thetha);\n var nz = Math.sin(thetha);\n \n this.normals.push(nx,ny,nz);//TODO:: Check if normals are correct calculated\n this.vertices.push(R*Math.cos(phi),R*Math.sin(phi),this.r2 * Math.sin(thetha)); \n\n this.texCoords.push(slices/(s1), loops/(l1));\n\n this.indices.push(slices*(l1)+ (loops + 1) % (l1),slices*(l1)+ loops , ((slices+1)%(s1))*(l1)+ loops);\n this.indices.push(slices*(l1)+ (loops + 1) % (l1),((slices+1)%(s1))*(l1)+ loops,((slices+1)%(s1))*(l1)+ (loops + 1) % (l1));\n \n\n }\n }\n\n this.primitiveType = this.scene.gl.TRIANGLES;\n this.initGLBuffers();\n }", "title": "" }, { "docid": "7ac6eb9a30ddad04609028e1715f7877", "score": "0.68092865", "text": "generateTriangles() {\n //Your code here\n var deltaX = (this.maxX - this.minX) / this.div;\n var deltaY = (this.maxY - this.minY) / this.div;\n\n for (var i = 0; i <= this.div; i++) {\n for (var j = 0; j <= this.div; j++) {\n this.vBuffer.push(this.minX + deltaX * j);\n this.vBuffer.push(this.minY + deltaY * i);\n this.vBuffer.push(0);\n\n this.nBuffer.push(0);\n this.nBuffer.push(0);\n this.nBuffer.push(1);\n }\n }\n\n for (var i = 0; i < this.div; i++) {\n for (var j = 0; j < this.div; j++) {\n var vid = i * (this.div + 1) + j;\n this.fBuffer.push(vid);\n this.fBuffer.push(vid + 1);\n this.fBuffer.push(vid + this.div + 1);\n\n this.fBuffer.push(vid + 1);\n this.fBuffer.push(vid + 1 + this.div + 1);\n this.fBuffer.push(vid + this.div + 1);\n }\n }\n\n\n //\n this.numVertices = this.vBuffer.length / 3;\n this.numFaces = this.fBuffer.length / 3;\n }", "title": "" }, { "docid": "44fffdffb2713c66b406714f68bf04df", "score": "0.68072915", "text": "function setupBuffers() {\n vertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\n var triangleVertices = [\n //blue top rectangle\n 0.893, 0.956, 0.0,\n 0.893, 0.665, 0.0,\n -0.893, 0.665, 0.0,\n\n 0.893, 0.956, 0.0,\n -0.893, 0.956, 0.0,\n -0.893, 0.665, 0.0,\n\n //blue right big rectangle\n 0.715, 0.665, 0.0,\n 0.715,-0.307, 0.0,\n 0.324,-0.307, 0.0,\n\n 0.715, 0.665, 0.0,\n 0.324, 0.665, 0.0,\n 0.324,-0.307, 0.0,\n\n //blue left big rectangle\n -0.715, 0.665, 0.0,\n -0.715,-0.307, 0.0,\n -0.324,-0.307, 0.0,\n\n -0.715, 0.665, 0.0,\n -0.324, 0.665, 0.0,\n -0.324,-0.307, 0.0,\n\n //blue right small rectangle\n 0.182, 0.378, 0.0,\n 0.182,-0.048, 0.0,\n 0.324,-0.048, 0.0,\n\n 0.182, 0.378, 0.0,\n 0.324, 0.378, 0.0,\n 0.324,-0.048, 0.0,\n\n //blue left small rectangle\n -0.182, 0.378, 0.0,\n -0.182,-0.048, 0.0,\n -0.324,-0.048, 0.0,\n\n -0.182, 0.378, 0.0,\n -0.324, 0.378, 0.0,\n -0.324,-0.048, 0.0,\n\n //orange right most\n 0.715,-0.369, 0.0,\n 0.715,-0.502, 0.0,\n 0.585,-0.369, 0.0,\n\n 0.585,-0.369, 0.0,\n 0.715,-0.502, 0.0,\n 0.585,-0.58, 0.0,\n\n //orange second right\n 0.325,-0.369, 0.0,\n 0.455,-0.63, 0.0,\n 0.455,-0.369, 0.0,\n\n 0.325,-0.369, 0.0,\n 0.455,-0.63, 0.0,\n 0.325,-0.70, 0.0,\n\n //orange third right\n 0.065,-0.369, 0.0,\n 0.195,-0.369, 0.0,\n 0.195,-0.75, 0.0,\n\n 0.065,-0.369, 0.0,\n 0.195,-0.75, 0.0,\n 0.065,-0.80, 0.0,\n\n //orange left most\n -0.715,-0.369, 0.0,\n -0.715,-0.502, 0.0,\n -0.585,-0.369, 0.0,\n\n -0.585,-0.369, 0.0,\n -0.715,-0.502, 0.0,\n -0.585,-0.58, 0.0,\n\n //orange second left\n -0.325,-0.369, 0.0,\n -0.455,-0.63, 0.0,\n -0.455,-0.369, 0.0,\n\n -0.325,-0.369, 0.0,\n -0.455,-0.63, 0.0,\n -0.325,-0.70, 0.0,\n\n //orange third left\n -0.065,-0.369, 0.0,\n -0.195,-0.369, 0.0,\n -0.195,-0.75, 0.0,\n\n -0.065,-0.369,0.0,\n -0.195,-0.75, 0.0,\n -0.065,-0.80, 0.0,\n ];\n \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.STATIC_DRAW);\n vertexPositionBuffer.itemSize = 3; //x,y,z coordinates. \n vertexPositionBuffer.numberOfItems = 66; //22 triangles in total. \n \n vertexColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\n var colors = [\n //Blue part color. \n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n 0.058, 0.114, 0.227, 1.0,\n\n //red-orange part color. \n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n 0.9, 0.192, 0.176, 1.0,\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n vertexColorBuffer.itemSize = 4; //RGB\n vertexColorBuffer.numItems = 66; //22 triangles in total. \n}", "title": "" }, { "docid": "0e8c749d7426933c022e1a7bc2317790", "score": "0.68053913", "text": "setUpWebGLBuffers(){\n this.webglPosBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.webglPosBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.posBuffer), gl.STATIC_DRAW);\n this.webglPosBuffer.itemSize = 3;\n this.webglPosBuffer.numItems = this.posBuffer.length / 3;\n\n if (this.normalBuffer){\n this.webglNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.webglNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.normalBuffer), gl.STATIC_DRAW);\n this.webglNormalBuffer.itemSize = 3;\n this.webglNormalBuffer.numItems = this.normalBuffer.length / 3;\n }\n\n if (this.tangentBuffer){\n this.webglTangentBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.webglTangentBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.tangentBuffer), gl.STATIC_DRAW);\n this.webglTangentBuffer.itemSize = 3;\n this.webglTangentBuffer.numItems = this.tangentBuffer.length / 3;\n }\n\n if (this.colorBuffer){\n this.webglColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.webglColorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.colorBuffer), gl.STATIC_DRAW);\n this.webglColorBuffer.itemSize = 3;\n this.webglColorBuffer.numItems = this.colorBuffer.length / 3;\n }\n\n if (this.textureBuffer){\n this.webglTextureBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.webglTextureBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.textureBuffer), gl.STATIC_DRAW);\n this.webglTextureBuffer.itemSize = 2;\n this.webglTextureBuffer.numItems = this.textureBuffer.length / 2;\n }\n\n this.webglIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.webglIndexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.indexBuffer), gl.STATIC_DRAW);\n this.webglIndexBuffer.itemSize = 1;\n this.webglIndexBuffer.numItems = this.indexBuffer.length;\n }", "title": "" }, { "docid": "cee6366c6cdad3100b79cd77c64219cf", "score": "0.67972237", "text": "genBuffer(){\n\t\tvar l = this.nbPoints*3;\n\t\tthis.buffer = new Float32Array(l);\n\t\tfor(var i=0, j=0; i<this.nbPoints; i+=3, j++) {\n\t\t\tthis.buffer[i] \t\t= this.vertices[j].x\n\t\t\tthis.buffer[i + 1] \t= this.vertices[j].y\n\t\t\tthis.buffer[i + 2] \t= this.vertices[j].z\n\t\t}\n\t\treturn this.buffer;\n\t}", "title": "" }, { "docid": "b03661befe4dbd545be47a15e785ebe8", "score": "0.6787547", "text": "function initBuffers2() {\t\n\n // Coordinates\n cubeVertexPositionBuffer2 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexPositionBuffer2);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(vertices), gl2.STATIC_DRAW);\n cubeVertexPositionBuffer2.itemSize = 3;\n cubeVertexPositionBuffer2.numItems = vertices.length / 3;\t\t\t\n\n // Colors, cada buffer para cada cubo que so tem uma cor\n\n\n cubeVertexColorBuffer1 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer1);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer1.itemSize = 3;\n cubeVertexColorBuffer1.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer2 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer2);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer2.itemSize = 3;\n cubeVertexColorBuffer2.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer3 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer3);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer3.itemSize = 3;\n cubeVertexColorBuffer3.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer4 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer4);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer4.itemSize = 3;\n cubeVertexColorBuffer4.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer5 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer5);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer5.itemSize = 3;\n cubeVertexColorBuffer5.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer6 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer6);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer6.itemSize = 3;\n cubeVertexColorBuffer6.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer7 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer7);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer7.itemSize = 3;\n cubeVertexColorBuffer7.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer8 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer8);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer8.itemSize = 3;\n cubeVertexColorBuffer8.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer9 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer9);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer9.itemSize = 3;\n cubeVertexColorBuffer9.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer10 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer10);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer10.itemSize = 3;\n cubeVertexColorBuffer10.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer11 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer11);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer11.itemSize = 3;\n cubeVertexColorBuffer11.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer12 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer12);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer12.itemSize = 3;\n cubeVertexColorBuffer12.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer13 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer13);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer13.itemSize = 3;\n cubeVertexColorBuffer13.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer14 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer14);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer14.itemSize = 3;\n cubeVertexColorBuffer14.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer15 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer15);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer15.itemSize = 3;\n cubeVertexColorBuffer15.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer16 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer16);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer16.itemSize = 3;\n cubeVertexColorBuffer16.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer17 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer17);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer17.itemSize = 3;\n cubeVertexColorBuffer17.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer18 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer18);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer18.itemSize = 3;\n cubeVertexColorBuffer18.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer19 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer19);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer19.itemSize = 3;\n cubeVertexColorBuffer19.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer20 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer20);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer20.itemSize = 3;\n cubeVertexColorBuffer20.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer21 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer21);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer21.itemSize = 3;\n cubeVertexColorBuffer21.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer22 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer22);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer22.itemSize = 3;\n cubeVertexColorBuffer22.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer23 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer23);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer23.itemSize = 3;\n cubeVertexColorBuffer23.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer24 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer24);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer24.itemSize = 3;\n cubeVertexColorBuffer24.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer25 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer25);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer25.itemSize = 3;\n cubeVertexColorBuffer25.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer26 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer26);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer26.itemSize = 3;\n cubeVertexColorBuffer26.numItems = vertices.length / 3;\t\t\t\n\n colors.splice(0, 72);\n\n cubeVertexColorBuffer27 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ARRAY_BUFFER, cubeVertexColorBuffer27);\n gl2.bufferData(gl2.ARRAY_BUFFER, new Float32Array(colors), gl2.STATIC_DRAW);\n cubeVertexColorBuffer27.itemSize = 3;\n cubeVertexColorBuffer27.numItems = vertices.length / 3;\t\t\t\n // Vertex indices\n cubeVertexIndexBuffer2 = gl2.createBuffer();\n gl2.bindBuffer(gl2.ELEMENT_ARRAY_BUFFER, cubeVertexIndexBuffer2);\n gl2.bufferData(gl2.ELEMENT_ARRAY_BUFFER, new Uint16Array(cubeVertexIndices), gl2.STATIC_DRAW);\n cubeVertexIndexBuffer2.itemSize = 1;\n cubeVertexIndexBuffer2.numItems = 36;\n}", "title": "" }, { "docid": "9314b80f28ea04ecc31d474f3e586c57", "score": "0.6768842", "text": "function initBuffers() {\r\n // The vertices for the triangle\r\n let coords = [-0.4, -0.4, 0, 0.4, 0.4, -0.4];\r\n\r\n // Create and bind VAO\r\n gl.vao = gl.createVertexArray();\r\n gl.bindVertexArray(gl.vao);\r\n\r\n // Load the vertex data into the GPU and associate with shader\r\n let buf = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, buf);\r\n gl.bufferData(gl.ARRAY_BUFFER, Float32Array.from(coords), gl.STATIC_DRAW);\r\n gl.vertexAttribPointer(gl.program.aPosition, 2, gl.FLOAT, false, 0, 0);\r\n gl.enableVertexAttribArray(gl.program.aPosition);\r\n\r\n // Cleanup\r\n gl.bindVertexArray(null);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\r\n}", "title": "" }, { "docid": "900f6d41397c29f82df2daacd7506cea", "score": "0.6747188", "text": "function initBuffers(gl,programInfo, gearData) { //<------------change values here\r\n\r\n\tvar numTeeth = 20; //tooth count\r\n\tvar numSpokes = 4; //spokes\r\n\tvar rgb = [.5,.4,.0]; //color\r\n\r\n\r\n\t//gearData = stocksettGear(numTeeth, numSpokes);\r\n\tvertices = gearData[0];\r\n\tcolors = gearData[1]; \r\n\tnormals = gearData[2]; \r\n\r\n\t// Create buffers for the object's vertex positions\r\n\tconst vertexBuffer = gl.createBuffer();\r\n\r\n\t// Select the positionBuffer as the one to apply buffer\r\n\t// operations to from here out.\r\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\r\n\r\n\t// Now pass the list of vertices to the GPU to build the\r\n\t// shape. We do this by creating a Float32Array from the\r\n\t// JavaScript array, then use it to fill the current buffer.\r\n\tgl.bufferData(gl.ARRAY_BUFFER,\r\n\t\t\tnew Float32Array(vertices),\r\n\t\t\tgl.STATIC_DRAW);\r\n\r\n\r\n\t// do likewise for colors\r\n\tconst colorBuffer = gl.createBuffer();\r\n\r\n\tgl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer); \r\n\r\n\tgl.bufferData(gl.ARRAY_BUFFER,\r\n\t\t\tnew Float32Array(colors),\r\n\t\t\tgl.STATIC_DRAW); \r\n\r\n\r\n\tconst normalBuffer = gl.createBuffer();\r\n\r\n\tgl.bindBuffer(gl.ARRAY_BUFFER, normalBuffer); \r\n\r\n\tgl.bufferData(gl.ARRAY_BUFFER,\r\n\t\t\tnew Float32Array(normals),\r\n\t\t\tgl.STATIC_DRAW); \r\n\r\n\treturn {\r\n\t\t// each vertex in buffer has 3 floats\r\n\t\tnum_vertices: vertices.length / 3,\r\n\t\tvertex: vertexBuffer,\r\n\t\tcolor: colorBuffer,\r\n\t\tnormal: normalBuffer\r\n\t};\r\n\r\n}", "title": "" }, { "docid": "a7006003eea6285c22ff1f8c93a12e52", "score": "0.6745813", "text": "generateTriangles()\n{\n /** initialize height map*/\n for(var i = 0; i<=this.div; i++){\n this.diamond[i] = new Array();\n for(var j = 0; j<=this.div; j++){\n this.diamond[i][j] = 0;\n }\n }\n\n this.diamondSquare( 0, 0, 0, this.div, this.div, this.div, this.div, this.div,this.div);\n\n\n var x_amount = (this.maxX - this.minX) / this.div\n var y_amount = (this.maxY - this.minY) / this.div\n\n for (var i = 0; i <= this.div; i++) {\n for (var j = 0; j <= this.div; j++) {\n this.vBuffer.push(j*x_amount + this.minX)\n this.vBuffer.push(this.minY + i*y_amount)\n this.vBuffer.push(this.diamond[i][j]*0.006)\n\n //console.log(this.diamond[i][j]);\n\n this.nBuffer.push(0)\n this.nBuffer.push(0)\n this.nBuffer.push(1)\n }\n }\n\n this.normals(this.diamond,this.nBuffer,this.div, this.x_amount,this.y_amount);//fill in the normals\n\n for (var i = 0; i < this.div; i++) {\n for (var j = 0; j < this.div; j++) {\n\n var vid = i*(this.div+1) + j\n\n this.fBuffer.push(vid)\n this.fBuffer.push(vid + this.div+1)\n this.fBuffer.push(vid + this.div+2)\n\n this.fBuffer.push(vid)\n this.fBuffer.push(vid+1)\n this.fBuffer.push(vid + this.div+2)\n }\n }\n\n this.numVertices = this.vBuffer.length/3;\n this.numFaces = this.fBuffer.length/3;\n}", "title": "" }, { "docid": "9c74a1c9c576270ae0e63764ccd12864", "score": "0.67423165", "text": "function drawRectangle(ax,ay,bx,by,color) {\r\n // focus on vBuffer (vertexBuffer)\r\n gl.bindBuffer(gl.ARRAY_BUFFER, pBuffer);\r\n\r\n // append flattened vertices to the vertex buffer\r\n // first triangle\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 8*index, flatten(vec2(ax,ay)));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 8*(index+1), flatten(vec2(bx,by)));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 8*(index+2), flatten(vec2(ax,by)));\r\n\r\n // second triangle\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 8*(index+3), flatten(vec2(ax,ay)));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 8*(index+4), flatten(vec2(bx,by)));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 8*(index+5), flatten(vec2(bx,ay)));\r\n\r\n // focus on cBuffer (color buffer)\r\n gl.bindBuffer(gl.ARRAY_BUFFER, cBuffer);\r\n\r\n // append flattened RGBA color to color vector\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 16*index, flatten(color));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 16*(index+1), flatten(color));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 16*(index+2), flatten(color));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 16*(index+3), flatten(color));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 16*(index+4), flatten(color));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 16*(index+5), flatten(color));\r\n\r\n index += 6; // 2 triangles = 6 vertices\r\n\r\n\r\n}", "title": "" }, { "docid": "6c514ef50a0c75a8c3c197073be967d9", "score": "0.67383504", "text": "loadBuffers() {\n // Specify the vertex coordinates\n this.VertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\n this.VertexPositionBuffer.itemSize = 3;\n this.VertexPositionBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\n\n // Specify normals to be able to do lighting calculations\n this.VertexNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\n gl.STATIC_DRAW);\n this.VertexNormalBuffer.itemSize = 3;\n this.VertexNormalBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\n\n // Specify faces of the terrain \n this.IndexTriBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\n gl.STATIC_DRAW);\n this.IndexTriBuffer.itemSize = 1;\n this.IndexTriBuffer.numItems = this.fBuffer.length;\n console.log(\"Loaded \", this.IndexTriBuffer.numItems, \" triangles\");\n\n //Setup Edges \n this.IndexEdgeBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\n gl.STATIC_DRAW);\n this.IndexEdgeBuffer.itemSize = 1;\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\n\n console.log(\"triangulatedPlane: loadBuffers\");\n }", "title": "" }, { "docid": "6c964d09780fad88a3705a61dc581237", "score": "0.67277896", "text": "function initBuffers() {\n/*\t\n\ttriangle = new Triangle([-1.5,0.0,0.0]);\n\n\tsquare = new Square([1.5,0.0,0.0]);\n\n\tspheres = [];\n\tfor( var i=0; i<20; i++){\n\t\tvar pos = [Math.random()*6-3,Math.random()*6-3,-12.0 + Math.random()*(-7)+3.5];\n\t\tspheres.push(new Sphere(pos,.3,20,20));\n\t}\n\tcube = new Cube([0.0,0.0,0.0])\n*/\t\n}", "title": "" }, { "docid": "ab7266ec95a9f5c67a0e2a47e3c85e48", "score": "0.67213917", "text": "generateTriangles()\r\n{\r\n //Your code here\r\n var deltaX = (this.maxX - this.minX) / this.div;\r\n var deltaY = (this.maxY - this.minY) / this.div;\r\n\r\n for (var i = 0; i <= this.div; i++) {\r\n for (var j = 0; j <= this.div; j++) {\r\n\r\n this.vBuffer.push(this.minX + deltaX * j);\r\n this.vBuffer.push(this.minY + deltaY * i);\r\n this.vBuffer.push(0); // set the z value to 0 initially for diamond-square\r\n\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(1);\r\n }\r\n }\r\n\r\n for (var i = 0; i < this.div; i++) {\r\n for (var j = 0; j < this.div; j++) {\r\n var vid = i * (this.div + 1) + j;\r\n this.fBuffer.push(vid);\r\n this.fBuffer.push(vid + 1);\r\n this.fBuffer.push(vid + this.div + 1);\r\n\r\n this.fBuffer.push(vid + 1);\r\n this.fBuffer.push(vid + 1 + this.div + 1);\r\n this.fBuffer.push(vid + this.div + 1);\r\n }\r\n }\r\n this.numVertices = this.vBuffer.length/3;\r\n this.numFaces = this.fBuffer.length/3;\r\n this.diamondSquare();\r\n}", "title": "" }, { "docid": "dae307491d7e86ed8f7c7ff8fa20a528", "score": "0.67208064", "text": "function initVertexBuffers() {\n\tbuildCarousel();\t//Build carousel vertex and normal arrays\n\t//Construct vertex array with vertex coordinates and 3 colour components for all parts to draw\n\tvar vertexInfo = C_VERTICES;\n\tvertexInfo = vertexInfo.concat(D_VERTICES);\n\tvertexInfo = vertexInfo.concat(BAR_VERTICES);\n\tvertexInfo = vertexInfo.concat(B_VERTICES);\n\tvertexInfo = vertexInfo.concat(H_VERTICES);\n\t//Construct normal array with normal vectors for all components\n\tvar normInfo = C_NORMALS;\n\tnormInfo = normInfo.concat(D_NORMALS);\n\tnormInfo = normInfo.concat(BAR_NORMALS);\n\tnormInfo = normInfo.concat(B_NORMALS);\n\tnormInfo = normInfo.concat(H_NORMALS); \n\t\n\t//Convert to Float32Array objects\n\tvar vertices = new Float32Array(vertexInfo);\n\tvar normals = new Float32Array(normInfo);\n\t\n\t//Create Vertex buffer\n\tvar vertexColorbuffer = gl.createBuffer(); \n\tif (!vertexColorbuffer) {\n\t\tconsole.log('Failed to create vertexColor buffer object....');\n\t\treturn -1;\n\t}\n\t\n\t// Write the vertex coordinates and color to the buffer object\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vertexColorbuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n\t\n\tvar FSIZE = vertices.BYTES_PER_ELEMENT;\n\t\n\t// Assign the buffer object to a_Position and enable the assignment\n\tvar a_Position = gl.getAttribLocation(gl.program, 'a_Position');\n\tif(a_Position < 0) {\n\t\tconsole.log('Failed to get the storage location of a_Position');\n\t\treturn -1;\n\t}\n\tgl.vertexAttribPointer(a_Position, 3, gl.FLOAT, false, FSIZE*6, 0);\n\tgl.enableVertexAttribArray(a_Position); \n\t\n\t//Get location of attribute variable\n\tvar a_Color = gl.getAttribLocation(gl.program, 'a_Color');\n\tif(a_Color < 0) {\n\t\tconsole.log('Failed to get the storage location of a_Color');\n\t\treturn -1;\n\t}\n\t//Send data to attribute variable\n\tgl.vertexAttribPointer(a_Color, 3, gl.FLOAT, false, FSIZE * 6, FSIZE * 3);\n\tgl.enableVertexAttribArray(a_Color);\n\t\n\tvar normalsbuffer = gl.createBuffer(); \n\tif (!normalsbuffer) {\n\t\tconsole.log('Failed to create normals buffer object....');\n\t\treturn -1;\n\t}\n\t// Write the normal components to the buffer object\n\tgl.bindBuffer(gl.ARRAY_BUFFER, normalsbuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, normals, gl.STATIC_DRAW);\n\t\n\t// Assign the buffer object to a_Position and enable the assignment\n\tvar a_Normal = gl.getAttribLocation(gl.program, 'a_Normal');\n\tif(a_Normal < 0) {\n\t\tconsole.log('Failed to get the storage location of a_Normal');\n\t\treturn -1;\n\t}\n\tgl.vertexAttribPointer(a_Normal, 3, gl.FLOAT, false, 0, 0);\n\tgl.enableVertexAttribArray(a_Normal); \n\t\n\treturn 1;\n}", "title": "" }, { "docid": "75986007a942a72bdb8db39ea32e2c18", "score": "0.67203856", "text": "function render(){\n //start by clearing any previous data\n gl.clear(gl.COLOR_BUFFER_BIT);\n //draw the geometry we previously sent over. It's a list of 1 triangle(s),\n //we want to start at index 0, and there will be a total of 3 vertices\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n\n}", "title": "" }, { "docid": "c0531bda57e4d27cf6274f5869f5dce9", "score": "0.6719644", "text": "buildVertexBuffer()\n {\n const stride = Vertex.length();\n var size = this.vertices.length * stride;\n\n var vertexData = new Float32Array(size);\n\n for(var i = 0; i < size; i += stride)\n {\n var vertex = i / stride;\n\n vertexData[i + 0] = this.vertices[vertex].position[0];\n vertexData[i + 1] = this.vertices[vertex].position[1];\n vertexData[i + 2] = this.vertices[vertex].position[2];\n \n vertexData[i + 3] = this.vertices[vertex].color[0];\n vertexData[i + 4] = this.vertices[vertex].color[1];\n vertexData[i + 5] = this.vertices[vertex].color[2];\n vertexData[i + 6] = this.vertices[vertex].color[3];\n\n vertexData[i + 7] = this.vertices[vertex].normal[0];\n vertexData[i + 8] = this.vertices[vertex].normal[1];\n vertexData[i + 9] = this.vertices[vertex].normal[2];\n \n vertexData[i + 10] = this.vertices[vertex].uv[0];\n vertexData[i + 11] = this.vertices[vertex].uv[1];\n }\n\n this.context.gl.bufferData(this.context.gl.ARRAY_BUFFER, vertexData, this.context.gl.STATIC_DRAW);\n }", "title": "" }, { "docid": "df8be4f68ce8118e04689fdd81bc11cf", "score": "0.6718476", "text": "loadBuffers()\n {\n // Specify the vertex coordinates\n this.VertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer); \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\n this.VertexPositionBuffer.itemSize = 3;\n this.VertexPositionBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\n \n // Specify normals to be able to do lighting calculations\n this.VertexNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\n gl.STATIC_DRAW);\n this.VertexNormalBuffer.itemSize = 3;\n this.VertexNormalBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\n \n // Specify faces of the terrain \n this.IndexTriBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\n gl.STATIC_DRAW);\n this.IndexTriBuffer.itemSize = 1;\n this.IndexTriBuffer.numItems = this.fBuffer.length;\n console.log(\"Loaded \", this.IndexTriBuffer.numItems, \" triangles\");\n \n //Setup Edges \n this.IndexEdgeBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\n gl.STATIC_DRAW);\n this.IndexEdgeBuffer.itemSize = 1;\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\n \n console.log(\"triangulatedPlane: loadBuffers\");\n }", "title": "" }, { "docid": "941eb4a358fa1447271ee1a6c70bc8fa", "score": "0.6706748", "text": "loadBuffers()\n {\n // Specify the vertex coordinates\n this.VertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\n this.VertexPositionBuffer.itemSize = 3;\n this.VertexPositionBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\n\n // Specify normals to be able to do lighting calculations\n this.VertexNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\n gl.STATIC_DRAW);\n this.VertexNormalBuffer.itemSize = 3;\n this.VertexNormalBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\n\n // Specify faces of the terrain\n this.IndexTriBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\n gl.STATIC_DRAW);\n this.IndexTriBuffer.itemSize = 1;\n this.IndexTriBuffer.numItems = this.fBuffer.length;\n console.log(\"Loaded \", this.numFaces, \" triangles\");\n console.log(\"Loaded \", this.diamond.numItems, \" normals\");\n\n //Setup Edges\n this.IndexEdgeBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\n gl.STATIC_DRAW);\n this.IndexEdgeBuffer.itemSize = 1;\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\n\n console.log(\"triangulatedPlane: loadBuffers\");\n }", "title": "" }, { "docid": "5fcdfb388fb0a7d16bcbb933b60c3367", "score": "0.66888", "text": "fill_buffers(){\n\n var poses = [];\n var colors = [];\n this.root_face.fill_arrays(this.root_face.flag, poses, colors);\n\n // >>>> New in Project 3 <<<<\n var line_poses = [];\n var line_colors = [];\n\n var j = 0;\n while (j < poses.length) {\n for (var i = 0; i < 3; i++) {\n line_poses.push(poses[j + i]);\n line_poses.push(poses[j + (i + 1) % 3]);\n line_colors.push(colors[j + i]);\n line_colors.push(colors[j + (i + 1) % 3]);\n }\n j+=3;\n }\n fill_buffer(this.line_buffer,line_poses);\n fill_buffer(this.line_color_buffer, line_colors);\n this.num_lines = line_poses.length;\n\n fill_buffer(this.pos_buffer,poses);\n fill_buffer(this.color_buffer,colors);\n this.num_vertices = poses.length;\n // >>>> End New <<<<\n }", "title": "" }, { "docid": "f5815e3b965b0e922168cc3fcf7a1a9d", "score": "0.6685002", "text": "generateTriangles()\n{\n //Your code here\n var deltaX = (this.maxX - this.minX)/this.div;\n var deltaY = (this.maxY - this.minY)/this.div;\n \n for (var i = 0; i <= this.div; i++) {\n for (var j = 0; j <= this.div; j++) {\n this.vBuffer.push(this.minX + deltaX*j);\n this.vBuffer.push(this.minY + deltaY*i)\n this.vBuffer.push(0);\n\n this.nBuffer.push(0);\n this.nBuffer.push(0);\n this.nBuffer.push(1);\n }\n }\n\n for (var i = 0; i < this.div; i++) {\n for (var j = 0; j < this.div; j++) {\n var vid = i*(this.div+1) + j;\n this.fBuffer.push(vid);\n this.fBuffer.push(vid+1);\n this.fBuffer.push(vid+this.div+1);\n\n this.fBuffer.push(vid+1);\n this.fBuffer.push(vid+1+this.div+1);\n this.fBuffer.push(vid+this.div+1);\n }\n }\n\n for (var i = 0; i <= this.div; i++) {\n for (var j = 0; j <= this.div; j++) {\n var t = glMatrix.vec3.fromValues(this.minX + deltaX*j, this.minY + deltaY*i, 0);\n this.vertexList.push(t);\n\n var n = glMatrix.vec3.fromValues(0,0,1);\n this.normalList.push(n);\n }\n }\n\n for (var i = 0; i < this.div; i++) {\n for (var j = 0; j < this.div; j++) {\n var vid = i*(this.div+1) + j;\n var v1 = glMatrix.vec3.fromValues(vid, vid+1, vid+this.div + 1);\n this.faceList.push(v1);\n\n var v2 = glMatrix.vec3.fromValues(vid+1, vid+1+this.div+1, vid+this.div+1);\n this.faceList.push(v2);\n }\n }\n\n //\n this.numVertices = this.vBuffer.length/3;\n this.numFaces = this.fBuffer.length/3;\n}", "title": "" }, { "docid": "06acd5ca052e476d55e81416cef767d7", "score": "0.66786695", "text": "loadBuffers()\r\n {\r\n // Specify the vertex coordinates\r\n this.VertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer); \r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\r\n this.VertexPositionBuffer.itemSize = 3;\r\n this.VertexPositionBuffer.numItems = this.numVertices;\r\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\r\n \r\n // Specify normals to be able to do lighting calculations\r\n this.VertexNormalBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\r\n gl.STATIC_DRAW);\r\n this.VertexNormalBuffer.itemSize = 3;\r\n this.VertexNormalBuffer.numItems = this.numVertices;\r\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\r\n\r\n this.VertexColorBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexColorBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.cBuffer),\r\n gl.STATIC_DRAW);\r\n this.VertexColorBuffer.itemSize = 3;\r\n this.VertexColorBuffer.numItems = this.numVertices;\r\n \r\n // Specify faces of the terrain \r\n this.IndexTriBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\r\n gl.STATIC_DRAW);\r\n this.IndexTriBuffer.itemSize = 1;\r\n this.IndexTriBuffer.numItems = this.fBuffer.length;\r\n console.log(\"Loaded \", this.numFaces, \" triangles\");\r\n \r\n //Setup Edges \r\n this.IndexEdgeBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\r\n gl.STATIC_DRAW);\r\n this.IndexEdgeBuffer.itemSize = 1;\r\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\r\n \r\n console.log(\"triangulatedPlane: loadBuffers\");\r\n }", "title": "" }, { "docid": "356ca79b4cd4965981770ce748c0b435", "score": "0.6673169", "text": "generateLines()\r\n{\r\n var numTris=this.fBuffer.length/3;\r\n for(var f=0;f<numTris;f++)\r\n {\r\n var fid=f*3;\r\n this.eBuffer.push(this.fBuffer[fid]);\r\n this.eBuffer.push(this.fBuffer[fid+1]);\r\n \r\n this.eBuffer.push(this.fBuffer[fid+1]);\r\n this.eBuffer.push(this.fBuffer[fid+2]);\r\n \r\n this.eBuffer.push(this.fBuffer[fid+2]);\r\n this.eBuffer.push(this.fBuffer[fid]);\r\n }\r\n \r\n}", "title": "" }, { "docid": "84924d9bcd0da3e1765a119b8d2b8338", "score": "0.66719884", "text": "generateLines()\r\n{\r\n var numTris=this.fBuffer.length/3;\r\n for(var f=0;f<numTris;f++)\r\n {\r\n var fid=f*3;\r\n this.eBuffer.push(this.fBuffer[fid]);\r\n this.eBuffer.push(this.fBuffer[fid+1]);\r\n\r\n this.eBuffer.push(this.fBuffer[fid+1]);\r\n this.eBuffer.push(this.fBuffer[fid+2]);\r\n\r\n this.eBuffer.push(this.fBuffer[fid+2]);\r\n this.eBuffer.push(this.fBuffer[fid]);\r\n }\r\n\r\n}", "title": "" }, { "docid": "725d56c1818d73dad9cf2ab3317dd9b4", "score": "0.6667055", "text": "generateLines()\n{\n var numTris=this.fBuffer.length/3;\n for(var f=0;f<numTris;f++)\n {\n var fid=f*3;\n this.eBuffer.push(this.fBuffer[fid]);\n this.eBuffer.push(this.fBuffer[fid+1]);\n \n this.eBuffer.push(this.fBuffer[fid+1]);\n this.eBuffer.push(this.fBuffer[fid+2]);\n \n this.eBuffer.push(this.fBuffer[fid+2]);\n this.eBuffer.push(this.fBuffer[fid]);\n }\n \n}", "title": "" }, { "docid": "e5070877b3b19a113ce6c1bea810376c", "score": "0.6661034", "text": "function initVertexBuffers(ev,gl,canvas,a_Position,n){ \n var n = xy_points.length/2; //Number of coordinate pairs\n var indices = new Uint16Array(indexes);\n \n if(right_clicked == true){\n n= g_points.length/2;\n }\n \n //Create buffer object\n var vertexBuffer = gl.createBuffer();\n if (!vertexBuffer){\n console.log('Failed to create the buffer object');\n return -1;\n }\n \n var indexBuffer = gl.createBuffer();\n \n //Bind buffer to target and write data into buffer object\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n \n gl.bufferData(gl.ARRAY_BUFFER, xy_points, gl.STATIC_DRAW);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);\n \n //Initialize a_Position for shader\n var a_Position = gl.getAttribLocation(gl.program, 'a_Position');\n if (a_Position < 0){\n console.log('Failed to get the storage location of a_Position');\n return -1;\n }\n\n gl.vertexAttribPointer(a_Position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_Position);\n // gl.drawElements(gl.LINE_STRIP, indices.length, gl.UNSIGNED_SHORT, 0);\n return n; \n}", "title": "" }, { "docid": "724920ca42fd4932a29e8537152bc652", "score": "0.6655353", "text": "createBuffers() {\n\t\tif(this.positionBuffer ===undefined && this.vertices !==undefined)\n\t\t{\n\t\t\t//console.log(\"no position and vertice buffer made,creating \",this.name);\n\t\t\tthis.positionBuffer=gl.createBuffer();\n\t\t\tthis.positionBufferItemSize=3;\n\t\t\tthis.positionBufferNumItems=(this.vertices.length)/(this.positionBufferItemSize);\n\t\n\t\t}\n\t\t\n\t\tif(this.colorBuffer===undefined)\n\t\t{\n\t\t\t//console.log(\"no color buffer has been made, creating now \",this.name);\n\t\t\tthis.colorBuffer= gl.createBuffer();\n\t\t\tthis.colorBufferItemSize=4;\n\t\t\tconsole.log(\"color length\",this.getColor().length);\n\t\t\tthis.colorBufferNumItems=(this.color.length)/(this.colorBufferItemSize);\n\t\t}\n\t}", "title": "" }, { "docid": "cd70e08b67cd225610f0c19d2b36efc3", "score": "0.6648036", "text": "generateLines() {\n var numTris = this.fBuffer.length / 3;\n for (var f = 0; f < numTris; f++) {\n var fid = f * 3;\n this.eBuffer.push(this.fBuffer[fid]);\n this.eBuffer.push(this.fBuffer[fid + 1]);\n\n this.eBuffer.push(this.fBuffer[fid + 1]);\n this.eBuffer.push(this.fBuffer[fid + 2]);\n\n this.eBuffer.push(this.fBuffer[fid + 2]);\n this.eBuffer.push(this.fBuffer[fid]);\n }\n\n }", "title": "" }, { "docid": "9c39cd46b9971a83fbcda7643cc0a28d", "score": "0.66367686", "text": "loadBuffers()\r\n {\r\n // Specify the vertex coordinates\r\n this.VertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\r\n this.VertexPositionBuffer.itemSize = 3;\r\n this.VertexPositionBuffer.numItems = this.numVertices;\r\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\r\n\r\n // Specify normals to be able to do lighting calculations\r\n this.VertexNormalBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\r\n gl.STATIC_DRAW);\r\n this.VertexNormalBuffer.itemSize = 3;\r\n this.VertexNormalBuffer.numItems = this.numVertices;\r\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\r\n\r\n // Specify faces of the terrain\r\n this.IndexTriBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\r\n gl.STATIC_DRAW);\r\n this.IndexTriBuffer.itemSize = 1;\r\n this.IndexTriBuffer.numItems = this.fBuffer.length;\r\n console.log(\"Loaded \", this.IndexTriBuffer.numItems, \" triangles\");\r\n\r\n //Setup Edges\r\n this.IndexEdgeBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\r\n gl.STATIC_DRAW);\r\n this.IndexEdgeBuffer.itemSize = 1;\r\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\r\n\r\n console.log(\"triangulatedPlane: loadBuffers\");\r\n }", "title": "" }, { "docid": "8dba9bbc1a6161457fd971b531f5c48f", "score": "0.66096103", "text": "generateLines()\n{\n var numTris=this.fBuffer.length/3;\n for(var f=0;f<numTris;f++)\n {\n var fid=f*3;\n this.eBuffer.push(this.fBuffer[fid]);\n this.eBuffer.push(this.fBuffer[fid+1]);\n\n this.eBuffer.push(this.fBuffer[fid+1]);\n this.eBuffer.push(this.fBuffer[fid+2]);\n\n this.eBuffer.push(this.fBuffer[fid+2]);\n this.eBuffer.push(this.fBuffer[fid]);\n }\n\n}", "title": "" }, { "docid": "7ca9ca6ffd08964670b97c0c2b1d8ec7", "score": "0.6590507", "text": "function setupTerrainBuffers() {\n \n\tvar vTerrain=[];\n\tvar fTerrain=[];\n\tvar nTerrain=[];\n\tvar eTerrain=[];\n\tvar cTerrain=[]; // initialize the array with the color values\n\tvar gridN=128;\n\n\tvar numT = terrainFromIteration(gridN, -2,2,-2,2, vTerrain,fTerrain,nTerrain,cTerrain); // pass in color values into the terrain generator\n\t//var numT = planeFromSubdivision(gridN, -1,1,-1,1, vTerrain,fTerrain,nTerrain);\n\tconsole.log(\"Generated \", numT, \" triangles\");\n\n\ttVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, tVertexPositionBuffer); \n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vTerrain), gl.STATIC_DRAW);\n\ttVertexPositionBuffer.itemSize = 3;\n\t//tVertexPositionBuffer.numItems = (gridN+1)*(gridN+1);\n\ttVertexPositionBuffer.numItems = numT*3;\n\n\t// Specify normals to be able to do lighting calculations\n\ttVertexNormalBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, tVertexNormalBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(nTerrain), gl.STATIC_DRAW);\n\ttVertexNormalBuffer.itemSize = 3;\n\t//tVertexNormalBuffer.numItems = (gridN+1)*(gridN+1);\n\ttVertexNormalBuffer.numItems = numT*3;\n\n\t// Specify faces of the terrain \n\ttIndexTriBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexTriBuffer);\n\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(fTerrain), gl.STATIC_DRAW);\n\ttIndexTriBuffer.itemSize = 1;\n\ttIndexTriBuffer.numItems = numT*3;\n\n\t// Specify the color of each vertex based off of cTerrain\n\ttvertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, tvertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(cTerrain), gl.STATIC_DRAW);\n\ttvertexColorBuffer.itemSize = 3;\n\ttvertexColorBuffer.numItems = numT*3;\n\n\t//Setup Edges\n\tgenerateLinesFromIndexedTriangles(fTerrain,eTerrain); \n\ttIndexEdgeBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexEdgeBuffer);\n\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(eTerrain), gl.STATIC_DRAW);\n\ttIndexEdgeBuffer.itemSize = 1;\n\ttIndexEdgeBuffer.numItems = eTerrain.length; \n}", "title": "" }, { "docid": "23329d7c03ffc7af0aae85eef5e95569", "score": "0.6587085", "text": "addDataHelperTriangles(i, k, dim, numStates) {\n console.log(\"Entities of\", i, this.data.sets[i].entities);\n let elementSize = dim; // for lines, and triangles, since \"dim\" (e.g. 3) values(x,y,z) must stay together\n let numElements =\n this.data.sets[i].states[0].positions[k].length / elementSize;\n let geometry = new BufferGeometry();\n geometry.type = this.data.sets[i].type;\n geometry.originIndex = k;\n\n let setIds = this.createFilledArray(i, numElements - 1);\n let drawIndexValues = JSON.parse(\n JSON.stringify(this.data.sets[i].entities[k])\n ); // this.createFilledArray(1, numElements - 1)\n\n geometry.setAttribute(\"setId\", new Float32BufferAttribute(setIds, 1));\n geometry.setAttribute(\n \"drawIndex\",\n new Float32BufferAttribute(drawIndexValues, 1)\n );\n\n // Make it twice (once here, once as attribute), otherwise three js problems\n geometry.setAttribute(\n \"position\",\n new Float32BufferAttribute(\n this.data.sets[i].states[0].positions[k],\n dim\n )\n );\n geometry.setAttribute(\n \"normalCustom\",\n new Float32BufferAttribute(\n this.data.sets[i].states[0].normals[k],\n dim\n )\n );\n geometry.setIndex(this.data.sets[i].indices[k]);\n this.numGlPrimitives += this.data.sets[i].indices[k].length / 3;\n\n for (\n let j = 0;\n j < numStates;\n j++ // States, starting from 1!!!\n ) {\n let positions = this.data.sets[i].states[j].positions[\n k\n ]; /**.slice(dim * fr, dim * to)**/\n let last = [];\n for (let l = positions.length - dim; l < positions.length; l++) {\n last.push(positions[l] + (positions[l] - positions[l - dim])); // It's a fake, one step further\n }\n\n geometry.setAttribute(\n \"position\" + j,\n new Float32BufferAttribute(positions, dim)\n );\n\n for (\n let a = 0;\n a < this.data.sets[i].states[j].attributes.length;\n a++\n ) {\n let aDim = this.data.sets[i].states[j].attributes[a].dim;\n let values = this.data.sets[i].states[j].attributes[a].values[\n k\n ]; /**.slice(aDim * fr, aDim * to)**/\n let shared = this.data.sets[i].states[j].attributes[a].shared;\n let attName = this.data.sets[i].states[j].attributes[a].name;\n\n if (shared == true && j > 0) {\n // Skip attributes if we share and have read the first one already\n continue;\n }\n if (shared == false) {\n attName += j; // If we save all attributes, name them with number\n }\n geometry.setAttribute(\n this.cleanVarName(attName),\n new Float32BufferAttribute(values, aDim)\n );\n\n for (let vv = 0; vv < values.length; vv++) {\n this.dataAttributes[a].min = Math.min(\n this.dataAttributes[a].min,\n values[vv]\n );\n this.dataAttributes[a].max = Math.max(\n this.dataAttributes[a].max,\n values[vv]\n );\n }\n }\n }\n\n // Create a unique id with setId_triangleId\n geometry.totalLineId = [];\n for (let l = 0; l < this.data.sets[i].entities[k].length; l++) {\n geometry.totalLineId.push(\n i.toString() + \"_\" + this.data.sets[i].entities[k][l].toString()\n );\n }\n\n return geometry;\n }", "title": "" }, { "docid": "3788b9e1cb616800df8250fdfeb8792b", "score": "0.6562055", "text": "function updatePoints() {\n points = [];\n\n // Subdivide initial triangle\n divideTriangle(vertices[0], vertices[1], vertices[2], subdivisionCount);\n\n // Load the data into the GPU\n gl.bufferData(gl.ARRAY_BUFFER, flatten(points), gl.STATIC_DRAW);\n}", "title": "" }, { "docid": "b7a4e69cb495382e51b9013d42a6d099", "score": "0.6508458", "text": "function reset(){\n\n\t\tvar triangleVertexBufferObject = gl.createBuffer();\n\t\t//set the active buffer to the triangle buffer\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexBufferObject);\n\t\t//gl expecting Float32 Array not Float64\n\t\t//gl.STATIC_DRAW means we send the data only once (the triangle vertex position\n\t\t//will not change over time)\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices),gl.STATIC_DRAW);\n\n\t\tvar positionAttribLocation = gl.getAttribLocation(program,'vertPosition');\n\t\tvar colorAttribLocation = gl.getAttribLocation(program,'vertColor');\n\t\tgl.vertexAttribPointer(\n\t\t\tpositionAttribLocation, //attribute location\n\t\t\t2, //number of elements per attribute\n\t\t\tgl.FLOAT, \n\t\t\tgl.FALSE,\n\t\t\t5*Float32Array.BYTES_PER_ELEMENT,//size of an individual vertex\n\t\t\t0*Float32Array.BYTES_PER_ELEMENT//offset from the beginning of a single vertex to this attribute\n\t\t\t);\n\t\tgl.vertexAttribPointer(\n\t\t\tcolorAttribLocation, //attribute location\n\t\t\t3, //number of elements per attribute\n\t\t\tgl.FLOAT, \n\t\t\tgl.FALSE,\n\t\t\t5*Float32Array.BYTES_PER_ELEMENT,//size of an individual vertex\n\t\t\t2*Float32Array.BYTES_PER_ELEMENT//offset from the beginning of a single vertex to this attribute\n\t\t\t);\n\t\tgl.enableVertexAttribArray(positionAttribLocation);\n\t\tgl.enableVertexAttribArray(colorAttribLocation);\n\n\t\tgl.useProgram(program);\n\t}", "title": "" }, { "docid": "cd0bfed8d7be7b56f0df6835a1cacce2", "score": "0.6472388", "text": "initBuffers(){\n\n this.raioalturabase = 4/3 * this.base;\n this.raioalturatop= 4/3 * this.top;\n\n if (this.base > this.top){\n this.declivex = (this.base-this.top)/this.height;\n this.meiox = this.declivex*(this.height/2) + this.top;\n this.meioy = 4/3*this.meiox;\n }else if (this.base < this.top){\n this.declivex = (this.top-this.base)/this.height;\n this.meiox = this.declivex*(this.height/2) + this.base;\n this.meioy = 4/3*this.meiox;\n }else{\n this.meiox = this.base;\n this.meioy = this.raioalturabase;\n }\n\n this.controlpoints1 = [\n [ -this.base, 0.0, 0, 1 ],\n [ -this.base, this.raioalturabase, 0, 1 ],\n [ this.base, this.raioalturabase, 0, 1 ],\n [ this.base, 0, 0, 1 ],\n [ -this.meiox, 0.0, this.height/2, 1 ],\n [ -this.meiox, this.meioy, this.height/2, 1 ],\n [ this.meiox, this.meioy, this.height/2, 1 ],\n [ this.meiox, 0, this.height/2, 1 ],\n [ -this.top, 0.0,this.height, 1 ],\n [ -this.top, this.raioalturatop, this.height, 1 ],\n [ this.top, this.raioalturatop, this.height, 1 ],\n [ this.top, 0, this.height, 1 ],\n ];\n\n this.controlpoints2 = [\n [ -this.top, 0.0, this.height, 1 ],\n [ -this.top, -this.raioalturatop, this.height, 1 ],\n [ this.top, -this.raioalturatop, this.height, 1 ],\n [ this.top, 0, this.height, 1 ],\n [ -this.meiox, 0.0, this.height/2, 1 ],\n [ -this.meiox, -this.meioy, this.height/2, 1 ],\n [ this.meiox, -this.meioy, this.height/2, 1 ],\n [ this.meiox, 0, this.height/2, 1 ],\n [ -this.base, 0.0, 0, 1 ],\n [ -this.base, -this.raioalturabase, 0, 1 ],\n [ this.base, -this.raioalturabase, 0, 1 ],\n [ this.base, 0, 0, 1 ]\n ];\n\n\n\n this.patch1 = new MyPatch(this.scene, 3,4,this.slices/2,this.stacks,this.controlpoints1);\n this.patch2 = new MyPatch(this.scene, 3,4,this.slices/2,this.stacks,this.controlpoints2);\n\n }", "title": "" }, { "docid": "bfb67f7886902144acc1e1a3951682b5", "score": "0.6458102", "text": "function initBuffers() {\n //Vertex Buffer Object\n cubeVertexPositionBuffer = gl.createBuffer();\n\n //Bind buffer to ARRAY_BUFFER\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexPositionBuffer);\n\n vertices = [\n // Front face\n -1.0, -1.0, 1.0,\n 1.0, -1.0, 1.0,\n 1.0, 1.0, 1.0,\n -1.0, 1.0, 1.0,\n\n // Back face\n -1.0, -1.0, -1.0,\n -1.0, 1.0, -1.0,\n 1.0, 1.0, -1.0,\n 1.0, -1.0, -1.0,\n\n // Top face\n -1.0, 1.0, -1.0,\n -1.0, 1.0, 1.0,\n 1.0, 1.0, 1.0,\n 1.0, 1.0, -1.0,\n\n // Bottom face\n -1.0, -1.0, -1.0,\n 1.0, -1.0, -1.0,\n 1.0, -1.0, 1.0,\n -1.0, -1.0, 1.0,\n\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,\n -1.0, -1.0, 1.0,\n -1.0, 1.0, 1.0,\n -1.0, 1.0, -1.0\n ];\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\n //every item has 3 coordinates (x,y,z)\n cubeVertexPositionBuffer.itemSize = 3;\n\n //we have 24 vertices\n cubeVertexPositionBuffer.numItems = 24;\n\n //Color\n cubeVertexColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexColorBuffer);\n\n colors = [\n [1.0, 1.0, 1.0, 1.0], // Front face\n [1.0, 1.0, 1.0, 1.0], // Back face\n [1.0, 1.0, 1.0, 1.0], // Top face\n [1.0, 1.0, 1.0, 1.0], // Bottom face\n [1.0, 1.0, 1.0, 1.0], // Right face\n [1.0, 1.0, 1.0, 1.0] // Left face\n ];\n\n var unpackedColors = [];\n for (var i in colors) {\n var color = colors[i];\n //assign colors for each vertex of each face based on the packed representation above\n for (var j=0; j < 4; j++) {\n unpackedColors = unpackedColors.concat(color);\n }\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(unpackedColors), gl.STATIC_DRAW);\n\n //every color has 4 values: red, green, blue and alpha (transparency: use 1.0 (opaque) for this demo)\n cubeVertexColorBuffer.itemSize = 4;\n\n //24 color values (we have 24 vertices to color...)\n cubeVertexColorBuffer.numItems = 24;\n\n //Index Buffer Object\n //it joins sets of vertices into faces\n cubeVertexIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeVertexIndexBuffer);\n\n var cubeVertexIndices = [\n //this numbers are positions in the VBO array above\n 0, 1, 2, 1, 2, 3, // Front face\n 4, 5, 6, 5, 6, 7, // Back face\n 8, 9, 10, 9, 10, 11, // Top face\n 12, 13, 14, 13, 14, 15, // Bottom face\n 16, 17, 18, 17, 18, 19, // Right face\n 20, 21, 22, 21, 22, 23 // Left face\n ];\n\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(cubeVertexIndices), gl.STATIC_DRAW);\n\n //we have one item - the cube\n cubeVertexIndexBuffer.itemSize = 1;\n\n //we have 36 indices (6 faces, every face has 2 triangles, each triangle 3 vertices: 2x3x6=36)\n cubeVertexIndexBuffer.numItems = 36;\n}", "title": "" }, { "docid": "b0f102f878b7fe5fe49dac6b8e54ef9f", "score": "0.64499384", "text": "function loadVerticesCustom() {\r\n vertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\r\n var triangleVertices = [\r\n -1.0, -1.0, 0.0,\r\n -0.75, 1.0, 0.0,\r\n -0.5, -1.0, 0.0,\r\n \r\n -0.5, -1.0, 0.0,\r\n -0.25, 1.0, 0.0,\r\n 0.0, -1.0, 0.0,\r\n \r\n 0.0, -1.0, 0.0,\r\n 0.25, 1.0, 0.0,\r\n 0.5, -1.0, 0.0,\r\n \r\n 0.5, -1.0, 0.0,\r\n 0.75, 1.0, 0.0,\r\n 1.0, -1.0, 0.0,\r\n \r\n \r\n -1.0, 1.0, 0.0,\r\n -0.75,-1.0, 0.0,\r\n -0.5, 1.0, 0.0,\r\n \r\n -0.5, 1.0, 0.0,\r\n -0.25,-1.0, 0.0,\r\n 0.0, 1.0, 0.0,\r\n \r\n 0.0, 1.0, 0.0,\r\n 0.25,-1.0, 0.0,\r\n 0.5, 1.0, 0.0,\r\n \r\n 0.5, 1.0, 0.0,\r\n 0.75,-1.0, 0.0,\r\n 1.0, 1.0, 0.0,\r\n \r\n \r\n ];\r\n \r\n //Move the point of each triangle towards the 0 y coord with staggered angles for cos function\r\n triangleVertices[4] = -1 + (Math.abs(Math.cos(degToRad(rotAngle))));\r\n triangleVertices[13] = -1 + (Math.abs(Math.cos(degToRad(rotAngle+20))));\r\n triangleVertices[22] = -1 + (Math.abs(Math.cos(degToRad(rotAngle+40))));\r\n triangleVertices[31] = -1 + (Math.abs(Math.cos(degToRad(rotAngle+60))));\r\n \r\n triangleVertices[40] = 1 + -1*(Math.abs(Math.cos(degToRad(rotAngle))));\r\n triangleVertices[49] = 1 + -1*(Math.abs(Math.cos(degToRad(rotAngle+20))));\r\n triangleVertices[58] = 1 + -1*(Math.abs(Math.cos(degToRad(rotAngle+40))));\r\n triangleVertices[67] = 1 + -1*(Math.abs(Math.cos(degToRad(rotAngle+60))));\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.DYNAMIC_DRAW);\r\n vertexPositionBuffer.itemSize = 3;\r\n vertexPositionBuffer.numberOfItems = 24;\r\n}", "title": "" }, { "docid": "5c6ed3a1796a278570709768a08e9d0c", "score": "0.6446575", "text": "addDataHelperLines(i, k, dim, numStates) {\n let elementSize = dim; // for lines, and triangles, since \"dim\" (e.g. 3) values(x,y,z) must stay together\n let numElements = this.data.sets[i].states[0].positions[k].length / elementSize;\n let axesElements = 0;\n if(this.data.sets[i].axes !== undefined) {\n axesElements = this.data.sets[i].axes.length / elementSize;\n // console.log(JSON.string(this.data.sets[i]))\n }\n let numElementsWithAxes = numElements + axesElements;\n let geometry = new BufferGeometry();\n\n geometry.type = this.data.sets[i].type;\n geometry.originIndex = k;\n let setIds = this.createFilledArray(i, numElementsWithAxes - 1);\n let axeType = this.createFilledArray(0, numElements - 1);\n\n let drawIndexValues = JSON.parse(JSON.stringify(this.data.sets[i].entities[k]));\n let primitiveIndices = JSON.parse(JSON.stringify(this.data.sets[i].indices[k]));\n \n\n let positions = JSON.parse(JSON.stringify(this.data.sets[i].states[0].positions[k]));\n if(this.data.sets[i].axes !== undefined) {\n for (let axeItem = 0; axeItem < this.data.sets[i].axes.length / elementSize; axeItem++) {\n drawIndexValues.push(-1)\n axeType.push(1)\n for (let d = 0; d < dim; d++) {\n positions.push(this.data.sets[i].axes[dim * axeItem + d])\n }\n }\n for (let axeItem = 0; axeItem < this.data.sets[i].axesIndices.length; axeItem++) {\n primitiveIndices.push(this.data.sets[i].axesIndices[axeItem] + numElements)\n }\n }\n\n geometry.setAttribute(\n \"setId\", \n new Float32BufferAttribute(setIds, 1));\n\n geometry.setAttribute(\n \"drawIndex\",\n new Float32BufferAttribute(drawIndexValues, 1)\n );\n\n geometry.setAttribute(\n \"axeType\",\n new Float32BufferAttribute(axeType, 1)\n );\n\n // Make it twice (once here, once as attribute), otherwise three js problems\n geometry.setAttribute(\n \"position\",\n new Float32BufferAttribute(positions, dim)\n );\n\n\n geometry.setIndex(primitiveIndices);\n this.numGlPrimitives += primitiveIndices / 2;\n/*\n console.log(\"--- Positions \" )\n console.log(positions.length / dim)\n console.log(positions.join(\", \"))\n\n \n console.log(\"--- setIds \" )\n console.log(setIds.length)\n console.log(setIds.join(\", \"))\n\n console.log(\"--- axeType \" )\n console.log(axeType.length)\n console.log(axeType.join(\", \"))\n\n console.log(\"--- drawIndexValues \" )\n console.log(drawIndexValues.length)\n console.log(drawIndexValues.join(\", \"))\n\n console.log(\"--- primitiveIndices \")\n console.log(primitiveIndices.length)\n console.log(primitiveIndices.join(\", \"))*/\n for (\n let j = 0;\n j < numStates;\n j++ \n ) {\n let positionsState = JSON.parse(JSON.stringify(this.data.sets[i].states[j].positions[k]));\n\n if(this.data.sets[i].axes !== undefined) {\n for (let axePos = 0; axePos < this.data.sets[i].axes.length; axePos++) {\n positionsState.push(this.data.sets[i].axes[axePos])\n }\n }\n\n let last = [];\n for (let l = positionsState.length - dim; l < positionsState.length; l++) {\n last.push(positionsState[l] + (positionsState[l] - positionsState[l - dim])); // It's a fake, one step further\n }\n\n geometry.setAttribute(\n \"position\" + j,\n new Float32BufferAttribute(positionsState, dim)\n );\n\n geometry.setAttribute(\n \"nextPosition\" + j,\n new Float32BufferAttribute(\n positionsState.slice(dim).concat(last),\n dim\n )\n );\n /*\n console.log(\"----- positionsState \" + j)\n console.log(positionsState.length / dim)\n console.log(positionsState.join(\", \"))\n \n console.log(\"----- nextPosition \" + j)\n console.log(positionsState.slice(dim).concat(last).length / dim)\n console.log(positionsState.slice(dim).concat(last).join(\", \"))\n */\n for (\n let a = 0;\n a < this.data.sets[i].states[j].attributes.length;\n a++\n ) {\n let aDim = this.data.sets[i].states[j].attributes[a].dim;\n let shared = this.data.sets[i].states[j].attributes[a].shared;\n let attName = this.data.sets[i].states[j].attributes[a].name;\n\n if (shared == true && j > 0) {\n // Skip attributes if we share and have read the first one already.\n // (We HAVE TO skip because maybe there are not even values for the subsequent ones.)\n continue;\n }\n\n let values = JSON.parse(JSON.stringify(this.data.sets[i].states[j].attributes[a].values[\n k\n ])); \n\n if(this.data.sets[i].axes !== undefined) {\n for (let axePos = 0; axePos < this.data.sets[i].axes.length / elementSize; axePos++) {\n for(let fillDim = 0; fillDim < aDim; fillDim++) {\n values.push(0)\n }\n }\n }\n\n if (shared == false) {\n attName += j; // If we save all attributes, name them with number\n }\n geometry.setAttribute(\n this.cleanVarName(attName),\n new Float32BufferAttribute(values, aDim)\n );\n /*\n console.log(\"----- att \" + this.cleanVarName(attName))\n console.log(values / dim)\n */\n let id = this.getDataAttributeIndex(\n i,\n this.data.sets[i].states[j].attributes[a].name\n );\n\n for (let vv = 0; vv < values.length; vv++) {\n this.dataAttributes[id].min = Math.min(\n this.dataAttributes[id].min,\n values[vv]\n );\n this.dataAttributes[id].max = Math.max(\n this.dataAttributes[id].max,\n values[vv]\n );\n }\n /*\n console.log(\"--- Attribute \" + a)\n console.log(values.length)\n // console.log(values.join(\", \"))\n */\n }\n\n }\n\n // Create a unique id with setId_lineId\n geometry.totalLineId = [];\n for (let l = 0; l < this.data.sets[i].entities[k].length; l++) {\n geometry.totalLineId.push(\n i.toString() + \"_\" + this.data.sets[i].entities[k][l].toString()\n );\n }\n\n return geometry;\n }", "title": "" }, { "docid": "e5d8692d8ead9666ccdebe8913d9eaf1", "score": "0.64450413", "text": "initBuffers()\n {\n const gl = this.gl;\n let dynamicOffset = 0;\n\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n */\n this.indices = createIndicesForQuads(this.size);\n this.indexBuffer = glCore.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n this.dynamicStride = 0;\n\n for (let i = 0; i < this.dynamicProperties.length; ++i)\n {\n const property = this.dynamicProperties[i];\n\n property.offset = dynamicOffset;\n dynamicOffset += property.size;\n this.dynamicStride += property.size;\n }\n\n const dynBuffer = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);\n\n this.dynamicData = new Float32Array(dynBuffer);\n this.dynamicDataUint32 = new Uint32Array(dynBuffer);\n this.dynamicBuffer = glCore.GLBuffer.createVertexBuffer(gl, dynBuffer, gl.STREAM_DRAW);\n\n // static //\n let staticOffset = 0;\n\n this.staticStride = 0;\n\n for (let i = 0; i < this.staticProperties.length; ++i)\n {\n const property = this.staticProperties[i];\n\n property.offset = staticOffset;\n staticOffset += property.size;\n this.staticStride += property.size;\n }\n\n const statBuffer = new ArrayBuffer(this.size * this.staticStride * 4 * 4);\n\n this.staticData = new Float32Array(statBuffer);\n this.staticDataUint32 = new Uint32Array(statBuffer);\n this.staticBuffer = glCore.GLBuffer.createVertexBuffer(gl, statBuffer, gl.STATIC_DRAW);\n\n this.vao = new glCore.VertexArrayObject(gl)\n .addIndex(this.indexBuffer);\n\n for (let i = 0; i < this.dynamicProperties.length; ++i)\n {\n const property = this.dynamicProperties[i];\n\n if (property.unsignedByte)\n {\n this.vao.addAttribute(\n this.dynamicBuffer,\n property.attribute,\n gl.UNSIGNED_BYTE,\n true,\n this.dynamicStride * 4,\n property.offset * 4\n );\n }\n else\n {\n this.vao.addAttribute(\n this.dynamicBuffer,\n property.attribute,\n gl.FLOAT,\n false,\n this.dynamicStride * 4,\n property.offset * 4\n );\n }\n }\n\n for (let i = 0; i < this.staticProperties.length; ++i)\n {\n const property = this.staticProperties[i];\n\n if (property.unsignedByte)\n {\n this.vao.addAttribute(\n this.staticBuffer,\n property.attribute,\n gl.UNSIGNED_BYTE,\n true,\n this.staticStride * 4,\n property.offset * 4\n );\n }\n else\n {\n this.vao.addAttribute(\n this.staticBuffer,\n property.attribute,\n gl.FLOAT,\n false,\n this.staticStride * 4,\n property.offset * 4\n );\n }\n }\n }", "title": "" }, { "docid": "71a0bf0f6e896df233252b745a174af0", "score": "0.6406808", "text": "constructor(elementSize, dataType = webGl.FLOAT, targetBufferType = webGl.ARRAY_BUFFER, drawingMode = webGl.TRIANGLES) {\n this._hasAttributeLocation = false;\n this._data = [];\n this._attributes = [];\n //* Destroys the buffer\n this.Destroy = () => {\n webGl.deleteBuffer(this._buffer);\n };\n //* Bindes the buffer\n this.Bind = (normalized = false) => {\n webGl.bindBuffer(this._targetBufferType, this._buffer);\n if (this._hasAttributeLocation) {\n for (let it of this._attributes) {\n webGl.vertexAttribPointer(it.location, it.size, this._dataType, normalized, this._stide, it.offset * this._typeSize);\n webGl.enableVertexAttribArray(it.location);\n }\n }\n };\n //* unBindes The buffer\n this.UnBind = () => {\n for (let it of this._attributes) {\n webGl.disableVertexAttribArray(it.location);\n }\n webGl.bindBuffer(this._targetBufferType, this._buffer);\n };\n //* Adds an atribute with given info to buffer\n this.addAttributeLocation = (info) => {\n this._hasAttributeLocation = true;\n this._attributes.push(info);\n };\n //*Add data to this buffer\n this.PushBackData = (data) => {\n for (let d of data) {\n this._data.push(d);\n }\n };\n //*Upload buffer data to gpu\n this.Upload = () => {\n webGl.bindBuffer(this._targetBufferType, this._buffer);\n let bufferData;\n switch (this._dataType) {\n case webGl.FLOAT:\n bufferData = new Float32Array(this._data);\n break;\n case webGl.INT:\n bufferData = new Int32Array(this._data);\n break;\n case webGl.UNSIGNED_INT:\n bufferData = new Uint32Array(this._data);\n break;\n case webGl.SHORT:\n bufferData = new Int16Array(this._data);\n break;\n case webGl.UNSIGNED_SHORT:\n bufferData = new Uint16Array(this._data);\n break;\n case webGl.BYTE:\n bufferData = new Int8Array(this._data);\n break;\n case webGl.UNSIGNED_BYTE:\n bufferData = new Uint8Array(this._data);\n break;\n }\n webGl.bufferData(this._targetBufferType, bufferData, webGl.STATIC_DRAW);\n };\n //* Draw this buffer\n this.Draw = () => {\n if (this._targetBufferType === webGl.ARRAY_BUFFER) {\n webGl.drawArrays(this._drawingMode, 0, this._data.length / this._elementSize);\n }\n else if (this._targetBufferType === webGl.ELEMENT_ARRAY_BUFFER) {\n webGl.drawElements(this._drawingMode, this._data.length, this._dataType, 0);\n }\n };\n this._elementSize = elementSize;\n this._dataType = dataType;\n this._targetBufferType = targetBufferType;\n this._drawingMode = drawingMode;\n //* Determine byte size\n switch (this._dataType) {\n case webGl.FLOAT:\n case webGl.INT:\n case webGl.UNSIGNED_INT:\n this._typeSize = 4;\n break;\n case webGl.SHORT:\n case webGl.UNSIGNED_SHORT:\n this._typeSize = 2;\n break;\n case webGl.BYTE:\n case webGl.UNSIGNED_BYTE:\n this._typeSize = 1;\n break;\n default:\n throw new Error(`Unrecognized dataType: ${dataType.toString()}`);\n }\n this._stide = this._elementSize * this._typeSize;\n this._buffer = webGl.createBuffer();\n }", "title": "" }, { "docid": "391c848abc8ec631aec48d87049f2532", "score": "0.6405901", "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": "7a9682ef48aebdd9d06d827c07a83826", "score": "0.6344061", "text": "function drawTriangle(ax, ay, bx, by, cx, cy, color) {\r\n // focus on vBuffer (vertexBuffer)\r\n gl.bindBuffer(gl.ARRAY_BUFFER, pBuffer);\r\n\r\n // append flattened vertices to the vertex buffer\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 8*index, flatten(vec2(ax,ay)));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 8*(index+1), flatten(vec2(bx,by)));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 8*(index+2), flatten(vec2(cx,cy)));\r\n\r\n // focus on cBuffer (color buffer)\r\n gl.bindBuffer(gl.ARRAY_BUFFER, cBuffer);\r\n\r\n // append flattened RGBA color to color vector\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 16*index, flatten(color));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 16*(index+1), flatten(color));\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 16*(index+2), flatten(color));\r\n\r\n index += 3; // 1 triangle = 3 vertices\r\n\r\n}", "title": "" }, { "docid": "05f62a22b4671e762053aadcbee3be6f", "score": "0.63361555", "text": "BindBuffers()\n {\n\t\tif (this.triangle_vrts.length == 0)\n\t\t\tthrow 'Shape::BindBuffers called with empty vertices';\n\n\t\t// All shapes must have verticies.\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.triangle_vrts_buffer); \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.triangle_vrts), gl.STATIC_DRAW);\n\n\t\t// Although not checked, all shapes ought to have normals per vertex.\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.normal_vrts_buffer); \n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.normal_vrts), gl.STATIC_DRAW);\n\n\t\t// Display normals are optional.\n\t\tif (this.normal_display_vrts.length > 0)\n\t\t{\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.normal_display_vrts_buffer); \n \t gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.normal_display_vrts), gl.STATIC_DRAW);\n\t\t}\n\n\t\t// Colors are optional.\n\t\tif (this.colors.length > 0)\n\t\t{\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.colors_buffer); \n \t gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.colors), gl.STATIC_DRAW);\n\t\t}\n\n\t\tif (this.indexed)\n\t\t{\n\t\t\t// Only indexed shapes make use of ELEMENT_ARRAY_BUFFER.\n\t\t\tif (this.indicies_buffer != null && this.indicies.length > 0)\n\t\t\t{\n\t\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicies_buffer);\n\t\t\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Int16Array(this.indicies), gl.STATIC_DRAW);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow 'Shape::BindBuffers() - indexed but no index buffer or no index data.';\n\t\t\t}\n\t\t\n\t\t\tif (this.line_segment_indicies_buffer != null && this.line_segment_indicies.length > 0)\n\t\t\t{\n\t\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.line_segment_indicies_buffer);\n\t\t\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Int16Array(this.line_segment_indicies), gl.STATIC_DRAW);\n\t\t\t}\n\n\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (this.line_segment_vrts_buffer != null && this.line_segment_vrts.length > 0)\n\t\t\t{\n\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.line_segment_vrts_buffer);\n\t\t\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.line_segment_vrts), gl.STATIC_DRAW);\n\t\t\t}\n\t\t}\n\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, null);\n }", "title": "" }, { "docid": "06d5e8add82350a648b84f3c47adaefa", "score": "0.63350254", "text": "initBuffers() {\n this.vertices = [];\n this.indices = [];\n this.texCoords = [];\n\n // related with the composition of the texture\n var sunit = 1 / 4;\n var tunit = 1 / 3;\n var x = (1 / 1025) / 2;\n var y = (1 / 769) / 2;\n\n // -y face\n this.vertices.push(this.halfSide, -this.halfSide, this.halfSide,\n this.halfSide, -this.halfSide, -this.halfSide,\n -this.halfSide, -this.halfSide, -this.halfSide,\n -this.halfSide, -this.halfSide, this.halfSide);\n this.indices.push(0, 1, 2,\n 2, 3, 0);\n this.texCoords.push(2 * sunit - x, 3 * tunit,\n 2 * sunit - x, 2 * tunit,\n 1 * sunit + x, 2 * tunit,\n 1 * sunit + x, 3 * tunit);\n\n // side +x face\n this.vertices.push(this.halfSide, -this.halfSide, this.halfSide,\n this.halfSide, -this.halfSide, -this.halfSide,\n this.halfSide, this.halfSide, -this.halfSide,\n this.halfSide, this.halfSide, this.halfSide);\n this.indices.push(6, 5, 4,\n 4, 7, 6);\n this.texCoords.push(3 * sunit, 2 * tunit - y,\n 2 * sunit, 2 * tunit - y,\n 2 * sunit, 1 * tunit + y,\n 3 * sunit, 1 * tunit + y);\n\n // side -z face\n this.vertices.push(this.halfSide, -this.halfSide, -this.halfSide,\n -this.halfSide, -this.halfSide, -this.halfSide,\n -this.halfSide, this.halfSide, -this.halfSide,\n this.halfSide, this.halfSide, -this.halfSide);\n this.indices.push(10, 9, 8,\n 8, 11, 10);\n this.texCoords.push(2 * sunit, 2 * tunit,\n 1 * sunit, 2 * tunit,\n 1 * sunit, 1 * tunit,\n 2 * sunit, 1 * tunit);\n\n // side -x face\n this.vertices.push(-this.halfSide, -this.halfSide, -this.halfSide,\n -this.halfSide, -this.halfSide, this.halfSide,\n -this.halfSide, this.halfSide, this.halfSide,\n -this.halfSide, this.halfSide, -this.halfSide);\n this.indices.push(14, 13, 12,\n 12, 15, 14);\n this.texCoords.push(1 * sunit, 2 * tunit - y,\n 0 * sunit, 2 * tunit - y,\n 0 * sunit, 1 * tunit + y,\n 1 * sunit, 1 * tunit + y);\n\n // side +z face\n this.vertices.push(this.halfSide, -this.halfSide, this.halfSide,\n this.halfSide, this.halfSide, this.halfSide,\n -this.halfSide, this.halfSide, this.halfSide,\n -this.halfSide, -this.halfSide, this.halfSide);\n this.indices.push(18, 17, 16,\n 16, 19, 18);\n this.texCoords.push(3 * sunit, 2 * tunit - y,\n 3 * sunit, 1 * tunit + y,\n 4 * sunit, 1 * tunit + y,\n 4 * sunit, 2 * tunit - y);\n\n // +y face\n this.vertices.push(this.halfSide, this.halfSide, this.halfSide,\n this.halfSide, this.halfSide, -this.halfSide,\n -this.halfSide, this.halfSide, -this.halfSide,\n -this.halfSide, this.halfSide, this.halfSide);\n this.indices.push(22, 21, 20,\n 20, 23, 22);\n this.texCoords.push(2 * sunit - x, 0 * tunit + y,\n 2 * sunit - x, 1 * tunit,\n 1 * sunit + x, 1 * tunit,\n 1 * sunit + x, 0 * tunit + y);\n\n this.primitiveType = this.scene.gl.TRIANGLES;\n this.initGLBuffers();\n }", "title": "" }, { "docid": "0475f01385b00c13594e50411ddf8804", "score": "0.630847", "text": "function b(a){a.__webglVertexBuffer=Ka.createBuffer(),a.__webglColorBuffer=Ka.createBuffer(),Sa.info.memory.geometries++}", "title": "" }, { "docid": "e43e0915f442ff7ffd2f28a050523193", "score": "0.6286975", "text": "bindVertexBuffers(pass) {\n let currSlot = 0;\n for (let i = 0; i < this.vertexBuffers.length; i++) {\n pass.setVertexBuffer(currSlot++, this.vertexBuffers[i], this.offsetVertexBuffer ? 4 : 0);\n }\n }", "title": "" }, { "docid": "188611e5d7f2bf3a0513f74ae365a535", "score": "0.6272644", "text": "function drawRandPixelsInInputTriangles(context) {\n var inputTriangles = getInputTriangles();\n var w = context.canvas.width;\n var h = context.canvas.height;\n var imagedata = context.createImageData(w,h);\n const PIXEL_DENSITY = 0.1;\n var numCanvasPixels = (w*h)*PIXEL_DENSITY; \n \n if (inputTriangles != String.null) { \n var x = 0; var y = 0; // pixel coord init\n var cx = 0; var cy = 0; // init center x and y coord\n var numTrianglePixels = 0; // init num pixels in triangle\n var c = new Color(0,0,0,0); // init the triangle color\n var n = inputTriangles.length; // the number of input files\n //console.log(\"number of files: \" + n);\n\n // Loop over the triangles, draw rand pixels in each\n for (var f=0; f<n; f++) {\n \tvar tn = inputTriangles[f].triangles.length;\n \t//console.log(\"number of triangles in this files: \" + tn);\n \t\n \t// Loop over the triangles, draw each in 2d\n \tfor(var t=0; t<tn; t++){\n \t\tvar vertex1 = inputTriangles[f].triangles[t][0];\n \t\tvar vertex2 = inputTriangles[f].triangles[t][1];\n \t\tvar vertex3 = inputTriangles[f].triangles[t][2];\n\n \t\tvar vertexPos1 = inputTriangles[f].vertices[vertex1];\n \t\tvar vertexPos2 = inputTriangles[f].vertices[vertex2];\n \t\tvar vertexPos3 = inputTriangles[f].vertices[vertex3];\n \t\t//console.log(\"vertexPos1 \" + vertexPos1);\n \t\t//console.log(\"vertexPos2 \" + vertexPos2);\n \t\t//console.log(\"vertexPos3 \" + vertexPos3);\n \t\t\n \t\t// triangle position on canvas\n \t\t\n \t\tvar v1 = [w*vertexPos1[0], h*vertexPos1[1]];\n \t\tvar v2 = [w*vertexPos2[0], h*vertexPos2[1]];\n \t\tvar v3 = [w*vertexPos3[0], h*vertexPos3[1]];\n \t\t\n \t\t// calculate triangle area on canvas (shoelace formula)\n \t\tvar triangleArea = 0.5*Math.abs(v1[0]*v2[1]+v2[0]*v3[1]+v3[0]*v1[1]-v2[0]*v1[1]-v3[0]*v2[1]-v1[0]*v3[1]);\n \t\tvar numTrianglePixels = triangleArea; // init num pixels in triangle\n \t//console.log(\"triangle area \" + triangleArea);\n \tnumTrianglePixels *= PIXEL_DENSITY; // percentage of triangle area to render to pixels\n \tnumTrianglePixels = Math.round(numTrianglePixels);\n \t// console.log(\"numTrianglePixels \" + numTrianglePixels);\n \tc.change(\n \t\tinputTriangles[f].material.diffuse[0]*255,\n \tinputTriangles[f].material.diffuse[1]*255,\n \tinputTriangles[f].material.diffuse[2]*255,\n \t255); // triangle diffuse color\n \tfor (var p=0; p<numTrianglePixels; p++) {\n var point; // on canvas plane\n \t\tvar triangleTest = 0;\n \t\twhile (triangleTest == 0 ){ //if the pixel outside the triangle\n \n \t\t\tpoint = [Math.floor(Math.random()*w), Math.floor(Math.random()*h)];\n \t// plane checking\n \t\t\t\n \tvar t1 = ((point[0]-v2[0]) * (v1[1] - v2[1]) - (v1[0] - v2[0]) * (point[1] - v2[1])) < 0.0;\n \tvar t2 = ((point[0]-v3[0]) * (v2[1] - v3[1]) - (v2[0] - v3[0]) * (point[1] - v3[1])) < 0.0;\n \tvar t3 = ((point[0]-v1[0]) * (v3[1] - v1[1]) - (v3[0] - v1[0]) * (point[1] - v1[1])) < 0.0;\n \t\n \tif((t1==t2)&&(t2==t3)) // draw the pixel if inside the triangle\n \t\ttriangleTest = 1;\n \t\t}\n \t\tdrawPixel(imagedata,point[0],point[1],c);\n \t//console.log(\"color: (\"+c.r+\",\"+c.g+\",\"+c.b+\")\");\n \t//console.log(\"x: \"+ x);\n \t//console.log(\"y: \"+ y);\n \t} // end for pixels in triangle\n \t} // end for triangles\n \t} // end for files\n context.putImageData(imagedata, 0, 0);\n } // end if triangle file found\n} // end draw rand pixels in input triangles", "title": "" }, { "docid": "6fab6cd815f5953bfa3ad6a08da13b36", "score": "0.6272302", "text": "function initBuffers1(gl) {\n\n // Create a buffer for the cube's vertex positions.\n\n const positionBuffer = gl.createBuffer();\n\n // Select the positionBuffer as the one to apply buffer\n // operations to from here out.\n\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n // Now create an array of positions for the cube.\n/*\n const positions = [\n // Front face\n -1.0, -1.0, 1.0,\n 1.0, -1.0, 1.0,\n 1.0, 1.0, 1.0,\n -1.0, 1.0, 1.0,\n\n // Back face\n -1.0, -1.0, -1.0,\n -1.0, 1.0, -1.0,\n 1.0, 1.0, -1.0,\n 1.0, -1.0, -1.0,\n\n // Top face\n -1.0, 1.0, -1.0,\n -1.0, 1.0, 1.0,\n 1.0, 1.0, 1.0,\n 1.0, 1.0, -1.0,\n\n // Bottom face\n -1.0, -1.0, -1.0,\n 1.0, -1.0, -1.0,\n 1.0, -1.0, 1.0,\n -1.0, -1.0, 1.0,\n\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,\n -1.0, -1.0, 1.0,\n -1.0, 1.0, 1.0,\n -1.0, 1.0, -1.0,\n ];\n*/\n \nvar i,j,k; \nconst obstacles = [\n // Front face\n -0.5, -2.0, 0.5,\n -0.5, 2.0, 0.5,\n 0.5, 2.0, 0.5,\n 0.5, -2.0, 0.5,\n\n // Back face\n 0.5, -2.0, -0.5,\n -0.5, 2.0, -0.5,\n 0.5, 2.0, -0.5,\n -0.5, -2.0, -0.5,\n\n // Top face\n -0.5, 2.0, -0.5,\n 0.5, 2.0, 0.5,\n -0.5, 2.0, 0.5,\n 0.5, 2.0, -0.5,\n\n // Bottom face\n -0.5, -2.0, -0.5,\n 0.5, -2.0, -0.5,\n 0.5, -2.0, 0.5,\n -0.5, -2.0, 0.5,\n\n // Right face\n 0.5, -2.0, -0.5,\n 0.5, 2.0, 0.5,\n 0.5, 2.0, -0.5, \n 0.5, -2.0, 0.5,\n\n // Left face\n -0.5, -2.0, -0.5,\n -0.5, 2.0, 0.5,\n -0.5, -2.0, 0.5,\n -0.5, 2.0, -0.5,\n ];\n\n// for(y=0;y<5;y++)\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(obstacles), gl.STATIC_DRAW);\n // Now set up the colors for the faces. We'll use solid colors\n // for each face.\n\nvar c;\nvar colors = [];\nconst faceColors2 = [\n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n [0.4, 1.0, 1.0, 1.0], \n// [0.3, 0.2, 0.4, 1.0],\n// [0.7, 0.6, 1.0, 1.0],\n ];\n\n\n for (j = 1; j <= faceColors2.length; j+=1) {\n c = faceColors2[j-1];\n\n // Repeat each color four times for the four vertices of the face\n colors = colors.concat(c, c, c, c);\n }\n\n\n/*\n // Convert the array of colors into a table for all the vertices.\n var c,color_flag=0;\n var colors = [];\n for(i=0; i<tunnel_length; i+=1)\n {\n \tcolor_flag = color_flag+1;\n \tif(color_flag>=30)\n \t{\n \t\tcolor_flag=0;\n \t\ti--;\n\t}\n \telse if(color_flag>=15)\n \t{\n \t//color_flag=0;\n\t\tfor(j=0; j<faceColors.length; j+=1)\n\t\t{\n\t \tc = faceColors[j];\n\t\t colors = colors.concat(c, c, c, c);\n\t }\n\t}\n\telse\n\t{\n\t\tfor(j=0; j<faceColors1.length; j+=1)\n\t\t{\n\t \tc = faceColors1[j];\n\t\t colors = colors.concat(c, c, c, c);\n\t }\n\t}\n }\n*/\n // Repeat each color four times for the four vertices of the face\n \n\n const colorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n\n // Build the element array buffer; this specifies the indices\n // into the vertex arrays for each face's vertices.\n\n const indexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n\n // This array defines each face as two triangles, using the\n // indices into the vertex array to specify each triangle's\n // position.\n\nconst indices = [\n 3, 1, 2, 3, 2, 0, // front\n 4, 6, 5, 4, 5, 7, // back\n 8, 9, 10, 8, 10, 11, // top\n 12, 13, 14, 12, 14, 15, // bottom\n 16, 18, 17, 16, 17, 19, // right\n 20, 22, 21, 20, 21, 23, // left\n ];\n\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,\n new Uint16Array(indices), gl.STATIC_DRAW);\n\n return {\n position: positionBuffer,\n color: colorBuffer,\n indices: indexBuffer,\n };\n}", "title": "" }, { "docid": "cff9eea040a8edf1b1d714b37fb92573", "score": "0.6269097", "text": "function initBuffers(gl, data) {\n\n // Create a buffer for the cube's vertex positions.\n\n const verticesBuffer = gl.createBuffer();\n \n\n // Select the positionBuffer as the one to apply buffer\n // operations to from here out.\n\n gl.bindBuffer(gl.ARRAY_BUFFER, verticesBuffer);\n \n\n // Now pass the list of positions into WebGL to build the\n // shape. We do this by creating a Float32Array from the\n // JavaScript array, then use it to fill the current buffer.\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data.vertices), gl.STATIC_DRAW);\n\n \n // Build the element array buffer; this specifies the indices\n // into the vertex arrays for each face's vertices.\n\n const indexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n\n // This array defines each face as two triangles, using the\n // indices into the vertex array to specify each triangle's\n // position.\n\n\n\n // Now send the element array to GL\n\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,\n new Uint16Array(data.indices), gl.STATIC_DRAW);\n\n return {\n vertices: verticesBuffer,\n //color: colorBuffer,\n indices: indexBuffer,\n };\n}", "title": "" }, { "docid": "9ea8c90efda2d6e09bd73f81e2f4bc1d", "score": "0.62641084", "text": "function initBuffers() {\n for (var i = 0; i < rectangleNum; i++) { // For each rectangle...\n L=(Math.random()*(maxLength - minLength) + minLength); // Length (un-scaled)\n W=(Math.random()*(maxWidth - minWidth) + minWidth); // Width (un-scaled)\n // Create the rectangle buffer itself, ie. memory allocated on the graphics card.\n VertexPositionBuffer[i] = gl.createBuffer();\n // \"Binds\" all future buffers to the rectangle buffer, ie. tells webGL that any subsequent buffer operations must be applied to the rectangle buffer.\n gl.bindBuffer(gl.ARRAY_BUFFER, VertexPositionBuffer[i]);\n // Define vertex positions. This gives a rectangular shape, of random length and width for each rectangle. Set all rectangles at a depth of 8.0 units.\n var vertices = [\n W, L, -sceneDepth, // Top right corner.\n -W, L, -sceneDepth, // Top left corner.\n W, -L, -sceneDepth, // Bottom right corner.\n -W, -L, -sceneDepth // Bottom left corner.\n ];\n // Fill the current buffer (ie. rectangle buffer) with the list of floating point numbers listed in 'vertices'. We need to convert 'vertices' to a Float32Array because Float32arrays can be used to fill buffers, whereas regular vars cannot.\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n // Specifies that each of the four vertices comprises three spacial coordinates (x,y,z).\n VertexPositionBuffer[i].itemSize = 3;\n // Specifies that each rectangle comprises four vertices.\n VertexPositionBuffer[i].numItems = 4;\n // Create color buffer\n VertexColorBuffer[i] = gl.createBuffer();\n // \"Binds\" all future color buffers to the rectangle's color buffer, ie. tells webGL that any subsequent buffer operations must be applied to the rectangle color buffer.\n gl.bindBuffer(gl.ARRAY_BUFFER, VertexColorBuffer[i]);\n // Define rectangle color scheme.\n var colors = []\n for (var j = 0; j < 4; j++) { // For the four components of the color of each rectangle...\n colors = colors.concat([Math.random(), Math.random(), Math.random(), Math.random()*(maxOpacity - minOpacity) + minOpacity]); // Amounts of red, blue, and green are randomized for each rectangle. Opaqueness is also randomized, but kept away from the lower and upper extremes.\n }\n // Fill the current buffer with the list of floating point numbers listed in 'colors'. We need to convert 'colors' to a Float32Array because Float32arrays can be used to fill buffers, whereas regular vars cannot.\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n // Specifies that each of the four vertices comprises four colors components (red, blue, green, and opaqueness).\n VertexColorBuffer[i].itemSize = 4;\n // Specifies that each rectangle comprises four vertices.\n VertexColorBuffer[i].numItems = 4;\n }\n}", "title": "" }, { "docid": "f50b87827f066b4744789b1f1aa64aa3", "score": "0.6262428", "text": "function createLineBuffers ( geometry ) {\n\n\t\t\tgeometry.__webglVertexBuffer = _gl.createBuffer();\n\t\t\tgeometry.__webglColorBuffer = _gl.createBuffer();\n\t\t\tgeometry.__webglLineDistanceBuffer = _gl.createBuffer();\n\n\t\t\t_this.info.memory.geometries ++;\n\t\t}", "title": "" }, { "docid": "6f823ed6ba3561204876609c689f1ca9", "score": "0.6257529", "text": "genVertices() {\n // 4 vertices per segment\n const vertices = new Float32Array(this.height * this.width * 8 * 3);\n const gridPositions = new Float32Array(this.height * this.width * 8 * 2);\n\n const vidx = flatIndex.bind(this, this.width, 8 * 3);\n const gidx = flatIndex.bind(this, this.width, 8 * 2);\n\n const MID_X = this.width / 2;\n const MID_Y = this.height / 2;\n // Horizontal segments\n for (let y = 0; y < this.height; ++y) {\n for (let x = 0; x < this.width; ++x) {\n // Construct this intersection block\n const block = cube(\n (x - MID_X) * this.unit, \n (y - MID_Y) * this.unit, \n 0, \n this.thickness\n );\n block.forEach((v, i) => {\n vertices[vidx(x, y, i)] = v\n });\n\n const positions = repeat([x / (this.width - 1), y / (this.height)], 8);\n positions.forEach((v, i) => gridPositions[gidx(x, y, i)] = v);\n }\n }\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vbuf);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.gbuf);\n gl.bufferData(gl.ARRAY_BUFFER, gridPositions, gl.STATIC_DRAW);\n }", "title": "" }, { "docid": "907c9cbeb961476f7d3c46b7fdf1f7c6", "score": "0.62562895", "text": "function renderShape(index) {\n\n // gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // clear frame/depth buffers\n\n // vertex buffer: activate and feed into vertex shader\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer[index]); // activate\n gl.vertexAttribPointer(vertexPositionAttrib,3,gl.FLOAT,false,0,0); // feed\n\n \n gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffer[index]); // activate\n gl.vertexAttribPointer(vertexNormalAttrib,3,gl.FLOAT,false,0,0); // feed\n\n\n // triangle buffer: activate and render\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffer[index]); // activate\n\n setUniformMatrices(index);\n gl.drawElements(gl.TRIANGLES,triBufferSize[index],gl.UNSIGNED_SHORT,0); // render\n} // end render triangles", "title": "" }, { "docid": "4103dab65fd8e1a057b46d0c174f6657", "score": "0.6255223", "text": "function createLineBuffers(geometry) {\n\n\t\t\tgeometry.__webglVertexBuffer = _gl.createBuffer();\n\t\t\tgeometry.__webglColorBuffer = _gl.createBuffer();\n\t\t\tgeometry.__webglLineDistanceBuffer = _gl.createBuffer();\n\n\t\t\t_this.info.memory.geometries++;\n\t\t}", "title": "" }, { "docid": "997a975c7af90da025751c6f7e83cd7d", "score": "0.62139666", "text": "function setupBuffersTeapot()\n{\n vertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(teapotVertices), gl.STATIC_DRAW);\n vertexPositionBuffer.itemSize = 3;\n vertexPositionBuffer.numberOfItems = teapotVertices.length/3;\n\n // Specify normals to be able to do lighting calculations\n vertexNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(teapotNormals),\n gl.STATIC_DRAW);\n vertexNormalBuffer.itemSize = 3;\n vertexNormalBuffer.numItems = teapotNormals.length;\n\n // faces\n vertexFaceBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, vertexFaceBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(teapotFaces), gl.STATIC_DRAW);\n vertexFaceBuffer.itemSize = 1;\n vertexFaceBuffer.numItems = teapotFaces.length;\n}", "title": "" }, { "docid": "562ae201d5a855ac98990cfd43ebd865", "score": "0.62082344", "text": "function finishDrawing(){\n\tif(currentFunction == \"line\"){\n\t\tlet points = [startPosition, lastCurrentPosition];\n\t\taddObject(points, \"line\");\n\t\tclickCount = 0;\n\t\tclearAndDraw();\n\t} else if(currentFunction == \"rectangle\"){\n\t\tlet p1, p2, p3, p4;\n\n\t\tp1 = startPosition;\n\t\tp2 = vec2(lastCurrentPosition[0], startPosition[1]);\n\t\tp3 = lastCurrentPosition;\n\t\tp4 = vec2(startPosition[0], lastCurrentPosition[1]);\n\n\t\tlet points = [p1, p2, p3, p4];\n\n\t\taddObject(points, \"rectangle\");\n\t\tclickCount = 0;\n\t\tclearAndDraw();\n\n\t\tconsole.log(points);\n\t} else if(currentFunction == \"triangle\"){\n\t\tr = Math.sqrt(Math.pow((lastCurrentPosition[0]-startPosition[0]),2)+Math.pow((lastCurrentPosition[1]-startPosition[1]),2));\n\t\ta = (r*6)/Math.sqrt(3);\n\t\tR = a*(Math.sqrt(3)/3);\n\t\tlet p1 = vec2(startPosition[0], startPosition[1]-R);\n\t\tlet p2 = vec2(startPosition[0]+(a/2), startPosition[1]+r);\n\t\tlet p3 = vec2(startPosition[0]-(a/2), startPosition[1]+r);\n\t\tlet points = [p1, p2, p3];\n\t\tconsole.log(points);\n\t\taddObject(points, \"triangle\");\n\t\tclickCount = 0;\n\t\tclearAndDraw();\n\t} else if(currentFunction == \"circle\"){\n\t\tlet points = [startPosition, lastCurrentPosition];\n\t\taddObject(points, \"circle\");\n\t\tclickCount = 0;\n\t\tclearAndDraw();\n\t} else if(currentFunction == \"polyline\"){\n\t\tdrag = false;\n\t\tpolyPoints.splice(count, 1);\n\t\taddObject(polyPoints, \"polyline\");\n\t\tclickCount = 0;\n\t\tcount = 1;\n\t\tclearAndDraw();\n\t} else if(currentFunction == \"curve\"){\n\t\tdrag = false;\n\t\taddObject(curvePoints, \"curve\");\n\t\tclickCount = 0;\n\t\tclearAndDraw();\n\t} else if(currentFunction == \"polygon\"){\n\t\tdrag = false;\n\t\taddObject(polygonPoints, \"polygon\");\n\t\tclickCount = 0;\n\t\tclearAndDraw();\n\t} else if(currentFunction == \"ellipse\"){\n\n\t\tlet p1, p2, p3;\n\n\t\tp1 = startPosition;\n\t\tp2 = vec2(startPosition[0], lastCurrentPosition[1]);\n\t\tp3 = vec2(lastCurrentPosition[0], startPosition[1]);\n\t\tlet points = [p1, p2, p3];\n\t\tdrag = false;\n\t\taddObject(points, \"ellipse\");\n\t\tclickCount = 0;\n\t\tclearAndDraw();\n\t}\n}", "title": "" }, { "docid": "8b1fe4e7aa820ad308b1e3b8890a085b", "score": "0.61972433", "text": "printBuffers() {\n for (var i = 0; i < this.numVertices; i++) {\n console.log(\"v \", this.positionData[i*3], \" \", \n this.positionData[i*3 + 1], \" \",\n this.positionData[i*3 + 2], \" \");\n }\n for (var i = 0; i < this.numVertices; i++) {\n console.log(\"n \", this.normalData[i*3], \" \", \n this.normalData[i*3 + 1], \" \",\n this.normalData[i*3 + 2], \" \");\n }\n for (var i = 0; i < this.numFaces; i++) {\n console.log(\"f \", this.faceData[i*3], \" \", \n this.faceData[i*3 + 1], \" \",\n this.faceData[i*3 + 2], \" \");\n } \n }", "title": "" }, { "docid": "b9c44db27643cd6a0b16e2bee53be7f5", "score": "0.61859804", "text": "function initBuffers_6( model ) {\t\t\n\t// Vertex Coordinates\t\t\n\ttriangleVertexPositionBuffer_6 = gl_6.createBuffer();\n\tgl_6.bindBuffer(gl_6.ARRAY_BUFFER, triangleVertexPositionBuffer_6);\n\tgl_6.bufferData(gl_6.ARRAY_BUFFER, new Float32Array(model.vertices_6), gl_6.STATIC_DRAW);\n\ttriangleVertexPositionBuffer_6.itemSize = 3;\n\ttriangleVertexPositionBuffer_6.numItems = model.vertices_6.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\t\n\tgl_6.vertexAttribPointer(shaderProgram_6.vertexPositionAttribute, \n\t\t\ttriangleVertexPositionBuffer_6.itemSize, \n\t\t\tgl_6.FLOAT, false, 0, 0);\n\t\n\t// Vertex Normal Vectors\t\t\n\ttriangleVertexNormalBuffer_6 = gl_6.createBuffer();\n\tgl_6.bindBuffer(gl_6.ARRAY_BUFFER, triangleVertexNormalBuffer_6);\n\tgl_6.bufferData(gl_6.ARRAY_BUFFER, new Float32Array( model.normals_6), gl_6.STATIC_DRAW);\n\ttriangleVertexNormalBuffer_6.itemSize = 3;\n\ttriangleVertexNormalBuffer_6.numItems = model.normals_6.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\t\n\tgl_6.vertexAttribPointer(shaderProgram_6.vertexNormalAttribute, \n\t\t\ttriangleVertexNormalBuffer_6.itemSize, \n\t\t\tgl_6.FLOAT, false, 0, 0);\t\n}", "title": "" }, { "docid": "74364ea2ef9eaf637363794bcec9ad30", "score": "0.61841345", "text": "function setupCubeBuffers() {\n\t// create a cube\n\n\tvar cubePositions = [];\n\tvar cubeNormals = [];\n\n\tvar numDivs = 4;\n\tvar totalTriangles = 0;\n\n\t/////////////////////////////////////////////\n\n\tvar vertexArray = [];\n\tvar numT = planeFromSubdivision(numDivs, -60,60,-60,60, vertexArray);\n\tfor(var i=0; i<numT*3; i++){\n\t\tvertexArray[i*3+2] = -60;\n\n\t\tcubePositions.push(vertexArray[i*3]);\n\t\tcubePositions.push(vertexArray[i*3+1]);\n\t\tcubePositions.push(vertexArray[i*3+2]);\n\t\tcubeNormals.push(0);\n\t\tcubeNormals.push(0);\n\t\tcubeNormals.push(1);\n\t}\n\ttotalTriangles += numT;\n\n\t/////////////////////////////////////////////\n\n\tvar vertexArray = [];\n\tvar numT = planeFromSubdivision(numDivs, -60,60,-60,60, vertexArray);\n\tfor(var i=0; i<numT*3; i++){\n\t\tvertexArray[i*3+2] = vertexArray[i*3+1];\n\t\tvertexArray[i*3+1] = -60;\n\n\t\tcubePositions.push(vertexArray[i*3]);\n\t\tcubePositions.push(vertexArray[i*3+1]);\n\t\tcubePositions.push(vertexArray[i*3+2]);\n\t\tcubeNormals.push(0);\n\t\tcubeNormals.push(1);\n\t\tcubeNormals.push(0);\n\t}\n\ttotalTriangles += numT;\n\n\tvar vertexArray = [];\n\tvar numT = planeFromSubdivision(numDivs, -60,60,-60,60, vertexArray);\n\tfor(var i=0; i<numT*3; i++){\n\t\tvertexArray[i*3+2] = vertexArray[i*3+1];\n\t\tvertexArray[i*3+1] = 60;\n\n\t\tcubePositions.push(vertexArray[i*3]);\n\t\tcubePositions.push(vertexArray[i*3+1]);\n\t\tcubePositions.push(vertexArray[i*3+2]);\n\t\tcubeNormals.push(0);\n\t\tcubeNormals.push(-1);\n\t\tcubeNormals.push(0);\n\t}\n\ttotalTriangles += numT;\n\n\t///////////////////////////////////////////////\n\n\tvar vertexArray = [];\n\tvar numT = planeFromSubdivision(numDivs, -60,60,-60,60, vertexArray);\n\tfor(var i=0; i<numT*3; i++){\n\t\tvertexArray[i*3+2] = vertexArray[i*3];\n\t\tvertexArray[i*3] = -60;\n\n\t\tcubePositions.push(vertexArray[i*3]);\n\t\tcubePositions.push(vertexArray[i*3+1]);\n\t\tcubePositions.push(vertexArray[i*3+2]);\n\t\tcubeNormals.push(1);\n\t\tcubeNormals.push(0);\n\t\tcubeNormals.push(0);\n\t}\n\ttotalTriangles += numT;\n\n\tvar vertexArray = [];\n\tvar numT = planeFromSubdivision(numDivs, -60,60,-60,60, vertexArray);\n\tfor(var i=0; i<numT*3; i++){\n\t\tvertexArray[i*3+2] = vertexArray[i*3];\n\t\tvertexArray[i*3] = 60;\n\n\t\tcubePositions.push(vertexArray[i*3]);\n\t\tcubePositions.push(vertexArray[i*3+1]);\n\t\tcubePositions.push(vertexArray[i*3+2]);\n\t\tcubeNormals.push(-1);\n\t\tcubeNormals.push(0);\n\t\tcubeNormals.push(0);\n\t}\n\ttotalTriangles += numT;\n\n\t/////////////////////////////////////////////\n\n\t// fill in vertex position buffer\n\tcubeVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexPositionBuffer); \n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(cubePositions), gl.STATIC_DRAW);\n\tcubeVertexPositionBuffer.itemSize = 3;\n\tcubeVertexPositionBuffer.numItems = totalTriangles*3;\n\n\t// fill in vertex normal buffer\n\tcubeVertexNormalBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexNormalBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(cubeNormals), gl.STATIC_DRAW);\n\tcubeVertexNormalBuffer.itemSize = 3;\n\tcubeVertexNormalBuffer.numItems = totalTriangles*3;\n\n}", "title": "" }, { "docid": "086e6854233f629ee21fe7aa5a756101", "score": "0.61788994", "text": "function drawTerrain(){\r\n for(var i = 0; i < width; ++i){\r\n for(var j = 0; j < height; ++j){\r\n gl.polygonOffset(0,0);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vPositions[i][j]);\r\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, vPositions[i][j].itemSize,\r\n gl.FLOAT, false, 0, 0);\r\n\r\n // Bind normal buffer\r\n gl.bindBuffer(gl.ARRAY_BUFFER, tVertexNormalBuffer);\r\n gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, tVertexNormalBuffer.itemSize,\r\n gl.FLOAT, false, 0, 0);\r\n\r\n //Draw\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexTriBuffer);\r\n gl.drawElements(gl.TRIANGLES, tIndexTriBuffer.numItems, gl.UNSIGNED_SHORT,0);\r\n }\r\n }\r\n\r\n}", "title": "" }, { "docid": "909023bfbfb4f57e2a0625550457f457", "score": "0.6159266", "text": "initBuffers() {\n\n this.controlpoints = [\n [0.5, 0.0, 0.5, 1 ],\n [-0.5, 0.0, 0.5, 1 ],\n [ 0.5, 0.0,-0.5, 1 ],\n [ -0.5, 0.0, -0.5, 1 ]\n ];\n\n this.patch = new MyPatch(this.scene, 2, 2, this.npartsU, this.npartsV,this.controlpoints);\n }", "title": "" }, { "docid": "0d716d3f544295dde196abad38cd4054", "score": "0.61584496", "text": "function coordinate_reset() {\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\n var triangleVertices = [\n //blue top rectangle\n 0.893, 0.956, 0.0,\n 0.893, 0.665, 0.0,\n -0.893, 0.665, 0.0,\n\n 0.893, 0.956, 0.0,\n -0.893, 0.956, 0.0,\n -0.893, 0.665, 0.0,\n\n //blue right big rectangle\n 0.715, 0.665, 0.0,\n 0.715,-0.307, 0.0,\n 0.324,-0.307, 0.0,\n\n 0.715, 0.665, 0.0,\n 0.324, 0.665, 0.0,\n 0.324,-0.307, 0.0,\n\n //blue left big rectangle\n -0.715, 0.665, 0.0,\n -0.715,-0.307, 0.0,\n -0.324,-0.307, 0.0,\n\n -0.715, 0.665, 0.0,\n -0.324, 0.665, 0.0,\n -0.324,-0.307, 0.0,\n\n //blue right small rectangle\n 0.182-dance2, 0.378, 0.0,\n 0.182-dance2,-0.048, 0.0,\n 0.324,-0.048, 0.0,\n\n 0.182-dance2, 0.378, 0.0,\n 0.324, 0.378, 0.0,\n 0.324,-0.048, 0.0,\n\n //blue left small rectangle\n -0.182+dance2, 0.378, 0.0,\n -0.182+dance2,-0.048, 0.0,\n -0.324,-0.048, 0.0,\n\n -0.182+dance2, 0.378, 0.0,\n -0.324, 0.378, 0.0,\n -0.324,-0.048, 0.0,\n\n //orange right most\n 0.715,-0.369, 0.0,\n 0.715,-0.502, 0.0,\n 0.585,-0.369, 0.0,\n\n 0.585,-0.369, 0.0,\n 0.715,-0.502, 0.0,\n 0.585,-0.58, 0.0,\n\n //orange second right\n 0.325,-0.369, 0.0,\n 0.455,-0.63, 0.0,\n 0.455,-0.369, 0.0,\n\n 0.325,-0.369, 0.0,\n 0.455,-0.63, 0.0,\n 0.325,-0.70, 0.0,\n\n //orange third right\n 0.065,-0.369, 0.0,\n 0.195,-0.369, 0.0,\n 0.195,-0.75, 0.0,\n\n 0.065,-0.369, 0.0,\n 0.195,-0.75, 0.0,\n 0.065,-0.80, 0.0,\n\n //orange left most\n -0.715,-0.369, 0.0,\n -0.715,-0.502, 0.0,\n -0.585,-0.369, 0.0,\n\n -0.585,-0.369, 0.0,\n -0.715,-0.502, 0.0,\n -0.585,-0.58, 0.0,\n\n //orange second left\n -0.325,-0.369, 0.0,\n -0.455,-0.63, 0.0,\n -0.455,-0.369, 0.0,\n\n -0.325,-0.369, 0.0,\n -0.455,-0.63, 0.0,\n -0.325,-0.70, 0.0,\n\n //orange third left\n -0.065,-0.369, 0.0,\n -0.195,-0.369, 0.0,\n -0.195,-0.75, 0.0,\n\n -0.065,-0.369,0.0,\n -0.195,-0.75, 0.0,\n -0.065,-0.80, 0.0,\n ];\n \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.STATIC_DRAW);\n vertexPositionBuffer.itemSize = 3; //x,y,z coordinates\n vertexPositionBuffer.numberOfItems = 66; //22 triangles in total. \n}", "title": "" }, { "docid": "95b8a7fbd1af1cb63878dcddd5371205", "score": "0.6156586", "text": "function drawTruchet2() {\n var pointer;\n for (i = 0; i < 2; i++) {\n pointer = truchet1.length + CIRCLE_RESOLUTION * i;\n gl.drawArrays(gl.LINE_STRIP, pointer + 1, CIRCLE_RESOLUTION);\n }\n}", "title": "" }, { "docid": "72cfa66b6b064e3173a8111e756dfb57", "score": "0.6149293", "text": "function initVertexBuffers(gl,r,g,b){\n\t//first create an array to store vertices \n\tvar 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, \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, \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, \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, \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, \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 \n ]);\n\t//then create similar array for colors just consisting of rgb for colors \n var colors = new Float32Array([ \n r, g, b, r, g, b, r, g, b, r, g, b, \n r, g, b, r, g, b, r, g, b, r, g, b, \n r, g, b, r, g, b, r, g, b, r, g, b,\n r, g, b, r, g, b, r, g, b, r, g, b, \n r, g, b, r, g, b, r, g, b, r, g, b, \n r, g, b, r, g, b, r, g, b, r, g, b, \n ]);\t\t\n\tvar indices = new Uint8Array([ 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23]);\t\n\t//buffer objects:\n\tvar buffer = gl.createBuffer();\n\tif(!buffer){\n\t\treturn -1;\n\t}\n\t// Write vertex coordinates and color to buffer object \n\tif(!initArrayBuffer(gl, vertices, 3, gl.FLOAT, 'a_Position')){\n\t\treturn -1\n\t}\n\tif(!initArrayBuffer(gl, colors, 3, gl.FLOAT, 'a_Color')){\n\t\treturn -1;\n\t}\n\t//Writes indices to the buffer object \n\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);\n return indices.length;\n}", "title": "" }, { "docid": "7224e396e3874789984f2debc7888afe", "score": "0.61461455", "text": "initBuffers() \n\t{\n\t\tthis.vertices = [];\n\t\tthis.normals = [];\n\t\tthis.indices = [];\n\t\tthis.texCoords = [];\n\n var slicesAng = 2 * Math.PI / this.slices;\n var loopsAng = 2 * Math.PI / this.loops; \n\n var patchLengthx = 1 / this.slices;\n var patchLengthy = 1 / this.loops;\n var xCoord = 0;\n var yCoord = 0;\n\n for (var l = 0; l < this.loops+1 ; l++) {\n var x = Math.cos(l * loopsAng) * this.dist;\n var y = Math.sin(l * loopsAng) * this.dist;\n\n for (var s = 0; s <= this.slices; s++) {\n this.vertices.push(Math.cos(s * slicesAng) * this.r * Math.cos(l * loopsAng) + x, Math.cos(s * slicesAng) * this.r * Math.sin(l * loopsAng) + y, Math.sin(s * slicesAng) * this.r);\n this.normals.push(Math.cos(l * loopsAng) * Math.cos(s * slicesAng), Math.cos(s * slicesAng) * Math.sin(l * loopsAng), Math.sin(s * slicesAng));\n \n this.texCoords.push(xCoord, yCoord);\n \n yCoord += patchLengthy;\n }\n\n yCoord = 0;\n xCoord += patchLengthx; \n }\n\n var sides = this.slices +1;\n\n for (var l = 0; l < this.loops; l++) {\n for (var s = 0; s < this.slices; s++) {\n this.indices.push(sides*l+s, sides*(l+1)+s, sides*l+s+1);\n this.indices.push(sides*l+s+1, sides*(l+1)+s, sides*(l+1)+s+1);\n\n this.indices.push(sides*l+s, sides*l+s+1, sides*(l+1)+s);\n this.indices.push(sides*l+s+1, sides*(l+1)+s+1, sides*(l+1)+s);\n }\n }\n\n this.primitiveType = this.scene.gl.TRIANGLES;\n this.initGLBuffers();\n }", "title": "" }, { "docid": "438b35423397f61188be575066ede373", "score": "0.6135367", "text": "function makeSquare(ctx)\n{\n // plane\n // v1------v0\n // | |\n // | |\n // | |\n // v2------v3\n //\n // vertex coords array\n var vertices = new Float32Array(\n [ 1, 1, 1, -1, 1, 1, -1,-1, 1, 1,-1, 1] // v0-v1-v2-v3 front\n );\n // normal array\n var normals = new Float32Array(\n [ 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1] // v0-v1-v2-v3 front\n );\n // texCoord array\n /*\n var texCoords = new Float32Array(\n [ 1, 1, 0, 1, 0, 0, 1, 0] // v0-v1-v2-v3 front\n );\n */\n var texCoords = new Float32Array(\n [ 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, -0.5] // v0-v1-v2-v3 front\n );\n // index array\n var indices = new Uint8Array(\n [ 0, 1, 2, 0, 2, 3] // front\n );\n var retval = { };\n retval.normalObject = ctx.createBuffer();\n ctx.bindBuffer(ctx.ARRAY_BUFFER, retval.normalObject);\n ctx.bufferData(ctx.ARRAY_BUFFER, normals, ctx.STATIC_DRAW);\n\n retval.texCoordObject = ctx.createBuffer();\n ctx.bindBuffer(ctx.ARRAY_BUFFER, retval.texCoordObject);\n ctx.bufferData(ctx.ARRAY_BUFFER, texCoords, ctx.STATIC_DRAW);\n\n retval.vertexObject = ctx.createBuffer();\n ctx.bindBuffer(ctx.ARRAY_BUFFER, retval.vertexObject);\n ctx.bufferData(ctx.ARRAY_BUFFER, vertices, ctx.STATIC_DRAW);\n\n ctx.bindBuffer(ctx.ARRAY_BUFFER, null);\n\n retval.indexObject = ctx.createBuffer();\n ctx.bindBuffer(ctx.ELEMENT_ARRAY_BUFFER, retval.indexObject);\n ctx.bufferData(ctx.ELEMENT_ARRAY_BUFFER, indices, ctx.STATIC_DRAW);\n ctx.bindBuffer(ctx.ELEMENT_ARRAY_BUFFER, null);\n\n retval.numIndices = indices.length;\n return retval;\n}", "title": "" }, { "docid": "01917e28bb2f37a4b99be2be41c210c0", "score": "0.612606", "text": "function initBuffers( model ) {\n\n\t// Vertex Coordinates\n\ttriangleVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(model.vertices), gl.STATIC_DRAW);\n\ttriangleVertexPositionBuffer.itemSize = 3;\n\ttriangleVertexPositionBuffer.numItems = model.vertices.length / 3;\n\n\t// Associating to the vertex shader\n\tgl.vertexAttribPointer(shaderProgram.vertexPositionAttribute,\n\t\t\ttriangleVertexPositionBuffer.itemSize,\n\t\t\tgl.FLOAT, false, 0, 0);\n\n\n\t// Vertex Normal Vectors\n\ttriangleVertexNormalBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexNormalBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array( model.normals), gl.STATIC_DRAW);\n\ttriangleVertexNormalBuffer.itemSize = 3;\n\ttriangleVertexNormalBuffer.numItems = model.normals.length / 3;\n\n\t// Associating to the vertex shader\n\tgl.vertexAttribPointer(shaderProgram.vertexNormalAttribute,\n\t\t\ttriangleVertexNormalBuffer.itemSize,\n\t\t\tgl.FLOAT, false, 0, 0);\n}", "title": "" }, { "docid": "233ffc8e9261b847437d34efa8064294", "score": "0.61136794", "text": "function initBuffers()\n{\n //maxium particles that can be represented in the textures\n var maxparticleCount = RT_TEX_SIZE * RT_TEX_SIZE;\n\n bufferCount = Math.ceil( maxparticleCount / MAX_PER_BUFFER );\n\n cubeVerticesBuffers.length = bufferCount;\n\n var gridSize = Math.ceil( Math.sqrt( maxparticleCount ) );\n\n for( var b = 0; b < bufferCount; b++ )\n {\n cubeVerticesBuffers[b] = gl.createBuffer();\n\n // setup batched vertex buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVerticesBuffers[b]);\n\n var batchedVertices = [];\n batchedVertices.length = vertices.length * Math.min( MAX_PER_BUFFER, maxparticleCount - b * MAX_PER_BUFFER );\n\n // each cube in buffer will be spaced out on xz grid - so shader can differentiate between them\n for(var i=0; i < batchedVertices.length; i+=3 )\n {\n var index = i % vertices.length;\n var pos = vertices.slice(index,index + 3);\n\n // index of cube out of all cubes through all buffers\n var cubedex = Math.floor( ( i + b * MAX_PER_BUFFER * vertices.length ) / vertices.length );\n\n pos[0] = pos[0] + ( cubedex % gridSize ) * 3;\n pos[2] = pos[2] + Math.floor( cubedex / gridSize ) * 3;\n\n batchedVertices[i] = pos[0];\n batchedVertices[i+1] = pos[1];\n batchedVertices[i+2] = pos[2];\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(batchedVertices), gl.STATIC_DRAW);\n }\n\n\n cubeVerticesIndexBuffer = gl.createBuffer();\n\n // setup batched elements\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeVerticesIndexBuffer);\n\n\n var batchedElements = [];\n batchedElements.length = cubeVertexIndices.length * MAX_PER_BUFFER;\n\n for( var i=0; i < batchedElements.length; i++ )\n {\n var index = i % cubeVertexIndices.length;\n\n // index of cube out of cubes in this current buffer\n var cubedex = Math.floor( i / cubeVertexIndices.length );\n\n batchedElements[i] = cubeVertexIndices[index] + cubedex * vertices.length / 3; // 8 vertex points in a cube - aka ( vertices / 3 )\n }\n\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(batchedElements), gl.STATIC_DRAW);\n}", "title": "" }, { "docid": "9fac9f99401cd9dc1dde1f8ebb483413", "score": "0.6111039", "text": "function populate_buffers(pa) {\n\n\n /*-- Particle Data Buffer --*/\n\n // Note: This block calculates the UV coordinates for each pixel of the images\n // representing a particle's data (initial pos, final pos, pos, etc). Values\n // are in range [0, 1]. The coordinates are sent to the vertex_particle shader\n // as uv_coord_data.\n\n // Declare Variables\n let uv_coord_data = [];\n let pixel_size = (new Decimal(1.0)).dividedBy(new Decimal(config.TEXTURE_SIZE)); // 1 / TEXTURE_SIZE\n let half_pixel_size = pixel_size.dividedBy(new Decimal(2)); // pixel_size / 2\n\n // Generate Texture Coordinates for Each Pixel\n for (let x = 0; x < config.TEXTURE_SIZE; x++) {\n \tfor (let y = 0; y < config.TEXTURE_SIZE; y++) {\n \t\tlet coord_x = pixel_size.times(new Decimal(x).plus(half_pixel_size)).toPrecision(10);\n \t\tlet coord_y = pixel_size.times(new Decimal(y).plus(half_pixel_size)).toPrecision(10);\n\t\t uv_coord_data.push(coord_x);\n\t\t uv_coord_data.push(coord_y);\n \t}\n }\n\n // Send UV Coordinates to GPU\n\tgl.bindBuffer(gl.ARRAY_BUFFER, uv_coord_data_buffer); \n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(uv_coord_data), gl.STATIC_DRAW);\n}", "title": "" }, { "docid": "00accf3ff630e3732a227f5bb880090d", "score": "0.61096805", "text": "function initBuffers( model ) {\t\n\t\n\t// Vertex Coordinates\n\ttriangleVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(model.vertices), gl.STATIC_DRAW);\n\ttriangleVertexPositionBuffer.itemSize = 3;\n\ttriangleVertexPositionBuffer.numItems = model.vertices.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\n\tgl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, \n\t\t\ttriangleVertexPositionBuffer.itemSize, \n\t\t\tgl.FLOAT, false, 0, 0);\n\t\n\t// Vertex Normal Vectors\n\ttriangleVertexNormalBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexNormalBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array( model.normals), gl.STATIC_DRAW);\n\ttriangleVertexNormalBuffer.itemSize = 3;\n\ttriangleVertexNormalBuffer.numItems = model.normals.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\n\tgl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, \n\t\t\ttriangleVertexNormalBuffer.itemSize, \n\t\t\tgl.FLOAT, false, 0, 0);\t\n}", "title": "" }, { "docid": "24d9b971473e94bc705f2e82424728e0", "score": "0.6109317", "text": "onContextChange()\n {\n const gl = this.renderer.gl;\n\n this.extension = gl.getExtension('ANGLE_instanced_arrays');\n\n this.shader = new PIXI.Shader(gl, vs, fs);\n this.quad = new Quad(gl);\n this.quad.initVao(this.shader);\n\n this.offsetBuffer1 = glCore.GLBuffer.createVertexBuffer(gl, null, gl.DYNAMIC_DRAW);\n this.quad.vao.addAttribute(this.offsetBuffer1, this.shader.attributes.aOffset1, gl.FLOAT, false, 4 * 4, 0);\n this.extension.vertexAttribDivisorANGLE(INDEX_OF_OFFSET1, 1);\n\n this.offsetBuffer2 = glCore.GLBuffer.createVertexBuffer(gl, null, gl.DYNAMIC_DRAW);\n this.quad.vao.addAttribute(this.offsetBuffer2, this.shader.attributes.aOffset2, gl.FLOAT, false, 4 * 4, 0);\n this.extension.vertexAttribDivisorANGLE(INDEX_OF_OFFSET2, 1);\n\n this.offsetBuffer3 = glCore.GLBuffer.createVertexBuffer(gl, null, gl.DYNAMIC_DRAW);\n this.quad.vao.addAttribute(this.offsetBuffer3, this.shader.attributes.aOffset3, gl.FLOAT, false, 4 * 4, 0);\n this.extension.vertexAttribDivisorANGLE(INDEX_OF_OFFSET3, 1);\n\n this.selectedBuffer = glCore.GLBuffer.createVertexBuffer(gl, null, gl.DYNAMIC_DRAW);\n this.quad.vao.addAttribute(this.selectedBuffer, this.shader.attributes.aSelected, gl.FLOAT, false, 4, 0);\n this.extension.vertexAttribDivisorANGLE(INDEX_OF_SELECTED, 1);\n\n this.thicknessBuffer = glCore.GLBuffer.createVertexBuffer(gl, null, gl.DYNAMIC_DRAW);\n this.quad.vao.addAttribute(this.thicknessBuffer, this.shader.attributes.aThickness, gl.FLOAT, false, 4, 0);\n this.extension.vertexAttribDivisorANGLE(INDEX_OF_THICKNESS, 1);\n\n this.colorBuffer = glCore.GLBuffer.createVertexBuffer(gl, null, gl.DYNAMIC_DRAW);\n this.quad.vao.addAttribute(this.colorBuffer, this.shader.attributes.aColor, gl.FLOAT, false, 3 * 4, 0);\n this.extension.vertexAttribDivisorANGLE(INDEX_OF_COLOR, 1);\n\n this.hasArrowBuffer = glCore.GLBuffer.createVertexBuffer(gl, null, gl.DYNAMIC_DRAW);\n this.quad.vao.addAttribute(this.hasArrowBuffer, this.shader.attributes.aHasArrow, gl.FLOAT, false, 4, 0);\n this.extension.vertexAttribDivisorANGLE(INDEX_OF_HASARROW, 1);\n\n this.renderer.bindVao(this.quad.vao);\n this.quad.upload();\n }", "title": "" }, { "docid": "63b645e8566df1f5a8109dd3f8636aaf", "score": "0.60939825", "text": "function initBuffers( model ) {\t\n\t\n\t// Vertex Coordinates\n\t\t\n\ttriangleVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(model.vertices), gl.STATIC_DRAW);\n\ttriangleVertexPositionBuffer.itemSize = 3;\n\ttriangleVertexPositionBuffer.numItems = model.vertices.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\n\t\n\tgl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, \n\t\t\ttriangleVertexPositionBuffer.itemSize, \n\t\t\tgl.FLOAT, false, 0, 0);\n\t\n\t// Vertex Normal Vectors\n\t\t\n\ttriangleVertexNormalBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexNormalBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array( model.normals), gl.STATIC_DRAW);\n\ttriangleVertexNormalBuffer.itemSize = 3;\n\ttriangleVertexNormalBuffer.numItems = model.normals.length / 3;\t\t\t\n\n\t// Associating to the vertex shader\n\t\n\tgl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, \n\t\t\ttriangleVertexNormalBuffer.itemSize, \n\t\t\tgl.FLOAT, false, 0, 0);\t\n}", "title": "" }, { "docid": "70d7d1d819bcb2db85f77cd49f11df88", "score": "0.6088597", "text": "constructor() {\n this.origin = vec3.fromValues(0, 0, 0);\n this.ending = vec3.fromValues(0, 0, 0);\n this.color = vec4.fromValues(1, 1, 1, 1);\n\n const LINE_THICKNESS = 0.2;\n this.current_thickness = LINE_THICKNESS;\n const BORDER_THICKNESS = 0.5;\n this.current_border = BORDER_THICKNESS;\n\n this.temp_vec4 = [];\n this.temp_vec4_pos = 0;\n\n this.stack = [];\n\n this.triangle_positions = [];\n this.triangle_colors = [];\n this.triangle_indices = [];\n this.triangle_normals = [];\n\n this.line_positions = [];\n this.line_colors = [];\n this.line_thickness = [];\n this.line_borders = [];\n\n this.positions = [];\n this.colors = [];\n }", "title": "" }, { "docid": "47a790b028a63e0f08c31d1d7a543edf", "score": "0.6081836", "text": "function initBuffers(gl) {\n\n // Create a buffer for the cube's vertex positions.\n\n // const positionBuffer = gl.createBuffer();\n\n // Select the positionBuffer as the one to apply buffer\n // operations to from here out.\n\n // gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n // Now create an array of positions for the cube.\n\n // const positions = [\n // // Front face\n // -1.0, -1.0, 1.0,\n // 1.0, -1.0, 1.0,\n // 1.0, 1.0, 1.0,\n // -1.0, 1.0, 1.0,\n // ];\n\n // Now pass the list of positions into WebGL to build the\n // shape. We do this by creating a Float32Array from the\n // JavaScript array, then use it to fill the current buffer.\n\n // gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);\n\n // Now set up the colors for the faces. We'll use solid colors\n // for each face.\n\n // const faceColors = [\n // [1.0, 0.0, 1.0, 1.0], // Left face: purple\n // ];\n // rect = new Rectangle(2,2, new vec3.fromValues(4,5,6));\n // let temp_Vec = new vec3.fromValues(1,2,3);\n // temp_Vec[2] = 1;\n // console.log(temp_Vec);\n //\n // // Convert the array of colors into a table for all the vertices.\n // console.log(faceColors);\n // var colors = [];\n //\n // for (var j = 0; j < faceColors.length; ++j) {\n // const c = faceColors[j];\n //\n // // Repeat each color four times for the four vertices of the face\n // colors = colors.concat(c, c, c, c);\n // }\n // console.log(colors);\n\n\n // const colorBuffer = gl.createBuffer();\n // gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);\n // gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n\n // Build the element array buffer; this specifies the indices\n // into the vertex arrays for each face's vertices.\n\n // const indexBuffer = gl.createBuffer();\n // gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n\n // This array defines each face as two triangles, using the\n // indices into the vertex array to specify each triangle's\n // position.\n //\n // const indices = [\n // 0, 1, 2, 0, 2, 3, // front\n // ];\n\n // rect = new Rectangle(2,2, new vec3.fromValues(0,1,1), );\n // rect2 = new Rectangle(2,2, new vec3.fromValues(-1, 0, 0));\n // cuboid = new Cuboid(new vec3.fromValues(-5, -1, 0), 2,2,2, '');\n // textureCuboid = new cuboidWithTexture(new vec3.fromValues(0,-2.5,4), 2,2,2);\n // for (let i=0;i<50;i++) {\n // track.push(new cuboidWithTexture(new vec3.fromValues(0,-2.5,4-2*i), 2,2,2));\n // track.push(new cuboidWithTexture(new vec3.fromValues(-3,-2.5,4-2*i), 2,2,2));\n // track.push(new cuboidWithTexture(new vec3.fromValues(3,-2.5,4-2*i), 2,2,2))\n\n // }\n\n let temp_mat = mat2.fromValues(1,2,3,4);\n console.log(temp_mat);\n let tran = mat2.create();\n mat2.transpose(tran, temp_mat);\n mat4.sub(temp_mat, temp_mat, mat2.fromValues(1,1,0,1));\n mat4.sub(tran, tran, mat2.fromValues(1,1,0,1));\n\n console.log(temp_mat);\n console.log(tran);\n // sleep(500);\n\n ground = new Rectangle(1000, 1000, [0,-2.5,0], -1, -1, COLORS_0_1.SANDY_BROWN);\n ground.rotate(-90, X_AXIS, ORIGIN);\n let ground_y = -2.5;\n // let img = 'rail8.jpg';\n // for (let i=0;i<100;i++) {\n // rect_track.push(new Rectangle(2,2, new vec3.fromValues(0, -2.5, 4-2*i), img));\n // rect_track[rect_track.length - 1].rotate(-90, X_AXIS, ORIGIN);\n // rect_track.push(new Rectangle(2,2, new vec3.fromValues(-3, -2.5, 4-2*i), img));\n // rect_track[rect_track.length-1].rotate(-90, X_AXIS, ORIGIN);\n // rect_track.push(new Rectangle(2,2, new vec3.fromValues(3, -2.5, 4-2*i), img));\n // rect_track[rect_track.length-1].rotate(-90, X_AXIS, ORIGIN);\n // }\n let img = 'rail10.jpg';\n left_track = new Rectangle(200,2, vec3.fromValues(-3, -2.5, -100), img, {s: gl.CLAMP_TO_EDGE, t:gl.REPEAT}, ground.color);\n left_track.rotate(-90, X_AXIS, ORIGIN);\n right_track = new Rectangle(200,2, vec3.fromValues(3, -2.5, -100), img, {s: gl.CLAMP_TO_EDGE, t:gl.REPEAT}, ground.color);\n right_track.rotate(-90, X_AXIS, ORIGIN);\n center_track = new Rectangle(200,2, vec3.fromValues(0, -2.5, -100), img, {s: gl.CLAMP_TO_EDGE, t:gl.REPEAT}, ground.color);\n center_track.rotate(-90, X_AXIS, ORIGIN);\n img = 'wall4.jpg';\n // for (let i=0;i<100;i++) {\n // // brick_wall.push(new Rectangle(2,2, new vec3.fromValues(6,-0.7,4-2*i), img));\n // // brick_wall[brick_wall.length-1].rotate(-90, Y_AXIS, ORIGIN);\n // // brick_wall.push(new Rectangle(2,2, new vec3.fromValues(-4,-0.7,4-2*i), img));\n // // brick_wall[brick_wall.length-1].rotate(-90, Y_AXIS, ORIGIN)\n //\n // brick_wall.push(new Cuboid(vec3.fromValues(6,-0.7,4-2*i), 1,1,1, '', img));\n // brick_wall.push(new Cuboid(vec3.fromValues(-6,-0.7,4-2*i),1,1, 1, '',img));\n // }\n\n // cuboid = new Cuboid(vec3.fromValues(1,1,-1),2,2, 'sd');\n right_wall = new Cuboid(vec3.fromValues(6,-0.5,-100), 1,2,200,'', 'wall9.jpg', {s:gl.REPEAT, t:gl.REPEAT}, true, true);\n left_wall = new Cuboid(vec3.fromValues(-6,-0.5,-100), 1,2,200,'', 'wall9.jpg', {s:gl.REPEAT, t:gl.REPEAT}, true, true);\n mario = new Player([0,0,1]);\n for (let i=0;i<10;i++) {\n coins.push(new Circle(vec3.fromValues(0, -1, -15 -2*i), 0.4, COLORS_0_1.GOLD));\n coins[i].rotate(Math.floor((Math.random() * 50) + 1), Y_AXIS, ORIGIN)\n }\n\n // down_obst = new Barrier(vec3.fromValues(left_track.position[0], ground_y + 2, -20), 1, 0.1, );\n high_pass_barriers.push(new HighPassBarrier(vec3.fromValues(right_track.position[0], ground_y + 1, -20)));\n high_pass_barriers.push(new HighPassBarrier(vec3.fromValues(right_track.position[0], ground_y + 1, -60)));\n\n low_pass_barriers.push(new LowPassBarrier(vec3.fromValues(left_track.position[0], ground_y + 3, -20)));\n low_pass_barriers.push(new LowPassBarrier(vec3.fromValues(left_track.position[0], ground_y + 3, -60)));\n band_pass_barriers.push(new BandPassBarrier(vec3.fromValues(center_track.position[0], ground_y + 2, -20)));\n\n trains.push(new Train(vec3.fromValues(left_track.position[0], ground_y + 3.2, -25)));\n trains.push(new Train(vec3.fromValues(right_track.position[0], ground_y + 3.2, -25)));\n trains.push(new Train(vec3.fromValues(center_track.position[0], ground_y + 3.2, -54)));\n\n\n flying_boosters.push(new FlyingBoost([center_track.position[0], ground_y + 1.83, -15]));\n\n for (let i=0;i<flying_boosters.length;i++) {\n\n let start_angle = 30;\n while(start_angle < 150) {\n let angle = start_angle*PI/180;\n let pos = [flying_boosters[i].position[0], 0, 0];\n pos[1] = flying_boosters[i].position[1] + 20 * Math.sin(angle);\n pos[2] = (flying_boosters[i].position[2]-50) + 50 * Math.cos(angle);\n coins.push(new Circle(pos, 0.4, COLORS_0_1.GOLD));\n\n start_angle += 5;\n }\n }\n\n // right_wall.rotate(90, Z_AXIS, ORIGIN)\n\n\n\n // let pos = new vec3.fromValues(1,2,-40);\n // rect_track.push(new Rectangle(2,2, pos))\n // Now send the element array to GL\n\n // gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,\n // new Uint16Array(indices), gl.STATIC_DRAW);\n //\n // return {\n // position: positionBuffer,\n // color: colorBuffer,\n // indices: indexBuffer,\n // };\n}", "title": "" }, { "docid": "410850c1a25954628247dfc2dcd015d3", "score": "0.6076591", "text": "function drawTruchet1() {\n var pointer;\n for (i = 0; i < 2; i++) {\n pointer = CIRCLE_RESOLUTION * i;\n gl.drawArrays(gl.LINE_STRIP, pointer + 1, CIRCLE_RESOLUTION);\n }\n}", "title": "" }, { "docid": "04a77c981d0baffcd8a08bbe712f9ffc", "score": "0.60729736", "text": "function loadVerticesLogo() {\r\n vertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\r\n var triangleVertices = [\r\n //UPPER\r\n -0.5, 0.7, 0.0,\r\n -0.5, 0.4, 0.0,\r\n -0.2, 0.4, 0.0,\r\n \r\n -0.5, 0.7, 0.0,\r\n -0.2, 0.7, 0.0,\r\n -0.2, 0.4, 0.0,\r\n \r\n 0.2, 0.4, 0.0,\r\n -0.2, 0.7, 0.0,\r\n -0.2, 0.4, 0.0,\r\n \r\n 0.2, 0.4, 0.0,\r\n -0.2, 0.7, 0.0,\r\n 0.2, 0.7, 0.0,\r\n \r\n 0.2, 0.4, 0.0,\r\n 0.5, 0.4, 0.0,\r\n 0.2, 0.7, 0.0,\r\n \r\n 0.5, 0.7, 0.0,\r\n 0.5, 0.4, 0.0,\r\n 0.2, 0.7, 0.0,\r\n \r\n //LOWER\r\n \r\n -0.5, -0.7, 0.0,\r\n -0.5, -0.4, 0.0,\r\n -0.2, -0.4, 0.0,\r\n \r\n -0.5, -0.7, 0.0,\r\n -0.2, -0.7, 0.0,\r\n -0.2, -0.4, 0.0,\r\n \r\n 0.2, -0.4, 0.0,\r\n -0.2, -0.7, 0.0,\r\n -0.2, -0.4, 0.0,\r\n \r\n 0.2, -0.4, 0.0,\r\n -0.2, -0.7, 0.0,\r\n 0.2, -0.7, 0.0,\r\n \r\n 0.2, -0.4, 0.0,\r\n 0.5, -0.4, 0.0,\r\n 0.2, -0.7, 0.0,\r\n \r\n 0.5, -0.7, 0.0,\r\n 0.5, -0.4, 0.0,\r\n 0.2, -0.7, 0.0,\r\n \r\n \r\n //Center Triangles\r\n -0.2, 0.4, 0.0,\r\n 0.2, 0.4, 0.0,\r\n -0.2, -0.4, 0.0,\r\n \r\n -0.2, -0.4, 0.0,\r\n 0.2, -0.4, 0.0,\r\n 0.2, 0.4, 0.0,\r\n \r\n \r\n //Border\r\n \r\n -0.5, 0.7, 0.0,\r\n -0.55, 0.75, 0.0,\r\n -0.5, 0.4, 0.0,\r\n \r\n -0.55, 0.35, 0.0,\r\n -0.55, 0.8, 0.0,\r\n -0.5, 0.4, 0.0,\r\n \r\n 0.5, 0.7, 0.0,\r\n 0.55, 0.75, 0.0,\r\n 0.5, 0.4, 0.0,\r\n \r\n 0.55, 0.35, 0.0,\r\n 0.55, 0.75, 0.0,\r\n 0.5, 0.4, 0.0,\r\n \r\n -0.5, 0.7, 0.0,\r\n -0.55, 0.75, 0.0,\r\n -0.2, 0.7, 0.0,\r\n \r\n -0.2, 0.75, 0.0,\r\n -0.55, 0.75, 0.0,\r\n -0.2, 0.7, 0.0,\r\n \r\n 0.5, 0.7, 0.0,\r\n 0.55, 0.75, 0.0,\r\n 0.2, 0.7, 0.0,\r\n \r\n 0.2, 0.75, 0.0,\r\n 0.55, 0.75, 0.0,\r\n 0.2, 0.7, 0.0,\r\n \r\n 0.2, 0.75, 0.0,\r\n -0.2, 0.75, 0.0,\r\n 0.2, 0.7, 0.0,\r\n \r\n 0.2, 0.7, 0.0,\r\n -0.2, 0.75, 0.0,\r\n -0.2, 0.7, 0.0,\r\n \r\n -0.55, 0.35, 0.0,\r\n -0.5 , 0.4 , 0.0,\r\n -0.2 , 0.4 , 0.0,\r\n \r\n -0.55, 0.35, 0.0,\r\n -0.25, 0.35, 0.0,\r\n -0.2 , 0.4 , 0.0,\r\n \r\n \r\n 0.55, 0.35, 0.0,\r\n 0.5 , 0.4 , 0.0,\r\n 0.2 , 0.4 , 0.0,\r\n \r\n 0.55, 0.35, 0.0,\r\n 0.25, 0.35, 0.0,\r\n 0.2 , 0.4 , 0.0,\r\n \r\n //Mirror border\r\n \r\n -0.5, -0.7, 0.0,\r\n -0.55, -0.75, 0.0,\r\n -0.5, -0.4, 0.0,\r\n \r\n -0.55, -0.35, 0.0,\r\n -0.55, -0.75, 0.0,\r\n -0.5, -0.4, 0.0,\r\n \r\n 0.5, -0.7, 0.0,\r\n 0.55, -0.75, 0.0,\r\n 0.5, -0.4, 0.0,\r\n \r\n 0.55, -0.35, 0.0,\r\n 0.55, -0.75, 0.0,\r\n 0.5, -0.4, 0.0,\r\n \r\n -0.5, -0.7, 0.0,\r\n -0.55, -0.75, 0.0,\r\n -0.2, -0.7, 0.0,\r\n \r\n -0.2, -0.75, 0.0,\r\n -0.55, -0.75, 0.0,\r\n -0.2, -0.7, 0.0,\r\n \r\n 0.5, -0.7, 0.0,\r\n 0.55, -0.75, 0.0,\r\n 0.2, -0.7, 0.0,\r\n \r\n 0.2, -0.75, 0.0,\r\n 0.55, -0.75, 0.0,\r\n 0.2, -0.7, 0.0,\r\n \r\n 0.2, -0.75, 0.0,\r\n -0.2, -0.75, 0.0,\r\n 0.2, -0.7, 0.0,\r\n \r\n 0.2, -0.7, 0.0,\r\n -0.2, -0.75, 0.0,\r\n -0.2, -0.7, 0.0,\r\n \r\n -0.55, -0.35, 0.0,\r\n -0.5 , -0.4 , 0.0,\r\n -0.2 , -0.4 , 0.0,\r\n \r\n -0.55, -0.35, 0.0,\r\n -0.25, -0.35, 0.0,\r\n -0.2 , -0.4 , 0.0,\r\n \r\n \r\n 0.55, -0.35, 0.0,\r\n 0.5 , -0.4 , 0.0,\r\n 0.2 , -0.4 , 0.0,\r\n \r\n 0.55, -0.35, 0.0,\r\n 0.25, -0.35, 0.0,\r\n 0.2 , -0.4 , 0.0,\r\n \r\n \r\n //sides\r\n -0.2 , 0.4 , 0.0,\r\n -0.25, 0.35, 0.0,\r\n -0.2 , -0.4 , 0.0,\r\n \r\n -0.25 , -0.35 , 0.0,\r\n -0.25, 0.35, 0.0,\r\n -0.2 , -0.4 , 0.0,\r\n \r\n 0.2 , 0.4 , 0.0,\r\n 0.25, 0.35, 0.0,\r\n 0.2 , -0.4 , 0.0,\r\n \r\n 0.25 , -0.35 , 0.0,\r\n 0.25, 0.35, 0.0,\r\n 0.2 , -0.4 , 0.0, \r\n ];\r\n \r\n //Animates the logo with translations in x and y direction\r\n for (i=0; i<triangleVertices.length;i++) {\r\n if (i% 3 == 1) {\r\n //console.log(\"BEFORE\", triangleVertices[i]);\r\n triangleVertices[i] = triangleVertices[i] + 0.25;\r\n //console.log(\"AFTER\", triangleVertices[i]);\r\n }\r\n if (i% 3 == 0) {\r\n //console.log(\"BEFORE\", triangleVertices[i]);\r\n triangleVertices[i] = triangleVertices[i] + 0.45;\r\n //console.log(\"AFTER\", triangleVertices[i]);\r\n }\r\n }\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.DYNAMIC_DRAW);\r\n vertexPositionBuffer.itemSize = 3;\r\n vertexPositionBuffer.numberOfItems = 138;\r\n}", "title": "" }, { "docid": "3924d919e72baf469cf40002141dbcc8", "score": "0.6070576", "text": "draw(location) {\r\n //first you need to bind the buffer you want to store data in\r\n gl.bindBuffer( gl.ARRAY_BUFFER, this.cBuffer );\r\n\r\n gl.vertexAttribPointer( this.vColor, 4, gl.FLOAT, false, 0, 0 );\r\n gl.enableVertexAttribArray( this.vColor );\r\n \r\n gl.bindBuffer( gl.ARRAY_BUFFER, this.vBuffer );\r\n \r\n gl.vertexAttribPointer( this.vPosition, 4, gl.FLOAT, false, 0, 0 );\r\n gl.enableVertexAttribArray( this.vPosition ); \r\n \r\n //Each matrix has its own unique matrix\r\n //Set the matrix for each shape.\r\n gl.uniformMatrix4fv(location, false, flatten(this.mat));\r\n \r\n gl.drawArrays( gl.TRIANGLES, 0, this.numVertices );\r\n }", "title": "" }, { "docid": "351af9b23fa111e20b9dd3de4dbfd328", "score": "0.6058493", "text": "function createCircle() {\n circleVertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, circleVertexPositionBuffer);\n \n // number of triangles for the subdivision\n var numTris2 = 50;\n\n vertices = [\n 0.0, 0.0, 0.0,\n 1.0, 0.0, 0.0\n ];\n \n var degPerTri = (2 * Math.PI) / numTris2;\n \n for(var i = 0; i < numTris2; i++) {\n var index = 2*3 + i*3\n var angle = degPerTri * (i+1);\n\n vertices[index] = Math.cos(angle); \n vertices[index+1] = Math.sin(angle); \n vertices[index+2] = 0; \n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n circleVertexPositionBuffer.itemSize = 3;\n circleVertexPositionBuffer.numItems = numTris2 + 2;\n \n\n}", "title": "" }, { "docid": "7d6f0cb1e00a31f2d80f85836ff4b719", "score": "0.60563296", "text": "function initBuffers() {\n\tIBuffers();\n\twireframeBuffers();\n\toutlineBuffers();\n\tanimationBuffers();\n}", "title": "" }, { "docid": "fc92917f0f49f0f257728360b42fc380", "score": "0.605291", "text": "save() {\n const gl = this.gl\n\n this.vertexCount = this.triangles.length\n\n if (!this.isEmpty()) {\n this.vertexBuffer = gl.createBuffer()\n this.uvBuffer = gl.createBuffer()\n this.colorUVBuffer = gl.createBuffer()\n this.triangleBuffer = gl.createBuffer()\n\n if (this.shading) {\n this.normalBuffer = gl.createBuffer()\n }\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer)\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vertices), gl.STATIC_DRAW)\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer)\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.uvs), gl.STATIC_DRAW)\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.colorUVBuffer)\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.colorUVs), gl.STATIC_DRAW)\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.triangleBuffer)\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.triangles), gl.STATIC_DRAW)\n\n if (this.shading) {\n gl.bindBuffer(gl.ARRAY_BUFFER, this.normalBuffer)\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.normals), gl.STATIC_DRAW)\n }\n }\n\n this.uvs = null\n this.colorUVs = null\n this.normals = null\n this.vertices = null\n this.triangles = null\n }", "title": "" }, { "docid": "b2989ed7b40943797e718cf4fe030961", "score": "0.6052755", "text": "function render () {\n index = (index + 1) % 2\n nextIndex = (index + 1) % 2\n \n gl.viewport(0, 0, glCanvas.clientWidth, glCanvas.clientHeight)\n gl.clearColor(0, 0, 0, 1)\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)\n\n gl.useProgram(p)\n gl.disable(gl.DEPTH_TEST)\n gl.bindBuffer(gl.ARRAY_BUFFER, b)\n gl.enableVertexAttribArray(locations.position)\n gl.vertexAttribPointer(locations.position, 2, gl.FLOAT, gl.FALSE, 0, 0)\n gl.drawArrays(gl.TRIANGLES, 0, 3)\n gl.bindBuffer(gl.ARRAY_BUFFER, null)\n gl.useProgram(null)\n\n // copy index buffer to PBO, read pixels to CPU from nextIndex PBO\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, pbos[index])\n gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, pixels)\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, pbos[nextIndex])\n gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, 0)\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null)\n\n requestAnimationFrame(render)\n}", "title": "" }, { "docid": "237fb98448eb134433c0e17c9b42d83e", "score": "0.604113", "text": "draw() {\n const {timeData} = this.props\n const canvas = this.canvas.current\n const height = canvas.height\n const width = canvas.width\n const context = canvas.getContext('2d')\n let x = 0\n //this is the part just doing a line that moves across\n const sliceWidth = width * 1.0 / this.props.bufferLength\n context.lineWidth = 2\n context.fillStyle = '#FF0000'\n context.strokeStyle = '#000000'\n context.clearRect(0, 0, width, height)\n\n //begins the line on bottom left\n context.beginPath()\n\n //a loop defining the position of a small segment of the wave for each point in the buffer at a certain height based on the data point value form the array, then moving the line across to the place where the next wave segment should be drawn\n for (let i = 0; i < this.props.bufferLength; i++) {\n let v = timeData[i] * 200\n let y = height / 2 + v\n\n if (i === 0) {\n context.moveTo(x, y)\n } else {\n context.lineTo(x, y)\n }\n\n x += sliceWidth\n }\n\n context.strokeStyle = '#99DD3C'\n context.lineTo(width, height / 2)\n context.stroke()\n }", "title": "" }, { "docid": "dfd6b40c6bb8efb5bd11d2da1f8a532c", "score": "0.60408187", "text": "rebuildBuffers()\n {\n console.log(\"rebuilding buffers\");\n this.buffers = this.initBuffers(this.gl);\n }", "title": "" }, { "docid": "c073a662067aa8f0be5209ec3b664262", "score": "0.6037715", "text": "constructor(vertex_array, face_array, gl, program){\n\n // >>>> New in Project 3 <<<<\n // Initialize gl buffers.\n this.gl = gl;\n this.pos_buffer = gl.createBuffer();\n this.color_buffer = gl.createBuffer();\n this.line_buffer = gl.createBuffer();\n this.line_color_buffer = gl.createBuffer();\n this.num_lines = 0;\n this.num_vertices = 0;\n this.vPosition = gl.getAttribLocation(program, \"vPosition\");\n this.vColor = gl.getAttribLocation(program, \"vColor\");\n // >>>> End New <<<<\n\n this.root_face = null;\n\n\n var verts = new Array(vertex_array.length);\n\n // Arrays to store edges to twin.\n var twins = new Array(vertex_array.length);\n\n // Convert vertex array to objects.\n for (var i = 0; i < vertex_array.length; i++){\n\n var new_v = new Vertex();\n new_v.pos = vertex_array[i][0];\n new_v.color = vertex_array[i][1];\n new_v.odd = false;\n new_v.flag = 0;\n verts[i] = new_v;\n twins[i] = [];\n\n }\n\n // Convert face array to objects.\n for (var i = 0; i < face_array.length; i++){\n var face = face_array[i];\n\n var new_face = new Face(null);\n var edges = [];\n for (var j = 0; j < 3; j++) {\n var new_edge = new Edge(verts[face[(j + 1) % 3]], verts[face[j]], null, null, new_face);\n twins[Math.min(face[j],face[(j+1)%3])].push([Math.max(face[j],face[(j+1)%3]), new_edge]);\n edges.push(new_edge);\n }\n for (var j = 0; j < 3; j++) {\n edges[j].next = edges[(j+1)%3];\n }\n\n new_face.edge = edges[0];\n\n this.root_face = new_face; // Root is last face created.\n }\n\n // Glue the faces together by setting twin edges.\n for (var i = 0; i < twins.length; i++){\n\n twins[i].sort(function(a,b){ return a[0] <= b[0];});\n\n var j = 0;\n\n while (j < twins[i].length){\n\n if ((j + 1) < twins[i].length){\n\n if (twins[i][j][0] == twins[i][j+1][0]) {\n twins[i][j][1].twin = twins[i][j+1][1];\n twins[i][j+1][1].twin = twins[i][j][1];\n j++;\n }\n }\n j++;\n\n }\n\n }\n\n // >>>> New in Project 3 <<<<\n // Fill the gl buffers now that construction is complete.\n this.fill_buffers();\n // >>>> End New <<<<\n\n }", "title": "" }, { "docid": "b08c509992539f9889995dc8409b4ce6", "score": "0.6037264", "text": "function setUpBuffers(){\n \"use strict\";\n rectangleObject.buffer = gl.createBuffer();\n var vertices = [\n -0.5, -0.5,\n 0.5, -0.5,\n 0.5, 0.5,\n -0.5, 0.5];\n gl.bindBuffer(gl.ARRAY_BUFFER, rectangleObject.buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n}", "title": "" }, { "docid": "48a74a1a136a156dd07ab442c67d00e2", "score": "0.6030597", "text": "InitBuffer () {\n\t\tgl.useProgram(program);\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesVBO);\n\n\t\t// TODO: Übergebe hier sowohl das Mesh, als auch die Normalen an das VBO\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.mesh.concat(this.normals)), gl.STATIC_DRAW);\n\n\t\t// Push the matrix to the buffer\n\t\tgl.uniformMatrix4fv(modelMatrixLoc, false, new Float32Array(this.modelMatrix));\t\t\n\t\tgl.uniformMatrix4fv(normalMatrixLoc, false, new Float32Array(this.normalMatrix)); // TODO: Übergebe hier die Normalenmatrix an den Shader\n\t}", "title": "" }, { "docid": "48a74a1a136a156dd07ab442c67d00e2", "score": "0.6030597", "text": "InitBuffer () {\n\t\tgl.useProgram(program);\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesVBO);\n\n\t\t// TODO: Übergebe hier sowohl das Mesh, als auch die Normalen an das VBO\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.mesh.concat(this.normals)), gl.STATIC_DRAW);\n\n\t\t// Push the matrix to the buffer\n\t\tgl.uniformMatrix4fv(modelMatrixLoc, false, new Float32Array(this.modelMatrix));\t\t\n\t\tgl.uniformMatrix4fv(normalMatrixLoc, false, new Float32Array(this.normalMatrix)); // TODO: Übergebe hier die Normalenmatrix an den Shader\n\t}", "title": "" }, { "docid": "55bce2e478b993910cf832e052729022", "score": "0.6027261", "text": "constructor (num_blades) {\n super (\"position\", \"normal\", \"texture_coord\");\n // A for loop to automatically generate the triangles:\n for (let i = 0; i < num_blades; i++) {\n // Rotate around a few degrees in the XZ plane to place each new point:\n const spin = Mat4.rotation (i * 2 * Math.PI / num_blades, 0, 1, 0);\n // Apply that XZ rotation matrix to point (1,0,0) of the base triangle.\n const newPoint = spin.times (vec4 (1, 0, 0, 1)).to3 ();\n const triangle = [newPoint, // Store that XZ position as point 1.\n newPoint.plus ([0, 1, 0]), // Store it again but with higher y coord as point 2.\n vec3 (0, 0, 0)]; // All triangles touch this location -- point 3.\n\n this.arrays.position.push (...triangle);\n // Rotate our base triangle's normal (0,0,1) to get the new one. Careful! Normal vectors are not\n // points; their perpendicularity constraint gives them a mathematical quirk that when applying\n // matrices you have to apply the transposed inverse of that matrix instead. But right now we've\n // got a pure rotation matrix, where the inverse and transpose operations cancel out, so it's ok.\n var newNormal = spin.times (vec4 (0, 0, 1, 0)).to3 ();\n // Propagate the same normal to all three vertices:\n this.arrays.normal.push (newNormal, newNormal, newNormal);\n this.arrays.texture_coord.push (...Vector.cast ([0, 0], [0, 1], [1, 0]));\n // Procedurally connect the 3 new vertices into triangles:\n this.indices.push (3 * i, 3 * i + 1, 3 * i + 2);\n }\n }", "title": "" }, { "docid": "944340a8168bbd3e1b32de7d41775688", "score": "0.60198593", "text": "function setupBuffers() {\n vertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\n \n // An array to hold all the vertices of the badge\n // The vertices for the orange part of the badge are set up with sin() of a global variable\n // such that the coordinate of those vertices will change according to the global variable \"rotAngle\"\n // when setupBuffers() is called\n // note: the global variable will change over each frame such that the orange part will also perform\n // a non-affine transformation in the animation.\n var triangleVertices = [\n -0.90, 0.95, 0.0,\n -0.90, 0.65, 0.0,\n -0.70, 0.65, 0.0,\n \n -0.70, 0.65, 0.0,\n -0.35, 0.65, 0.0, \n -0.90, 0.95, 0.0,\n \n -0.90, 0.95, 0.0,\n -0.35, 0.65, 0.0,\n 0.35, 0.65, 0.0,\n \n -0.90, 0.95, 0.0,\n 0.35, 0.65, 0.0,\n 0.70, 0.65, 0.0,\n \n -0.90, 0.95, 0.0,\n 0.70, 0.65, 0.0,\n 0.90, 0.65, 0.0,\n \n -0.90, 0.95, 0.0,\n 0.90, 0.65, 0.0,\n 0.90, 0.95, 0.0,\n //------------------------------\n -0.70, 0.65, 0.0,\n -0.70, -0.30, 0.0,\n -0.35, 0.65, 0.0,\n \n -0.35, 0.65, 0.0,\n -0.70, -0.30, 0.0,\n -0.35, 0.40, 0.0,\n \n -0.35, 0.40, 0.0,\n -0.70, -0.30, 0.0,\n -0.35, -0.05, 0.0,\n \n -0.35, -0.30, 0.0,\n -0.35, -0.05, 0.0,\n -0.70, -0.30, 0.0,\n \n -0.35, 0.40, 0.0,\n -0.35, -0.05, 0.0,\n -0.20, 0.40, 0.0,\n \n -0.35, -0.05, 0.0,\n -0.20, -0.05, 0.0,\n -0.20, 0.40, 0.0,\n \n 0.70, -0.30, 0.0,\n 0.70, 0.65, 0.0,\n 0.35, 0.65, 0.0,\n \n 0.35, 0.65, 0.0,\n 0.35, 0.40, 0.0,\n 0.70, -0.30, 0.0,\n \n 0.35, 0.40, 0.0,\n 0.35, -0.05, 0.0,\n 0.70, -0.30, 0.0,\n \n 0.35, -0.30, 0.0,\n 0.70, -0.30, 0.0,\n 0.35, -0.05, 0.0,\n\n 0.35, -0.05, 0.0,\n 0.35, 0.40, 0.0,\n 0.20, 0.40, 0.0,\n \n 0.35, -0.05, 0.0,\n 0.20, 0.40, 0.0,\n 0.20, -0.05, 0.0,\n //-----------------------------\n -0.70+0.05*Math.sin(0.2*rotAngle), -0.35, 0.0,\n -0.58+0.05*Math.sin(0.2*rotAngle), -0.57, 0.0,\n -0.58+0.05*Math.sin(0.2*rotAngle), -0.35, 0.0,\n -0.58+0.05*Math.sin(0.2*rotAngle), -0.57, 0.0,\n -0.70+0.05*Math.sin(0.2*rotAngle), -0.35, 0.0,\n -0.70+0.05*Math.sin(0.2*rotAngle), -0.50, 0.0,\n \n -0.35+0.05*Math.sin(0.2*rotAngle+0.5), -0.35, 0.0,\n -0.47+0.05*Math.sin(0.2*rotAngle+0.5), -0.35, 0.0,\n -0.47+0.05*Math.sin(0.2*rotAngle+0.5), -0.63, 0.0,\n -0.35+0.05*Math.sin(0.2*rotAngle+0.5), -0.35, 0.0,\n -0.47+0.05*Math.sin(0.2*rotAngle+0.5), -0.63, 0.0,\n -0.35+0.05*Math.sin(0.2*rotAngle+0.5), -0.70, 0.0,\n \n -0.08+0.05*Math.sin(0.2*rotAngle+1.0), -0.35, 0.0,\n -0.22+0.05*Math.sin(0.2*rotAngle+1.0), -0.35, 0.0,\n -0.22+0.05*Math.sin(0.2*rotAngle+1.0), -0.75, 0.0,\n -0.08+0.05*Math.sin(0.2*rotAngle+1.0), -0.35, 0.0,\n -0.22+0.05*Math.sin(0.2*rotAngle+1.0), -0.75, 0.0,\n -0.08+0.05*Math.sin(0.2*rotAngle+1.0), -0.82, 0.0,\n \n 0.70+0.05*Math.sin(0.2*rotAngle+1.5), -0.35, 0.0,\n 0.58+0.05*Math.sin(0.2*rotAngle+1.5), -0.35, 0.0,\n 0.58+0.05*Math.sin(0.2*rotAngle+1.5), -0.57, 0.0,\n 0.70+0.05*Math.sin(0.2*rotAngle+1.5), -0.35, 0.0,\n 0.58+0.05*Math.sin(0.2*rotAngle+1.5), -0.57, 0.0,\n 0.70+0.05*Math.sin(0.2*rotAngle+1.5), -0.50, 0.0,\n \n 0.47+0.05*Math.sin(0.2*rotAngle+2.0), -0.35, 0.0,\n 0.35+0.05*Math.sin(0.2*rotAngle+2.0), -0.35, 0.0,\n 0.47+0.05*Math.sin(0.2*rotAngle+2.0), -0.63, 0.0,\n 0.47+0.05*Math.sin(0.2*rotAngle+2.0), -0.63, 0.0,\n 0.35+0.05*Math.sin(0.2*rotAngle+2.0), -0.35, 0.0,\n 0.35+0.05*Math.sin(0.2*rotAngle+2.0), -0.70, 0.0,\n \n 0.22+0.05*Math.sin(0.2*rotAngle+2.5), -0.35, 0.0,\n 0.08+0.05*Math.sin(0.2*rotAngle+2.5), -0.35, 0.0,\n 0.22+0.05*Math.sin(0.2*rotAngle+2.5), -0.75, 0.0,\n 0.22+0.05*Math.sin(0.2*rotAngle+2.5), -0.75, 0.0,\n 0.08+0.05*Math.sin(0.2*rotAngle+2.5), -0.35, 0.0,\n 0.08+0.05*Math.sin(0.2*rotAngle+2.5), -0.82, 0.0,\n \n \n ];\n \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.DYNAMIC_DRAW);\n vertexPositionBuffer.itemSize = 3;\n vertexPositionBuffer.numberOfItems = 90;\n \n vertexColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\n \n // An array to store RGBA information of color for each vertex\n // (0.075, 0.16, 0.3, 1.0) for navy blue\n // (0.9, 0.3, 0.2, 1.0) for orange\n var colors = [\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n 0.075, 0.16, 0.3, 1.0,\n \n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n \n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n \n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n \n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n \n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n \n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0,\n 0.9, 0.3, 0.2, 1.0\n ];\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n vertexColorBuffer.itemSize = 4;\n vertexColorBuffer.numItems = 90; \n}", "title": "" }, { "docid": "51f02233e20a395f77c3facb25e958a7", "score": "0.6019595", "text": "initBuffers() {\n this.vertices = [];\n this.indices = [];\n this.normals = [];\n this.texCoords = [];\n\n var trueStacks = 2 * this.stacks;\n var phi = 0;\n var deltaPhi = 2 * Math.PI / this.slices;\n var deltaTheta = Math.PI / trueStacks;\n\n var sCoord = 0;\n var tCoord = 1;\n var deltaS = 1 / this.slices;\n var deltaT = 1 /trueStacks;\n\n\n // Iterate through all the points on the same line that goes from pole to pole\n for (var i = 0; i <= this.slices; i++) {\n\n var cosPhi = Math.cos(phi);\n var sinPhi = Math.sin(phi);\n var theta = -Math.PI/2;\n tCoord = 1;\n \n // Iterate through all the points on the same edge\n for (var j = 0; j <= trueStacks; j++) {\n\n var cosTheta = Math.cos(theta);\n var sinTheta = Math.sin(theta);\n\n var vertex = [this.radius * cosTheta * cosPhi\n , this.radius * cosTheta * sinPhi\n , this.radius * sinTheta];\n\n // Add the apropriate vertex normals and texture coordinates\n // The normal to a point on the sphere can be the vector that links the\n // center of the sphere with that point (normalized). Since the center of\n // the sphere is (0,0,0) the normal is equal to the vertex position (normalized)\n this.vertices.push(...vertex);\n this.normals.push(...normalizeVector(vertex));\n this.texCoords.push(sCoord, tCoord);\n\n theta += deltaTheta;\n tCoord -= deltaT;\n\n /* On the last iteration of this cycle we only need to add the vertices, \n the normals and the texture coordinates to the corresponding arrays because \n we always push the indeces for the triangles that make up the square above \n the point*/\n if (j == trueStacks)\n continue;\n\n /* If we are iterating through the points of the last edge we only need to add the vertices, \n the normals and the texture coordinates to the corresponding arrays because these points \n overlap with the first ones */\n if (i == this.slices)\n continue;\n\n // This is the index of the current vertix in the vertices array\n var index = i * (trueStacks + 1) + j;\n this.indices.push(index, index + trueStacks + 1,index + trueStacks + 2);\n this.indices.push(index,index + trueStacks + 2,index + 1);\n\n }\n\n phi += deltaPhi;\n sCoord += deltaS;\n }\n\n this.defaultTexCoords = [...this.texCoords];\n\n this.primitiveType = this.scene.gl.TRIANGLES;\n this.initGLBuffers();\n }", "title": "" }, { "docid": "5baca5bb1800c88772f6fe3e718bd6bf", "score": "0.60153085", "text": "function setUpBuffers() {\n \"use strict\";\n rectangleObject.buffer = gl.createBuffer();\n var vertices = [-0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, 0.5];\n gl.bindBuffer(gl.ARRAY_BUFFER, rectangleObject.buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n}", "title": "" }, { "docid": "7d041326ad91a9ef9f8eb3aec79ddc9e", "score": "0.60134655", "text": "printBuffers()\n {\n \n for(var i=0;i<this.numVertices;i++)\n {\n console.log(\"v \", this.vBuffer[i*3], \" \", \n this.vBuffer[i*3 + 1], \" \",\n this.vBuffer[i*3 + 2], \" \");\n \n }\n \n for(var i=0;i<this.numFaces;i++)\n {\n console.log(\"f \", this.fBuffer[i*3], \" \", \n this.fBuffer[i*3 + 1], \" \",\n this.fBuffer[i*3 + 2], \" \");\n \n }\n \n }", "title": "" }, { "docid": "f3f13a15c4c6786a621ffadebfdcddf0", "score": "0.6009388", "text": "function drawBufferPolygon() {\n // When pause() is called on the watch handle, the callback represented by the\n // watch is no longer invoked, but is still available for later use\n // this watch handle will be resumed when user searches for a new location\n pausableWatchHandle.pause();\n\n // Initial location for the center, edge and polylines on the view\n const viewCenter = view.center.clone();\n const centerScreenPoint = view.toScreen(viewCenter);\n const centerPoint = view.toMap({\n x: centerScreenPoint.x,\n y: centerScreenPoint.y\n });\n const edgePoint = view.toMap({\n x: centerScreenPoint.x + 15,\n y: centerScreenPoint.y - 49\n });\n\n // Store updated vertices\n const vertices = [\n [centerPoint.x, centerPoint.y],\n [edgePoint.x, edgePoint.y]\n ];\n\n // Create center, edge, polyline and buffer graphics for the first time\n if (!centerGraphic) {\n const polyline = new Polyline({\n paths: vertices,\n spatialReference: view.spatialReference\n });\n\n // get the length of the initial polyline and create buffer\n const length = geometryEngine.geodesicLength(polyline, unit);\n const buffer = geometryEngine.geodesicBuffer(centerPoint, length, unit);\n\n // Create the graphics representing the line and buffer\n const pointSymbol = {\n type: \"simple-marker\",\n style: \"circle\",\n size: 10,\n color: \"#009AF2\"\n };\n centerGraphic = new Graphic({\n geometry: centerPoint,\n symbol: pointSymbol,\n attributes: {\n center: \"center\"\n }\n });\n\n edgeGraphic = new Graphic({\n geometry: edgePoint,\n symbol: pointSymbol,\n attributes: {\n edge: \"edge\"\n }\n });\n\n polylineGraphic = new Graphic({\n geometry: polyline,\n symbol: {\n type: \"simple-line\",\n color: [254, 254, 254, 1],\n width: 2.5\n }\n });\n\n bufferGraphic = new Graphic({\n geometry: buffer,\n symbol: {\n type: \"simple-fill\",\n color: [150, 150, 150],\n outline: {\n color: \"#FFEB00\",\n width: 2\n }\n }\n });\n labelGraphic = labelLength(edgePoint, length);\n\n // Add graphics to layer\n graphicsLayer.addMany([centerGraphic, edgeGraphic, polylineGraphic, labelGraphic]);\n // once center and edge point graphics are added to the layer,\n // call sketch's update method pass in the graphics so that users\n // can just drag these graphics to adjust the buffer\n setTimeout(function () {\n sketchViewModel.update([edgeGraphic, centerGraphic], {\n tool: \"move\"\n });\n }, 1000);\n\n bufferLayer.addMany([bufferGraphic]);\n }\n // Move the center and edge graphics to the new location returned from search\n else {\n centerGraphic.geometry = centerPoint;\n edgeGraphic.geometry = edgePoint;\n }\n\n // Query features that intersect the buffer\n calculateBuffer(vertices);\n }", "title": "" } ]
6755489be1623ca86777438ffa2b305b
function to get id >i
[ { "docid": "7c938755a1361f2e5bdf028a962ddbe2", "score": "0.0", "text": "function child (e){\r\n \r\n treenodid = e.getAttribute('value');\r\n \r\n}", "title": "" } ]
[ { "docid": "9b5e732ad595f98ae06783dd8fb127b4", "score": "0.76567584", "text": "function id(i) {\n return document.getElementById(i);\n }", "title": "" }, { "docid": "8043263cb4679c52f60187c704caf7cf", "score": "0.7506556", "text": "function retornaId( id ){\r\n\tvar cont = id . split(\"-\");\t\r\n\treturn cont[1];\t\r\n}", "title": "" }, { "docid": "e7487fc2bf2a23721697a006dad54b32", "score": "0.7458525", "text": "function getId(){\n var id=0;\n for(var i=0;i<data.length;i++){\n id=Math.max(id,data[i].id());\n }\n return id+1;\n }", "title": "" }, { "docid": "3bf82aef4d41d506f5ee9637df25c7f5", "score": "0.7333202", "text": "function getId() {\n idRoot++;\n return idRoot;\n // return \"id\"+idRoot;//\n }", "title": "" }, { "docid": "d2734170d595ed1b430331ab316e8ca2", "score": "0.72129744", "text": "function getId() {\n return ++lastId;\n}", "title": "" }, { "docid": "8f4a25268ba877a0646211228064aa3c", "score": "0.72074485", "text": "function id(){}", "title": "" }, { "docid": "058806052b89cde7523e6b1263781c9b", "score": "0.7179045", "text": "function getId() {\n return ++lastId;\n }", "title": "" }, { "docid": "058806052b89cde7523e6b1263781c9b", "score": "0.7179045", "text": "function getId() {\n return ++lastId;\n }", "title": "" }, { "docid": "058806052b89cde7523e6b1263781c9b", "score": "0.7179045", "text": "function getId() {\n return ++lastId;\n }", "title": "" }, { "docid": "058806052b89cde7523e6b1263781c9b", "score": "0.7179045", "text": "function getId() {\n return ++lastId;\n }", "title": "" }, { "docid": "058806052b89cde7523e6b1263781c9b", "score": "0.7179045", "text": "function getId() {\n return ++lastId;\n }", "title": "" }, { "docid": "058806052b89cde7523e6b1263781c9b", "score": "0.7179045", "text": "function getId() {\n return ++lastId;\n }", "title": "" }, { "docid": "db7bd031f812920ac8fadbbaacab68a6", "score": "0.71301806", "text": "function _id(z) {\n\t if (!z) {\n\t\tz = document.getElementById(x);\n\t }\n\t else {\n\t\tvar idTags = [];\n\t\tvar tags = document.getElementsByTagName(\"*\");\n\t\tfor (var i = 0; i < tags.length; i++) {\n\t\t var id = _attribute(tags[i], \"id\", \"get\");\n\t\t if (x == id) {\n\t\t\tidTags.push(tags[i]);\n\t\t };\n\t\t};\n\t\t\n\t\tif (typeof(z) == \"number\") {\n\t\t z = idTags[z-1];\n\t\t}\n\t\telse {\n\t\t z = idTags; \n\t\t};\n\t };\n\t \n\t return z; \n }", "title": "" }, { "docid": "14b538a590173b4aa0fc2e11db0261eb", "score": "0.7046215", "text": "id(callback,whr=false) {\n\t\tthis.get(callback,whr, \"id\");\n\t}", "title": "" }, { "docid": "9832aa8c96273b7ffb60728c46f84e44", "score": "0.70219254", "text": "function id (x) { return x }", "title": "" }, { "docid": "af4713fa00e8adf8a9a10526c8df3cf5", "score": "0.6995719", "text": "function getID(arg)\r\n{\r\n var counter = 0;\r\n while( items[counter].name != arg)\r\n {\r\n counter++;\r\n }\r\n\r\n return items[counter].id;\r\n}", "title": "" }, { "docid": "47c333262d84c896f807ea0fdc424940", "score": "0.69784725", "text": "function GetID() : int {\n return id;\n}", "title": "" }, { "docid": "86dca5e04fbfc97296044eaba9cd8bae", "score": "0.69546956", "text": "function getIid() {\r\n return iid;\r\n}", "title": "" }, { "docid": "86dca5e04fbfc97296044eaba9cd8bae", "score": "0.69546956", "text": "function getIid() {\r\n return iid;\r\n}", "title": "" }, { "docid": "14be181dd1ca4ee3cc0b6793514d7cb3", "score": "0.6948466", "text": "getId()\n {\n return(this.id);\n }", "title": "" }, { "docid": "1cf2b36a345736fe59512307301071cd", "score": "0.69243693", "text": "function getIid() {\n return iid;\n}", "title": "" }, { "docid": "4fbaf212b7616ff0b5e433369329e107", "score": "0.69241107", "text": "getId() { return this.id_; }", "title": "" }, { "docid": "a52a3f658de7f27df0d98d68729ac963", "score": "0.69167674", "text": "function getID(item) {\n\treturn item.id;\n}", "title": "" }, { "docid": "d7a66fcbc6dd4fd974a5394c82679cfa", "score": "0.6911774", "text": "function getId(node) {\n\tid = $(node).attr(\"id\").substring(2);\n\treturn parseInt(id);\n}", "title": "" }, { "docid": "338b1582cc5e224d3224587ba354cd79", "score": "0.6836792", "text": "function getId(item) {\n return item.id;\n }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6834055", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6832861", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6832861", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6832861", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6832861", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "d5584cfd0e643daaa14e43c73083ab65", "score": "0.6832861", "text": "getId() {\n\t \treturn this.id;\n\t }", "title": "" }, { "docid": "f8f42de23d36e009edba3c0d2dd6ba89", "score": "0.68243873", "text": "function getId(idTarjeta){\n return parseInt( $('#'+idTarjeta).attr(\"id\").replace(\"m\",\"\") );\n}", "title": "" }, { "docid": "471344ca1e5e379ce9f5ba56e4d7da58", "score": "0.68184614", "text": "getId(){\n console.log(id);\n }", "title": "" }, { "docid": "61c9d26a349427e81d752eb17e398dbc", "score": "0.6798641", "text": "getId()\n\t{\n\t\treturn this.id;\n\t}", "title": "" }, { "docid": "b7e492bc7381b43fd7346b2676edc254", "score": "0.6798183", "text": "function getIid() {\r\n return iid;\r\n }", "title": "" }, { "docid": "b7e492bc7381b43fd7346b2676edc254", "score": "0.6798183", "text": "function getIid() {\r\n return iid;\r\n }", "title": "" }, { "docid": "b7e492bc7381b43fd7346b2676edc254", "score": "0.6798183", "text": "function getIid() {\r\n return iid;\r\n }", "title": "" }, { "docid": "b0a4138be83584969ebd8cfb3ade1ea7", "score": "0.6755262", "text": "function next_id(){\n return ++id_counter;\n }", "title": "" }, { "docid": "cf855105c6c1ba903b8a74667899206d", "score": "0.67353415", "text": "function getItemId(ui) {\n\tvar id=$(ui.draggable).attr(\"id\");\n\treturn parseInt(id.substr(4,5));\n}", "title": "" }, { "docid": "fbe00fc16800b0808c4ebab5e05ddce2", "score": "0.67215955", "text": "function id(x) { return x[0]; }", "title": "" }, { "docid": "09dfd228f7d7566ae3334a90505db556", "score": "0.672085", "text": "function getId() {\n idRoot++;\n return idRoot;\n\n }", "title": "" }, { "docid": "6b4857dc7c78513b5b26691bbb550710", "score": "0.67201465", "text": "function getId(x) {\n if (typeof x.identifier === \"number\") {\n return Math.abs(x.identifier);\n } else {\n return x.identifier;\n }\n }", "title": "" }, { "docid": "dc4d642fd48f57f35ecfa3a04b17fca1", "score": "0.67042893", "text": "function getId(text) {\n return getIdText(text)\n}", "title": "" }, { "docid": "c7740ff0619115110682250bbe5c60ed", "score": "0.66952646", "text": "function getIndice(liens){\n /** mes variables **/\n let id = null;\n\n /** recherche de l'id **/\n for(let i = 0;i<liens.length;i++){\n let ref = liens.item(i).getAttribute('href'); // recuperation du lien href de m syntaxe que celle de win.loc.pathname\n\n if(window.location.pathname == ref){\n id = i; // Il s'agit de l'indice de la page actuelle et de son div ;\n }\n }\n return id;\n}", "title": "" }, { "docid": "06b5067340de4480b56d99ba9981d7eb", "score": "0.6678639", "text": "getID(){\n\t\treturn this.id;\n\t}", "title": "" }, { "docid": "1fcf9da469442add55102cfca81d747c", "score": "0.66755384", "text": "static getID(element)\n {\n return element.getAttribute(\"id\") || IOElement.setID(element);\n }", "title": "" }, { "docid": "ad11f27e4c7d8f738b5b6b59e0890999", "score": "0.6667233", "text": "function getId() {\n idRoot++;\n return idRoot;\n\n }", "title": "" }, { "docid": "83ffd4f09681c7774849d521711b30b1", "score": "0.6658293", "text": "function getID() {\n return this.id || this._id;\n}", "title": "" }, { "docid": "e59645e7d30bc179e655437c7ac31bbd", "score": "0.6655332", "text": "function uniqueId() {\n return id++;\n}", "title": "" }, { "docid": "7c8751266e2f3693006323a44e214685", "score": "0.6637372", "text": "id() {\n const item = this.data;\n const onlyString = (x) => (typeof x == \"string\" ? x : null);\n const id = [item.guid, item.id, item.link]\n .map(onlyString)\n .filter((x) => x)[0];\n\n if (!id) throw new Error(\"can't find message id in the data\");\n return id;\n }", "title": "" }, { "docid": "34fc3533139ac6581ed8b9c77bed26e1", "score": "0.6628831", "text": "get id() {\n if (this._id === undefined) {\n this._id = this.onComputeId();\n }\n return this._id;\n }", "title": "" }, { "docid": "0160ff68989ef2d232af353e4ac34361", "score": "0.66043365", "text": "function id(x) { return x; }", "title": "" }, { "docid": "5e560d26746c4955a0f855a410427150", "score": "0.65828156", "text": "function getPokeId(i){\n var id_poke= pokemons[i].id;//para buscar only\n return id_poke;\n}", "title": "" }, { "docid": "3230a337ad3ae8046fe58bcc3c2c7fc1", "score": "0.6577387", "text": "function getId() {\n var id = getUrlVars()[\"oid\"];\n return id;\n}", "title": "" }, { "docid": "8858b2a13eef45b750fb64586d831953", "score": "0.6570243", "text": "findId(){\n let categoriesLength=this.state.categories.length;\n let id=categoriesLength+1;\n return id\n }", "title": "" }, { "docid": "9512103a8849ea3fd35e7ff45e396e9c", "score": "0.6567417", "text": "function generateId(){\n return idCounter++ ;\n}", "title": "" }, { "docid": "f773f8fed7742df7294dd74b8a8a54fd", "score": "0.6564245", "text": "function id(x){\n\t\tvar elementId = document.getElementById(x);\n\t\treturn elementId;\n\t}", "title": "" }, { "docid": "756ef690b0525fcabd636fd5beb4f266", "score": "0.65545493", "text": "function NextID() {\n return ++iid;\n}", "title": "" }, { "docid": "48ed3039360f87e32014e25e16e3b66b", "score": "0.65294653", "text": "function getLastId() {\n let lastId = 0\n if (livros.length > 0) {\n lastId = livros[livros.length-1].id\n } \n return lastId\n }", "title": "" }, { "docid": "3b45e30dd6a78e8b5b1eb5089183f426", "score": "0.65253", "text": "function getContactId() {\n for (var i = 0; i < singlePerson.length; i++) {\n singlePerson[i].addEventListener('click', function() {\n var clickedName = this.textContent;\n for (var i = 0; i < data.length; i++) {\n var dbNames = data[i].first_name + ' ' + data[i].last_name;\n if (clickedName == dbNames) {\n id = data[i].id;\n }\n }\n });\n }\n return id;\n }", "title": "" }, { "docid": "eaad715ae8cecbc5929173f09a460be1", "score": "0.6521846", "text": "function id(elem){\n\treturn document.getElementById(elem);\n}", "title": "" }, { "docid": "d26fb82dd2d84400a5ca788c608f572d", "score": "0.6520994", "text": "function getId(record, index) {\n return oid(record) || index;\n }", "title": "" }, { "docid": "ef25cf08e3aaf1dd876d8560b1386c86", "score": "0.65029144", "text": "function GetId(element) {\n var id = \"#\" + element.attr(\"id\");\n var param = id.substring(id.indexOf(\"_\"));\n return param;\n}", "title": "" }, { "docid": "bad777974543b4fbe385fb43b3423e11", "score": "0.64934266", "text": "getId() {\n\t\treturn this.node.id;\n\t}", "title": "" }, { "docid": "7ceca1989a0ee37da5c054c74b708f86", "score": "0.6491435", "text": "function getRDid(){\n var rdID = rd.obj.children[0].id;\n rdID = rdID.split(\"-\");\n var theID = rdID[1]; \n return theID;\n }", "title": "" }, { "docid": "291a0f19c1dcf6dce1e234d6e13d5fbb", "score": "0.64848834", "text": "function getID(id){\n return document.getElementById(id);\n }", "title": "" }, { "docid": "4a56e6b269dde15f6518439dbd5f0833", "score": "0.64847183", "text": "function spaceIDOf(element) {\n return ($j(element).attr('id').match(/\\d+/) || [])[0];\n }", "title": "" }, { "docid": "fdb3e36f6ce2831d567820e7a024d0e3", "score": "0.6477137", "text": "GetId() { return this.id; }", "title": "" }, { "docid": "d02ed183aa6bd736ea755febfc519e7d", "score": "0.64738476", "text": "function getID() {\n var id = [];\n var table = document.getElementById(\"tableresults\");\n for (var i = 1, row; row = table.rows[i]; i++) {\n id.push(row.cells[0].innerHTML);\n }\n return id;\n}", "title": "" }, { "docid": "27405878a8e11c4e5929d0535ab5a007", "score": "0.6470198", "text": "function getUserID(item) { // pass the element being clicked as a parameter\n let id = item.id; // get the link id attribute value\n let getID = id.split(\"_\"); // used to split the id into an array using the _ as a separator\n return parseInt(getID[1]); // id will be given as string so immediately convert to integer\n}", "title": "" }, { "docid": "30ce71d63cc8e61b043e6d02828f821a", "score": "0.6462209", "text": "function idIndex(a, id) {\n for (var i = 0; i < a.length; i++) {\n if (a[i].id == id) return i;\n }\n return null;\n }", "title": "" }, { "docid": "ad2799b4c744e05b995779e7fc3384fe", "score": "0.6459467", "text": "function getId(event) {\n\treturn event.target.id;\n}", "title": "" }, { "docid": "81f71e6f8a1d68510abf30dbe04b9b6d", "score": "0.6455689", "text": "getNewID(){\n\t\tlet arr=this.state.order;\n\t\tlet max=0;\n\t\tfor(let i=0;i<arr.length;i++){\n\t\t\tlet num=parseInt(arr[i].id.substring(2))\n\t\t\tif(max<num){\n\t\t\t\tmax=num\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"Returning New ID:\", max+1);\n\t\treturn max+1\n\t}", "title": "" }, { "docid": "d8534ab29dc4dfd84c225a6e3b4823ae", "score": "0.64476913", "text": "function getDataId( e ) {\n return e.data( \"id@\" );\n }", "title": "" }, { "docid": "6a1ac87c9a2dfaf2ea34f57de18604c8", "score": "0.6444758", "text": "_id() {\n\t\treturn this[this.constructor._pk()];\n\t}", "title": "" }, { "docid": "ab294559ca10613b7878957db04e326b", "score": "0.64407706", "text": "getId() {\n return this.wrapped.id;\n }", "title": "" }, { "docid": "864df75595097e140f4242d384969c00", "score": "0.6431503", "text": "get id() {\n return this.i.as;\n }", "title": "" }, { "docid": "c9e7888067489d011a70027a5fc0848d", "score": "0.6416608", "text": "get id() {\n return this.getStringAttribute('id');\n }", "title": "" }, { "docid": "c9e7888067489d011a70027a5fc0848d", "score": "0.6416608", "text": "get id() {\n return this.getStringAttribute('id');\n }", "title": "" }, { "docid": "c9e7888067489d011a70027a5fc0848d", "score": "0.6416608", "text": "get id() {\n return this.getStringAttribute('id');\n }", "title": "" }, { "docid": "c9e7888067489d011a70027a5fc0848d", "score": "0.6416608", "text": "get id() {\n return this.getStringAttribute('id');\n }", "title": "" }, { "docid": "c9e7888067489d011a70027a5fc0848d", "score": "0.6416608", "text": "get id() {\n return this.getStringAttribute('id');\n }", "title": "" }, { "docid": "c9e7888067489d011a70027a5fc0848d", "score": "0.6416608", "text": "get id() {\n return this.getStringAttribute('id');\n }", "title": "" }, { "docid": "c9e7888067489d011a70027a5fc0848d", "score": "0.6416608", "text": "get id() {\n return this.getStringAttribute('id');\n }", "title": "" }, { "docid": "c9e7888067489d011a70027a5fc0848d", "score": "0.6416608", "text": "get id() {\n return this.getStringAttribute('id');\n }", "title": "" }, { "docid": "c9e7888067489d011a70027a5fc0848d", "score": "0.6416608", "text": "get id() {\n return this.getStringAttribute('id');\n }", "title": "" } ]
ad5b47c93f0b053a65211c54780df3d9
remove listeners when component no longer used
[ { "docid": "e4f56a9a65c8e0933a1cbdb7cd114c4a", "score": "0.0", "text": "componentWillUnmount(){\n\t\tappStore.removeListener('DATA_LOADED', this._dataLoaded);\n\t\tappStore.removeListener('DATA_FINISHED', this._onDataFinished);\n\t}", "title": "" } ]
[ { "docid": "2a1f4aa94c8c55c80c3950e11963b48b", "score": "0.7561193", "text": "unbindEvents() {\n this.listener.destroy();\n }", "title": "" }, { "docid": "056cb52fcd2c388f73a5bfd58f86a488", "score": "0.7558793", "text": "cleanupListeners () {\n if (this.state.action) {\n this.state.action.removeListener('value changed', this.onValueChanged);\n }\n }", "title": "" }, { "docid": "d6949f702e00632cbd1850609f3376a5", "score": "0.7469809", "text": "removeListeners() {\n this.unlistenEvents.forEach((unlisten) => {\n unlisten();\n });\n\n this.unlistenEvents = [];\n }", "title": "" }, { "docid": "fc316d2ec836d47832ee51bdee27c8d3", "score": "0.7458803", "text": "_removeEventListeners() {\n\n this.inputEl.removeEventListener('focus', this._onFocusBound);\n this.inputEl.removeEventListener('blur', this._onBlurBound);\n this.inputEl.removeEventListener('input', this._onInputBound);\n\n if (this.passwordToggleEl) {\n this.passwordToggleEl.removeEventListener('click', this._onTogglePasswordViewHideBound);\n }\n\n if (this.clearEl) {\n this.clearEl.removeEventListener('click', this._onClearClickBound);\n }\n }", "title": "" }, { "docid": "f207eba71449a09faad58bd410c87184", "score": "0.744606", "text": "dispose() {\n // Perfect place to remove eventlisteners etc\n }", "title": "" }, { "docid": "b33931bf1a00f5e2c148c941e31adbcb", "score": "0.7413827", "text": "_unlisten() {\n const disposalListener = this._disposalListener;\n if (disposalListener) {\n this._disposalListener = undefined;\n disposalListener.dispose();\n }\n }", "title": "" }, { "docid": "d2671b4379d4d4b182dd8ba8706bd9ce", "score": "0.7399566", "text": "removeEventListeners() {\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\n \n if (this.gyroscope) {\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\n }\n \n if (this.glare || this.fullPageListening) {\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\n }\n }", "title": "" }, { "docid": "0c28a6e90d426fa5e7081d3f3d95c604", "score": "0.7392581", "text": "removeEventListeners() {\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\n\n if (this.gyroscope) {\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\n }\n\n if (this.glare || this.fullPageListening) {\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\n }\n }", "title": "" }, { "docid": "fe773ca75508c755cf2df5af1a8fc8b3", "score": "0.73913544", "text": "destroy() {\n this.listeners = {};\n }", "title": "" }, { "docid": "b7779728be8c46938e5f48df585becd4", "score": "0.73585045", "text": "_removeListeners() {\n // Do nothing if listeners were already removed.\n if (!this._isListening) {\n return;\n }\n\n window.removeEventListener('resize', this.startUpdateCycle, true);\n window.removeEventListener('scroll', this.scheduleUpdate, true);\n\n this._removeHoverListener();\n\n if (!mutationsSupported) {\n this._repeatCycle = false;\n\n window.removeEventListener('click', this.startUpdateCycle, true);\n } else if (this._mutationsObserver) {\n this._mutationsObserver.disconnect();\n this._mutationsObserver = null;\n }\n\n this._isListening = false;\n }", "title": "" }, { "docid": "97e7bfceff0a25b3824471a354d42119", "score": "0.7348437", "text": "clearEventListeners() {\n\t\tfor ( let args; args = this.eventListeners.pop(); ) {\n\t\t\tthis.host.removeEventListener( ...args );\n\t\t}\n\t}", "title": "" }, { "docid": "fe41fe8ef45567d2a5ce72deffba44ea", "score": "0.73273754", "text": "destroy() {\n this.removeDOMListener()\n this.unsubscribers.forEach(unsub => unsub())\n }", "title": "" }, { "docid": "1a68ad85b42651f183a456aeae991413", "score": "0.7321485", "text": "_removeEventListeners() {\n this.el.removeEventListener('click', this._onClickBound);\n this.el.removeEventListener('focus', this._onFocusBound);\n this.el.removeEventListener('blur', this._onBlurBound);\n this.el.removeEventListener('keydown', this._onKeydownBound);\n }", "title": "" }, { "docid": "95191557eebcd1203199c84790b7dbc9", "score": "0.7293179", "text": "removeListener() {\n }", "title": "" }, { "docid": "f7bc49cf6ad9720d5367533391d95f7f", "score": "0.72889054", "text": "function removeListeners() {\n if (state.current.scrollContainers) {\n state.current.scrollContainers.forEach(function (element) {\n return element.removeEventListener('scroll', scrollChange, true);\n });\n state.current.scrollContainers = null;\n }\n\n if (state.current.resizeObserver) {\n state.current.resizeObserver.disconnect();\n state.current.resizeObserver = null;\n }\n } // add scroll-listeners / observers", "title": "" }, { "docid": "f101db911853b8f0e60a0803e8cc618e", "score": "0.7283376", "text": "removeAllEventListener() {\n\t\tdelete this.__listeners;\n\t\tthis.__listeners = {};\n\t}", "title": "" }, { "docid": "a119145ded209c92354be9459aae5dcb", "score": "0.7282727", "text": "_unsubscribeEvents() {\n this._emitter.removeAllListeners()\n }", "title": "" }, { "docid": "54574fcece8ea9b783f42d2e3526f2e5", "score": "0.7272285", "text": "destroy() {\n this.deactivate();\n this._listeners = [];\n }", "title": "" }, { "docid": "9a35396f815300d4e1c6ee269932bd03", "score": "0.72592765", "text": "__unregisterEventListener() {\n qx.core.Init.getApplication().removeListener(\"stop\", this.hide, this);\n qx.core.Init.getApplication().removeListener(\"popup\", this.hide, this);\n\n qx.event.Registration.removeListener(\n window,\n \"resize\",\n this._updatePosition,\n this\n );\n\n if (this.__anchor) {\n this.__anchor.removeCssClass(\"anchor-target\");\n qx.ui.mobile.dialog.Popup.ROOT.removeListener(\n \"pointerdown\",\n this._trackUserTap,\n this\n );\n }\n }", "title": "" }, { "docid": "75df0dc28d532a804eb9a637f119fafa", "score": "0.723434", "text": "dispose() {\n this.removeAllEventListeners();\n this.disconnect();\n }", "title": "" }, { "docid": "4e8bf44cbe327449f2cefb56f3834a7a", "score": "0.7226866", "text": "$_indicator_removeListeners() {\n if (!this.$_indicator_applied) return;\n\n this.$_indicator_applied = false;\n\n if (this.$_indicator_listener && this.$_indicator_listener.destroy) {\n this.$_indicator_listener.destroy();\n }\n }", "title": "" }, { "docid": "e6cdec57760b11bf72839fc3adec2c76", "score": "0.71709603", "text": "removeEventListeners() {\n let mouseEventName = `mousedown.${EVENT_ID}${this.id}`;\n let resizeEventName = `resize.${EVENT_ID}${this.id}`;\n this.removeWindowListener(mouseEventName);\n this.removeWindowListener(resizeEventName);\n if (this.__scrollDeregister) {\n this.__scrollDeregister();\n }\n this.__handlerDefined = false;\n }", "title": "" }, { "docid": "8427f0d8679d5685194f14931abc17e8", "score": "0.7170895", "text": "removeListeners() {\n this.context.isLoading.valueChanged.remove(this._loadUI);\n }", "title": "" }, { "docid": "84f5fd104421ff4fb60438147ffd4ab5", "score": "0.716858", "text": "_removeListeners() {\n const { listenElement, eventMap } = this;\n\n Object.keys(eventMap).forEach(eventName => {\n const { listeners, added } = eventMap[eventName];\n\n if (added === true) {\n listeners.forEach(({ name, method }) =>\n listenElement.removeEventListener(name, method)\n );\n\n eventMap[eventName].added = false;\n }\n });\n }", "title": "" }, { "docid": "16cbc97f398454fbe47c92b13bd925d7", "score": "0.7163118", "text": "destruct() {\n this.renderer.controls.removeEventListener(\"click\", this._dblclickHandler);\n this.renderer.controls.removeEventListener(\"dblclick\", this._dblclickHandler);\n this.renderer.controls.removeEventListener(\"mousemove\", this._mousemoveHandler);\n this.renderer.controls.removeEventListener(\"updated\", this._updatedHandler);\n }", "title": "" }, { "docid": "9df3adbbd8ac1b046551b6a9d69bf7e6", "score": "0.715833", "text": "destroy() {\n this.props.viewport.removeEventListener('mousedown', this.events.pointerdown);\n this.props.viewport.removeEventListener('touchstart', this.events.pointerdown);\n this.props.viewport.removeEventListener('click', this.events.click);\n this.props.viewport.removeEventListener('wheel', this.events.wheel);\n this.props.viewport.removeEventListener('scroll', this.events.scroll);\n this.props.content.removeEventListener('load', this.events.contentLoad);\n window.removeEventListener('mousemove', this.events.pointermove);\n window.removeEventListener('touchmove', this.events.pointermove);\n window.removeEventListener('mouseup', this.events.pointerup);\n window.removeEventListener('touchend', this.events.pointerup);\n window.removeEventListener('resize', this.events.resize);\n }", "title": "" }, { "docid": "8b33280c73ab503dba95f00ec44855a6", "score": "0.7146497", "text": "_removeEventListeners() {\n\n this.controlsEl.removeEventListener('touchstart', this._onTouchStartBound);\n this.controlsEl.removeEventListener('mousedown', this._onMouseDownBound);\n\n document.removeEventListener('spark.visible-children', this._onVisibleChildrenBound);\n\n for (var i = 0, len = this.inputEls.length; i < len; i++) {\n this.inputEls[i].removeEventListener('change', this._onChangeBound);\n }\n\n for (var j = 0, len2 = this.handleEls.length; i < len2; i++) {\n this.handleEls[j].removeEventListener('focus', this._onFocusBound);\n this.handleEls[j].removeEventListener('click', this._onClickBound);\n }\n\n window.removeEventListener('resize', this._onResizeBound);\n window.removeEventListener('orientationchange', this._onResizeBound);\n }", "title": "" }, { "docid": "1cacb87afd038d3355a679c222bf1d27", "score": "0.71401703", "text": "removeAllChangeListeners() {\n this.removeAllListeners(\"change\");\n }", "title": "" }, { "docid": "0c31b602a651bca82832f6f69853fb84", "score": "0.7114063", "text": "dispose() {\n if(this.shouldWatch) {\n window.removeEventListener(\"scroll\", this.handler, {\n passive: true\n });\n }\n }", "title": "" }, { "docid": "2e87ce59831e610b7ed21fe892a26438", "score": "0.7102425", "text": "function _removeAndUnbind() {\n\t _unbindResizeWindowListener();\n\t _unbindKeyboardListener();\n\t _cleanUpAfterStep();\n\n\t if (Utils.isValid(FlexTour.Component)) {\n\t FlexTour.Component.removeComponents();\n\t }\n\t FlexTour.running = false; // Reset this flag when users quit the tour\n\t}", "title": "" }, { "docid": "cfb62b788da4d5b58614062dbfab14c0", "score": "0.70967555", "text": "removeAllEventListeners() {\n\t\tObject.keys(this.evtCallbacks).forEach((evtName) => {\n\t\t\tconst events = this.evtCallbacks[evtName];\n\t\t\tevents.forEach(({ element, callback }) => {\n\t\t\t\telement.removeEventListener(evtName, callback);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "61be82743550c7a1eae6d6c7d438bf93", "score": "0.7090056", "text": "detachEventListeners() {\n\t\tthis.listeners.forEach(function (listenerArr) {\n\t\t\tif ('un' in listenerArr[0])\n\t\t\t\tlistenerArr[0].un(listenerArr[1]);\n\t\t\telse if ('off' in listenerArr[0])\n\t\t\t\tlistenerArr[0].off(listenerArr[1]);\n\t\t});\n\t\tthis.listeners = [];\n\t}", "title": "" }, { "docid": "1d5847f864a19346a69c660d447558c9", "score": "0.7086035", "text": "function removeListeners() {\n if (!$scroller) { return; }\n $scroller.off('mousewheel.smoothscroll', onScroll);\n }", "title": "" }, { "docid": "24cf6d788f52e0b7126d265702af8592", "score": "0.7069663", "text": "destroy() {\n this.removeDomListeners();\n this.unsubscribers.forEach(unsub =>unsub());\n }", "title": "" }, { "docid": "b7d74e9b8facb793d23e85c29dbe046d", "score": "0.705253", "text": "function deinit() {\n // removes all listenTo events\n $.stopListening();\n $.test_names.removeEventListener('click', onTestNameClick);\n // defined in view xml file\n $.clear_results.removeEventListener('click', clearOutput);\n $.email_tests.removeEventListener('click', emailTests);\n $.destroy();\n}", "title": "" }, { "docid": "b9a1830b346321fa985201e796c64715", "score": "0.7029132", "text": "stopListeners() {\n this._destroyed = true;\n }", "title": "" }, { "docid": "39d1cda48d1d1d85cbbe5881ac1da0bd", "score": "0.7018275", "text": "function deinit() {\n $.dashboard_configuration_button.removeEventListener('click', onDashboardConfigClick);\n $.dashboard_settings_button.removeEventListener('click', onDashboardSettingsClick);\n $.dashboard_payment_terminal_button.removeEventListener('click', onPaymentTerminalClick);\n $.dashboard_receipt_printer_button.removeEventListener('click', onReceiptPrinterClick);\n $.dashboard_test_button.removeEventListener('click', onTestClick);\n $.dashboard_logs_button.removeEventListener('click', onLogsClick);\n $.stopListening();\n $.destroy();\n}", "title": "" }, { "docid": "e118d259f2203d5d0617a0971140ab1e", "score": "0.7002845", "text": "removeEvents() {\n if (this.settings.closeOnClick) {\n document.removeEventListener('click', this.handleCloseOnClick.bind(this), false);\n }\n\n this.trigger.removeEventListener('click', this, false);\n document.removeEventListener('keydown', this, false);\n }", "title": "" }, { "docid": "1b2810d423a85f16abf5554f3c3f1f36", "score": "0.7002231", "text": "destroy() {\n this.removeDOMListeners()\n this.unsubscribers.forEach(unsub => unsub())\n }", "title": "" }, { "docid": "604fa2aa621a3f9b13bea8ce16140cbb", "score": "0.69929373", "text": "destroy() {\n\t\tthis.removeDOMListeners()\n\t\tthis.unsubsribers.forEach( unsub => unsub() )\n\t}", "title": "" }, { "docid": "d9d9649cde8445921f17f0e25790e53c", "score": "0.6978577", "text": "willDestroy () {\n if (!!this._mdcComponent) {\n // Instruct all registered listeners to stop listening for events.\n this._listeners.forEach (listener => listener.unlisten (this._mdcComponent));\n }\n }", "title": "" }, { "docid": "3faef82d98d0168f9539f73ff88e6841", "score": "0.697792", "text": "destroy () {\n this.removeAllListener()\n this.emit = this._emit // retrieve basic behavior\n }", "title": "" }, { "docid": "5e0f55cac10d270e54ed57f3e393d60d", "score": "0.69737995", "text": "function removeListeners() {\n console.log(\"Remove listeners\");\n document.removeEventListener('click', clickListener, true)\n document.removeEventListener('change', changeListener, false)\n //document.removeEventListener('mouseover', hoverListener, false)\n //removeRecorderPanel();\n}", "title": "" }, { "docid": "d7dbb8bf63f562904517f0347147ab8e", "score": "0.6965138", "text": "_unlisten() {\n\t\tfor(const type of this.types)\n\t\t\tthis.target.removeEventListener(type, this);\n\t}", "title": "" }, { "docid": "845b825588b83a962fb989341ef103a3", "score": "0.6964623", "text": "function _removeListeners() {\n MainViewManager.off(\".sort\");\n }", "title": "" }, { "docid": "6452b44b3462819592b4aad4bc3c7eab", "score": "0.6964364", "text": "function removeEvents() {\n node.removeEventListener('load', onResolve);\n node.removeEventListener('error', onReject);\n }", "title": "" }, { "docid": "964bed7d28dcf81c9c733f2a0b252ba5", "score": "0.6963776", "text": "removeEventListeners() {\n for (let i = 0; i < this.eventListeners.length; i++) {\n const eventListener = this.eventListeners[i];\n eventListener.target.removeEventListener(\n eventListener.type,\n eventListener.listener\n );\n }\n }", "title": "" }, { "docid": "9a555bde41aa2b47c22fcc9883ba6ccb", "score": "0.6960646", "text": "unregisterEventListeners_() {\n const openElements = this.element.querySelectorAll(\n '[amp-drilldown-submenu-open]'\n );\n openElements.forEach(element => {\n element.removeEventListener('click', this.submenuOpenHandler_);\n });\n const closeElements = this.element.querySelectorAll(\n '[amp-drilldown-submenu-close]'\n );\n closeElements.forEach(element => {\n element.removeEventListener('click', this.submenuCloseHandler_);\n });\n\n this.documentElement_.removeEventListener('keydown', this.keydownHandler_);\n }", "title": "" }, { "docid": "9deba19780b5abcab3417b81ab9d9246", "score": "0.6959054", "text": "function destroy() {\n element.off('$destroy', methods.destroy);\n angular.forEach(scope.vm.data.listeners, function ($listener) {\n $listener();\n });\n }", "title": "" }, { "docid": "887fb77fc76c5c1af37f51752e138c90", "score": "0.69567597", "text": "deactivate() {\n // dispose of all listeners\n disposables.forEach((d) => d.dispose())\n }", "title": "" }, { "docid": "65fb199ccd0b8e3a7b765d6f70d2da66", "score": "0.6956653", "text": "removeAllListeners(name) {}", "title": "" }, { "docid": "3f0891cbd4c7083609def3719a29887f", "score": "0.6953313", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t\t\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) { \n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\t\t\t\n\t\t\tsetTouchInProgress(false);\n\t\t}", "title": "" }, { "docid": "0ce52d8d1dcd017d4580508dcc880db4", "score": "0.69450957", "text": "destroy() {\n this.removeDOMListeners()\n this.unsubcribers.forEach((unsub) => unsub())\n }", "title": "" }, { "docid": "7091154b669346d8c11a913b718ec0d2", "score": "0.69197416", "text": "function removeListeners() {\r\n $element.unbind(START_EV, touchStart);\r\n $element.unbind(CANCEL_EV, touchCancel);\r\n $element.unbind(MOVE_EV, touchMove);\r\n $element.unbind(END_EV, touchEnd);\r\n\r\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\r\n if (LEAVE_EV) {\r\n $element.unbind(LEAVE_EV, touchLeave);\r\n }\r\n\r\n setTouchInProgress(false);\r\n }", "title": "" }, { "docid": "4d6e5ef23e846d579ee6ebf5204425e2", "score": "0.6914684", "text": "componentWillUnmount() {\n this.props.doc.removeListener('remove-error', this.boundHandleRemoveError);\n this.props.doc.removeListener('remove-success', this.boundHandleRemoveSuccess);\n }", "title": "" }, { "docid": "39aa04a71facc7ebdbae4582c0fce142", "score": "0.69116235", "text": "function removeListeners() {\r\n\t\t\t$element.unbind(START_EV, touchStart);\r\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\r\n\t\t\t$element.unbind(MOVE_EV, touchMove);\r\n\t\t\t$element.unbind(END_EV, touchEnd);\r\n\r\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\r\n\t\t\tif(LEAVE_EV) {\r\n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\r\n\t\t\t}\r\n\r\n\t\t\tsetTouchInProgress(false);\r\n\t\t}", "title": "" }, { "docid": "0fdf37cbaeb6e1550bea6dff74c306aa", "score": "0.6906238", "text": "unlisten() {\n for (let btn of this.buttons) {\n btn.elem.removeEventListener('click', this.handleClick);\n }\n }", "title": "" }, { "docid": "462e794d0f04e45b705e610a40c922b5", "score": "0.6895332", "text": "unregisterEvents() {\n this.eventManager.clear();\n }", "title": "" }, { "docid": "443151572c3c1e418cc87c3fff03fc82", "score": "0.68851745", "text": "disconnectedCallback () {\n this._inputField.removeEventListener('input', this._onInput)\n this._submitButton.removeEventListener('submit', this._onSubmit)\n }", "title": "" }, { "docid": "92002b1a80f61dfefe9f20687baee160", "score": "0.6882851", "text": "clearEvents() {\n if (!this.context) {\n return;\n }\n let len = this.context.eventListeners.length;\n\n while (len--) {\n let event = this.context.eventListeners[len];\n\n if (event) {\n this.removeEventListener(event.element, event.event, event.callback);\n }\n }\n }", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.6876461", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.6876461", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.6876461", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "73c97f487299ac43b00f17bec21d7d91", "score": "0.68745744", "text": "destroy() {\n // Detatch all event listeners.\n for(let i = 0; i < listenerKeys.length; i++) {\n window.removeEventListener(listenerKeys[i], this.listeners[listenerKeys[i]]);\n }\n\n // Destroy element.\n this.element.remove();\n }", "title": "" }, { "docid": "1276d0e2b628fd037e9faaf799bfadac", "score": "0.6872781", "text": "componentWillUnmount() {\n const { listeners } = this.props;\n this.removeEventListeners(listeners);\n }", "title": "" }, { "docid": "00c17631161514fd4e2ad012a57cfe9c", "score": "0.6868184", "text": "componentWillUnmount() {\n this.vsBdHoodLookupService\n .removeAllListeners('created')\n .removeAllListeners('removed');\n\n const services = [\n this.hoodsService,\n this.pendingHoodsService\n ];\n\n services.forEach(service => {\n service\n .removeAllListeners('created')\n .removeAllListeners('updated')\n .removeAllListeners('patched')\n .removeAllListeners('removed');\n });\n }", "title": "" }, { "docid": "c787a5828d8d4d937b63fde5c671b461", "score": "0.68584657", "text": "disconnectedCallback() {\n this.removeEventListener('keydown', this._onKeyDown);\n this.removeEventListener('click', this._onClick);\n }", "title": "" }, { "docid": "bb92e77f46d2e9da2ade7f2009a6038c", "score": "0.6850762", "text": "disconnectedCallback() {\n this.removeEventListeners();\n super.disconnectedCallback();\n }", "title": "" }, { "docid": "9ddde1e04cea238dcde633d6e8a2a541", "score": "0.68506503", "text": "_removeAllMetaMaskEventListeners () {\n this.metamaskEventListeners.forEach((listenerRemovalMap) => {\n listenerRemovalMap.forEach((removeListener) => {\n removeListener()\n })\n listenerRemovalMap.clear()\n })\n this.metamaskEventListeners.clear()\n }", "title": "" }, { "docid": "214a742f51f083500d68a199b3003d86", "score": "0.6850576", "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": "08f13872407acf5986dd4b2650365f67", "score": "0.68432134", "text": "removeDeviceListeners () {\n Object.keys(this._dListeners).forEach(name => this._dListeners[name].remove())\n this._dListeners = {}\n }", "title": "" }, { "docid": "7a5efaceddb5f7cdf1cbfe079c8700bc", "score": "0.68403256", "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}", "title": "" }, { "docid": "545452eeca6985ef495c6a6829630a9d", "score": "0.6839218", "text": "cleanupListeners () {\n if (this.state.machine) {\n this.state.machine.removeListener('before state change', this.beforeTransition);\n this.state.machine.removeListener('state changed', this.onTransition);\n this.state.machine.removeListener('state change failed', this.onTransitionFailed);\n }\n }", "title": "" }, { "docid": "bf674abc1e29f5b7b99414458a16bbfe", "score": "0.6838294", "text": "destroy() {\n this.disconnect();\n this.events.removeAllListeners();\n }", "title": "" }, { "docid": "14d1c286f334bcf6dea5b7f954ca08b0", "score": "0.68295044", "text": "dispose() {\n\t\tdocument.removeEventListener( 'mousemove', this.onMouseMoveRef, false );\n\t\tdocument.removeEventListener( 'pointerlockchange', this.onPointerLockChangeRef, false );\n\t\tdocument.removeEventListener( 'mozpointerlockchange', this.onPointerLockChangeRef, false );\n\t\tdocument.removeEventListener( 'webkitpointerlockchange', this.onPointerLockChangeRef, false );\n\n\t\tdocument.removeEventListener( 'pointerlockerror', this.onPointerLockErrorRef, false );\n\t\tdocument.removeEventListener( 'mozpointerlockerror', this.onPointerLockErrorRef, false );\n\t\tdocument.removeEventListener( 'webkitpointerlockerror', this.onPointerLockErrorRef, false );\n\t}", "title": "" }, { "docid": "32d59738be5cadbc7222a89d5d1c2f35", "score": "0.6812964", "text": "removeOnScrollListener_() {\n if (this.scrollUnlisten_) {\n this.scrollUnlisten_();\n this.scrollUnlisten_ = null;\n }\n }", "title": "" }, { "docid": "74ef95ce1b1610d911ff7414598cb0cd", "score": "0.6804283", "text": "disconnectedCallback() {\n this.refreshButton.removeEventListener('click', this.refresh);\n this.table.removeEventListener('click',this.rowClicked);\n }", "title": "" }, { "docid": "fc0a012c76e4a302f5cd317b7a742cf1", "score": "0.68011737", "text": "removeAllListeners() {\n for (let i = this.listeners.length - 1; i >= 0; i--) {\n this.listeners.splice(i, 1);\n }\n\n this.listeners.map(listener => this.removeListener(listener.id));\n }", "title": "" }, { "docid": "b3cd5e47288a4b9805203b60f078d4be", "score": "0.6798766", "text": "componentWillUnmount () {\n window.removeEventListener('resize', this.updatePosition)\n window.removeEventListener('scroll', this.updatePosition)\n this.removeListeners(this.el)\n }", "title": "" }, { "docid": "037b587ad9fdb1d7cb059e1555f507b2", "score": "0.678818", "text": "removeListener(func){\n var index = listeners.indexOf(func);\n if (index > -1){\n listeners.splice(index, 1);\n }\n }", "title": "" }, { "docid": "4e0d3b63eb5bdc71399054f0d9410811", "score": "0.6783662", "text": "disconnectedCallback() {\n this.removeEventListener('click');\n }", "title": "" }, { "docid": "edf72a9fdfd60e7c1879707a1caaf307", "score": "0.6782951", "text": "removeEventListner (eventName) {\n if (this.events && this.events[eventName]) {\n delete this.events[eventName];\n }\n }", "title": "" }, { "docid": "1c2864d30bf812ce6ab8b771f129c444", "score": "0.6780031", "text": "removeListeners() {\n\t\twindow.removeEventListener('online', this._status);\n\t window.removeEventListener('offline', this._status);\n\t\tthis._status = undefined;\n\t}", "title": "" }, { "docid": "e534dfdc7df5398447ff5e556323d598", "score": "0.67700565", "text": "disconnectedCallback() {\n this.shadowRoot.querySelector(\".collapse-icon\").removeEventListener(\"click\", () => this.expandCollapse());\n this.shadowRoot.querySelector(\".del-btn\").removeEventListener(\"click\", () => this.deletePoint());\n this.shadowRoot.querySelector(\".loc-btn\").removeEventListener(\"click\", () => this.getLocation());\n\n }", "title": "" }, { "docid": "7e112ef371eb3cda7970862684c87bf8", "score": "0.6769961", "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": "5a9fdf9f29cbadc715817c0f03771cb1", "score": "0.6764267", "text": "removeEvents() {\n window.removeEventListener('resize', this);\n window.removeEventListener('mousemove', this);\n }", "title": "" }, { "docid": "dc855619d919fe4abeb72e953b9bee75", "score": "0.6752856", "text": "cleanup() {\n this.unsubscribeFromAll();\n this.removeListeners();\n }", "title": "" }, { "docid": "b958c60f32e2922bcc8e931a3af8869c", "score": "0.67522186", "text": "_clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n this._globalListeners.clear();\n }", "title": "" }, { "docid": "b958c60f32e2922bcc8e931a3af8869c", "score": "0.67522186", "text": "_clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n this._globalListeners.clear();\n }", "title": "" }, { "docid": "b958c60f32e2922bcc8e931a3af8869c", "score": "0.67522186", "text": "_clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n this._globalListeners.clear();\n }", "title": "" }, { "docid": "937ea7c45563430d08b4a0d008a38924", "score": "0.67506343", "text": "beforeDestroy() {\n document.removeEventListener('mouseup', this.chartMouseUp);\n document.removeEventListener('mousemove', this.chartMouseMove);\n document.removeEventListener('touchmove', this.chartMouseMove);\n document.removeEventListener('touchend', this.chartMouseUp);\n }", "title": "" }, { "docid": "c175a5847ebf41bf8500b388ba0c3430", "score": "0.6749276", "text": "onUnload() {\n this.$container.off(this.namespace);\n }", "title": "" }, { "docid": "7090ed7d683cc3ec6352bb0e70731b4f", "score": "0.67457724", "text": "remove() {\n if (this.canvas.removeEventListener) {\n this.canvas.removeEventListener('click', this.mouseEventHandler);\n this.canvas.removeEventListener('dblclick', this.mouseEventHandler);\n this.canvas.removeEventListener('keydown', this.keyEventHandler);\n this.canvas.removeEventListener('wheel', this.scrollEventHandler);\n this.canvas.removeEventListener('touchstart', this.touchStartHandler);\n this.canvas.removeEventListener('touchmove', this.touchMoveHandler);\n this.canvas.removeEventListener('mousewheel', this.scrollEventHandler);\n window.removeEventListener('resize', this.resizeEventHandler);\n } \n }", "title": "" }, { "docid": "017255ab65b068c8aad75ab3ffeb8dee", "score": "0.6743812", "text": "disconnectedCallback () {\n this._insertBtn.removeEventListener('click', this._onInsertBtn)\n this._withdrawBtn.removeEventListener('click', this._onWithdrawBtn)\n this._startBtn.removeEventListener('click', this._onStartBtn)\n if (this._didStartGame) {\n this._spinBtn.removeEventListener('click', this._onSpinBtn)\n }\n }", "title": "" }, { "docid": "54a52be4450cd8007ceb2ddc32e886fe", "score": "0.67427075", "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.67427075", "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.67427075", "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.67427075", "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.67427075", "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": "ee3c9d426d8f71dca4571b3f9c2240b9", "score": "0.6742603", "text": "componentWillUnmount() {\n this.listener();\n }", "title": "" }, { "docid": "62f45728c67ea60cf00e5299a1129c85", "score": "0.67413473", "text": "onRemoved() {}", "title": "" } ]
d8663491ac70a7901f9d92128db25a0f
translate a GS1 Digital Link URI into a string of concatenated GS1 element strings
[ { "docid": "3f0dc8ffeed643abaf9d5823f7d4d5b8", "score": "0.6996067", "text": "gs1digitalLinkToGS1elementStrings(digitalLinkURI, brackets) {\n return this.buildGS1elementStrings(this.extractFromGS1digitalLink(digitalLinkURI).GS1, brackets);\n }", "title": "" } ]
[ { "docid": "f918aebf5312f876929b26ea44a3206f", "score": "0.69469494", "text": "gs1ElementStringsToGS1DigitalLink(elementString, useShortText, uriStem) {\n return this.buildGS1digitalLink(this.extractFromGS1elementStrings(elementString), useShortText, uriStem, {});\n }", "title": "" }, { "docid": "3644770a137e625008b278e3ed162086", "score": "0.6940674", "text": "gs1compressedDigitalLinkToGS1elementStrings(digitalLinkURI, brackets) {\n return this.buildGS1elementStrings(this.extractFromCompressedGS1digitalLink(digitalLinkURI).GS1, brackets);\n }", "title": "" }, { "docid": "66340a5a1f7257f8b4af00d6e522fb27", "score": "0.6573234", "text": "extractFromGS1digitalLink(gs1DigitalLinkURI) {\n // initialise internal variables\n let obj = {};\n let rv = {};\n\n // extract path info and query string from URI and parse these to extract AI key:value pairs\n //\t\tlet s=this.analyseURI(gs1DigitalLinkURI,false);\n\n let s = this.analyseURI(gs1DigitalLinkURI, false);\n let queryString = s.queryString;\n let uriPathInfo = s.uriPathInfo;\n let pathCandidates = s.pathCandidates;\n\n let splitPath = uriPathInfo.split('/').slice(1);\n\n let aiSeq = [];\n let l = splitPath.length;\n for (let i = l - 1; i >= 0; i--) {\n if (i % 2 == 0) {\n let k = splitPath[i];\n if (!this.regexAllNum.test(k)) {\n k = this.shortCodeToNumeric[k];\n }\n aiSeq.push(k);\n }\n }\n aiSeq = aiSeq.reverse();\n\n // check that the URI path components appear in the correct sequence\n if (this.pathSequenceConstraints.hasOwnProperty(aiSeq[0])) {\n let lastIndex = -1;\n for (let j = 1; j < aiSeq.length; j++) {\n let i = this.pathSequenceConstraints[aiSeq[0]].indexOf(aiSeq[j]);\n if (i <= lastIndex) {\n throw new Error('Invalid GS1 Digital Link - invalid sequence of key qualifiers found in URI path information.');\n }\n lastIndex = i;\n }\n }\n\n for (let k in pathCandidates) {\n if (pathCandidates.hasOwnProperty(k)) {\n if (!this.regexAllNum.test(k)) {\n let numkey = this.shortCodeToNumeric[k];\n }\n }\n }\n\n let queryStringCandidates = s.queryStringCandidates;\n let nonGS1queryStringCandidates = {};\n\n // merge pathCandidates and queryStringCandidates into a combined associative array, candidates\n let candidates = Object.assign({}, pathCandidates, queryStringCandidates);\n\n // process candidates;\n for (let k in candidates) {\n if (candidates.hasOwnProperty(k)) {\n if (!this.regexAllNum.test(k)) {\n // for keys that are not all-numeric, attempt to convert to all-numeric AI equivalent\n if (this.shortCodeToNumeric.hasOwnProperty(k)) {\n let numkey = this.shortCodeToNumeric[k];\n candidates[numkey] = candidates[k];\n delete candidates[k];\n } else {\n // or otherwise remove from candidates map if it doesn't relate to a GS1 Application Identifier\n nonGS1queryStringCandidates[k] = candidates[k];\n delete candidates[k];\n }\n }\n }\n }\n\n // check that each entry in the associative array has correct syntax and correct digit (where appropriate)\n for (let k in candidates) {\n if (candidates.hasOwnProperty(k)) {\n this.verifySyntax(k, candidates[k]);\n this.verifyCheckDigit(k, candidates[k]);\n obj[k] = padGTIN(k, candidates[k]);\n }\n }\n\n rv.GS1 = obj;\n rv.other = nonGS1queryStringCandidates;\n\n return rv;\n\n function padGTIN(ai, value) {\n // always pad the value of any GTIN [ AI (01) or (02) ] to 14 digits in element string representation\n let newvalue = value;\n if (ai == '01' || ai == '(01)' || ai == '02' || ai == '(02)') {\n if (value.length == 8) {\n newvalue = '000000' + value;\n }\n if (value.length == 12) {\n newvalue = '00' + value;\n }\n if (value.length == 13) {\n newvalue = '0' + value;\n }\n }\n return newvalue;\n }\n }", "title": "" }, { "docid": "14418577037337b1887e7203eb00bcda", "score": "0.646702", "text": "buildGS1digitalLink(gs1AIarray, useShortText, uriStem, nonGS1keyvaluePairs) {\n let identifiers = [];\n let qualifiers = [];\n let attributes = [];\n let fixedLengthValues = [];\n let variableLengthValues = [];\n let otherKeys = [];\n\n let valid = true;\n let path = '';\n let queryStringArray = [];\n let queryString = '';\n let webURI = '';\n let canonicalStem = 'https://id.gs1.org';\n let rv = {};\n\n // Need to remove unwanted trailing slash\n if (uriStem !== undefined && uriStem !== null && uriStem !== '' && uriStem.endsWith('/')) {\n uriStem = uriStem.substr(0, uriStem.length - 1) + path + queryString;\n }\n\n for (let a in gs1AIarray) {\n let other = true;\n if (this.aiMaps.identifiers.includes(a)) {\n identifiers.push(a);\n other = false;\n }\n if (this.aiMaps.qualifiers.includes(a)) {\n qualifiers.push(a);\n other = false;\n }\n if (this.aiMaps.dataAttributes.includes(a)) {\n attributes.push(a);\n other = false;\n }\n if (this.aiMaps.fixedLength.includes(a)) {\n fixedLengthValues.push(a);\n other = false;\n }\n if (this.aiMaps.variableLength.includes(a)) {\n variableLengthValues.push(a);\n other = false;\n }\n if (other) {\n otherKeys.push(a);\n }\n }\n\n // Start building Web URI path expression\n // need exactly one identifier key\n\n if (identifiers.length !== 1) {\n valid = false;\n throw new Error(\n 'The element string should contain exactly one primary identification key - it contained ' +\n identifiers.length +\n ' ' +\n JSON.stringify(identifiers) +\n '; please check for a syntax error',\n );\n } else {\n this.verifySyntax(identifiers[0], gs1AIarray[identifiers[0]]);\n\n this.verifyCheckDigit(identifiers[0], gs1AIarray[identifiers[0]]);\n\n if (useShortText) {\n // Using short text names\n if (this.aiShortCode[identifiers[0]] !== undefined) {\n path = '/' + this.aiShortCode[identifiers[0]] + '/' + this.percentEncode(gs1AIarray[identifiers[0]]);\n } else {\n path = '/' + identifiers[0] + '/' + this.percentEncode(gs1AIarray[identifiers[0]]);\n }\n } else {\n // Using numeric AIs\n path = '/' + identifiers[0] + '/' + this.percentEncode(gs1AIarray[identifiers[0]]);\n }\n\n // append any data qualifiers in the expected order, as specified in this.aiQualifiers[identifiers[0]]\n\n if (this.aiQualifiers[identifiers[0]] !== undefined) {\n for (let j in this.aiQualifiers[identifiers[0]]) {\n let q = this.aiQualifiers[identifiers[0]][j];\n if (qualifiers.includes(q)) {\n if (useShortText) {\n // Using short text names\n if (this.aiShortCode[q] !== undefined) {\n path += '/' + this.aiShortCode[q] + '/' + this.percentEncode(gs1AIarray[q]);\n } else {\n path += '/' + q + '/' + this.percentEncode(gs1AIarray[q]);\n }\n } else {\n // Using numeric AIs\n path += '/' + q + '/' + this.percentEncode(gs1AIarray[q]);\n }\n }\n }\n }\n\n // if there are any data attributes, we need to add these to the query string\n\n if (attributes.length > 0) {\n for (let k in attributes) {\n let a = attributes[k];\n\n if (useShortText) {\n // Using short text names\n if (this.aiShortCode[a] !== undefined) {\n queryStringArray.push(this.aiShortCode[a] + '=' + this.percentEncode(gs1AIarray[a]));\n } else {\n queryStringArray.push(a + '=' + this.percentEncode(gs1AIarray[a]));\n }\n } else {\n // Using numeric AIs\n queryStringArray.push(a + '=' + this.percentEncode(gs1AIarray[a]));\n }\n }\n queryString = '?' + queryStringArray.join('&');\n }\n\n if (uriStem == null || uriStem == '') {\n // prepare a canonical Web URI\n webURI = canonicalStem + path + queryString;\n } else {\n webURI = uriStem + path + queryString;\n }\n\n if (otherKeys.length > 0) {\n let queryStringArray = [];\n for (let iok in otherKeys) {\n queryStringArray.push(otherKeys[iok] + '=' + gs1AIarray[otherKeys[iok]]);\n }\n if (queryString == '') {\n webURI += '?' + queryStringArray.join('&');\n } else {\n webURI += '&' + queryStringArray.join('&');\n }\n }\n\n if (nonGS1keyvaluePairs !== {} && Object.keys(nonGS1keyvaluePairs).length > 0) {\n let queryStringArray = [];\n let keys = Object.keys(nonGS1keyvaluePairs);\n for (let iok in keys) {\n let key = keys[iok];\n queryStringArray.push(key + '=' + nonGS1keyvaluePairs[key]);\n }\n if (queryString == '') {\n webURI += '?' + queryStringArray.join('&');\n } else {\n webURI += '&' + queryStringArray.join('&');\n }\n }\n }\n\n return webURI;\n }", "title": "" }, { "docid": "1daeec92c2004bdb67d1078233322967", "score": "0.6332852", "text": "function GS1DLextractFromGS1digitalLink(gs1DigitalLinkURI) {\n // initialise internal variables\n var obj = {};\n var rv = {};\n var s = GS1DLanalyseURI(gs1DigitalLinkURI);\n var queryString = s.queryString;\n var uriPathInfo = s.uriPathInfo;\n var pathCandidates = s.pathCandidates;\n var queryStringCandidates = s.queryStringCandidates;\n var nonGS1queryStringCandidates = {}; // merge pathCandidates and queryStringCandidates into a combined associative array, candidates\n\n // var candidates = Object.assign({}, pathCandidates, queryStringCandidates); // process candidates;\n var candidates={};\n\t\n for (var kpc in pathCandidates) {\n \tcandidates[kpc]=pathCandidates[kpc];\n }\n\n for (var kqc in queryStringCandidates) {\n \tcandidates[kqc]=queryStringCandidates[kqc];\n }\n\t\n\n\n for (var k in candidates) {\n if (candidates.hasOwnProperty(k)) {\n if (!GS1DLregexAllNum.test(k)) {\n // for keys that are not all-numeric, attempt to convert to all-numeric AI equivalent\n if (GS1DLshortCodeToNumeric.hasOwnProperty(k)) {\n var numkey = GS1DLshortCodeToNumeric[k];\n candidates[numkey] = candidates[k];\n delete candidates[k];\n } else {\n // or otherwise remove from candidates map if it doesn't relate to a GS1 Application Identifier\n nonGS1queryStringCandidates[k] = candidates[k];\n delete candidates[k];\n }\n }\n }\n }\n\n for (var k in candidates) {\n if (candidates.hasOwnProperty(k)) {\n GS1DLverifySyntax(k, candidates[k]);\n GS1DLverifyCheckDigit(k, candidates[k]);\n obj[k] = padGTIN(k, candidates[k]);\n }\n }\n\n rv.GS1 = obj;\n rv.other = nonGS1queryStringCandidates;\n return rv;\n}", "title": "" }, { "docid": "9d866ef51ce2c3965301f6208963f4d6", "score": "0.62395716", "text": "extractFromCompressedGS1digitalLink(gs1DigitalLinkURI) {\n // initialise internal variables\n let objGS1 = {};\n let objOther = {};\n let rv = {};\n\n // set cursor to 0 = start reading from the left-most part of the gs1 Digital Link URI provided as input\n let s = this.analyseURI(gs1DigitalLinkURI, false);\n\n let queryString = s.queryString;\n let uriPathInfo = s.uriPathInfo;\n let candidates = s.pathCandidates;\n let queryStringCandidates = s.queryStringCandidates;\n let nonGS1queryStringCandidates = {};\n\n if (queryString !== '') {\n // if semicolon was used as delimiter between key=value pairs, replace with ampersand as delimiter\n queryString = queryString.replace(new RegExp(';', 'g'), '&');\n\n let firstFragment = queryString.indexOf('#');\n if (firstFragment > -1) {\n queryString = queryString.substring(0, firstFragment);\n }\n\n let pairs = queryString.split('&');\n for (let i = 0; i < pairs.length; i++) {\n let p = pairs[i].split('=');\n // if the key is not numeric AND is not a shortcode such as exp or expdt, then add to the nonGS1keyvalueePairs\n if (p[0] !== null && p[1] !== null && !this.regexAllNum.test(p[0]) && !this.shortCodeToNumeric.hasOwnProperty(p[0])) {\n nonGS1queryStringCandidates[p[0]] = this.percentDecode(p[1]);\n }\n }\n }\n\n // TODO for a partially compressed http://example.org/AQnYUc1gmiERBhQ0ytiyZuAGOLc1TQ?expdt=1903061658&k1=v1\n // expdt:1903061658 is appearing in queryStringCandidates\n\n // TODO also for fully compressed http://example.org/AQnYUc1gmiERBhQ0ytiyZuAGOLc1TXhXsaXbQKHFuaprwUmrBX6g\n // expdt:1903061658 is appearing in queryStringCandidates\n\n // TODO correct splitURIintoComponents to consider shortCode appearing within query string key=value pairs\n\n // remove initial forward slash\n uriPathInfo = uriPathInfo.substr(1);\n\n if (this.regexSafe64.test(uriPathInfo)) {\n let binstr = this.base642bin(uriPathInfo);\n objGS1 = this.decompressBinaryToGS1AIarray(binstr);\n } else {\n // handle situation where the primary identification key is not compressed\n let index1 = uriPathInfo.indexOf('/');\n let index2 = uriPathInfo.lastIndexOf('/');\n let gs1primaryKey = uriPathInfo.substr(0, index1);\n let base64segment = uriPathInfo.substr(1 + index2);\n let gs1primaryKeyValue = uriPathInfo.substr(1 + index1, index2 - index1 - 1);\n objGS1 = this.decompressBinaryToGS1AIarray(this.base642bin(base64segment));\n if (this.regexAllNum.test(gs1primaryKey)) {\n objGS1[gs1primaryKey] = gs1primaryKeyValue;\n } else {\n if (this.shortCodeToNumeric.hasOwnProperty(gs1primaryKey)) {\n objGS1[this.shortCodeToNumeric[gs1primaryKey]] = gs1primaryKeyValue;\n }\n }\n }\n\n // insert into associative array return value any key=value pairs from the URI query string that were not compressed\n for (let k in objGS1) {\n // need to change this to check whether key is exp / expdt or numeric GS1 key - see related method ~ refactor lines 951-967\n /*\t\t\tif ((this.regexAllNum.test(k)) || (this.shortCodeToNumeric.hasOwnProperty(k))) {\n objGS1[this.shortCodeToNumeric[k]]=objGS1[k];\n } else {\n objOther[k]=objGS1[k];\n }\n */\n\n // TODO correct decompressBinaryToGS1AIarray so that expdt and 7003 do not both appear in the returned arrayc\n\n // if the key is not all-numeric and is not exp or expdt, then move it into objOther and delete from objGS1\n if (!this.regexAllNum.test(k) && !this.shortCodeToNumeric.hasOwnProperty(k)) {\n nonGS1queryStringCandidates[k] = objGS1[k];\n delete objGS1[k];\n }\n }\n\n rv.GS1 = objGS1;\n rv.other = nonGS1queryStringCandidates;\n\n return rv;\n }", "title": "" }, { "docid": "38808b30711d82ac0354b3347f347410", "score": "0.6002936", "text": "function linkify(input) {\n let res = [], \n terminalI = 0;\n \n // \"g/123\" \n for(let i = 1; i < input.length; i++) {\n let prev = input[i-1], \n curr = input[i];\n \n if(prev === \"g\" && curr === \"/\") {\n \n if(i-2 >= 0) {\n let preG = input.substring(0, i-2); // off by 1\n \n res.push(preG); \n }\n \n let terminalI = i; \n\n // optimize: \n while(input[terminalI] !== \" \" || terminalI < input.length - 1) {\n terminalI++;\n }\n \n let gSlashSub = input.substring(i-1, terminalI); \n let hrefToAdd = hrefMaker(gSlashSub); \n \n res.push(hrefToAdd); \n // [\"hello world see \", <a href=\"google.com/123\">g/123</a>]\n }\n }\n\n if(terminalI !== input.length) {\n res.push(input.substring(terminalI-1));\n } \n \n return res;\n}", "title": "" }, { "docid": "9c7d22a1a65215ccdbb987551bd2ca47", "score": "0.5702411", "text": "formatUri(uri) {\n\t\tconst internal = this.isInternal(uri);\n\n\t\tlet formatted = uri || '#';\n\n\t\tif (internal) {\n\t\t\tconst removeDupes = uri.replace(/^(?:https?:\\/\\/.+)(https?:\\/\\/.+)/gi, '$1');\n\t\t\tformatted = removeDupes.replace(/^(?:\\/?\\$base_url|https?:\\/\\/(?:[^/]+))(.+)/gi, '$1');\n\t\t}\n\n\t\treturn formatted;\n\t}", "title": "" }, { "docid": "2622ce8b6d6dae67d5c20016d8a5ccf2", "score": "0.5514968", "text": "function stringEncapsulate(url){\n var a = document.createElement('a');\n a.setAttribute('href',url);\n var hostname = a.hostname;\n return [hostname,\"*://\" + hostname + \"/*\"];\n}", "title": "" }, { "docid": "40c72536d874ac571c8544fcb63a069e", "score": "0.5476238", "text": "function gurpslink(str, clrdmods = true) {\n if (str === undefined || str == null) return '!!UNDEFINED'\n let found = -1\n let depth = 0\n let output = ''\n for (let i = 0; i < str.length; i++) {\n if (str[i] == '[') {\n if (depth == 0) found = ++i\n depth++\n }\n if (str[i] == ']') {\n depth--\n if (depth == 0 && found >= 0) {\n output += str.substring(0, found - 1)\n let action = parselink(str.substring(found, i), '', clrdmods)\n if (!action.action) output += '['\n output += action.text\n if (!action.action) output += ']'\n str = str.substr(i + 1)\n i = -1\n found = -1\n }\n }\n }\n output += str\n return output\n}", "title": "" }, { "docid": "a2f0e41abc99a2efd1650c1465e268df", "score": "0.54264563", "text": "convertUri(id, uri) {\n if(uri.includes('{vehicle_id}')) {\n return uri.replace('{vehicle_id}', id)\n }\n\n if(uri.includes('{site_id}')) {\n return uri.replace('{site_id}', id)\n }\n\n if(uri.includes('{battery_id}')) {\n return uri.replace('{battery_id}', id)\n }\n\n if(uri.includes('{message_id}')) {\n return uri.replace('{message_id}', id)\n }\n }", "title": "" }, { "docid": "0834f694417ece3aa6937516926319e4", "score": "0.5421075", "text": "function convertURItoStringId(uri) {\n const inputURI = new URL(uri)\n let source = `${inputURI.hostname}${inputURI.pathname}`\n\n // If hash fragment is anything else but #/definitions keep do not convert it but append\n // for example:\n // http://supermodel.io/fragments/A#/definitions/a - needs to be converted including the hash\n // http://supermodel.io/fragments/A#/properties/a - the hash needs to be preserved as '/properties/a'\n // one has to love OpenAI\n const hash = inputURI.hash\n let appendHash\n if (hash) {\n if (!hash.startsWith('#/definitions')) {\n appendHash = hash\n }\n else {\n source += hash\n }\n }\n \n // snakeCase path segments\n let target = source.replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, function (match, index) {\n if (+match === 0) return \"\"; // or if (/\\s+/.test(match)) for white spaces\n return index == 0 ? match.toLowerCase() : match.toUpperCase();\n });\n\n // remove '/', '#' and '.' from the URI\n target = target.replace(/\\/|\\.|#/g, '')\n \n // Append hash, that has not been converted\n if (appendHash) {\n target += appendHash.slice(1) // skip the leading '#' ie. in #/properties/a\n }\n return target\n}", "title": "" }, { "docid": "6c16b8ec3c9fe423d79486adeceba8cf", "score": "0.5420713", "text": "function createHTTPS(link){\n\n return link.slice(0, 4) + 's' + link.slice(4, link.length);\n\n}", "title": "" }, { "docid": "4fe57eaf8e9f8e6a1dfc87d626e30997", "score": "0.54147184", "text": "function hrefMaker(string) {\n}", "title": "" }, { "docid": "a4b536b83d46c92b5040f23d57ab1621", "score": "0.5386224", "text": "convertListItem(listItem) {\n if (listItem.endsWith(\"\\b\")) {\n return \"\";\n }\n\n try {\n let uri = Services.io.newURI(listItem);\n return uri.spec;\n } catch (ex) {}\n\n try {\n let matches = /^(\\*\\.[^*/]+)\\*$/.exec(listItem);\n if (matches) {\n return `*://${matches[1]}/*`;\n }\n } catch (ex) {}\n\n return \"\";\n }", "title": "" }, { "docid": "5fcdfe5d462bd51e3025494f17c40281", "score": "0.5376934", "text": "function convertLinks(string)\n {\n var aliaslinkre=/\\[\\[(.*?)\\|(.*?)\\]\\]/;\n var linkre=/\\[\\[(.*?)\\]\\]/;\n var linktext=string.match(aliaslinkre);\n while (linktext!=null)\n {\n var replacement='<a href=\"/wiki/'+linktext[1]+'\">'+linktext[2]+'</a>';\n var string=string.replace(aliaslinkre,replacement);\n linktext=string.match(aliaslinkre);\n }\n linktext=string.match(linkre);\n while (linktext!=null) \n {\n var replacement='<a href=\"/wiki/'+linktext[1]+'\">'+linktext[1]+'</a>';\n var string=string.replace(linkre,replacement);\n linktext=string.match(linkre);\n }\n return string;\n }", "title": "" }, { "docid": "2a31e066766fcfe3942af5f41152875b", "score": "0.53712904", "text": "function properlyEncoded(linkdef) {\r\n return linkdef.replace(/^\\s*(.*?)(?:\\s+\"(.+)\")?\\s*$/, function (wholematch, link, title) {\r\n link = link.replace(/\\?.*$/, function (querypart) {\r\n return querypart.replace(/\\+/g, \" \"); // in the query string, a plus and a space are identical\r\n });\r\n link = decodeURIComponent(link); // unencode first, to prevent double encoding\r\n link = encodeURI(link).replace(/'/g, '%27').replace(/\\(/g, '%28').replace(/\\)/g, '%29');\r\n link = link.replace(/\\?.*$/, function (querypart) {\r\n return querypart.replace(/\\+/g, \"%2b\"); // since we replaced plus with spaces in the query part, all pluses that now appear where originally encoded\r\n });\r\n if (title) {\r\n title = title.trim ? title.trim() : title.replace(/^\\s*/, \"\").replace(/\\s*$/, \"\");\r\n title = $.trim(title).replace(/\"/g, \"quot;\").replace(/\\(/g, \"&#40;\").replace(/\\)/g, \"&#41;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\r\n }\r\n return title ? link + ' \"' + title + '\"' : link;\r\n });\r\n }", "title": "" }, { "docid": "4a2e2e3bd231aadac79241ea447c8edb", "score": "0.5356968", "text": "function expand_links(s) {\n var start, stop, mid, linksep, link;\n while(true){\n\tstart = s.indexOf(\"[[\");\n\tif(start == -1)return s;\n\tstop = s.indexOf(\"]]\", start+2);\n\tif(stop == -1)return s;\n\tvar s1 = s.substring(0, start);\n\tvar mid = s.substring(start+2, stop);\n var s2 = s.substring(stop+2, s.length);\n\t// mid might be in two segments\n\tlinksep = mid.indexOf(\"|\");\n\tif (linksep == -1) {\n\t // there is only segment\n\t link = \"<a href='one?arg=\" + mid + \"'>\" + mid + \"</a>\";\n\t s = s1 + link + s2;\n\t} else {\n\t // two parts\n\t var a = mid.substring(0, linksep);\n\t var b = mid.substring(linksep+1, mid.length);\n\t link = \"<a href='two?arg=\" + b + \"'>\" + a + \"</a>\"; \n\t // alert(\"a=\"+a+\"b=\"+b+\"link2=\"+link);\n\t s = s1 + link + s2;\n\t}\n }\n}", "title": "" }, { "docid": "e1c444ea9445ab69a74ecc24d55f18a0", "score": "0.5333466", "text": "function GS1DLbuildGS1elementStrings(gs1AIarray, brackets) {\n // if brackets=true, use GS1 Digital Link ordering - identifier, qualifiers then data attributes in numeric order\n var identifiers = [];\n var qualifiers = [];\n var attributes = [];\n var fixedLengthValues = [];\n var variableLengthValues = [];\n var elementStrings = [];\n\n for (var a in gs1AIarray) {\n if (gs1AIarray.hasOwnProperty(a)) {\n if (GS1DLaiMaps.identifiers.includes(a)) {\n identifiers.push(a);\n }\n\n if (GS1DLaiMaps.qualifiers.includes(a)) {\n qualifiers.push(a);\n }\n\n if (GS1DLaiMaps.dataAttributes.includes(a)) {\n attributes.push(a);\n }\n\n if (GS1DLaiMaps.fixedLength.includes(a)) {\n fixedLengthValues.push(a);\n }\n\n if (GS1DLaiMaps.variableLength.includes(a)) {\n variableLengthValues.push(a);\n }\n }\n }\n\n if (brackets == true) {\n if (identifiers.length !== 1) {\n throw new Error(\"The associative array should contain exactly one primary identification key - it contained \" + identifiers.length + \" \" + JSON.stringify(identifiers) + \"; please check for a syntax error\");\n } else {\n GS1DLverifySyntax(identifiers[0], gs1AIarray[identifiers[0]]);\n GS1DLverifyCheckDigit(identifiers[0], gs1AIarray[identifiers[0]]);\n elementStrings = elementStringsPush(elementStrings, \"(\" + identifiers[0] + \")\", gs1AIarray[identifiers[0]], \"\"); // append any valid found qualifiers for that primary identifier to the elementStrings array\n\n if (GS1DLaiQualifiers.hasOwnProperty(identifiers[0])) {\n var qualifiersForPrimary = GS1DLaiQualifiers[identifiers[0]];\n\n for (var qindex in qualifiersForPrimary) {\n if (qualifiers.indexOf(qualifiersForPrimary[qindex]) > -1) {\n elementStrings = elementStringsPush(elementStrings, \"(\" + qualifiersForPrimary[qindex] + \")\", gs1AIarray[qualifiersForPrimary[qindex]], \"\");\n }\n }\n } // append any found attributes to the elementStrings array\n\n\n var sortedAttributes = attributes.sort();\n\n for (var a in sortedAttributes) {\n elementStrings = elementStringsPush(elementStrings, \"(\" + attributes[a] + \")\", gs1AIarray[attributes[a]], \"\");\n }\n }\n } else {\n // if brackets=false, concatenate defined-length AIs first, then variable-length AIs\n // identify which AIs in gs1AIarray are defined fixed length\n var fixedLengthPrimaryIdentifier = [];\n var fixedLengthValuesOther = fixedLengthValues.slice(0);\n ;\n\n for (var i in fixedLengthValuesOther) {\n if (identifiers.indexOf(fixedLengthValuesOther[i]) > -1) {\n fixedLengthPrimaryIdentifier.push(fixedLengthValuesOther[i]);\n fixedLengthValuesOther.splice(i, 1);\n }\n }\n\n for (var i in fixedLengthPrimaryIdentifier) {\n elementStrings = elementStringsPush(elementStrings, fixedLengthPrimaryIdentifier[i], gs1AIarray[fixedLengthPrimaryIdentifier[i]], \"\");\n }\n\n for (var i in fixedLengthValuesOther) {\n elementStrings = elementStringsPush(elementStrings, fixedLengthValuesOther[i], gs1AIarray[fixedLengthValuesOther[i]], \"\");\n }\n\n for (var i in variableLengthValues) {\n var gs = \"\";\n\n if (i < variableLengthValues.length - 1) {\n gs = GS1DLgroupSeparator;\n }\n\n elementStrings = elementStringsPush(elementStrings, variableLengthValues[i], gs1AIarray[variableLengthValues[i]], gs);\n }\n }\n\n return elementStrings.join(\"\");\n}", "title": "" }, { "docid": "1c1a87282f53de63bd61fd9251b1398d", "score": "0.5317965", "text": "function trial(inputarray) {\n urlfirst=\"https://example.com/\"\n return inputarray.map (singleelement => urlfirst+urlify(singleelement));\n}", "title": "" }, { "docid": "c599cb21fce084e8f4e63a4e1eb7b9ac", "score": "0.5312642", "text": "function composePrefixURI(scheme, manufacturer, type, host, uniqueID) { \n return encodeURI(prefix = suffixString(scheme, \"://\") + suffixString(uniqueID, \":\") + suffixString(manufacturer, \"/\") + type + \":\" + host);\n}", "title": "" }, { "docid": "c599cb21fce084e8f4e63a4e1eb7b9ac", "score": "0.5312642", "text": "function composePrefixURI(scheme, manufacturer, type, host, uniqueID) { \n return encodeURI(prefix = suffixString(scheme, \"://\") + suffixString(uniqueID, \":\") + suffixString(manufacturer, \"/\") + type + \":\" + host);\n}", "title": "" }, { "docid": "15011b3cae510a15ec75c6c4193fa06f", "score": "0.5307371", "text": "function convertObjectToLink(fields){\r\n\tvar str = '';\r\n\tfor(var key in fields){\r\n\t\tvar value = fields[key];\r\n\t\tif(typeof value!=\"object\"){\r\n\t\t\tif(value!=\"\"){\r\n\t\t\t\tstr += '&' + key + '=' + value;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tvar v = '';\r\n\t\t\tfor(var i in value){\r\n\t\t\t\tif(value[i]!=\"\"){\r\n\t\t\t\t\tv += ', ' + value[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(v!=\"\"){\r\n\t\t\t\tv = v.replace(\", \", \"\");\r\n\t\t\t\tstr += '&' + key + '=' + v;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn str;\r\n}", "title": "" }, { "docid": "58c56b5d64bde1476aa220562b378b75", "score": "0.52845806", "text": "function web_address_to_uri($wa, $addhttp) {\n if ($wa=='' || (substr($wa, 0,7) == \"http://\") || (substr($wa, 0,8) == \"https://\") || (substr($wa, 0,6) == \"irc://\")) {\n return $wa;\n }\n if ((substr($wa, 0,7) == \"Http://\") || (substr($wa, 0,8) == \"Https://\")) { // handle iPad overcapitalization of input entries\n return strcat('h', substr($wa,1,strlen($wa)));\n }\n \n if (substr($wa,0,1) == \"@\") {\n return strcat(\"https://twitter.com/\",substr($wa,1,strlen($wa)));\n }\n \n if ($addhttp) {\n $wa = strcat('http://', $wa);\n }\n return $wa;\n }", "title": "" }, { "docid": "77df8d12d249fd01454835c968526819", "score": "0.5280548", "text": "function parseImageURL() {\n\t\t\tvar href = imageArray[0].href;\n\t\t\tvar pos0 = href.lastIndexOf('/') + 1;\n\t\t\tvar pre = href.substring(0, pos0);\n\t\t\tvar post = href.substring(pos0, href.length);\n\t\t\thref = pre + 'm' + post;\n\t\t\treturn href;\n\t\t}", "title": "" }, { "docid": "e5f8cd79bbf4f9e4cce450935b7f9686", "score": "0.52536464", "text": "function convertSeeLink(str) {\n // Love.Resource.NewCompressedData(System.String)\n // => #/module/Love.Graphics?id=loveresourcenewcompresseddatasystemstring\n const id = str.substr(2)\n .toLocaleLowerCase()\n .replace(/ /gi, '-')\n .replace(/[^a-z0-9-]/gi, '')\n let name = str.substr(2);\n if (name.indexOf('(') !== -1){\n name = name.substr(0, name.indexOf('('))\n }\n\n const typeFile = TypeName.find(item => name.startsWith(item))\n\n return `[${typeFile}](/module/${typeFile}?id=${id})`\n}", "title": "" }, { "docid": "8b3e585be69ae917e55994d4fc9c7508", "score": "0.52506", "text": "function toUri() {\n var url = \"http://www.bai.com?name=zcl\";\n var urlTo = encodeURIComponent(url);\n var urlTo1 = decodeURIComponent(url);\n console.log(encodeURIComponent(url)); // 编译不符合uri规则的特殊字符\n console.log(decodeURIComponent(urlTo)); // 编译不符合uri规则的特殊字符\n console.log(encodeURI(url)); // 反编译被处理过的不符合uri规则的uri地址\n console.log(decodeURI(urlTo1)); // 反编译被处理过的不符合uri规则的uri地址\n }", "title": "" }, { "docid": "4329534c74a961932dffeda454c316e3", "score": "0.5200952", "text": "function encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}", "title": "" }, { "docid": "4329534c74a961932dffeda454c316e3", "score": "0.5200952", "text": "function encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}", "title": "" }, { "docid": "f6d0320ce9db2e25258c9c56fb6f4b32", "score": "0.51999515", "text": "function buildUri(host, db, id) { return host + db + id; }", "title": "" }, { "docid": "b76e648ea9aa2cd6f4f247d5558aaf31", "score": "0.5196586", "text": "function tagToUrl(sTag){\r\n\treturn sTag.replace(/_/g, '%20');\r\n}", "title": "" }, { "docid": "71753064a61329eb0d155611e272a7a3", "score": "0.51961285", "text": "function link_converter(md) {\n return md.replace(/\\[\\[([\\w\\s\\-]+)\\]\\]/g, function(match, p1, offset, string) {\n return \"[\" + p1 + \"](/\" + p1.replace(/\\s/g, \"_\") + \")\";\n });\n}", "title": "" }, { "docid": "48410cbcfba5874b1e04f9a235a52ce1", "score": "0.51636916", "text": "link() {\n const link = this.data.link;\n // Some feeds omit schema from the URL.\n // In that case assume https.\n if (link.startsWith(\"//\")) {\n return \"https:\" + link;\n }\n return link;\n }", "title": "" }, { "docid": "b4461c89a0a856aa3175510e2e88c8f8", "score": "0.516271", "text": "function linkify(disease, db_id){\r\n var idls = db_id.split(',');\r\n var links = {};\r\n for (var i=0;i<idls.length;i++){\r\n var link = ''\r\n if(idls[i].startsWith('MedGen')){\r\n link = 'https://www.ncbi.nlm.nih.gov/medgen/'+idls[i].slice(idls[i].indexOf(':')+1);\r\n links.MedGen = link;\r\n }\r\n else if(idls[i].startsWith('OMIM')){\r\n link = 'https://www.omim.org/entry/'+idls[i].slice(idls[i].indexOf(':')+1);\r\n links.OMIM = link;\r\n }\r\n else if(idls[i].startsWith('EFO')){\r\n link = 'https://www.ebi.ac.uk/ols/ontologies/efo/terms?short_form='+idls[i].slice(idls[i].indexOf(':')+1).replace(' ','_');\r\n links.EFO = link;\r\n }\r\n else if(idls[i].startsWith('Human')){\r\n link = 'https://www.human-phenotype-ontology.org/hpoweb/showterm?id='+idls[i].slice(idls[i].indexOf(':')+1);\r\n links.HPO = link;\r\n }\r\n else if(idls[i].startsWith('Gene')){\r\n link = 'https://www.ncbi.nlm.nih.gov/gene/'+idls[i].slice(idls[i].indexOf(':')+1);\r\n links.Gene = link;\r\n }\r\n else if(idls[i].startsWith('Orphanet')){\r\n link = 'https://www.orpha.net/consor/cgi-bin/OC_Exp.php?lng=EN&Expert='+idls[i].slice(idls[i].indexOf(':')+6);\r\n links.Orphanet = link;\r\n }\r\n else if(idls[i].startsWith('MeSH')){\r\n link = 'https://meshb.nlm.nih.gov/record/ui?ui='+idls[i].slice(idls[i].indexOf(':')+1);\r\n links.MeSH = link;\r\n }\r\n else if(idls[i].startsWith('SNOMED')){\r\n link = 'https://browser.ihtsdotools.org/?perspective=full&conceptId1='+idls[i].slice(idls[i].indexOf(':')+1)+'&edition=en-edition&release=v20180731&server=https://browser.ihtsdotools.org/api/v1/snomed&langRefset=900000000000509007';\r\n links.SNOMED_CT = link;\r\n }\r\n }\r\n return disease_obj = {\r\n name: disease,\r\n refs: links\r\n };\r\n }", "title": "" }, { "docid": "b893ddadbddac59ca9aa25e3c935974c", "score": "0.51313555", "text": "function convertURL(str) {\r\n // Handle tmall world link\r\n if (contains(str, 'tmall.com'))\r\n return TMALL_URL + getID(str, ITEM_ID);\r\n\r\n // Handle Taobao links\r\n if (contains(str, M_INTL) || contains(str, H5)) {\r\n // Normal international or H5 app link\r\n return buildTaobaoURL(str, ITEM_ID, false)\r\n } else if (contains(str, WORLD)) {\r\n // world.taobao.com link\r\n if (contains(str, 'item')) {\r\n // World item\r\n return buildTaobaoURL(str, ITEM, false);\r\n } else {\r\n // World store\r\n var intermediate = str.replace('world.taobao.com', 'taobao.com');\r\n return cleanTaobaoStore(intermediate);\r\n }\r\n } else if (contains(str, SHOP_M)) {\r\n // Mobile shop with shop ID\r\n return buildTaobaoURL(str, SHOP_ID, true);\r\n } else if (!contains(str, 'item')) {\r\n // Clean the store link, remove any redundant information, and conevrt from mobile if relevant\r\n // str.replace('m.taobao.com', 'taobao.com'); // MOBILE STORE\r\n return cleanTaobaoStore(str);\r\n } else {\r\n // Already valid Taobao URL, canonacalise it\r\n return buildTaobaoURL(str, 'id=', false);\r\n }\r\n}", "title": "" }, { "docid": "b9ff71f1f8ec6ecb5ac29d219c21a76d", "score": "0.5124433", "text": "function linkURLs(element) {\n\tvar orig_str = element.value;\n\tif ( orig_str != \"\" ) { \n\t\tvar regexp_urlloc = /([^\\s]+\\.(com|org|net))/;\n\t\tvar ary_element_seg = regexp_urlloc.exec(orig_str);\n\t\tif ( ary_element_seg ) {\n\t\t\talert (ary_element_seg[1]);\n\t\t\tvar str_new = orig_str.replace(/\\s([^\\s]+\\.(com|org|net))/g,\" <A href=\\\"http://$1\\\">$1</A>\");\n\t\t\telement.value = str_new;\n\t\t}\n\t\telse alert (\"no match\");\n\t}\n}", "title": "" }, { "docid": "b7cba6b00993e7bb6cd30b78e5df7c6d", "score": "0.5113629", "text": "function correctURLs() {\n $('.product').each(function() {\n var orgLinks = $(this).attr('link'),\n newLinks = orgLinks.split(',');\n\n $(this).attr('link', newLinks[0]);\n });\n}", "title": "" }, { "docid": "01588148025a42bc447864ac4cf1f997", "score": "0.5107803", "text": "function generate_uri(input) {\n var output = input;\n var delimeter = '_';\n\n output = output.replace(/[^a-zA-Z0-9\\/_|+ -]/g, '');\n output = output.toLowerCase();\n output = output.replace(/[\\/_|+ -]+/g, delimeter);\n\n return output;\n}", "title": "" }, { "docid": "543b042de95b291a919402be02562565", "score": "0.5093419", "text": "function testDL(dl) {\n // First we want to test whether the given input is a URL or not.\n\n // Set up the a results object for testing whether what we have is a URL or not\n let isURL = Object.create(resultProps);\n isURL.id = 'isURL';\n isURL.test = 'Not listed as a conformance criterion but the DL URI must be a valid URL';\n isURL.msg = 'Given GS1 Digital Link URI is not a valid URL';\n recordResult(isURL);\n\n // While we're at it, we'll set up the results object for whether it's a valid DL URI or not\n let validDL = Object.create(resultProps);\n validDL.id = 'validDL';\n validDL.test = 'Given input must be a GS1 Digital Link URI';\n validDL.msg = 'Given input is not a valid GS1 Digital link URI, no further testing is possible';\n recordResult(validDL);\n\n // And whether it's using HTTPS or not\n let isHttps = Object.create(resultProps);\n isHttps.id = 'isHttps';\n isHttps.test = 'SHALL support HTTP Over TLS (HTTPS)';\n isHttps.msg = 'Given GS1 Digital Link URI uses a scheme other than HTTPS';\n isHttps.status = 'warn';\n recordResult(isHttps);\n\n // We will tolerate leading and training spaces but not spaces within the URL\n dl = dl.replace(/(^\\s+|\\s+$)/g, ''); // Remove leading and trailing spaces\n console.log('Given GS1 Digital Link URI is \"' + dl + '\"');\n let UriElements;\n let RabinRegEx = /^(([^:\\/?#]+):)?(\\/\\/((([^\\/?#]*)@)?([^\\/?#:]*)(:([^\\/?#]*))?))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\n // (see https://www.w3.org/TR/powder-grouping/#rabinsRegEx for the origin of this regex by Jo Rabin)\n\n // A couple of things we need to be portable...\n\n let domain; // We need this to be portable. Others below aren't needed outside the code block.\n let gs1dlt = new GS1DigitalLinkToolkit();\n\n if (UriElements = dl.match(RabinRegEx)) {\n // for (i in UriElements) {console.log('i is ' + i + ' which is ' + UriElements[i])}\n let scheme = UriElements[2];\n domain = UriElements[4];\n let port = UriElements[9];\n let path = UriElements[10];\n let query = UriElements[12];\n let frag = UriElements[14];\n if (((scheme == 'http') || (scheme == 'https')) && (domain.indexOf('.') != -1)) {\n isURL.msg = 'Given GS1 Digital Link URI is a valid URL';\n isURL.status = 'pass';\n recordResult(isURL);\n\n // At this point we probably have a URL and we have its various elements,\n // But we should check to see if it's a valid DL URL which we can do using the DL toolkit\n\n try {\n \t let gs1Array = gs1dlt.extractFromGS1digitalLink(dl); \n // You can get here with a variety of URLs including just a domain name and /gtin etc. So we need to check further\n // Object returned has a GS1 object within it. Test for that using Mark's code\n if (gs1dlt.buildStructuredArray(gs1Array.GS1).identifiers.length == 1) {\n validDL.status = 'pass';\n validDL.msg = 'Given input is a valid GS1 Digital Link URI';\n recordResult(validDL);\n }\n } catch(err) {\n \tconsole.log('Error when extracting keys from given DL. Message is ' + err); // Don't actually want to stop processing. validInputCheck.status is our flag for future processing\n }\n } // End is it a URL\n if (scheme == 'https') {\n isHttps.msg = 'Given GS1 Digital Link URI defines HTTPS as its scheme';\n isHttps.status = 'pass';\n recordResult(isHttps);\n }\n } // End is it a URI\n\n // We can only go beyond this point if we have a valid DL URI, so we test for that\n\n if (validDL.status == 'pass') {\n // We'll call a series of functions rather than putting everything here\n // They return an object that normally goes into the asynch fetch array\n\n TLSCheck(domain); // This one doesn't push to the array\n rdFileCheck(domain); // Nor this one\n\n testList.push(checkHttpVersion(domain));\n testList.push(headerBasedChecks(dl));\n testList.push(errorCodeChecks(dl));\n testList.push(trailingSlashCheck(dl));\n testList.push(compressionChecks(dl, domain, gs1dlt));\n testList.push(jsonTests(dl));\n testList.push(jsonLdTests(dl));\n testList.push(testQuery(dl));\n\n // Now we run all the fetch-based tests one after the other. Promise-based means they don't all happen at once.\n testList.reduce(\n (chain, d) => chain.then(() => runTest(d)).catch((error) => console.log('There has been a problem with your fetch operation for: ', error.message)),\n Promise.resolve()\n );\n } // End validDL.status=='pass'\n}", "title": "" }, { "docid": "f153238c9a5e7acd35887c69d9e8b9f2", "score": "0.508671", "text": "function getvrefstring(a)\n{\n try{\n var bk=-1,ch=0,vn=0,i,j,s=\"\",t,b,c,bk1=-2,ch1,vn1\n for(i=0;i<a.length;i++)\n {\n t=a[i]\n if((j=t.indexOf(\"-\"))!=-1)\n {\n c=t.substring(j+1)\n t=t.substring(0,j)\n }\n \n b=getvrefstring1(bk,ch,vn,t)\n if(s)s+=b[4]+\" \"\n bk=b[0];ch=b[1];vn=b[2];s+=b[3]\n \n if(j!=-1)\n {\n b=getvrefstring1(bk,ch,vn,c)\n bk=b[0];ch=b[1];vn=b[2];s+=\"-\"+b[3]\n }\n }\n return s\n }catch(e){ex(\"getvrefstring\",e)}\n}", "title": "" }, { "docid": "9390bcf915058acc9cab45bb088bfb3f", "score": "0.5085279", "text": "function URLify(str1) {\n let result = '';\n for (let i = 0; i < str1.length; i++) {\n if (str1[i] == ' ') {\n result += '20%';\n } else {\n result += str1[i];\n }\n }\n return result;\n}", "title": "" }, { "docid": "a26d081a94a90e4e33280cd3e6e5d180", "score": "0.50765324", "text": "function convert() {\r\n var url = gUrlBox.value;\r\n replaceImgUrl(url);\r\n if (url) {\r\n gLink.href = CHARTPLAY_URL + '?url=' + encodeURIComponent(url);\r\n }\r\n var query;\r\n var match = url.match(/(.*?)\\?(.*)/);\r\n if (match) {\r\n query = match[2];\r\n } else {\r\n query = url;\r\n }\r\n query = query.replace(/&[a-z]+=&/g, '&');\r\n query = query.replace(/%20/g, '+');\r\n query = query.replace(/%22/g, '\"');\r\n query = query.replace(/%27/g, \"'\");\r\n query = query.replace(/%2C/g, ',');\r\n query = query.replace(/%3A/g, ':');\r\n query = query.replace(/%3C/g, '<');\r\n query = query.replace(/%3E/g, '>');\r\n query = query.replace(/%5C/g, '\\\\');\r\n query = query.replace(/%7C/g, '|');\r\n var spec = query.replace(/ *& */g, '\\n');\r\n spec = spec.replace(/ *\\| */g, '\\n ');\r\n gSpecBox.value = spec;\r\n}", "title": "" }, { "docid": "8ca15abfcad6261d59741586396cc0ba", "score": "0.50585335", "text": "function uriFromObject(object) {\n var res = \"\";\n for (key in object) {\n res += encodeURIComponent(key) +\"=\"+ encodeURIComponent(object[key]) + \"&\";\n }\n return res;\n}", "title": "" }, { "docid": "f85f8ab1743d060139676cea870c0581", "score": "0.5038104", "text": "get href() { return encodeURI(stringAttribute$1.get(this, 'href')); }", "title": "" }, { "docid": "d7caa618676ad2555e104a6ab971828d", "score": "0.5036796", "text": "function convertNameToLink(){\r\n for (key in greenpeaceWebsites) {\r\n regex[key] = new RegExp(key, 'g');\r\n }\r\n\r\n textnodes = document.evaluate(\"//text()[not(ancestor::a)]\", //text() is key for all blocks of text. [not (ancestor::a)] restricts where it looks.\r\n document,\r\n null,\r\n XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, //results will be returned at random\r\n null);\r\n\r\n for (var i = 0; i < textnodes.snapshotLength; i++) {\r\n node = textnodes.snapshotItem(i);\r\n s = node.data;\r\n if (testON == 2){\r\n if((s.length > 10) && (i < 100)) {alert(\"Text Node #\" + i + \": \" + s)};\r\n };\r\n for (key in greenpeaceWebsites) {\r\n s = s.replace(regex[key], greenpeaceWebsites[key]);\r\n }\r\n count++;\r\n node.data = s;\r\n }\r\n if (testON == 1) alert(\"Total blocks of text: \" + count);\r\n}", "title": "" }, { "docid": "6ec3c2daddae23f421f6922d1b2cad55", "score": "0.50315243", "text": "function convertURL(str) {\n if (isTaobaoURL(str)) {\n\n if (contains(str, M_INTL) || contains(str, H5)) {\n // Normal international or H5 app link\n return buildTaobaoURL(str, ITEM_ID, false)\n } else if (contains(str, WORLD)) {\n // world.taobao.com link\n if (contains(str, 'item'))\n // World item\n return buildTaobaoURL(str, ITEM, false);\n else\n // World store\n return str.replace('world.taobao.com', 'taobao.com');\n } else if (contains(str, SHOP_M)) {\n // Mobile shop with shop ID\n return buildTaobaoURL(str, SHOP_ID, true);\n } else if (!contains(str, 'item')) {\n // Most mobile shops\n return str.replace('m.taobao.com', 'taobao.com');\n } else {\n // Already valid Taobao URL, canonacalise it\n return buildTaobaoURL(str, 'id=', false);\n }\n } else {\n return str;\n }\n}", "title": "" }, { "docid": "d29c3440d92b1dd36944d8e7a1e100df", "score": "0.5009842", "text": "function makeUrl() {\n let args = Array.from(arguments);\n return args.reduce(function (acc, cur) {\n return urljoin(acc, cur);\n });\n}", "title": "" }, { "docid": "cbe05d2f61f7353c88e9298a2850aaa6", "score": "0.50096816", "text": "function toUrlString(buffer) {\n return buffer.toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '');\n }", "title": "" }, { "docid": "85ea058436e6374a1cca9c89620063b2", "score": "0.5008066", "text": "function uriToUrl(uri) {\n const internal = 'internal:';\n if (uri.startsWith(internal)) {\n return uri.substring(internal.length);\n }\n return uri;\n}", "title": "" }, { "docid": "a2c50150a8376a27001c92c01471d28c", "score": "0.5001525", "text": "function createLink(verse){\n var gatewayLinkMain = \"https://www.biblegateway.com/passage/?search=\";\n link = gatewayLinkMain + verse + \"&version=NIV\";\n return link\n}", "title": "" }, { "docid": "2c8e3ce549056316fb482081d204aa22", "score": "0.50012815", "text": "function getURIInfo(arr){\n\t\t\t\t// make array of strings into domains\n\t\t\t\tfor (i in arr){\n\t\t\t\t\tarr[i] = extractDomain(arr[i]);\n\t\t\t\t}\n\n\t\t\t\t// make unique\n\t\t\t\tfor (i in arr){\n\t\t\t\t\tarr = Array.from(new Set(arr));\n\t\t\t\t}\n\n\t\t\t\treturn arr;\n\n\t\t\t\tfunction extractDomain(url) {\n\t\t\t\t var domain;\n\t\t\t\t //find & remove protocol (http, ftp, etc.) and get domain\n\t\t\t\t if (url.indexOf(\"://\") > -1) {\n\t\t\t\t domain = url.split('/')[2];\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t domain = url.split('/')[0];\n\t\t\t\t }\n\n\t\t\t\t //find & remove port number\n\t\t\t\t domain = domain.split(':')[0];\n\n\t\t\t\t return domain;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "1990187269fe6ab243fef3e76014346d", "score": "0.49942502", "text": "function urlobj(object) {\r\n\tvar strBuilder = [];\r\n\tfor (var key in object) if (object.hasOwnProperty(key)) {\r\n\t strBuilder.push(encodeURIComponent(key)+'='+encodeURIComponent(object[key]));\r\n\t}\r\n\treturn strBuilder.join('&');\r\n}", "title": "" }, { "docid": "5d0a55221602a47cb31482cbe2b599cf", "score": "0.49855307", "text": "function base64ToUrl(s) {\n return s.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/\\=+$/, '');\n}", "title": "" }, { "docid": "dd8b28a26def515addc1cd8822da5c5c", "score": "0.49847096", "text": "function create_uri (command, params, prefix, no_xml)\n{\n var params_str = prefix + \"cmd=\" + command;\n for (var prop_name in params)\n {\n if (!no_xml || prop_name != \"xml\")\n params_str = (params_str + \"&\" + prop_name\n + \"=\" + params[prop_name]);\n }\n params_str = params_str + \"&token=\" + gsa.gsa_token;\n return encodeURI (params_str);\n}", "title": "" }, { "docid": "9f2b16dc64c2d61463390e2bd9a41f5f", "score": "0.49846983", "text": "get href() { return encodeURI(stringAttribute.get(this, 'href')); }", "title": "" }, { "docid": "bcafbe95942854b8c4e8d5ea975e3b5b", "score": "0.4979537", "text": "mapOpenURLToGlutton(url) {\n url = decodeURIComponent((url + '').replace(/\\+/g, '%20'));\n var params = GluttonLinkInserter.getAllUrlParams(url);\n\n var newLink = '';\n var atitle = params['rft.atitle'];\n if (atitle) {\n newLink += '&atitle=' + atitle;\n }\n var jtitle = params['rft.jtitle'];\n if (jtitle) {\n newLink += '&jtitle=' + jtitle;\n }\n var aulast = params['rft.aulast'];\n if (aulast) {\n newLink += '&firstAuthor=' + aulast;\n }\n var volume = params['rft.volume'];\n if (volume) {\n newLink += '&volume=' + volume;\n }\n var firstPage = params['rft.pages'];\n // might be whole range of pages, and we want only first page\n if (firstPage) {\n newLink += '&firstPage=' + firstPage;\n }\n\n // note: not sure what happens when we have several identifiers\n var identifier = params['rft_id'];\n var doi;\n var pmid;\n var pii;\n if (identifier) {\n for (var i = 0; i < identifier.length; i++) {\n if (!identifier[i]) continue;\n if (identifier[i].indexOf('info:doi') != -1) {\n doi = identifier[i].replace('info:doi/', '');\n }\n if (identifier[i].indexOf('info:pmid') != -1) {\n pmid = identifier[i].replace('info:pmid/', '');\n }\n if (identifier[i].indexOf('info:pii') != -1) {\n pii = identifier[i].replace('info:pii/', '');\n }\n }\n }\n\n if (doi) {\n newLink += '&doi=' + doi;\n }\n if (pmid) {\n newLink += '&pmid=' + pmid;\n }\n if (pii) {\n newLink += '&pii=' + pii;\n }\n\n if (newLink && newLink.length > 0 && newLink[0] == '&') {\n newLink = newLink.substring(1);\n }\n newLink = 'lookup?' + newLink;\n\n return newLink;\n }", "title": "" }, { "docid": "670f5be9ac20869904e44e2f5ffe5e7b", "score": "0.49776846", "text": "buildGS1elementStrings(gs1AIarray, brackets) {\n // if brackets=true, use GS1 Digital Link ordering - identifier, qualifiers then data attributes in numeric order\n\n let identifiers = [];\n let qualifiers = [];\n let attributes = [];\n let fixedLengthValues = [];\n let variableLengthValues = [];\n let elementStrings = [];\n\n for (let a in gs1AIarray) {\n if (gs1AIarray.hasOwnProperty(a)) {\n if (this.aiMaps.identifiers.includes(a)) {\n identifiers.push(a);\n }\n if (this.aiMaps.qualifiers.includes(a)) {\n qualifiers.push(a);\n }\n if (this.aiMaps.dataAttributes.includes(a)) {\n attributes.push(a);\n }\n if (this.aiMaps.fixedLength.includes(a)) {\n fixedLengthValues.push(a);\n }\n if (this.aiMaps.variableLength.includes(a)) {\n variableLengthValues.push(a);\n }\n }\n }\n\n if (brackets == true) {\n if (identifiers.length !== 1) {\n throw new Error(\n 'The associative array should contain exactly one primary identification key - it contained ' +\n identifiers.length +\n ' ' +\n JSON.stringify(identifiers) +\n '; please check for a syntax error',\n );\n } else {\n this.verifySyntax(identifiers[0], gs1AIarray[identifiers[0]]);\n this.verifyCheckDigit(identifiers[0], gs1AIarray[identifiers[0]]);\n\n elementStrings = elementStringsPush(elementStrings, '(' + identifiers[0] + ')', gs1AIarray[identifiers[0]], '');\n\n // append any valid found qualifiers for that primary identifier to the elementStrings array\n\n if (this.aiQualifiers.hasOwnProperty(identifiers[0])) {\n let qualifiersForPrimary = this.aiQualifiers[identifiers[0]];\n\n for (let qindex in qualifiersForPrimary) {\n if (qualifiers.indexOf(qualifiersForPrimary[qindex]) > -1) {\n elementStrings = elementStringsPush(elementStrings, '(' + qualifiersForPrimary[qindex] + ')', gs1AIarray[qualifiersForPrimary[qindex]], '');\n }\n }\n }\n\n // append any found attributes to the elementStrings array\n let sortedAttributes = attributes.sort();\n for (let a in sortedAttributes) {\n elementStrings = elementStringsPush(elementStrings, '(' + attributes[a] + ')', gs1AIarray[attributes[a]], '');\n }\n }\n } else {\n // if brackets=false, concatenate defined-length AIs first, then variable-length AIs\n // identify which AIs in gs1AIarray are defined fixed length\n\n let fixedLengthPrimaryIdentifier = [];\n let fixedLengthValuesOther = fixedLengthValues.slice(0);\n for (let i in fixedLengthValuesOther) {\n if (identifiers.indexOf(fixedLengthValuesOther[i]) > -1) {\n fixedLengthPrimaryIdentifier.push(fixedLengthValuesOther[i]);\n fixedLengthValuesOther.splice(i, 1);\n }\n }\n\n for (let i in fixedLengthPrimaryIdentifier) {\n elementStrings = elementStringsPush(elementStrings, fixedLengthPrimaryIdentifier[i], gs1AIarray[fixedLengthPrimaryIdentifier[i]], '');\n }\n\n for (let i in fixedLengthValuesOther) {\n elementStrings = elementStringsPush(elementStrings, fixedLengthValuesOther[i], gs1AIarray[fixedLengthValuesOther[i]], '');\n }\n\n for (let i in variableLengthValues) {\n let gs = '';\n if (i < variableLengthValues.length - 1) {\n gs = this.groupSeparator;\n }\n elementStrings = elementStringsPush(elementStrings, variableLengthValues[i], gs1AIarray[variableLengthValues[i]], gs);\n }\n }\n\n return elementStrings.join('');\n\n function elementStringsPush(elementStrings, ai, value, gs) {\n let newvalue = value;\n // always pad the value of any GTIN [ AI (01) or (02) ] to 14 digits in element string representation\n if (ai == '01' || ai == '(01)' || ai == '02' || ai == '(02)') {\n if (value.length == 8) {\n newvalue = '000000' + value;\n }\n if (value.length == 12) {\n newvalue = '00' + value;\n }\n if (value.length == 13) {\n newvalue = '0' + value;\n }\n }\n elementStrings.push(ai + newvalue + gs);\n return elementStrings;\n }\n }", "title": "" }, { "docid": "857b5118bf5c88b42cc7a1a50d28d0eb", "score": "0.49650297", "text": "function escapeSkotosLink(s)\n{\n /*\n * we can't use regexp replace here, because we will overwrite\n * the global RegExp object with new regexp results.\n */\n var len = s.length;\n var res = \"\";\n var seq = 0;\n for (var i = 0; i < len; i++) {\n /*\n * We actually have to unescape HTML entities and crap. And there's no built-ins for\n * that in JS. Yay.\n */\n if (s.substr(i, 6) == \"&quot;\") {\n res += s.substring(seq, i) + \"\\\\\\\"\";\n seq = i+6;\n }\n else if (s.substr(i, 4) == \"&lt;\") {\n res += s.substring(seq, i) + \"<\";\n seq = i+4;\n }\n else if (s.substr(i, 4) == \"&gt;\") {\n res += s.substring(seq, i) + \">\";\n seq = i+4;\n }\n else if (s.substr(i, 5) == \"&amp;\") {\n res += s.substring(seq, i) + \"&\";\n seq = i+5;\n }\n }\n return res + s.substring(seq);\n}", "title": "" }, { "docid": "d1d9061b6c05d6fd0615e3c2b9b0e1dd", "score": "0.49628955", "text": "function encodeUriSegment(s) {\n return encodeUriString(s).replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/%26/gi, '&');\n }", "title": "" }, { "docid": "e68bbb464cb7fc7b5ecd2fb4a95940cb", "score": "0.49588785", "text": "function createUrl(pd) { \n \n var url = 'http://www.geni.com/search?search_type=people&names=';\n \n var name = \"\";\n \n if( pd.givenName ) {\n name += pd.givenName;\n }\n if( pd.familyName ) {\n if( name ) {\n name += \" \";\n }\n name += pd.familyName;\n }\n \n // Replace spaces with +\n name = name.replace(/ /g, '+');\n \n return url + name;\n }", "title": "" }, { "docid": "49ed82d2f64917c866d296fbe7332b9b", "score": "0.49588406", "text": "function encodeUriSegment(val) {\n\t return encodeUriQuery(val, true).replace(/%26/gi, '&').replace(/%3D/gi, '=').replace(/%2B/gi, '+');\n\t }", "title": "" }, { "docid": "5944246354f6fa8d6cb00918e6fb8ba5", "score": "0.49534672", "text": "function link(node) {\n var self = this\n var content = self.encode(node.url || '', node)\n var exit = self.enterLink()\n var value = self.all(node).join('')\n\n exit()\n\n content = uri(content)\n\n if (node.title) {\n content += space + title(self.encode(self.escape(node.title, node), node))\n }\n\n return (\n leftSquareBracket +\n value +\n rightSquareBracket +\n leftParenthesis +\n content +\n rightParenthesis\n )\n}", "title": "" }, { "docid": "3b03a74c5e4ae61f33bf36949e5548fc", "score": "0.49454704", "text": "function encodeUriString(s) {\n return encodeURIComponent(s).replace(/%40/g, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',');\n }", "title": "" }, { "docid": "e2293fd39aabc088052113398e252ad9", "score": "0.49437714", "text": "getLinkURL() {\n var href = this.link.href;\n if (href) {\n return href;\n }\n\n href = this.link.getAttributeNS(\"http://www.w3.org/1999/xlink\", \"href\");\n\n if (!href || href.trim() == \"\") {\n // Without this we try to save as the current doc,\n // for example, HTML case also throws if empty\n throw new Error(\"Empty href\");\n }\n\n return makeURLAbsolute(this.link.baseURI, href);\n }", "title": "" }, { "docid": "253e3ae4c4a0aaef3b6b900103a93c97", "score": "0.4941439", "text": "function simplifyUri(uri) {\n let parts = uri.split(\"/\");\n return parts[parts.length-1].replace(\".xml\",\"\");\n }", "title": "" }, { "docid": "253e3ae4c4a0aaef3b6b900103a93c97", "score": "0.4941439", "text": "function simplifyUri(uri) {\n let parts = uri.split(\"/\");\n return parts[parts.length-1].replace(\".xml\",\"\");\n }", "title": "" }, { "docid": "71240461b762da9f4e26c6415e4c16e4", "score": "0.4940385", "text": "function urlify(data) {\n const mdLinkRgEx = /\\[(.+?)\\]\\(.+?\\)/g;\n const mdLinkRgEx2 = /\\[(.+?)\\]\\((.+?)\\)/;\n let allLinks = data.match(mdLinkRgEx);\n let htmlLinks = [];\n for (var x in allLinks) {\n var grpdDta = mdLinkRgEx2.exec(allLinks[x]);\n var grupoData = {\n href: grpdDta[2],\n text: grpdDta[1],\n file: pathfile\n }; \n htmlLinks.push(grupoData); \n }\n console.log(htmlLinks.length);\n console.log(htmlLinks);\n return (htmlLinks);\n \n}", "title": "" }, { "docid": "0fbae2df4df1bc8fb16b7ca313bcb0cb", "score": "0.49355814", "text": "function urlEncodeParts(uri) {\n\t // Normalize and join, split, encode, then join.\n\t uri = urljoin(uri);\n\t var parts = uri.split('/').map(encodeURIComponent);\n\t return urljoin.apply(void 0, parts);\n\t}", "title": "" }, { "docid": "daefa6b083b3cf6629e684aafbf1a358", "score": "0.49274704", "text": "function p09_ExtractLinks(input) {\r\n input = input.reduce((a, b) => a.concat(' ' + b));\r\n let pattern = /(www)\\.([A-Za-z0-9-]+)(\\.[a-z]+)+/g;\r\n let result = input.match(pattern);\r\n if (result != undefined) {\r\n console.log(result.join('\\n'));\r\n }\r\n else {\r\n console.log('undefined');\r\n }\r\n}", "title": "" }, { "docid": "cfce53daf78c0ed2fe4b9bbc012cdd65", "score": "0.4925867", "text": "function URLifyFunctional(s){\n let copy = \"\";\n for(let i = 0; i< s.length; i++){\n if(s.charAt(i) === \" \" ) copy+= \"%20\";\n else copy+= s.charAt(i)\n } \n return copy;\n}", "title": "" }, { "docid": "de8068eb451bd3c599b44d148e9b653e", "score": "0.492534", "text": "function formatEthAdr(adr){\r\n\tvar _smallAdr = adr.substring(0, 10);\r\n\tvar _stringLink = '<a href=\"https://etherscan.io/address/' + adr + '\" target=\"_blank\">' + _smallAdr + '</a>';\r\n\treturn _stringLink;\r\n}", "title": "" }, { "docid": "57da64eaf016f070c3cb66d8ac5bf4c7", "score": "0.49196336", "text": "function makeLink(s, types) {\n const matchedType = types.filter(aType => aType.name === s);\n const tString = ` \\`${s}\\``;\n if (matchedType.length === 1) {\n return `[${tString}](http://${ReferenceLink})`.replace(\n 'NAME',\n matchedType[0].name,\n );\n } else {\n return tString;\n }\n}", "title": "" }, { "docid": "b4af58e3e8847e9f5bd1581d8d448ad6", "score": "0.49172726", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).replace(/%26/gi, '&').replace(/%3D/gi, '=').replace(/%2B/gi, '+');\n }", "title": "" }, { "docid": "b4af58e3e8847e9f5bd1581d8d448ad6", "score": "0.49172726", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).replace(/%26/gi, '&').replace(/%3D/gi, '=').replace(/%2B/gi, '+');\n }", "title": "" }, { "docid": "4745ecad5cd9eb4c507f05674170e2c2", "score": "0.490637", "text": "function getlist(host, str) {\n var lst = [];\n var i, j, k;\n i = str.indexOf(patns[1]);\n while(i > 0) {\n k = str.substr(0,i).lastIndexOf('href=');\n j = str.substr(k).indexOf('\"') + k + 1;\n k = str.substr(j).indexOf('\"');\n var url =\"https://\" + host + str.substr(j, k);\n str = str.substr(i+patns[1].length);\n k = str.indexOf('<');\n var til = str.substr(0, k);\n var tmp = { link: url, title: til }\n j = str.indexOf(patns[2]);\n k = str.substr(0,j).indexOf(patns[3]);\n if (k >=0) {\n str = str.substr(k+patns[3].length+1);\n j = str.indexOf('\"');\n tmp['label'] = str.substr(0,j);\n }\n lst.push(tmp);\n i = str.indexOf(patns[1]);\n }\n return lst;\n}", "title": "" }, { "docid": "6513ec2d80a1cdbb32e7b9aa78a10306", "score": "0.49031794", "text": "function genFullLink(muhURL, muhProto, tinfoil) {\n // Start link with an empty string since beginning of it depends\n // on the values of 'muhProto' and 'tinfoil'\n var linkPreface = '';\n \n // Format of link depends on protocol\n switch(muhProto) {\n // HTTP protocol (regular and secure)\n case 'http':\n // if 'tinfoil' is true, use https. if not, use plain http\n linkPreface = (tinfoil ? 'https' : 'http') + '://';\n break;\n // Internal Mozilla pages\n case 'about':\n linkPreface = 'about:';\n break;\n // Internal Chrome pages\n case 'chrome':\n linkPreface = 'chrome://';\n break;\n // Other protocols produce error message through alert\n default:\n error_p = true;\n error_m = \"Protocol \" + muhProto + \" not recognized!\";\n }\n \n // Return fully-formed link\n return linkPreface + muhURL;\n }", "title": "" }, { "docid": "34f0821a12411dc7fee7922156fa8a8b", "score": "0.4902964", "text": "function articleBaseUrl$1(url,parsed){var parsedUrl=parsed||URL$1.parse(url);var protocol=parsedUrl.protocol,host=parsedUrl.host,path=parsedUrl.path;var firstSegmentHasLetters=false;var cleanedSegments=path.split('/').reverse().reduce(function(acc,rawSegment,index){var segment=rawSegment;// Split off and save anything that looks like a file type.\nif(segment.includes('.')){var _segment$split=segment.split('.'),_segment$split2=_slicedToArray$1(_segment$split,2),possibleSegment=_segment$split2[0],fileExt=_segment$split2[1];if(IS_ALPHA_RE$1.test(fileExt)){segment=possibleSegment;}}// If our first or second segment has anything looking like a page\n// number, remove it.\nif(PAGE_IN_HREF_RE$1.test(segment)&&index<2){segment=segment.replace(PAGE_IN_HREF_RE$1,'');}// If we're on the first segment, check to see if we have any\n// characters in it. The first segment is actually the last bit of\n// the URL, and this will be helpful to determine if we're on a URL\n// segment that looks like \"/2/\" for example.\nif(index===0){firstSegmentHasLetters=HAS_ALPHA_RE$1.test(segment);}// If it's not marked for deletion, push it to cleaned_segments.\nif(isGoodSegment$1(segment,index,firstSegmentHasLetters)){acc.push(segment);}return acc;},[]);return protocol+'//'+host+cleanedSegments.reverse().join('/');}// Given a string, return True if it appears to have an ending sentence", "title": "" }, { "docid": "58474513a2494375047c2aa41b84bd16", "score": "0.49018008", "text": "entryToHref(entryNames, entryToHref) {\n const result = [];\n entryNames.forEach(elem => {\n const res = entryToHref(elem);\n if (res) {\n result.push(res);\n }\n });\n return result;\n }", "title": "" }, { "docid": "06451b5b0187e0e555e1de6b1a1ee780", "score": "0.48993713", "text": "function makeURIEncoded(article_name) {\n\n return article_name.replace(/\\\\/g, \"\")\n .replace(/[!'()*]/g, escape)\n}", "title": "" }, { "docid": "6b6dded4f9eeb0f99fbd8861a0faf237", "score": "0.4891339", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).replace(/%26/gi, '&').replace(/%3D/gi, '=').replace(/%2B/gi, '+');\n }", "title": "" }, { "docid": "918aecf8f3fc9c5bbe1107e894059ddf", "score": "0.48863247", "text": "createURI() { \n\t\tlet URI = \"\";\n\t\tURI = URI + this.getURIEnvironment(); //add environment to URI\n\t\tURI = URI + this.getURIDomain(); // add domain to URI\n\t\tswitch(this.getURIModule()) { //Determine which endpoint and view to use based on module\n\t\t\tcase \"catalog\":\n\t\t\tcase \"category\":\n\t\t\tcase \"series\":\n\t\t\tcase \"division\":\n\t\t\tcase \"imprint\":\n\t\t\t\tURI = URI + \"/works/views/sales-display?\" + this.getURIModuleParameters();\n\t\t\t\tthis.setURIService(\"sales-display\")\n\t\t\t\tbreak; \n\t\t\tcase \"bookDetail\":\n\t\t\t\tURI = URI + /titles/ + this.getURIParameters() + \"/views/product-display?\";\n\t\t\t\tthis.setURIService(\"product-display\")\n\t\t\t\tbreak;\n\t\t\tcase \"dynamicCarousel\":\n\t\t\t\tURI = URI + \"/titles?\";\n\t\t\t\tthis.setURIService(\"listTitles\")\n\t\t\t\tbreak;\n\t\t}\n\t\tURI = URI + this.getURIParameters(); \n\t\tURI = URI + \"&api_key=\" + this.getURIAPIKey(); \n\t\tURI = URI + this.getURISortParameters();\n\t\tURI = URI + \"&siteFilter=\" + this.getURISiteParameters();\n\t\t//add multiple filters to uri\n\t\tlet filters = this.getURIFilter();\n\t\tlet filterParamString = this.getURIFilterParameters();\n\t\tconst filterParams = filterParamString.split(\" \"); \n\t\tlet filterLength = Math.min(filters.length, filterParams.length);\n\t\tfor (let i = 0; i < filterLength; i++){\n\t\t\tURI = URI + filters[i] + filterParams[i];\n\t\t}\n\t\tURI = URI + \"&rows=\" + this.getURIRows();\n\t\tthis.setURI(URI);\n\t\treturn URI; \n\t}", "title": "" }, { "docid": "9cbacf9f7a6ed03916d2f4d8be21b67d", "score": "0.48837358", "text": "static makeURI(uri) {\n return _core__WEBPACK_IMPORTED_MODULE_0__[\"Grammar\"].URIParse(uri);\n }", "title": "" }, { "docid": "9e2560390eee33441b81737ff1ddad61", "score": "0.48810288", "text": "function convertEntity(entity){switch(entity[0]){case'\"':{if(entity.indexOf(\"^^\")>0){var parts=entity.split(\"^^\");return{literal:parts[0]+\"^^<\"+parts[1]+\">\"};}else{return{literal:entity};}}case'_':return{blank:entity.replace('b','')};default:return{token:'uri',value:entity,prefix:null,suffix:null};}}", "title": "" }, { "docid": "b04268144d0f4f3bc5d354ed699f9ebe", "score": "0.48787162", "text": "function formatCompassInfoString(link, short){\n\t\tvar line = link.line,\n\t\t\thref = link.href,\n\t\t\tcompassInfo,\n\t\t\tcache = FireCompass.CACHE,\n\t\t\tstr, filename;\n\t\t\n\t\tif (!cache[href] || !cache[href].compassInfoMap[line]) {\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\t// Get previously cached compass info by href and line\n\t\tcompassInfo = cache[href].compassInfoMap[line];\n\t\t\n\t\tif (short) {\n\t\t\t// get filename part and shorten string (if too long)\n\t\t\tfilename = compassInfo.path;\n\t\t\tfilename = filename.substring(filename.lastIndexOf(\"/\") + 1);\n\t\t\tfilename = decodeURIComponent(filename);\n\t\t\tfilename = FBL.cropString(filename, 17);\n\t\t\t\n\t\t\t// If it's a Compass internal file return with brackets around the name\n\t\t\t//\tCompass: [reset.scss]\n\t\t\t//\tNormal: _wizard.scss\n\t\t\tfilename = compassInfo.isCompassInternal ? \"[\"+ filename +\"] \" : filename;\n\t\t\t\n\t\t\t// TODO Maybe make the link italic if Compass internal?\n\t\t\t\n\t\t\tstr = FBL.$STRF(\"Line\", [filename, compassInfo.line]);\n\t\t} else {\n\t\t\t// If it's a Compass internal file, prefix with [Compass]\n\t\t\tstr = (compassInfo.isCompassInternal ? \"[Compass] \" : \"\");\n\t\t\tstr += FBL.$STRF(\"Line\", [compassInfo.path, compassInfo.line]);\n\t\t}\n\t\t\n\t\treturn str;\n\t}", "title": "" }, { "docid": "ce1d616ee3d70903803619ead1a75ad2", "score": "0.48752204", "text": "function getGoogleStartAddress() {\r\n line1 = document.getElementById('sxaddr').childNodes[0].innerHTML;\r\n line1 = [line1.replace(/ /g, '+')];\r\n line2 = document.getElementById('sxaddr').childNodes[1].innerHTML;\r\n line2 = line2.replace(/,/, '').split(' ');\r\n return line1.concat(line2);\r\n}", "title": "" }, { "docid": "275ef467a28097cccc777ee7b41122d4", "score": "0.48723516", "text": "function parse_URLMoniker(blob) {\n var len = blob.read_shift(4),\n start = blob.l;\n var extra = false;\n\n if (len > 24) {\n /* look ahead */\n blob.l += len - 24;\n if (blob.read_shift(16) === \"795881f43b1d7f48af2c825dc4852763\") extra = true;\n blob.l = start;\n }\n\n var url = blob.read_shift((extra ? len - 24 : len) >> 1, 'utf16le').replace(chr0, \"\");\n if (extra) blob.l += 24;\n return url;\n }", "title": "" }, { "docid": "8d766a1abee88aa380ab4b01674863a5", "score": "0.4866642", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "title": "" }, { "docid": "c65e99b5eedef4247413241800534684", "score": "0.48635352", "text": "function buildUrl() {\r\n\t\tvar current = document.getElementById('current-entry');\r\n\t\tvar title = document.evaluate(\"//div[@id='current-entry']/div[@class='entry-container']/div[@class='entry-main']/h2[@class='entry-title']/a[@class='entry-title-link']\",\r\n\t\t\tdocument,\r\n\t\t\tnull,\r\n\t\t\tXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,\r\n\t\t\tnull);\r\n\t\t\t\t\r\n\t\t\tif (title.snapshotLength == 1) { // && deliciousUser != 'post') {\r\n\t\t\tvar link = title.snapshotItem(0);\r\n\t\t\treturn 'http://del.icio.us/post?v=4&url=' + encodeURIComponent(link.href) + '&title=' + encodeURIComponent(link.childNodes[0].nodeValue);\r\n\t\t}\r\n\t\treturn 'http://del.icio.us/post/';\r\n\t}", "title": "" }, { "docid": "f73c18f52da458bc25569d8de9d3d133", "score": "0.48578888", "text": "function makeUrlFromSemantic(semantic){\n // We should probably build a tree and traverse it in postorder. But screw that, this works too.\n return semantic.match(/[a-zA-Z0-9\\-]+/g).reverse().join(\"/\")\n}", "title": "" }, { "docid": "6f7815ba9e723066a8014302d7a47655", "score": "0.4856771", "text": "function encodeUriSegment(val) {\n\t\treturn encodeUriQuery(val, true).\n\t\treplace(/%26/gi, '&').\n\t\treplace(/%3D/gi, '=').\n\t\treplace(/%2B/gi, '+');\n\t}", "title": "" }, { "docid": "76c3a71a7de39f0c17b8d97f8967eda3", "score": "0.4856658", "text": "function linkifylinkify(body) {\n let words = body.split('\\n'); // assumes URL is on its own line\n\n for(let i=0; i<words.length; i++) {\n // alert(words[i].slice(0,4));\n if(words[i].slice(0,4) === `http`) {\n words[i] = `<a href=\"${words[i]}\">${words[i]}</a>`;\n }\n }\n return words.join(`<br />`);\n}", "title": "" }, { "docid": "2e0186421703697f9986f239257dbb5d", "score": "0.48546875", "text": "function getLink(message){\n let url = message.substring(3);\n return url\n}", "title": "" }, { "docid": "751f67e7b51d0589dfda5fb4c1177876", "score": "0.48531252", "text": "function getLink() {\n var endpointUrl = 'https://dbpedia.org/sparql';\n var sparqlQuery = \"SELECT ?url ?description WHERE {?id rdfs:label \\\"Oakeshott typology\\\"@en;foaf:isPrimaryTopicOf ?url; dbo:abstract ?description.FILTER(LANG(?description) = \\\"en\\\").}\";\n makeSPARQLQuery(endpointUrl, sparqlQuery, function (data) {\n $(\"#link\").prop(\"href\", data.results.bindings[0].url.value);\n $(\"#description\").append(data.results.bindings[0].description.value);\n });\n}", "title": "" }, { "docid": "f36a5d18e95d2fb8037507dec219e273", "score": "0.48429593", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "title": "" }, { "docid": "f36a5d18e95d2fb8037507dec219e273", "score": "0.48429593", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "title": "" }, { "docid": "f36a5d18e95d2fb8037507dec219e273", "score": "0.48429593", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "title": "" }, { "docid": "f36a5d18e95d2fb8037507dec219e273", "score": "0.48429593", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "title": "" }, { "docid": "f36a5d18e95d2fb8037507dec219e273", "score": "0.48429593", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "title": "" }, { "docid": "f36a5d18e95d2fb8037507dec219e273", "score": "0.48429593", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "title": "" }, { "docid": "f36a5d18e95d2fb8037507dec219e273", "score": "0.48429593", "text": "function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }", "title": "" } ]
25f22fa971a14771af1d377d5d8c1526
function XXX / void
[ { "docid": "02379f451484db3f50d7a919ee9e9170", "score": "0.0", "text": "function gen_op_neon_shl_s8()\n{\n gen_opc_ptr.push({func:op_neon_shl_s8});\n}", "title": "" } ]
[ { "docid": "23206452bcbb211ca59f6bd6fc217806", "score": "0.77432454", "text": "function fn() {\n\t\t }", "title": "" }, { "docid": "a4d8363407e3af52c557dca4455e48ef", "score": "0.76703453", "text": "function miFuncion (){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.7607833", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.7607833", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.7607833", "text": "function miFuncion(){}", "title": "" }, { "docid": "24f2453e25866b8c6160f7317764d2e8", "score": "0.7236305", "text": "function fun() { }", "title": "" }, { "docid": "71f7c2264245accffacd4a9cfc194713", "score": "0.7105027", "text": "function fuction() {\n\n}", "title": "" }, { "docid": "b58939bef8483458b69110907e830f52", "score": "0.7103109", "text": "function miFuncion(){\n\n}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.697615", "text": "function dummy(){}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.697615", "text": "function dummy(){}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.697615", "text": "function dummy(){}", "title": "" }, { "docid": "c0c010faf8b66062876d14ea2a0371e8", "score": "0.68555987", "text": "function blabla() {\n\n}", "title": "" }, { "docid": "5412cbec186d84761f7c0bb74ddbad34", "score": "0.6800703", "text": "function __func(){}", "title": "" }, { "docid": "ac80bee1092741b4ace2b1d61cdeff0f", "score": "0.6789331", "text": "function do_nothing(){\n\n}", "title": "" }, { "docid": "2f8ee2d48eb18737e173a5df204b6e04", "score": "0.67773557", "text": "function wa(){}", "title": "" }, { "docid": "4c038830223206cfc169741da7b6109b", "score": "0.6746858", "text": "function fuctionPanier(){\n\n}", "title": "" }, { "docid": "d226c7579de02bf4f64ce013efb3d5bf", "score": "0.6744292", "text": "method(){}", "title": "" }, { "docid": "73bbe87315ea8821865f9f6ed2fd9d75", "score": "0.6741563", "text": "function func(){\r\n\r\n}", "title": "" }, { "docid": "51f5316cb122f90c0f65f49d6d795d27", "score": "0.67225444", "text": "function doStuff() {}", "title": "" }, { "docid": "49ff90f8ddf046cc74807fd30bbdf79c", "score": "0.671191", "text": "function doStuff(){\n\n}", "title": "" }, { "docid": "14426f048d425640a3ff54932e6bb862", "score": "0.6695983", "text": "function fun1( /*parametros opcionais*/ ){ /*retorno opcional*/ }", "title": "" }, { "docid": "0e70789cb3456f896e28f233cb1b42fe", "score": "0.6685686", "text": "function fun1(){}", "title": "" }, { "docid": "0e70789cb3456f896e28f233cb1b42fe", "score": "0.6685686", "text": "function fun1(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.66780466", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.66780466", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.66780466", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.66780466", "text": "function ba(){}", "title": "" }, { "docid": "e34a6ca6184a1d1dbe1889b20f1515e2", "score": "0.66680884", "text": "function fn() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.6638762", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.6638762", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.6638762", "text": "function dummy() {}", "title": "" }, { "docid": "3571ace4182524975843e7502d270ef9", "score": "0.6625183", "text": "function doThings(){\n//things\n}", "title": "" }, { "docid": "8d1811fe5c65a4d6e44fbca2f6e3222c", "score": "0.6607184", "text": "function doSomething() {}", "title": "" }, { "docid": "fae9b0306e0c028d6653874e150ddee5", "score": "0.65971434", "text": "function foo() {...}", "title": "" }, { "docid": "f0df6db6fd6c7efc1d90330c01e7319b", "score": "0.65961", "text": "function do_nothing() {\n}", "title": "" }, { "docid": "36452c4f2cf16681fa4284d05fe90a66", "score": "0.6594145", "text": "function fun1 ( ) {}", "title": "" }, { "docid": "6b27bef00d7aa9a6d94452e8383d1e86", "score": "0.6551582", "text": "function fm(){}", "title": "" }, { "docid": "a587e016a3cb244299bad480de6a2b3d", "score": "0.6549842", "text": "function doOtherStuff() {}", "title": "" }, { "docid": "2d8b4b524cf494a8c24a79932e4fb5ec", "score": "0.6548182", "text": "function fun1( ) { }", "title": "" }, { "docid": "87fc1b21d7167a50e4735488793f9eae", "score": "0.654425", "text": "function foo(){}", "title": "" }, { "docid": "87fc1b21d7167a50e4735488793f9eae", "score": "0.654425", "text": "function foo(){}", "title": "" }, { "docid": "e708f6cc8a6a1a7ffeb560e0c290395d", "score": "0.652323", "text": "function ea(){}", "title": "" }, { "docid": "b0c60b9001e9d7af0cf564de00490324", "score": "0.6514827", "text": "function lalalala() {\n\n}", "title": "" }, { "docid": "6bb4fcb2d8d60966bcb0720621c94a4b", "score": "0.6490766", "text": "function someFunction(){\n // do something here...\n}", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.6484855", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.6484855", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.6484855", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.6484855", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.6484855", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.6484855", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.6484855", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "53cb5b11086809c484e61c5692161780", "score": "0.64842236", "text": "function Func_s() {\n}", "title": "" }, { "docid": "18c3fe2e22928972efbd9500ff540dc0", "score": "0.6459841", "text": "function foo(x: void) { }", "title": "" }, { "docid": "fc82f84fd29a17942fd1b85fe66f5569", "score": "0.64412695", "text": "function foo() {\r\n}", "title": "" }, { "docid": "c2c43fbe5d3f77d1fa47bfc72bf92834", "score": "0.6437666", "text": "function Scdr() {\r\n}", "title": "" }, { "docid": "cbf0719cef2f07f88b1f4a13ce7df4c7", "score": "0.64360625", "text": "function doCoolStuff(){\n // do cool stuff\n }", "title": "" }, { "docid": "01c85619d5f162a80741b3d4cba50514", "score": "0.6426827", "text": "function fun1() { }", "title": "" }, { "docid": "01c85619d5f162a80741b3d4cba50514", "score": "0.6426827", "text": "function fun1() { }", "title": "" }, { "docid": "01c85619d5f162a80741b3d4cba50514", "score": "0.6426827", "text": "function fun1() { }", "title": "" }, { "docid": "01c85619d5f162a80741b3d4cba50514", "score": "0.6426827", "text": "function fun1() { }", "title": "" }, { "docid": "01c85619d5f162a80741b3d4cba50514", "score": "0.6426827", "text": "function fun1() { }", "title": "" }, { "docid": "01c85619d5f162a80741b3d4cba50514", "score": "0.6426827", "text": "function fun1() { }", "title": "" }, { "docid": "01c85619d5f162a80741b3d4cba50514", "score": "0.6426827", "text": "function fun1() { }", "title": "" }, { "docid": "01c85619d5f162a80741b3d4cba50514", "score": "0.6426827", "text": "function fun1() { }", "title": "" }, { "docid": "3d41b64138c736483e7b067751fc1f41", "score": "0.6407982", "text": "function oi(){}", "title": "" }, { "docid": "eae11327eb4a8c3d9b49145c737d2b37", "score": "0.6404977", "text": "function hello() {\r\n // do something...\r\n}", "title": "" }, { "docid": "ad9ea4b8917de19779c67be4bafa7feb", "score": "0.64043903", "text": "function fun1(){ }", "title": "" }, { "docid": "ad9ea4b8917de19779c67be4bafa7feb", "score": "0.64043903", "text": "function fun1(){ }", "title": "" }, { "docid": "32c2f741645046dc2680a7c41830c224", "score": "0.64024776", "text": "function va(t,e){0}", "title": "" }, { "docid": "c91b46dd41bd2084f23b32fe9f0c79f3", "score": "0.64014965", "text": "function one(){\n \n}", "title": "" }, { "docid": "79867565c3ab8063e8bad5b679e1fefb", "score": "0.6380508", "text": "function fun1() {}", "title": "" }, { "docid": "79867565c3ab8063e8bad5b679e1fefb", "score": "0.6380508", "text": "function fun1() {}", "title": "" }, { "docid": "b6b751b5d50277b8d7294f8b45c1e2b2", "score": "0.6378577", "text": "function doNothing()\n{\n}", "title": "" }, { "docid": "cb99852578823cc4d3211c7f905e822c", "score": "0.6378077", "text": "function Ha(){}", "title": "" }, { "docid": "ad063f99758dd2805eafd6aca92540ef", "score": "0.6376497", "text": "function doNothing() {}", "title": "" }, { "docid": "ad063f99758dd2805eafd6aca92540ef", "score": "0.6376497", "text": "function doNothing() {}", "title": "" }, { "docid": "ad063f99758dd2805eafd6aca92540ef", "score": "0.6376497", "text": "function doNothing() {}", "title": "" }, { "docid": "ad063f99758dd2805eafd6aca92540ef", "score": "0.6376497", "text": "function doNothing() {}", "title": "" }, { "docid": "ad063f99758dd2805eafd6aca92540ef", "score": "0.6376497", "text": "function doNothing() {}", "title": "" }, { "docid": "b7ff6bdfa567f7237e2924d96f785a97", "score": "0.6370592", "text": "function dummyReturn(){\n}", "title": "" }, { "docid": "01e1341b16b60685a21af4d387a6858e", "score": "0.6361525", "text": "function no_op () {}", "title": "" }, { "docid": "dfb12d2b130970e1886229f708ef301a", "score": "0.63561016", "text": "function doNothing(){\n\n}", "title": "" }, { "docid": "dfb12d2b130970e1886229f708ef301a", "score": "0.63561016", "text": "function doNothing(){\n\n}", "title": "" }, { "docid": "befdecdf4a7bf48d9420b7d26c55916d", "score": "0.63547486", "text": "function _____SHARED_functions_____(){}", "title": "" }, { "docid": "baf205bf0a2ed5538bd1e7ac02507d45", "score": "0.6344035", "text": "function doNothing(){\n}", "title": "" }, { "docid": "6ca7fbc147010e8d21d88809541e006a", "score": "0.6335441", "text": "function abc() {\n\n}", "title": "" }, { "docid": "240644cc0b3bb87bf74241a66c29e74d", "score": "0.6331729", "text": "function StupidBug() {}", "title": "" }, { "docid": "3c9c5722b9cbdc910f24922289419723", "score": "0.63310665", "text": "function doNothing() { }", "title": "" }, { "docid": "8df8f0d86666552ee7c7c4691e1e8785", "score": "0.6325176", "text": "function Expt() {\r\n}", "title": "" }, { "docid": "a4c01d3af48a6a17455e0d2dd33f6da2", "score": "0.6322613", "text": "function Xuice() {\r\n}", "title": "" }, { "docid": "0ab8918363fe38a78e150be264c2310a", "score": "0.6316716", "text": "function test() {\n\n}", "title": "" }, { "docid": "650ff554859977bab92401016e1b7806", "score": "0.6315968", "text": "private public function m246() {}", "title": "" }, { "docid": "9e7d4d92de0d708ea0a4d17fddb9c5dc", "score": "0.63107", "text": "function noop() {// No operation performed.\n\t }", "title": "" }, { "docid": "b1781b517b7c331b0fe60da8094639ef", "score": "0.6309269", "text": "function an(){}", "title": "" }, { "docid": "4846f7442387d0797edb680641658aba", "score": "0.6306638", "text": "function callback(){}", "title": "" }, { "docid": "6a6041fa7d39ede3d0f7f6875e79bf44", "score": "0.629979", "text": "function returnVoid() { }", "title": "" }, { "docid": "7e146f14e9f9ac94bd0f7771ecc2072d", "score": "0.6297476", "text": "function test() {}", "title": "" }, { "docid": "c8dc40a234b90bc8963296eb70a93a51", "score": "0.62924707", "text": "function foo4(){}", "title": "" }, { "docid": "e9778e9969a8a3235d4cfe91d77a0770", "score": "0.6291853", "text": "function fun1(){\n\n}", "title": "" }, { "docid": "d36b85d659a6f4573b1a198dd5a63b80", "score": "0.62879467", "text": "function Instruction() {\r\n}", "title": "" }, { "docid": "47f51b54c9298c34c298a02e88eefdd0", "score": "0.6281484", "text": "function myFunc() { \n\n}", "title": "" } ]
d7ba08758f7b2a255ffea081453fb47c
Any fragments that will be injected in must be processed before, the doT engine is then used to render the resulting template
[ { "docid": "c37e93bf6aae733860df159031d7d8c6", "score": "0.56820726", "text": "async _renderFragmentPart(currentDepth, fragmentBody, dataForView) {\n try {\n const str = await this.renderRecursive(fragmentBody, currentDepth + 1);\n return dotEngine.template(str)(dataForView);\n } catch (error) {\n this._logger.error(`DoT.js Rendering failed with error ${error.message}`, error);\n throw new FragmentRenderError(error);\n }\n }", "title": "" } ]
[ { "docid": "345a6882409aa837698e3a605844eb8d", "score": "0.5851445", "text": "function create_fragment(ctx) {\n \tlet header;\n \tlet t0;\n \tlet banner;\n \tlet t1;\n \tlet section;\n \tlet t2;\n \tlet section2;\n \tlet t3;\n \tlet section3;\n \tlet t4;\n \tlet section4;\n \tlet t5;\n \tlet input;\n \tlet t6;\n \tlet menu;\n \tlet t7;\n \tlet footer;\n \tlet current;\n \theader = new Header({ $$inline: true });\n \tbanner = new Banner({ $$inline: true });\n \tsection = new Section1({ $$inline: true });\n \tsection2 = new Section2({ $$inline: true });\n \tsection3 = new Section3({ $$inline: true });\n \tsection4 = new Section4({ $$inline: true });\n \tinput = new Searchinput({ $$inline: true });\n \tmenu = new Menu({ $$inline: true });\n \tfooter = new Footer({ $$inline: true });\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tcreate_component(header.$$.fragment);\n \t\t\tt0 = space();\n \t\t\tcreate_component(banner.$$.fragment);\n \t\t\tt1 = space();\n \t\t\tcreate_component(section.$$.fragment);\n \t\t\tt2 = space();\n \t\t\tcreate_component(section2.$$.fragment);\n \t\t\tt3 = space();\n \t\t\tcreate_component(section3.$$.fragment);\n \t\t\tt4 = space();\n \t\t\tcreate_component(section4.$$.fragment);\n \t\t\tt5 = space();\n \t\t\tcreate_component(input.$$.fragment);\n \t\t\tt6 = space();\n \t\t\tcreate_component(menu.$$.fragment);\n \t\t\tt7 = space();\n \t\t\tcreate_component(footer.$$.fragment);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(header, target, anchor);\n \t\t\tinsert_dev(target, t0, anchor);\n \t\t\tmount_component(banner, target, anchor);\n \t\t\tinsert_dev(target, t1, anchor);\n \t\t\tmount_component(section, target, anchor);\n \t\t\tinsert_dev(target, t2, anchor);\n \t\t\tmount_component(section2, target, anchor);\n \t\t\tinsert_dev(target, t3, anchor);\n \t\t\tmount_component(section3, target, anchor);\n \t\t\tinsert_dev(target, t4, anchor);\n \t\t\tmount_component(section4, target, anchor);\n \t\t\tinsert_dev(target, t5, anchor);\n \t\t\tmount_component(input, target, anchor);\n \t\t\tinsert_dev(target, t6, anchor);\n \t\t\tmount_component(menu, target, anchor);\n \t\t\tinsert_dev(target, t7, anchor);\n \t\t\tmount_component(footer, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: noop,\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(header.$$.fragment, local);\n \t\t\ttransition_in(banner.$$.fragment, local);\n \t\t\ttransition_in(section.$$.fragment, local);\n \t\t\ttransition_in(section2.$$.fragment, local);\n \t\t\ttransition_in(section3.$$.fragment, local);\n \t\t\ttransition_in(section4.$$.fragment, local);\n \t\t\ttransition_in(input.$$.fragment, local);\n \t\t\ttransition_in(menu.$$.fragment, local);\n \t\t\ttransition_in(footer.$$.fragment, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(header.$$.fragment, local);\n \t\t\ttransition_out(banner.$$.fragment, local);\n \t\t\ttransition_out(section.$$.fragment, local);\n \t\t\ttransition_out(section2.$$.fragment, local);\n \t\t\ttransition_out(section3.$$.fragment, local);\n \t\t\ttransition_out(section4.$$.fragment, local);\n \t\t\ttransition_out(input.$$.fragment, local);\n \t\t\ttransition_out(menu.$$.fragment, local);\n \t\t\ttransition_out(footer.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(header, detaching);\n \t\t\tif (detaching) detach_dev(t0);\n \t\t\tdestroy_component(banner, detaching);\n \t\t\tif (detaching) detach_dev(t1);\n \t\t\tdestroy_component(section, detaching);\n \t\t\tif (detaching) detach_dev(t2);\n \t\t\tdestroy_component(section2, detaching);\n \t\t\tif (detaching) detach_dev(t3);\n \t\t\tdestroy_component(section3, detaching);\n \t\t\tif (detaching) detach_dev(t4);\n \t\t\tdestroy_component(section4, detaching);\n \t\t\tif (detaching) detach_dev(t5);\n \t\t\tdestroy_component(input, detaching);\n \t\t\tif (detaching) detach_dev(t6);\n \t\t\tdestroy_component(menu, detaching);\n \t\t\tif (detaching) detach_dev(t7);\n \t\t\tdestroy_component(footer, detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "332792eb5c3db3caab620c99cce5bb6e", "score": "0.58332545", "text": "renderSync (content: string, context: ?Object) {\n const template = this.parsedTemplate\n // 构造函数中没有生成模板 就直接报错\n if (!template) {\n throw new Error('renderSync cannot be called without a template.')\n }\n context = context || {}\n // 是否要注入\n if (this.inject) {\n return (\n // 开始到header结束\n template.head(context) +\n // 上下文head\n (context.head || '') +\n // 资源链接\n this.renderResourceHints(context) +\n // 渲染样式\n this.renderStyles(context) +\n // head结束到标记开始\n template.neck(context) +\n // 渲染内容\n content +\n // vuex状态\n this.renderState(context) +\n // 渲染脚本\n this.renderScripts(context) +\n // 从标记结束到最后\n template.tail(context)\n )\n } else {\n return (\n // 拼接内容 返回\n template.head(context) +\n template.neck(context) +\n content +\n template.tail(context)\n )\n }\n }", "title": "" }, { "docid": "5e66ea5033c172f1c2e61585b04d6b89", "score": "0.57783604", "text": "async parseAndRender() {\n const { template, data, liquidEngine } = this.props\n\n const compiledRender = await liquidEngine.parseAndRender(template, data)\n this.setState({ compiledRender, template, data, needsRender: false })\n }", "title": "" }, { "docid": "72a37cf4cbd601d035b927f473a7ba00", "score": "0.56751245", "text": "templateHandler () {\n return;\n }", "title": "" }, { "docid": "6d48849c52f97d12a3fb16038a55edd5", "score": "0.5674882", "text": "function create_fragment(ctx) {\n\tlet h3;\n\tlet t0;\n\tlet t1;\n\tlet br;\n\tlet t2;\n\tlet div;\n\tlet t3;\n\tlet p;\n\tlet t4;\n\tlet a;\n\tlet t5;\n\tlet t6;\n\tlet span0;\n\tlet t7;\n\tlet t8;\n\tlet t9;\n\tlet pre;\n\tlet code;\n\n\tlet t10_value = `http.HandleFunc(\"/hello\", helloHandler)\n\tlog.Fatal(http.ListenAndServe(\":8080\", nil))\n` + \"\";\n\n\tlet t10;\n\tlet t11;\n\tlet span1;\n\tlet t12;\n\tlet t13;\n\n\treturn {\n\t\tc() {\n\t\t\th3 = element(\"h3\");\n\t\t\tt0 = text(\"What do I do with Go?.\");\n\t\t\tt1 = space();\n\t\t\tbr = element(\"br\");\n\t\t\tt2 = space();\n\t\t\tdiv = element(\"div\");\n\t\t\tt3 = text(\"What do I do with Go?.\\n\");\n\t\t\tp = element(\"p\");\n\t\t\tt4 = text(\"I usually build servers. I enjoy the nice API that it has.\\nA good example is the \");\n\t\t\ta = element(\"a\");\n\t\t\tt5 = text(\"http package\");\n\t\t\tt6 = text(\"\\nThe \");\n\t\t\tspan0 = element(\"span\");\n\t\t\tt7 = text(\"ListenAndServe \");\n\t\t\tt8 = text(\"method is really where the server begins.\");\n\t\t\tt9 = space();\n\t\t\tpre = element(\"pre\");\n\t\t\tcode = element(\"code\");\n\t\t\tt10 = text(t10_value);\n\t\t\tt11 = text(\"\\nThe \");\n\t\t\tspan1 = element(\"span\");\n\t\t\tt12 = text(\"HandleFunc\");\n\t\t\tt13 = text(\" is how routing is setup.\\nI think a lot of people dont realize how easy this is to read.\\nThey just presume this is how go does it and dont stop to \\nrealize how simple this is.\");\n\t\t\tthis.h();\n\t\t},\n\t\tl(nodes) {\n\t\t\th3 = claim_element(nodes, \"H3\", { style: true });\n\t\t\tvar h3_nodes = children(h3);\n\t\t\tt0 = claim_text(h3_nodes, \"What do I do with Go?.\");\n\t\t\th3_nodes.forEach(detach);\n\t\t\tt1 = claim_space(nodes);\n\t\t\tbr = claim_element(nodes, \"BR\", {});\n\t\t\tt2 = claim_space(nodes);\n\t\t\tdiv = claim_element(nodes, \"DIV\", { class: true });\n\t\t\tvar div_nodes = children(div);\n\t\t\tt3 = claim_text(div_nodes, \"What do I do with Go?.\\n\");\n\t\t\tp = claim_element(div_nodes, \"P\", {});\n\t\t\tvar p_nodes = children(p);\n\t\t\tt4 = claim_text(p_nodes, \"I usually build servers. I enjoy the nice API that it has.\\nA good example is the \");\n\t\t\ta = claim_element(p_nodes, \"A\", { href: true, class: true });\n\t\t\tvar a_nodes = children(a);\n\t\t\tt5 = claim_text(a_nodes, \"http package\");\n\t\t\ta_nodes.forEach(detach);\n\t\t\tt6 = claim_text(p_nodes, \"\\nThe \");\n\t\t\tspan0 = claim_element(p_nodes, \"SPAN\", { class: true });\n\t\t\tvar span0_nodes = children(span0);\n\t\t\tt7 = claim_text(span0_nodes, \"ListenAndServe \");\n\t\t\tspan0_nodes.forEach(detach);\n\t\t\tt8 = claim_text(p_nodes, \"method is really where the server begins.\");\n\t\t\tp_nodes.forEach(detach);\n\t\t\tt9 = claim_space(div_nodes);\n\t\t\tpre = claim_element(div_nodes, \"PRE\", { class: true });\n\t\t\tvar pre_nodes = children(pre);\n\t\t\tcode = claim_element(pre_nodes, \"CODE\", { class: true });\n\t\t\tvar code_nodes = children(code);\n\t\t\tt10 = claim_text(code_nodes, t10_value);\n\t\t\tcode_nodes.forEach(detach);\n\t\t\tpre_nodes.forEach(detach);\n\t\t\tt11 = claim_text(div_nodes, \"\\nThe \");\n\t\t\tspan1 = claim_element(div_nodes, \"SPAN\", { class: true });\n\t\t\tvar span1_nodes = children(span1);\n\t\t\tt12 = claim_text(span1_nodes, \"HandleFunc\");\n\t\t\tspan1_nodes.forEach(detach);\n\t\t\tt13 = claim_text(div_nodes, \" is how routing is setup.\\nI think a lot of people dont realize how easy this is to read.\\nThey just presume this is how go does it and dont stop to \\nrealize how simple this is.\");\n\t\t\tdiv_nodes.forEach(detach);\n\t\t\tthis.h();\n\t\t},\n\t\th() {\n\t\t\tset_style(h3, \"text-decoration\", \"underline\");\n\t\t\tattr(a, \"href\", \"https://golang.org/pkg/net/http/\");\n\t\t\tattr(a, \"class\", \"svelte-1rzkz8u\");\n\t\t\tattr(span0, \"class\", \"svelte-1rzkz8u\");\n\t\t\tattr(code, \"class\", \"svelte-1rzkz8u\");\n\t\t\tattr(pre, \"class\", \"svelte-1rzkz8u\");\n\t\t\tattr(span1, \"class\", \"svelte-1rzkz8u\");\n\t\t\tattr(div, \"class\", \"body svelte-1rzkz8u\");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, h3, anchor);\n\t\t\tappend(h3, t0);\n\t\t\tinsert(target, t1, anchor);\n\t\t\tinsert(target, br, anchor);\n\t\t\tinsert(target, t2, anchor);\n\t\t\tinsert(target, div, anchor);\n\t\t\tappend(div, t3);\n\t\t\tappend(div, p);\n\t\t\tappend(p, t4);\n\t\t\tappend(p, a);\n\t\t\tappend(a, t5);\n\t\t\tappend(p, t6);\n\t\t\tappend(p, span0);\n\t\t\tappend(span0, t7);\n\t\t\tappend(p, t8);\n\t\t\tappend(div, t9);\n\t\t\tappend(div, pre);\n\t\t\tappend(pre, code);\n\t\t\tappend(code, t10);\n\t\t\tappend(div, t11);\n\t\t\tappend(div, span1);\n\t\t\tappend(span1, t12);\n\t\t\tappend(div, t13);\n\t\t},\n\t\tp: noop,\n\t\ti: noop,\n\t\to: noop,\n\t\td(detaching) {\n\t\t\tif (detaching) detach(h3);\n\t\t\tif (detaching) detach(t1);\n\t\t\tif (detaching) detach(br);\n\t\t\tif (detaching) detach(t2);\n\t\t\tif (detaching) detach(div);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "0827a103b21481347cdd62237776e95f", "score": "0.55944455", "text": "loadFragments(onDone) {\n if (_.isEmpty(this._queue) && _.isEmpty(this._saved)) {\n if (_.isFunction(onDone)) {\n onDone();\n }\n\n return;\n }\n\n const queueName = this._queueName;\n\n _.each(this._queue, queuedLoads => {\n $.funcQueue(queueName).add(() => {\n const pendingCommentIDs = [];\n const onFragmentRenderedFuncs = {};\n\n /*\n * Check if there are any comment IDs that have been saved.\n * We don't need to reload these from the server.\n */\n for (let i = 0; i < queuedLoads.length; i++) {\n const queuedLoad = queuedLoads[i];\n const commentID = queuedLoad.commentID;\n const onFragmentRendered =\n _.isFunction(queuedLoad.onFragmentRendered)\n ? queuedLoad.onFragmentRendered\n : null;\n\n if (this._saved.hasOwnProperty(commentID)) {\n const html = this._saved[commentID];\n\n const container = this._getCommentContainer(commentID);\n console.assert(container);\n\n let view = container.data('diff-fragment-view');\n\n if (view) {\n view.$el.html(html);\n view.render();\n } else {\n view = this._renderFragment(container, commentID,\n html);\n }\n\n if (onFragmentRendered) {\n onFragmentRendered(view);\n }\n\n delete this._saved[commentID];\n } else {\n pendingCommentIDs.push(commentID);\n onFragmentRenderedFuncs[commentID] =\n onFragmentRendered;\n }\n }\n\n if (pendingCommentIDs.length > 0) {\n /*\n * There are some comment IDs we don't have. Load these\n * from the server.\n *\n * Once these are loaded, they'll call next() on the queue\n * to process the next batch.\n */\n this._loadDiff(pendingCommentIDs.join(','), {\n queueName: queueName,\n onFragmentRendered: (commentID, view) => {\n if (onFragmentRenderedFuncs[commentID]) {\n onFragmentRenderedFuncs[commentID](view);\n }\n },\n onDone: () => $.funcQueue(queueName).next(),\n });\n } else {\n /*\n * We processed all we need to process above. Go to the\n * next queue.\n */\n $.funcQueue(queueName).next();\n }\n });\n });\n\n if (_.isFunction(onDone)) {\n $.funcQueue(queueName).add(() => {\n onDone();\n $.funcQueue(queueName).next();\n });\n }\n\n // Clear the list.\n this._queue = {};\n\n $.funcQueue(queueName).start();\n }", "title": "" }, { "docid": "dd5e6db5fee0ec0cc35ff1f42ea829ae", "score": "0.55746454", "text": "function setup(){\n var templateSources = document.querySelectorAll('[id^=\"template-\"]')//looking for id attribute that start with template\n\n for (var i = 0; i < templateSources.length; i++){\n var render = Handlebars.compile( templateSources[i].innerHTML )\n Views[ templateSources[i].id ]\n }\n}", "title": "" }, { "docid": "9b2a593f383a94d4bec4acb5da8ab28b", "score": "0.5530409", "text": "function compile(content, context, postCompile) {\n \tvar template = Handlebars.compile(content);\n \tvar compiledContent = $.trim(template(context));\n \t\n \tif (postCompile) {\n \t\tpostCompile(compiledContent);\n \t}\n\n \treturn compiledContent;\n \t}", "title": "" }, { "docid": "0048f00c2fd8d156564656f895ba31ec", "score": "0.5486487", "text": "preRender() { }", "title": "" }, { "docid": "ded9a932fd5fd5d09e9395625d138b4d", "score": "0.54624915", "text": "preRender() {\n }", "title": "" }, { "docid": "d53dca5ea3b958b5e1d0a48126377bb7", "score": "0.5451881", "text": "preRendering() {}", "title": "" }, { "docid": "b79e4df990bac58173dacce86b89c99c", "score": "0.54264855", "text": "_regExpFragmentInject() {\n return /<fragment-inject ([^>]+)>([\\s\\S]*?)<\\/fragment-inject>/igm;\n }", "title": "" }, { "docid": "3e7d2a12fdf8f26c39062f2a475b3ebd", "score": "0.53236085", "text": "function create_fragment(ctx) {\n\tlet t0;\n\tlet carrousel;\n\tlet t1;\n\tlet inputs;\n\tlet current;\n\tcarrousel = new Carrousel({ $$inline: true });\n\tinputs = new Inputs({ $$inline: true });\n\n\tconst block = {\n\t\tc: function create() {\n\t\t\tt0 = space();\n\t\t\tcreate_component(carrousel.$$.fragment);\n\t\t\tt1 = space();\n\t\t\tcreate_component(inputs.$$.fragment);\n\t\t\tthis.h();\n\t\t},\n\t\tl: function claim(nodes) {\n\t\t\tconst head_nodes = query_selector_all(\"[data-svelte=\\\"svelte-1ine71f\\\"]\", document.head);\n\t\t\thead_nodes.forEach(detach_dev);\n\t\t\tt0 = claim_space(nodes);\n\t\t\tclaim_component(carrousel.$$.fragment, nodes);\n\t\t\tt1 = claim_space(nodes);\n\t\t\tclaim_component(inputs.$$.fragment, nodes);\n\t\t\tthis.h();\n\t\t},\n\t\th: function hydrate() {\n\t\t\tdocument.title = \"About\";\n\t\t},\n\t\tm: function mount(target, anchor) {\n\t\t\tinsert_dev(target, t0, anchor);\n\t\t\tmount_component(carrousel, target, anchor);\n\t\t\tinsert_dev(target, t1, anchor);\n\t\t\tmount_component(inputs, target, anchor);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp: noop,\n\t\ti: function intro(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(carrousel.$$.fragment, local);\n\t\t\ttransition_in(inputs.$$.fragment, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to: function outro(local) {\n\t\t\ttransition_out(carrousel.$$.fragment, local);\n\t\t\ttransition_out(inputs.$$.fragment, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td: function destroy(detaching) {\n\t\t\tif (detaching) detach_dev(t0);\n\t\t\tdestroy_component(carrousel, detaching);\n\t\t\tif (detaching) detach_dev(t1);\n\t\t\tdestroy_component(inputs, detaching);\n\t\t}\n\t};\n\n\tdispatch_dev(\"SvelteRegisterBlock\", {\n\t\tblock,\n\t\tid: create_fragment.name,\n\t\ttype: \"component\",\n\t\tsource: \"\",\n\t\tctx\n\t});\n\n\treturn block;\n}", "title": "" }, { "docid": "e9ceb83d14db86ae2c61eedc223d7082", "score": "0.53194344", "text": "function preparePage () {\n\t\tvar elBody = bodyElement;\n\t\tvar sourceText = elBody.textContent;\n\t\tvar sourceCont = html('<section />');\n\t\tvar jsonCont = sourceCont.cloneNode(false);\n\n\t\tsourceCont.innerText = sourceText;\n\t\tsourceCont.classList.add('source');\n\t\tjsonCont.classList.add('json');\n\t\telems.source = sourceCont;\n\t\telems.json = jsonCont;\n\t\telBody.innerHTML = \"\";\n\t\tappend(elBody, [sourceCont, jsonCont]);\n\t}", "title": "" }, { "docid": "a4676c165e0a62864e10a56ba81bd648", "score": "0.5310917", "text": "resolve(context) {\n context.registerPostProcessor(new RemoveDuplicateStatements(this.autoAssignSids));\n return this.render();\n }", "title": "" }, { "docid": "9a3b4de8a1a4ce77f8c21090bef3aa57", "score": "0.5301367", "text": "function create_fragment(ctx) {\n \tlet todos_1;\n \tlet current;\n\n \ttodos_1 = new Todos({\n \t\t\tprops: { todos: /*todos*/ ctx[0] },\n \t\t\t$$inline: true\n \t\t});\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tcreate_component(todos_1.$$.fragment);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(todos_1, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: noop,\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(todos_1.$$.fragment, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(todos_1.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(todos_1, detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "a197bb9a564cded0e6656e189204d649", "score": "0.52789897", "text": "postRendering() {}", "title": "" }, { "docid": "96911186e0828c366a8f2c078bdad99a", "score": "0.5259383", "text": "function create_fragment$1d(ctx) {\n \tconst block = {\n \t\tc: noop,\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: noop,\n \t\tp: noop,\n \t\ti: noop,\n \t\to: noop,\n \t\td: noop\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$1d.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "81dce4f2e4144cfebb69c890e322985a", "score": "0.52432597", "text": "renderMainContent () {\n if (isNewUser()) {\n const fragment = document.createDocumentFragment();\n const div = document.createElement('div');\n div.innerHTML = (require('./templates/first-entrance.hbs'))();\n\n fragment.appendChild(div);\n\n const skipBtn = fragment.querySelector('.skip');\n skipBtn.addEventListener('click', () => {\n PubSub.publish('settingsModel/setDefaultSettings');\n });\n\n main.innerHTML = '';\n main.appendChild(fragment);\n $('main').tooltip();\n\n return;\n }\n\n PubSub.publish('model/requestTasksData');\n }", "title": "" }, { "docid": "1fca5eee84c2adfc260cb58edf02ba45", "score": "0.52389705", "text": "function render(dom, data) {\n renderImmediately(dom);\n renderOnLoad(dom, data);\n // Remove script tag so it doesn't run again in the client\n let s = dom.querySelector('script[src*=\"distill.pub/template\"]');\n if (s) { s.parentElement.removeChild(s); };\n}", "title": "" }, { "docid": "75827f4e51f706c7c16f6c0c349ddd22", "score": "0.5236225", "text": "function create_fragment$4(ctx) {\n \tconst block = {\n \t\tc: noop,\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: noop,\n \t\tp: noop,\n \t\ti: noop,\n \t\to: noop,\n \t\td: noop\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$4.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "76dc1c323c88c6d82acbc5f8898073a7", "score": "0.522472", "text": "function skipUnreachableNodeTransform(\n context: GraphQLCompilerContext,\n): GraphQLCompilerContext {\n const fragments: Map<string, ?Fragment> = new Map();\n const nextContext = GraphQLIRTransformer.transform(context, {\n Root: node => transformNode(context, fragments, node),\n // Fragments are included below where referenced.\n // Unreferenced fragments are not included.\n Fragment: id => null,\n });\n return (Array.from(fragments.values()): Array<?Fragment>).reduce(\n (ctx: GraphQLCompilerContext, fragment) =>\n fragment ? ctx.add(fragment) : ctx,\n nextContext,\n );\n}", "title": "" }, { "docid": "e1c90fd1e4882804add6af4d16619583", "score": "0.5218291", "text": "function create_fragment(ctx) {\n var div;\n return {\n c: function c() {\n div = (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.element)(\"div\");\n div.innerHTML = \"<h1 class=\\\"text-8xl text-gray-800 dark:text-white font-display\\\">Goodbye!</h1> \\n <p class=\\\"mt-24\\\">BetterDiscordLibrary is officially shutting down in favour of the new and official BetterDiscord website.</p> \\n <p class=\\\"mt-2\\\">All data will be deleted.</p> \\n\\n <a href=\\\"https://betterdiscord.app\\\" class=\\\"btn btn-primary py-6 px-8 inline-flex bg-teal-500 hover:bg-teal-400 focus:ring-teal-500 focus:ring-opacity-40 text-2xl mt-24\\\">Take me to the new site</a>\";\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.attr)(div, \"class\", \"wrap py-24 text-center\");\n },\n m: function m(target, anchor) {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.insert)(target, div, anchor);\n },\n p: svelte_internal__WEBPACK_IMPORTED_MODULE_0__.noop,\n i: svelte_internal__WEBPACK_IMPORTED_MODULE_0__.noop,\n o: svelte_internal__WEBPACK_IMPORTED_MODULE_0__.noop,\n d: function d(detaching) {\n if (detaching) (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.detach)(div);\n }\n };\n}", "title": "" }, { "docid": "dc531eb2dfe777398e7046b65f6ba7d8", "score": "0.5204121", "text": "function processLayout(ob) {\n if (ob.file.endsWith(\".js\")) {\n //console.log(\"-=-=-\\n\", ob);\n ob.templateFunc = eval(ob.contents);\n }\n}", "title": "" }, { "docid": "950f8f6c2343f8ab5eacc865bebabdba", "score": "0.5193591", "text": "function create_fragment$5(ctx) {\n \tlet t0;\n \tlet t1_value = (window.localStorage.getItem('dev') ? 'On' : 'Off') + \"\";\n \tlet t1;\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tt0 = text$1(\"Dev mode is \");\n \t\t\tt1 = text$1(t1_value);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tinsert_dev(target, t0, anchor);\n \t\t\tinsert_dev(target, t1, anchor);\n \t\t},\n \t\tp: noop,\n \t\ti: noop,\n \t\to: noop,\n \t\td: function destroy(detaching) {\n \t\t\tif (detaching) detach_dev(t0);\n \t\t\tif (detaching) detach_dev(t1);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$5.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "988efe96652f2fd3c610372a0eec7327", "score": "0.5184508", "text": "function processTemplate ( templateString ) {\n var fragment = document.createDocumentFragment();\n var div = document.createElement('div');\n div.innerHTML = templateString;\n while ( div.childNodes.length > 0 ) {\n fragment.appendChild( div.childNodes[0] );\n }\n return fragment;\n }", "title": "" }, { "docid": "b6e51249b2a270b5240516dfee05dd9f", "score": "0.5176266", "text": "[(typeof Handlebars === 'object' ? '@test' : '@skip') + \" template with type text/x-raw-handlebars should be parsed\"](assert) {\n fixture.innerHTML = '<script type=\"text/x-raw-handlebars\" data-template-name=\"funkyTemplate\">{{name}}</script>';\n (0, _runloop.run)(() => (0, _bootstrap.default)({\n context: fixture,\n hasTemplate: _glimmer.hasTemplate,\n setTemplate: _glimmer.setTemplate\n }));\n var template = (0, _glimmer.getTemplate)('funkyTemplate');\n assert.ok(template, 'template with name funkyTemplate available'); // This won't even work with Ember templates\n\n assert.equal(template({\n name: 'Tobias'\n }).trim(), 'Tobias');\n }", "title": "" }, { "docid": "48e167ab9ee0f82462131ac9edbbf891", "score": "0.51573026", "text": "function create_fragment$10(ctx) {\n \tlet header;\n \tlet t0;\n \tlet t1;\n \tlet footer;\n \tlet current;\n \theader = new Header({ $$inline: true });\n \tconst default_slot_template = /*#slots*/ ctx[1].default;\n \tconst default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[0], null);\n \tfooter = new Footer({ $$inline: true });\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tcreate_component(header.$$.fragment);\n \t\t\tt0 = space();\n \t\t\tif (default_slot) default_slot.c();\n \t\t\tt1 = space();\n \t\t\tcreate_component(footer.$$.fragment);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(header, target, anchor);\n \t\t\tinsert_dev(target, t0, anchor);\n\n \t\t\tif (default_slot) {\n \t\t\t\tdefault_slot.m(target, anchor);\n \t\t\t}\n\n \t\t\tinsert_dev(target, t1, anchor);\n \t\t\tmount_component(footer, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: function update(ctx, [dirty]) {\n \t\t\tif (default_slot) {\n \t\t\t\tif (default_slot.p && (!current || dirty & /*$$scope*/ 1)) {\n \t\t\t\t\tupdate_slot_base(\n \t\t\t\t\t\tdefault_slot,\n \t\t\t\t\t\tdefault_slot_template,\n \t\t\t\t\t\tctx,\n \t\t\t\t\t\t/*$$scope*/ ctx[0],\n \t\t\t\t\t\t!current\n \t\t\t\t\t\t? get_all_dirty_from_scope(/*$$scope*/ ctx[0])\n \t\t\t\t\t\t: get_slot_changes(default_slot_template, /*$$scope*/ ctx[0], dirty, null),\n \t\t\t\t\t\tnull\n \t\t\t\t\t);\n \t\t\t\t}\n \t\t\t}\n \t\t},\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(header.$$.fragment, local);\n \t\t\ttransition_in(default_slot, local);\n \t\t\ttransition_in(footer.$$.fragment, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(header.$$.fragment, local);\n \t\t\ttransition_out(default_slot, local);\n \t\t\ttransition_out(footer.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(header, detaching);\n \t\t\tif (detaching) detach_dev(t0);\n \t\t\tif (default_slot) default_slot.d(detaching);\n \t\t\tif (detaching) detach_dev(t1);\n \t\t\tdestroy_component(footer, detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$10.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "3c3396be56f2871b5630d08a7ddf68c8", "score": "0.51463425", "text": "function create_fragment$1(ctx) {\n \treturn {\n \t\tc: noop,\n\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n\n \t\tm: noop,\n \t\tp: noop,\n \t\ti: noop,\n \t\to: noop,\n \t\td: noop\n \t};\n }", "title": "" }, { "docid": "a5296b9806b25d1ce658b999ea55ddfe", "score": "0.5127282", "text": "function create_fragment$3(ctx) {\n \tconst block = {\n \t\tc: noop,\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: noop,\n \t\tp: noop,\n \t\ti: noop,\n \t\to: noop,\n \t\td: noop\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$3.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "4cf4b5aa55881b9acabbf2e558be39ff", "score": "0.5122159", "text": "async _renderFragment(\n currentDepth,\n injectedFragment,\n fragmentContent,\n isRequired,\n requiredSources,\n repeatedDataName\n ) {\n try {\n const repeatedDataNameFragName = repeatedDataName && repeatedDataName.split('.')[0];\n const repeatedDataNameFragment = repeatedDataName && this._manager.hasFragment(repeatedDataNameFragName);\n if (repeatedDataName && (!repeatedDataNameFragment || !requiredSources.includes(repeatedDataNameFragName))) {\n const error = new FragmentRenderError(new Error('Attempting to render a list ' +\n 'of data with source which doesnt exist or isnt specified as a ' +\n `dependency with accessor '${repeatedDataName}'`));\n this._logger.error('Renderer: ', error.message);\n throw error;\n }\n\n const dataObject = requiredSources.map((name) => {\n if (!this._manager.hasFragment(name)) {\n const error = new FragmentRenderError(new Error('Attempting to render with a ' +\n 'data source fragment which doesnt exist in configuration ' +\n `(name ${name})`));\n this._logger.error('Renderer: ', error.message);\n throw error;\n }\n return [name, this._manager.fragmentBody(name, {\n neverHandleError: name === repeatedDataNameFragName\n })];\n }).reduce((acc, [key, promise]) => {\n acc[key] = promise;\n return acc;\n }, {});\n\n const sources = await Promise.props(dataObject);\n\n if (repeatedDataName) {\n // If source fails simply return generic content load message, else render the list fragment\n if (sources[repeatedDataNameFragName] instanceof Error) {\n return this._manager.fragment(repeatedDataNameFragName)\n .contentMissingMessage(sources[repeatedDataNameFragName]);\n }\n\n const dataBody = getProperty(sources, repeatedDataName);\n if (dataBody && dataBody.length) {\n return await Promise.all(dataBody.map((d) => this._renderFragmentPart(currentDepth, fragmentContent, Object.assign({\n current: d\n }, sources)))).then(data => data.join(''));\n } else {\n return '';\n }\n } else {\n // Render a simple embedded fragment\n return await this._renderFragmentPart(currentDepth, fragmentContent, sources);\n }\n } catch(error) {\n if (error instanceof FragmentRenderError && !isRequired) {\n this._logger.error('A non required fragment failed to render');\n return injectedFragment.contentRenderErrorMessage(error) || '';\n }\n throw error;\n }\n }", "title": "" }, { "docid": "5b5090a2a9db7e8a26952c5694f1bb8d", "score": "0.51196855", "text": "function create_fragment$d(ctx) {\n \tlet current;\n \tconst login = new Login({ $$inline: true });\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tcreate_component(login.$$.fragment);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(login, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: noop,\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(login.$$.fragment, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(login.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(login, detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$d.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "889fcd4aa85a94c695b1dab1fb8a6c4c", "score": "0.5118279", "text": "function create_fragment$6(ctx) {\n \tvar t, current;\n\n \tvar header = new Header({\n \t\tprops: { title: ctx.title },\n \t\t$$inline: true\n \t});\n\n \tvar wallets = new Wallets({\n \t\tprops: { App: app },\n \t\t$$inline: true\n \t});\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\theader.$$.fragment.c();\n \t\t\tt = space();\n \t\t\twallets.$$.fragment.c();\n \t\t},\n\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(header, target, anchor);\n \t\t\tinsert_dev(target, t, anchor);\n \t\t\tmount_component(wallets, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n\n \t\tp: function update(changed, ctx) {\n \t\t\tvar header_changes = {};\n \t\t\tif (changed.title) header_changes.title = ctx.title;\n \t\t\theader.$set(header_changes);\n \t\t},\n\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(header.$$.fragment, local);\n\n \t\t\ttransition_in(wallets.$$.fragment, local);\n\n \t\t\tcurrent = true;\n \t\t},\n\n \t\to: function outro(local) {\n \t\t\ttransition_out(header.$$.fragment, local);\n \t\t\ttransition_out(wallets.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(header, detaching);\n\n \t\t\tif (detaching) {\n \t\t\t\tdetach_dev(t);\n \t\t\t}\n\n \t\t\tdestroy_component(wallets, detaching);\n \t\t}\n \t};\n \tdispatch_dev(\"SvelteRegisterBlock\", { block, id: create_fragment$6.name, type: \"component\", source: \"\", ctx });\n \treturn block;\n }", "title": "" }, { "docid": "2e51922a05a66265f129d14b53c0e5a3", "score": "0.5113412", "text": "function create_fragment$1(ctx) {\n \tlet current;\n \tconst initmap = new InitMap({ $$inline: true });\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tcreate_component(initmap.$$.fragment);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(initmap, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: noop,\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(initmap.$$.fragment, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(initmap.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(initmap, detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$1.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "2acd3e9696caf661122ab1b69dd8c3aa", "score": "0.5100851", "text": "function render(template, ctx, insertPt) {\n if (!template || (!(template instanceof Template) && !(template instanceof String || typeof template === 'string'))) {\n console.log(\"ERROR: Must pass in a valid template or template string.\");\n return;\n }\n if (template instanceof String || typeof template === 'string')\n template = compile(template);\n if (template.inst) {\n return incrementalRerender(template, ctx);\n } else {\n if (!insertPt) {\n console.log(\"ERROR: Must specify an insertion point for unrendered templates.\");\n return;\n }\n var renderWrapper = htmlRender(template, ctx);\n insertPt.innerHTML = renderWrapper.text;\n return renderWrapper.instTmpl;\n }\n}", "title": "" }, { "docid": "a1ef519506cf42a89f6823fe5687c9c1", "score": "0.5090272", "text": "function TemplateDispatcher() {\r\n\t}", "title": "" }, { "docid": "6e8e8dfba113335ce4f8ee628a651578", "score": "0.50856084", "text": "function rawFragments2htmlText(\n rawActiveFrag,\n ){\n if( typeof( rawActiveFrag ) === 'object' ) {\n ////we have active fragments:\n //// { name1 : fragBody_raw1,\n //// name2 : fragBody_raw2,\n //// ....\n var normalizedActiveFrag = nspaste( {}, rawActiveFrag );\n } else {\n ////normalizes rawActiveFrag string to comply with active fragments format:\n //// { static : fragBody_raw,\n //// }\n //// ....\n var normalizedActiveFrag = { 'static' : rawActiveFrag };\n }\n var norFrRack = {};\n eachprop( normalizedActiveFrag, (\n fragBody_raw, //this is a plain text,\n //pre-ready for final-HTML-text,\n //it will be modified few times here without\n //affecting originally supplied rawActiveFrag argument.\n akey\n ) => {\n\n\n //***************************************************\n // //\\\\ Macros filter\n // (Macros are not \"tp-anchor-scripts\", macros\n // are \"undivided text bricks\".)\n // Raw html-script-text is fragBody_raw.\n // Main place to add more fragBody_raw\n // preconversions before\n // convertion fragBody_raw to tp-anchor-scripts.\n //***************************************************\n fragBody_raw = doesInsertSiteHTMLMacros( fragBody_raw );\n\n //----------------------------------------------------\n // //\\\\ processes tp-batch-controllers\n // by replacing marks with tp-script-clauses:\n // if there are marks in book-text, then replaces all of them,\n // implemented, since proposition 14,\n //----------------------------------------------------\n if( has( sconf, 'insertDelayedBatch' ) ) {\n fragBody_raw = insertDelayedBatch( fragBody_raw );\n }\n //----------------------------------------------------\n // \\\\// processes tp-batch-controllers\n //----------------------------------------------------\n\n //***************************************************\n // \\\\// Macros filter\n //***************************************************\n\n norFrRack[ akey ] = {\n //(*) format:\n //text ready to be injected into html dom$\n fragBody : fragBody_raw.replace( TOP_ANCH_REG_gu, replWithAnchor ),\n //normalizes scriptedAnchors to form <a ... tl-NNNNN dix ...\n //placeholder to accept text to be injected into html dom$\n dom$ : 'to be defined later',\n //... : ...\n };\n });\n return norFrRack;\n\n //--------------------------------------------------------\n // //\\\\ html conversion of body fragments\n //--------------------------------------------------------\n // todo: to fix the bug, topics and links ids must be collected here.\n // perhaps make a special parser for |...|| incursions.\n\n function replWithAnchor(\n match, //total match: ¦anchor config¦anchor caption¦¦\n anchorConfig, //¦anchor config\n scaption, //anchor caption\n cflag, //close flag ¦\n farFlag, //far flag ¦\n remainder //everything remained between ¦conf¦caption¦¦¦¦ and\n //next occrance of ¦conf¦caption¦¦¦¦\n ){\n ///we must do anchorConfig preporcessing again, for time 2 out of 2:\n ///do handle strip==='' or generate anchorConfig\n if( anchorConfig === '' ) {\n anchorConfig = scaption;\n } else {\n //strips \"¦\" from the lead of anchorConfig:\n anchorConfig = anchorConfig.substring( 1, anchorConfig.length );\n }\n\n var rack = topics.id2tplink[ anchorConfig ];\n if( !rack ) return;\n var dix = cflag ? ' delayed-anchor' : '';\n dix += farFlag ? ' delayed-far' : '';\n \n\n //***********************************************************\n // This anchor with non-empty dix will be hidden? and\n // will be a \"seed\" from\n // which its config will be spread on to siblings with\n // the same content. Siblings will become anchors which\n // are linked to media content configured in the seed,\n //***********************************************************\n //.we cannot use anchorConfig because spaces inside of it, so\n //.we use tplink_ix_str\n //.todm ... this is a real bug: tplink_ix does not count all links with\n // the same config, same anchorConfig.\n // So, different targets will be \"killed\", and\n // there will be only one target.\n var repl = '<a class=\"tl-' + rack.tplink_ix + dix + '\">'+ scaption +\n '</a>' + (remainder || '' );\n return repl;\n }\n //--------------------------------------------------------\n // \\\\// html conversion of body fragments\n //--------------------------------------------------------\n }", "title": "" }, { "docid": "95b6e9c7b91f76c2cea60d88a19110c2", "score": "0.5067287", "text": "_insertPartialFragment() {\n if (this._documentFragment.isEmpty) {\n return;\n }\n\n const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__[\n 'default'\n ].fromPosition(this.position, 'toNext');\n\n this._setAffectedBoundaries(this.position);\n\n // If the very first node of the whole insertion process is inserted, insert it separately for OT reasons (undo).\n // Note: there can be multiple calls to `_insertPartialFragment()` during one insertion process.\n // Note: only the very first node can be merged so we have to do separate operation only for it.\n if (this._documentFragment.getChild(0) == this._firstNode) {\n this.writer.insert(this._firstNode, this.position);\n\n // We must merge the first node just after inserting it to avoid problems with OT.\n // (See: https://github.com/ckeditor/ckeditor5/pull/8773#issuecomment-760945652).\n this._mergeOnLeft();\n\n this.position = livePosition.toPosition();\n }\n\n // Insert the remaining nodes from document fragment.\n if (!this._documentFragment.isEmpty) {\n this.writer.insert(this._documentFragment, this.position);\n }\n\n this._documentFragmentPosition = this.writer.createPositionAt(\n this._documentFragment,\n 0\n );\n\n this.position = livePosition.toPosition();\n livePosition.detach();\n }", "title": "" }, { "docid": "2ed8b323860f056308e3e5672f2d0777", "score": "0.50650465", "text": "preRender() {\n\n }", "title": "" }, { "docid": "8e0ee610de8230824a84d2255f6f2bad", "score": "0.50521636", "text": "visitNormalTemplateBody(ctx) {\n const result = new analyzerResult_1.AnalyzerResult();\n for (const templateStr of ctx.templateString()) {\n result.union(this.visit(templateStr.normalTemplateString()));\n }\n return result;\n }", "title": "" }, { "docid": "eabcd3f8cf182443f7a5453fbb6e1499", "score": "0.5043799", "text": "function inject() {\n const inject = require('gulp-inject');\n inject.transform.html.js = filepath => `<script src=\"${filepath}\" async></script>`;\n\n return gulp\n .src('./client/views/commons/_layout.ejs')\n .pipe(\n inject(\n gulp.src(['./dist/*.js', './dist/*.css'], {\n read: false\n }),\n {\n ignorePath: 'dist'\n }\n )\n )\n .pipe(gulp.dest('./client/views/commons'));\n}", "title": "" }, { "docid": "e78643df54392f69d6d85a43d1cd7d4a", "score": "0.50382465", "text": "function render(result, container, scopeName) {\n const templateFactory = shadyTemplateFactory(scopeName);\n const template = templateFactory(result);\n let instance = container.__templateInstance;\n // Repeat render, just call update()\n if (instance !== undefined && instance.template === template &&\n instance._partCallback === result.partCallback) {\n instance.update(result.values);\n return;\n }\n // First render, create a new TemplateInstance and append it\n instance =\n new _lit_html_js__WEBPACK_IMPORTED_MODULE_0__[\"TemplateInstance\"](template, result.partCallback, templateFactory);\n container.__templateInstance = instance;\n const fragment = instance._clone();\n instance.update(result.values);\n const host = container instanceof ShadowRoot ?\n container.host :\n undefined;\n // If there's a shadow host, do ShadyCSS scoping...\n if (host !== undefined && typeof window.ShadyCSS === 'object') {\n ensureStylesScoped(fragment, template, scopeName);\n window.ShadyCSS.styleElement(host);\n }\n Object(_lit_html_js__WEBPACK_IMPORTED_MODULE_0__[\"removeNodes\"])(container, container.firstChild);\n container.appendChild(fragment);\n}", "title": "" }, { "docid": "e78643df54392f69d6d85a43d1cd7d4a", "score": "0.50382465", "text": "function render(result, container, scopeName) {\n const templateFactory = shadyTemplateFactory(scopeName);\n const template = templateFactory(result);\n let instance = container.__templateInstance;\n // Repeat render, just call update()\n if (instance !== undefined && instance.template === template &&\n instance._partCallback === result.partCallback) {\n instance.update(result.values);\n return;\n }\n // First render, create a new TemplateInstance and append it\n instance =\n new _lit_html_js__WEBPACK_IMPORTED_MODULE_0__[\"TemplateInstance\"](template, result.partCallback, templateFactory);\n container.__templateInstance = instance;\n const fragment = instance._clone();\n instance.update(result.values);\n const host = container instanceof ShadowRoot ?\n container.host :\n undefined;\n // If there's a shadow host, do ShadyCSS scoping...\n if (host !== undefined && typeof window.ShadyCSS === 'object') {\n ensureStylesScoped(fragment, template, scopeName);\n window.ShadyCSS.styleElement(host);\n }\n Object(_lit_html_js__WEBPACK_IMPORTED_MODULE_0__[\"removeNodes\"])(container, container.firstChild);\n container.appendChild(fragment);\n}", "title": "" }, { "docid": "e9df9a9745ccae535c44dd99cf47b727", "score": "0.50350046", "text": "function create_fragment$9(ctx) {\n \tlet t0;\n \tlet tailwindcss;\n \tlet t1;\n \tlet home;\n \tlet current;\n \ttailwindcss = new Tailwindcss({ $$inline: true });\n \thome = new Home({ $$inline: true });\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tt0 = space();\n \t\t\tcreate_component(tailwindcss.$$.fragment);\n \t\t\tt1 = space();\n \t\t\tcreate_component(home.$$.fragment);\n \t\t\tdocument.title = \"Movies - Home\";\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tinsert_dev(target, t0, anchor);\n \t\t\tmount_component(tailwindcss, target, anchor);\n \t\t\tinsert_dev(target, t1, anchor);\n \t\t\tmount_component(home, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: noop,\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(tailwindcss.$$.fragment, local);\n \t\t\ttransition_in(home.$$.fragment, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(tailwindcss.$$.fragment, local);\n \t\t\ttransition_out(home.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tif (detaching) detach_dev(t0);\n \t\t\tdestroy_component(tailwindcss, detaching);\n \t\t\tif (detaching) detach_dev(t1);\n \t\t\tdestroy_component(home, detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$9.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "49cc27b30abec2623c802a26f0ef3c3d", "score": "0.502802", "text": "function create_fragment$6(ctx) {\n \tconst block = {\n \t\tc: noop,\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: noop,\n \t\tp: noop,\n \t\ti: noop,\n \t\to: noop,\n \t\td: noop\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$6.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "e3811332e1eedfc75567108c5043ada1", "score": "0.50228226", "text": "function parseContent(_t) {\r\n $(\"fragment\", dom_content).forEach(function (item) {\r\n var frag = new Fragment(item);\r\n _t.fragments[frag.name] = frag;\r\n });\r\n delete content;\r\n delete contentType;\r\n }", "title": "" }, { "docid": "0fab42dc8ee8b38b08b19841ab11f42b", "score": "0.50216305", "text": "function inject(data) {\n return data.replace(\n '<\\/body>',\n ' <script src=\"/zapp/client\"></script>\\n </body>'\n );\n}", "title": "" }, { "docid": "fcb96370c5375da22223f66d6880cb02", "score": "0.50211304", "text": "function compileScripts(context, postCompile) {\n \t\t$(\"script[type='text/x-handlebars-template']:not([delayCompile='true'])\").each(function () {\n \t\t\tvar jThis = $(this);\n \t\t\tpostCompile(compile(jThis.html(), context), jThis);\n \t\t});\n \t}", "title": "" }, { "docid": "c1f2fe109dbb5feb8e8d1eb09d8c9247", "score": "0.50206465", "text": "function templateLoader (id)\n {\n // Looks up the template ID to refresh the content.\n return function templateLoader (request,response,next,Template)\n {\n Template.findById(id).then(template => {\n response.view.template(template.file);\n response.view.use('template', template);\n response.view.meta('templateId', template.id);\n\n // Render each component and attach to the response view data.\n components.render(request,template.slots).then(rendered => {\n response.view.use('cmp', rendered);\n return next();\n }).catch(err => {\n return next(err);\n });\n })\n }\n\n }", "title": "" }, { "docid": "1047e34f547a51b78b142966cd4fa697", "score": "0.5010225", "text": "function startTagInTemplate(p, token) {\n switch (token.tagID) {\n // First, handle tags that can start without a mode change\n case html_js_1.TAG_ID.BASE:\n case html_js_1.TAG_ID.BASEFONT:\n case html_js_1.TAG_ID.BGSOUND:\n case html_js_1.TAG_ID.LINK:\n case html_js_1.TAG_ID.META:\n case html_js_1.TAG_ID.NOFRAMES:\n case html_js_1.TAG_ID.SCRIPT:\n case html_js_1.TAG_ID.STYLE:\n case html_js_1.TAG_ID.TEMPLATE:\n case html_js_1.TAG_ID.TITLE: {\n startTagInHead(p, token);\n break;\n }\n // Re-process the token in the appropriate mode\n case html_js_1.TAG_ID.CAPTION:\n case html_js_1.TAG_ID.COLGROUP:\n case html_js_1.TAG_ID.TBODY:\n case html_js_1.TAG_ID.TFOOT:\n case html_js_1.TAG_ID.THEAD: {\n p.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE;\n p.insertionMode = InsertionMode.IN_TABLE;\n startTagInTable(p, token);\n break;\n }\n case html_js_1.TAG_ID.COL: {\n p.tmplInsertionModeStack[0] = InsertionMode.IN_COLUMN_GROUP;\n p.insertionMode = InsertionMode.IN_COLUMN_GROUP;\n startTagInColumnGroup(p, token);\n break;\n }\n case html_js_1.TAG_ID.TR: {\n p.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE_BODY;\n p.insertionMode = InsertionMode.IN_TABLE_BODY;\n startTagInTableBody(p, token);\n break;\n }\n case html_js_1.TAG_ID.TD:\n case html_js_1.TAG_ID.TH: {\n p.tmplInsertionModeStack[0] = InsertionMode.IN_ROW;\n p.insertionMode = InsertionMode.IN_ROW;\n startTagInRow(p, token);\n break;\n }\n default: {\n p.tmplInsertionModeStack[0] = InsertionMode.IN_BODY;\n p.insertionMode = InsertionMode.IN_BODY;\n startTagInBody(p, token);\n }\n }\n}", "title": "" }, { "docid": "6e3ceb20b78b750dd302928873f8f5a8", "score": "0.50047934", "text": "function create_fragment$e(ctx) {\n \tlet blockquote;\n \tlet p;\n \tlet t;\n\n \treturn {\n \t\tc() {\n \t\t\tblockquote = element(\"blockquote\");\n \t\t\tp = element(\"p\");\n \t\t\tt = text(/*show*/ ctx[0]);\n \t\t\tattr(p, \"class\", \"f3 lh-copy svelte-1jczml0\");\n \t\t\tattr(blockquote, \"class\", \"athelas ml0 mt4 pl4 black-90 bl bw2 b--black svelte-1jczml0\");\n \t\t},\n \t\tm(target, anchor) {\n \t\t\tinsert(target, blockquote, anchor);\n \t\t\tappend(blockquote, p);\n \t\t\tappend(p, t);\n \t\t},\n \t\tp(ctx, [dirty]) {\n \t\t\tif (dirty & /*show*/ 1) set_data(t, /*show*/ ctx[0]);\n \t\t},\n \t\ti: noop,\n \t\to: noop,\n \t\td(detaching) {\n \t\t\tif (detaching) detach(blockquote);\n \t\t}\n \t};\n }", "title": "" }, { "docid": "0121252af1d22dc3b7c379e0cc84faec", "score": "0.49941346", "text": "beforeEnter({ query, params }, _, next) {\n // Obviously this is built with example in mind\n // This can be approached in any manner\n const valid = ['foo', 'bar']\n\n // If all is well then go ahead and continue on\n if (valid.includes(query.page)) {\n return next()\n }\n\n // If it's not valid then throw them back to the main blog component\n return next({\n path: `/blog/main/${params.id}`,\n replace: true\n })\n }", "title": "" }, { "docid": "a3649fad9e98f7d5e856736f5dd4f86f", "score": "0.49831656", "text": "function create_fragment$1(ctx) {\n \tlet div;\n\n \treturn {\n \t\tc() {\n \t\t\tdiv = element(\"div\");\n\n \t\t\tdiv.innerHTML = `<header><slot name=\"header\">No header was provided</slot></header> \n\n <main><slot name=\"content\">No Content was providedd</slot></main> \n\n <footer><slot name=\"footer\">No Footer was provided</slot></footer>`;\n\n \t\t\tthis.c = noop;\n \t\t\tattr(div, \"class\", \"dpdhl-card\");\n \t\t},\n \t\tm(target, anchor) {\n \t\t\tinsert(target, div, anchor);\n \t\t},\n \t\tp: noop,\n \t\ti: noop,\n \t\to: noop,\n \t\td(detaching) {\n \t\t\tif (detaching) detach(div);\n \t\t}\n \t};\n }", "title": "" }, { "docid": "e1ddcca35bb099b64e515b3cb2c84da7", "score": "0.49759316", "text": "function _renderTinyliquid(engine, str, options, cb) {\n\t var context = engine.newContext();\n\t var k;\n\n\t /**\n\t * Note that there's a bug in the library that doesn't allow us to pass\n\t * the locals to newContext(), hence looping through the keys:\n\t */\n\n\t if (options.locals) {\n\t for (k in options.locals) {\n\t context.setLocals(k, options.locals[k]);\n\t }\n\t delete options.locals;\n\t }\n\n\t if (options.meta) {\n\t context.setLocals('page', options.meta);\n\t delete options.meta;\n\t }\n\n\t /**\n\t * Add any defined filters:\n\t */\n\n\t if (options.filters) {\n\t for (k in options.filters) {\n\t context.setFilter(k, options.filters[k]);\n\t }\n\t delete options.filters;\n\t }\n\n\t /**\n\t * Set up a callback for the include directory:\n\t */\n\n\t var includeDir = options.includeDir || process.cwd();\n\n\t context.onInclude(function(name, callback) {\n\t var extname = path.extname(name) ? '' : '.liquid';\n\t var filename = path.resolve(includeDir, name + extname);\n\n\t fs.readFile(filename, {encoding: 'utf8'}, function(err, data) {\n\t if (err) return callback(err);\n\t callback(null, engine.parse(data));\n\t });\n\t });\n\t delete options.includeDir;\n\n\t /**\n\t * The custom tag functions need to have their results pushed back\n\t * through the parser, so set up a shim before calling the provided\n\t * callback:\n\t */\n\n\t var compileOptions = {\n\t customTags: {}\n\t };\n\n\t if (options.customTags) {\n\t var tagFunctions = options.customTags;\n\n\t for (k in options.customTags) {\n\t /*Tell jshint there's no problem with having this function in the loop */\n\t /*jshint -W083 */\n\t compileOptions.customTags[k] = function(context, name, body) {\n\t var tpl = tagFunctions[name](body.trim());\n\t context.astStack.push(engine.parse(tpl));\n\t };\n\t /*jshint +W083 */\n\t }\n\t delete options.customTags;\n\t }\n\n\t /**\n\t * Now anything left in `options` becomes a local:\n\t */\n\n\t for (k in options) {\n\t context.setLocals(k, options[k]);\n\t }\n\n\t /**\n\t * Finally, execute the template:\n\t */\n\n\t var tmpl = cache(context) || cache(context, engine.compile(str, compileOptions));\n\t tmpl(context, cb);\n\t}", "title": "" }, { "docid": "6d561b59409d44c270303c8f36e5eaa7", "score": "0.49750262", "text": "function beforeRender() {\n}", "title": "" }, { "docid": "b6313ad41b882ad31d085b3b411cecfd", "score": "0.49734765", "text": "function create_fragment$6(ctx) {\n\tlet script;\n\tlet script_src_value;\n\tlet t;\n\tlet div;\n\tlet mounted;\n\tlet dispose;\n\n\treturn {\n\t\tc() {\n\t\t\tscript = element(\"script\");\n\t\t\tt = space();\n\t\t\tdiv = element(\"div\");\n\t\t\tattr(script, \"type\", \"text/javascript\");\n\t\t\tif (script.src !== (script_src_value = \"https://ko-fi.com/widgets/widget_2.js\")) attr(script, \"src\", script_src_value);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tappend(document.head, script);\n\t\t\tinsert(target, t, anchor);\n\t\t\tinsert(target, div, anchor);\n\t\t\t/*div_binding*/ ctx[2](div);\n\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = listen(script, \"load\", /*initializeKofi*/ ctx[1]);\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp: noop,\n\t\ti: noop,\n\t\to: noop,\n\t\td(detaching) {\n\t\t\tdetach(script);\n\t\t\tif (detaching) detach(t);\n\t\t\tif (detaching) detach(div);\n\t\t\t/*div_binding*/ ctx[2](null);\n\t\t\tmounted = false;\n\t\t\tdispose();\n\t\t}\n\t};\n}", "title": "" }, { "docid": "8893a908e23b9e97558ab56d88463ae1", "score": "0.4964984", "text": "function create_fragment(ctx) {\n \tlet div6;\n \tlet div0;\n \tlet img;\n \tlet img_src_value;\n \tlet img_alt_value;\n \tlet img_width_value;\n \tlet img_height_value;\n \tlet t0;\n \tlet div5;\n \tlet div1;\n \tlet p0;\n \tlet a0;\n \tlet t1_value = (/*article*/ ctx[0].category && /*article*/ ctx[0].category.name) + \"\";\n \tlet t1;\n \tlet a0_href_value;\n \tlet t2;\n \tlet a1;\n \tlet p1;\n \tlet t3_value = /*article*/ ctx[0].title + \"\";\n \tlet t3;\n \tlet t4;\n \tlet p2;\n \tlet t5_value = /*article*/ ctx[0].excerpt + \"\";\n \tlet t5;\n \tlet a1_href_value;\n \tlet t6;\n \tlet div4;\n\n \treturn {\n \t\tc() {\n \t\t\tdiv6 = element(\"div\");\n \t\t\tdiv0 = element(\"div\");\n \t\t\timg = element(\"img\");\n \t\t\tt0 = space();\n \t\t\tdiv5 = element(\"div\");\n \t\t\tdiv1 = element(\"div\");\n \t\t\tp0 = element(\"p\");\n \t\t\ta0 = element(\"a\");\n \t\t\tt1 = text(t1_value);\n \t\t\tt2 = space();\n \t\t\ta1 = element(\"a\");\n \t\t\tp1 = element(\"p\");\n \t\t\tt3 = text(t3_value);\n \t\t\tt4 = space();\n \t\t\tp2 = element(\"p\");\n \t\t\tt5 = text(t5_value);\n \t\t\tt6 = space();\n \t\t\tdiv4 = element(\"div\");\n\n \t\t\tdiv4.innerHTML = `<div><div class=\"flex space-x-1 text-sm text-gray-500\"><time datetime=\"2020-03-10\">Mar 10, 2020</time> \n <span aria-hidden=\"true\">·</span> \n <span>4 min read</span></div></div>`;\n\n \t\t\tattr(img, \"class\", \"h-48 w-full object-cover\");\n \t\t\tif (img.src !== (img_src_value = \"/\" + /*article*/ ctx[0].image.file_name)) attr(img, \"src\", img_src_value);\n \t\t\tattr(img, \"alt\", img_alt_value = /*article*/ ctx[0].title);\n \t\t\tattr(img, \"width\", img_width_value = /*article*/ ctx[0].image.width);\n \t\t\tattr(img, \"height\", img_height_value = /*article*/ ctx[0].image.height);\n \t\t\tattr(div0, \"class\", \"flex-shrink-0\");\n \t\t\tattr(a0, \"href\", a0_href_value = \"/categories/\" + /*article*/ ctx[0].category_id);\n \t\t\tattr(a0, \"class\", \"hover:underline\");\n \t\t\tattr(p0, \"class\", \"text-sm font-medium text-cyan-800\");\n \t\t\tattr(p1, \"class\", \"text-xl font-semibold text-gray-900\");\n \t\t\tattr(p2, \"class\", \"mt-3 text-base text-gray-500\");\n \t\t\tattr(a1, \"href\", a1_href_value = \"/articles/\" + /*article*/ ctx[0].id);\n \t\t\tattr(a1, \"class\", \"block mt-2\");\n \t\t\tattr(div1, \"class\", \"flex-1\");\n \t\t\tattr(div4, \"class\", \"mt-6 flex items-center\");\n \t\t\tattr(div5, \"class\", \"flex-1 bg-white p-6 flex flex-col justify-between\");\n \t\t\tattr(div6, \"class\", \"flex flex-col rounded-lg shadow-lg overflow-hidden\");\n \t\t},\n \t\tm(target, anchor) {\n \t\t\tinsert(target, div6, anchor);\n \t\t\tappend(div6, div0);\n \t\t\tappend(div0, img);\n \t\t\tappend(div6, t0);\n \t\t\tappend(div6, div5);\n \t\t\tappend(div5, div1);\n \t\t\tappend(div1, p0);\n \t\t\tappend(p0, a0);\n \t\t\tappend(a0, t1);\n \t\t\tappend(div1, t2);\n \t\t\tappend(div1, a1);\n \t\t\tappend(a1, p1);\n \t\t\tappend(p1, t3);\n \t\t\tappend(a1, t4);\n \t\t\tappend(a1, p2);\n \t\t\tappend(p2, t5);\n \t\t\tappend(div5, t6);\n \t\t\tappend(div5, div4);\n \t\t},\n \t\tp(ctx, [dirty]) {\n \t\t\tif (dirty & /*article*/ 1 && img.src !== (img_src_value = \"/\" + /*article*/ ctx[0].image.file_name)) {\n \t\t\t\tattr(img, \"src\", img_src_value);\n \t\t\t}\n\n \t\t\tif (dirty & /*article*/ 1 && img_alt_value !== (img_alt_value = /*article*/ ctx[0].title)) {\n \t\t\t\tattr(img, \"alt\", img_alt_value);\n \t\t\t}\n\n \t\t\tif (dirty & /*article*/ 1 && img_width_value !== (img_width_value = /*article*/ ctx[0].image.width)) {\n \t\t\t\tattr(img, \"width\", img_width_value);\n \t\t\t}\n\n \t\t\tif (dirty & /*article*/ 1 && img_height_value !== (img_height_value = /*article*/ ctx[0].image.height)) {\n \t\t\t\tattr(img, \"height\", img_height_value);\n \t\t\t}\n\n \t\t\tif (dirty & /*article*/ 1 && t1_value !== (t1_value = (/*article*/ ctx[0].category && /*article*/ ctx[0].category.name) + \"\")) set_data(t1, t1_value);\n\n \t\t\tif (dirty & /*article*/ 1 && a0_href_value !== (a0_href_value = \"/categories/\" + /*article*/ ctx[0].category_id)) {\n \t\t\t\tattr(a0, \"href\", a0_href_value);\n \t\t\t}\n\n \t\t\tif (dirty & /*article*/ 1 && t3_value !== (t3_value = /*article*/ ctx[0].title + \"\")) set_data(t3, t3_value);\n \t\t\tif (dirty & /*article*/ 1 && t5_value !== (t5_value = /*article*/ ctx[0].excerpt + \"\")) set_data(t5, t5_value);\n\n \t\t\tif (dirty & /*article*/ 1 && a1_href_value !== (a1_href_value = \"/articles/\" + /*article*/ ctx[0].id)) {\n \t\t\t\tattr(a1, \"href\", a1_href_value);\n \t\t\t}\n \t\t},\n \t\ti: noop,\n \t\to: noop,\n \t\td(detaching) {\n \t\t\tif (detaching) detach(div6);\n \t\t}\n \t};\n }", "title": "" }, { "docid": "2bc326cd14d735ae6c5bda5920a36351", "score": "0.49621394", "text": "function done(err, srcOrTemplate) {\n var template;\n if (err) {\n return chunk.setError(err);\n }\n // Prefer a template that is passed via callback over the cached version.\n template = getTemplate(srcOrTemplate, false) || getTemplate(name, dust.config.cache);\n if (!template) {\n // It's a template string, compile it and register under `name`\n if(dust.compile) {\n template = dust.loadSource(dust.compile(srcOrTemplate, name));\n } else {\n return chunk.setError(new Error('Dust compiler not available'));\n }\n }\n template(chunk, Context.wrap(context, template.templateName)).end();\n }", "title": "" }, { "docid": "cae20a73cafe36aec1e1c987d82bd50c", "score": "0.49588794", "text": "function parse(template,options){warn$2=options.warn||baseWarn;platformIsPreTag=options.isPreTag||no;platformMustUseProp=options.mustUseProp||no;platformGetTagNamespace=options.getTagNamespace||no;transforms=pluckModuleFunction(options.modules,'transformNode');preTransforms=pluckModuleFunction(options.modules,'preTransformNode');postTransforms=pluckModuleFunction(options.modules,'postTransformNode');delimiters=options.delimiters;var stack=[];var preserveWhitespace=options.preserveWhitespace!==false;var root;var currentParent;var inVPre=false;var inPre=false;var warned=false;function warnOnce(msg){if(!warned){warned=true;warn$2(msg);}}function endPre(element){// check pre state\nif(element.pre){inVPre=false;}if(platformIsPreTag(element.tag)){inPre=false;}}parseHTML(template,{warn:warn$2,expectHTML:options.expectHTML,isUnaryTag:options.isUnaryTag,canBeLeftOpenTag:options.canBeLeftOpenTag,shouldDecodeNewlines:options.shouldDecodeNewlines,shouldKeepComment:options.comments,start:function start(tag,attrs,unary){// check namespace.\n// inherit parent ns if there is one\nvar ns=currentParent&&currentParent.ns||platformGetTagNamespace(tag);// handle IE svg bug\n/* istanbul ignore if */if(isIE&&ns==='svg'){attrs=guardIESVGBug(attrs);}var element=createASTElement(tag,attrs,currentParent);if(ns){element.ns=ns;}if(isForbiddenTag(element)&&!isServerRendering()){element.forbidden=true;\"development\"!=='production'&&warn$2('Templates should only be responsible for mapping the state to the '+'UI. Avoid placing tags with side-effects in your templates, such as '+\"<\"+tag+\">\"+', as they will not be parsed.');}// apply pre-transforms\nfor(var i=0;i<preTransforms.length;i++){element=preTransforms[i](element,options)||element;}if(!inVPre){processPre(element);if(element.pre){inVPre=true;}}if(platformIsPreTag(element.tag)){inPre=true;}if(inVPre){processRawAttrs(element);}else if(!element.processed){// structural directives\nprocessFor(element);processIf(element);processOnce(element);// element-scope stuff\nprocessElement(element,options);}function checkRootConstraints(el){{if(el.tag==='slot'||el.tag==='template'){warnOnce(\"Cannot use <\"+el.tag+\"> as component root element because it may \"+'contain multiple nodes.');}if(el.attrsMap.hasOwnProperty('v-for')){warnOnce('Cannot use v-for on stateful component root element because '+'it renders multiple elements.');}}}// tree management\nif(!root){root=element;checkRootConstraints(root);}else if(!stack.length){// allow root elements with v-if, v-else-if and v-else\nif(root.if&&(element.elseif||element.else)){checkRootConstraints(element);addIfCondition(root,{exp:element.elseif,block:element});}else{warnOnce(\"Component template should contain exactly one root element. \"+\"If you are using v-if on multiple elements, \"+\"use v-else-if to chain them instead.\");}}if(currentParent&&!element.forbidden){if(element.elseif||element.else){processIfConditions(element,currentParent);}else if(element.slotScope){// scoped slot\ncurrentParent.plain=false;var name=element.slotTarget||'\"default\"';(currentParent.scopedSlots||(currentParent.scopedSlots={}))[name]=element;}else{currentParent.children.push(element);element.parent=currentParent;}}if(!unary){currentParent=element;stack.push(element);}else{endPre(element);}// apply post-transforms\nfor(var i$1=0;i$1<postTransforms.length;i$1++){postTransforms[i$1](element,options);}},end:function end(){// remove trailing whitespace\nvar element=stack[stack.length-1];var lastNode=element.children[element.children.length-1];if(lastNode&&lastNode.type===3&&lastNode.text===' '&&!inPre){element.children.pop();}// pop stack\nstack.length-=1;currentParent=stack[stack.length-1];endPre(element);},chars:function chars(text){if(!currentParent){{if(text===template){warnOnce('Component template requires a root element, rather than just text.');}else if(text=text.trim()){warnOnce(\"text \\\"\"+text+\"\\\" outside root element will be ignored.\");}}return;}// IE textarea placeholder bug\n/* istanbul ignore if */if(isIE&&currentParent.tag==='textarea'&&currentParent.attrsMap.placeholder===text){return;}var children=currentParent.children;text=inPre||text.trim()?isTextTag(currentParent)?text:decodeHTMLCached(text)// only preserve whitespace if its not right after a starting tag\n:preserveWhitespace&&children.length?' ':'';if(text){var expression;if(!inVPre&&text!==' '&&(expression=parseText(text,delimiters))){children.push({type:2,expression:expression,text:text});}else if(text!==' '||!children.length||children[children.length-1].text!==' '){children.push({type:3,text:text});}}},comment:function comment(text){currentParent.children.push({type:3,text:text,isComment:true});}});return root;}", "title": "" }, { "docid": "832e8637f7b904c2733610434967974c", "score": "0.49555492", "text": "render(data, tpl, cursor, callback) {\n if (tpl === impress.FILE_IS_EMPTY) {\n callback(null, '');\n return;\n }\n const doc = impress.parseTemplate(data, tpl, cursor);\n let result = '';\n\n const iterate = (item, next) => {\n let cursorNew;\n if (item.type === 'plain') {\n result += api.common.subst(item.tpl, data, cursor);\n next();\n } else if (item.type === 'inline') {\n cursorNew = cursor === '' ? item.name : cursor + '.' + item.name;\n this.render(data, item.tpl, cursorNew, (err, tpl) => {\n result += tpl;\n next();\n });\n } else if (item.type === 'include') {\n cursorNew = cursor === '' ? item.name : cursor + '.' + item.name;\n this.execPath = this.realPath;\n this.execPathDir = this.realPathDir;\n this.template(data, item.name, cursorNew, (err, tpl) => {\n if (tpl !== impress.FILE_IS_EMPTY) {\n result += tpl || impress.TPL_NOT_FOUND + item.name;\n }\n next();\n });\n }\n };\n\n const done = () => {\n callback(null, result);\n };\n\n api.metasync.series(doc, iterate, done);\n }", "title": "" }, { "docid": "10c815015ab2d81989136114128d2775", "score": "0.49541923", "text": "function done(context, contents) {\n // Store the rendered template someplace so it can be re-assignable.\n var rendered;\n // This allows the `render` method to be asynchronous as well as `fetch`.\n var renderAsync = LayoutManager._makeAsync(options, function(rendered) {\n applyTemplate(rendered);\n });\n\n // Ensure the cache is up-to-date.\n LayoutManager.cache(url, contents);\n\n // Render the View into the el property.\n if (contents) {\n rendered = options.render.call(renderAsync, contents, context);\n }\n\n // If the function was synchronous, continue execution.\n if (!renderAsync._isAsync) {\n applyTemplate(rendered);\n }\n }", "title": "" }, { "docid": "4e55fe9c2f1d8464b7e95ee9046f9324", "score": "0.4951276", "text": "function create_fragment$_(ctx) {\n \tlet current;\n \tconst default_slot_template = /*#slots*/ ctx[1].default;\n \tconst default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[0], null);\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tif (default_slot) default_slot.c();\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tif (default_slot) {\n \t\t\t\tdefault_slot.m(target, anchor);\n \t\t\t}\n\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: function update(ctx, [dirty]) {\n \t\t\tif (default_slot) {\n \t\t\t\tif (default_slot.p && (!current || dirty & /*$$scope*/ 1)) {\n \t\t\t\t\tupdate_slot_base(\n \t\t\t\t\t\tdefault_slot,\n \t\t\t\t\t\tdefault_slot_template,\n \t\t\t\t\t\tctx,\n \t\t\t\t\t\t/*$$scope*/ ctx[0],\n \t\t\t\t\t\t!current\n \t\t\t\t\t\t? get_all_dirty_from_scope(/*$$scope*/ ctx[0])\n \t\t\t\t\t\t: get_slot_changes(default_slot_template, /*$$scope*/ ctx[0], dirty, null),\n \t\t\t\t\t\tnull\n \t\t\t\t\t);\n \t\t\t\t}\n \t\t\t}\n \t\t},\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(default_slot, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(default_slot, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tif (default_slot) default_slot.d(detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$_.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "eb299d823340726b25d1772e47d5fde3", "score": "0.49464142", "text": "render() {\n const draw = [\n {\n block: 'not-found-page',\n content: [\n {\n elem: 'text',\n elemMods: {main: true},\n content: 'Oops, we have lost this page :C',\n },\n {\n elem: 'text',\n elemMods: {additional: true},\n content: 'or you typed something wrong C:',\n },\n {\n elem: 'link',\n attrs: {'href': '#', 'data-link-type': '/'},\n content: 'But you can go to our main page!',\n },\n ],\n },\n ];\n\n this.parent.insertAdjacentHTML('beforeend', bemhtml.apply(draw));\n }", "title": "" }, { "docid": "8c47bf9a7db2501fec446319c0426e3d", "score": "0.4943754", "text": "_render({}) {\n return html`\n <div>waaaaa</div>\n `;\n }", "title": "" }, { "docid": "306e5fab629467418d9ecec17c5a1c35", "score": "0.49337724", "text": "function create_fragment(ctx) {\n \tlet current;\n \tconst default_slot_template = /*#slots*/ ctx[9].default;\n \tconst default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[8], null);\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tif (default_slot) default_slot.c();\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tif (default_slot) {\n \t\t\t\tdefault_slot.m(target, anchor);\n \t\t\t}\n\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: function update(ctx, [dirty]) {\n \t\t\tif (default_slot) {\n \t\t\t\tif (default_slot.p && dirty & /*$$scope*/ 256) {\n \t\t\t\t\tupdate_slot(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[8], dirty, null, null);\n \t\t\t\t}\n \t\t\t}\n \t\t},\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(default_slot, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(default_slot, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tif (default_slot) default_slot.d(detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "80f6cf18b459de824bad5853a58a0161", "score": "0.49336702", "text": "function render(template, context) {\n\n var uid, tokens,\n\n \t/**\n \t * Recursive parsing method. Parse template string in context of provided object data.\n \t * @param {String} str Template string.\n \t * @param {Object} data Data for template.\n \t */\n process = function(str, data) {\n \t\treturn str.replace(/\\{_(\\d+?)\\}/g, function(a, b) {\n \t\t\tvar token = tokens[b], repl, i;\n \t\t\tif (!token.expr) {\n \t\t\t\trepl = evl(data, tokens[b].buffer);\n \t\t\t\tif (token.modif.length) {\n \t\t\t\t\tfor (i in token.modif) {\n \t\t\t\t\t\tvar modif = token.modif[i],\n \t\t\t\t\t\t\tparams = [],\n \t\t\t\t\t\t\tcheck = token.modif[i].match(/(\\w+)\\(([\\s\\S]+)\\)/);\n\n \t\t\t\t\t\tif (check) {\n \t\t\t\t\t\t\tmodif = check[1];\n \t\t\t\t\t\t\tparams = check[2].split(/\\s*,\\s*/);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tparams.unshift(repl);\n \t\t\t\t\t\tmodif = Ashe.modifiers[modif] || window[modif];\n\n \t\t\t\t\t\tif (typeof modif != 'function') {\n \t\t\t\t\t\t\tthrow new Error('Ashe: Unknown modifier \"' + token.modif[i] + '\".');\n \t\t\t\t\t\t}\n\n \t\t\t\t\t\trepl = modif.apply(this, params);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\treturn repl;\n \t\t\t}\n \t\t\telse {\n \t\t\t\tvar block;\n \t\t\t\tswitch (token.expr.type) {\n \t\t\t\t\tcase 'if':\n \t\t\t\t\t\tvar cond = evl(data, token.expr.cond);\n \t\t\t\t\t\tblock = token.buffer.match(cond\n \t\t\t\t\t\t\t? /\\{%\\s*if\\s+.+?\\s*%\\}([\\s\\S]*?)\\{%/i\n \t\t\t\t\t\t\t: /\\{%\\s*else\\s*%\\}([\\s\\S]*?)\\{%/i\n \t\t\t\t\t\t);\n \t\t\t\t\t\treturn block ? process(block[1], data) : '';\n\n \t\t\t\t\tcase 'for':\n \t\t\t\t\t\tvar loopData = evl(data, token.expr.list);\n \t\t\t\t\t\tif (typeof loopData == 'undefined') {\n \t\t\t\t\t\t\tif (Ashe.debug) {\n \t\t\t\t\t\t\t\tthrow new Error('Ashe: Undefined list \"' + token.expr.list + '\".');\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\treturn '';\n \t\t\t\t\t\t}\n\n \t\t\t\t\t\tif (hasElements(loopData)) {\n \t\t\t\t\t\t\tblock = token.buffer.match(/\\{%\\s*for.*?\\s*%\\}([\\s\\S]*?)\\{%/i);\n \t\t\t\t\t\t\tif (block) {\n \t\t\t\t\t\t\t\tvar key, k,\n \t\t\t\t\t\t\t\t\telem = token.expr.elem,\n \t\t\t\t\t\t\t\t\tsplit = elem.split(/\\s*,\\s*/),\n \t\t\t\t\t\t\t\t\tsubStr = '';\n\n \t\t\t\t\t\t\t\tif (split.length == 2) {\n \t\t\t\t\t\t\t\t\tkey = split[0];\n \t\t\t\t\t\t\t\t\telem = split[1];\n \t\t\t\t\t\t\t\t}\n\n \t\t\t\t\t\t\t\tfor (k in loopData) {\n \t\t\t\t\t\t\t\t\tif (loopData.hasOwnProperty(k)) {\n \t\t\t\t\t\t\t\t\t\tvar tmpObj = {};\n \t\t\t\t\t\t\t\t\t\tif (key) tmpObj[key] = k;\n \t\t\t\t\t\t\t\t\t\ttmpObj[elem] = loopData[k];\n \t\t\t\t\t\t\t\t\t\tsubStr += process(block[1], tmpObj);\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\treturn subStr;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\treturn '';\n \t\t\t\t\t\t}\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\tblock = token.buffer.match(/\\{%\\s*else\\s*%\\}([\\s\\S]*?)\\{%/i);\n \t\t\t\t\t\t\treturn block ? process(block[1], loopData) : '';\n \t\t\t\t\t\t}\n\n \t\t\t\t\tcase 'set':\n \t\t\t\t\t\tvar t = token.expr,\n \t\t\t\t\t\t\tv = t.sval ? evl(data, t.sval) : process(token.buffer.replace(/\\{%.*?%\\}/g , ''), data);\n \t\t\t\t\t\tdata[t.svar] = v;\n \t\t\t\t\t\treturn '';\n \t\t\t\t}\n \t\t\t}\n \t\t});\n \t},\n\n \t/**\n \t * Replace just markers between {{ and }}.\n \t */\n \tproccessMarkers = function(str) {\n \t\tvar i = 0;\n \t\tstr = trim(str);\n\n \t\twhile ((i = str.indexOf('{{', i)) != -1) {\n \t\t\tvar id = uid++,\n \t\t\t\tend = str.indexOf('}}', i),\n \t\t\t\tbuffer = trim(str.slice(i+2, end)).split('|'),\n \t\t\t\trepl = '{_' + id + '}';\n\n \t\t\ttokens[id] = {\n \t\t\t\tbuffer: buffer.shift(),\n \t\t\t\tmodif: buffer\n \t\t\t};\n\n \t\t\tstr = replaceWith(str, repl, i, end+2);\n \t\t\ti = i + repl.length;\n \t\t}\n\n \t\treturn str;\n \t},\n\n \t/**\n \t * Replace control blocks, loops, conditions.\n \t */\n \tproccessControls = function(str, i, lookingFor, exprDescr, inline) {\n \t\tvar from = i;\n\n \t\twhile ((i = str.indexOf('{%', i)) != -1) {\n \t\t\tvar id = uid++,\n \t\t\t\tend = str.indexOf('%}', i),\n \t\t\t\texpr = str.slice(i+2, end),\n \t\t\t\trepl = '{_' + id + '}';\n\n \t\t\tif (inline || (lookingFor && expr.match(lookingFor))) {\n \t\t\t\tvar start = from - 2;\n \t\t\t\tend = i + expr.length + 4;\n\n \t\t\t\ttokens[id] = {\n \t\t\t\t\tbuffer: trim(str.slice(start, end)),\n \t\t\t\t\texpr: exprDescr\n \t\t\t\t};\n\n \t\t\t\treturn replaceWith(str, repl, start, end);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tvar m;\n \t\t\t\t// For loop\n \t\t\t\tif (m = expr.match(/\\s*for\\s+((?:\\w+\\s*,)?\\s*\\w+)\\s+in\\s+(.+?)\\s*$/i)) {\n \t\t\t\t\tstr = proccessControls(str, i+2, /\\s*endfor\\s*/i, {\n \t\t\t\t\t\ttype: 'for',\n \t\t\t\t\t\telem: m[1],\n \t\t\t\t\t\tlist: m[2]\n \t\t\t\t\t});\n \t\t\t\t}\n \t\t\t\t// If statement\n \t\t\t\telse if (m = expr.match(/\\s*if\\s+(.+)\\s*/i)) {\n \t\t\t\t\tstr = proccessControls(str, i+2, /\\s*endif\\s*/i, {\n \t\t\t\t\t\ttype: 'if',\n \t\t\t\t\t\tcond: trim(m[1])\n \t\t\t\t\t});\n \t\t\t\t}\n \t\t\t\t// Set expression\n \t\t\t\telse if (m = expr.match(/\\s*set\\s+(\\w+)(?:\\s*=\\s*(.*)?)?\\s*/i)) {\n \t\t\t\t\tvar dat = {\n \t\t\t\t\t\ttype: 'set',\n \t\t\t\t\t\tsvar: m[1],\n \t\t\t\t\t\tsval: m[2]\n \t\t\t\t\t};\n \t\t\t\t\tstr = m[2]\n \t\t\t\t\t\t? proccessControls(str, i, null, dat, true)\n \t\t\t\t\t\t: proccessControls(str, i+2, /\\s*endset\\s*/i, dat);\n \t\t\t\t}\n \t\t\t}\n \t\t\ti = i + repl.length;\n \t\t}\n\n \t\treturn str;\n \t},\n\n \t/**\n \t * Need to flush closure vars before next parsing.\n \t */\n \treset = function() {\n \t\tuid = 1;\n \t\ttokens = {};\n \t},\n\n \t/**\n \t * Resolve variables from the data scope.\n \t */\n \tevl = function(data, buffer) {\n \t\tvar parts = ~buffer.indexOf('.') ? buffer.split('.') : [buffer],\n \t\t\ti, l = parts.length,\n \t\t\tret = data;\n\n \t\tfor (i = 0; i < l; i++) {\n \t\t\tret = ret[parts[i]];\n \t\t\tif (!ret) return '';\n \t\t}\n\n \t\treturn typeof ret == 'function' ? ret.call(data) : ret;\n \t},\n\n \t/**\n \t * Check if array or object is empty.\n \t * @param {Array|Object}\n \t */\n \thasElements = function(obj) {\n \t\tif (obj.hasOwnProperty('length')) return !!obj.length;\n \t\tfor (var k in obj) {\n \t\t\tif (obj.hasOwnProperty(k)) return true;\n \t\t}\n \t\treturn false;\n \t},\n\n \t/**\n \t * Trim whitespaces.\n \t */\n \ttrim = function(s) {\n \t\treturn s.replace(/^\\s*|\\s*$/g, '');\n \t},\n\n \t/**\n \t * Replace specified part of string.\n \t */\n \treplaceWith = function(str, replace, start, end) {\n \t\treturn str.substr(0, start) + replace + str.substr(end);\n \t},\n\n \t/**\n \t * Turn on debug messages about undefined vars and problems of parsing.\n \t */\n \t__debug = false,\n\n \t/**\n \t * Modifiers object.\n \t * @type {Object}\n \t */\n \t__modifiers = {},\n\n \t/**\n \t * Run analysing and parsing.\n \t * @param {String} tplStr Template string.\n \t * @param {Object} tplData Data passed to the template.\n \t */\n \t__parse = function(tplStr, tplData) {\n \t\treturn reset(), process(proccessControls(proccessMarkers(tplStr), 0), tplData || {});\n \t},\n\n \t/**\n \t * Add new modifiers.\n \t */\n __addModifiers = function(obj) {\n \t\tfor (var i in obj) {\n \t\t\tif (obj.hasOwnProperty(i)) __modifiers[i] = obj[i];\n \t\t}\n \t};\n\n /**\n * Modified exports for Mixcloud Tracklist (doesn't monkey patch\n * `window` and simply returns rendered HTML).\n */\n log('Rendering template');\n return __parse(template, context);\n }", "title": "" }, { "docid": "422e4e38b7ae4b6665c1f789cdfc28e2", "score": "0.4923037", "text": "[symbols.render]() {\n if (super[symbols.render]) { super[symbols.render](); }\n if (this.shadowRoot) {\n // Already rendered\n return;\n }\n \n // See if we've already processed a template for this type of element.\n const template = getPreparedTemplate(this);\n\n // Stamp the template into a new shadow root.\n if (template) {\n const root = this.attachShadow({ mode: 'open' });\n const clone = document.importNode(template.content, true);\n root.appendChild(clone);\n }\n }", "title": "" }, { "docid": "9818a0c51dceaef2bdecd2a0209dee53", "score": "0.49184892", "text": "function create_fragment$11(ctx) {\n \tlet header;\n \tlet t0;\n \tlet t1;\n \tlet footer;\n \tlet current;\n \theader = new Header({ $$inline: true });\n \tconst default_slot_template = /*#slots*/ ctx[1].default;\n \tconst default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[0], null);\n \tfooter = new Footer({ $$inline: true });\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tcreate_component(header.$$.fragment);\n \t\t\tt0 = space();\n \t\t\tif (default_slot) default_slot.c();\n \t\t\tt1 = space();\n \t\t\tcreate_component(footer.$$.fragment);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(header, target, anchor);\n \t\t\tinsert_dev(target, t0, anchor);\n\n \t\t\tif (default_slot) {\n \t\t\t\tdefault_slot.m(target, anchor);\n \t\t\t}\n\n \t\t\tinsert_dev(target, t1, anchor);\n \t\t\tmount_component(footer, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: function update(ctx, [dirty]) {\n \t\t\tif (default_slot) {\n \t\t\t\tif (default_slot.p && (!current || dirty & /*$$scope*/ 1)) {\n \t\t\t\t\tupdate_slot_base(\n \t\t\t\t\t\tdefault_slot,\n \t\t\t\t\t\tdefault_slot_template,\n \t\t\t\t\t\tctx,\n \t\t\t\t\t\t/*$$scope*/ ctx[0],\n \t\t\t\t\t\t!current\n \t\t\t\t\t\t? get_all_dirty_from_scope(/*$$scope*/ ctx[0])\n \t\t\t\t\t\t: get_slot_changes(default_slot_template, /*$$scope*/ ctx[0], dirty, null),\n \t\t\t\t\t\tnull\n \t\t\t\t\t);\n \t\t\t\t}\n \t\t\t}\n \t\t},\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(header.$$.fragment, local);\n \t\t\ttransition_in(default_slot, local);\n \t\t\ttransition_in(footer.$$.fragment, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(header.$$.fragment, local);\n \t\t\ttransition_out(default_slot, local);\n \t\t\ttransition_out(footer.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(header, detaching);\n \t\t\tif (detaching) detach_dev(t0);\n \t\t\tif (default_slot) default_slot.d(detaching);\n \t\t\tif (detaching) detach_dev(t1);\n \t\t\tdestroy_component(footer, detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$11.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.4918312", "text": "render(){}", "title": "" }, { "docid": "de59c68d1776962651140d8cd0a04b3d", "score": "0.49167863", "text": "render() {\n return html`\n ${ until(\n this.#initializeStore()\n .then(response => {\n return html`${appTemplate({ showModal: this.#showModal, filterData: this.#filterData})}`;\n })\n .catch((error) => { console.error('Error:', error); }),\n html`<h4>Loading...</h4>`\n )}`;\n }", "title": "" }, { "docid": "2d68898c5c5db1e0aff3db75bc5282e1", "score": "0.49118096", "text": "function startTagInTemplate(p, token) {\r\n\t var tn = token.tagName;\r\n\r\n\t if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META ||\r\n\t tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE)\r\n\t startTagInHead(p, token);\r\n\r\n\t else {\r\n\t var newInsertionMode = TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn] || IN_BODY_MODE;\r\n\r\n\t p._popTmplInsertionMode();\r\n\t p._pushTmplInsertionMode(newInsertionMode);\r\n\t p.insertionMode = newInsertionMode;\r\n\t p._processToken(token);\r\n\t }\r\n\t}", "title": "" }, { "docid": "ada7b36deddb0eba55e3ef46ecfe7ca8", "score": "0.4908203", "text": "function create_fragment$i(ctx) {\n\tlet tr0;\n\tlet td0;\n\tlet t0;\n\tlet t1;\n\tlet tr1;\n\tlet td1;\n\tlet t2;\n\tlet t3;\n\tlet tr2;\n\tlet td2;\n\tlet t4;\n\tlet td3;\n\tlet t6;\n\tlet td4;\n\tlet t7;\n\n\treturn {\n\t\tc() {\n\t\t\ttr0 = element(\"tr\");\n\t\t\ttd0 = element(\"td\");\n\t\t\tt0 = text(/*name*/ ctx[0]);\n\t\t\tt1 = space();\n\t\t\ttr1 = element(\"tr\");\n\t\t\ttd1 = element(\"td\");\n\t\t\tt2 = text(/*description*/ ctx[2]);\n\t\t\tt3 = space();\n\t\t\ttr2 = element(\"tr\");\n\t\t\ttd2 = element(\"td\");\n\t\t\tt4 = space();\n\t\t\ttd3 = element(\"td\");\n\t\t\ttd3.textContent = \"Version\";\n\t\t\tt6 = space();\n\t\t\ttd4 = element(\"td\");\n\t\t\tt7 = text(/*version*/ ctx[1]);\n\t\t\tattr(td0, \"colspan\", \"3\");\n\t\t\tattr(td1, \"colspan\", \"3\");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, tr0, anchor);\n\t\t\tappend(tr0, td0);\n\t\t\tappend(td0, t0);\n\t\t\tinsert(target, t1, anchor);\n\t\t\tinsert(target, tr1, anchor);\n\t\t\tappend(tr1, td1);\n\t\t\tappend(td1, t2);\n\t\t\tinsert(target, t3, anchor);\n\t\t\tinsert(target, tr2, anchor);\n\t\t\tappend(tr2, td2);\n\t\t\tappend(tr2, t4);\n\t\t\tappend(tr2, td3);\n\t\t\tappend(tr2, t6);\n\t\t\tappend(tr2, td4);\n\t\t\tappend(td4, t7);\n\t\t},\n\t\tp(ctx, [dirty]) {\n\t\t\tif (dirty & /*name*/ 1) set_data(t0, /*name*/ ctx[0]);\n\t\t\tif (dirty & /*description*/ 4) set_data(t2, /*description*/ ctx[2]);\n\t\t\tif (dirty & /*version*/ 2) set_data(t7, /*version*/ ctx[1]);\n\t\t},\n\t\ti: noop,\n\t\to: noop,\n\t\td(detaching) {\n\t\t\tif (detaching) detach(tr0);\n\t\t\tif (detaching) detach(t1);\n\t\t\tif (detaching) detach(tr1);\n\t\t\tif (detaching) detach(t3);\n\t\t\tif (detaching) detach(tr2);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "2ed19d52c696ee8b0f713dce0176b22e", "score": "0.4899402", "text": "function r(e,t,n){var r=i.insertText(e.getCurrentContent(),t,n,e.getCurrentInlineStyle());return a.push(e,r,\"insert-fragment\")}", "title": "" }, { "docid": "afd32ec530b54e9fa278a05e42c9c192", "score": "0.48879385", "text": "_compileTemplate() {\n var self = this;\n\n var mainTemplateName = self.data[self.options.templateKey];\n var mainTemplate = self.partials[mainTemplateName].content;\n\n self.template = Handlebars.compile(mainTemplate);\n\n self.handlebarsReady.resolve();\n }", "title": "" }, { "docid": "508c54cb2a7d9973b797971e2e51f3fc", "score": "0.48878998", "text": "async function parseTemplate(unparsed, options) {\n const OPEN = options.delimiters.open;\n const CLOSE = options.delimiters.close;\n const COMMENT = options.delimiters.comment;\n const ESCAPE = options.delimiters.escape;\n const UNESCAPE = options.delimiters.unescape;\n const IMPORT = options.delimiters.import;\n let parsed;\n let i = 0;\n let length = unparsed.length;\n parsed = \"with($locals||{}){$buffer.push(`\";\n for (; i < length; ++i) {\n let c = unparsed[i];\n if (unparsed.slice(i, i + OPEN.length) === OPEN) {\n i += OPEN.length;\n switch (unparsed[i]) {\n case COMMENT:// Comments -- output nothing\n tagContents(COMMENT + CLOSE);\n break;\n case ESCAPE:// Output escaped value\n ++i;\n parsed += \"`,$xml(\";\n parsed += tagContents();\n parsed += \"),`\";\n break;\n case UNESCAPE:// Output unescaped value\n ++i;\n parsed += \"`,(\";\n parsed += tagContents();\n parsed += \"),`\";\n break;\n case IMPORT:// Include another file\n ++i;\n parsed += \"`,`\";\n // Cache the previous values\n const importContents = tagContents().split(\"|\");\n const templateName = importContents[0].trim();\n const locals = importContents[1] && importContents[1].trim() || \"$locals\";\n // Read the next template using the new values\n const unparsedImport = await getTemplate(templateName, options);\n parsed += \"`);(function($buffer,$locals){\" + unparsedImport + \"})($buffer,\" + locals + \");$buffer.push(`\";\n break;\n default:\n parsed += \"`);\";\n parsed += tagContents();\n parsed += \";$buffer.push(`\";\n break;\n }\n }\n else if (c === \"\\\\\") {\n // Backslashes need to be escaped\n parsed += \"\\\\\\\\\";\n }\n else if (c === \"`\") {\n // Backticks need to be escaped as that the character that we are using to surround our string literals\n // We chose them as backtick string literals are containing raw newline characters\n parsed += \"\\\\`\";\n }\n else if (c === \"$\") {\n // Since backtick string literals in javascript support interpolation, we need to escape the dollar sign\n parsed += \"\\\\$\";\n }\n else {\n parsed += c;\n }\n }\n parsed += \"`);}\";\n return parsed;\n function tagContents(endTag = CLOSE) {\n let end = unparsed.indexOf(endTag, i);\n if (end < 0) {\n throw new Error(\"Could not find matching close tag '\" + endTag + \"'.\");\n }\n let result = unparsed.substring(i, end);\n // Move the cursor to the end of the tag\n i = end + endTag.length - 1;\n return result;\n }\n}", "title": "" }, { "docid": "84c4a5409d6e9938c751fc91d6c0173a", "score": "0.48868966", "text": "function create_fragment$1m(ctx) {\n \tconst block = {\n \t\tc: noop,\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: noop,\n \t\tp: noop,\n \t\ti: noop,\n \t\to: noop,\n \t\td: noop\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$1m.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "18dfc8bccbc651e7500cfc77fe3450ce", "score": "0.48843083", "text": "function startTagInTemplate(p, token) {\n const tn = token.tagName;\n\n if (\n tn === $.BASE ||\n tn === $.BASEFONT ||\n tn === $.BGSOUND ||\n tn === $.LINK ||\n tn === $.META ||\n tn === $.NOFRAMES ||\n tn === $.SCRIPT ||\n tn === $.STYLE ||\n tn === $.TEMPLATE ||\n tn === $.TITLE\n ) {\n startTagInHead(p, token);\n } else {\n const newInsertionMode = TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn] || IN_BODY_MODE;\n\n p._popTmplInsertionMode();\n p._pushTmplInsertionMode(newInsertionMode);\n p.insertionMode = newInsertionMode;\n p._processToken(token);\n }\n }", "title": "" }, { "docid": "f0b33a2e1344c3d70baf98907e7b5909", "score": "0.4880811", "text": "function create_fragment$E(ctx) {\n \tlet fullcalendar;\n \tlet current;\n\n \tfullcalendar = new FullCalendar({\n \t\t\tprops: { options: /*options*/ ctx[0] },\n \t\t\t$$inline: true\n \t\t});\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tcreate_component(fullcalendar.$$.fragment);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(fullcalendar, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: noop,\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(fullcalendar.$$.fragment, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(fullcalendar.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(fullcalendar, detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$E.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "9e2ed30d36bdd81e9c4fc8479dc41edc", "score": "0.48793486", "text": "static splitTextNodes(node) {\n if(node && node.childNodes && node.childNodes.length) {\n for(let i=node.childNodes.length-1;i>=0;i--) {\n this.splitTextNodes(node.childNodes[i]);\n }\n }\n if(node.tagName === \"TEMPLATE\" && !window.isIE11Lyte) {\n this.splitTextNodes(node.content);\n }\n if(node.nodeType === node.TEXT_NODE) {\n let nodeValue = node.nodeValue;\n if(nodeValue){\n let mustacheValues = nodeValue.match(/{{[^}]*?(?:(?:('|\")[^\\1]*?\\1)[^}]*?)*}}/g); //'\n if(!mustacheValues) {\n return;\n }\n let newNodeArray = [];\n for(let i=0;i<mustacheValues.length;i++) {\n let mustacheStartIndex = nodeValue.indexOf(mustacheValues[i]);\n let mustacheEndIndex = mustacheStartIndex + mustacheValues[i].length;\n if(mustacheStartIndex) {\n newNodeArray.push(document.createTextNode(nodeValue.substring(0, mustacheStartIndex)));\n }\n newNodeArray.push(document.createTextNode(nodeValue.substring(mustacheStartIndex, mustacheEndIndex)));\n nodeValue = nodeValue.substring(mustacheEndIndex);\n }\n if(!(!nodeValue.trim() && node.nextSibling && node.nextSibling.nodeType === 3 && !node.nextSibling.nodeValue.trim())) {\n newNodeArray.push(document.createTextNode(nodeValue));\n }\n //Fix for IE Edge issue with higher versions where node.replaceWith is not working when the parent is a doc fragment.\n if(window.replaceWithNeeded && node.parentNode.nodeName === \"#document-fragment\") {\n \tfor(let i=0;i<newNodeArray.length;i++) {\n node.parentNode.insertBefore(newNodeArray[i],node);\n }\n node.remove();\n } else {\n \tnode.replaceWith.apply(node, newNodeArray);\n }\n }\n }\n }", "title": "" }, { "docid": "23e71342fc3fd06f8eb8cf88e5a0e5a7", "score": "0.48774442", "text": "render() {return null}", "title": "" }, { "docid": "da63ca46df9c6c59b58c7b726a744467", "score": "0.48764607", "text": "'content:file:beforeInsert'(document, database) {\n if (!database.markdown._generateBody) {\n let path\n\n // https://github.com/nuxt/content/blob/main/packages/content/parsers/markdown/index.js\n database.extendParser = {\n ...database.extendParser,\n '.md'(data, obj) {\n path = obj.path\n\n return database.markdown.toJSON(data)\n },\n }\n\n // https://github.com/nuxt/content/blob/main/packages/content/parsers/markdown/index.js\n database.markdown._generateBody = database.markdown.generateBody\n database.markdown.generateBody = (content, data) => {\n return database.markdown._generateBody(content, { ...data, path })\n }\n }\n }", "title": "" }, { "docid": "15df5055c33e219f8e9e841b829e2b5f", "score": "0.4872317", "text": "visitNormalTemplateBody(context) {\n let result = [];\n for (const templateStr of context.templateString()) {\n const errorTemplateStr = templateStr.errorTemplateString();\n if (errorTemplateStr) {\n result.push(this.buildLGDiagnostic(templateErrors_1.TemplateErrors.invalidTemplateBody, undefined, errorTemplateStr));\n }\n else {\n result = result.concat(this.visit(templateStr));\n }\n }\n return result;\n }", "title": "" }, { "docid": "d0f9cdbb8c2658736c6f8160468847ce", "score": "0.48712468", "text": "function Offer_svelte_create_fragment(ctx) {\n\tlet section;\n\tlet div8;\n\tlet div7;\n\tlet h2;\n\tlet t1;\n\tlet div6;\n\tlet slider;\n\tlet t2;\n\tlet div5;\n\tlet h4;\n\tlet t3_value = /*data*/ ctx[0].machine.category + \"\";\n\tlet t3;\n\tlet t4;\n\tlet div0;\n\tlet p0;\n\tlet span0;\n\tlet t7;\n\tlet t8;\n\tlet t9;\n\tlet t10;\n\tlet p1;\n\tlet t11;\n\tlet t12;\n\tlet t13_value = /*data*/ ctx[0].machine.price + \"\";\n\tlet t13;\n\tlet t14;\n\tlet ul;\n\tlet li0;\n\tlet t15_value = /*data*/ ctx[0].machine.headline + \"\";\n\tlet t15;\n\tlet t16;\n\tlet li1;\n\tlet t18;\n\tlet li2;\n\tlet t20;\n\tlet div4;\n\tlet div1;\n\tlet p2;\n\tlet span1;\n\tlet t21;\n\tlet t22_value = /*data*/ ctx[0].plan.promotionalPrice.toFixed(2) + \"\";\n\tlet t22;\n\tlet t23;\n\tlet t24;\n\tlet t25_value = /*data*/ ctx[0].plan.periodicFee.toFixed(2) + \"\";\n\tlet t25;\n\tlet t26;\n\tlet t27;\n\tlet p3;\n\tlet t28;\n\tlet t29;\n\tlet t30_value = /*data*/ ctx[0].machine.price + \"\";\n\tlet t30;\n\tlet t31;\n\tlet div3;\n\tlet button;\n\tlet t32;\n\tlet div2;\n\tlet a;\n\tlet span2;\n\tlet t34;\n\tlet arrow;\n\tlet a_href_value;\n\tlet current;\n\n\tslider = new components_SliderSwipe_svelte({\n\t\t\tprops: { slides: /*data*/ ctx[0].machine.slides }\n\t\t});\n\n\tbutton = new components_Button_svelte({\n\t\t\tprops: {\n\t\t\t\ttext: \"SUBSCRIBE\",\n\t\t\t\thiddenText: \"\",\n\t\t\t\ticonPlus: true,\n\t\t\t\ticonBasket: false\n\t\t\t}\n\t\t});\n\n\tbutton.$on(\"buttonClick\", /*clickHandler*/ ctx[1]);\n\tarrow = new components_Arrow_svelte({ props: { type: \"right\", color: \"brown\" } });\n\n\treturn {\n\t\tc() {\n\t\t\tsection = internal_element(\"section\");\n\t\t\tdiv8 = internal_element(\"div\");\n\t\t\tdiv7 = internal_element(\"div\");\n\t\t\th2 = internal_element(\"h2\");\n\t\t\th2.textContent = \"MIGHT BE YOUR PERFECT MATCH\";\n\t\t\tt1 = space();\n\t\t\tdiv6 = internal_element(\"div\");\n\t\t\tcreate_component(slider.$$.fragment);\n\t\t\tt2 = space();\n\t\t\tdiv5 = internal_element(\"div\");\n\t\t\th4 = internal_element(\"h4\");\n\t\t\tt3 = internal_text(t3_value);\n\t\t\tt4 = space();\n\t\t\tdiv0 = internal_element(\"div\");\n\t\t\tp0 = internal_element(\"p\");\n\t\t\tspan0 = internal_element(\"span\");\n\t\t\tspan0.textContent = `${/*currSymbol*/ ctx[2]}1.00`;\n\t\t\tt7 = internal_text(\"+ \");\n\t\t\tt8 = internal_text(/*currSymbol*/ ctx[2]);\n\t\t\tt9 = internal_text(\"55.00 / month\");\n\t\t\tt10 = space();\n\t\t\tp1 = internal_element(\"p\");\n\t\t\tt11 = internal_text(\"instead of \");\n\t\t\tt12 = internal_text(/*currSymbol*/ ctx[2]);\n\t\t\tt13 = internal_text(t13_value);\n\t\t\tt14 = space();\n\t\t\tul = internal_element(\"ul\");\n\t\t\tli0 = internal_element(\"li\");\n\t\t\tt15 = internal_text(t15_value);\n\t\t\tt16 = space();\n\t\t\tli1 = internal_element(\"li\");\n\t\t\tli1.textContent = \"Free Delivery\";\n\t\t\tt18 = space();\n\t\t\tli2 = internal_element(\"li\");\n\t\t\tli2.textContent = \"24 months minimum term\";\n\t\t\tt20 = space();\n\t\t\tdiv4 = internal_element(\"div\");\n\t\t\tdiv1 = internal_element(\"div\");\n\t\t\tp2 = internal_element(\"p\");\n\t\t\tspan1 = internal_element(\"span\");\n\t\t\tt21 = internal_text(/*currSymbol*/ ctx[2]);\n\t\t\tt22 = internal_text(t22_value);\n\t\t\tt23 = internal_text(\"+\\r\\n \");\n\t\t\tt24 = internal_text(/*currSymbol*/ ctx[2]);\n\t\t\tt25 = internal_text(t25_value);\n\t\t\tt26 = internal_text(\"\\r\\n / month\");\n\t\t\tt27 = space();\n\t\t\tp3 = internal_element(\"p\");\n\t\t\tt28 = internal_text(\"instead of\\r\\n \");\n\t\t\tt29 = internal_text(/*currSymbol*/ ctx[2]);\n\t\t\tt30 = internal_text(t30_value);\n\t\t\tt31 = space();\n\t\t\tdiv3 = internal_element(\"div\");\n\t\t\tcreate_component(button.$$.fragment);\n\t\t\tt32 = space();\n\t\t\tdiv2 = internal_element(\"div\");\n\t\t\ta = internal_element(\"a\");\n\t\t\tspan2 = internal_element(\"span\");\n\t\t\tspan2.textContent = \"More about this machine\";\n\t\t\tt34 = space();\n\t\t\tcreate_component(arrow.$$.fragment);\n\t\t\tattr(h2, \"class\", \"perfectMatch__title\");\n\t\t\tattr(h4, \"class\", \"perfectMatch__name\");\n\t\t\tattr(div0, \"class\", \"perfectMatch__price perfectMatch__price--m\");\n\t\t\tattr(ul, \"class\", \"perfectMatch__description\");\n\t\t\tattr(p3, \"class\", \"perfectMatch__price__original\");\n\t\t\tattr(div1, \"class\", \"perfectMatch__price perfectMatch__price--d\");\n\t\t\tattr(a, \"href\", a_href_value = /*data*/ ctx[0].machine.pdpURLs.desktop);\n\t\t\tattr(div2, \"class\", \"perfectMatch__moreAbout\");\n\t\t\tattr(div3, \"class\", \"perfectMatch__cta\");\n\t\t\tattr(div4, \"class\", \"perfectMatch__priceCta\");\n\t\t\tattr(div5, \"class\", \"perfectMatch__machineInfo\");\n\t\t\tattr(div6, \"class\", \"perfectMatch__machine\");\n\t\t\tattr(div7, \"class\", \"perfectMatch__content\");\n\t\t\tattr(div8, \"class\", \"perfectMatch__container\");\n\t\t\tattr(section, \"id\", \"offer\");\n\t\t\tattr(section, \"class\", \"perfectMatch\");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, section, anchor);\n\t\t\tappend(section, div8);\n\t\t\tappend(div8, div7);\n\t\t\tappend(div7, h2);\n\t\t\tappend(div7, t1);\n\t\t\tappend(div7, div6);\n\t\t\tmount_component(slider, div6, null);\n\t\t\tappend(div6, t2);\n\t\t\tappend(div6, div5);\n\t\t\tappend(div5, h4);\n\t\t\tappend(h4, t3);\n\t\t\tappend(div5, t4);\n\t\t\tappend(div5, div0);\n\t\t\tappend(div0, p0);\n\t\t\tappend(p0, span0);\n\t\t\tappend(p0, t7);\n\t\t\tappend(p0, t8);\n\t\t\tappend(p0, t9);\n\t\t\tappend(div0, t10);\n\t\t\tappend(div0, p1);\n\t\t\tappend(p1, t11);\n\t\t\tappend(p1, t12);\n\t\t\tappend(p1, t13);\n\t\t\tappend(div5, t14);\n\t\t\tappend(div5, ul);\n\t\t\tappend(ul, li0);\n\t\t\tappend(li0, t15);\n\t\t\tappend(ul, t16);\n\t\t\tappend(ul, li1);\n\t\t\tappend(ul, t18);\n\t\t\tappend(ul, li2);\n\t\t\tappend(div5, t20);\n\t\t\tappend(div5, div4);\n\t\t\tappend(div4, div1);\n\t\t\tappend(div1, p2);\n\t\t\tappend(p2, span1);\n\t\t\tappend(span1, t21);\n\t\t\tappend(span1, t22);\n\t\t\tappend(p2, t23);\n\t\t\tappend(p2, t24);\n\t\t\tappend(p2, t25);\n\t\t\tappend(p2, t26);\n\t\t\tappend(div1, t27);\n\t\t\tappend(div1, p3);\n\t\t\tappend(p3, t28);\n\t\t\tappend(p3, t29);\n\t\t\tappend(p3, t30);\n\t\t\tappend(div4, t31);\n\t\t\tappend(div4, div3);\n\t\t\tmount_component(button, div3, null);\n\t\t\tappend(div3, t32);\n\t\t\tappend(div3, div2);\n\t\t\tappend(div2, a);\n\t\t\tappend(a, span2);\n\t\t\tappend(a, t34);\n\t\t\tmount_component(arrow, a, null);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp(ctx, [dirty]) {\n\t\t\tconst slider_changes = {};\n\t\t\tif (dirty & /*data*/ 1) slider_changes.slides = /*data*/ ctx[0].machine.slides;\n\t\t\tslider.$set(slider_changes);\n\t\t\tif ((!current || dirty & /*data*/ 1) && t3_value !== (t3_value = /*data*/ ctx[0].machine.category + \"\")) set_data(t3, t3_value);\n\t\t\tif ((!current || dirty & /*data*/ 1) && t13_value !== (t13_value = /*data*/ ctx[0].machine.price + \"\")) set_data(t13, t13_value);\n\t\t\tif ((!current || dirty & /*data*/ 1) && t15_value !== (t15_value = /*data*/ ctx[0].machine.headline + \"\")) set_data(t15, t15_value);\n\t\t\tif ((!current || dirty & /*data*/ 1) && t22_value !== (t22_value = /*data*/ ctx[0].plan.promotionalPrice.toFixed(2) + \"\")) set_data(t22, t22_value);\n\t\t\tif ((!current || dirty & /*data*/ 1) && t25_value !== (t25_value = /*data*/ ctx[0].plan.periodicFee.toFixed(2) + \"\")) set_data(t25, t25_value);\n\t\t\tif ((!current || dirty & /*data*/ 1) && t30_value !== (t30_value = /*data*/ ctx[0].machine.price + \"\")) set_data(t30, t30_value);\n\n\t\t\tif (!current || dirty & /*data*/ 1 && a_href_value !== (a_href_value = /*data*/ ctx[0].machine.pdpURLs.desktop)) {\n\t\t\t\tattr(a, \"href\", a_href_value);\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(slider.$$.fragment, local);\n\t\t\ttransition_in(button.$$.fragment, local);\n\t\t\ttransition_in(arrow.$$.fragment, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(slider.$$.fragment, local);\n\t\t\ttransition_out(button.$$.fragment, local);\n\t\t\ttransition_out(arrow.$$.fragment, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) detach(section);\n\t\t\tdestroy_component(slider);\n\t\t\tdestroy_component(button);\n\t\t\tdestroy_component(arrow);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "1250a68cc73f983832dd9af8112b9ac1", "score": "0.48683894", "text": "function create_fragment$1c(ctx) {\n \tlet header;\n \tlet t0;\n \tlet t1;\n \tlet footer;\n \tlet current;\n \theader = new Header({ $$inline: true });\n \tconst default_slot_template = /*#slots*/ ctx[1].default;\n \tconst default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[0], null);\n \tfooter = new Footer({ $$inline: true });\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tcreate_component(header.$$.fragment);\n \t\t\tt0 = space();\n \t\t\tif (default_slot) default_slot.c();\n \t\t\tt1 = space();\n \t\t\tcreate_component(footer.$$.fragment);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(header, target, anchor);\n \t\t\tinsert_dev(target, t0, anchor);\n\n \t\t\tif (default_slot) {\n \t\t\t\tdefault_slot.m(target, anchor);\n \t\t\t}\n\n \t\t\tinsert_dev(target, t1, anchor);\n \t\t\tmount_component(footer, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: function update(ctx, [dirty]) {\n \t\t\tif (default_slot) {\n \t\t\t\tif (default_slot.p && (!current || dirty & /*$$scope*/ 1)) {\n \t\t\t\t\tupdate_slot_base(\n \t\t\t\t\t\tdefault_slot,\n \t\t\t\t\t\tdefault_slot_template,\n \t\t\t\t\t\tctx,\n \t\t\t\t\t\t/*$$scope*/ ctx[0],\n \t\t\t\t\t\t!current\n \t\t\t\t\t\t? get_all_dirty_from_scope(/*$$scope*/ ctx[0])\n \t\t\t\t\t\t: get_slot_changes(default_slot_template, /*$$scope*/ ctx[0], dirty, null),\n \t\t\t\t\t\tnull\n \t\t\t\t\t);\n \t\t\t\t}\n \t\t\t}\n \t\t},\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(header.$$.fragment, local);\n \t\t\ttransition_in(default_slot, local);\n \t\t\ttransition_in(footer.$$.fragment, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(header.$$.fragment, local);\n \t\t\ttransition_out(default_slot, local);\n \t\t\ttransition_out(footer.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(header, detaching);\n \t\t\tif (detaching) detach_dev(t0);\n \t\t\tif (default_slot) default_slot.d(detaching);\n \t\t\tif (detaching) detach_dev(t1);\n \t\t\tdestroy_component(footer, detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$1c.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "a07817ee87ce5a5c1eb4840c50d37981", "score": "0.4868032", "text": "function renderPage(dataSrc, templateSrc) {\n getPageData(dataSrc)\n .then((data) => {\n // get template and render\n getTemplate('js/templates/body.hbs')\n .then((templateSrc) => {\n prependTemplate('body', templateSrc, data)\n })\n .fail((err) => console.log('template is not available'))\n })\n .fail((err) => console.log('data not available'))\n}", "title": "" }, { "docid": "ee3016ad938e255217a337f062131a49", "score": "0.48678896", "text": "function templateContent() {\n const html = fs.readFileSync(\n path.resolve(process.cwd(), 'app/index.html')\n ).toString();\n\n if (!dllPlugin) {\n return html;\n }\n\n const doc = cheerio(html);\n const body = doc.find('body');\n const dllNames = !dllPlugin.dlls ? ['reactBoilerplateDeps'] : Object.keys(dllPlugin.dlls);\n\n dllNames.forEach((dllName) => body.append(`<script data-dll='true' src='/${dllName}.dll.js'></script>`));\n\n return doc.toString();\n}", "title": "" }, { "docid": "5512b20045081c386dd729fe1b2ee8e0", "score": "0.4866286", "text": "function loadPage(context) {\n context.loadPartials({\n header: './templates/common/header.hbs',\n footer: './templates/common/footer.hbs',\n receiptForm: './templates/receipts/receiptForm.hbs',\n entryForm: './templates/entries/entryForm.hbs',\n entryItem: './templates/entries/entryItem.hbs',\n page: './templates/receipts/editor.hbs'\n })\n .then(function () {\n this.partial('./templates/main.hbs');\n });\n }", "title": "" }, { "docid": "4b87adfe27db539eb1a335eb09fa59e6", "score": "0.48646426", "text": "function create_fragment$3(ctx) {\n \tlet router;\n \tlet current;\n \trouter = new Router({ props: { routes: routes$1 }, $$inline: true });\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tcreate_component(router.$$.fragment);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(router, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n \t\tp: noop,\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(router.$$.fragment, local);\n \t\t\tcurrent = true;\n \t\t},\n \t\to: function outro(local) {\n \t\t\ttransition_out(router.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(router, detaching);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$3.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "c441e1be2f6d0610663cd54ff9edbdb8", "score": "0.4861177", "text": "function partialRender() {\n\n if (firstLoad) {\n rootDiv.innerHTML = '';\n firstLoad = false;\n }\n // Name all the partials we want to display from html files\n const partialNames = ['nav', 'header', 'main', 'footer'];\n // Collect all the partials in one promise to keep the fetching and the loading consistent.\n Promise.all(partialNames.map(partial => {\n\n if (partial !== 'main') {\n\n fetch(`${viewUrl}${partial}.html`)\n .then((response) => {\n return response.text();\n })\n .then((html) => {\n rootDiv.innerHTML = rootDiv.innerHTML + html;\n })\n .catch(err => {\n console.error('The partial is not found.');\n });\n } else {\n //start the render for the active page.\n const pageHash = window.location.hash.substr(1)\n renderActivePage(pageHash);\n }\n\n }))\n .then(\n // after we renderd everything we add the Script tags \n // in this way the scripts run after the html elements are in place.\n // so it can modify the DOM\n\n //loop through the partials end leave out the main because we are already in the main JS \n //and the footer because usually there is no scripts in the footer.\n partialNames.map(partial => {\n\n if (partial !== 'main' && partial !== 'footer') {\n loadScript(partial);\n }\n }));\n\n}", "title": "" }, { "docid": "3fbc2faae05897bb9e184d26c34f8345", "score": "0.48532212", "text": "function create_fragment$4(ctx) {\n \tvar t, current;\n\n \tvar headerbar = new HeaderBar({\n \t\tprops: { headerMessage: \"Wi-Finder\" },\n \t\t$$inline: true\n \t});\n\n \tvar networkstable = new NetworksTable({ $$inline: true });\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\theaderbar.$$.fragment.c();\n \t\t\tt = space();\n \t\t\tnetworkstable.$$.fragment.c();\n \t\t},\n\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n\n \t\tm: function mount(target, anchor) {\n \t\t\tmount_component(headerbar, target, anchor);\n \t\t\tinsert_dev(target, t, anchor);\n \t\t\tmount_component(networkstable, target, anchor);\n \t\t\tcurrent = true;\n \t\t},\n\n \t\tp: noop,\n\n \t\ti: function intro(local) {\n \t\t\tif (current) return;\n \t\t\ttransition_in(headerbar.$$.fragment, local);\n\n \t\t\ttransition_in(networkstable.$$.fragment, local);\n\n \t\t\tcurrent = true;\n \t\t},\n\n \t\to: function outro(local) {\n \t\t\ttransition_out(headerbar.$$.fragment, local);\n \t\t\ttransition_out(networkstable.$$.fragment, local);\n \t\t\tcurrent = false;\n \t\t},\n\n \t\td: function destroy(detaching) {\n \t\t\tdestroy_component(headerbar, detaching);\n\n \t\t\tif (detaching) {\n \t\t\t\tdetach_dev(t);\n \t\t\t}\n\n \t\t\tdestroy_component(networkstable, detaching);\n \t\t}\n \t};\n \tdispatch_dev(\"SvelteRegisterBlock\", { block, id: create_fragment$4.name, type: \"component\", source: \"\", ctx });\n \treturn block;\n }", "title": "" }, { "docid": "356a57f66856709045d9cadec2b915ca", "score": "0.48524258", "text": "['@test a child outlet is always a fragment']() {\n this.addTemplate('application', '{{outlet}}');\n this.addTemplate('index', '{{#if true}}1{{/if}}<div>2</div>');\n return this.visit('/').then(() => {\n this.assertInnerHTML('1<div>2</div>');\n });\n }", "title": "" }, { "docid": "33b3484aeb6aeb89623fb078b238fd23", "score": "0.48517883", "text": "visitTagPlaceholder(ph, context) {\n const tag = `${ph.tag}`;\n const attrs = Object.keys(ph.attrs).map(name => `${name}=\"${ph.attrs[name]}\"`).join(' ');\n if (ph.isVoid) {\n return `<${tag} ${attrs}/>`;\n }\n const children = ph.children.map((c) => c.visit(this)).join('');\n return `<${tag} ${attrs}>${children}</${tag}>`;\n }", "title": "" }, { "docid": "33b3484aeb6aeb89623fb078b238fd23", "score": "0.48517883", "text": "visitTagPlaceholder(ph, context) {\n const tag = `${ph.tag}`;\n const attrs = Object.keys(ph.attrs).map(name => `${name}=\"${ph.attrs[name]}\"`).join(' ');\n if (ph.isVoid) {\n return `<${tag} ${attrs}/>`;\n }\n const children = ph.children.map((c) => c.visit(this)).join('');\n return `<${tag} ${attrs}>${children}</${tag}>`;\n }", "title": "" }, { "docid": "cbcf86c04b334c5b4740af44a96dfef2", "score": "0.48515052", "text": "function templateRendering() {\n\t\n\t/**\n\t * Add a template\n\t */\n\t$(\"body\").on(\"click\", \".add-template\", function (e) {\n\t\t\n\t\te.preventDefault();\n\t\t\n\t\tvar id\t\t\t\t\t\t\t =\t(new Date()).getTime();\n\t\tvar template\t\t\t\t\t =\t$(\"#\" + $(this).data(\"template\")).html();\n\t\ttemplate\t\t\t\t\t\t =\ttemplate.replace(/__INDEX__/g, id);\n\t\t\n\t\t$(\"#\" + $(this).data(\"append\")).append(template);\n\t\t\n\t});\n\t\n\t/**\n\t * Removes a template\n\t */\n\t$(\"body\").on(\"click\", \".remove-template\", function (e) {\n\t\t\n\t\te.preventDefault();\n\t\t\n\t\t$(\"#\" + $(this).data(\"id\")).remove();\n\t\t\n\t});\n\t\n}", "title": "" }, { "docid": "3e058366af368213b786fba921518e23", "score": "0.48512948", "text": "function _loadTemplate()\n {\n var memento = {\n 'templateId': pageModel.getTemplateModel().getId(),\n 'pageId': currentPageId,\n 'tabId': \"perc-tab-layout\"\n };\n $.PercNavigationManager.goToLocation($.PercNavigationManager.VIEW_EDIT_TEMPLATE, $.PercNavigationManager.getSiteName(), null, null, null, $.PercNavigationManager.getPath(), null, memento);\n }", "title": "" }, { "docid": "11e3ae110af60dbe5f1d0a6874cee094", "score": "0.48509976", "text": "function startTagInTemplate(p, token) {\n var tn = token.tagName\n\n if (\n tn === $.BASE ||\n tn === $.BASEFONT ||\n tn === $.BGSOUND ||\n tn === $.LINK ||\n tn === $.META ||\n tn === $.NOFRAMES ||\n tn === $.SCRIPT ||\n tn === $.STYLE ||\n tn === $.TEMPLATE ||\n tn === $.TITLE\n )\n startTagInHead(p, token)\n else {\n var newInsertionMode =\n TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn] ||\n IN_BODY_MODE\n\n p._popTmplInsertionMode()\n p._pushTmplInsertionMode(newInsertionMode)\n p.insertionMode = newInsertionMode\n p._processToken(token)\n }\n }", "title": "" }, { "docid": "39128f9b3400506d0eebed2f6ddf3855", "score": "0.48486623", "text": "function loadLayout() {\n if (!document.querySelector(\".specific\")) {\n let mainWrapper = document.getElementById(\"main-wrapper\");\n\n let newSpecificTemplate = specificTemplate;\n mainWrapper.insertAdjacentHTML(\"beforeend\", newSpecificTemplate);\n\n let mainNode = document.querySelector(\"#specific\").content;\n let copyNode = document.importNode(mainNode, true);\n\n document.querySelector(\"template\").remove();\n mainWrapper.appendChild(copyNode);\n }\n}", "title": "" }, { "docid": "e65f4f41723b115d727f56ddb1d09488", "score": "0.48453948", "text": "preExecute() {\n\t\t// Overwrite this...\n\t}", "title": "" }, { "docid": "c316d6d1d2e46aa7e4e05870dc4801f8", "score": "0.48447818", "text": "function tryTemplate(){ //jshint ignore:line\n\t\t\t\tif (Array.isArray(linkTags) && linkCount < linkTags.length){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Replace the /**tevatron...**/ with a variable declaring htmlString and styleString\n\t\t\t\tvar htmlDeclare = '';\n\t\t\t\tif (vars[i].operator.indexOf(\"=\") > -1){\n\t\t\t\t\thtmlDeclare += \"var \";\n\t\t\t\t}\n\t\t\t\thtmlDeclare += vars[i].var+vars[i].operator+\"{html: '\" + htmlString.replace(/'/g,\"\\\\'\") + \"'\";\n\t\t\t\tif (styleString !== null){\n\t\t\t\t\thtmlDeclare += \", css: '\" + styleString.replace(/'/g,\"\\\\'\") + \"'\";\n\t\t\t\t}\n\t\t\t\thtmlDeclare += \"}\";\n\t\t\t\tif (vars[i].operator.indexOf(\"=\") > -1){\n\t\t\t\t\thtmlDeclare += \";\";\n\t\t\t\t} else if (vars[i].operator.indexOf(\":\") > -1){\n\t\t\t\t\thtmlDeclare += \",\";\n\t\t\t\t}\n\t\t\t\tvar jsPattern = new RegExp(\"\\\\/\\\\*[* ]tevatron .+? ?[=:] ?\"+templates[i]+\"[* ]\\\\*\\\\/\", \"g\");\n\t\t\t\tjsString = jsString.replace(jsPattern, htmlDeclare);\n\t\t\t\tprocessedTemplates++;\n\t\t\t\ttryDone();\n\t\t\t}", "title": "" }, { "docid": "3e31e05feb6b0a33cec764b7dc314f1a", "score": "0.48420614", "text": "function _render($scope) {\n var params,\n deferred = $q.defer();\n\n $log.debug(\"### requesting web=\",$scope.web,\"topic=\",$scope.topic);\n\n params = {\n topic: $scope.web+'.'+$scope.topic,\n zones: [\n \"head\",\n \"script\"\n ],\n expand: [],\n urlparams: {}\n };\n\n angular.forEach(templateRequests, function(val, key) {\n //$log.debug(\"tempalteRequest=\",val,\"web=\",$scope.web,\"prevWeb=\",prevWeb);\n if (val.reload === 'web') {\n if ( $scope.web !== prevWeb) {\n //$log.debug(\"... detected new web\",$scope.web,\"fetching\",key);\n params.expand.push(key);\n } else {\n //$log.debug(\"... same web, not fetching\",key);\n val.deferred.resolve(cache[key]);\n }\n } else {\n params.expand.push(key);\n }\n });\n\n // forward url params\n angular.forEach($location.search(), function(val, key) {\n params.urlparams[key] = val;\n });\n\n //$log.debug(\"params=\",params);\n\n prevWeb = $scope.web;\n\n if (typeof(canceler) !== 'undefined') {\n $log.debug(\"cancelling previous request\");\n canceler.resolve(\"aborded\");\n }\n \n // new canceler\n canceler = $q.defer();\n\n // do the request\n loadStart = (new Date()).getTime();\n $http({\n method: 'post',\n url: '/bin/jsonrpc/AngularPlugin/tmpl',\n timeout: canceler.promise,\n data: {\n jsonrpc: \"2.0\",\n params: params\n }\n })\n\n .success(function(data, status, header, config) {\n\n // finish request\n canceler = undefined;\n\n //$log.debug(\"response=\",data);\n angular.forEach(data.result.expand, function(text, name) {\n var req = templateRequests[name];\n\n //$log.debug(\"name=\",name,\"req=\",req);\n\n if (typeof(req) !== 'undefined') {\n cache[name] = text;\n req.deferred.resolve(text);\n delete templateRequests[name];\n }\n });\n\n // inject stuff that we need to display this topic\n _processZones(data.result.zones);\n\n // publish topic preferences\n $rootScope.preferences = data.result.preferences;\n //$log.debug(\"preferences=\",$rootScope.preferences);\n\n $rootScope.loadTime = ((new Date()).getTime() - loadStart);\n $log.log(params.topic+\" took \"+$rootScope.loadTime+\"ms to load\");\n \n // send to promise\n deferred.resolve(data);\n })\n\n .error(function(data) {\n\n // finish request\n canceler = undefined;\n\n $log.log(\"loading time: \"+(new Date()).getTime() - loadStart);\n\n // send to promise\n deferred.reject(data);\n });\n\n // return promise\n return deferred.promise;\n }", "title": "" } ]
230d0576fdc826edb538848911cd05da
Sets the bootstrap validation for various states
[ { "docid": "c1aee34027497277fc07dbc757b42a3c", "score": "0.67499006", "text": "function setValidation(state){\n if(state == 'valid'){\n bitmaskObject.removeClass('was-validated');\n baseStringObject.removeClass('was-validated');\n bitmaskObject.addClass('badVal');\n baseStringObject.addClass('badVal');\n }else{\n bitmaskObject.removeClass('was-validated');\n baseStringObject.removeClass('was-validated');\n bitmaskObject.addClass('badVal');\n baseStringObject.addClass('badVal');\n }\n }", "title": "" } ]
[ { "docid": "7980fe30c6d87157cb750a23a48d4751", "score": "0.65744597", "text": "static initValidation() {\n // Load default options for jQuery Validation plugin\n One.helpers('validation');\n\n // Init Form Validation\n jQuery('.js-validation-lock').validate({\n rules: {\n 'lock-password': {\n required: true,\n minlength: 3\n }\n },\n messages: {\n 'lock-password': {\n required: 'Please enter your valid password'\n }\n }\n });\n }", "title": "" }, { "docid": "160540a22f5a0896fad12917301e27c8", "score": "0.64536685", "text": "function validateAddState()\n{\n\t\n\t$('#addState').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tsstt_country_code: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select country name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tsstt_state: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter country name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tsstt_name: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please enter only character'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter country name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "89fff7913e598af385749fc845e93dc1", "score": "0.6416989", "text": "validation() {\n this.updateValidation()\n }", "title": "" }, { "docid": "8472904d5358c769198764b9080941d0", "score": "0.6385472", "text": "function configureFormValidation() {\n window.addEventListener('load', function() {\n // Fetch all the forms we want to apply custom Bootstrap validation styles to\n var forms = document.getElementsByClassName('needs-validation');\n // Loop over them and prevent submission\n var validation = Array.prototype.filter.call(forms, function(form) {\n form.addEventListener('submit', function(event) {\n event.preventDefault();\n event.stopPropagation();\n form.classList.add('was-validated');\n }, false);\n });\n }, false);\n}", "title": "" }, { "docid": "e1b93df44d7fc4bc3d7def6061f7488c", "score": "0.6382218", "text": "validate () {\n this._validatePanel()\n this._validatePrompts();\n this._validateCustomSelector();\n }", "title": "" }, { "docid": "3f2f46252490d174203fffebcecc6970", "score": "0.6254899", "text": "function initialiseValidations() {\n initialiseValidationContainers();\n initialiseNameValidation();\n initialiseEmailValidation();\n initialiseCardValidation();\n initialiseActivityValidation();\n $(\"form\").submit(validateAll);\n}", "title": "" }, { "docid": "4cf26b1e352191a41257656bd5354da7", "score": "0.6232563", "text": "resetValidation() {\n this.setProperties({\n isUsernamePresenceValid: true,\n isPasswordPresenceValid: true,\n loginErrorMessage: null\n });\n }", "title": "" }, { "docid": "112ae4c7338a3d61f8add87bfe9803a4", "score": "0.62021756", "text": "function initFormValidation() {\r\n\r\n var forms = $('.needs-form-validation');\r\n // Event handler On Submit\r\n forms.on('submit', function (ev) {\r\n // Using 'this' we get the form which is actually beeing submitted\r\n if (this.checkValidity() === false) {\r\n // Prevent form submission and event propagation\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n // When the form was validated\r\n $(this).addClass('was-validated');\r\n });\r\n\r\n // Reset form when the modal is being closed\r\n /*\r\n $('.modal').on('hide.bs.modal', function () {\r\n $(this).find('form').removeClass('was-validated');\r\n $(this).find('form')[0].reset();\r\n });*/\r\n }", "title": "" }, { "docid": "4bf683ebc250cb632425e4bfe99952aa", "score": "0.6189782", "text": "function initialiseValidationContainers() {\n createValidationContainerAndHide(\n \"#name\",\n \"name-validation\",\n \"Name must be filled\",\n \"Name is filled\"\n );\n createValidationContainerAndHide(\n \"#mail\",\n \"mail-validation\",\n \"Email must be valid\",\n \"Email entered is valid\"\n );\n\n initialiseAdditionalErrorMessage(`#mail-validation`, 'mail-validation-empty');\n\n\n createValidationContainerAndHide(\n \".activities\",\n \"activity-validation\",\n \"At least one activity must be selected\",\n \"Number of activities selected is valid\"\n );\n createCreditValidationContainerAndHide();\n}", "title": "" }, { "docid": "fab0d7d4c5852ca9e2d3a651f361080d", "score": "0.6141231", "text": "resetValidation() {\n this.setProperties({\n isUsernamePresenceValid: true,\n isPasswordPresenceValid: true,\n isConfirmedPasswordPresenceValid: true,\n isConfirmedPasswordValueValid: true,\n isFNamePresenceValid: true,\n isLNamePresenceValid: true,\n isEmailPresenceValid: true,\n isWeightPresenceValid: true,\n isWeightValueValid: true,\n isEmailValueValid: true,\n registerErrorMessage: '',\n });\n }", "title": "" }, { "docid": "3561670b0a2e7aa3ab02f8335c1ded74", "score": "0.6100108", "text": "function validateBookMasterForm()\n{\n\t$('#bookMaster').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tscbm_book_name: {\n\t\t\t\tvalidators: {\n\t\t\t\t\t/* regexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters and number'\n\t\t\t\t\t}, */\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter book name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscbm_auther: {\n\t\t\t\tvalidators: {\n\t\t\t\t\t/* regexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters and number'\n\t\t\t\t\t}, */\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter auther name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscbm_publication: {\n\t\t\t\tvalidators: {\n\t\t\t\t\t/* regexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters and number'\n\t\t\t\t\t}, */\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter publication name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscbm_category: {\n\t\t\t\tvalidators: {\n\t\t\t\t\t/* regexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters and number'\n\t\t\t\t\t}, */\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter category name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscbm_isbn_no: {\n\t\t\t\tvalidators: {\n\t\t\t\t\t/* regexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters and number'\n\t\t\t\t\t}, */\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter ISBN no.'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "e827bf6f93b619fa78f1a69f1b85efb4", "score": "0.6096346", "text": "function validateAssignHomeworkFormByteacher()\n{\n\t$('#assignHomeworkFormByteacher').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tclass: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select class'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdiv: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select div'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tsubject: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select subject'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdescription: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter description'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "64bb70f0136571e8523361431a1a2f45", "score": "0.6081256", "text": "function DemoFormValidator(){\n\t$('#defaultForm').bootstrapValidator({\n\t\tmessage: 'This value is not valid',\n\t\tfields: {\n\t\t\tusername: {\n\t\t\t\tmessage: 'The username is not valid',\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'The username is required and can\\'t be empty'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'The username must be more than 6 and less than 30 characters long'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z0-9_\\.]+$/,\n\t\t\t\t\t\tmessage: 'The username can only consist of alphabetical, number, dot and underscore'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\n\t\t\tnombre: {\n\t\t\t\tmessage: 'El nombre no es valido',\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo nombre es requeridos'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'The username must be more than 6 and less than 30 characters long'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z0-9_\\.]+$/,\n\t\t\t\t\t\tmessage: 'The username can only consist of alphabetical, number, dot and underscore'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tcountry: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'The country is required and can\\'t be empty'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tacceptTerms: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'You have to accept the terms and policies'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\temail: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'The email address is required and can\\'t be empty'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'The username must be more than 6 and less than 30 characters long'\n\t\t\t\t\t},\n\t\t\t\t\temailAddress: {\n\t\t\t\t\t\tmessage: 'The input is not a valid email address'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\twebsite: {\n\t\t\t\tvalidators: {\n\t\t\t\t\turi: {\n\t\t\t\t\t\tmessage: 'The input is not a valid URL'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tphoneNumber: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tdigits: {\n\t\t\t\t\t\tmessage: 'The value can contain only digits'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tcolor: {\n\t\t\t\tvalidators: {\n\t\t\t\t\thexColor: {\n\t\t\t\t\t\tmessage: 'The input is not a valid hex color'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tzipCode: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tusZipCode: {\n\t\t\t\t\t\tmessage: 'The input is not a valid US zip code'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'The password is required and can\\'t be empty'\n\t\t\t\t\t},\n\t\t\t\t\tidentical: {\n\t\t\t\t\t\tfield: 'confirmPassword',\n\t\t\t\t\t\tmessage: 'The password and its confirm are not the same'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tconfirmPassword: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'The confirm password is required and can\\'t be empty'\n\t\t\t\t\t},\n\t\t\t\t\tidentical: {\n\t\t\t\t\t\tfield: 'password',\n\t\t\t\t\t\tmessage: 'The password and its confirm are not the same'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tages: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tlessThan: {\n\t\t\t\t\t\tvalue: 100,\n\t\t\t\t\t\tinclusive: true,\n\t\t\t\t\t\tmessage: 'The ages has to be less than 100'\n\t\t\t\t\t},\n\t\t\t\t\tgreaterThan: {\n\t\t\t\t\t\tvalue: 10,\n\t\t\t\t\t\tinclusive: false,\n\t\t\t\t\t\tmessage: 'The ages has to be greater than or equals to 10'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\t$('#LoginForm').bootstrapValidator({\n\t\tmessage: 'This value is not valid',\n\t\tfields: {\n\t\t\t\n\t\t\tnombre: {\n\t\t\t\tmessage: 'El nombre no es valido',\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo nombre es requeridos'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'The username must be more than 6 and less than 30 characters long'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z0-9_\\.]+$/,\n\t\t\t\t\t\tmessage: 'The username can only consist of alphabetical, number, dot and underscore'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\temail: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo email es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 10,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'El email debe ser mayor a 10 y menor a 30 caracteres de longitud'\n\t\t\t\t\t},\n\t\t\t\t\temailAddress: {\n\t\t\t\t\t\tmessage: 'La entrada no es una dirección válida de correo electrónico'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tclave: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo clave es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'La clave debe ser mayor a 6 y menor a 30 caracteres de longitud'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t});\n\n\n\t$('#EditDataVideoForm').bootstrapValidator({\n\t\tmessage: 'This value is not valid',\n\t\tfields: {\n\t\t\tcategoriaalavista: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Se requiere el estado, no puede estar vacío'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\n\t\t}\n\t});\n\t\n\n\n\n\t$('#DataPersonalForm').bootstrapValidator({\n\t\tmessage: 'This value is not valid',\n\t\tfeedbackIcons: {\n valid: 'glyphicon glyphicon-ok',\n invalid: 'glyphicon glyphicon-remove',\n validating: 'glyphicon glyphicon-refresh'\n },\n\t\tfields: {\n\t\t\t\n\t\t\tnombre: {\n\t\t\t\tmessage: 'El nombre no es valido',\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo Nombre es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 80,\n\t\t\t\t\t\tmessage: 'El nombre debe ser mayor a 6 y menor a 80 caracteres de longitud'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/,\n\t\t\t\t\t\tmessage: 'El nombre de usuario sólo puede consistir de caracteres alfabéticos y números'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\temail: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo email es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 10,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'El email debe ser mayor a 10 y menor a 30 caracteres de longitud'\n\t\t\t\t\t},\n\t\t\t\t\temailAddress: {\n\t\t\t\t\t\tmessage: 'La entrada no es una dirección válida de correo electrónico'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\n\t\t\tclave: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo clave es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'La clave debe ser mayor a 6 y menor a 30 caracteres de longitud'\n\t\t\t\t\t},\n\t\t\t\t\tidentical: {\n\t\t\t\t\t\tfield: 'reclave',\n\t\t\t\t\t\tmessage: 'La clave y su confirmación no son las mismas'\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\n\t\t\treclave: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo repetir clave es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tidentical: {\n\t\t\t\t\t\tfield: 'clave',\n\t\t\t\t\t\tmessage: 'La clave y su confirmación no son las mismas'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'La clave debe ser mayor a 6 y menor a 30 caracteres de longitud'\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\n\t\t\testado: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Se requiere el estado, no puede estar vacío'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\trol: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Se requiere el rol, no puede estar vacío'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tmenu: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Se requiere un menu, no puede estar vacío'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t});\n\n\n\t$('#EditDataPersonalForm').bootstrapValidator({\n\t\tmessage: 'This value is not valid',\n\t\tfeedbackIcons: {\n valid: 'glyphicon glyphicon-ok',\n invalid: 'glyphicon glyphicon-remove',\n validating: 'glyphicon glyphicon-refresh'\n },\n\t\tfields: {\n\t\t\t\n\t\t\tmodal_nombre: {\n\t\t\t\tmessage: 'El nombre no es valido',\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo Nombre es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 80,\n\t\t\t\t\t\tmessage: 'El nombre debe ser mayor a 6 y menor a 80 caracteres de longitud'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/,\n\t\t\t\t\t\tmessage: 'El nombre de usuario sólo puede consistir de caracteres alfabéticos y números'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tmodal_email: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo email es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 10,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'El email debe ser mayor a 10 y menor a 30 caracteres de longitud'\n\t\t\t\t\t},\n\t\t\t\t\temailAddress: {\n\t\t\t\t\t\tmessage: 'La entrada no es una dirección válida de correo electrónico'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\n\t\t\tmodal_clave: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo clave es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'La clave debe ser mayor a 6 y menor a 30 caracteres de longitud'\n\t\t\t\t\t},\n\t\t\t\t\tidentical: {\n\t\t\t\t\t\tfield: 'modal_reclave',\n\t\t\t\t\t\tmessage: 'La clave y su confirmación no son las mismas'\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tmodal_reclave: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo repetir clave es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tidentical: {\n\t\t\t\t\t\tfield: 'modal_clave',\n\t\t\t\t\t\tmessage: 'La clave y su confirmación no son las mismas'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'La clave debe ser mayor a 6 y menor a 30 caracteres de longitud'\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tmodal_estado: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Se requiere el estado, no puede estar vacío'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tmodal_rol: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Se requiere el rol, no puede estar vacío'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tmodal_menu: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Se requiere un menu, no puede estar vacío'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t});\n\n\n\t$('#Profile').bootstrapValidator({\n\t\tmessage: 'This value is not valid',\n\t\tfeedbackIcons: {\n valid: 'glyphicon glyphicon-ok',\n invalid: 'glyphicon glyphicon-remove',\n validating: 'glyphicon glyphicon-refresh'\n },\n\t\tfields: {\n\n\t\t\treclave: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'El campo repetir clave es requerido'\n\t\t\t\t\t},\n\t\t\t\t\tidentical: {\n\t\t\t\t\t\tfield: 'modal_clave',\n\t\t\t\t\t\tmessage: 'La clave y su confirmación no son las mismas'\n\t\t\t\t\t},\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\tmessage: 'La clave debe ser mayor a 6 y menor a 30 caracteres de longitud'\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\t\n\t\t}\n\t});\n\n\n\n}", "title": "" }, { "docid": "6a53553385271e16f12b9da33135288d", "score": "0.60683477", "text": "function trigger() {\n modal.removeAttribute('class');\n petNameValidate(true);\n petAgeValidate(true);\n petBreedValidate(true);\n petPersonalityValidate(true);\n petBioValidate(true);\n petPictureValidate(true);\n}", "title": "" }, { "docid": "171c38fd4dc33862dc1bdce462f5ad8d", "score": "0.60496986", "text": "function studentAddmissionValidate()\n{\n\t\n\t$('#student_addmission_form').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tscad_stud_id: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select student'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscad_acdmic_yr: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter year'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscad_admission_date: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select addmission date'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscad_class: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select class'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscad_course: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select course'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t'scrc_paid_amt[]': {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9.]+$/,\n\t\t\t\t\t\tmessage: 'Please add only number'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter paid amt or set 0'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t'scrc_taxId[]': {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select tax or select 0 tax'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscrh_payment_mode: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select payment mode'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t$('#scad_admission_date').on('changeDate show', function(e) {\n\t $('#student_addmission_form').bootstrapValidator('revalidateField', 'scad_admission_date');\n\t });\n}", "title": "" }, { "docid": "33cb6e7249746abc5d1bbb24e572ec23", "score": "0.6040336", "text": "setValidations() {\n\t\tconst { data } = this.props\n\t\tthis.validations = {\n\t\t\tkey: {\n\t\t\t\trules: [\n\t\t\t\t\t{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: 'Code is Required',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinitialValue: data ? data.key : null,\n\t\t\t},\n\t\t\tname: {\n\t\t\t\trules: [\n\t\t\t\t\t{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: 'Name is required',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinitialValue: data ? data.name : null,\n\t\t\t},\n\t\t\ttemplateVariables: {\n\t\t\t\trules: [],\n\t\t\t\tinitialValue: data\n\t\t\t\t\t? data.templateVariables\n\t\t\t\t\t: 'Variable name : Variable Value',\n\t\t\t},\n\t\t\ttemplate: {\n\t\t\t\trules: [\n\t\t\t\t\t{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: 'Template is Required',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinitialValue: data ? data.template : null,\n\t\t\t},\n\t\t}\n\t}", "title": "" }, { "docid": "68b094e479f41790df0359e6a18b3da7", "score": "0.5991223", "text": "function instanceFormValidateWithAddStyle() {\n //Validate and add Bootstrap classs for errors\n $('form.validateAddStyle').validationEngine(\n 'attach',\n {\n validateNonVisibleFields: false,\n addFailureCssClassToField: 'field-error',\n addSuccessCssClassToField: 'field-success',\n scroll: false,\n onValidationComplete: function(form, status){ \n $('.field-success').parent().removeClass('has-error'); \n\n if (!status) { \n $('.field-error').parent().addClass('has-error');\n onValidateErrorScrollToTop();\n } \n\n return status;\n }\n }\n ); \n}", "title": "" }, { "docid": "7b06ee4833828f0b5b8106a9b90e4f9e", "score": "0.5982997", "text": "setValidations() {\n\t\tconst { translate } = this.props\n\t\tthis.validations = {\n\t\t\tpassword: {\n\t\t\t\trules: [\n\t\t\t\t\t{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: translate('common.password.error.required'),\n\t\t\t\t\t},\n\t\t\t\t\t{ min: 6, message: translate('common.password.error.invalid') },\n\t\t\t\t],\n\t\t\t},\n\t\t\tconfirmPassword: {\n\t\t\t\trules: [\n\t\t\t\t\t{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: translate('common.confirmPassword.error.required'),\n\t\t\t\t\t},\n\t\t\t\t\t{ validator: this.checkPassword.bind(this), name: 'confirmPassword' },\n\t\t\t\t],\n\t\t\t},\n\t\t}\n\t}", "title": "" }, { "docid": "c5b79a2ecacb82216d4ae925ae541366", "score": "0.5981062", "text": "function validate() {\n 'use strict';\n // Fetch all the forms we want to apply custom Bootstrap validation styles to\n var forms = document.getElementsByClassName('needs-validation');\n // Loop over them and prevent submission\n var validation = Array.prototype.filter.call(forms, function (form) {\n form.addEventListener('submit', function (event) {\n if (form.checkValidity() === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n form.classList.add('was-validated');\n }, false);\n });\n}", "title": "" }, { "docid": "8c9b19f25a573ff2332a5099a7399ac5", "score": "0.59792566", "text": "function validateBookIssueForm()\n{\n\t\n\t$('#issueBookForm').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tscbs_book_id: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select book'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscbs_batch_no: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select book batch'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscbs_due_date: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select due date'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscbs_class_id: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select class'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdiv: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select division'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tstudent_list: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select student'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscbs_issue_book_status: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter book status'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t$('#scbs_due_date').on('changeDate show', function(e) {\n\t $('#issueBookForm').bootstrapValidator('revalidateField', 'scbs_due_date');\n\t });\n}", "title": "" }, { "docid": "440337c3be70cf68d1c015bb74d095e7", "score": "0.594056", "text": "_validate() {\n\n if (this.isTypeahead) {\n this._validateTypeaheads();\n }\n else if (this.isSelect) {\n this._validateSelects();\n }\n }", "title": "" }, { "docid": "c60de3d61e0b3288516805036d48c3cf", "score": "0.5927471", "text": "_initTopLabelValidation() {\n // Select2\n if (jQuery().select2) {\n jQuery('#select2TopLabel').select2({minimumResultsForSearch: Infinity, placeholder: ''});\n jQuery('#select2TopLabel').on('change', function () {\n jQuery(this).valid();\n });\n }\n // Tagify\n if (typeof Tagify !== 'undefined') {\n if (document.querySelector('#tagsTopLabel') !== null) {\n new Tagify(document.querySelector('#tagsTopLabel'));\n }\n jQuery('#tagsTopLabel').on('change', function () {\n jQuery(this).valid();\n });\n }\n // Datepicker\n if (jQuery().datepicker) {\n jQuery('#dateTopLabel').datepicker({\n autoclose: true,\n });\n jQuery('#dateTopLabel').on('change', function () {\n jQuery(this).valid();\n });\n }\n // Form validation\n jQuery('#validationTopLabel').validate();\n }", "title": "" }, { "docid": "7dd447c647e009ee8e51d90a96b7375b", "score": "0.59195757", "text": "runValidation() {\n // Gives time to the error-messages attributes to react\n this.$timeout(() => {\n this.formControls.forEach((control) => {\n control.$setDirty();\n control.$validate();\n });\n });\n }", "title": "" }, { "docid": "fd1266e2bc67803ca59c3d833fe8f737", "score": "0.5895827", "text": "function Validators() {}", "title": "" }, { "docid": "dd5cdc33bcb21b5fc70b3f563447e8ef", "score": "0.58823085", "text": "static initValidationInstallation() {\r\n // Load default options for jQuery Validation plugin\r\n Dashmix.helpers('validation');\r\n\r\n // Init Form Validation\r\n jQuery('.js-validation-installation').validate({\r\n rules: {\r\n 'install-db-name': {\r\n required: true\r\n },\r\n 'install-db-username': {\r\n required: true\r\n },\r\n 'install-db-password': {\r\n required: true\r\n },\r\n 'install-admin-email': {\r\n required: true,\r\n email: true\r\n },\r\n 'install-admin-password': {\r\n required: true,\r\n minlength: 5\r\n },\r\n 'install-admin-password-confirm': {\r\n required: true,\r\n equalTo: '#install-admin-password'\r\n }\r\n },\r\n messages: {\r\n 'install-db-name': {\r\n required: 'Please provide the name of your database'\r\n },\r\n 'install-db-username': {\r\n required: 'Please provide the username with access to your database'\r\n },\r\n 'install-db-password': {\r\n required: 'Please provide the password of your database user'\r\n },\r\n 'install-admin-email': {\r\n required: 'Please enter your email'\r\n },\r\n 'install-admin-password': {\r\n required: 'Please provide a password',\r\n minlength: 'Your password must be at least 5 characters long'\r\n },\r\n 'install-admin-password-confirm': {\r\n required: 'Please provide a password',\r\n minlength: 'Your password must be at least 5 characters long',\r\n equalTo: 'Please enter the same password as above'\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "a124bb7c34b1550b29b8c310deda1343", "score": "0.58736634", "text": "function setValidations() {\n\tcolumnValidation();\n\trowValidation();\n\t// Si hay dulces que borrar\n\tif ($('img.delete').length !== 0) {\n\t\tdeletesDulceAnimation();\n\t}\n}", "title": "" }, { "docid": "c45af9972dfb8d1dec439e4813126700", "score": "0.5862427", "text": "init() {\n this._super(...arguments);\n\n let errors = this.get('errors');\n\n if (!errors) {\n throw new Error('Errors property for flexberry-validationsummary component must be set');\n }\n\n this.set('validationProperties', new Ember.A());\n\n for (let propertyName in errors) {\n // TODO: Delete after update Ember on 2.5.1 and up.\n if (errors.hasOwnProperty(propertyName) && propertyName !== 'toString') {\n this.get('validationProperties').push(propertyName);\n errors.addObserver(propertyName + '.[]', this, 'changeMessages');\n }\n }\n\n this.get('classNames').push(this.get('color'));\n this.changeMessages();\n }", "title": "" }, { "docid": "18e886d7277027fa3380f83cfb70894c", "score": "0.5857521", "text": "function validation_setup() {\r\n\tthis.eventNonBlank = es_non_blank;\r\n\tthis.nonBlank = vs_non_blank;\r\n\tthis.eventNormal = es_normal;\r\n\tthis.normal = vs_normal;\r\n\tthis.eventNonQuote = es_non_quote;\r\n\tthis.nonQuote = vs_non_quote;\r\n\tthis.eventNonDoubleQuote = es_non_doublequote;\r\n\tthis.nonDoubleQuote = vs_non_doublequote;\r\n\tthis.eventValidNumber = es_valid_number;\r\n\tthis.validNumber = vs_valid_number;\r\n\tthis.eventValidDate = es_valid_date;\r\n\tthis.validDate = vs_valid_date;\r\n\tthis.eventValidSelect = es_item_selected;\r\n\tthis.validSelect = vs_item_selected;\r\n\tthis.eventValidEmail = es_valid_email;\r\n\tthis.validEmail = vs_valid_email;\r\n\tthis.eventValidEnglish = es_valid_english;\r\n\tthis.validEnglish = vs_valid_english;\r\n\treturn this;\r\n}", "title": "" }, { "docid": "a7a0dc4a1f269929e7f4d5cc4b47f348", "score": "0.5825175", "text": "prepareForValidating() {\n let root = this;\n\n this.$formBlock.on('focusout', function(e) {\n root.$formBlock.off('focusout');\n root.options.keyUpCheckMode = true;\n root.startValidating();\n });\n }", "title": "" }, { "docid": "bcef6872781a7dfb27e7e189d4d6fc5b", "score": "0.5820311", "text": "function NO_VALIDATION$static_(){PanelSkin.NO_VALIDATION=( new PanelSkin(\"no-validation\"));}", "title": "" }, { "docid": "2437cd02301e5a1734fefeb996832bc3", "score": "0.5789342", "text": "function activateValidation() {\n $(\"#aspnetForm\").validationEngine({\n success: function () {\n validateInput();\n },\n failure: false\n })\n}", "title": "" }, { "docid": "7fa6662e6964fa933538de4c8dab9a4b", "score": "0.57822764", "text": "function validateFeesClassMapping()\n{\n\t$('#feesClassMapping').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tsfcc_fee_id: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select fees id'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tsfcc_class_id: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select class'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tsfcc_amount: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9.]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digit'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter amount'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "52bd8bc9899872018b530a8717baf220", "score": "0.57809824", "text": "function setMode(mode) {\n validationMode = mode;\n}", "title": "" }, { "docid": "15deacda004317a6b652a4a0507a8aae", "score": "0.5764711", "text": "setValidatorStatus(element, status) {\n if (status) {\n element.style.display = 'block';\n element.style.color = \"#FF454F\";\n } else {\n element.style.display = 'none';\n }\n }", "title": "" }, { "docid": "f1bee3075dc05b76532930e2b28ce7e7", "score": "0.5754007", "text": "function validateStudentRegistration()\n{\n\t\n\t$('#studentRegistrationForm').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tstudent_fname: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter first name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tstudent_mname: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tstudent_lname: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter last name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tgender: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select gender'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_dob: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select date'\n\t\t\t\t\t},\n\t\t\t\t\tdate: {\n\t\t\t\t\t format: 'YYYY-MM-DD',\n\t\t\t\t\t message: 'The format is YYYY-MM-DD'\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t},\n\t\t\tbirth_place: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tstud_religion: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select religion'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tstud_caste: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select caste'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, \n\t\t\t\n\t\t\tstudent_height: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[+-]?\\d+(\\.\\d+)?$/,\n\t\t\t\t\t\tmessage: 'Please add only digit'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tstudent_weight: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[+-]?\\d+(\\.\\d+)?$/,\n\t\t\t\t\t\tmessage: 'Please add only digit'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\taadhar_number: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 12,\n\t\t\t\t\t\tmax: 12,\n\t\t\t\t\t\tmessage:'Please add valid aadhar number'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter aadhar number'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_identity:{\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter identity number'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_pblock: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter house no/name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_pstreet: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter street name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_pcountry_id: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select country'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_pstate_id: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select state'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_pzipcode: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 6,\n\t\t\t\t\t\tmessage:'Please add 6 digit zipcode'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter 6 digit zipcode'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_cblock: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter house no/name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_cstreet: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter street name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_ccountry_id: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select country'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_cstate_id: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select state'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_czipcode: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 6,\n\t\t\t\t\t\tmessage:'Please add 6 digit zipcode'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter 6 digit zipcode'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_contact1: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 10,\n\t\t\t\t\t\tmax: 10,\n\t\t\t\t\t\tmessage:'Please add 10 digit contact number'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_contact2: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 10,\n\t\t\t\t\t\tmax: 10,\n\t\t\t\t\t\tmessage:'Please add 10 digit contact number'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_phy_disable: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select physically disabled'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscst_mother_tounge: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter mother tounge'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_ftr_fname: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter father first name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_ftr_mname: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_ftr_lname: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter father last name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_ftr_quali: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select qualification'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_ftr_occupation_type: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select occupation type'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_ftr_occu: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter occupation '\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_ftr_employername: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_ftr_income: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter annual income'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_ftr_uid: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 12,\n\t\t\t\t\t\tmax: 12,\n\t\t\t\t\t\tmessage:'Please add valid aadhaar number'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter father aadhaar number'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_femail: {\n\t\t\t\tvalidators: {\n\t\t\t\t\t// regexp: {\n\t\t\t\t\t\t// regexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\t// message: 'Please add only characters'\n\t\t\t\t\t// },\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter father email id'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, \n\t\t\tscpt_ftr_employer_add: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter father office address'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, \n\t\t\tscpt_mtr_fname: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter mother first name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_mtr_mname: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_mtr_lname: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter mother last name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_mtr_quali: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select qualification'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_mtr_occupation_type: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select occupation type'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_mtr_occu: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter occupation '\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_mtr_employername: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_mtr_income: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter annual income'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_mtr_uid: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 12,\n\t\t\t\t\t\tmax: 12,\n\t\t\t\t\t\tmessage:'Please add valid aadhaar number'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter father aadhaar number'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_memail: {\n\t\t\t\tvalidators: {\n\t\t\t\t\t// regexp: {\n\t\t\t\t\t\t// regexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\t// message: 'Please add only characters'\n\t\t\t\t\t// },\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter father email id'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, \n\t\t\tscpt_mtr_employer_add: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter father office address'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, \n\t\t\tscpt_contact1: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 10,\n\t\t\t\t\t\tmax: 10,\n\t\t\t\t\t\tmessage:'Please add 10 digit contact number'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digit'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter parents contact number'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_contact2: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 10,\n\t\t\t\t\t\tmax: 10,\n\t\t\t\t\t\tmessage:'Please add 10 digit contact number'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digit'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_pblock: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter house no/name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_pstreet: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter street name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_pcountry: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select country'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_pstate: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select state'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_pzipcode: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 6,\n\t\t\t\t\t\tmessage:'Please add 6 digit zipcode'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter 6 digit zipcode'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_cblock: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter house no/name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_cstreet: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter street name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_ccountry: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select country'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_cstate: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select state'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscpt_czipcode: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tstringLength: {\n\t\t\t\t\t\tmin: 6,\n\t\t\t\t\t\tmax: 6,\n\t\t\t\t\t\tmessage:'Please add 6 digit zipcode'\n\t\t\t\t\t},\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only digits'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter 6 digit zipcode'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t first_sibling_name: {\n\t\t\t\t validators: {\n\t\t\t\t\t regexp: {\n\t\t\t\t\t\t regexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\t message: 'Please add only characters'\n\t\t\t\t\t } \n\t\t\t\t }\n\t\t\t },\n\t\t\t first_sibling_age: {\n\t\t\t\t validators: {\n\t\t\t\t\t stringLength: {\n\t\t\t\t\t\t max: 3,\n\t\t\t\t\t\t max: 12,\n\t\t\t\t\t\t message:'Please add valid age'\n\t\t\t\t\t },\n\t\t\t\t\t regexp: {\n\t\t\t\t\t\t regexp: /^[0-9]+$/,\n\t\t\t\t\t\t message: 'Please add only digit'\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t },\n\t\t\t first_sibling_work: {\n\t\t\t\t validators: {\n\t\t\t\t\t regexp: {\n\t\t\t\t\t\t regexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\t message: 'Please add only characters'\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t },\n\t\t second_sibling_name: {\n\t\t\t\t validators: {\n\t\t\t\t\t regexp: {\n\t\t\t\t\t\t regexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\t message: 'Please add only characters'\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t },\n\t\t\t second_sibling_age: {\n\t\t\t\t validators: {\n\t\t\t\t\t stringLength: {\n\t\t\t\t\t\t max: 3,\n\t\t\t\t\t\t max: 12,\n\t\t\t\t\t\t message:'Please add valid age'\n\t\t\t\t\t },\n\t\t\t\t\t regexp: {\n\t\t\t\t\t\t regexp: /^[0-9]+$/,\n\t\t\t\t\t\t message: 'Please add only digit'\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t },\n\t\t\t second_sibling_work: {\n\t\t\t\t validators: {\n\t\t\t\t\t regexp: {\n\t\t\t\t\t\t regexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\t message: 'Please add only characters'\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t },\n\t\t\t scad_acdmic_yr: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select year'\n\t\t\t\t\t}\n\t\t\t },\n\t\t\t scad_admission_date: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select date'\n\t\t\t\t\t},\n\t\t\t\t\tdate: {\n\t\t\t\t\t format: 'YYYY-MM-DD',\n\t\t\t\t\t message: 'The format is YYYY-MM-DD'\n\t\t\t\t\t }\n\t\t\t },\n\t\t\t scad_class: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select class'\n\t\t\t\t\t}\n\t\t\t },\n\t\t\t scad_course: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select course'\n\t\t\t\t\t}\n\t\t\t }\n\t\t}\n\t});\n\t $('#scst_dob').on('changeDate show', function(e) {\n\t $('#studentRegistrationForm').bootstrapValidator('revalidateField', 'scst_dob');\n\t });\n\t $('#scad_admission_date').on('changeDate show', function(e) {\n\t $('#studentRegistrationForm').bootstrapValidator('revalidateField', 'scad_admission_date');\n\t });\n\n\t/* $(\"#scpt_ftr_fname\").blur(function () {\n\t\t$('#studentRegistrationForm').bootstrapValidator('revalidateField', 'scpt_ftr_fname');\n\t });\n\t $(\"#scpt_ftr_mname\").blur(function () {\n\t $('#studentRegistrationForm').bootstrapValidator('revalidateField', 'scpt_ftr_mname');\n\t });\n\t $(\"#scpt_ftr_lname\").blur(function () {\n\t\t $('#studentRegistrationForm').bootstrapValidator('revalidateField', 'scpt_ftr_lname');\n\t }); */\n\t\t\n}", "title": "" }, { "docid": "bb9922fb477a4acc8c23c298d042f0e7", "score": "0.5753348", "text": "_initValidators () {\n for (let key in this.options) {\n this.addValidator(key, this.options[key])\n }\n }", "title": "" }, { "docid": "9562d637b0a9805f104c0e60591a1afb", "score": "0.57530874", "text": "function validateFinancialYear()\n{\n\t$('#addFinancialYear').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tfinancial_year_name: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /(\\b19|\\b20)\\d\\d-\\d\\d/,\n\t\t\t\t\t\tmessage: 'Please add valid academic year ex. 2019-20'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter financial year name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tterm: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select term'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfromdate: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select from date'\n\t\t\t\t\t},\n\t\t\t\t\t date: {\n\t\t\t\t\t format: 'YYYY-MM-DD',\n\t\t\t\t\t message: 'The format is YYYY-MM-DD'\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t},\n\t\t\ttodate: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select to date'\n\t\t\t\t\t},\n\t\t\t\t\t date: {\n\t\t\t\t\t format: 'YYYY-MM-DD',\n\t\t\t\t\t message: 'The format is YYYY-MM-DD'\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t});\n\t $('#fromdate').on('changeDate show', function(e) {\n\t $('#addFinancialYear').bootstrapValidator('revalidateField', 'fromdate');\n\t }); \n\t $('#todate').on('changeDate show', function(e) {\n\t $('#addFinancialYear').bootstrapValidator('revalidateField', 'todate');\n\t });\n}", "title": "" }, { "docid": "d7ae8a100b832e6ac69f59ffd95ce833", "score": "0.5717882", "text": "function setValidationMessages() {\n var missing = getMessage(\"Missing\");\n var missingElements = getElementsByName(\"missingText\", \"div\");\n for (i = 0; i < missingElements.length; i++) {\n missingElements[i].innerHTML = missing;\n }\n \n var invalid = getMessage(\"Invalid\");\n var invalidElements = getElementsByName(\"invalidText\", \"div\");\n for (i = 0; i < invalidElements.length; i++) {\n invalidElements[i].innerHTML = invalid;\n }\n}", "title": "" }, { "docid": "ba1cdea0699747d1cc7f572cbc5f2198", "score": "0.57171553", "text": "function virtualFormValidation () {\n}", "title": "" }, { "docid": "5328a0558f9e7cef4ceefc63c9251edb", "score": "0.5706577", "text": "initValidator() {\n this.validatorInstance = new WeValidator({\n // the set of the rules applied to the form\n rules: {\n realname: {\n required: true\n },\n idnum: {\n required: true,\n idcard: true\n },\n telnum: {\n required: true,\n mobile: true\n },\n willtxt: {\n required: true,\n //todo: set a max length? \n }\n },\n // the message if the rules are violated\n messages: {\n realname: {\n required: '请输入真实姓名'\n },\n idnum: {\n required: '请输入身份证号',\n idcard: '请输入正确的身份证号'\n },\n telnum: {\n required: '请输入手机号',\n mobile: '手机号格式不正确'\n },\n willtxt: {\n required: '请输入您的留声'\n }\n },\n })\n }", "title": "" }, { "docid": "1ca261847ea6630d1666e813aff7bccd", "score": "0.5701146", "text": "function init_ModalValidate() {\n $('#eventDetailsForm').validetta({\n realTime: true,\n display: 'inline',\n errorTemplateClass: 'validetta-inline',\n onValid: function (event) {\n promiseDetailModal(event);\n }\n });\n}", "title": "" }, { "docid": "31bb97380a44b1eb91bf052e27efab41", "score": "0.56978524", "text": "boot() {\n const Validator = use('Validator')\n Validator.extend('price', this.price.bind(this))\n Validator.extend('quantity', this.quantity.bind(this))\n Validator.extend('sellcurrency', this.sellcurrency.bind(this))\n Validator.extend('askcurrency', this.askcurrency.bind(this))\n Validator.extend('feeprocessing', this.feeprocessing.bind(this))\n Validator.extend('expires', this.expires.bind(this))\n }", "title": "" }, { "docid": "a9d06bf9591c217366182d9770228ba8", "score": "0.56900513", "text": "function Validator() {\n\t\tthis.hasErrors = false;\n}", "title": "" }, { "docid": "8abd2322b2adda744b6d34cf6468b70a", "score": "0.5689905", "text": "function initValidations(){\n // GENERIC FUNCTIONS\n var validateErrorPlacement = function(error, element) {\n error.addClass('ui-input__validation');\n error.appendTo(element.parent(\"div\"));\n }\n var validateHighlight = function(element) {\n $(element).parent('div').addClass(\"has-error\");\n }\n var validateUnhighlight = function(element) {\n $(element).parent('div').removeClass(\"has-error\");\n }\n var validateSubmitHandler = function(form) {\n $(form).addClass('loading');\n $.ajax({\n type: \"POST\",\n url: $(form).attr('action'),\n data: $(form).serialize(),\n success: function(response) {\n $(form).removeClass('loading');\n var data = $.parseJSON(response);\n if (data.status == 'success') {\n // do something I can't test\n } else {\n $(form).find('[data-error]').html(data.message).show();\n }\n }\n });\n }\n\n var validatePhone = {\n required: true,\n normalizer: function(value) {\n var PHONE_MASK = '+X (XXX) XXX-XXXX';\n if (!value || value === PHONE_MASK) {\n return value;\n } else {\n return value.replace(/[^\\d]/g, '');\n }\n },\n minlength: 11,\n digits: true\n }\n\n ////////\n // FORMS\n\n\n /////////////////////\n // REGISTRATION FORM\n ////////////////////\n $(\".js-registration-form\").validate({\n errorPlacement: validateErrorPlacement,\n highlight: validateHighlight,\n unhighlight: validateUnhighlight,\n submitHandler: validateSubmitHandler,\n rules: {\n last_name: \"required\",\n first_name: \"required\",\n email: {\n required: true,\n email: true\n },\n password: {\n required: true,\n minlength: 6,\n }\n // phone: validatePhone\n },\n messages: {\n last_name: \"Заполните это поле\",\n first_name: \"Заполните это поле\",\n email: {\n required: \"Заполните это поле\",\n email: \"Email содержит неправильный формат\"\n },\n password: {\n required: \"Заполните это поле\",\n email: \"Пароль мимимум 6 символов\"\n },\n // phone: {\n // required: \"Заполните это поле\",\n // minlength: \"Введите корректный телефон\"\n // }\n }\n });\n }", "title": "" }, { "docid": "9a488df4a17d1451833538597e666d8d", "score": "0.5681308", "text": "resetValidators() {\n Object.keys(this.validators).forEach((fieldName) => {\n this.validators[fieldName].errors = [];\n this.validators[fieldName].state = '';\n this.validators[fieldName].valid = false;\n });\n }", "title": "" }, { "docid": "e3d9f97827da96cc0d162036aad7fc70", "score": "0.56708056", "text": "init() {\n this._super(...arguments);\n (true && !(this.get('validationProperty')) && Ember.assert('validationProperty must be set', this.get('validationProperty')));\n\n if (!this.get('validationErrorMessages')) {\n let computedValidationMessages = buildComputedValidationMessages(this.get('validationProperty'), this.validations(), this.get('customValidations'));\n Ember.defineProperty(this, 'validationErrorMessages', computedValidationMessages);\n }\n }", "title": "" }, { "docid": "840e24ce779b4e3ac7d843797ebf1898", "score": "0.56586325", "text": "function checkValidation() {\r\n\r\n $(p.mShell).find('.changeEmailBody .loginInput').each(function (e) {\r\n if ($(this).val() == \"\") {\r\n valFlag = true;\r\n $(p.mShell).find('.changeEmailBody .feedback').css(\"color\", \"red\").html(\"Please fill in all of the fields.\").fadeIn();\r\n return false;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "3fbea51c61d29bb07670399cfbdee5e3", "score": "0.565398", "text": "function setValidateLabel () {\n let values = getCheckedAndUnchecked(form.validate.schema, form.validate.spec);\n\n switch (values.checked.length) {\n case 0:\n form.validate.label.text(\"Don't validate anything\");\n break;\n case 1:\n form.validate.label.text(\"Don't validate Swagger \" + values.unchecked[0]);\n break;\n case 2:\n form.validate.label.text(\"Validate everything\");\n }\n}", "title": "" }, { "docid": "b38332c099798ffceb43b6126d5bf6e3", "score": "0.56494164", "text": "function validateCreateDepartment()\n{\n\t$('#createDepartment').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tscdp_dept_name: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "29071b8c86ff3a899331faf88a77537b", "score": "0.56419355", "text": "function validateAddDivision()\n{\n\t$('#addDivision').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tclass: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please select class'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdivision_name: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter division name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "089738fc444b8b31082c49354e6e5446", "score": "0.5637107", "text": "function validateAddClass()\n{\n\t$('#addClass').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tclass_name: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter class name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "7c9b804107ea1fadfe9482adf7ab3f26", "score": "0.5627735", "text": "function initFormErrors() {\n const obj = d.querySelector('form .invalid');\n if (obj) obj.focus();\n}", "title": "" }, { "docid": "22ba978899ce01696c1802d07d4d4004", "score": "0.56101155", "text": "function initValidations() {\n // GENERIC FUNCTIONS\n var validateErrorPlacement = function(error, element) {\n error.addClass(\"ui-input__validation\");\n error.appendTo(element.parent(\"div\"));\n };\n var validateHighlight = function(element) {\n $(element).addClass(\"has-error\");\n };\n var validateUnhighlight = function(element) {\n $(element).removeClass(\"has-error\");\n };\n var validateSubmitHandler = function(form) {\n $(form).addClass(\"loading\");\n $.ajax({\n type: \"POST\",\n url: $(form).attr(\"action\"),\n data: $(form).serialize(),\n success: function(response) {\n $(form).removeClass(\"loading\");\n var data = $.parseJSON(response);\n if (data.status == \"success\") {\n // do something I can't test\n } else {\n $(form)\n .find(\"[data-error]\")\n .html(data.message)\n .show();\n }\n }\n });\n };\n\n var validatePhone = {\n required: true,\n normalizer: function(value) {\n var PHONE_MASK = \"+X (XXX) XXX-XXXX\";\n if (!value || value === PHONE_MASK) {\n return value;\n } else {\n return value.replace(/[^\\d]/g, \"\");\n }\n },\n minlength: 11,\n digits: true\n };\n\n /////////////////////\n // REGISTRATION FORM\n ////////////////////\n $(\".js-registration-form\").validate({\n errorPlacement: validateErrorPlacement,\n highlight: validateHighlight,\n unhighlight: validateUnhighlight,\n submitHandler: validateSubmitHandler,\n rules: {\n last_name: \"required\",\n first_name: \"required\",\n email: {\n required: true,\n email: true\n },\n password: {\n required: true,\n minlength: 6\n }\n // phone: validatePhone\n },\n messages: {\n last_name: \"Заполните это поле\",\n first_name: \"Заполните это поле\",\n email: {\n required: \"Заполните это поле\",\n email: \"Email содержит неправильный формат\"\n },\n password: {\n required: \"Заполните это поле\",\n email: \"Пароль мимимум 6 символов\"\n }\n // phone: {\n // required: \"Заполните это поле\",\n // minlength: \"Введите корректный телефон\"\n // }\n }\n });\n\n // when multiple forms share functionality\n\n // var subscriptionValidationObject = {\n // errorPlacement: validateErrorPlacement,\n // highlight: validateHighlight,\n // unhighlight: validateUnhighlight,\n // submitHandler: validateSubmitHandler,\n // rules: {\n // email: {\n // required: true,\n // email: true\n // }\n // },\n // messages: {\n // email: {\n // required: \"Fill this field\",\n // email: \"Email is invalid\"\n // }\n // }\n // }\n\n // call/init\n // $(\"[js-subscription-validation]\").validate(subscriptionValidationObject);\n // $(\"[js-subscription-validation-footer]\").validate(subscriptionValidationObject);\n // $(\"[js-subscription-validation-menu]\").validate(subscriptionValidationObject);\n }", "title": "" }, { "docid": "70f07275512f8d8cddba6975d67aba4b", "score": "0.5607728", "text": "init() {\n this._super(...arguments);\n assert('validationProperty must be set', this.validationProperty);\n if (!this.validationErrorMessages) {\n let computedValidationMessages = buildComputedValidationMessages(\n this.validationProperty,\n this.validations(),\n this.customValidations\n );\n defineProperty(this, 'validationErrorMessages', computedValidationMessages);\n }\n }", "title": "" }, { "docid": "fa7d176d02ccf36905826d571eef5eae", "score": "0.56010616", "text": "function validation (id) \r\n \t{\r\n\t\tvar elem = document.getElementById(id)\r\n\r\n\t\tif (elem.checkValidity()) {\r\n\t\t\telem.className=\"form-control is-valid\";\r\n\t\t}\r\n \t\t else {\r\n\t\t\telem.className=\"form-control is-invalid\";\r\n \t\t\t};\r\n\t}", "title": "" }, { "docid": "63abe34fc78b7e287ffb409ace4ab3e3", "score": "0.5599233", "text": "_validateAndPrepare() {\n let _this = this;\n\n // non interactive validation\n if (!S.config.interactive) {\n // Check Params\n if (!_this.evt.options.stage || !_this.evt.options.region || !_this.evt.options.key || !_this.evt.options.value) {\n return BbPromise.reject(new SError('Missing stage and/or region and/or key'));\n }\n }\n\n // Validate stage: make sure stage exists\n if (!S.getProject().validateStageExists(_this.evt.options.stage) && _this.evt.options.stage != 'local') {\n return BbPromise.reject(new SError('Stage ' + _this.evt.options.stage + ' does not exist in your project'));\n }\n\n // Skip the next validation if stage is 'local' & region is 'all'\n if (_this.evt.options.stage != 'local' && _this.evt.options.region != 'all') {\n\n // validate region: make sure region exists in stage\n if (!S.getProject().validateRegionExists(_this.evt.options.stage, _this.evt.options.region)) {\n return BbPromise.reject(new SError('Region \"' + _this.evt.options.region + '\" does not exist in stage \"' + _this.evt.options.stage + '\"'));\n }\n }\n }", "title": "" }, { "docid": "4470b72ab7b25668c5ea495cf73eb8ad", "score": "0.5597129", "text": "setCustomValidationMessages() {\n let self = this;\n\n self.inputElems.map(item => {\n self.setCustomValidationMessage(item);\n });\n }", "title": "" }, { "docid": "1a4e985987be76a8d6559a56fc7f8fb0", "score": "0.55887496", "text": "function set_up_vaild() {\r\n window.addEventListener('load', function () {\r\n var form = document.getElementById('login');\r\n document.getElementById('btn-login').addEventListener('click', function (event) {\r\n if (form.checkValidity() === false) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n form.classList.add('was-validated');\r\n }, false);\r\n }, false);\r\n}", "title": "" }, { "docid": "f8e8316aa3decc1515815952e01da072", "score": "0.5583221", "text": "value() {\n this.updateValidation()\n }", "title": "" }, { "docid": "0d7711b1b0255a3f52c6bcfb9747c3bd", "score": "0.55804443", "text": "function toggleValidCss(isValid,validationErrorKey){validationErrorKey=validationErrorKey?\"-\"+snake_case(validationErrorKey,\"-\"):\"\",$animate.removeClass(element,(isValid?INVALID_CLASS:VALID_CLASS)+validationErrorKey),$animate.addClass(element,(isValid?VALID_CLASS:INVALID_CLASS)+validationErrorKey)}", "title": "" }, { "docid": "7b6eb2f0e14ee18963489c08820b1ff5", "score": "0.5578146", "text": "function initialiseFormValidation() {\n const validationRules = {}\n\n // Calculate validation fields based on to/amount fields\n _.each(getRecipientIds(), (id) => {\n validationRules['to' + id] = {\n identifier: 'to_' + id,\n rules: [\n {\n type: 'empty',\n prompt: 'Please enter the QRL address you wish to send to',\n },\n {\n type: 'qrlAddressValid',\n prompt: 'Please enter a valid QRL address',\n },\n ],\n }\n\n validationRules['amounts' + id] = {\n identifier: 'amounts_' + id,\n rules: [\n {\n type: 'empty',\n prompt: 'You must enter an amount',\n },\n {\n type: 'number',\n prompt: 'Amount must be a number',\n },\n {\n type: 'maxDecimals',\n prompt: 'You can only enter up to 9 decimal places in the amount field',\n },\n ],\n }\n })\n\n // Now set fee and otskey validation rules\n validationRules['fee'] = {\n id: 'fee',\n rules: [\n {\n type: 'empty',\n prompt: 'You must enter a fee',\n },\n {\n type: 'number',\n prompt: 'Fee must be a number',\n },\n {\n type: 'maxDecimals',\n prompt: 'You can only enter up to 9 decimal places in the fee field',\n },\n ],\n }\n validationRules['otsKey'] = {\n id: 'otsKey',\n rules: [\n {\n type: 'empty',\n prompt: 'You must enter an OTS Key Index',\n },\n {\n type: 'number',\n prompt: 'OTS Key Index must be a number',\n },\n ],\n }\n\n // Address Validation\n $.fn.form.settings.rules.qrlAddressValid = function (value) {\n try {\n const rawAddress = anyAddressToRawAddress(value)\n const thisAddress = helpers.rawAddressToHexAddress(rawAddress)\n const isValid = qrlAddressValdidator.hexString(thisAddress)\n return isValid.result\n } catch (e) {\n return false\n }\n }\n\n // Initialise the form validation\n $('.ui.form').form({\n fields: validationRules,\n })\n}", "title": "" }, { "docid": "7bd2c68f9f8672fd789504fabfa7aa7e", "score": "0.55776507", "text": "function initializeValidation() {\n jQuery.validator.setDefaults({\n debug: true\n\n });\n let validationRules = {\n \"Question\": {\n required: true\n , minlength: 5\n }\n , \"Answer\": {\n required: true\n , minlength: 5\n }\n , \"Display Order\": {\n required: true\n }\n }\n let validationMessages = {\n \"Question\": {\n required: \"Question is required\"\n , minlength: \"At least 5 characters are required\"\n }\n , \"Answer\": {\n required: \"Answer is required\"\n , minlength: \"At least 5 characters are required\"\n }\n , \"Display Order\": {\n required: \"This field is required\"\n }\n }\n let validationOptions = {\n rules: validationRules\n , messages: validationMessages\n }\n $(\"#faqValidate\").validate(validationOptions);\n}", "title": "" }, { "docid": "077d51a18947193ced2645a700975a0c", "score": "0.55588937", "text": "formValidation() {\n this.userInput = this.input.value;\n this.ipTestRegex = this.ipAddressRegex.test(this.userInput);\n this.domainTestRegex = this.domainRegex.test(this.userInput);\n this.form.classList.remove(`${this.selectors.invalidClass}`);\n\n // Checking input for ip address or domain\n if (this.ipTestRegex) {\n this.userInput = `ipAddress=${this.userInput}`;\n } else if (this.domainTestRegex) {\n this.userInput = `domain=${this.userInput}`;\n } else {\n this.form.classList.add(`${this.selectors.invalidClass}`);\n return false;\n }\n\n this.collapse.disable();\n this.loader.classList.add(`${this.selectors.loadingClass}`);\n this.formEnabled = false;\n this.fetchData(this.userInput);\n this.form.reset();\n }", "title": "" }, { "docid": "d014b736f4d79c915dec99596e7ae574", "score": "0.55582315", "text": "function toggleValidCss(isValid,validationErrorKey){validationErrorKey=validationErrorKey?\"-\"+snake_case(validationErrorKey,\"-\"):\"\",$animate.removeClass($element,(isValid?INVALID_CLASS:VALID_CLASS)+validationErrorKey),$animate.addClass($element,(isValid?VALID_CLASS:INVALID_CLASS)+validationErrorKey)}", "title": "" }, { "docid": "b06a5f7ad17f24a266944c1b4da81e95", "score": "0.55505496", "text": "function validateCreateDepartment()\n{\n\t$('#createDepartment').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tscdp_dept_name: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter department name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "17c482a822c74c1039295e74f6bbebff", "score": "0.550983", "text": "function validateAddCountry()\n{\n\t\n\t$('#addCountry').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tsccy_country: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter country code'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tsccy_name: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z]+$/,\n\t\t\t\t\t\tmessage: 'Please enter only character'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter country name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "f22b3e2b6c7b4af5f6308676e70f0295", "score": "0.549843", "text": "function validateForm() {\n\n // These 2 booleans will be used to know whether to check their containers or not\n var isPartialShiftCollapsed = ($('#partial-shift').css('display') === 'none' ? true : false),\n isMealPeriodCollapsed = ($('#meal-period-section').css('display') === 'none' ? true : false),\n\n // These arrays - required, atLeastOne - represent an attempt to \n // set up a larger formal system for handling basic requirements \n // around empty form elements. It turned out to be more complicated \n // than that, and this issue might benefit from refactoring.\n required = [\n 'leaveType',\n 'startDate',\n 'mealPeriodLength'\n ],\n\n // perform action depends on whether its section is open or not\n atLeastOne = [\n {\n keys: [\n 'leaveTime',\n 'returnTime'\n ],\n performAction: !isPartialShiftCollapsed\n },\n { \n keys: [\n 'yesMeal',\n 'noMeal'\n ],\n performAction: !isPartialShiftCollapsed,\n\n // method to handle bootstrap error class adding/subtracting\n setErrors: function(pass, map) {\n var btnY = map.yesMeal.$,\n btnN = map.noMeal.$,\n div = map.noMeal.parent.parent();\n if (pass) {\n if (btnY.hasClass('btn-danger')) {\n btnY.removeClass('btn-danger').addClass('btn-default'); \n }\n if (btnN.hasClass('btn-danger')) {\n btnN.removeClass('btn-danger').addClass('btn-default');\n }\n div.removeClass('has-error');\n } else {\n btnY.removeClass('btn-default').addClass('btn-danger');\n btnN.removeClass('btn-default').addClass('btn-danger');\n div.addClass('has-error');\n valid = false;\n }\n }\n }\n ],\n endDate = $('#endDate').val(),\n mealTime = $('#mealTime').val(),\n\n // create the responses object we'll use to transmit to server\n responses = {\n endDate: endDate ? new Date(endDate).getTime() : undefined,\n mealTime: mealTime ? moment(mealTime, 'LT').toDate().getTime() : undefined,\n comments: $('#comments').val(),\n isPartialShiftCollapsed: isPartialShiftCollapsed,\n isMealPeriodCollapsed: isMealPeriodCollapsed\n },\n valid = true,\n text = '',\n jQ;\n\n // the variable arr is a misnomer here, as it is actually an object.\n atLeastOne.forEach(function(arr) {\n if (arr.performAction) {\n var map = {},\n\n // map() may seem to be unnecessary here, as id passes inertly through\n // it, but it's used instead of a seemingly more appropriate forEach()\n // because it passes the array forward to every(), while forEach()\n // would pass undefined along. every() is of course responsible for\n // setting nonePass to a boolean value after all is said and done.\n nonePass = arr.keys.map(function(id) {\n jQ = $('#' + id);\n var val = jQ.val();\n map[id] = {\n $: jQ,\n val:val,\n\n // not generic logic. only works for the current form elements.\n pass: (jQ.attr('type') === 'text') ? !!val : jQ.hasClass('active'),\n\n parent: jQ.parent()\n };\n return id;\n })\n\n // Probably inverting this return statement and renaming nonePass to \n // pass would make some sense in the larger context.\n .every(function(id) {\n return !map[id].pass\n });\n\n if (arr.setErrors) {\n\n // flipping nonePass is a little counterintuitive. See a few lines above.\n arr.setErrors(!nonePass, map);\n } else if (nonePass) {\n arr.keys.forEach(function(id) {\n if (!map[id].parent.hasClass('has-error')) map[id].parent.addClass('has-error');\n\n // take data out of responses until error is cleared up\n if (id in responses) delete responses[id];\n });\n valid = false;\n } \n\n // this else clause is only possible because of the unique structure\n // of this form/code. perhaps the way to clear this up is to make\n // setErrors more generic. As it stands, the code in this block is\n // only ever run for 'leaveTime' and 'returnTime', which is precisely\n // what is exploited.\n else {\n arr.keys.forEach(function(id) {\n if (map[id].val) {\n responses[id] = moment(map[id].val, 'LT').toDate().getTime();\n } else { delete responses[id]; }\n });\n }\n }\n });\n \n required.forEach(function(e) {\n var $e = $('#' + e),\n val = $e.val(),\n $div = $e.parent(),\n $otherTime;\n\n // modify val in the case of a custom leave type.\n val = (e === 'leaveType' && val === 'other') ? $('#specifyType').val() : val;\n\n // only count leave time if that section is expanded\n if (e === 'leaveTime' || e === 'returnTime') {\n if (responses.isPartialShiftCollapsed) {\n if (responses[e]) delete responses[e];\n return;\n }\n }\n\n // only count mealPeriodLength if that section is expanded\n if (e === 'mealPeriodLength') {\n if (responses.isMealPeriodCollapsed) {\n if (responses[e]) {\n delete responses[e];\n\n // no period len means no mealtime either\n if (responses.mealTime) delete responses.mealTime;\n }\n return;\n }\n }\n \n // Refactoring this to supply a method that handles errors might\n // make this code more generic too. Already, this does handle\n // all cases with 2 expressions, though.\n if (!val || val === 'Please choose:') {\n if (!$div.hasClass('has-error')) $div.addClass('has-error');\n if (responses.hasOwnProperty(e)) delete responses[e];\n valid = false;\n } \n\n // remove error class\n else {\n if ($div.hasClass('has-error')) $div.removeClass('has-error');\n if (!responses.hasOwnProperty(e)) {\n\n // be sure to handle dates/times, and pass them to the server in milliseconds\n if (e.search(/Date/) !== -1) {\n responses[e] = new Date(val).getTime();\n } else if (e.search(/Time/) !== -1) {\n responses[e] = moment(val, 'LT').toDate().getTime();\n } else {\n responses[e] = val;\n }\n }\n }\n });\n\n // Handle time inconsistent start and end dates to time off\n if (responses.endDate && responses.startDate) {\n if (responses.endDate < responses.startDate) {\n $('#startDate').parent().addClass('has-error');\n $('#endDate').parent().addClass('has-error');\n valid = false;\n } else {\n $('#startDate').parent().removeClass('has-error');\n $('#endDate').parent().removeClass('has-error');\n }\n } else { $('#endDate').parent().removeClass('has-error'); }\n\n if (valid) {\n\n // All good! move on to confirmation\n confirm(responses);\n\n } else {\n\n // Some things need fixing before we can submit this\n showValidationErrorMessage();\n\n }\n}", "title": "" }, { "docid": "cbb457715ce9bbe26f8e852c8ac1f183", "score": "0.54961145", "text": "function validationEvent() {\n // Fetch all the forms we want to apply custom Bootstrap validation styles to\n var forms = document.getElementsByClassName(\"needs-validation-event\");\n // Loop over them and prevent submission\n var validation = Array.prototype.filter.call(forms, function (form) {\n document.getElementById(\"createEvent\").addEventListener(\"click\", function (event) {\n if (form.checkValidity() === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n form.classList.add(\"was-validated\");\n }, false);\n });\n}", "title": "" }, { "docid": "39770671d12db99de28f4a23345fe4a3", "score": "0.5491781", "text": "function bindInputCheckValid() {\n $(\":input.form-control\").bind('blur', function () {\n try {\n var val = Page_Validators;\n\n if (val != 'undefined' && val != null) {\n var haserror = 0;\n for (var i = 0; i < val.length; i++) {\n var isValidPhone = CheckPhoneUSValid($(\"#\" + this.id).val(), this.id);\n if (val[i].controltovalidate == this.id && !val[i].isvalid && !isValidPhone) {\n haserror = 1;\n break;\n }\n }\n if (haserror == 1) {\n\n var control = $(this).parent();\n if (control.hasClass(\"form-group\")) {\n control.addClass(\"has-error has-feedback\");\n }\n else if (control.parent().hasClass(\"form-group\")) {\n control = control.parent();\n control.addClass(\"has-error has-feedback\");\n }\n var tagName = this.tagName;\n if (tagName != \"SELECT\") {\n var iconError = \"<span id=spError_\" + this.id + \" class='glyphicon glyphicon-remove form-control-feedback'></span>\";\n if (!document.getElementById(\"spError_\" + this.id)) {\n $(iconError).insertAfter(this);\n }\n }\n }\n else if (haserror == 0) {\n var control = $(this).parent();\n if (control.hasClass(\"has-error has-feedback\")) {\n control.removeClass(\"has-error has-feedback\");\n }\n else if (control.parent().hasClass(\"has-error has-feedback\")) {\n control = control.parent();\n control.removeClass(\"has-error has-feedback\");\n }\n $(\"#spError_\" + this.id).remove();\n }\n }\n }\n catch (err)\n { }\n });\n}", "title": "" }, { "docid": "bbe666c5dbf66f2d66524713e23bb49b", "score": "0.5490284", "text": "function OnValidate () {}", "title": "" }, { "docid": "6cf03b04a5d26dee5849b15dede85869", "score": "0.54882294", "text": "function configureResetValidation() {\n // reset wrong file type error message\n self.configure.form.$setValidity('invalid', true);\n // toggleErrorMessage(self.select.form, 'dataType', 'wrong', true);\n }", "title": "" }, { "docid": "cab023c9db4ad7b8f389dd78970ecece", "score": "0.54833204", "text": "function llamarValidarProducto() {\n \n //se svalida el form\n $('#frmVehiculo').bootstrapValidator(\"validate\");\n var iValido = false;\n //se recupera el estatus \n iValido = $('#frmVehiculo').data(\"bootstrapValidator\").isValid();\n //se verifica si el form es valido\n if (iValido == true) {\n realizaProceso();\n } else {\n \n alert(\"Debe de llenar Todos los campos\");\n }\n}", "title": "" }, { "docid": "54d74e7944e00a4814fd24955787d5a0", "score": "0.5473184", "text": "function validateCreateDesignation()\n{\n\t$('#createDesignation').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tscdg_designation: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[a-zA-Z ]+$/,\n\t\t\t\t\t\tmessage: 'Please add only characters'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "32fbab7a7334415fedce7c3977a26131", "score": "0.54730064", "text": "setValidation() {\n let fields = this.state.createUserAllData\n let formIsValid = true;\n if (!fields[\"first_name\"]) {\n formIsValid = false;\n this.setState({ firstNameError: true })\n }\n else {\n this.setState({ firstNameError: false })\n }\n \n if (!fields[\"email_id\"]) {\n formIsValid = false;\n this.setState({ emailError: true })\n }\n else {\n this.setState({ emailError: false })\n }\n\n if (typeof fields[\"email_id\"] !== \"undefined\") {\n let lastAtPos = fields[\"email_id\"].lastIndexOf('@');\n let lastDotPos = fields[\"email_id\"].lastIndexOf('.');\n\n if (!(lastAtPos < lastDotPos && lastAtPos > 0 && fields[\"email_id\"].indexOf('@@') == -1 && lastDotPos > 2 && (fields[\"email_id\"].length - lastDotPos) > 2)) {\n formIsValid = false;\n this.setState({ emailValidError: true });\n }\n else {\n this.setState({ emailValidError: false, isCheckFillField: 1 });\n }\n }\n if (!fields[\"conPassword\"]) {\n formIsValid = false;\n this.setState({ passwordError: true })\n }\n else {\n this.setState({ passwordError: false })\n }\n\n if (!fields[\"role\"]) {\n formIsValid = false;\n this.setState({ roleError: true })\n }\n else {\n this.setState({ roleError: false })\n }\n \n if (!this.state.isEmailExist) {\n formIsValid = false;\n }\n return formIsValid;\n }", "title": "" }, { "docid": "81312dbf4ae2b535963696d4e3c6d194", "score": "0.54721665", "text": "function inititaliseForm() {\n $(\"#name\").focus();\n $('#other-title, label[for = \"other-title\"], #colors-js-puns').hide();\n $(\"#design\").on(\"input\", showColorOptionsForDesign);\n $(\".activities\").on(\"input\", \"input\", handleActivitySelection());\n $(\"#payment\").on(\"input\", handlePaymentSelection());\n $(\"#title\").on(\"input\", handleJobSelection);\n initialiseValidations();\n}", "title": "" }, { "docid": "1172e0a2e14110ad6713706f23e7102c", "score": "0.5467748", "text": "function initValidate1(){\n\tvar fn = \"[ValidateSample.js initValidate1()] \";\n\tjslog (JSLOG_DEBUG,fn + JSLOG_FUN_START);\n\t\n\tcValidateObj1 = new cValidate ({ \n\t\temail: { // Mandatory email \n\t\t presence: true,\t email: true \n\t\t},\n\t\tduration: { // Mandatory Integer in range [1..10] with a tip explaining it\n\t\t\tpresence: true, tip: TIP_DURATION, \n\t numericality: {\n\t onlyInteger: true,\n\t greaterThanOrEqualTo: 1,\n\t lessThanOrEqualTo: 10\n\t }\n\t\t},\n\t\tbirthdate: { // Optional Birthaday in date default format (YYYY-MM-DD)\n\t\t\tdate: {}\n\t\t}},\n\t\t// OPTION: Id of div to use in case of bOnErrShowSect:true\n\t\t{szErrSectId: \"errSect1\"}\n\t);\n\t// Now the item Validation is managed by cValidate.js\n\tjslog (JSLOG_DEBUG,fn + JSLOG_FUN_END);\n}", "title": "" }, { "docid": "727757048f2a98f10b9a7cd265e38ff1", "score": "0.5457748", "text": "function initSettingsValidators(){\n const sEls = document.getElementById('settingsContainer').querySelectorAll('[cValue]')\n Array.from(sEls).map((v, index, arr) => {\n const vFn = ConfigManager['validate' + v.getAttribute('cValue')]\n if(typeof vFn === 'function'){\n if(v.tagName === 'INPUT'){\n if(v.type === 'number' || v.type === 'text'){\n v.addEventListener('keyup', (e) => {\n const v = e.target\n if(!vFn(v.value)){\n settingsState.invalid.add(v.id)\n v.setAttribute('error', '')\n settingsSaveDisabled(true)\n } else {\n if(v.hasAttribute('error')){\n v.removeAttribute('error')\n settingsState.invalid.delete(v.id)\n if(settingsState.invalid.size === 0){\n settingsSaveDisabled(false)\n }\n }\n }\n })\n }\n }\n }\n\n })\n}", "title": "" }, { "docid": "4b57e7684f6b060edb7e786c0148e7db", "score": "0.5455814", "text": "function customSettingsValidation() {\n\t$.extend($.validator.messages, {\n\t\trequired: 'Bitte Feld ausfüllen.',\n\t\turl: 'Bitte gültige URL eingeben.',\n\t\tdigits: 'Nur Zahlen erlaubt.'\n\t});\n}", "title": "" }, { "docid": "1aadb6f67e006348ff0bc03608c9510f", "score": "0.54550445", "text": "function addNewGroupValidation() {\n\t$('#name', '#addGroupForm').popover('hide');\n\t\n\t$('#addGroupForm').bootstrapValidator({\n\t\tcontainer: '#no',\n feedbackIcons: {\n valid: 'glyphicon glyphicon-ok',\n invalid: 'glyphicon glyphicon-remove',\n validating: 'glyphicon glyphicon-refresh'\n },\n\t\tlive: 'enabled',\n\t\tfields: {\n\t\t\tname: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}).on('error.field.bv', function(e, data){\n\t\t$(e.target).popover('show');\n\t}).on('success.field.bv', function(e, data){\n\t\t$(e.target).popover('hide');\n\t});\n}", "title": "" }, { "docid": "d29dba0cec9a4ce1d06fd163be67fbfa", "score": "0.54517555", "text": "function set_up_vaild() {\r\n window.addEventListener('load', function () {\r\n document.getElementById('btn-signup').addEventListener('click', function (event) {\r\n if (form.checkValidity() === false) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n form.classList.add('was-validated');\r\n }, false);\r\n }, false);\r\n}", "title": "" }, { "docid": "bc082154c7fb80d88056dce878415958", "score": "0.54411274", "text": "validate () {\n\n }", "title": "" }, { "docid": "f8fd0daf3e91bf26270c5ac1da4a184f", "score": "0.54400814", "text": "onChange () {\n const isValid = this.fields.every((field) => {\n return field.validationState === fieldValidationStateValid ||\n field.validationState === fieldValidationStateNotEvaluated\n })\n if (this.isValid !== isValid) {\n debug('change valid state to \"%s\"', isValid)\n this.isValid = isValid\n if (isValid) {\n this.$button.removeAttribute('disabled')\n } else {\n this.$button.setAttribute('disabled', true)\n }\n }\n }", "title": "" }, { "docid": "917bc0860bc13cac6b8a4ef62501e09f", "score": "0.543502", "text": "function _init() {\n if (onExpandedView) {\n overlay = $(modalOverlayHTML)\n }\n\n validationButtons = {\n \"validate-agree\": overlay.find(\"#gallery-card-agree-button\"),\n \"validate-disagree\": overlay.find(\"#gallery-card-disagree-button\"),\n \"validate-not-sure\": overlay.find(\"#gallery-card-not-sure-button\")\n };\n\n // If the signed in user had already validated this label before loading the page, style the card to show that.\n if (currCardProperties !== null && currCardProperties.user_validation) {\n if (onExpandedView) showValidationOnExpandedView(currCardProperties.user_validation);\n else showValidationOnCard(currCardProperties.user_validation);\n }\n\n // Add onClick functions for the validation buttons.\n for (const [valKey, button] of Object.entries(validationButtons)) {\n button.click(validateOnClick(valKey, false));\n }\n\n // Add onClick for the validation thumbs up/down buttons.\n if (!onExpandedView) {\n addValidationInfoOnClicks(refCard.validationInfoDisplay);\n }\n gsvImage.append(overlay);\n }", "title": "" }, { "docid": "a5b1da2ad587c1e762472695816d784f", "score": "0.54342437", "text": "function validateLoginForm()\n{\n\t$('#login_form').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tunumber: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter username'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tsl_user_pwd: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter password'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8d9f83ff1b64f8e18c594c10c171650a", "score": "0.5428065", "text": "constructor(value, validation) {\n this.value = value;\n this.validation = validation;\n }", "title": "" }, { "docid": "1edfd864f6ee741531086dffba0cd994", "score": "0.54250944", "text": "function initiateWizards() {\n validateCategoryInput() ? $scope.wizards.category = true : 0;\n validateDescriptionInput() ? $scope.wizards.description = true : 0;\n validatePhotosInput() ? $scope.wizards.photos = true : 0;\n validateBookingInput() ? $scope.wizards.booking = true : 0;\n validatePriceInput() ? $scope.wizards.price = true : 0;\n $scope.allStepDones = checkAllStepDoneYet();\n }", "title": "" }, { "docid": "1edfd864f6ee741531086dffba0cd994", "score": "0.54250944", "text": "function initiateWizards() {\n validateCategoryInput() ? $scope.wizards.category = true : 0;\n validateDescriptionInput() ? $scope.wizards.description = true : 0;\n validatePhotosInput() ? $scope.wizards.photos = true : 0;\n validateBookingInput() ? $scope.wizards.booking = true : 0;\n validatePriceInput() ? $scope.wizards.price = true : 0;\n $scope.allStepDones = checkAllStepDoneYet();\n }", "title": "" }, { "docid": "a025b683d243f528d5bce26dccd99b63", "score": "0.5424183", "text": "function Validator() {\n // error message in the current validation\n this.messages = [];\n this.config = {};\n }", "title": "" }, { "docid": "698b0d5ff0436a24b24d796c9dba40c1", "score": "0.54212594", "text": "validateForm() {\n\t\t this.setState({\n\t\t\t formValid: this.state.emailValid\n\t\t });\n\t }", "title": "" }, { "docid": "c9fd28f623a82f5ec8609538206829e3", "score": "0.5410756", "text": "function validateBookInward()\n{\n\t$('#bookInward').bootstrapValidator({\n\t\t// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later\n\t\tfeedbackIcons: {\n\t\t\tvalid: 'glyphicon glyphicon-ok',\n\t\t\tinvalid: 'glyphicon glyphicon-remove',\n\t\t\tvalidating: 'glyphicon glyphicon-refresh'\n\t\t},\n\t\texcluded: [':disabled'],\n\t\tfields: {\n\t\t\tscbi_book_id: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter book name'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscbi_quantity: {\n\t\t\t\tvalidators: {\n\t\t\t\t\tregexp: {\n\t\t\t\t\t\tregexp: /^[0-9]+$/,\n\t\t\t\t\t\tmessage: 'Please add only number'\n\t\t\t\t\t},\n\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\tmessage: 'Please enter quantity'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n}", "title": "" }, { "docid": "ac18e5bc0fc4cb62799abfc02ed09133", "score": "0.5408976", "text": "function feedbackFormValidation() {\n $('#feedbackInsert').on('click', 'button.addFeedback-btn', function () {\n \n var fromyear = $(\"#fromyear\").val();\n var fromdate = $(\"#fromdate\").val();\n if(fromyear == '' || fromdate == ''){\n alertmethod('','The year and Quarter value is mandatory, please select it');\n return false;\n }\n $('form').validate({\n highlight: function (element) {\n $(element).closest('.form-group').addClass('has-error');\n },\n unhighlight: function (element) {\n $(element).closest('.form-group').removeClass('has-error');\n $(element).closest('.form-horizontal').find('select').removeClass('has-error');\n }\n });\n });\n}", "title": "" }, { "docid": "40fc1cab71350e8c7e20a3e20aba49a8", "score": "0.5396559", "text": "function $onInit() {\n self.ngModelCtrl.$render = $render;\n self.ngModelCtrl.$validators.bread = breadValidator;\n //self.ngModelCtrl.$asyncValidators.bread = asyncBreadValidator;\n }", "title": "" }, { "docid": "c9cab8a706a2967b1920012e7cce80c8", "score": "0.5394704", "text": "function init(){\n\t\tstartDateInputs = $('#start-date-group').find('input');\n\t\tendDateInputs = $('#end-date-group').find('input');\n\t\tendDateLabels = $('#end-date-group').find('label');\n\t\tstartStatusInputs = $('#start-status-group').find('input');\n\t\tstartStatusLabels = $('#start-status-group').find('label');\n\t\toutcomeInputs = $('#outcome-group').find('input');\n\t\toutcomeLabels = $('#outcome-group').find('label');\n\n\t\tsetStartDateState();\n\t\tsetEndDateState();\n\t\tsetOutcomeStatusState();\n\n\t\tstartDateInputs.on('blur', setStartDateState);\n\t\tendDateInputs.on('blur', setOutcomeStatusState);\n\n\t\tstartStatusInputs.on('click', setEndDateState)\n\t}", "title": "" }, { "docid": "77b89beede2145b94291e57a3f6f9845", "score": "0.5387137", "text": "initValidations() {\n this.validationsMaps.forEach(mapping => {\n let targetRange = this.getColumnRange(\n this.getTabId(mapping.targetTab), mapping.targetProperty);\n let validationRange = this.getColumnRange(\n this.getTabId(mapping.validationTab), mapping.validationProperty);\n let rule = SpreadsheetApp.newDataValidation().requireValueInRange(\n validationRange).build();\n targetRange.setDataValidation(rule);\n });\n }", "title": "" }, { "docid": "cf038378862a03ba6b69f76fc37be521", "score": "0.5374887", "text": "function setValid(field) {\t\n\n\tfield.nextElementSibling.innerHTML = '';\n\n\n\tif (field.classList.contains('border-danger')) {\n\t\tfield.classList.remove('border-danger');\n\t}\n\n\tfield.classList.add('border-success');\n}", "title": "" }, { "docid": "bd87b28bcce7a7607833041a2d0528d1", "score": "0.5373986", "text": "function validate(input) {\n $(\"#\"+input).removeClass('form-control is-invalid');\n $(\"#\"+input).addClass('form-control is-valid');\n}", "title": "" }, { "docid": "9c566148929adc31d526450ec6661d9b", "score": "0.5369922", "text": "function validaFormUpdateUsuario()\n {\n\n\n $('#FormUpdateUsuario').bootstrapValidator(\n {\n\n message: 'This value is not valid',\n container: 'tooltip',\n feedbackIcons: {\n valid: 'glyphicon glyphicon-ok',\n invalid: 'glyphicon glyphicon-remove',\n validating: 'glyphicon glyphicon-refresh'\n },\n fields: {\n txtNombre: {\n group: '.form-group',\n validators: \n {\n notEmpty: {\n message: 'Este campo es requerido'\n },\n \n\n }\n },\n txtApellidos: {\n group: '.form-group',\n validators: {\n notEmpty: {\n message: 'Este campo es requerido'\n },\n \n\n\n }\n },\n txtEmail: {\n group: '.form-group',\n validators: \n {\n notEmpty: {\n message: 'Este campo es requerido'\n },\n regexp: {\n regexp: /^([a-zA-Z0-9_.+-])+\\@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$/,\n\n message: 'La dirección de email no es válida',\n\n },\n callback: {\n message: 'El Email ingresado no esta disponible',\n callback: function(value, validator) {\n // Get the selected options\n\n var valida = true;\n\n var datosUsuario = {\n id_usuario : $(\"#txtIdUsuario\").val(),\n email:$(\"#txtEmail\").val()\n }\n\n\n $.ajax(\n {\n type: \"POST\",\n url: \"Usuarios/checkEmail\",\n dataType:\"json\",\n data: datosUsuario,\n async: false,\n success: function(result)\n {\n\n if(typeof(result.baja) == \"undefined\") \n {\n if(result.msjCantidadRegistros > 0)\n {\n valida = false;\n }\n else\n {\n valida = true;\n }\n\n }\n else\n {\n window.location = result.url;\n }\n \n },\n error:function(result)\n {\n alert(\"Error\");\n console.log(result.responseText);\n \n }\n \n });\n\n return valida;\n\n // var options = validator.getFieldElements('colors').val();\n // return (options != null && options.length >= 2 && options.length <= 4);\n }\n },\n\n }\n },\n txtPassword: {\n group: '.form-group',\n validators: {\n notEmpty: {\n message: 'Este campo es requerido'\n },\n stringLength: {\n enabled: true,\n min: 5,\n max: 20,\n message: 'El password debe contener como mínimo 5 caracteres y 20 como máximo'\n },\n\n }\n },\n slTipoUsuario: {\n group: '.form-group',\n validators: {\n notEmpty: {\n message: 'Seleciona un tipo de usuario.'\n }\n }\n }\n\n\n }\n }).on('success.form.bv', function (e) {\n \n\n var imagenBD = $(\"#modalUpdateUsuario #btnModificarUsuario\").prop(\"imagen\");\n\n var imagenLoad = \"\";\n\n if($(\"body .file-preview img\").length > 0 )\n {\n imagenLoad = $(\"body .file-preview img\").attr(\"src\").split(\"/\")[6];\n }\n if($(\"body .kv-file-content embed\").length>0)\n {\n imagenLoad = $(\"body .kv-file-content embed\").attr(\"src\").split(\"/\")[3]\n }\n\n \n\n var cambioImagen = \"NO\";\n\n if(imagenBD!=imagenLoad)\n {\n cambioImagen = \"SI\";\n }\n\n //console.log(cambioImagen);\n\n // var cambioImagen = $(\"#modalUpdateUsuario #btnModificarUsuario\").prop(\"cambioImagen\");\n\n\n var datosUsuarioUrl = \"?id_usuario=\"+ $(\"#txtIdUsuario\").val()+\n \"&id_rol= \"+$(\"#slTipoUsuario\").val()+\n \"&nombre=\"+$(\"#txtNombre\").val()+\n \"&apellidos=\"+$(\"#txtApellidos\").val()+\n \"&email=\"+$(\"#txtEmail\").val()+\n \"&password=\"+$(\"#txtPassword\").val()+\n \"&cambioImagen=\"+cambioImagen;\n\n var archivos = document.getElementById(\"fileFoto\"); \n\n var archivo = archivos.files;\n var archivos = new FormData();\n for(i=0; i<archivo.length;i++)\n {\n archivos.append('archivo',archivo[i])\n }\n\n $.ajax(\n {\n type: \"POST\",\n url: \"Usuarios/updateUsuario\"+datosUsuarioUrl,\n dataType:\"json\",\n contentType:false,\n processData:false,\n data: archivos,\n async: true,\n success: function(result)\n {\n console.log(result);\n\n if(typeof(result.baja) == \"undefined\") \n {\n $('#modalUpdateUsuario').modal('hide');\n $(\"#modalAlertaUsuario .modal-body\").html(result.msjConsulta);\n $(\"#modalAlertaUsuario\").modal(\"show\");\n }\n else\n {\n window.location = result.url;\n }\n \n\n },\n error:function(result)\n {\n alert(\"Error\");\n console.log(result.responseText);\n \n }\n \n });\n\n\n\n });\n\n\n }", "title": "" }, { "docid": "8ef3a4d2a171457f1f23e415a2e46d57", "score": "0.53581005", "text": "validate() {\n // Get generic API validation errors\n this._super();\n const intl = get(this, 'intl');\n var errors = get(this, 'errors')||[];\n if ( !get(this, 'model.name') ) {\n errors.push(intl.t('nodeDriver.aliyunecs.errors.nameRequired'));\n }\n\n // Add more specific errors\n\n // Check something and add an error entry if it fails:\n const name = get(this, 'model.name');\n\n const sshPassword = get(this, 'config.sshPassword');\n\n const lower = /[a-z]/.test(sshPassword) ? 1 : 0;\n const upper = /[A-Z]/.test(sshPassword) ? 1 : 0;\n const number = /[0-9]/.test(sshPassword) ? 1 : 0;\n const special = /[?+*$^().|<>';:\\-=\\[\\]\\{\\},&%#@!~`\\\\]/.test(sshPassword) ? 1 : 0;\n\n if (sshPassword && (sshPassword.length < 8) || sshPassword.length > 30) {\n errors.push(intl.t('nodeDriver.aliyunecs.errors.sshPasswordLengthNotValid'));\n }\n\n if (sshPassword && !/[?+*$^().|<>';:\\-=\\[\\]\\{\\},&%#@!~`\\\\a-zA-Z0-9]+/.test(sshPassword)) {\n errors.push(intl.t('nodeDriver.aliyunecs.errors.sshPasswordInvalidCharacter'));\n }\n\n if (sshPassword && (lower + upper + number + special < 3)) {\n errors.push(get(this, 'intl').t('nodeDriver.aliyunecs.errors.sshPasswordFormatError'));\n }\n\n // Set the array of errors for display,\n // and return true if saving should continue.\n if ( get(errors, 'length') ) {\n set(this, 'errors', errors);\n return false;\n } else {\n set(this, 'errors', null);\n return true;\n }\n }", "title": "" }, { "docid": "9486e1d2f6ba035dccaca7c271b3d7d4", "score": "0.5345538", "text": "validations() {\n return [\n requiredValidator,\n minValidator,\n maxValidator,\n minlengthValidator,\n maxlengthValidator\n ];\n }", "title": "" }, { "docid": "8bbff04aab53a375f8370bcbcc056bf1", "score": "0.53406614", "text": "constructor(props) {\n super(props);\n this.validate = this.validate.bind(this);\n }", "title": "" } ]
e6fb23df34db461fd97b784c348ca5f3
Returns a single element assigned to that slot; if multiple, it returns the first
[ { "docid": "b8a2b6f28da8a8ce953fbf5a7aa441e8", "score": "0.0", "text": "has_slot(name) {\n return this.querySelector(`[slot='${name}']`);\n }", "title": "" } ]
[ { "docid": "22c3ef9c23b9553e75af1508aa51b085", "score": "0.66056126", "text": "function first (thing) {\n return _get_element(thing, 0);\n}", "title": "" }, { "docid": "50b6ad23528dcfffe856460dedc24684", "score": "0.64207894", "text": "first_item(componentID) {\n const sel = this.get(componentID);\n if (sel && sel.size > 0) {\n return sel.values().next().value;\n }\n }", "title": "" }, { "docid": "806f7dc1aa59292b442e00df35e5c0a9", "score": "0.60694915", "text": "get(name) {\n if (typeof name === 'string') name = this.store.lookup(name);\n for (let n = 0; n < this.slots.length; n += 2) {\n if (this.slots[n] === name) return this.slots[n + 1];\n }\n return undefined;\n }", "title": "" }, { "docid": "f9973858a9e250132968fea5b1248f6d", "score": "0.5956187", "text": "getFirst() {\n\t\treturn this.items[0];\n\t}", "title": "" }, { "docid": "f210507400fe6cb0c1f9255818f24cce", "score": "0.5947787", "text": "function single(a) {\n return (isEmpty(a)) ? null : a[0];\n}", "title": "" }, { "docid": "33478f43f298381f08d27f96f1fc941e", "score": "0.58598834", "text": "function first(s) { return get(s, 0); }", "title": "" }, { "docid": "ea31a2e366624ee30acdd7d3546a8ab1", "score": "0.5828876", "text": "function one(selector)\n{\n\treturn $(selector)[0];\n}", "title": "" }, { "docid": "2ce586edbf9fadf55e3eb24f55292fa0", "score": "0.581077", "text": "function first() {\n return this[0];\n}", "title": "" }, { "docid": "e7d9c2e5b457da18f42c37cc04e93e3f", "score": "0.57792294", "text": "get first() { return this[0]; }", "title": "" }, { "docid": "7a976e6e5e3e0a1c7608d7f3b662ad17", "score": "0.5777365", "text": "first() {\n if (this.allElements.length > 0) {\n return $(this.allElements[0])\n }\n return null\n }", "title": "" }, { "docid": "6c4109cbf4e8f2af9379d29b6b88abea", "score": "0.5767008", "text": "function first$get$0() {\n if ( !this.list ) return undefined;\n return this.list[0];\n }", "title": "" }, { "docid": "7974e6e59c2f8ebfe270a15e945295bb", "score": "0.5711156", "text": "function array_getSingleItem( arr )\n{\n if ( Array.isArray(arr) && arr.length == 1 )\n return arr[0] ;\n else\n return null ;\n}", "title": "" }, { "docid": "fbabaeab2c3158559d08bb75fdb06db0", "score": "0.5705276", "text": "function getEquippedItem(type){\r\n\tfor(var x=0; x<items.length; x++){\r\n\t\tif(typeof items[x]!='undefined'){\r\n\t\t\tif(items[x].type == type && items[x].slot == type){\r\n\t\t\t\treturn x;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n}", "title": "" }, { "docid": "907009bf9ed13f45f16d33001a651ec9", "score": "0.5680198", "text": "getFirstEl(tagName) {\n if (tagName === undefined) {\n return this.$elItems[0];\n }\n else {\n for (let $el of this.$elItems) {\n if ($el.tagName === tagName.toUpperCase()) {\n return $el;\n }\n }\n }\n }", "title": "" }, { "docid": "c3ee39de55fb876b9dff36f1cf7a3e9b", "score": "0.566478", "text": "function array_getSingleItem(arr)\n{\n if (Array.isArray(arr) && arr.length == 1)\n return arr[0];\n else\n return null;\n}", "title": "" }, { "docid": "dca19396cb415df1b59342c92e1f7fba", "score": "0.5661176", "text": "function first(a) { return (a !== null && a.length > 0) ? a[0] : null; }", "title": "" }, { "docid": "9a2f55da0cb00223af847e902a49853c", "score": "0.5656031", "text": "first() {\n for (const x of this.iter) {\n return x;\n }\n return undefined;\n }", "title": "" }, { "docid": "ffa601251346df69e5ec87d20212c779", "score": "0.5649803", "text": "function getElement(index) {\n return elements[index];\n }", "title": "" }, { "docid": "b52de78a010105d33e1ad460be471c67", "score": "0.5605227", "text": "elementAt(index){\n let cur = this.head\n while(cur.next){\n if(this.indexOf(cur.element) === index){\n return cur.element\n }\n cur = cur.next\n }\n }", "title": "" }, { "docid": "02e27f498e55a7c490252f80ede34934", "score": "0.554967", "text": "get getSingleSelection() {\n if (this.selection.selectedConceptComponent.size === 1 && this.selection.selectedPropositionComponent.size === 0) {\n return this.selection.selectedConceptComponent.values().next().value;\n }\n return undefined;\n }", "title": "" }, { "docid": "a739c6b42d103f9ed23238bd60248dee", "score": "0.5497057", "text": "function first(b) {\n return b[0];\n }", "title": "" }, { "docid": "ed7dd07ac9852ea55dd403194a28db60", "score": "0.54741746", "text": "function getSlot(slotName) {\n\n // Validation\n if (_.isEmpty(slotName)) {\n return false;\n }\n\n // Lookup in the Slot Map\n return slotMap[slotName];\n\n}", "title": "" }, { "docid": "1cecb85433ddc35b7ad0bd679645d948", "score": "0.5457891", "text": "getOneOptional(locator) {\n try {\n let components = this.find(locator, false);\n return components.length > 0 ? components[0] : null;\n }\n catch (ex) {\n return null;\n }\n }", "title": "" }, { "docid": "d3869bccdb5e6b3c1e54175054ef0f5e", "score": "0.5456429", "text": "getEquipItem(idx) {\n if(idx >= this.equipment.length) return null;\n return this.equipment[idx];\n }", "title": "" }, { "docid": "e0441caf8f917c6914c0f6faced0699b", "score": "0.54544944", "text": "value(n) {\n return this.slots[n * 2 + 1];\n }", "title": "" }, { "docid": "730b47e97bc9bff34bc7d6e81981935d", "score": "0.5427223", "text": "function first(array, func) {\n var newArray;\n\n newArray = select(array, func);\n return (newArray.length !== 0 ) ? newArray[0] : 'no element to return';\n }", "title": "" }, { "docid": "adb413d7d14a9b05ba0a69983b644f9c", "score": "0.5425362", "text": "first() {\n\treturn this.length <= 1 ? this : select([this[0]], this);\n}", "title": "" }, { "docid": "4f0a97878522f0f9d65791850f36da7c", "score": "0.541979", "text": "function firstElement(names) {\n \n return names [0];\n\n}", "title": "" }, { "docid": "68f278f9dd85dedaefec6a0c8dd460f0", "score": "0.54162", "text": "pickOne() {\n let index = -1;\n let r = Math.random();\n\n while (r > 0) {\n index++;\n r -= this.species[index].fitness;\n }\n\n let selected = this.species[index];\n return selected;\n }", "title": "" }, { "docid": "6c7db085fcfcc0532939117eeed29861", "score": "0.5400788", "text": "function grab(elem) {\n if (typeof elem === \"string\") {\n var o = [];\n elem.split(\"|\").forEach((x) => o.push(document.getElementById(x)));\n return o.length == 1 ? o[0] : o;\n }\n return elem;\n}", "title": "" }, { "docid": "a7634327e8a7a55cbb6b5c7c75eeb13f", "score": "0.5387712", "text": "function item(i) {\n /* jshint validthis: true */\n return this[i] || null;\n }", "title": "" }, { "docid": "9ecbea7eb5c1c2869b2046c8ba58c47a", "score": "0.53762835", "text": "function single(predicate, defaultValue) {\n predicate = typeof predicate === 'function' ? predicate : util.defaultPredicate;\n\n let count = 0;\n let singleItem = undefined;\n for (let item of this) {\n if (predicate(item)) {\n if (singleItem === undefined) {\n singleItem = item;\n } else {\n throw new Error('More than one element satisfies the condition in predicate.');\n }\n }\n\n count++;\n }\n\n if (singleItem === undefined && arguments.length == 2) return defaultValue;\n\n if (count === 0) throw new Error('The source sequence is empty.');\n if (!singleItem) throw new Error('No element satisfies the condition in predicate.');\n\n return singleItem;\n}", "title": "" }, { "docid": "4acb7c0dff10789070f02a87ca008820", "score": "0.53732324", "text": "function secondElement(movies) {\n \n return movies [1];\n\n}", "title": "" }, { "docid": "6bd46cb6e9c0ef26bb706edc07a579c7", "score": "0.5356406", "text": "function first(array) {\n return array ? array[0] : _undefined;\n }", "title": "" }, { "docid": "cc22708d61d6f4adb9548880420d24d5", "score": "0.5334333", "text": "function getFirstTile(){\n\t\t\t\t\n\t\treturn g_objInner.children(\".ug-thumb-wrapper\").first();\n\t}", "title": "" }, { "docid": "cc22708d61d6f4adb9548880420d24d5", "score": "0.5334333", "text": "function getFirstTile(){\n\t\t\t\t\n\t\treturn g_objInner.children(\".ug-thumb-wrapper\").first();\n\t}", "title": "" }, { "docid": "1a6f4b36511e9a881a174add9b489fa3", "score": "0.53291637", "text": "function getElement() {\n for (let i = 0; i < sec.length; i++) {\n let bound = sec[i].getBoundingClientRect();\n\n /*This calculates the vertical height of the element , \n this will we necessary if there's section with different height */\n let limit = bound.bottom - bound.top;\n\n if (bound.top >= -limit / 2 && bound.top < 0.4 * window.innerHeight) {\n return [sec[i], items[i]];\n }\n }\n return null;\n}", "title": "" }, { "docid": "abc4f246251e7d468e7000eb612e10d1", "score": "0.53111964", "text": "first() {\r\n return this._to(0);\r\n }", "title": "" }, { "docid": "81bb5c705f9bd770878298780b78c6a2", "score": "0.52979994", "text": "getFirst() {\n return this.return(this.first);\n }", "title": "" }, { "docid": "0dd29994506bac790a2eb0f965590e0e", "score": "0.5293853", "text": "get first () { return this.children()[0] }", "title": "" }, { "docid": "bb553e94fb09cb9b68ce082aeed7abca", "score": "0.5292283", "text": "async one() {\n return (await this.toArray())[0]\n }", "title": "" }, { "docid": "fb48c8ceb269ed2f2a40ed2f25494233", "score": "0.5291296", "text": "function _firstFromSet(set) {\n\treturn set.values().next().value;\n}", "title": "" }, { "docid": "2070e637740c4178e69d87dd5f7d2650", "score": "0.52853024", "text": "function get1(x, y) { var n = get(x, y); return n.length ? n[0] : null; }", "title": "" }, { "docid": "8fb08a70671aef8eaaae1281f1040ec2", "score": "0.5269824", "text": "function select_q(i) {\r\n return id_quantity[i].firstElementChild;\r\n}", "title": "" }, { "docid": "8a65d57c9b1cfdd62d890af3557c802c", "score": "0.52690655", "text": "getSelectedOrFirstCell___() {\n const { menuID } = this.props;\n //try to get previously selected\n if ( this.focusedElements[menuID] ) return this.focusedElements[menuID].focus();\n\n //try to get the active one\n const active = document.getElementsByClassName( 'SlidingMenuCell--SC active' );\n if ( active.length > 0 ) return active[0].focus();\n\n //try to get the first\n const first = document.getElementsByClassName( 'SlidingMenuCell--SC' );\n if ( first.length > 0 ) return first[0].focus();\n }", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.52674127", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.52674127", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.52674127", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.52674127", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.52674127", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.52674127", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "bfd317872133bfdc12d757b42d035ca6", "score": "0.52665305", "text": "function getOne(idx) {\n return skills[idx];\n }", "title": "" }, { "docid": "413639d9e14bfcca0010ae6777329187", "score": "0.52615166", "text": "function getElement$1(element) {\n\t if (!element) {\n\t return null;\n\t }\n\t if (typeof element.current !== \"undefined\") {\n\t return element.current;\n\t }\n\t return element;\n\t}", "title": "" }, { "docid": "6bde62fc1bc0fd51d6d5010c1e3cd447", "score": "0.5261004", "text": "function getSlot(i, a)\n\t{\n\t\tvar slot = i >> (5 * a.height);\n\t\twhile (a.lengths[slot] <= i)\n\t\t{\n\t\t\tslot++;\n\t\t}\n\t\treturn slot;\n\t}", "title": "" }, { "docid": "8c8bdf7bdc17b451bfe9d3a8d70841b2", "score": "0.5256811", "text": "function findValueByTuple(param, _tuple) {\r\n\t//return param.rs.data[_.findIndex(param.rs.tuples, _tuple)];\r\n\tfor (var i = 0; i < param.rs.tuples.length; i++) {\r\n\t\tif (_.isEqual(param.rs.tuples[i], _tuple)) {\r\n\t\t\treturn param.rs.data[i];\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn null;\r\n}//findValueByTuple", "title": "" }, { "docid": "55724c2f9bb30227dc6e6320eed2cfd5", "score": "0.52443224", "text": "function _find (element) {\n for (var i = 0;i < _elements.length; i++) {\n var elx = _elements[i];\n\n if (element === elx.element) {\n return elx;\n }\n }\n\n return null;\n }", "title": "" }, { "docid": "4d3b2da335de83c65f6633b1aa451e93", "score": "0.5240869", "text": "function getOneElement(tagName, node) {\n return (0, legacy_1.getElementsByTagName)(tagName, node, true, 1)[0];\n}", "title": "" }, { "docid": "ab38d28a4e987058405fd696015e7c1c", "score": "0.52373713", "text": "function getOneElement(tagName, node) {\n return (0, legacy_js_1.getElementsByTagName)(tagName, node, true, 1)[0];\n}", "title": "" }, { "docid": "6124eb9af4f83ec43f31fca906edaf4c", "score": "0.5225878", "text": "function getFirstElement(arr) {\n return arr[0];\n}", "title": "" }, { "docid": "1726eba740c2696cb61358533d0a692a", "score": "0.52214277", "text": "function first(array, number) {\n\tif (array === null) {\n\t\treturn \"void\"\n\t}\n\telse if (array != null) {\n\t\treturn array[number]\n\t}\n}", "title": "" }, { "docid": "bc9c6865df462c5ed648f7be922d6824", "score": "0.52162355", "text": "function getFirstEle(l)\r\n{\r\n if (Array.isArray(l) && l.length != 0)\r\n return l[0];\r\n else\r\n return \"not exist\";\r\n}", "title": "" }, { "docid": "b72b402d15cbe90bf1918db399a3ce66", "score": "0.5214566", "text": "function getOneElement(tagName, node) {\n return (0, legacy_1.getElementsByTagName)(tagName, node, true, 1)[0];\n}", "title": "" }, { "docid": "d4b7e7cfce742f7b02ee7a007fb76c9d", "score": "0.5211076", "text": "function first(array) {\n return array[0];\n }", "title": "" }, { "docid": "9e805296212915bde4280d8c27c595e6", "score": "0.52083254", "text": "static find(element) {\n while (element && !element.e2_item) {\n element = element.parentElement;\n }\n if (!element) {\n return null;\n }\n return element.e2_item;\n }", "title": "" }, { "docid": "65305ab746acd040e384af7c94b718ce", "score": "0.5201396", "text": "function getElement() {\n return this.dataStore[this.pos];\n}", "title": "" }, { "docid": "e134e1d4b9d81fcd448b690f32ba45e3", "score": "0.52013713", "text": "function next()\n\t\t{\n\t\t\tvar out = arr[i]._0;\n\t\t\t++i;\n\t\t\treturn out;\n\t\t}", "title": "" }, { "docid": "e134e1d4b9d81fcd448b690f32ba45e3", "score": "0.52013713", "text": "function next()\n\t\t{\n\t\t\tvar out = arr[i]._0;\n\t\t\t++i;\n\t\t\treturn out;\n\t\t}", "title": "" }, { "docid": "acfa95f69c8873f606fca5be47b190ae", "score": "0.52002645", "text": "function first(array) {\n return array[0];\n}", "title": "" }, { "docid": "bdb5b2b4e88749191e7e340704c87ce1", "score": "0.5186394", "text": "function _getElement(selector) {\n return _getElements(selector)[0];\n}", "title": "" }, { "docid": "1daeb1ab14a933305d4f633ce76f9979", "score": "0.51826155", "text": "function _getElement(selector) {\n return _getElements(selector)[0];\n }", "title": "" }, { "docid": "ebf2dfd905e72f5b58a779dac05d5bad", "score": "0.51819265", "text": "function getFirstElement(array) {\n // your code here\n return array[0];\n}", "title": "" }, { "docid": "dd5e220b3c6f712a7fc17cdf547a20fd", "score": "0.5172772", "text": "get firstRadioButton() {\n return this.querySelector('[role=\"radio\"]:first-of-type');\n }", "title": "" }, { "docid": "d77ae85faf701383dbe9add94c17433c", "score": "0.51642877", "text": "get selectedItem() {\n const selectedItem = this.selection.first_item(this.id);\n if (selectedItem) {\n return selectedItem;\n }\n return null;\n }", "title": "" }, { "docid": "b383021494e8a441060181b8c657fee1", "score": "0.5159832", "text": "function fst(pair) {\n return pair._0;\n }", "title": "" }, { "docid": "3562eb26de456313c0bd7ff2fd341d3c", "score": "0.51357764", "text": "function getFirstAvailableSlot() {\n for (let i = 0; i < battleData.UI.bottom[battleData.selStage].length; i++) {\n if (!battleData.UI.bottom[battleData.selStage][i].disabled) {\n return i;\n }\n }\n}", "title": "" }, { "docid": "18ddd8e3dffb1551fff4d01b0ce00702", "score": "0.5134583", "text": "function getElement(elements, currentElement, position) {\n if (elements && elements.length > 0) {\n var currentIndex = 0;\n switch (position) {\n case ElementPosition.Next:\n currentIndex = elements.findIndex(function (x) { return x.isSameNode(currentElement); });\n return currentIndex + 1 < elements.length ? elements[currentIndex + 1] : currentElement;\n case ElementPosition.Previous:\n currentIndex = elements.findIndex(function (x) { return x.isSameNode(currentElement); });\n return currentIndex - 1 >= 0 ? elements[currentIndex - 1] : currentElement;\n case ElementPosition.First:\n return elements.first();\n case ElementPosition.Last:\n return elements.last();\n default:\n return currentElement;\n }\n }\n return null;\n }", "title": "" }, { "docid": "b62bc3226c24ac051cbe89f6117a2f8e", "score": "0.5128781", "text": "function first(ar,pred,ctxt) {\n\tfor (var i = 0; i < ar.length; i++) {\n\t\tvar el = ar[i]\n\t\tif(pred.call(ctxt,el)){ return el }\n\t}\n\treturn null\n}", "title": "" }, { "docid": "5d297a350e64a916015e64f400eaeee4", "score": "0.5102025", "text": "function peek() {\n if (isEmpty()) return null;\n return firstNode.item;\n }", "title": "" }, { "docid": "1db2ca85bfd334e862f9a0e23c658ce0", "score": "0.50987935", "text": "function getTheArrayElement(index0, index1, array) {\n\tvar element1 = \"\";\n\telement1 = array[index0][index1];\n\treturn element1;\n}", "title": "" }, { "docid": "13ad87db8d96191a7264a69c7fecae65", "score": "0.5094976", "text": "function ele(){var e=Rt();return this.copyTo(e),e}", "title": "" }, { "docid": "39bf59d26755ea3babe43a1ee5c61e82", "score": "0.50900185", "text": "function SINGLE(val, placeholder) {\n if (val instanceof Array) {\n if (val.length > 1) return placeholder;\n else return val[0];\n }\n return val;\n }", "title": "" }, { "docid": "035b425b0901cf496494e18f21f52050", "score": "0.508092", "text": "first() {\n return this._store[0];\n }", "title": "" }, { "docid": "b21bea771a5d8293d7d183e52fe9169e", "score": "0.5079982", "text": "getInteractionItemElement() {\n let itemElement;\n if (this.select.selectedItem) {\n itemElement = this.select.selectedItem.element.nativeElement;\n }\n else {\n itemElement = this.select.getFirstItemElement();\n }\n return itemElement;\n }", "title": "" }, { "docid": "a450cd48c3ff2dc55395a2fcc50d47d5", "score": "0.5078486", "text": "function element() {\n return this.choice(\n ruleref,\n group,\n option,\n char_val,\n num_val,\n prose_val);\n}", "title": "" }, { "docid": "a24ade0940baa5a5d1db959b209318fe", "score": "0.5071187", "text": "function getItemInternal(guid) {\n\t\tfor (var i = 0, item; item = itemList[i]; i++) {\n\t\t\tif ( item.getGUID() == guid ) { \n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "89440da1e1811f52c10d87ee0dd0fe88", "score": "0.5070301", "text": "function get_element( selector ) {\n return document.querySelectorAll( selector )[0];\n}", "title": "" }, { "docid": "1627a004ba3820bdb6545a16955250f5", "score": "0.5069255", "text": "peek() {\n\t\treturn this.first.val;\n\t}", "title": "" }, { "docid": "3465ded0b251094e6f44db40823acdd6", "score": "0.5061426", "text": "function getSlotId() {\n var radioValue = \"\";\n for (i = 0; i < slotRadios.length; i++) {\n if (slotRadios[i].checked) {\n radioValue = slotRadios[i].value;\n break;\n }\n }\n return radioValue;\n}", "title": "" }, { "docid": "7e2775aca7095b908e994492dd6c0763", "score": "0.50553215", "text": "function grabProduct(choiceID, res){\n for(var i =0; i < res.length; i++){\n if(res[i].item_id === choiceID){\n return res[i];\n }\n }\n return null;\n}", "title": "" }, { "docid": "36fe3433a720f4acf59548f85b3f0225", "score": "0.50527656", "text": "function SNAP_getElementIdAtIndex(_elements, _index)\r\n{\r\n\tif (!SNAP_Utils_isArray(_elements))\r\n\t{\r\n\t\talert(\"Invalid elements array.\");\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\tvar element = _elements[_index];\r\n\tif (element.type == \"undefined\")\r\n\t{\r\n\t\talert(\"Undefined element (wrong index ?)\");\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\treturn element;\r\n}", "title": "" }, { "docid": "8e42c673897c4b6d5d93757a8b19c0e0", "score": "0.5051077", "text": "first() {\n return this.first;\n }", "title": "" }, { "docid": "2cbefe78336c761a46fa1cca823c2345", "score": "0.50318927", "text": "function randElement(item){\n\treturn item[Math.floor(Math.random() * item.length)];\n}", "title": "" }, { "docid": "9eddfdf282833052e31bc7dabd14b840", "score": "0.50303036", "text": "function elementAt(index, defaultValue) {\n let i = 0;\n\n for (let item of this) {\n if (i === index) return item;\n i++;\n }\n\n return defaultValue;\n}", "title": "" }, { "docid": "aec93f61ff6417b09de4020d58b1ebc2", "score": "0.502821", "text": "function returnAnElement(array, index) {\n return array[index];\n}", "title": "" }, { "docid": "9a7e0643c658f03b24112f34e376645d", "score": "0.50273997", "text": "function findSlot(i, list) {\n\tvar slot = i >> (5 * heightOf(list));\n\twhile (lengthsOf(list)[slot] <= i) {\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "4de930b9fdfd253d3498c9e9955c7c80", "score": "0.5026517", "text": "function first(a, fn) {\n\t var i, l;\n\t for (i = 0, l = a.length; i < l; i++) {\n\t if (fn(a[i])) return a[i];\n\t }\n\t return;\n\t}", "title": "" }, { "docid": "2da73769ea57ba937a61cf3724c4dcc1", "score": "0.5025397", "text": "nth (idx) {\n return this.first().next (idx);\n}", "title": "" }, { "docid": "3e71cc06520450c7a9834a47866319ab", "score": "0.5024905", "text": "function firstOne(a, b = 0, c = 0, d = 0) {\n\tif (a || b || c || d) return a || b || c || d\n\treturn \"not found\"\n}", "title": "" }, { "docid": "94c1b7f8439ea686f1379ded9eaba0e6", "score": "0.50234073", "text": "get first() {\n return this._first;\n }", "title": "" }, { "docid": "ca4e2aa70840a5266b036d3345f5ef12", "score": "0.50127506", "text": "peek() {\n return this.values[0] || null;\n }", "title": "" }, { "docid": "22bf61034166e6b5c48b8b5aaf78c963", "score": "0.5011262", "text": "function getOneElement$1(tagName, node) {\n return (0, legacy_1.getElementsByTagName)(tagName, node, true, 1)[0];\n}", "title": "" } ]
5fa1e380ccbb290900a02410d288af25
Paso 1: Pedir los generos Paso 2: Mostrar popup para elegir un genero Paso 3: Pedir las peliculas del genero elegido Paso 4: Mostrar las peliculas recibidas en un popup
[ { "docid": "8f829e8cf5b856ef8f2f39afaa75f312", "score": "0.0", "text": "function getDatos(url, cb) {\n let xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4 && xhr.status === 200) {\n let datos = JSON.parse(xhr.responseText);\n cb(datos);\n }\n }\n\n xhr.send();\n}", "title": "" } ]
[ { "docid": "fd8046acc2da4185da43f8218e6213fe", "score": "0.68603045", "text": "function generarTest()\n{\n\t\n\tif(contPreg > 0)\n\t{\n\t\tvar nomCuestionario = prompt(\"Nombre del cuestionario: \");\n\n\t\tvar ventCuestionario = window.open();\n\n\t\t// div que encapsula todo el contenido del cuestionario\n\t\tventCuestionario.document.write(\"<div style='width:90%; border: 2px solid #1F1F1F; background-color: #FFFFCC; margin:auto; margin-top: 45px;font-family: Arial, Helvetica, sans-serif;'>\");\n\n\t\t// nombre del cuestionario\n\t\tventCuestionario.document.write(\"<h1 style='text-align: center'>\" + nomCuestionario + \"</h1>\");\n\n\t\t// mensaje\n\t\tventCuestionario.document.write(\"<p style='text-align: center'>Contesta a las siguientes preguntas marcando la respuesta correcta:</p>\");\n\n\t\t// preguntas y respuestas\n\t\tfor(var i = 0; i<preguntas.length; i++)\n\t\t{\n\t\t\t// div que encapsula las preguntas con sus respuestas\n\t\t\tventCuestionario.document.write(\"<div style='width: 80%; margin: auto; background-color: #F6D1A7; border-top: 15px solid #CC0000; border-left: 15px solid #CC0000; border-bottom: 2px solid #CC0000; border-right: 2px solid #CC0000;'>\");\n\n\t\t\t// numero de la pregunta\n\t\t\tventCuestionario.document.write(\"<p style='margin: 0; margin-left: -15px; display: inline; background-color: #0000FF; color: white; font-weight: bold; font-size: 1.5em; padding: 15px 12px 5px 11px;'>\" + (i+1) + \"</p>\");\n\n\t\t\t// pregunta\n\t\t\tventCuestionario.document.write(\"<p style='width: 80%; margin-left: 50px; margin-top: 0; margin-bottom: 25px;'>\" + preguntas[i].pregunta + \"</p>\");\n\n\t\t\tfor(var j = 0; j<preguntas[i].respuestas.length; j++)\n\t\t\t{\n\t\t\t\tventCuestionario.document.write(\"<p style='width: 75%; margin-left: 70px; margin-bottom: 0;'>\" + (j+1) + \". <input style='margin-left: 15px;' type='radio' name='\" +i + \"'value='\" +(j+1)+\"'>\" + preguntas[i].respuestas[j] + \"</p>\");\n\t\t\t\t// ventCuestionario.document.write(\"<br>\");\n\t\t\t}\n\n\t\t\tventCuestionario.document.write(\"</div>\");\n\t\t}\n\n\t\t// botones de calificiacións y reperitr cuestionario\n\t\tventCuestionario.document.write(\"<div style='background-color: #F6D1A7; width: 95%; margin: auto; margin-top: 20px; margin-bottom: 20px; border: 1px solid #CC0000; padding: 20px; box-sizing: border-box;'>\");\n\n\t\tventCuestionario.document.write(\"<button style='display: block; margin: auto; margin-bottom: 50px;' onclick='calificarCuestionario()'>Calificación final</button>\");\n\t\tventCuestionario.document.write(\"<button style='display: block; margin: auto;' onclick='intarNuevo()'>Intentalo de nuevo</button>\");\n\n\t\tventCuestionario.document.write(\"</div>\");\n\n\t\tventCuestionario.document.write(\"</div>\");\n\n\t\n\n\t\t// funciones para los botones\n\t\tventCuestionario.document.write(\"<script>function intarNuevo(){var inputs = document.getElementsByTagName('input'); for(var i = 0; i < inputs.length; i++) {if(inputs[i].type.includes('radio')) inputs[i].checked = false;}}function calificarCuestionario() {var numPreguntas = 0; var respCorrectas = 0; numPreguntas = window.opener.preguntas.length; for(var i = 0; i < window.opener.preguntas.length; i++) {var res = document.getElementsByName(i); var sol = null; for(var z = 0; z < res.length; z++) {if(res[z].checked) sol = res[z].value; } if(sol == window.opener.preguntas[i].posRespuestaCorrecta) respCorrectas++; } alert('\\\\nRespuestas correctas = ' + respCorrectas + '\\\\nRespuestas falladas = ' + (numPreguntas-respCorrectas) + '\\\\nNº preguntas = ' + numPreguntas); }<\\/script>\");\n\t}\n\telse\n\t\talert(\"No se ha creado ninguna pregunta, crea una pregunta antes de generar el cuestionario.\")\n}", "title": "" }, { "docid": "f3deb11fe14bbe1bf60a3df0063c8f6a", "score": "0.65115774", "text": "function principal()\r\n{\r\n\tpanelInfo();\r\n\tvar chemin=document.getElementById('Kronos');\r\n\tvar idIle=idIleRecup();\r\n\tvar base=urlBase();\r\n\twood(base+'?view=resource&type=resource&id='+idIle);\r\n\ttrade(base+'?view=tradegood&type=tradegood&id='+idIle);\r\n\tconstructionTempsFin();\r\n\tlevelBat();\r\n\r\n\r\n\r\n\tvar list=document.createElement('div');//List des batiments.\r\n\r\n\tchemin.appendChild(list);\r\n\t\r\n\tvar script = document.createElement('style');\r\n\tscript.setAttribute('type','text/css');\r\n\tscript.appendChild(document.createTextNode('\\n.popup\\n{\\nz-index: 1000;\\nposition: absolute;\\ntop: 30%;\\nleft: 35%;\\nwidth: 400px;\\nheight: 250px;\\nbackground-color: #DBB562;\\nborder: 3px solid #CE9928;\\n}'));\r\n\tchemin.appendChild(script);// On inscrit les styles dans le script\r\n\tchemin.appendChild(document.createTextNode(lang[10]+' '+navigator.language));\r\n\tvar FIN=new Date();\r\n\t\r\n\tchemin.appendChild(createBr());\r\n\tchemin.appendChild(document.createTextNode(lang[11]+' : '+(FIN-DEBUT)+'ms'));\r\n\t//document.getElementById('Kronos').appendChild(document.createTextNode(myLanguage));\r\n}", "title": "" }, { "docid": "31505d685ad1ece6c3c1bb24c351f769", "score": "0.65094286", "text": "function zamer(){\n let popupEngener = document.getElementsByClassName('popup_engineer')[0];\n let popupBtn = document.getElementsByClassName('popup_engineer_btn')[0];\n let popupClose = document.getElementsByClassName('popup_close')[1];\n \n //для Хранения данных пользователя в переменных\n let width = 0;\n let height = 0;\n let check1; //храним условие \"холодное\"\n let check2; // храним условие \"теплое\"\n let view; //храним вид балкона\n \n \n \n \n popupBtn.addEventListener('click', () => {\n popupEngener.style.display = 'block';\n });\n \n popupClose.addEventListener('click', () => {\n popupEngener.style.display = 'none';\n });\n \n window.addEventListener('click', (e) =>{\n if(e.target === popupEngener){\n popupEngener.style.display = 'none';\n }\n });\n }", "title": "" }, { "docid": "0dd1c3e1db1eeeb511d160578ff8dd20", "score": "0.6497835", "text": "function crearPopUpConfirmacion(texto, titulo, ancho, alto, jsaccion, params)\n{\n\tif (document.getElementById(\"DivPopUpWindow\") == null)\n\t{\n\t\tvar xpos = 0, ypos = 0;\n\t\tvar myWidth = 0, myHeight = 0; // Nueva Forma de Capturar el Tamaņo de la Ventana del Navegador\t\n\t\tif( typeof( window.innerWidth ) == 'number' ) \n\t\t{\n\t\t\t//Non-IE\n\t\t\tmyWidth = window.innerWidth;\n\t\t\tmyHeight = window.innerHeight;\n\t\t} \n\t\telse if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) \n\t\t{\n\t\t\t//IE 6+ in 'standards compliant mode'\n\t\t\tmyWidth = document.documentElement.clientWidth;\n\t\t\tmyHeight = document.documentElement.clientHeight;\n\t\t\t} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {\n\t\t\t//IE 4 compatible\n\t\t\tmyWidth = document.body.clientWidth;\n\t\t\tmyHeight = document.body.clientHeight;\n\t\t}\n\t\txpos = myWidth;\n \typos = myHeight;\n\t\tvar formulario = document.forms[0];\n\t\txpos = ( xpos / 2 ) - ( ancho / 2 );\n\t\typos = ( ypos / 2 ) - ( alto / 2 );\n\t\tif (navigator.appName.indexOf(\"Microsoft\")!=-1)\t\t// Si el navegador es IE pone un iframe abajo del Div \n\t\t{ \n\t\t\tly = document.createElement('iframe'); // para prevenir el sobreposicionamiento de las etiquetas SELECT\n\t\t\tly.setAttribute('id',\"lyPopUpWindow\");\n\t\t\tly.style.position=\"absolute\"; \n\t\t\tly.style.pixelWidth=ancho;\n\t\t\tly.style.pixelHeight=alto;\n\t\t\tly.style.pixelHeight=alto;\n\t\t\tly.style.border = \"0px none #cccccc\";\n\t\t\tformulario.appendChild(ly);\n\t\t\tdocument.getElementById(\"lyPopUpWindow\").style.left = xpos + \"px\";\n\t\t\tdocument.getElementById(\"lyPopUpWindow\").style.top = ypos + \"px\";\n\t\t}\n\t\tdv = document.createElement('div');\n\t\tdv.setAttribute('id',\"DivPopUpWindow\");\n\t\tdv.style.position=\"absolute\"; \n\t\tdv.style.pixelWidth=ancho;\n\t\tdv.style.pixelHeight=alto;\n\t\tdv.style.backgroundColor=\"#F4F7F5\";\n\t\tdv.style.border = \"1px solid #cccccc\";\n\t\tdv.innerHTML='<table width=\"' + ancho + '\" border=\"0\" cellpadding=\"6\" cellspacing=\"1\"><tr class=\"tit_tabla\"><td align=\"left\"><strong>'\n\t\t+ titulo + '</strong></td></tr><tr class=\"tr_osc\"><td align=\"center\">'\n\t\t+ texto + '</td></tr>'\n\t\t+ '<tr><td align=\"center\"><input name=\"btnAceptarPopUp\" type=\"button\" id=\"btnAceptarPopUp\" value=\"Aceptar\" class=\"botones\" onclick=\"'+jsaccion+'; destruirPopUp();\">&nbsp;<input type=\"hidden\" id=\"popUpParamsHidden\" name=\"popUpParamsHidden\" value=\"'+params+'\"><input name=\"btnCancelPopUp\" type=\"button\" id=\"btnCancelPopUp\" value=\"Cancelar\" class=\"botones\" onclick=\"msgboxProcesando(false); destruirPopUp();\"></td></tr></table>';\n\t\tformulario.appendChild(dv);\n\t\tdocument.getElementById(\"DivPopUpWindow\").style.left = xpos + \"px\";\n\t\tdocument.getElementById(\"DivPopUpWindow\").style.top = ypos + \"px\";\n\t}\n}", "title": "" }, { "docid": "dcdc6b7cfc23bf2c47acee57a97b1122", "score": "0.64954835", "text": "function verDetallePopup(id, tipo){\n if(tipo==\"plan\"){\n var html = $(\"#caracplan_\"+id).html();\n }\n if(tipo==\"promo\"){\n var html = $(\"#caracpromo_\"+id).html();\n } \n if(tipo==\"requisito\"){\n var html = $(\"#caracreq_\"+id).html();\n } \n $(\"#contenidodin_popup\").html(\"\");\n $(\"#contenidodin_popup\").html(html); \n}", "title": "" }, { "docid": "0c09e06010af81159d5f5e352c217703", "score": "0.64717066", "text": "function perder(){\n let mensaje = document.getElementById(\"pPerder\");\n mensaje.innerHTML = `Has perdido :c <br><br> \n Tu puntuacion: ${puntuacion}`;\n dialogoPerder.showModal();\n llenarFaltantes(); \n}", "title": "" }, { "docid": "e3f16263a72a05a909a7987db1b87c82", "score": "0.64315253", "text": "function crearPopUp(texto, titulo, ancho, alto)\n{\n\tif (document.getElementById(\"DivPopUpWindow\") == null)\n\t{\n\t\tvar xpos = 0, ypos = 0;\n\t\tvar myWidth = 0, myHeight = 0; // Nueva Forma de Capturar el Tamaņo de la Ventana del Navegador\t\n\t\tif( typeof( window.innerWidth ) == 'number' ) \n\t\t{\n\t\t\t//Non-IE\n\t\t\tmyWidth = window.innerWidth;\n\t\t\tmyHeight = window.innerHeight;\n\t\t} \n\t\telse if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) \n\t\t{\n\t\t\t//IE 6+ in 'standards compliant mode'\n\t\t\tmyWidth = document.documentElement.clientWidth;\n\t\t\tmyHeight = document.documentElement.clientHeight;\n\t\t\t} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {\n\t\t\t//IE 4 compatible\n\t\t\tmyWidth = document.body.clientWidth;\n\t\t\tmyHeight = document.body.clientHeight;\n\t\t}\n\t\txpos = myWidth;\n \typos = myHeight;\n\t\tvar formulario = document.forms[0];\n\t\txpos = ( xpos / 2 ) - ( ancho / 2 );\n\t\typos = ( ypos / 2 ) - ( alto / 2 );\n\t\tif (navigator.appName.indexOf(\"Microsoft\")!=-1)\t\t// Si el navegador es IE pone un iframe abajo del Div \n\t\t{ \n\t\t\tly = document.createElement('iframe'); // para prevenir el sobreposicionamiento de las etiquetas SELECT\n\t\t\tly.setAttribute('id',\"lyPopUpWindow\");\n\t\t\tly.style.position=\"absolute\"; \n\t\t\tly.style.pixelWidth=ancho;\n\t\t\tly.style.pixelHeight=alto;\n\t\t\tly.style.pixelHeight=alto;\n\t\t\tly.style.border = \"0px none #cccccc\";\n\t\t\tformulario.appendChild(ly);\n\t\t\tdocument.getElementById(\"lyPopUpWindow\").style.left = xpos + \"px\";\n\t\t\tdocument.getElementById(\"lyPopUpWindow\").style.top = ypos + \"px\";\n\t\t}\n\t\tdv = document.createElement('div');\n\t\tdv.setAttribute('id',\"DivPopUpWindow\");\n\t\tdv.style.position=\"absolute\"; \n\t\tdv.style.pixelWidth=ancho;\n\t\tdv.style.pixelHeight=alto;\n\t\tdv.style.backgroundColor=\"#F4F7F5\";\n\t\tdv.style.border = \"1px solid #cccccc\";\n\t\tdv.innerHTML='<table width=\"' + ancho + '\" border=\"0\" cellpadding=\"6\" cellspacing=\"1\"><tr class=\"tit_tabla\"><td align=\"left\"><strong>'\n\t\t+ titulo + '</strong></td></tr><tr class=\"tr_osc\"><td align=\"center\">'\n\t\t+ texto + '</td></tr>'\n\t\t+ '<tr><td align=\"center\"><input name=\"btnAceptarPopUp\" type=\"button\" id=\"btnAceptarPopUp\" value=\"Aceptar\" class=\"botones\" onclick=\"destruirPopUp();\"></td></tr></table>';\n\t\tformulario.appendChild(dv);\n\t\tdocument.getElementById(\"DivPopUpWindow\").style.left = xpos + \"px\";\n\t\tdocument.getElementById(\"DivPopUpWindow\").style.top = ypos + \"px\";\n\t}\n}", "title": "" }, { "docid": "2d324524b126fcc2e78b2ecdf08b0c8f", "score": "0.64240915", "text": "function itemslatenzieninpopup(nr){\n //leegmaken van de div\n document.getElementById('popupcontentimg').innerHTML = \"\";\n document.getElementById('popupcontentkleur').innerHTML = \"\";\n document.getElementById('popupcontentprijs').innerHTML = \"\";\n \n //img per element\n let imgelement = document.createElement(\"img\");\n imgelement.setAttribute('src', bandjes[nr].img);\n imgelement.setAttribute('height', '150px');\n document.getElementById('popupcontentimg').appendChild(imgelement);\n\n //welke kleur het bandje is\n let newP = document.createElement(\"p\");\n newP.className = \"popupcontentkleur-pingwing\";\n let newPText = document.createTextNode(`PingWing`);\n newP.appendChild(newPText);\n document.getElementById(\"popupcontentkleur\").appendChild(newP);\n\n newP = document.createElement(\"p\");\n newP.id = \"kleurvanbandje\";\n newPText = document.createTextNode(`Kleur: ${bandjes[nr].kleur}`);\n newP.appendChild(newPText);\n document.getElementById(\"popupcontentkleur\").appendChild(newP);\n \n //Prijs van bandje\n newP = document.createElement(\"p\");\n newPText = document.createTextNode(`Prijs`);\n newP.appendChild(newPText);\n document.getElementById(\"popupcontentprijs\").appendChild(newP);\n\n newP = document.createElement(\"p\");\n newP.className = \"popupcontentprijs-prijs\"\n newPText = document.createTextNode(bandjes[nr].prijs);\n newP.appendChild(newPText);\n document.getElementById(\"popupcontentprijs\").appendChild(newP);\n}", "title": "" }, { "docid": "c43b3b62089a2bcbad407e9fbb42f8c9", "score": "0.6361495", "text": "mostrarFormularioAsignacionPaciente() {\n\n let funcion = () => this.activarSeleccion(\"asignarPersonal\", botonAltaPaciente);\n crearFormulario([\"Nombre\"], \"asignarPersonal\", funcion);\n let botonAltaPaciente = document.getElementById(\"confirmacion\");\n }", "title": "" }, { "docid": "79f91b8d72bd54ae552f37de7d972504", "score": "0.6344308", "text": "function buildModal(row, cupos_caption){//Se recibe la fila (destino) a visualizar y los semestres correspondientes a los cupos\r\n var modalTitle = document.querySelector(\".modal-title\");\r\n modalTitle.innerText = row[1];\r\n\r\n /*---Cupos---*/\r\n document.querySelector(\".modal-body #CT1\").innerText = cupos_caption[0];\r\n document.querySelector(\".modal-body #CT2\").innerText = cupos_caption[1];\r\n document.querySelector(\".modal-body #CT3\").innerText = cupos_caption[2];\r\n\r\n document.querySelector(\".modal-body #CP1\").innerText = row[2];\r\n document.querySelector(\".modal-body #CP2\").innerText = row[3];\r\n document.querySelector(\".modal-body #CP3\").innerText = row[4];\r\n /*-----------*/\r\n\r\n var i = document.querySelector(\".modal-body #PA\");//Pais\r\n i.innerText = row[0];\r\n var i = document.querySelector(\".modal-body #EP\");//Estudios Permitidos\r\n i.innerText = row[5];\r\n var i = document.querySelector(\".modal-body #RE\");//Requisitos especiales\r\n i.innerText = row[7] == undefined? \"Sin requisitos\" : row[7];\r\n var i = document.querySelector(\".modal-body #OB\");//Observaciones\r\n i.innerText = row[9] == undefined? \"Sin observaciones\" : row[9];\r\n var i = document.querySelector(\".modal-body #BE\");//Becas\r\n i.innerText = row[8] == undefined? \"No hay becas\" : row[8];\r\n\r\n var i = document.querySelector(\".modal-body #OA\");//Oferta Academica\r\n i.setAttribute(\"href\", row[10] == undefined? \"\" : row[10]);\r\n\r\n var i = document.querySelector(\".modal-body #OA2\");//Oferta Academica #2\r\n i.setAttribute(\"href\", row[11] == undefined? \"\" : row[11]);\r\n}", "title": "" }, { "docid": "3848e0ddde1889f512d7e3266e80304b", "score": "0.6334062", "text": "function chequearPerfil() {\nif (tienePerfil == false) {\napp.dialog.confirm('Completa tu perfil', 'Para poder acceder a esta función', function () {\n\n app.popup.open(\".my-popup3\");\n habilitarInputs();\n });\n \n}else{\n app.popup.open(\".my-popup2\");\n}\n}", "title": "" }, { "docid": "aa1aad7c5891364b4175221256dc5e3b", "score": "0.6327848", "text": "function mostrarMensajeProceso() {\n\t//Comprobar marca proceso\n\tif (msgprocesando)\n\t\treturn false;\n\n\t// Inicializar variables\n\tmsgprocesando = true;\n\turl_1 = getURL();\n\tvueltas = 0;\n\tcheckURL();\n\n\t// Crear elemento 'mensajeproceso'\n\tmensajeProceso = document.createElement(\"div\");\n\tmensajeProceso.setAttribute(\"id\",\"mensajeproceso\");\n\tmensajeProceso.style.position\t\t= 'absolute';\n\tmensajeProceso.style.width\t\t\t= '164px';\n\tmensajeProceso.style.height\t\t\t= '79px';\n// \tmensajeProceso.style.clip\t\t\t= 'rect(0,160,75,0)';\n\tmensajeProceso.style.zIndex\t\t\t= '100';\n\tmensajeProceso.style.fontFamily\t\t= 'Arial, Helvetica, Sans-Serif';\n\tmensajeProceso.style.fontWeight\t\t= 'Bold';\n\tmensajeProceso.style.fontSize\t\t= '14px';\n\tmensajeProceso.style.color\t\t\t= '#FF0000';\n\tmensajeProceso.style.padding\t\t= '4px'; \n\tmensajeProceso.style.height\t\t\t= '2px';\n\n\t// Texto a mostrar\n\ttextoProceso = \"<table width=100% height='70px' border=0 cellpadding=0 cellspacing=0 style='background-image:url(/img/recuadro_procesando.gif)'>\" +\n\t\"<tr>\" +\n\t\t\"<td>\" +\n\t\t\t\"<table width=100% height='45px' border=0 cellpadding=0 cellspacing=0 >\" +\n\t\t\t\t\"<tr>\" +\n\t\t\t\t\t\"<td align='center' style='color:#FF0000; font-weight:Bold; font-size:16px'>\" + \n\t\t\t\t\t\t\"PROCESANDO\" +\n\t\t\t\t\t\"</td>\" +\n\t\t\t\t\"</tr>\" +\n\t\t\t\t\"<tr>\" +\n\t\t\t\t\t\"<td align='center'>\" +\n\t\t\t\t\t\t\"<img src='/img/ajax-loader.gif'>\" +\n\t\t\t\t\t\"</td>\" +\n\t\t\t\t\"</tr>\" +\n\t\t\t\"</table>\" +\n\t\t\"</td>\" +\n\t\"</tr>\" +\n\"</table>\";\n\tmensajeProceso.innerHTML = textoProceso;\n\tdocument.body.appendChild(mensajeProceso);\n\n\t// Crear capa semi-transparente\n\tcapaTrans();\n\n\t// Colocar capas\n\tmoveDivs();\n\n\t// Asignar eventos\n\twindow.onscroll = moveDivs;\n\twindow.onresize = moveDivs;\n}", "title": "" }, { "docid": "430fedfbc432294de74c341a2229b005", "score": "0.63068086", "text": "function createProdoPopup(prodoPopupType){\n if(prodoPopupType == 'ARROW'){\n try{\n document.getElementById('prodoBase').innerHTML = arrowPopupTemplate;\n }\n catch(err){}\n finally{\n document.getElementById('arrowPopupContent').innerHTML = prodoContent;\n }\n arrowPopupCreated = 'YES';\n return;\n }\n if(prodoPopupType == 'ALERT'){\n //Alert Type Popup\n }\n}", "title": "" }, { "docid": "873fa7bab0bc610a389e3f174c49f837", "score": "0.6298257", "text": "function PopUp( clickElem, opciones )\n {\n \"use strict\"; \n var box; // Cuadro que se va a mostrar\n var clkElem = $(clickElem); // Elemento que al hacer click sale el cuadro de dialogo\n var posElem = clkElem;\n var opt = opciones || {};\n var $this = this;\n var frm = $(\"body\"); \n var Slide = opt.Slide; // Define si el cuadro se va a mover hacia los lados\n var mvBox = true; // El recuadro al cerrarse se mueve hacia el grupo #HidedBoxs\n var isCb = false; // El popup es del tipo combo con una lista de items\n var callFn = null;\n \n var pos = clkElem.css( \"position\" );\n if( pos!==\"absolute\" && pos!==\"relative\" )\n {clkElem.css( \"position\", \"relative\" );}\n \n {clkElem.css( \"cursor\", \"pointer\" );}\n \n if( opt.NoClick!==1 ) {clkElem.click( ShowPopup );}\n if( opt.PosElem ) {posElem = $(opt.PosElem);}\n\n this.idxSel = -1;\n this.OnShowPopUp = null;\n this.OnClosePopUp = null;\n this.OnVisiblePopUp = null;\n this.SetCallBack = function(fn) {callFn=fn;};\n this.GetBox = function(){return box;}; \n this.Show = function(){ ShowPopup(); }; \n \n this.BoxFromList = function( list, cb, CallBack )\n {\n if( box ) \n {box.removeAttr(\"style\");\n box.remove();}\n \n callFn = CallBack;\n isCb = cb;\n \n var s = \"\"; \n if( opt.w ) { s = 'width:'+ opt.w +'px; ';}\n if( opt.hMax ) { s+= 'max-height:'+ opt.hMax +'px; overflow-y: auto;';} \n if( s !== \"\" ) { s = 'style=\"'+ s + '\"';} \n \n var html = '<div class=\"popup\" '+ s + '>';\n \n for( var i=0; i<list.length; ++i )\n {\n var str = list[i]; \n html += '<div class=\"item-pu\" item=\"'+ i +'\">'+ str +'</div>';\n }\n \n html += '</div>';\n box = $(html);\n \n box.find(\".item-pu\").click( SelectedItem );\n };\n \n this.SetBox = function( Box, ClkClose ) \n {\n box = $(Box);\n if( !ClkClose ) { box.click( function(e){ e.stopPropagation();} ); }\n if( mvBox ) { box.css( {display:'none', position:'absolute'} ); }\n };\n \n this.UseBox = function( Box, Click ) {mvBox=false; this.SetBox(Box,Click);};\n\n this.SetSelItem = function( iSel )\n { \n if( !isCb ) {return;} \n \n var Items = box.find(\".item-pu\");\n if( iSel<0 || iSel>=Items.length )\n { \n clkElem.text(\"\");\n this.idxSel = -1;\n }\n else\n { \n clkElem.text( Items.eq(iSel).text() );\n this.idxSel = iSel;\n }\n };\n \n function ShowPopup( e )\n {\n if( _PopUp )\n {\n if( _PopUp===opt.NoHide ) { _NoHide = _PopUp; }\n else\n { \n var ret = (_PopUp === $this)? null : ShowPopup;\n return _PopUp.ClosePopUp( e, ret );\n }\n }\n \n if( _NoHide && _NoHide!==opt.NoHide ) { return _NoHide.ClosePopUp( e, ShowPopup ); }\n \n if( !box ) {console.log(\"No box set\"); return;}\n if( !mvBox && !Slide ) {console.log(\"Only for Slide\"); return;}\n \n if( $this.OnShowPopUp ) {$this.OnShowPopUp();} \n \n if( Slide ) { SlideLeftBox(); }\n else { PushDownBox(); }\n \n $(\"html\").one(\"click\",$this.ClosePopUp );\n\n _PopUp = $this;\n \n if(e) {e.stopPropagation();}\n }\n \n this.ClosePopUp = function( e, fn, par )\n {\n if( Slide ) { SlideRightBox(fn, par); }\n else { PushUpBox(fn, par); }\n\n if(e) {e.stopPropagation();}\n \n if( $this === _PopUp ) { _PopUp = undefined;}\n if( $this === _NoHide ) { _NoHide = undefined;}\n \n if( $this.OnClosePopUp ) {$this.OnClosePopUp();}\n };\n \n function SelectedItem()\n { \n if( isCb ) \n {\n clkElem.text( $(this).text() );\n box.find(\".item-pu\").click( SelectedItem );\n }\n \n $this.idxSel = +$(this).attr(\"item\");\n\n $this.ClosePopUp( null, callFn, $this.idxSel ); \n return false;\n }\n \n function PushDownBox()\n {\n clkElem.append( box );\n \n if( opt.wBtn ) { box.outerWidth( clkElem.outerWidth() ); }\n \n var x = 0;\n var ye = clkElem.outerHeight();\n var wb = box.outerWidth(); \n var mg = opt.mg || 10;\n var xe = clkElem.offset().left;\n if( opt.right )\n {\n var we = clkElem.outerWidth();\n var xi = xe - (wb - we) - mg;\n if( xi<0 ) {x = (xe+we)-(mg+wb);}\n \n box.css( \"right\", x );\n }\n else\n {\n var W = $(\"body\").outerWidth();\n var xf = xe + wb + mg;\n \n if( xf>W ) { x = -(xf-W); }\n box.css( \"left\", x );\n }\n \n box.css( \"top\", ye );\n \n box.slideDown( 200, function()\n { \n if( $this.OnVisiblePopUp ) {$this.OnVisiblePopUp();}\n });\n } \n\n function PushUpBox( fn, par )\n {\n if( !box ) {return;} \n box.slideUp(200, function()\n { \n if( mvBox ) {$(\"#HidedBoxs\").append( box );}\n else {box.removeAttr(\"style\");}\n \n if( fn ) {fn(par);}\n });\n } \n\n var xi; \n function SlideLeftBox()\n {\n if( mvBox ) {frm.append( box );} \n \n var pos = posElem.offset();\n if( opt.Up ) { window.scroll({top:pos.top}); }\n \n pos.top += posElem.height();\n pos.left = frm.width() + 10;\n \n box.css( {display:\"block\"} );\n frm.css( \"overflow-x\",\"hidden\" );\n box.offset( pos ); \n \n xi = box.position().left;\n var mg = opt.mg || 15;\n var w = box.outerWidth(); \n var xf = xi - ( 10 + w + mg );\n \n box.animate( {left: xf}, 500, function(){frm.css( \"overflow-x\",\"visible\" );} );\n }\n \n function SlideRightBox( fn, par )\n {\n if( !box ) {return;} \n frm.css( \"overflow-x\",\"hidden\" );\n box.animate( {left: xi}, 500, function()\n { \n if( mvBox ) {$(\"#HidedBoxs\").append( box );} \n else {box.removeAttr(\"style\");}\n \n frm.css( \"overflow-x\",\"visible\" );\n \n if( fn ) {fn(par);}\n });\n } \n\n }", "title": "" }, { "docid": "436c5b73c71109d7670e20d24d372ed4", "score": "0.6277999", "text": "function mostrarincidenciasTipo(tipo){\n botones=\"\"\n todasnotificaciones=\"\"\n contenidoficha=\"\"\n contenidofinal=\"\"\n operaciondisponible=\"\"\n\n if(sesionActiva===\"true\"){\n botones='<button onclick=\"mostrarincidenciasTipo(3)\" class=\"w3-button w3-darkolivegreen\">Canceladas</button>'+\n '&nbsp; &nbsp;'+\n '<button onclick=\"mostrarincidenciasTipo(0)\" class=\"w3-button w3-darkolivegreen\">Pendientes</button>'+\n '&nbsp; &nbsp;'+\n '<button onclick=\"mostrarincidenciasTipo(4)\" class=\"w3-button w3-darkolivegreen\">Aceptadas</button><br><br>'+\n '&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;'+\n '<button onclick=\"mostrarincidenciasTipo(1)\" class=\"w3-button w3-darkolivegreen\">Asignadas</button>'+\n '&nbsp; &nbsp;'+\n '<button onclick=\"mostrarincidenciasTipo(2)\" class=\"w3-button w3-darkolivegreen\">Completadas</button>'\n\n }else{\n botones='<button onclick=\"mostrarincidenciasTipo(1,sesionActiva)\" class=\"w3-button w3-darkolivegreen\">En proceso</button>'+\n '&nbsp; &nbsp;'+\n '<button onclick=\"mostrarincidenciasTipo(2,sesionActiva)\" class=\"w3-button w3-darkolivegreen\">Completadas</button>'\n }\n document.getElementById('botonesIncidencias').innerHTML=botones;\n\n if (tipo==\"0\"){\n tipo=\"Pendiente\"\n }\n else if (tipo == \"1\"){\n tipo=\"Asignada\"\n }\n else if (tipo== \"2\") {\n tipo=\"Completada\"\n }\n else if (tipo== \"3\") {\n tipo=\"Cancelada\"\n }\n else if (tipo== \"4\") {\n tipo=\"Aceptada\"\n }\n contenidoheader=\"<br><br><b>Incidencias \"+tipo+\"s en el espacio:</b><br><br>\"\n todasnotificaciones=\"\"\n num=0\n for (let i in incidencias) {\n if(incidencias[i][\"estado\"][\"estadoCategoria\"]==tipo){\n idIncidencia=incidencias[i][\"id\"]\n if(tipo===\"Pendiente\" && sesionActiva===\"true\"){\n tablaIdsIncidencias[num]=idIncidencia\n operaciondisponible='<button id=\"'+ num +'\" onclick=\"actualizarIncidencia(this,0)\" class=\"w3-button w3-darkolivegreen left\">Cancelar</button>'+\n '&nbsp; &nbsp;'+\n '<button id=\"'+ num +'\" onclick=\"actualizarIncidencia(this,1)\" class=\"w3-button w3-darkolivegreen\">Aceptar</button><br><br>'\n }else if(tipo===\"Aceptada\" && sesionActiva===\"true\"){\n tablaIdsIncidencias[num]=idIncidencia\n operaciondisponible='<button id=\"'+ num +'\" onclick=\"actualizarIncidencia(this,2)\" class=\"w3-button w3-darkolivegreen\">Asignar</button><br><br>'\n\n }else if(tipo===\"Asignada\" && sesionActiva===\"true\"){\n tablaIdsIncidencias[num]=idIncidencia\n operaciondisponible='<button id=\"'+ num +'\" onclick=\"actualizarIncidencia(this,3)\" class=\"w3-button w3-darkolivegreen\">Completar</button><br><br>'\n }else if(tipo===\"Cancelada\" && sesionActiva===\"true\"){\n tablaIdsIncidencias[num]=idIncidencia\n operaciondisponible='<button id=\"'+ num +'\" onclick=\"actualizarIncidencia(this,4)\" class=\"w3-button w3-darkolivegreen\">Borrar</button><br><br>'\n }else{\n operaciondisponible=\"\"\n }\n if(num%2==0){\n contenidoficha=\n '<div class=\"odd\"><b class=\"w3-center\">Incidencia </b><br>'+\n '<b>Nombre:&nbsp; '+ incidencias[i][\"nombreIncidencia\"] +' </b><br><br>'+\n '<b>Descripcion: '+ incidencias[i][\"descripcion\"] +' </b><br><br>'+\n '<b>Fecha creada: '+incidencias[i][\"horaFechaCreada\"]+' </b>'\n if(tipo===\"Completada\"){\n contenidoficha+='<br><b>Fecha Completada: '+incidencias[i][\"estado\"][\"horaFechaCompletada\"]+' </b>'\n }\n contenidoficha+='</div><br><br>';\n }else{\n contenidoficha=\n '<div class=\"even\"><b class=\"w3-center\">Incidencia </b><br>'+\n '<b>Nombre:&nbsp; '+ incidencias[i][\"nombreIncidencia\"] +' </b><br><br>'+\n '<b>Descripcion: '+ incidencias[i][\"descripcion\"] +' </b><br><br>'+\n '<b>Fecha creada: '+incidencias[i][\"horaFechaCreada\"]+' </b>'\n if(tipo===\"Completada\"){\n contenidoficha+='<br><b>Fecha Completada: '+incidencias[i][\"estado\"][\"horaFechaCompletada\"]+' </b>'\n }\n\n contenidoficha+='</div><br><br>';\n }\n contenidoficha+=operaciondisponible\n num++\n todasnotificaciones+=contenidoficha\n }\n }\n if(todasnotificaciones==\"\"){\n todasnotificaciones='<div id=\"ficha\"><b class=\"w3-center\">No existen incidencias '+tipo+'s en este espacio </b><br></div>'\n contenidofinal=todasnotificaciones\n }else{\n contenidofinal=contenidoheader+todasnotificaciones\n }\n headerIncidencias=\" Incidencias \"+tipo+\"s\";\n document.getElementById('tituloincidencia').innerHTML=headerIncidencias;\n document.getElementById('incidencias-text').innerHTML = contenidofinal;\n sidebar.open(\"incidencias\")\n}", "title": "" }, { "docid": "f3258ec90dca90d72c0cb8cb46e5762b", "score": "0.62352514", "text": "function openModal(id) {\n var repiceModal = document.querySelector(\".modal\");\n let div = \"\";\n for (var repice in arrayRepices) {\n\n if (arrayRepices[repice].id == id) {\n repiceModal = arrayRepices[repice];\n break;\n }\n }\n if (repiceModal.valid) {\n div += '<div class=\"modal-content\">';\n div += '<span class=\"close\">&times;</span>';\n div += '<p class= \"modal-name\">' + repiceModal.name + \"</p>\";\n div +=\n '<p class= \"modal-number\">Pour ' +\n repiceModal.number +\n \" personnes\" +\n \"</p>\";\n div +=\n '<p class= \"modal-time\">Durée : ' + repiceModal.time + \" min</p>\";\n div +=\n '<p class= \"modal-picture\"><img class=\"center\"+ ' +\n repiceModal.name +\n \" src ='./images/recettes/\" +\n repiceModal.picture +\n \".jpg'/></p>\";\n\n var global = repiceModal.lists;\n for (var list in global) {\n if (list != \"Principale\") {\n div += \"<ul><li>\" + list + \"</li></ul>\";\n } else {\n /*Force the name change*/\n div += \"<ul><li>Ingredient</li></ul>\";\n }\n for (var j = 0; j < global[list].length; j++) {\n div += \"<li>\" + global[list][j] + \"</li>\";\n }\n }\n var globalP = repiceModal.preparations;\n for (var list in globalP) {\n if (list != \"Principale\") {\n div += \"<ul>\" + list + \"</ul>\";\n } else {\n /*Force the name change*/\n div += \"<ul>Recette</ul>\";\n }\n for (var j = 0; j < globalP[list].length; j++) {\n if (list != \"Conseil\") {\n div += \"<li>\" + globalP[list][j] + \"</li>\";\n }\n }\n }\n div += \"<li>\" + globalP.Conseil + \"</li>\";\n\n modal.style.display = \"block\";\n modal.innerHTML = div;\n\n //Click condition on the modal\n var close = document.querySelector(\".close\");\n close.onclick = function () {\n modal.style.display = \"none\";\n };\n window.onclick = function (event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n };\n var close = document.querySelector(\".modal\");\n modal.onclick = function (event) {\n modal.style.display = \"none\";\n };\n }\n}", "title": "" }, { "docid": "4c933a82c96e03b7096dc8a505f34f7b", "score": "0.622904", "text": "function draw_partial_popup(x1, y1, trainee_name, rot_name) {\n\n temp_graphic.clear();\n temp_graphic.beginFill(0xFFFFFF);\n temp_graphic.lineStyle(1, '0xDEDDDD', 1);\n\n var x2 = x1 + POPUP_WIDTH;\n var y2 = y1 + POPUP_WEIGHT;\n\n temp_graphic.moveTo(x1, y1);\n temp_graphic.lineTo(x1, y2);\n temp_graphic.lineTo(x2, y2);\n temp_graphic.lineTo(x2, y1);\n temp_graphic.lineTo(x1, y1);\n temp_graphic.endFill();\n\n var start_x = x1 + POPUP_PADDING;\n var start_y = y1 + POPUP_PADDING;\n\n popup_label1.visible = true;\n popup_label2.visible = true;\n popup_label3.visible = true;\n popup_label4.visible = true;\n popup_info1.visible = true;\n popup_info2.visible = true;\n popup_info3.visible = true;\n popup_info4.visible = true;\n popup_click_to_view.visible = true;\n\n popup_label1.x = start_x;\n popup_label1.y = start_y;\n\n popup_label2.x = start_x;\n popup_label2.y = start_y + POPUP_LABEL_HEIGHT;\n\n popup_label3.x = start_x;\n popup_label3.y = start_y + POPUP_LABEL_HEIGHT * 2;\n\n popup_label4.x = start_x;\n popup_label4.y = start_y + POPUP_LABEL_HEIGHT * 3;\n\n popup_click_to_view.x = start_x;\n popup_click_to_view.y = start_y + POPUP_LABEL_HEIGHT * 4;\n if (current_mode == MODE_EXPLORE) {\n popup_click_to_view.text = 'Click to explore additional information';\n } else if (current_mode == MODE_SCHEDULE) {\n popup_click_to_view.text = 'Click to change rotation';\n }\n\n\n popup_info1.x = start_x + POPUP_INFO_X_OFFSET;\n popup_info1.y = start_y;\n popup_info1.text = rot_name;\n\n popup_info2.x = start_x + POPUP_INFO_X_OFFSET;\n popup_info2.y = start_y + POPUP_LABEL_HEIGHT;\n\n popup_info3.x = start_x + POPUP_INFO_X_OFFSET;\n popup_info3.y = start_y + POPUP_LABEL_HEIGHT * 2;\n\n popup_info4.x = start_x + POPUP_INFO_X_OFFSET;\n popup_info4.y = start_y + POPUP_LABEL_HEIGHT * 3;\n popup_info4.text = trainee_name;\n\n app.stage.addChild(temp_line);\n app.stage.addChild(temp_graphic);\n app.stage.addChild(popup_label1);\n app.stage.addChild(popup_label2);\n app.stage.addChild(popup_label3);\n app.stage.addChild(popup_label4);\n app.stage.addChild(popup_info1);\n app.stage.addChild(popup_info2);\n app.stage.addChild(popup_info3);\n app.stage.addChild(popup_info4);\n app.stage.addChild(popup_click_to_view);\n}", "title": "" }, { "docid": "139a32eebc78c68efcf611a3576ab60d", "score": "0.62268084", "text": "function verOrdenes() {\n let usuario = cambiarUsuario();\n console.log(usuario);\n console.log(usuariosLugo[usuario].nombre);\n $('#modalUser').modal('show');\n document.getElementById('header-pedidos').innerHTML = `${usuariosLugo[usuario].nombre}, Estas son tus ordenes`;\n document.getElementById('zona-productos').innerHTML = '';\n for (let i = 0; i < usuariosLugo[usuario].ordenes.length; i++) {\n document.getElementById('zona-productos').innerHTML += \n `\n <p>\n <h3>${ usuariosLugo[usuario].ordenes[i].nombreProducto }</h3>\n </p>\n <p style=\"font-size: 18px;\">\n ${usuariosLugo[usuario].ordenes[i].descripcion}\n </p>\n <p class=\"ml-auto\">\n <b style=\"font-size: 25px\">$${usuariosLugo[usuario].ordenes[i].precio}</b>\n </p>\n <hr>\n `;\n console.log(usuariosLugo[usuario].ordenes[i].nombreProducto);\n console.log(usuariosLugo[usuario].ordenes[i].descripcion);\n console.log(usuariosLugo[usuario].ordenes[i].precio);\n \n } \n}", "title": "" }, { "docid": "8cea04fbdeee138a45fc986c425673bb", "score": "0.6213397", "text": "function formularioInfo() {\n $('.nombre_info').click(function () {\n Swal.fire({\n title: 'Nombre',\n text: \"Este campo servira para identificar al usuario dentro de la plataforma, solo sera visible por el mismo y el administrador.\",\n })\n\n });\n $('.correo_info').click(function () {\n Swal.fire({\n title: 'Correo electronico',\n text: \"Direccion de correo electronico valida, que sera utilizada como herramienta de comunicacion entre la plataforma y el usuario.\",\n })\n });\n $('.birthdate_info').click(function () {\n Swal.fire({\n title: 'Fecha de Nacimiento',\n text: \"En caso de introducir la fecha de nacimiento, la edad del usuario le sera mostrada a todos aquellos que consulten cualquiera de sus perfiles.\",\n })\n });\n $('.localidad_info').click(function () {\n Swal.fire({\n title: 'Localidad',\n text: \"Al seleccionar una localizacion, cualquiera que acceda a alguno de los perfiles podra verla.\",\n })\n });\n $('.sexo_info').click(function () {\n Swal.fire({\n title: 'Sexo',\n text: \"Campo que en caso de ser seleccionado, indicara el genero del propietario cuando un visitante acceda a consultar un perfil\",\n })\n });\n $('.nicka_info').click(function () {\n Swal.fire({\n title: 'Nick del Aprendiz',\n text: \"Nombre que se utilizara para identificar el perfil Aprendiz del usuario, y que podra ver cualquiera que acceda al perfil.\",\n })\n });\n $('.nickm_info').click(function () {\n Swal.fire({\n title: 'Nick del Maestro',\n text: \"Nombre que se utilizara para identificar el perfil Maestro del usuario, y que podra ver cualquiera que acceda al perfil.\",\n })\n });\n $('.descripciona_info').click(function () {\n Swal.fire({\n title: 'Descripcion del Aprendiz',\n text: \"Informacion que se le mostrara a los visitantes que accedan al perfil de Aprendiz.\",\n })\n });\n $('.descripcionm_info').click(function () {\n Swal.fire({\n title: 'Descripcion del Maestro',\n text: \"Informacion que se le mostrara a los visitantes que accedan al perfil de Maestro.\",\n })\n });\n $('.maestro_info').click(function () {\n Swal.fire({\n title: 'Perfil de Maestro',\n text: \"El perfil de Maestro permite al usuario crear contenido en la plataforma en forma de articulos, estos estaran relacionados con temas a eleccion del maestro.\",\n })\n });\n $('.aprendiz_info').click(function () {\n Swal.fire({\n title: 'Perfil de Aprendiz',\n text: \"El perfil de Aprendiz permite al usuario buscar contenido en la plataforma en forma de articulos creados por los Maestros, ademas de interaccionar en los mismos con otro usuarios.\",\n })\n });\n}", "title": "" }, { "docid": "f0d3bb66777416032704dd3c0b4baa29", "score": "0.6195864", "text": "function _createPopUp() {\n _idTab = _utils.activeTab;\n var assistantOptByTab = _assistantOpt[_idTab];\n _idClass = assistantOptByTab.idClass;\n createPopUpContent(assistantOptByTab);\n }", "title": "" }, { "docid": "b1abb61d2b7da108cc68592ff6aea7e1", "score": "0.61894834", "text": "function gerar(txt){ \n \n if(txt==\"Cliente\")\n { \n cargaGerada= txt\n abrePopup(iniciogerar + cTop) \n \n }\n else if(txt==\"Politica\"){\n cargaGerada= txt\n abrePopup(iniciogerar + cPolitica)\n \n }\n else if(txt==\"Verba\"){\n cargaGerada= txt\n abrePopup(iniciogerar + cVerba)\n \n }\n else if(txt==\"Estoque\"){\n cargaGerada= txt\n abrePopup(iniciogerar + cEstoque)\n }\n else if(txt==\"Produto\"){\n cargaGerada= txt\n abrePopup(iniciogerar + cPreco)\n } \n else if(txt==\"Meta\"){\n cargaGerada= txt\n abrePopup(iniciogerar + cMeta)\n }\n else if(txt==\"Ficha\"){\n cargaGerada= txt\n abrePopup(iniciogerar + cFicha)\n }\n else if(txt==\"Meta\"){\n cargaGerada= txt\n abrePopup(iniciogerar + cMeta)\n }\n else if(txt==\"Completa\"){\n cargaGerada= txt\n abrePopup(iniciogerar + cCompleta)\n } \n}", "title": "" }, { "docid": "b5450005e2d0147daed49237d98ebcdc", "score": "0.6159848", "text": "function popup_justificar(f,h,dia,cod){\n \n $('#txt_fecha').val(f);\n $('#txt_hora').val(h); \n $('#txt_motivo').val(\"\");\n \n var params={};\n params['cod'] = cod; \n \n $.ajax({\n data :params,\n type: \"GET\",\n url: \"verjustificarasis\",\n dataType: \"json\",\n success : function(data)\n {\n //$(\"#d_rpta\").remove();\n //$('#txt_motivo').disabled('true');\n //alert(data[0][0]); \n //alert(data[0][4]); \n aviso(\"\",\"\",\"\");\n $(\"#d_rpta\").empty(); \n $('#txt_motivo').attr(\"disabled\", false);\n $('#i_fecha_jus').attr(\"disabled\", false);\n $('#cmb_hora_inicio_jus').attr(\"disabled\", false);\n $('#cmb_hora_fin_jus').attr(\"disabled\", false);\n $(\"#si_rec\").attr('checked', true);\n $('#d_sino').show();\n avisoLimpiar(\"i_fecha_jus\");\n avisoLimpiar(\"cmb_hora_fin_jus\");\n avisoLimpiar(\"cmb_hora_inicio_jus\");\n\n var i=0;\n \n if(data[0][3]!=' ')\n {\n i=0; \n }\n else\n {\n i=1; \n }\n\n if(data[0][4]==1)//bloquear y mostrar mensaje\n { \n \n $(\"#d_rpta\").append(\"ya realizo su marcación del día de recuperación\"); \n aviso_adv(\"No puede realizar ningun cambio porque ya marco su recuperación\");\n \n $('#txt_motivo').val(data[i][0]);\n $('#i_fecha_jus').val(data[i][1]); \n $('#cmb_hora_inicio_jus').val(data[i][2]);\n $('#cmb_hora_fin_jus').val(data[i][3]);\n\n $('#txt_motivo').attr(\"disabled\", true);\n $('#i_fecha_jus').attr(\"disabled\", true);\n $('#cmb_hora_inicio_jus').attr(\"disabled\", true);\n $('#cmb_hora_fin_jus').attr(\"disabled\", true);\n $('#d_sino').hide();\n /*$('#no_rec').hide();\n $('#l_si').hide();\n $('#l_no').hide();*/\n poppup_ventana_justificar(dia) \n \n }\n else\n { \n if(data[0][4]==2)//no se puede justificar\n { \n alerta(\"Este es un día de Recuperación\",\"Advertencia\");\n aviso_adv(\"Este es un día de Recuperación\");\n } \n else\n { \n \n if(data[1][0]=='No hay datos')\n {\n i=0; \n }\n else\n {\n i=1; \n }\n\n if(data.length==1)\n { \n //alert(\"aqui\");\n $('#txt_motivo').val(\"\");\n $('#i_fecha_jus').val(\"\");\n $('#cmb_hora_inicio_jus').val(\"06:00\");\n $('#cmb_hora_fin_jus').val(\"06:00\");\n }\n else\n {\n //alert(\"alla\");\n $('#txt_motivo').val(data[i][0]);\n $('#i_fecha_jus').val(data[i][1]); \n $('#cmb_hora_inicio_jus').val(data[i][2]);\n $('#cmb_hora_fin_jus').val(data[i][3]);\n } \n poppup_ventana_justificar(dia) \n }\n }\n\n },\n error: function()\n {\n //aviso_mal(\"Ocurrio un problema con el JSON: verjustificarasis...\"); \n location.reload();\n }\n\n }); \n \n}", "title": "" }, { "docid": "7eb9ce97654d0c095c2c9bdfed3e89db", "score": "0.61502695", "text": "function ocultarModal() {\n //mostrar botones de guardadado\n //document.getElementById('ConvertPDF').style.display = 'inline';\n //document.getElementById('guardar').style.display = 'inline';\n\n // document.getElementById('Formulario').style.display = 'inline';\n document.getElementById('MenuFecha').style.display = 'inline-block';\n document.getElementById('MenuFecha2').style.display = 'inline-block';\n document.getElementById('MenuFecha3').style.display = 'inline-block';\n\n //document.getElementById('MenuFecha3').style.display = 'block';\n document.getElementById('Modal').style.display = 'none';\n document.getElementById('btnGuarda').style.display = 'inline';\n document.getElementById('nomina').style.display = \"inline\";\n document.getElementById('Deshacer').style.display = \"inline\";\n //getAño('#AutoSelec');\n $.unblockUI();\n}", "title": "" }, { "docid": "2606c5237d3b1612c1f8ef7f7ac59954", "score": "0.6149875", "text": "function setup_popups(){\n $( \".pop-up\" ).tooltip({\n show: {\n delay: 10\n }\n });\n \n $(\"#cmpa\").tooltip( \"option\", \"position\", { my: \"left+15 center\", at: \"right center\" } );\n \n $( \".my-dialog\" ).dialog({\n autoOpen: false,\n minWidth: 200,\n minHeight: 200,\n maxHeight: 600,\n maxWidth: 1000,\n width: 600,\n resizeStart: function( event, ui ) {\n resize_modal = true;\n },\n resizeStop: function( event, ui ) {\n resize_modal = false;\n }\n })\n \n \n $( \"#biblio-dialog\" ).dialog({\n minWidth: 360,\n minHeight: 300,\n open: function(event, ui) {\n let diagw = $($(event.target).parent()[0]).width(),\n diagh = $($(event.target).parent()[0]).height(),\n pagew = document.documentElement.clientWidth,\n pageh = document.documentElement.clientHeight,\n top = (pageh - diagh)*0.5,\n left = (pagew - diagw)*0.5;\n \n $(event.target).parent().css('top', top+'px');\n $(event.target).parent().css('left', left+'px');\n }\n })\n \n \n $( \"#tutorial\" ).on( \"click\", function() {\n if( $( \"#tutorial-dialog\" ).dialog( \"isOpen\" ))\n $( \"#tutorial-dialog\" ).dialog( \"close\" );\n else \n $( \"#tutorial-dialog\" ).dialog( \"open\" );\n event.preventDefault()\n event.stopPropagation()\n });\n}", "title": "" }, { "docid": "9acd097c86a7da4d68af8ee03536b643", "score": "0.614393", "text": "function showDetails(data){\n modal = document.getElementById(\"modalDetalle\");\n if(data.author==null)\n modal.children[0].children[0].children[1].innerHTML= \"No hay autor\";\n else \n htmlString= \"<p> Author`s name:<br/> \"+data.author+\" <p>\";\n modal.children[0].children[0].children[1].innerHTML= htmlString;\n\n // modal.children[0].children[0].children[1].innerHTML= data.author;\n\n if(data.content==null)\n modal.children[0].children[0].children[2].innerHTML= \"No hay contenido\";\n else \n htmlString= \"<p> The content:<br/> \"+data.content+\" <p>\";\n modal.children[0].children[0].children[2].innerHTML= htmlString;\n \n if(data.description==null)\n modal.children[0].children[0].children[3].innerHTML= \"No hay descripcion\";\n else \n htmlString= \"<p> The description:<br/> \"+data.description+\" <p>\";\n modal.children[0].children[0].children[3].innerHTML= htmlString;\n\n htmlString= \"<p> Date of publish:<br/> \"+data.publishedAt+\" <p>\";\n modal.children[0].children[0].children[4].innerHTML= htmlString;\n\n modal.children[0].children[0].children[5].href= data.url;\n htmlString= \"<p> View More...:<br/> \"+data.url+\" <p>\";\n modal.children[0].children[0].children[5].innerHTML= htmlString;\n \n //modal.innerHTML = data.author;\n modal.style.display = \"block\";\n \n }", "title": "" }, { "docid": "d91e158a265648bd41041c51d92a416c", "score": "0.61422986", "text": "function creaVentanaSecundariaPrueba(){\r\n\t\r\n\twindow.open(\"opciones.html\" , \"ventana1\" , \"width=120,height=300,scrollbars=NO\");\r\n\t\r\n}", "title": "" }, { "docid": "56e285c6bf2156f1eedb99c3e67ee226", "score": "0.6135872", "text": "mostrarFormularioIngresoPaciente() {\n let datosPersonal = this.hospital.nombresPersonal;\n let clase = \"ingresoPaciente\";\n let funcion = () => { this.ingresarDatos(Paciente.name, clase) };\n crearFormulario([\"nombre\", \"apellidos\", \"edad\", \"enfermedad\"], clase, funcion);\n let botonAltaForm = document.getElementById(\"confirmacion\");\n addSelect(botonAltaForm, datosPersonal, clase);\n }", "title": "" }, { "docid": "1f17d337690d0297df55c624440d4d53", "score": "0.6130525", "text": "function mostrarformRelleno(provicia, localidad, cp, tipoVia, calle, numero) {\n\t\tdocument.getElementById('oculto').style.display = 'block';\n\t\tdocument.getElementById('listaprovincias').value = provicia;\n\t\tdocument.getElementById('listalocalidades').value = localidad;\n\t\tdocument.getElementById('cpWatson').value = cp;\n\t\tdocument.getElementById('tipoV').value = tipoVia;\n\t\tdocument.getElementById('listacalles').value = calle;\n\t\tdocument.getElementById('numero').value = numero;\n\t\tvar div = document.getElementById('watson__body__chat');\n\t\tdiv.scrollTop = '9999';\n\t}", "title": "" }, { "docid": "74087cae841113833fc4f4d5c27d4a0c", "score": "0.61263037", "text": "function ouvrePopUpVerre(verreBoisson, verreDegre, verreContenance)\n {\n var verre;\n var vide = \"\";\n window.localStorage.setItem('verre', vide);//Réinitialise le stockage des caracteristiques de la boisson à vide, au cas où l'utilisateur cliquerait dans le vide au lieu d'ajouter\n\n /*Modifie les caractéristiques de la boisson a afficher*/\n document.getElementById('boissonAjtVerres').innerHTML=verreBoisson;\n document.getElementById('degreAjtVerre').innerHTML=\"<b>Degré : </b>\"+verreDegre*100 +\" %\";\n document.getElementById('volumeAjtVerre').innerHTML=\"<b>Volume : </b>\"+verreContenance+\" mL\";\n\n \t$(\"#nombreVerres\").text($(\"#\"+verreBoisson).text());\n verre={\n \"nomV\":verreBoisson,\n \"degreV\":verreDegre,\n \"volV\":verreContenance,\n };\n\n verre=JSON.stringify(verre);//format JSON\n window.localStorage.setItem('verre', verre);//stock pr passer a la fonction ajout verre\n \n //Ouvre la pop Up\n $(\"#popupNbVerres\").popup(\"open\");\n }", "title": "" }, { "docid": "8c83d38124eec9e09a814a55fc1e4730", "score": "0.61256224", "text": "function draw_full_popup(x1, y1, trainee_name, rot_name) {\n\n temp_graphic.clear();\n temp_graphic.beginFill(0xFFFFFF);\n temp_graphic.lineStyle(1, '0xDEDDDD', 1);\n\n var x2 = x1 + POPUP_WIDTH;\n var y2 = y1 + POPUP_WEIGHT + POPUP_LABEL_HEIGHT * (num_rotations + 1);\n\n temp_graphic.moveTo(x1, y1);\n temp_graphic.lineTo(x1, y2);\n temp_graphic.lineTo(x2, y2);\n temp_graphic.lineTo(x2, y1);\n temp_graphic.lineTo(x1, y1);\n temp_graphic.endFill();\n\n var start_x = x1 + POPUP_PADDING;\n var start_y = y1 + POPUP_PADDING;\n\n popup_close_btn.visible = true;\n popup_close_btn.interactive = true;\n popup_label1.visible = true;\n popup_label2.visible = true;\n popup_label3.visible = true;\n popup_label4.visible = true;\n popup_info1.visible = true;\n popup_info2.visible = true;\n popup_info3.visible = true;\n popup_info4.visible = true;\n popup_click_to_view.visible = true;\n\n popup_close_btn.x = start_x + POPUP_WIDTH - POPUP_CLOSE_OFFSET;\n popup_close_btn.y = start_y;\n\n popup_label1.x = start_x;\n popup_label1.y = start_y;\n\n popup_label2.x = start_x;\n popup_label2.y = start_y + POPUP_LABEL_HEIGHT;\n\n popup_label3.x = start_x;\n popup_label3.y = start_y + POPUP_LABEL_HEIGHT * 2;\n\n popup_label4.x = start_x;\n popup_label4.y = start_y + POPUP_LABEL_HEIGHT * 3;\n\n popup_click_to_view.x = start_x;\n popup_click_to_view.y = start_y + POPUP_LABEL_HEIGHT * 4;\n popup_click_to_view.text = 'Select a rotation you would like to change to'\n\n popup_info1.x = start_x + POPUP_INFO_X_OFFSET;\n popup_info1.y = start_y;\n popup_info1.text = rot_name;\n\n popup_info2.x = start_x + POPUP_INFO_X_OFFSET;\n popup_info2.y = start_y + POPUP_LABEL_HEIGHT;\n\n popup_info3.x = start_x + POPUP_INFO_X_OFFSET;\n popup_info3.y = start_y + POPUP_LABEL_HEIGHT * 2;\n\n popup_info4.x = start_x + POPUP_INFO_X_OFFSET;\n popup_info4.y = start_y + POPUP_LABEL_HEIGHT * 3;\n popup_info4.text = trainee_name;\n\n rot_top_left_x = start_x;\n rot_top_left_y = start_y + POPUP_LABEL_HEIGHT * 5;\n\n var label;\n var square;\n var click_field;\n for (var i = 0; i < num_rotations + 1; i++) {\n click_field = rotation_click_fields[i];\n square = rotation_squares[i];\n label = rotation_labels[i];\n\n click_field.x = start_x;\n square.x = start_x + POPUP_SQUARE_OFFSET_X;\n square.y = start_y + POPUP_LABEL_HEIGHT * (5 + i) + POPUP_SQUARE_OFFSET_Y + POPUP_ROTATION_OFFSET;\n\n click_field.y = start_y + POPUP_LABEL_HEIGHT * (5 + i);\n label.x = start_x + POPUP_ROTATION_LABEL_OFFSET;\n label.y = start_y + POPUP_LABEL_HEIGHT * (5 + i) + POPUP_ROTATION_OFFSET;\n }\n\n app.stage.addChild(temp_line);\n app.stage.addChild(temp_graphic);\n app.stage.addChild(popup_close_btn);\n app.stage.addChild(popup_label1);\n app.stage.addChild(popup_label2);\n app.stage.addChild(popup_label3);\n app.stage.addChild(popup_label4);\n app.stage.addChild(popup_info1);\n app.stage.addChild(popup_info2);\n app.stage.addChild(popup_info3);\n app.stage.addChild(popup_info4);\n app.stage.addChild(popup_click_to_view);\n app.stage.addChild(rotation_click_fields_container);\n app.stage.addChild(rotation_labels_container);\n app.stage.addChild(rotation_squares_container);\n app.stage.addChild(temp_popup);\n}", "title": "" }, { "docid": "d44803396d30f44bf82a7d3419661c2b", "score": "0.611832", "text": "function renderPromocoes (promos) {\n for (let obj of promos) {\n const divPromo = createDivPromo()\n const title = createPromoTitle(obj.NomeTarifa)\n divPromo.appendChild(title)\n\n title.appendChild(createPopOver(obj.RegrasTarifa))\n\n const descricoes = createDescription(obj.DescricaoTarifa)\n\n for (let desc of descricoes) {\n divPromo.appendChild(desc)\n }\n\n divPromo.appendChild(createOldPrice(obj.TipoMoeda, obj.ValorTarifaSemDesconto))\n divPromo.appendChild(createNewPrice(obj.TipoMoeda, obj.ValorTarifa))\n divPromo.appendChild(createButton(obj.CodigoHotel, obj.CodigoTarifa))\n\n document.querySelector('.modal-grid').appendChild(divPromo)\n }\n}", "title": "" }, { "docid": "a23a146f7ece83678c30639fec46da2f", "score": "0.61117995", "text": "function mostraPatio(){\n\tvar livros = JSON.parse(localStorage.getItem('patio2')); /*chamar as informações do patio2 e convertendo para JSON*/\n\tvar livrosResultado = document.getElementById('resultados'); /*capturar as informações do id*/\n\n\n\tlivrosResultado.innerHTML = '';\n\n\t\tfor(var i=0; i < livros.length; i++){ /*para capturar as informações do objeto e apresentá-las na tabela*/\n\t\t\tvar numero = i;\n\t\t\tvar nome = livros[i].nome;\n\t\t\tvar autor = livros[i].autor;\n\t\t\tvar pagina = livros[i].pagina;\n\t\t\tvar diferenca = livros[i].diferenca;\n\t\t\tvar genero = livros[i].genero;\n\t\t\tswitch(genero){\n\t\t\t\tcase '0':\n\t\t\t\t\tgenero = \"Ação\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '1':\n\t\t\t\t\tgenero = \"Autoajuda\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t\tgenero = \"Aventura\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t\tgenero = \"Bibliografia\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t\tgenero = \"Carta\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '5':\n\t\t\t\t\tgenero = \"Científico\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '6':\n\t\t\t\t\tgenero = \"Conto\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '7':\n\t\t\t\t\tgenero = \"Crônica\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '8':\n\t\t\t\t\tgenero = \"Didático\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '9':\n\t\t\t\t\tgenero = \"Drama\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '10':\n\t\t\t\t\tgenero = \"Épico\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '11':\n\t\t\t\t\tgenero = \"Fantasia\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '12':\n\t\t\t\t\tgenero = \"Ficção Científica\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '13':\n\t\t\t\t\tgenero = \"Guia\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '14':\n\t\t\t\t\tgenero = \"Histórico\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '15':\n\t\t\t\t\tgenero = \"Humor\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '16':\n\t\t\t\t\tgenero = \"Infatojuvenil\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '17':\n\t\t\t\t\tgenero = \"Jogo\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '18':\n\t\t\t\t\tgenero = \"Romance\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '19':\n\t\t\t\t\tgenero = \"Saúde\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase '20':\n\t\t\t\t\tgenero = \"Terror\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\nlivrosResultado.innerHTML += '<tr><td>' + (numero + 1) + '</td><td>' + nome + '</td><td>' + autor + '</td><td>' + pagina + '</td><td>'+ genero + '</td><td>' \n+ diferenca +\n '</td><td><a href=\"editar.html\"><button type=\"submit\" class=\"btn btn-light\" onclick=\"editar(\\''+i+'\\')\"><i class=\"material-icons\">create</i> </button></a>'+\n '</td><td><button type=\"submit\" class=\" btn btn-light\" onclick=\"apagarLivro(\\''+nome+'\\')\"><i class=\"material-icons\">delete</i></button>' +\n '</td></tr>' \n\n\t\t\n\t}\t\n\n}", "title": "" }, { "docid": "1b96b48c5747c13ff2c6f82373db59cb", "score": "0.6096042", "text": "function PrintAnamnesisCdu()\n{\n\t//SaveAnanmesisCdu();\n/*\t$(\"#PrintAnamnesiscdu\").attr(\"title\",\"Anamnesis\");\n\t$( \"#PrintAnamnesiscdu\" ).dialog({\n\t\t\tautoOpen: false,\n\t\t\tmodal: true,\n\t\t\theight:700,\n\t\t\twidth:900,\n\t\t\tshow: {\n\t\t\t\teffect: \"slide\",\n\t\t\t\tduration: 1000\n\t\t\t},\n\t\t\thide: {\n\t\t\t\teffect: \"drop\",\n\t\t\t\tduration: 1000\n\t\t\t}\n\t\t});\n\t$( \"#PrintAnamnesiscdu\" ).dialog( \"open\" );*/\n\t$( \".modal-body\" ).html(\"<object type='text/html' data='../Reportes/AnamnesisCdu.php?idPac=\"+$('#codigoPaciente').val()+\"'></object>\");\n}", "title": "" }, { "docid": "d1faec326539341a8b4cc957dadd34e7", "score": "0.6095795", "text": "function ganar(){\n let mensaje = document.getElementById(\"pGanar\");\n mensaje.innerHTML = `Felicidades!! <br><br> \n Has ganado!! <br><br> \n Tu puntuacion: ${puntuacion}`;\n dialogoGanar.showModal();\n}", "title": "" }, { "docid": "1991e983fd2333077a05ef12c9bef898", "score": "0.60844845", "text": "function initPage() {\n // creation des listes des choix type, public et patiqye\n x_return_enum('bav_objet', 'obj_type', display_list_type);\n x_return_enum('bav_objet', 'obj_public', display_list_public);\n x_return_enum('bav_objet', 'obj_pratique', display_list_pratique);\n\n // recuperation de la liste des marques\n x_return_list_marques(display_list_marques)\n x_return_list_tailles(display_list_tailles)\n\n // chargement des taux\n x_return_tauxBAV(display_list_taux_com);\n\n document.ficheForm.obj_type.focus();\n\n\n document.ficheForm.obj_description.value = texteDescription;\n\n if (ADMIN) {\n // chargement de la liste des client par mel\n x_return_listClientByMel(display_listVendeur);\n\n // chargement de la liste des client par mel\n // x_return_listClientByName(display_listVendeurName);\n\n console.log(\"mode \" + ADMIN);\n // en mode create de table, le mail n'est pas obligatoire\n document.ficheForm.cli_emel.required = false;\n\n // pas de CGU pour la ADMIN\n\n document.ficheForm.checkCGU.required = false;\n // pas la peine de voir les CGU\n getElement(\"tdCGU\").style.display = 'none';\n\n // champ au nom aleatoir pour contrer google \n document.ficheForm.elements.namedItem('obj_marque_' + idRamdom).required = true;\n\n // pas de couleur obligatoire\n document.ficheForm.obj_couleur.required = true;\n\n\n // prix de depot oblogatoire\n document.ficheForm.obj_prix_depot.required = true;\n\n // affichage de la section TAUX-CAM\n getElement(\"trTauxCom\").style.display = 'block';\n\n // affchage de la section PRIX\n getElement(\"divPrix\").style.display = 'block';\n\n\n // sinon si pas de CLIENT possible\n } else if (!CLIENT) {\n alertModalInfo(\"La saisie n'est pas encore ouverte.\");\n setTimeout(function() { goTo() }, 2000);\n }\n\n // si on passe un d de fiche alors pn affiche\n if (idFiche) {\n x_return_oneFiche(idFiche, display_fiche);\n } else {\n // on doit être en create, sinon index.\n if (modePage != \"create\") {\n goTo();\n }\n }\n}", "title": "" }, { "docid": "2f73c9df106dbab9010064bf7784dc31", "score": "0.6082283", "text": "function verDetalles(){\n\tvar btn = $(this)[0];\n\tvar i = btn.getAttribute(\"id_pullDeResultados\");\n\tvar detallesHTML = \"<p>\";\n\tdetallesHTML += \"<strong># Id del apunte:</strong> \" + pullDeResultados[i]['id'] +\"</br>\";\n\tdetallesHTML +=\t\"<strong>Nombre:</strong> \" + pullDeResultados[i]['nombre'] +\"</br>\";\n\tdetallesHTML += \"<strong>Lugar:</strong> \" + pullDeResultados[i]['lugar'] +\"</br>\";\n\tdetallesHTML +=\t\"<strong>Estante:</strong> \" + pullDeResultados[i]['estante'] +\"</br>\";\n\tdetallesHTML += \"<strong>Numero:</strong> \" + pullDeResultados[i]['numero'] +\"</br>\";\n\tdetallesHTML +=\t\"<strong>Estado:</strong> \" + pullDeResultados[i]['estado'] +\"</br>\";\n\tdetallesHTML +=\t\"<strong>En la apunteca desde:</strong> \" + pullDeResultados[i]['desde'] +\"</br>\";\n\tdetallesHTML += '<strong><a href=\"apunteca_registro.php?&id_apunte='+pullDeResultados[i]['id']+'\" target=\"_blank\">Ver historial</a></strong></br>';\n\tdetallesHTML += '<strong><a href=\"apunteca_editar.php?&id_apunte='+pullDeResultados[i]['id']+'\" target=\"_blank\">Editar apunte</a></strong>';\n\n\tdetallesHTML += \"</p>\";\n\n\tif(pullDeResultados[i]['estado_id']==2){\n\t\tdetallesHTML += '<p id=\"registro\">';\n\t\tdetallesHTML += \"</p>\";\n\t\tunRegistro(pullDeResultados[i]['id']);\n\t\t\n\t\tbootbox.dialog({\n\t\t message: detallesHTML,\n\t\t title: '<span class=\"glyphicon glyphicon-book\"></span> Detalles del apunte',\n\t\t buttons: {\n\t\t btn_devolver: {\n\t\t label: \"Devolver apunte\",\n\t\t className: \"btn-warning\",\n\t\t callback: function() {\n\t\t \tbootbox.prompt(\"Estas seguro que queres devolver el apunte? Agrega alguna observacion\", function(result) { \n\t\t\t\t if (result === null) { \n\t\t\t\t //Example.show(\"Prompt dismissed\"); \n\t\t\t\t } else {\n\t\t\t\t \t$.ajax({\n\t\t\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\t\t\turl: 'librerias/formulariosajax.php?nocache='+ Math.random(),\n\t\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\t\tasync: true,\n\t\t\t\t\t\t\t\tdata: \"apuntecaDevuelve=apuntecaDevuelve&id_apunte=\"+pullDeResultados[i]['id']+\"&comentario=\"+result,\n\t\t\t\t\t\t\t\tsuccess: cargaDatos,\n\t\t\t\t\t\t}); \n\t\t\t\t }\n\t\t\t\t});\n\t\t }\n\t\t },\n\t\t btn_cancelar: {\n\t\t label: \"Cancelar\",\n\t\t className: \"btn-primary\",\n\t\t callback: function() {\n\t\t //Example.show(\"uh oh, look out!\");\n\t\t }\n\t\t }\n\t\t }\n\t\t});\n\t}else{\n\t\tbootbox.dialog({\n\t\t message: detallesHTML,\n\t\t title: '<span class=\"glyphicon glyphicon-book\"></span>'+\" Detalles del apunte\",\n\t\t buttons: {\n\t\t btn_retirar: {\n\t\t label: \"Retirar apunte\",\n\t\t className: \"btn-primary\",\n\t\t callback: function() {\n\t\t\t \twindow.location=\"apunteca_retirar.php?id_apunte=\"+pullDeResultados[i]['id'];\n\t\t }\n\t\t },\n\t\t btn_salir: {\n\t\t label: \"Cancelar\",\n\t\t className: \"btn-default\",\n\t\t callback: function() {\n\t\t //Example.show(\"uh oh, look out!\");\n\t\t }\n\t\t }\n\t\t }\n\t\t});\n\t}\n\t\n}", "title": "" }, { "docid": "e8b42db620dabe2f729ab1c41ad4e732", "score": "0.60594827", "text": "function PopupFormato(){\n\n this.$id = $('#id_tarjeta_formato')\n this.$id_compania = $('#id_compania')\n this.$id_tipo = $('#id_tipo')\n this.$id_no_revision = $('#id_no_revision')\n // this.$id_activo = $('#id_activo')\n this.$id_vigencia = $('#id_vigencia_group')\n this.$id_codigo = $('#id_codigo')\n this.$id_descripcion = $('#id_descripcion')\n this.$id_boton_guardar = $('#id_boton_guardar')\n this.$id_popup_titulo = $('#id_popup_formato_titulo')\n this.$id_formulario = $('#id_formulario_formato')\n this.$accion\n this.init_Components()\n this.init_Events()\n}", "title": "" }, { "docid": "b7dc11d902f9831fd30ba608e920bfc4", "score": "0.6052076", "text": "function btngo_popup(u, btn) {\n var urlpopup = window.location.origin + \"/\" + u.replace(\"../wfl\", \"wf\"); //[*]Esto debe de cambiar\n // if (eleid != null & eleid != undefined) {\n // eleid = eleid.replace('V', '') + 'V';\n // // var co_conpar_1 = document.getElementById(eleid).getElementsByTagName('SPAN')[0].getAttribute('valpag');\n // // var co_conpar_2 = document.getElementById(eleid).getElementsByTagName('SPAN')[0].innerHTML;\n //\n // urlpopup = urlpopup + \"\" + \"&co_conpar_1=\" + encodeURIComponent(co_conpar_1) + \"&co_conpar_2=\" + encodeURIComponent(co_conpar_2);\n // }\n\n urlpopup = urlpopup + \"&co_conpad=\" + CO_CONTEN + \"&il_popup=true\";\n window.parent.master_button_popup(CO_PAGINA, btn, urlpopup);\n}", "title": "" }, { "docid": "f03190e3331a992601b75cfa56a80c42", "score": "0.6038228", "text": "function cdos_mostrarExito(pMensaje){\n\t\tvar vWnd = -1;\n\t\tif ( pMensaje != null){\n\t\t\tvar sDescrip =new String(pMensaje + '');\n\t\t\tif ( sDescrip.length > 0){\n\t\t\t\tvar parametroExito = new Object();\n\t\t\t\tparametroExito.exito = GestionarMensaje('1459',null,null,null);\n\t\t\t\tparametroExito.exitoDescripcion = sDescrip;\n\t\t\t\tparametroExito.opener = window;\n\t\t\t\tvWnd = window.showModalDialog('../paginaExito.html', parametroExito, 'dialogWidth:464px;dialogHeight:140px;status:no;scroll:no;help:no;resizable=no;');\n\t\t\t\t//queda obsoleto, hablar con juan pablo bosnjak cualquier consulta vWnd = window.showModalDialog('sicc0000jg?ON=LPPantallaAlert', parametrosReturn, 'dialogWidth:464px;dialogHeight:140px;status:no;scroll:no;help:no;resizable=no;');\n\t\t\t}\t\n\t\t}\n\t\treturn vWnd;\n\t}", "title": "" }, { "docid": "fefd287df3a1beaf9f19d167f142850f", "score": "0.6036322", "text": "function abrirPopMover(){\n document.getElementById(\"popupMA\").style.display = \"block\";\n\n //sacamos los nombres de los grupos.\n //Sacamos nombre del alumno\n $.post(\"/Clima/php/grupos.php\", {id: idAl})\n .done(function(grupos){\n if(grupos!=\"\"){\n \n grouparray = grupos.split(\"][\").join(\"],[\");\n var grupo = eval(\"[\"+grouparray+\"]\");\n \n for(i=0; i<grupo.length; i++){\n for(j=0; j<grupo[i].length; j++){\n idGNew = (grupo[i][0]); //id del grupo\n nombreGrupo = (grupo[i][1]); //nombre grupo\n\n } \n\n //Creacion de elementos HTML\n //Opciones\n var opc = document.createElement(\"option\");\n var textOpc = document.createTextNode(nombreGrupo);\n opc.value = nombreGrupo;\n opc.className = \"opcGrups\";\n\n opc.appendChild(textOpc);\n\n document.getElementById(\"gru\").appendChild(opc);\n\n //Si el grupo es el actual, la opcion se inhabilita\n if(opc.value == nombreG){\n opc.disabled = true;\n }\n }\n }\n\n else{\n alert(\"Error la nota no está\");\n }\n }); \n}", "title": "" }, { "docid": "15216968cbc7e1cd20af485e833ed853", "score": "0.60346586", "text": "function cargarEjercicio() {\n\tcambiarFondo(1);\n\tvar textopaso = cuento.pasos[0];\n\tdocument.getElementById('contenedortexto').innerHTML = textopaso;\n\tpasoActual = 1; //inicio en el paso 1\n}", "title": "" }, { "docid": "45e1856e657882b91054e0ae09ec4794", "score": "0.6005755", "text": "function generarLiquidacion() {\n\n\t//Obtener el id de Trabajador por Codigo \n\tlet idTrabajador = $(this).getJSONSync(\"/simpleWeb/json/work/getIdTrabajadorByCodigo/\"+$('#rut').val());\n\t\n\tlet liquidacionList = new Array();\n\t\n\tdatosLiquidacion.forEach(function(value) {\n\t\t\n\t\tlet liquidacion = new Object();\n\t\t\n\t\tliquidacion.descripcion = JSON.stringify(value.descripcion);\n\t\tliquidacion.valor = JSON.stringify(value.valor);\n\t\tliquidacionList.push(liquidacion)\n\t\t\n\t});\n\t\n\t$(this).setJSONSync(\"/simpleWeb/json/work/generateLiquidacion/\"+idTrabajador+\",\"+$('#periodo').val(), liquidacionList);\n\t\n\twindow.open(\"/simpleWeb/json/work/showLiquidacion/?ID=\"+$('#rut').val()+\"&PERIODO=\"+$('#periodo').val());\n\t\n}", "title": "" }, { "docid": "661d57c21fc4d974647d742288357388", "score": "0.6000405", "text": "function affichagePage(request) {\n\t// Parcours des fenetres/onglets ouverts\n\tvar ongletDejaExistant = false;\n\tvar windowsId = -1;\n\tvar tabId = -1;\n\tvar monUrl = \"\";\n\tvar requestUrl = \"\";\n\n\t// Recuperation de la requete reclamee\n\tvar param = request.param;\n\t// Recuperation du parametre optionnel (voir si nécessaire une liste de parametres)\n\tvar value = request.value;\n\n if (request.from == 'popup_interaction') {\n\t\tif (param == null || param === \"\") {\n createNotification('Jeedom', 'Veuillez saisir une interaction');\n\t\t}\n\t\telse {\n requestUrl = Config.get(\"jeedomUrl\") + '/core/api/jeeApi.php?apikey=' + Config.get(\"jeedomApiKey\") + '&type=interact&query=' + encodeURI(request.param) + '&utf8=1';\n //createNotification('Jeedom', 'Lancement de l\\'interaction \"' + encodeURI(request.param) + '\"');\n\t\t\t//monPort.postMessage(\"Message vers popup.js : \" + request.param);\n\t\t}\n\t}\n\telse if (request.from == 'popup_scenario') {\n\t\tif (param == null || param === \"\") {\n\t\t\tcreateNotification('Jeedom', 'Veuillez saisir un id de scenario');\n\t\t}\n\t\telse if (param.search(\"[^0-9]\")!=-1) {\n\t\t\tcreateNotification('Jeedom', 'Veuillez saisir un id de scenario correct');\n\t\t}\n\t\telse {\n\t\t\trequestUrl = Config.get(\"jeedomUrl\") + '/core/api/jeeApi.php?apikey=' + Config.get(\"jeedomApiKey\") + '&type=scenario&id=' + param + '&action=start';\n\t\t\t//createNotification('Jeedom', 'Lancement du scenario ' + request.param);\n\t\t}\n\t}\n\telse if (request.from == 'popup_info') {\n\t\tif (param == null || param === \"\") {\n\t\t\tcreateNotification('Jeedom', 'Veuillez saisir un id info');\n\t\t}\n\t\telse if (param.search(\"[^0-9]\")!=-1) {\n\t\t\tcreateNotification('Jeedom', 'Veuillez saisir un id info correct');\n\t\t}\n\t\telse {\n\t\t\trequestUrl = Config.get(\"jeedomUrl\") + '/core/api/jeeApi.php?apikey=' + Config.get(\"jeedomApiKey\") + '&type=info&id=' + param + '&value=1';\n\t\t\t//createNotification('Jeedom', 'Lancement de la commande ' + request.param);\n\t\t}\n\t}\n\telse if (request.from == 'popup_commande') {\n\t\tif (param == null || param === \"\") {\n\t\t\tcreateNotification('Jeedom', 'Veuillez saisir un id de commande');\n\t\t}\n\t\telse if (param.search(\"[^0-9]\")!=-1) {\n\t\t\tcreateNotification('Jeedom', 'Veuillez saisir un id de commande correct');\n\t\t}\n\t\telse {\n\t\t\trequestUrl = Config.get(\"jeedomUrl\") + '/core/api/jeeApi.php?apikey=' + Config.get(\"jeedomApiKey\") + '&type=cmd&id=' + param;\n\t\t\t//createNotification('Jeedom', 'Lancement du scenario ' + request.param);\n\t\t}\n\t}\n\telse if (request.from == 'popup_ifttt') {\n\t\tif (param === \"\") {\n\t\t\tcreateNotification('Jeedom', 'Veuillez saisir un id ifttt');\n\t\t}\n\t\telse if (param.search(\"[^0-9]\")!=-1) {\n\t\t\tcreateNotification('Jeedom', 'Veuillez saisir un id ifttt correct');\n\t\t}\n\t\telse {\n\t\t\trequestUrl = Config.get(\"jeedomUrl\") + '/core/api/jeeApi.php?apikey=' + Config.get(\"jeedomApiKey\") + '&type=ifttt&id=' + param;\n\t\t\tif (value != null && value != \"\" && value != undefined)\t{\n\t\t\t\trequestUrl += '&value=' + value\n\t\t\t}\n\t\t\t//createNotification('Jeedom', 'Lancement de la commande ' + request.param);\n\t\t}\n\t}\n\telse if (request.from == 'popup_url') {\n\t\tmonUrl = request.urlDestination;\n\t}\n\n\tif (monUrl != \"\") {\n\t\t//chrome.tabs.query({},function(tabs){\n\t\t//\ttabs.forEach(function(tab){\n\t\tconsole.log('parcours fenetres');\n\t\tchrome.windows.getAll({ populate: true }, function (windows) {\n\t\t\tconsole.log('lancement boucle');\n\t\t\tfor (var i = 0; i < windows.length; ++i) {\n\t\t\t\tvar w = windows[i];\n\t\t\t\tif (!ongletDejaExistant && windowsId == -1) {\n\t\t\t\t\t// sauvegarde id window de la premiere fenêtre pour la création de l'onglet si inexistant\n\t\t\t\t\twindowsId = w.id;\n\t\t\t\t}\n\t\t\t\tfor (var j = 0; j < w.tabs.length; ++j) {\n\t\t\t\t\tvar tab = w.tabs[j];\n\n\t\t\t\t\tif (!ongletDejaExistant && tab.url == monUrl) {\n\t\t\t\t\t\tconsole.log(\"onglet \" + tab.url + \" deja existant !\");\n\t\t\t\t\t\tongletDejaExistant = true;\n\t\t\t\t\t\twindowsId = w.id;\n\t\t\t\t\t\ttabId = tab.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!ongletDejaExistant) {\n\t\t\t\t// Création d'un nouvel onglet pour cette url\n\t\t\t\tconsole.log(\"ouverture nouvel onglet pour \" + monUrl);\n\t\t\t\tchrome.windows.update(windowsId, { focused: true }, function (window) {\n\t\t\t\t\tchrome.tabs.create({url: monUrl}, function(tab) {\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Focus sur l'onglet deja ouvert pour cette url\n\t\t\t\tconsole.log(\"focus sur l'onglet déjà ouvert pour \" + monUrl);\n\t\t\t\tchrome.windows.update(windowsId, { focused: true }, function (window) {\n\t\t\t\t\tvar updateProperties = {\"active\": true};\n\t\t\t\t\tchrome.tabs.update(tabId, updateProperties, function(tab){\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\telse if (requestUrl != '') {\n\t\t// execution de la requete demandee\n loadHTTPRequest(requestUrl, retourRequestUrl, request.from);\n\t}\n}", "title": "" }, { "docid": "a1a22a5101706d1f03e50eb109c89bc9", "score": "0.5997752", "text": "function showPopUp(e) {\n \n var obj = data[e.target.value.toLowerCase()];\n\n if (obj.rules == undefined) {\n obj.rules = [\"Will be updated soon\"];\n }\n if (obj.eventStructure == undefined) {\n obj.eventStructure = [\"Will be updated soon\"];\n }\n\n\n txtEventName.innerText = e.target.innerText;\n description.innerHTML = obj.description;\n ytbVideo.src = obj.videoURL;\n var structureHTML = \"\";\n var rulesHTML = \"\";\n obj.eventStructure.forEach(elem => {\n structureHTML += \"<li>\" + elem + \"</li>\";\n })\n obj.rules.forEach(elem => {\n rulesHTML += \"<li>\" + elem + \"</li>\";\n })\n \n var contactHTML = \"\";\n obj.contact.forEach(elem => {\n contactHTML += `<li>\n <h3 id=\"contact-name\">${elem.name} : </h3>\n <h3 id=\"contact-number\">+91${elem.no}</h3>\n </li>`\n })\n\n\n structure.innerHTML = structureHTML;\n rules.innerHTML = rulesHTML;\n txtPrizeMoney.innerText = obj.prizeMoney;\n txtEntryFee.innerText = obj.entryFee;\n btnRegister.value = obj.registerURL;\n contact.innerHTML = contactHTML;\n\n btnRegister.addEventListener('click', _ => {\n window.open(btnRegister.value);\n })\n document.body.style.overflowY = \"hidden\";\n popUp.classList.remove(\"hide\");\n}", "title": "" }, { "docid": "54b68ed4fb374635303598141c8c70f4", "score": "0.5994197", "text": "function generarPlagas(lista,idpl){\n\t$.getJSON(`http://localhost:8080/especie/${idpl}`, function(respuesta){\n\t\t\tnestedList = $('<ul class=\"plagas list-group\"/>').insertAfter(lista)\n\t\t\tfor (plaga in respuesta){\n\t\t\t\tnestedList.append($('<li class=\"list-group-item\">').append(\n\t\t\t\t\t$(`<div class=\"row ${respuesta[plaga].idPlaga}_${idpl}\"/>`).append(\n\t\t\t\t\t\t$('<span class=\"plagas col-10\">')\n\t\t\t\t\t\t\t.html(`<span class=\"texto\"> ${respuesta[plaga].nombreVulgar}<span/>\n\t\t\t\t\t\t\t <a href=\"${respuesta[plaga].uRL}\">${respuesta[plaga].uRL}<a/>`)\n\t\t\t\t\t).append(\n\t\t\t\t\t\t$(`<span class=\"material-icons col-2 btn btn-light ${respuesta[plaga].idPlaga}_${idpl}\">`).attr('id', `${respuesta[plaga].idPlaga}`).html(\"visibility\")\n\t\t\t\t)))\n\t\t\t\t$(`.${respuesta[plaga].idPlaga}_${idpl}`).children('.plagas').children('.texto')\n\t\t\t\t.easyTooltip({\n\t\t\t\t\tcontent: `<span>${respuesta[plaga].nombreCientifico}<span/>`\n\t\t\t\t});\n\t\t\t\n\t\t\t//esta funcion muestra el subarbol si no está visible o lo oculta si lo está\n\t\t\t$(`.btn.${respuesta[plaga].idPlaga}_${idpl}`).unbind(\"click\").click(function (){\n\t\t\tif($(this).hasClass(\"visible\")){\n\t\t\t\t$(this).removeClass(\"visible\");\n\t\t\t\t$(this).html(\"visibility\");\n\t\t\t\tdivUL =$(this).parent().parent().children('ul');\t\n\t\t\t\teliminarArbol(divUL)\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(this).addClass(\"visible\");\n\t\t\t\t$(this).html(\"visibility_off\");\n\t\t\t\tdivPadre =$(this).parent();\n\t\t\t\tid = $(this).attr('id');\n\t\t\t\tgenerarSustanciasActivas(divPadre,id);\t\t\t\t\n\t\t\t}\n\t\t})\n\t\t}\t\n\t\t})\n}", "title": "" }, { "docid": "e190c85893bcb97c29ed430643eec51c", "score": "0.59920216", "text": "function cambiar_estado_presupuesto_pendiente(idGenPresupuesto) {\n ////console.log(idGenPresupuesto);\n swal({\n type: 'question',\n text: '¿ Estás seguro que quieres cambiar el estado del presupuesto a Pendiente ?',\n showCancelButton: true,\n confirmButtonText: 'Si',\n showLoaderOnConfirm: true,\n preConfirm: (login) => {\n return fetch(URL + \"presupuesto/pendiente_presupuesto/\" + idGenPresupuesto)\n .then(response => {\n if (!response.ok) {\n throw new Error(response.statusText)\n }\n return response.json()\n })\n .catch(error => {\n swal.showValidationMessage(\n `Request failed: ${error}`\n )\n })\n },\n allowOutsideClick: () => !swal.isLoading()\n }).then((result) => {\n if (result.value) {\n var element = document.getElementById(\"btn\" + idGenPresupuesto);\n //--- anterior estado ---//\n element.classList.remove(\"btn-success\");\n element.classList.remove(\"btn-danger\");\n element.classList.remove(\"btn-info\");\n //--- nuevo estado ---//\n element.classList.add(\"btn-warning\");\n element.innerText = \"Pendiente\";\n //--- cambios de estados visibles ---//\n $(\"#pendiente\" + idGenPresupuesto).css(\"display\", \"none\");\n $(\"#enviar\" + idGenPresupuesto).css(\"display\", \"block\");\n $(\"#rechazar\" + idGenPresupuesto).css(\"display\", \"block\");\n $(\"#aceptado\" + idGenPresupuesto).css(\"display\", \"block\");\n swal(\n 'Presupuesto',\n 'El presupuesto fue cambiado a pendiente con exito',\n 'success'\n )\n }\n })\n}", "title": "" }, { "docid": "db0e98c512200e8079765ffd74718eeb", "score": "0.5990488", "text": "function mostrarCompras(yo){\n var checkbox;\n var txt;\n var div;\n\n var personaClicker = yo.parentNode.parentNode.getElementsByTagName(\"td\")[1];\n personaClicker = personaClicker.getElementsByTagName('input')[0].value;\n\n borrarModal();\n\n if(yo.id == \"activado\"){\n //Busca los datos de las compras desde el array de compras\n //Hace una lista conm checkboxes para seleccionar las compras\n for (var i = compras.length - 1; i >= 0; i--) {\n //div = document.createElement(\"div\");\n div = crearNodo(\"div\");\n //checkbox = document.createElement(\"input\");\n checkbox = crearNodo(\"input\");\n\n // Agrega el texto con \"compra ($precio)\" al checkbox\n txt = compras[i].producto;\n txt += \" ($\" + compras[i].precio + \")\";\n txt = document.createTextNode(txt);\n\n checkbox.type = \"checkbox\";\n checkbox.className = \"checkCompra\";\n checkbox.value = compras[i].producto; //No se bien por que hace esto\n\n //Checkear las compras que ya estan en el array de la persona\n checkbox.checked = esCompra(personaClicker, compras[i].producto);\n\n div.appendChild(checkbox);\n div.appendChild(txt); //Adiciona el texto al lado del checkbox con el nombre de la compra\n\n escribirModal(div);\n };\n\n var valor = 0;\n\n for (var i = personas.length - 1; i >= 0; i--) {\n if(personas[i].nombre == personaClicker){\n valor = personas[i].plataPuesta; \n }\n }\n\n //Al final de los checkboxes, mostrar el input de lo que ya puso\n //div = document.createElement(\"div\");\n div = crearNodo(\"div\");\n txt = document.createTextNode(\"Puso $\");\n /*\n var input = document.createElement(\"input\");\n input.className = \"modal-input\"\n */\n var input = crearNodo(\"input\", \"modal-input\");\n input.type = \"number\";\n if(valor>0){\n input.value = valor;\n }\n else{\n input.placeholder = valor;\n }\n div.appendChild(txt)\n div.appendChild(input);\n escribirModal(div);\n\n //Crea el boton para confirmar la seleccion de compras\n //var boton = document.createElement(\"input\");\n var boton = crearNodo(\"input\", \"modal-boton\");\n boton.type = \"button\";\n boton.value = \"OK\";\n\n\n boton.onclick = function() { \n actualizarPersona(personaClicker, yo);\n };\n setElementFooter(boton);\n setTextHeader(\"Compras\");\n setModoModal();\n mostrarModal();\n\n setUltimoBoton(yo);\n yo.id = \"desactivado\"; //Desactiva el boton para que no sea activado mas de una vez sin seleccionar compras\n }\n}", "title": "" }, { "docid": "a157787f3bcfa95558aa8700f890f247", "score": "0.5975773", "text": "function PrintReceSoli(code){\n\t///SaveSolucitud();\n\n\tsetTimeout(function(){\n\t\n\t/*$(\"#ImpReceSolicitud\").attr(\"title\",\"Receta\");\n\t$( \"#ImpReceSolicitud\" ).dialog({\n\t\t\tautoOpen: false,\n\t\t\tmodal: true,\n\t\t\theight:600,\n\t\t\twidth:1000,\n\t\t\tshow: {\n\t\t\t\teffect: \"blind\",\n\t\t\t\tduration: 1000\n\t\t\t},\n\t\t\thide: {\n\t\t\t\teffect: \"explode\",\n\t\t\t\tduration: 1000\n\t\t\t}\n\t\t});\n\t\t$( \"#ImpReceSolicitud\" ).dialog( \"open\" );\t*/\n\t\t$( \".modal-body\" ).html(\"<object type='text/html' data='../Reportes/RecetaSolicitudIn.php?id=\"+code+\"'></object>\");\n\n\t},1000);\t\n\n\n}", "title": "" }, { "docid": "c7607a82d627fe1be3a5bcc3997c3fff", "score": "0.5973559", "text": "function createPopUp(){\n\tvar isClicked = new Array();\n\tvar i = 0; //for array above\n\tvar j = 1; // for ids in html below\n\t$(function(){\n\t\t//If pop-ups must be visited, disable Next Button until all pop ups are viewed\n\t\t//console.log(shell.tracking.firstVisit);\n\t\tif (shell.tracking.firstVisit && popUp.isRequired) {\n\t\t\t//console.log(popUp.isRequired);\n\t\t\tdisableNav('next');\n\t\t\tsetPageVisit(false);\n\t\t};\n\t\t//then find each pop up trigger (what ever that trigger may be image, text, etc...) and make a dialog box\n\t\t$('[id^=\"trigger\"]').each(function() {\n\t\t\t//pass the trigger id and pop up id to the function below\n\t\t\tcreateDialog('#trigger'+j, '#popUp_'+j);\n\t\t\t//set the isClicked value to false to determine if all elemements have been viewed\n\t\t\tisClicked[i] = false;\n\t\t\t//$(this).attr('tabindex',1);\n\t\t\t//i++;\n\t\t\tj++;\n\t\t});\n\t\t//make a click event for each trigger\n\t\t$(function(){\n\t\t\t$('[id^=\"trigger\"]').click(function() {\n\t\t\t\tvar x = $('[id^=\"trigger\"]').index(this);\n\t\t\t\tshell.popUp.lastFocusEl = '#'+this.id;\n\t\t\t\t//change the isClicked value to true\n\t\t\t\tisClicked[x] = true;\n\t\t\t\tconsole.log('clicked '+x);\n\t\t\t\tpopUp.clickedArray = isClicked;\n\t\t\t\t//check if all have been completed to enable the next button\n\t\t\t\tif (popUp.isRequired) {\n\t\t\t\t\tif (popUp.extraCompleted) {\n\t\t\t\t\t\tcontentSwap.actionAlert = \"\";\n\t\t\t\t\t\tcheckClickCompletion(isClicked);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\t\t});\n\t});\n\t\n}", "title": "" }, { "docid": "105f4937e7350b58e6b72e628659e7df", "score": "0.5971201", "text": "dynamicView(type){\n var term = \"\"\n if(type == \"competence\"){term = \"Nouvelle\";}\n else if (type == \"objet\") {term = \"Nouvel\";}\n else { term = \"Nouveau\"; }\n var UI = this;\n // affichage d'un popup\n $.confirm({\n title: term + \" \" + type,\n type: 'green',\n theme: 'material',\n boxWidth: '80%',\n useBootstrap: false,\n content: '' +\n '<form action=\"\" class=\"formName\">' +\n '<div class=\"form-group\">' +\n '<label>Entrez le nom</label></br>' +\n '<input type=\"text\" placeholder=\"name\" class=\"name form-control\" required autofocus/>' +\n '</div>' +\n '</form>',\n buttons: {\n formSubmit: {\n text: 'Créer',\n btnClass: 'btn-green',\n action: function () {\n // callback apeler lors de l'apuis sur \"Créer\"\n // on recupere le nom\n var name = this.$content.find('.name').val();\n // on verifie le nom et compatible et qui n'existe pas deja\n if(!name){\n $.alert('Nom invalide');\n return false;\n }\n try {\n var n = $(\"#\"+name.replace(/ /g,'')).length;\n } catch (e) {\n var n = 1;\n }\n if(n){\n $.alert('Nom déjà utilisé');\n return false;\n }\n UI.addTab(name,type)\n }\n },\n cancel: {\n\t\t\t\t\ttext: 'Annuler',\n\t\t\t\t\tcancel: function () {\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n },\n onContentReady: function () {\n // bind to events\n var jc = this;\n this.$content.find('form').on('submit', function (e) {\n // if the user submits the form by pressing enter in the field.\n e.preventDefault();\n jc.$$formSubmit.trigger('click'); // reference the button and click it\n });\n }\n });\n }", "title": "" }, { "docid": "df03b24348942059579fbcc8457106fd", "score": "0.596925", "text": "function mostrarTarjetas(atletasArray){\n const divAtletas = document.getElementById(\"contenedorTarjetas\")\n divAtletas.innerHTML = '';\natletasArray.forEach((atleta) => {\n let divCardAtleta = document.createElement(\"div\");\n divCardAtleta.className = \"cardPersona\";\n let divImagenAtleta = document.createElement('div');\n divImagenAtleta.className = \"imagenAtleta\";\n let img = document.createElement('img');\n let randomNumber = Math.floor(Math.random() * 100);\n if (atleta.genero === 'M') {\n img.src = `https://randomuser.me/api/portraits/men/${randomNumber}.jpg`;\n }\n else {\n img.src = `https://randomuser.me/api/portraits/women/${randomNumber}.jpg`;\n }\n\n divAtletas.appendChild(divCardAtleta);\n divCardAtleta.appendChild(divImagenAtleta);\n divImagenAtleta.appendChild(img);\n\n var h3 = document.createElement(\"h3\");\n var pintarNombre = document.createTextNode(atleta.nombre);\n h3.appendChild(pintarNombre);\n divCardAtleta.appendChild(h3);\n\n var equipoAtleta = document.createElement(\"p\");\n var pintarEquipo = document.createTextNode(\"Equipo: \"+(atleta.equipo));\n equipoAtleta.appendChild(pintarEquipo);\n divCardAtleta.appendChild (equipoAtleta);\n\n var edadAtleta = document.createElement(\"p\");\n var pintarEdad = document.createTextNode(\"Edad: \"+ (atleta.edad));\n edadAtleta.appendChild(pintarEdad);\n divCardAtleta.appendChild(edadAtleta);\n\n var deporteAtleta = document.createElement(\"p\");\n var pintarDeporte= document.createTextNode(\"Deporte: \"+(atleta.deporte));\n deporteAtleta.appendChild(pintarDeporte);\n divCardAtleta.appendChild(deporteAtleta);\n \n var medallaAtleta = document.createElement(\"p\");\n var pintarMedalla= document.createTextNode(\"Medalla: \"+(atleta.medalla));\n medallaAtleta.appendChild(pintarMedalla);\n divCardAtleta.appendChild(medallaAtleta);\n});\n}", "title": "" }, { "docid": "b0cde853c4c924e0b3fc5b53df5f4beb", "score": "0.59659564", "text": "function crearVentanaServicios(){\r\n \r\n crearArbol();\r\n winServicios= new Ext.Window({\r\n modal: true,\r\n closeAction:'hide',\r\n layout:'fit',\r\n closable:false,\r\n title:perfil.etiquetas.lbVentanaServicio,\r\n width:300,\r\n height:300,\r\n resizable:false,\r\n \r\n buttons:[\r\n {\r\n icon:perfil.dirImg+'cancelar.png',\r\n iconCls:'btn',\r\n id:'estcan',\r\n text:perfil.etiquetas.lbBtnCancelar,\r\n handler:function(){ \r\n arbolServicio.collapseAll(); \r\n winServicios.hide();\r\n idnodo=0;\r\n \r\n }\r\n },\r\n {\r\n icon:perfil.dirImg+'aceptar.png',\r\n iconCls:'btn',\r\n id:'estacept',\r\n handler:function(){\r\n \r\n if(idnodo!=0 && tipoDato=='cadena'){\r\n campo.setValue(arbolServicio.getNodeById(idnodo).attributes.text);\r\n \r\n arbolServicio.collapseAll();\r\n \r\n winServicios.hide(); \r\n idnodo=0; \r\n }else if(idnodo!=0 && tipoDato=='numerico'){\r\n campo.setValue(arbolServicio.getNodeById(idnodo).attributes.id); \r\n \r\n arbolServicio.collapseAll();\r\n winServicios.hide();\r\n idnodo=0;\r\n \r\n }else{\r\n mostrarMensaje(1,perfil.etiquetas.MsgInfArbolServ);\r\n }\r\n \r\n },\r\n text:perfil.etiquetas.lbBtnAceptar\r\n }]\r\n });\r\n arbolServicio.collapseAll(); \r\n winServicios.add(panelServicios);\r\n winServicios.doLayout();\r\n winServicios.show();\r\n \r\n }", "title": "" }, { "docid": "7810ad849bafd7cc6c3b03766982ab47", "score": "0.5965421", "text": "function retrocederEjercicio() {\n\tlet nropaso = pasoActual;\n\tlet nropasoanterior = parseInt(nropaso) - parseInt(1);\n\tvar textopaso = cuento.pasos[parseInt(nropaso) - parseInt(2)]; //vuelvo 2 para atras porque la cuenta arranca en 0 , tengo un desplazamiento\n\n\tif (nropaso == '1') {\n\t\tSwal.fire({\n\t\t\twidth: 400,\n\t\t\timageWidth: 200,\n\t\t\timageHeight: 300,\n\t\t\tbackground: '#e4f2f0',\n\t\t\ttitle: 'Es el paso inicial , no se puede volver',\n\t\t\tshowConfirmButton: false,\n\t\t\ttimer: 1000\n\t\t});\n\t} else {\n\t\tcambiarFondo(nropasoanterior); //cambio el fondo al fondo correspondiente al paso anterior\n\t\tdocument.getElementById('contenedortexto').innerHTML = textopaso;\n\t\tpasoActual = nropasoanterior;\n\t}\n\n\tvar faseActual = faseActualCuento;\n\tif (faseActual == 'Ejercitacion') {\n\t\tiniciarEjercicio();\n\t}\n}", "title": "" }, { "docid": "006843fb6d6e7b34e060ff0bf085e428", "score": "0.5962832", "text": "mostrarPeliculas(peliculas){\n //Leer las peliculas y agregarlas a una variable\n const listaPeliculas = peliculas.results;\n \n //Recorrer las peliculas y crear el Template\n listaPeliculas.forEach(pelicula => {\n this.listado.innerHTML += `\n <div class=\"col-md-4 mb-4\">\n <div class=\"card\">\n <div class=\"card-body centrar\">\n <img class=\"img-responsive mb-2\" src=\"https://image.tmdb.org/t/p/w200${pelicula.poster_path}\">\n </div>\n <div class=\"card-body\">\n <div class=\"card-text\">\n <h2 class=\"text-center\">${pelicula.title}</h2>\n <p class=\"lead text-info\">Sinopsis</p>\n <p>${pelicula.overview.substring(0,280)}...</p>\n <span class=\"badge badge-secondary\">Idioma Original: ${pelicula.original_language}</span>\n <span class=\"badge badge-primary\">Año de Estreno: ${pelicula.release_date}</span>\n </div>\n </div>\n </div>\n </div>\n `;\n })\n }", "title": "" }, { "docid": "37b2ec6e1168f5f1c22be2c9d9fd1e34", "score": "0.59620965", "text": "function mostrarContenido() {\n var html = '';\n var textos = pokemon_seleccionado.datos.flavor_text_entries.filter((obj) => {\n return obj.language.name == 'es';\n })\n html += `<p>${textos[0].flavor_text}</p>\n <div class=\"row\">\n <div class=\"col-xs-4 blue\">\n Altura: <br/>\n <span id=\"altura\"></span> <br/>\n </div>\n <div class=\"col-xs-7 blue\">\n Categoría: <br/>\n <span id=\"categoria\"></span> <br/>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-4 blue\">\n Peso: <br/>\n <span id=\"peso\"></span> <br/>\n </div>\n <div class=\"col-xs-7 blue\">\n Habilidad: <br/>\n <span id=\"habilidad\"></span> <br/>\n </div>\n </div>\n `;\n $('#modal_contenido').html(html);\n ajaxPokemonDetalle(pokemon_seleccionado.id);\n}", "title": "" }, { "docid": "3cc38c3171f7d7225917f9178fe5fb49", "score": "0.5961413", "text": "function showProductions(){\n\n\tvar cookieExist = getCookie(\"userName\");\n\n\tvar show = document.getElementById(\"Nombre\");\n\tshow.innerHTML = \"Producciones\";\n\n\tvar contentP = document.getElementById(\"principal\");\n\tcontentP.setAttribute(\"class\",\"row\");\n\n\twhile (contentP.firstChild) {\n\tcontentP.removeChild(contentP.firstChild);\n\t}\n\n\tif (cookieExist !== \"\") {\n\t\t\n\t\tvar columN = document.createElement(\"div\");\n\t\tcolumN.setAttribute(\"class\",\"col-6 col-md-4 mb-4\");\n\t\tvar contentN = document.createElement(\"div\");\n\t\tcontentN.setAttribute(\"class\",\"card\");\n\t\tvar image = document.createElement(\"img\");\n\t\timage.setAttribute(\"class\",\"card-img-top\");\n\n\t\timage.setAttribute(\"src\",\"img/producciones.jpg\");\n\t\timage.setAttribute(\"alt\",\"Gestionar Producciones\");\n\n\t\tvar body = document.createElement(\"div\");\n\t\tbody.setAttribute(\"class\",\"card-body\");\n\t\tvar paragraph = document.createElement(\"h5\");\n\t\tparagraph.setAttribute(\"class\",\"card-text font-weight-bold\");\n\t\tparagraph.setAttribute(\"style\",\"max-height:45px; overflow:hidden; min-height:45px\");\n\t\tvar text = document.createTextNode(\"Gestionar producciones\");\n\t\tparagraph.appendChild(text);\n\n\t\tvar divbuttons = document.createElement(\"div\");\n\t\tdivbuttons.setAttribute = (\"class\",\"d-flex justify-content-between\");\n\n\t\tvar button1 = document.createElement(\"button\");\n\t\tbutton1.setAttribute(\"class\",\"btn btn-primary\");\n\t\tbutton1.setAttribute(\"id\",\"buttonC\");\n\t\tbutton1.setAttribute(\"type\",\"button\");\n\t\tbutton1.setAttribute(\"value\",\"\");\n\t\tvar textB = document.createTextNode(\"Gestionar\");\n\t\tbutton1.appendChild(textB);\n\t\t\n\t\tcontentP.appendChild(columN);\n\t\tcolumN.appendChild(contentN);\n\t\tcontentN.appendChild(body);\n\t\tbody.appendChild(image);\n\t\tbody.appendChild(paragraph);\n\t\tbody.appendChild(divbuttons);\n\t\tdivbuttons.appendChild(button1);\n\n\t\tbutton1.addEventListener(\"click\",formProduction);\n\n\t}\n\n\tvar request = indexedDB.open(nameDB);\n\n request.onsuccess = function(event) {\n\n var db = event.target.result; \n var objectStore = db.transaction([\"producciones\"],\"readonly\").objectStore(\"producciones\");\n //Abre un cursor y reccorre los datos devueltos \n objectStore.openCursor().onsuccess = function(event) {\n \n var production = event.target.result;\n\n if (production) {\n\n\t\t\t\tvar colum = document.createElement(\"div\");\n\t\t\t\tcolum.setAttribute(\"class\",\"col-6 col-md-4 mb-4\");\n\t\t\t\tvar content = document.createElement(\"div\");\n\t\t\t\tcontent.setAttribute(\"class\",\"card\");\n\t\t\t\tvar image = document.createElement(\"img\");\n\t\t\t\timage.setAttribute(\"class\",\"card-img-top\");\n\n\t\t\t\timage.setAttribute(\"src\",production.value.image);\n\t\t\t\timage.setAttribute(\"alt\",production.value.title);\n\n\t\t\t\tvar body = document.createElement(\"div\");\n\t\t\t\tbody.setAttribute(\"class\",\"card-body\");\n\t\t\t\tvar paragraph = document.createElement(\"p\");\n\t\t\t\tparagraph.setAttribute(\"class\",\"card-text font-weight-bold\");\n\t\t\t\tparagraph.setAttribute(\"style\",\"min-height:45px ; max-height:45px ; overflow:hidden\");\n\t\t\t\tvar text = document.createTextNode(production.value.title);\n\t\t\t\tparagraph.appendChild(text);\n\n\t\t\t\tvar button = document.createElement(\"button\");\n\t\t\t\tbutton.setAttribute(\"class\",\"btn btn-primary\");\n\t\t\t\tbutton.setAttribute(\"id\",\"buttonC\");\n\t\t\t\tbutton.setAttribute(\"type\",\"button\");\n\t\t\t\tbutton.setAttribute(\"value\",production.value.title);\n\t\t\t\tvar textB = document.createTextNode(\"Ver Produccion\");\n\t\t\t\tbutton.appendChild(textB);\n\t\t\t\t\t\t\n\t\t\t\tcontentP.appendChild(colum);\n\t\t\t\tcolum.appendChild(content);\n\t\t\t\tcontent.appendChild(body);\n\t\t\t\tbody.appendChild(image);\n\t\t\t\tbody.appendChild(paragraph);\n\t\t\t\tbody.appendChild(button);\n\n\t\t\t\tbutton.addEventListener(\"click\",showProductionAlone);\n\t\t\t\tproduction.continue();\n }\n }\n }\n\t\n}", "title": "" }, { "docid": "4bcb9b13970eafb3cb0eea9e0eb83f83", "score": "0.59596413", "text": "function agregar(cla) {\n\n /*\n var nuevo = document.createElement(\"tr\");\n nuevo.className=cla;\n */\n\n var nuevo = crearNodo(\"tr\", cla);\n\n //Si quiero agregar una compra, lo agreago a la pagina 1\n if(cla == \"compra\"){\n nuevo.innerHTML = primerCampoCompra;\n document.getElementById(\"page1\").getElementsByTagName(\"tbody\")[0].appendChild(nuevo); \n }\n\n //Si es una persona, a la pagina 2\n if(cla == \"persona\"){\n nuevo.innerHTML = primerCampoPersona;\n document.getElementById(\"page2\").getElementsByTagName(\"tbody\")[0].appendChild(nuevo); \n\n //Activa el boton de seleccion de compras para ser usado\n //Esto va a cambiar con el uso de \"modals\" (para mostrar las compras en una ventana)\n var td = document.getElementById(\"page2\").getElementsByTagName(\"tr\");\n td = td[td.length - 1];\n td = td.getElementsByTagName(\"td\");\n td = td[td.length - 1];\n td = td.lastChild;\n td.id = \"activado\";\n }\n}", "title": "" }, { "docid": "ab39895c3ff135536579a18293b9bde6", "score": "0.59563", "text": "function BCreateEstructura() {\n formularioOff();\n document.getElementById(\"overlayAporteCCG\").style.display = \"none\";\n document.getElementById(\"overlayMGrups\").style.display = \"none\";\n document.getElementById(\"overlayINBOX\").style.display = \"none\";\n document.getElementById(\"overlayParticipacion\").style.display = \"none \";\n document.getElementById(\"overlayNN\").style.display = \"none\";\n document.getElementById(\"overlayZonasRamas\").style.display = \"none\";\n document.getElementById(\"overlayConsultarNodo\").style.display = \"none\";\n\n\n\n\n\n document.getElementById(\"overlayAgregarMiembro\").style.display = \"none\";\n document.getElementById(\"overlayMovimiento\").style.display = \"none\";\n document.getElementById(\"overlayConsultasVarias\").style.display = \"none \";\n document.getElementById(\"overlayConformarCoordinacion\").style.display = \"none \";\n document.getElementById(\"overlayAsignarMonitor\").style.display = \"none \";\n document.getElementById(\"overlayAdmMiembros\").style.display = \"none \";\n document.getElementById(\"overlayCrearGrupo\").style.display = \"none \";\n document.getElementById(\"overlayCrearESt\").style.display = \"block \";\n document.getElementById(\"overlayBandejaAporte\").style.display = \"none\";\n powerfulErase();\n\n}", "title": "" }, { "docid": "382d76753cc985ecae594aa278628c8f", "score": "0.59555423", "text": "function visualizaRegistro(i) {\n Swal.fire({\n width: 500,\n height: 600,\n title: '<strong> ID: '+lista[i].id+' | '+lista[i].titulo+'</strong>',\n type: 'info',\n html:HTMLtoString(i),\n showCloseButton: true,\n focusConfirm: false,\n confirmButtonText:'FECHAR',\n })\n}", "title": "" }, { "docid": "c687161e6f881176433d92f006dd33ac", "score": "0.59525084", "text": "function displayMessagePagos(evt) {\n console.log(\"PAGOS-LISTENER: \" + evt.data);\n if (evt.data == \"MOSTRAR-CONSTANCIA\") {\n $('#myModal25').modal('hide'); //panel de pagos.html\n $('#btnPaso04').trigger('click'); //evento de carrito.js\n }\n else if (evt.data == \"PAGOS-REINTENTAR-OPERACION\") {\n $('#myModal25').modal('hide'); //ocultar panel de progreso\n $('#modalReintentarPago').modal('show');\n }\n else if (evt.data.indexOf(\"PAGOS-REINTENTAR-OPERACION-\") == 0) {\n $('#myModal25').modal('hide'); //ocultar panel de progreso\n console.log(\"displayMessagePagos:\" + evt.data);\n $(\"span.titleMensajeReintentarPago\").text(evt.data.substring(27, evt.data.length));\n $('#modalReintentarPago').modal('show');\n }\n else if (evt.data == \"MOSTRAR-ERROR-SERVIDOR\") {\n $('#myModal25').modal('hide'); //panel de pagos.html\n $('#modalErrorSinServicio').modal('show');\n }\n else if (evt.data == \"MOSTRAR-MODAL-PRESENTE-PAGUE\") {\n $(\"#modalPresentePague\").modal('show');\n }\n else if (evt.data.indexOf(\"PAGO-VISA-OK-\") == 0) {\n console.log(\"displayMessagePagos:\" + evt.data);\n var numIntOpe = evt.data.substring(13, evt.data.length);\n var constanciaRespuesta;\n constanciaRespuesta = comunServiciosBandeja.obtenerResultadoPagoRedis(numIntOpe);\n $(\"#modalPresentePague\").modal('hide');\n registraConstanciaPagoVisa(constanciaRespuesta);\n $('#myModal25').modal('hide'); //panel de pagos.html\n $('#btnPaso04').trigger('click'); //evento de carrito.js\n }\n else if (evt.data == \"PAGO-VISA-ERROR\") {\n $(\"#modalPresentePague\").modal('hide');\n }\n}", "title": "" }, { "docid": "9f7d0a3cd0e3ab7cfea73a0fe96998c0", "score": "0.5952391", "text": "function pagarEnCaja() {\n\n pantallaActual = \"pagar caja\";\n\n $(\"#divBack\").html('<div onclick=\"opcionesPago()\"><div class=\"ui-grid-b\"><div class=\"ui-block-a\" style=\"width: 10%;\"><span class=\"flaticon-leftarrow\" style=\"font-size:8px;float:left;text-transform:uppercase;\"></span></div><div class=\"ui-block-b\" style=\"width: 90%;\"><label style=\"font-weight: bold;\">Opciones de pago</label></div></div></div>');\n\n var html = '<div>' +\n '<center>' +\n '<h3 style=\"text-transform: uppercase;color:#0197d4;\">' + jsonIdiomas.pan_pago_tienda.tl_tienda + '</h3>' +\n '<br>' +\n '<a data-corners=\"false\" style=\"width:35%\" onclick=\"sendEmail();\" data-role=\"button\" data-icon=\"mail\" data-iconpos=\"right\" data-theme=\"b\">' + jsonIdiomas.pan_pago_tienda.envio_email + '</a>' +\n '<br>' +\n '<a data-corners=\"false\" style=\"width:35%\" onclick=\"imprimirPedido();\" data-role=\"button\" data-icon=\"home\" data-iconpos=\"right\" data-theme=\"b\">' + jsonIdiomas.pan_pago_tienda.imprimir + '</a>' +\n '<br>' +\n //'<a data-corners=\"false\" style=\"width:300px\" onclick=\"pedidoOnline();\" data-role=\"button\" data-icon=\"shop\" data-iconpos=\"right\" data-theme=\"b\"> Pedido online </a>' +\n //'<br>' +\n //'<a data-corners=\"false\" style=\"width:300px\" onclick=\"$(\\'#popupConfirmacionCancelarPedido\\').popup(\\'open\\');\" data-role=\"button\" data-icon=\"delete\" data-iconpos=\"right\" data-theme=\"b\"> Cancelar pedido </a>' +\n '<div class=\"ui-grid-a\" style=\"width:41%;background-color:#dd3324;margin: 1% 0 0 0;\" onclick=\"$(\\'#popupConfirmacionCancelarPedido\\').popup(\\'open\\');\"><div class=\"ui-block-a\" style=\"width: 90%;height: 45px;color:white;text-transform: uppercase;line-height: 45px;\">' + jsonIdiomas.pan_pago_tienda.cancelar + '</div><div class=\"ui-block-b\" style=\"width: 10%;height: 45px;\"><img src=\"http://partyfiesta.youtter.com/app/alb/img/X.png\" style=\"width: 45px;\"></div></div>' +\n '</center>' +\n '</div>';\n $(\"#divContent\").html(html);\n $(\"#divContent\").trigger('create');\n}", "title": "" }, { "docid": "2fe01d2dcf75d2afb9c026cb509af1e2", "score": "0.59505165", "text": "function mostrarActividad(data){\n\tif(data.id_img == \"exit\"){\n\t\twindow.location = \"../menu_ninos_lenguaje.php\";\n\t}\n\t\n\t//Recivimos las respuestas del Controlador\n\tid_img = data.id_img;\n\timagen = data.direccion;\n\taudio = data.audio;\n\tlng_sena = data.lng_sena;\n\tpregunta = data.pregunta;\n\n\t//Descomponemos la palabra\n\tvar descomponer = pregunta.split(\"\");\n\t//Guardamos la primera letra\n\tprimera_letra = descomponer[0];\n\t//Declaramos una variable palabra que servira para colocar la interrogante de la actividad\n\t//Tendra como valor principal \"_\" ya que no mostraremos la primera letra\n\tvar palabra = \"?\";\n\n\t//Hacemos el llamado a letraAleatorias, para mostrar letras al azar\n\tvar letras = letrasAleatorias(primera_letra);\n\n\t//Asignamos la palabra descompuesta a la variable palabra, sin la primera letra\n\tfor(var i = 1; i < descomponer.length; i++){\n\t\tpalabra += descomponer[i];\t\t\n\t}\n\n\t//Limpiamos los elementos\n\t$(\".preg-actividad-1 p\").remove();\n\t$(\".resp-actividad-1 button\").remove();\n\n\t//Mostramos en pantalla\n\t$(\"#img-cargar\").attr(\"src\", imagen);\n\t$(\"#tocar-audio\").attr(\"src\", audio);\n\n\t$(\".preg-actividad-1\").append(\"<p>\"+palabra+\"</p>\");\n\t\n\tfor(var i = 0; i < letras.length; i++){\n\t\t$(\".resp-actividad-1\").append(\"<button class='boton-letra'>\"+letras[i]+\"</button>\");\n\t}\n\n\t//Guardamos en la variable global el codigo de la primera letra\n\t//para comprar con el evento letra()\n\tprimera_letra = primera_letra.charCodeAt();\n}", "title": "" }, { "docid": "3bf8fe85055560933a8e3eddcb333106", "score": "0.5947044", "text": "function finalizar(){\n//alert('q');\n if(canasto.length==0){\n alert('Su pedido no contiene elementos por procesar');\n }\n else{\n//var contiene=\"Descripción--Cantidad--Precio</br>\";\n//for(var i=0;i<canasto.length;i++){\n//contiene+=canasto[i].nombre+\"--\"+canasto[i].cantidad+\"--\"+canasto[i].precio+\"<br/>\";\n//}\n $(\"ventanaModal\").style.visibility=\"visible\";\n//$(\"listadoprod\").innerHTML=contiene;\n }\n}", "title": "" }, { "docid": "d8aa9088b31746cba6d80fb62b3a11d5", "score": "0.594258", "text": "expansionPage() {\r\n //scroll page back up to wheree dialog opens\r\n document.documentElement.scrollTop = 650;\r\n document.body.scrollTop = 650;\r\n //create dialog and append\r\n let newDialog = document.createElement('dialog')\r\n document.getElementById('startCatalogueDiv').appendChild(newDialog)\r\n //assign class and id\r\n newDialog.className = 'dialog';\r\n newDialog.id = this.id + '_dialog';\r\n //add in dialog content\r\n //divs for bootstrap grid\r\n let newDivRow = document.createElement('div')\r\n let newDivCol1 = document.createElement('div')\r\n let newDivCol2 = document.createElement('div')\r\n newDivRow.className = 'row'\r\n newDivCol1.className = 'col-lg-6'\r\n newDivCol2.className = 'col-lg-6'\r\n //add grid divs into dialog\r\n newDialog.appendChild(newDivRow)\r\n newDivRow.appendChild(newDivCol1)\r\n newDivRow.appendChild(newDivCol2)\r\n //h1\r\n let newH1 = document.createElement('h1')\r\n newH1.innerText = (this.name)\r\n newH1.className = 'display-5'\r\n newDivCol1.appendChild(newH1)\r\n //img\r\n let newImg = document.createElement('img');\r\n newImg.src = this.image;\r\n newImg.className = 'img_dialog';\r\n newDivCol1.appendChild(newImg);\r\n //p\r\n let newP = document.createElement('p')\r\n newP.innerText = (`Picture frames not only define the personality of the house, but they also depict the aesthetic sense of the people living in that house. The kind of art that you put up will describe your knowledge of creativity. Hence picture frames are an essential part of the interior design of the property.`)\r\n newDivCol2.appendChild(newP)\r\n //h2\r\n let newH2 = document.createElement('h2')\r\n newH2.innerText = (`R ${this.price}.00 (A5)`)\r\n newH2.className = 'display-6'\r\n newH2.id = this.price\r\n newDivCol2.appendChild(newH2)\r\n //form\r\n let newForm = document.createElement('form')\r\n newDivCol2.appendChild(newForm)\r\n let newNumInput = document.createElement('input')\r\n newNumInput.type = 'number'\r\n newNumInput.value = 1\r\n newNumInput.min = 1\r\n newNumInput.id = 'qtyInput'\r\n newNumInput.placeholder = 'Qty'\r\n newForm.appendChild(newNumInput)\r\n //select for frame size\r\n let newSelectSizes = document.createElement('select')\r\n newSelectSizes.name = 'selectSizes'\r\n let newLabelSize = document.createElement('label')\r\n newLabelSize.for = 'selectSizes'\r\n newLabelSize.id = 'selectSizes'\r\n newLabelSize.innerText = 'Size'\r\n newForm.appendChild(newLabelSize)\r\n newForm.appendChild(newSelectSizes)\r\n //iterate through sizes array to make an option for each color\r\n for (let element of sizes) {\r\n let newOption = document.createElement('option')\r\n newOption.value = element\r\n newOption.innerText = element\r\n newSelectSizes.appendChild(newOption)\r\n }\r\n //select for frame color\r\n let newSelectColors = document.createElement('select')\r\n newSelectColors.name = 'selectColors'\r\n let newLabelColor = document.createElement('label')\r\n newLabelColor.for = 'selectColors'\r\n newLabelColor.id = 'selectColors'\r\n newLabelColor.innerText = 'Color'\r\n newForm.appendChild(newLabelColor)\r\n newForm.appendChild(newSelectColors)\r\n for (let element of colors) {\r\n let newOption2 = document.createElement('option')\r\n newOption2.value = element\r\n newOption2.innerText = element\r\n newSelectColors.appendChild(newOption2)\r\n }\r\n //addToCartBtn\r\n let addToCartBtn = document.createElement('button')\r\n addToCartBtn.innerText = 'Add To Cart';\r\n addToCartBtn.id = 'addToCartBtn'\r\n newDivCol2.appendChild(addToCartBtn);\r\n addToCartBtn.addEventListener('click', addProductToCart)\r\n //give dialog a close button\r\n let newButton = document.createElement('button');\r\n newDialog.appendChild(newButton);\r\n newButton.className = 'closeButton'\r\n newButton.id = 'closeBtn'\r\n newButton.innerText = 'x';\r\n newButton.addEventListener('click', function () {\r\n newDialog.remove();\r\n })\r\n }", "title": "" }, { "docid": "37a1d13886e7f615e60133c855b30e50", "score": "0.59412295", "text": "function mostrarPacientes() {\n // Oculto las alertas\n $(\"#alerta\").hide();\n if (window.localStorage.getItem('login') == \"true\") {\n\n // Al cerrar la alerta recarga la pag\n $(\"#cierre-modal-info\").on(\"click\", function() {\n location.reload();\n });\n\n // Menu lateral\n $('#sidebarCollapse').on('click', function() {\n $('#sidebar').toggleClass('active');\n });\n\n //Boton agregar nuevo paciente\n $(\".agregarNuevoPaciente\").on('click', agregarPaciente);\n\n //Boton agregar nuevo Especialista\n $(\".agregarNuevoEspecialista\").on('click', agregarEspecialista);\n\n // Click salir\n $(\"#btn-sign-out\").on('click', cerrarSesion);\n\n //Boton ayuda con referencia colores\n $(\"#ayuda-pacientes\").on('click', function() {\n $(\"#modalAyudaPacientes\").modal('show');\n });\n\n // Carga la tabla\n mostrarTabla();\n // Buscador pacientes:\n habilitarBuscadorPacientes();\n } else {\n $('#sidebar').toggleClass('active');\n $(\"#modalAlerta\").modal('show');\n setTimeout(function() {\n window.location.href = \"./index.html\";\n }, 3200);\n }\n}", "title": "" }, { "docid": "570dcc463b3f77147d80dd29b2debfd7", "score": "0.59380454", "text": "dialogAvisoSeven(attCont,arrFil,arrAtr,arrBut){/* avisoCuatro.css*/\n\t\tconst chidrs = new Array();\n\t\tlet saRowCu,txt,indice,but,col,fragmento;\n\t\tfor(let i=0;i<arrFil.length+2;i++){\n\t\t\tsaRowCu = document.createElement('div');\n\t\t\tarrAtr[0].forEach(item =>{saRowCu.setAttribute(item[0],item[1]);});\n\t\t\tchidrs.push(saRowCu);\n\t\t}\n\t\tconst cnclBtn = document.createElement('button');\n\t\tcnclBtn.setAttribute('class','cnclBtn');\n\t\tcnclBtn.setAttribute('id','cnclBtn');\n\t\ttxt = document.createTextNode('X');\n\t\tcnclBtn.appendChild(txt);\n\t\tchidrs[0].appendChild(cnclBtn);\n\t\tarrFil.forEach((item,index,array)=>{\n\t\t\tfragmento = document.createDocumentFragment();\n\t\t\titem.forEach(it => {\n\t\t\t\tcol = document.createElement('div');\n\t\t\t\tarrAtr[1].forEach(it =>{col.setAttribute(it[0],it[1]);});\n\t\t\t\tcol.appendChild(it);\n\t\t\t\tfragmento.appendChild(col);\n\t\t\t});\n\t\t\tindice = index+1;\n\t\t\tchidrs[indice].appendChild(fragmento);\n\t\t});\n\t\tindice++;\n\t\tfragmento = document.createDocumentFragment();\n\t\tarrBut.forEach(item =>{\n\t\t\tbut = document.createElement('button');\n\t\t\tbut.setAttribute('class',item[1]);\n\t\t\tbut.setAttribute('id',item[2]);\n\t\t\ttxt = document.createTextNode(item[0]);\n\t\t\tbut.appendChild(txt);\n\t\t\tcol = document.createElement('div');\n\t\t\tarrAtr[1].forEach(it =>{col.setAttribute(it[0],it[1]);});\n\t\t\tcol.appendChild(but);\n\t\t\tfragmento.appendChild(col);\n\t\t})\n\t\tindice++;\n\t\tchidrs[indice].appendChild(fragmento);\n\t\tconst formOne = document.createElement('form');\n\t\tformOne.setAttribute('class',attCont[1][0]);\n\t\tformOne.setAttribute('id',attCont[1][1]);\n\t\tchidrs.forEach((item,index,array)=>{\n\t\t\t\tformOne.appendChild(item);\n\t\t});\n\t\tconst avisTwo = document.createElement('div');\n\t\tavisTwo.setAttribute('class',attCont[0][0]);\n\t\tavisTwo.setAttribute('class',attCont[0][1]);\n\t\tavisTwo.appendChild(formOne);\n\t\treturn avisTwo;\n\t}", "title": "" }, { "docid": "0a061be9dff5c137e3c2a09632e9b6f4", "score": "0.59358823", "text": "function fecharPopUp(){\n //Após o $ é o id ou a classe na qual se deseja implementar uma função css\n //No .css é implementada o comando css dentro do {}\n $('#fundo_transparente').css({\"display\":\"none\"});\n $('#div_foraCadastro').css({\"display\":\"none\"});\n $(\"#div_mostrarImagem\").css({\"display\":\"none\"});\n}", "title": "" }, { "docid": "434c3150ee19feb2609e817301470739", "score": "0.5935331", "text": "function displayMessageForm0626(evt) {\n\n if (evt.data == \"DESACTIVAR-PANEL-PRESENTARPAGAR\") {\n $('#myModal-40').modal('hide');\n }\n if (evt.data == \"EDITAR-0626\") {\n console.log(\"WebMessage, edicion estando en el mismo formulario\");\n var dataJson = comunBandeja.getKeyDataStorage(\"SUNAT.Edicion.Formulario0626.Data\");\n if (dataJson!=\"\") {\n var dataJsonParse = JSON.parse(dataJson);\n casillasEditarBandeja(dataJsonParse);\n }\n }\n if (evt.data == \"PAGAR-DESDE-BANDEJA\") {\n var montoPagar = comunBandeja.obtenerTotalaPagar();\n\n if (montoPagar != -1) {\n if (montoPagar > 0) {\n comunLibreria.cambiarTextoBontonesModalPresentarPagar(\"SI\", \"NO\");\n comunLibreria.mostrarModalPresentarPagar(comunMensajes.getMensaje(\"INFNPS\", \"\"));\n }\n else {\n comunLibreria.cambiarTextoBontonesModalPresentarPagar(\"ACEPTAR\", \"CANCELAR\");\n comunLibreria.mostrarModalPresentarPagar(comunMensajes.getMensaje(\"INFNPSCERO\", \"\"));\n }\n }\n }\n}", "title": "" }, { "docid": "98957f55ba99f73760410ec0af19d88c", "score": "0.59318763", "text": "function abrirPopup(){\n\t$('.' + $(this).data('modal')).css('display','flex');\n\t$('[data-modal-close], .mask').click(function() {\n\t\tfecharPopup();\n\t});\n\tabrirMascara();\n}", "title": "" }, { "docid": "efc682926dd3985ca112e31bed8a520a", "score": "0.593021", "text": "function FrmAusentismo() {\n PopupPosition();\n $.ajax({\n type: \"post\",\n url: urlBase + urlAusencias + '/RegistrarNuevaAusencia'\n }).done(function (response) {\n if (response != undefined && response != '' && response.Mensaje == 'Success') {\n $('#datosAusentismo').empty();\n $('#datosAusentismo').html(response.Data);\n }\n OcultarPopupposition();\n }).fail(function (response) {\n swal(\"Atención\", \"No se logró consultar la información del Trabajador. Intente más tarde.\");\n OcultarPopupposition();\n });\n }", "title": "" }, { "docid": "51089c7075462390e50983a0c0eaf098", "score": "0.5922694", "text": "function agregarPaciente() {\n resetFormulario();\n document.getElementById(\"dni\").removeAttribute(\"disabled\");\n document.getElementsByClassName(\"btn-form\")[0].innerText = \"AGREGAR\";\n document.getElementById(\"titulo-nuevo-paciente\").innerText = \" Crear nuevo paciente\";\n $(\"#modalNuevoPaciente\").modal('show');\n recolectarDatosPaciente()\n .then((respuesta) => {\n postNuevo(\"PACIENTE\", respuesta)\n .then(resp => {\n new Alerta(`Se creo el paciente con éxito!`, `Nuevo Paciente`).mostrar();\n mostrarTabla();\n })\n .catch(err => {\n new Alerta(err, `Nuevo Paciente`).mostrar();\n });\n })\n .catch((error) => {\n (new Alerta(error, \"Nuevo Paciente\")).mostrar();\n }); // No debería entrar acá porque no reject la promesa.\n}", "title": "" }, { "docid": "b25ad5b95fed7020dc5aa97a763bec83", "score": "0.5922529", "text": "function popupAddingAuthor() {\r\n // ====== Draw hide layout\r\n $(\"#hide-layout\").show().unbind().click(function() {\r\n $(\"#hide-layout\").hide();\r\n $(\"#popup\").hide();\r\n });\r\n\r\n // ====== Draw modal window\r\n var popup = $(\"<div>\").attr(\"id\", \"popup\").addClass(\"popup\");\r\n var popupTitle = $(\"<h2>\").addClass(\"popup-title\").text(\r\n jQuery.i18n.prop(\"news.modal_adding_author\"));\r\n var popupContent = $(\"<div>\").addClass(\"popup-content\");\r\n\r\n var selectMultiplyElement = $(\"<select multiple>\").addClass(\r\n \"multiple-element\");\r\n var multipleContainer = $(\"<div>\").addClass(\"multiple-container\");\r\n\r\n var creatingAuthorContainer = $(\"<div>\").addClass(\r\n \"creating-author-container\");\r\n var inputAuthor = $(\"<input>\").attr(\"type\", \"text\")\r\n .addClass(\"input-author\");\r\n var btnCreateAuthor = $(\"<button>\").addClass(\"btn-add-author\").text(\r\n jQuery.i18n.prop(\"news.add_author\")).unbind().click(function() {\r\n createNewAuthor();\r\n });\r\n var labelErrorAuthor = $(\"<label>\").addClass(\"error-new-author\").addClass(\r\n \"error\");\r\n inputAuthor.appendTo(creatingAuthorContainer);\r\n labelErrorAuthor.appendTo(creatingAuthorContainer);\r\n btnCreateAuthor.appendTo(creatingAuthorContainer);\r\n\r\n selectMultiplyElement.appendTo(multipleContainer);\r\n multipleContainer.appendTo(popupContent);\r\n creatingAuthorContainer.appendTo(popupContent);\r\n\r\n getAuthorsFromServer();\r\n\r\n var popupBtnContainer = $(\"<div>\").addClass(\"popup-btn-conteiner\");\r\n var btnAddAuthorToNews = $(\"<button>\").addClass(\"btn-add-author-to-news\")\r\n .text(jQuery.i18n.prop(\"news.add_author_to_news\"));\r\n var btnClose = $(\"<div>\").addClass(\"btn-close\").text(\"x\");\r\n popupTitle.appendTo(popup);\r\n popupContent.appendTo(popup);\r\n btnClose.appendTo(popup);\r\n btnAddAuthorToNews.appendTo(popupBtnContainer);\r\n popupBtnContainer.appendTo(popupContent);\r\n btnClose.unbind().click(function() {\r\n $(\"#hide-layout\").hide();\r\n popup.remove();\r\n });\r\n btnAddAuthorToNews.unbind().click(function() {\r\n addAuthorToCreatingNews();\r\n $(\"#hide-layout\").hide();\r\n popup.remove();\r\n });\r\n\r\n popup.appendTo(\"div.content\");\r\n}", "title": "" }, { "docid": "87103b61ab464666a596de8468a98503", "score": "0.59220797", "text": "function mostrarDetalles(detalles) {\n var html_completo = \"\";\n html_completo = mostrarNavbar();\n html_completo += '<div class=\"container container-login container-tabla\">' + '<h1>Detalles de ' + detalles.nombre + '</h1>' + '<div class=\"row\">' + '<div class=\"col\"><p class=\"font-weight-bold\">Nombre: </p></div>' + '<div class=\"col\"><p>' + detalles.nombre + '</p></div>' + '</div>' + '<div class=\"row\">' + '<div class=\"col\"><p class=\"font-weight-bold\">Descripcion: </p></div>' + '<div class=\"col\"><p>' + detalles.descripcion + '</p></div>' + '</div>' + '<div class=\"row\">' + '<div class=\"col\"><p class=\"font-weight-bold\">Trailer: </p></div>' + '<div class=\"col\">';\n\n if (detalles.trailer.includes(\"https://www.youtube.com/embed/\")) {\n html_completo += '<iframe width=\"560\" height=\"315\" src=\"' + detalles.trailer + '\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>';\n } else {\n html_completo += '<p>El video no existe o la url es incorrecta</p>';\n }\n\n html_completo += '</div>' + '</div>' + '<div class=\"row\">' + '<div class=\"col\"><p class=\"font-weight-bold\">Edad Recomendada: </p></div>' + '<div class=\"col\"><p>' + detalles.edad_recomendada + '</p></div>' + '</div>' + '<div class=\"row\">' + '<div class=\"col\"><p class=\"font-weight-bold\">Requisitos del sistema: </p></div>' + '<div class=\"col\"><p>' + detalles.Requerimientos + '</p></div>' + '</div>' + '<div class=\"row\">' + '<div class=\"col\"><p class=\"font-weight-bold\">Precio: </p></div>' + '<div class=\"col\"><p>' + detalles.precio + '</p></div>' + '</div>' + '<div class=\"row\">' + '<div class=\"col\"><p class=\"font-weight-bold\">Desarrolladora ID: </p></div>' + '<div class=\"col\"><p>' + detalles.desarrolladora_id + '</p></div>' + '</div>' + '<a href=\"/\"><button type=\"button\" class=\"btn btn-primary\">>Volver</button></a>' + '</div>';\n return html_completo;\n}", "title": "" }, { "docid": "6e3b7d7b46af8670d8d2bd792900003e", "score": "0.591332", "text": "function MostrarDatos(posicion)\r\n{\r\n\t\tidexpediente=document.getElementById('idexpediente['+posicion+']').value;\r\n\t\tidsolicitud=document.getElementById('idsolicitud['+posicion+']').value;\r\n\t\tidarea=document.getElementById('idarea['+posicion+']').value;\r\n\t\tidexamen=document.getElementById('idexamen['+posicion+']').value;\r\n\t\tidexpediente=trim(idexpediente);\r\n\t\tidsolicitud=trim(idsolicitud);\r\n\t\tswitch (idarea)\r\n\t\t { case \"URI\": \r\n\t\t\tventana_secundaria = window.open(\"DatosSolicitudesPorArea1.php?var1=\"+idexpediente+\r\n\t\t\t\t\t\t\t\t\t\t \"&var2=\"+idarea+\"&var3=\"+idsolicitud+\"&var4=\"+idexamen,\"Datos1\",\t\t\t\t\t\t\t\t\t\t\t\"width=850,height=475,menubar=no,scrollbars=yes\") ;\r\n\t\t\tbreak;\r\n\t\t\tcase \"BAT\": \r\n\t\t\tventana_secundaria = window.open(\"DatosSolicitudesPorArea1.php?var1=\"+idexpediente+\r\n\t\t\t\t\t\t\t\t\t\t \"&var2=\"+idarea+\"&var3=\"+idsolicitud+\"&var4=\"+idexamen,\"Datos1\",\t\t\t\t\t\t\t\t\t\t\t\"width=850,height=475,menubar=no,scrollbars=yes\") ;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\tventana_secundaria = window.open(\"DatosSolicitudesPorArea.php?var1=\"+idexpediente+\r\n\t\t\t\t\t\t\t\t\t\t \"&var2=\"+idarea+\"&var3=\"+idsolicitud+\"&var4=\"+idexamen,\"Datos\",\t\t\t\t\t\t\t\t\t\t\t\"width=850,height=475,menubar=no,scrollbars=yes\") ;\r\n\t\t\tbreak;\r\n\t\t}\r\n }", "title": "" }, { "docid": "aacf17183878aab36e4cf6cee2477cd7", "score": "0.59081", "text": "function obtenerInformacion() {\r\n let taka = JSON.parse(localStorage.getItem('Notas'));\r\n let nana = document.getElementById('Manejador');\r\n nana.innerHTML = '';\r\n for(let i = 0; i < taka.length; i++) {\r\n let titulo = taka[i].title;\r\n let descripcion = taka[i].description;\r\n \r\n let ventana = document.createElement(\"div\");\r\n ventana.id= \"viewNoteV1-\" + i;\r\n ventana.className = \"viewNoteV1\";\r\n\r\n if(ventana.id != null){\r\n\r\n ventana.innerHTML = `\r\n <div class=\"cuerpo\">\r\n <div class=\"arriba\">\r\n <p>Titulo:\r\n <p id=\"AddTitle2\">${titulo}</p>\r\n </p>\r\n <button class=\"close\" id=\"Sayonara\" onclick='document.getElementById(\"viewNoteV1-${i}\").style.display = \"none\" '>X</button>\r\n </div>\r\n <div class=\"abajo\">\r\n <p>Mensaje: </p>\r\n <p id=\"AddText\" style=\"font-family:var(--Familia1);\">${descripcion}</p>\r\n </div>\r\n </div>`;\r\n document.querySelector(\".guardadoText\").appendChild(ventana);\r\n // Ventana de las GOD\r\n\r\n nana.innerHTML += `<div>\r\n <div class=\"distraccion3\">\r\n <p>${titulo}</p>\r\n </div>\r\n <button class=\"btn view\" onclick='document.querySelector(\"#viewNoteV1-${i}\").style.display= \"block\" '>Ver</button>\r\n <button class=\"btn delet peligro\" onclick='document.querySelector(\"#viewNoteV1-${i}\").remove();borrarElemento(\"${titulo}\")'>Eliminar</button>\r\n <div class=\"distraccion2\">\r\n <label style=\"Cursor: text;\">${descripcion}</label>\r\n </div>\r\n\r\n </div>\r\n `;\r\n }else{\r\n ventana.remove();\r\n }\r\n \r\n }\r\n }", "title": "" }, { "docid": "05a0e2eb8dbd19e12e405537ac1ab2b9", "score": "0.5906635", "text": "function caricoSezione(x){\n var sezione = coordPless['\"'+lng+','+lat+'\"'][0][x];\n var perv = \"No\";var color = \"red\";if (dataSetSez[parseInt(sezione[\"Numero\"])] == true){perv = \"Si\";color = \"green\";}\n jQuery(\"#dettSezioneNumero\").html(sezione[\"Numero\"]);\n jQuery(\"#dettSezioneIncaricato\").html(sezione[\"User\"] + \" - \" + sezione[\"IncaricatoDataEntry\"]);\n jQuery(\"#dettSezioneScuola\").html(sezione[\"Scuola\"]);\n jQuery(\"#dettSezioneMunicipio\").html(sezione[\"Municipio\"]);\n jQuery(\"#dettSezioneUbicazione\").html(sezione[\"Ubicazione\"]);\n jQuery(\"#dettSezioneGruppo\").html(sezione[\"Gruppo\"]);\n jQuery(\"#dettSezioneTelefono\").html(sezione[\"Telefono\"]);\n jQuery(\"#dettSezioneCellulare\").html(sezione[\"Cellulare\"]);\n jQuery(\"#dettSezioneVoip\").html(sezione[\"Voip\"]);\n jQuery(\"#dettSezionePerv\").html('<font color=\"'+color+'\">'+ perv + '</font>');\n jQuery(\"#dettSezione\").popup(\"open\");\n}", "title": "" }, { "docid": "c9f66dac5e9351ed82d12a80e49b5eef", "score": "0.59027076", "text": "function popUp () {\n pub.setAttribute('class','popup');\n let nbPub = sessionStorage.getItem('pub');\n let plusPub = localStorage.getItem('pub');\n if (nbPub == 1 || plusPub == 1){ //sessionStorage ou localStorage pour stocker l'apparition de la pub.\n pub.setAttribute('class','hidden'); //pour empecher la popup de revenir dans la page apres l'avoir fermée une fois\n }\n }", "title": "" }, { "docid": "d5b6d35198fcdd81a15bf4ffdaa691b0", "score": "0.5901842", "text": "function creaPanelTransporte (){\r\n\t/**\r\n\t * Crea la lista de ciudades.\r\n\t * @return contenido para añadir al panel.\r\n\t */\r\n\tfunction creaContenido (){\r\n\t\tvar contenido = \"<ul id='listaIconosTransportar'>\";\r\n\t\tvar ciudades = GM_getValue (server + \"ordenCiudades\").split (\"#\");\r\n\t\tvar top = 3;\r\n\r\n\t\tfor (var i=0; i<ciudades.length; i++){\r\n\t\t\tvar ciudad = ciudades[i].split (\"|\")[0];\r\n\t\t\t\r\n\t\t\tif (ciudad != Ciudad.getNombre ()){\r\n\t\t\t\tcontenido += \"<li style='padding: 5px 0 4px 5px;'>\";\r\n\t\t\t\tcontenido += \"<span>\" + ciudad + \"</span>\";\r\n\t\t\t\tcontenido +=\t\"<img title='\" + Lang[\"moveResources\"] + \"' style='cursor: pointer; position: absolute; right: 65px; top: \" + top + \"px;' src='\" + Img.MENU_TRANSPORTE_RECURSOS + \"'/>\" +\r\n\t\t\t\t\t\t\t\t\"<img title='\" + Lang[\"moveTroops\"] + \"' style='cursor: pointer; position: absolute; right: 36px; top: \" + top + \"px;' src='\" + Img.MENU_TRANSPORTE_TROPAS + \"'/>\" +\r\n\t\t\t\t\t\t\t\t\"<img title='\" + Lang[\"moveFleets\"] + \"' style='cursor: pointer; position: absolute; right: 7px; top: \" + top + \"px;' src='\" + Img.MENU_TRANSPORTE_FLOTAS + \"'/>\";\r\n\t\t\t\tcontenido += \"</li>\";\r\n\t\t\t\t\r\n\t\t\t\ttop += 25;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcontenido += \"</ul>\";\r\n\t\t\r\n\t\treturn contenido;\r\n\t}\r\n\t\r\n\t/**\r\n\t * Calcula la dirección donde redirigir la página para enviar unidades.\r\n\t * @param ciudad ciudad a la que se quieren enviar unidades.\r\n\t * @param n 0 si se transportan recursos, 1, si se envian tropas y 2 si se envian flotas.\r\n\t */\r\n\tfunction calculaDireccion (ciudad, n){\r\n\t\tvar url = \"http://\" + host + \"/index.php?\";\r\n\t\tswitch (n){\r\n\t\t\tcase 0:\r\n\t\t\t\turl += \"view=transport&destinationCityId=\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\turl += \"view=deployment&deploymentType=army&destinationCityId=\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\turl += \"view=deployment&deploymentType=fleet&destinationCityId=\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\turl += GM_getValue (server + ciudad).split (\"#\")[4];\r\n\t\t\r\n\t\twindow.open (url, \"_self\");\r\n\t}\r\n\r\n\tvar capa = document.createElement (\"div\");\r\n\tcapa.id = \"menuPanelTransporte\";\r\n\tcapa.className = \"dynamic\";\r\n\t\r\n\tif (panelesScript[1] == \"1\"){\r\n\t\tvar abierto = true;\r\n\t\tvar imagen = Img.PANEL_BOTON_MINIMIZAR;\r\n\t\tvar vis = \"visible\";\r\n\t\tvar hei = \"auto\";\r\n\t}else{\r\n\t\tvar abierto = false;\r\n\t\tvar imagen = Img.PANEL_BOTON_MAXIMIZAR;\r\n\t\tvar vis = \"hidden\";\r\n\t\tvar hei = \"0\";\r\n\t}\r\n\t\r\n\tvar contenido = creaContenido ();\r\n\t\r\n\tcapa.innerHTML =\t\"<h3 class='header'>\" + Lang[\"moveUnits\"] + \"<img src='\" + imagen + \"' style='position: absolute; right: 5px; top: 7px; cursor: pointer;'/></h3>\" +\r\n\t\t\t\t\t\t\"<div class='content' style='visibility: \" + vis + \"; height: \" + hei + \";'>\" + contenido + \"</div>\" +\r\n\t\t\t\t\t\t\"<div class='footer'></div>\";\r\n\t\r\n\tvar panelPuntos = document.getElementById (\"menuPanelPuntos\");\r\n\tif (panelPuntos){\r\n\t\tcolocaDetras (capa, panelPuntos);\r\n\t}else{\r\n\t\tcolocaDetras (capa, document.getElementById (\"menuPaneles\"));\r\n\t}\r\n\t\r\n\tdocument.getElementById (\"menuPanelTransporte\").getElementsByTagName (\"img\")[0].addEventListener (\r\n\t\t\"click\",\r\n\t\tfunction (){\r\n\t\t\tvar contenido = this.parentNode.parentNode.childNodes[1];\r\n\t\t\t\r\n\t\t\tif (abierto){\r\n\t\t\t\tabierto = false;\r\n\t\t\t\tthis.src = Img.PANEL_BOTON_MAXIMIZAR;\r\n\t\t\t\tcontenido.style.visibility = \"hidden\";\r\n\t\t\t\tcontenido.style.height = \"0\";\r\n\t\t\t\tpanelesScript[1] = 0;\r\n\t\t\t\tGM_setValue (server + \"paneles\", panelesScript.join (\"#\"));\r\n\t\t\t}else{\r\n\t\t\t\tabierto = true;\r\n\t\t\t\tthis.src = Img.PANEL_BOTON_MINIMIZAR;\r\n\t\t\t\tcontenido.style.height = \"auto\";\r\n\t\t\t\tcontenido.style.visibility = \"visible\";\r\n\t\t\t\tpanelesScript[1] = 1;\r\n\t\t\t\tGM_setValue (server + \"paneles\", panelesScript.join (\"#\"));\r\n\t\t\t}\r\n\t\t},\r\n\t\tfalse\r\n\t);\r\n\r\n\t//Añado listeners a todos los iconos\r\n\tvar lista = document.getElementById (\"listaIconosTransportar\");\r\n\tfor (var i=0; i<lista.childNodes.length; i++){\r\n\t\tvar img = lista.childNodes[i].getElementsByTagName (\"img\");\r\n\t\timg[0].addEventListener (\"click\", function (){ calculaDireccion (this.parentNode.childNodes[0].textContent, 0); }, false);\r\n\t\timg[1].addEventListener (\"click\", function (){ calculaDireccion (this.parentNode.childNodes[0].textContent, 1); }, false);\r\n\t\timg[2].addEventListener (\"click\", function (){ calculaDireccion (this.parentNode.childNodes[0].textContent, 2); }, false);\r\n\t}\r\n}", "title": "" }, { "docid": "137e254fe7c99e1ccebf01ea35672180", "score": "0.589929", "text": "function modalInsert(id)\n{\n\tvar promenjiva=id;\n\tvar a=\"\";\n\tswitch(promenjiva)\n\t{\n\t\tcase'korisnik':\n\t\t\n\t\ta+='<label>Ime:</label>&nbsp<input type=\"text\" id=\"imeModal\" value=\"\"/>'+\n\t\t'</br><label>Prezime:</label>&nbsp<input type=\"text\" id=\"prezimeModal\" value=\"\"/>'+\n\t\t'</br><label>Username:</label>&nbsp<input type=\"text\" id=\"usernameModal\" value=\"\"/>'+\n\t\t'</br><label>Email:</label>&nbsp<input type=\"text\" id=\"emailModal\" value=\"\"/>'+\n\t\t'</br><label>Password:</label>&nbsp<input type=\"password\" id=\"passwordModal\"/>'+\n\t\t'</br><label>Password repeat:</label>&nbsp<input type=\"password\" id=\"passwordModal2\"/>'+\n\t\t'</br><label>Aktivan:</label>&nbsp'+\n\t\t '<select id=\"aktivanModal\">'+\n\t\t '<option value=\"1\">';\n\t\t a+='Aktivan</option><option value=\"0\">Neaktivan</option>';\n\t\t\n\t\t \n\t\t a+='</select>'+\n\t\t '</br><label>Uloga:</label>&nbsp'+\n\t\t '<select name=\"ulogaModal\" id=\"ulogaModal\">'+\n\t\t '<option value=\"0\">';\n \n\t\t a+='Uloga...</option><option value=\"1\">Korisnik</option><option value=\"2\">Admin</option>';\n\t\t \n\t\t\n\t\t a+='</select></br><button class=\"promenaPodaci\" id=\"korisnik\">Izmeni</button>';\t\n\t\t\t\n\t\t\t\n\t\t\n\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t $(\".sredinaM\").html(a);\n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"uloge\":\n\t\ta+='<label>Naziv:</label>&nbsp<input type=\"text\" id=\"ulogaNazivM\" value=\"\"/>'+\n\t\t'</br><button class=\"promenaPodaci\" id=\"uloge\">Izmeni</button>';\n\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t $(\".sredinaM\").html(a);\n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"kontinenti\":\n\t\ta+='<label>Naziv:</label>&nbsp<input type=\"text\" id=\"kontinentiM\" value=\"\"/>'+\n\t\t'</br><button class=\"promenaPodaci\" id=\"\">Izmeni</button>';\n\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t $(\".sredinaM\").html(a);\n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"drzave\":\n\t\ta+='<label>Naziv:</label>&nbsp<input type=\"text\" id=\"drzaveM\" value=\"\"/>';\n\t\ta+='</br><label>Kontinenti:</label>&nbsp<select id=\"aaa\" name=\"drzaveKontinentiM\">'+\n '<option value=\"0\">Kontinenti...</option></select>';\t\t\n\t\t\t$(\".sredinaM\").html(a);\n\t\t\t\n$.ajax({\n url: base_url + 'php/kontinenti.php',\n type: \"POST\",\n data: {\n\t\t\t\t\tsend:true\n },\n success: function (data,xhr) {\n\t\t\t//var b=\" \";\n\t\t\t\n for(var i=0;i<data.length;i++)\n\t\t\t {\n\t\t\t\t \n\t\t\t\t var b='<option value=\"'+data[i].id_kontinent+'\">'+data[i].naziv+'</option>';\n\t\t\t\t $(\"#aaa\").append(b);\n\t\t\t\t \n\t\t\t }\t\t\t\t \n\t\t\t var b='</select></br><button class=\"promenaPodaci\" id=\"drzave\">Izmeni</button>';\n\t\t\t $(\".sredinaM\").append(b);\n\t\t\t\t},\n\t\t\t\terror:function (xhr,status,error){\n var poruka = \"<h1>Nije pronadjen.</h1>\";\n switch(xhr.status) {\n case 404 :\n poruka = \"<h1>Stranica nije pronadjena.</h1>\";\n break;\n case 500:\n poruka = \"<h1>Greska.</h1>\";\n break;\n }console.log(xhr.status); \n \t\t\t\t\n $(\"#feedback\").html(poruka);\n }\n\n });\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t \n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"kategorije\":\n\t\ta+='<label>Naziv:</label>&nbsp<input type=\"text\" id=\"kategorijaM\" value=\"\"/>'+\n\t\t'</br><button class=\"promenaPodaci\" id=\"kategorije\">Izmeni</button>';\n\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t $(\".sredinaM\").html(a);\n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"pitanjeA\":\n\t\ta+='<label>Pitanje:</label>&nbsp'+\n\t\t'<textarea placeholder=\"\" id=\"pitanjeM\"></textarea>'+\n\t\t'</br><button class=\"promenaPodaci\" id=\"pitanjeA\">Izmeni</button>';\n\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t $(\".sredinaM\").html(a);\n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"namernice\":\n\t\ta+='<label>Naziv:</label>&nbsp'+\n\t\t'<input type=\"text\" value=\"\" id=\"namernicaM\"/>'+\n\t\t'</br><button class=\"promenaPodaci\" id=\"namernice\">Izmeni</button>';\n\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t $(\".sredinaM\").html(a);\n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"spremanje\":\n\t\ta+='<label>Nacin:</label>&nbsp'+\n\t '<textarea placeholder=\"\" id=\"spremanjeM\"></textarea>'+\n\t\t'</br><button class=\"promenaPodaci\" id=\"spremanje\">Izmeni</button>';\n\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t $(\".sredinaM\").html(a);\n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"meni\":\n\t\ta+='<label>Ispis:</label>&nbsp'+\n\t '<input type=\"text\" value=\"\" id=\"ispisM\"/>'+\n\t '</br><label>Href:</label>&nbsp'+\n\t '<input type=\"text\" value=\"\" id=\"hrefM\"/>'+\n\t\t'</br><button class=\"promenaPodaci\" id=\"meni\">Izmeni</button>';\n\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t $(\".sredinaM\").html(a);\n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"jelo\":\n\t\ta+='<form accept-charset=\"UTF-8\" method=\"post\" action=\"php/jelo.php\" role=\"form\" enctype=\"multipart/form-data\">'+\n\t\t'<label>Slika:</label>&nbsp'+\n\t '<input type=\"file\" name=\"slikaInsert\" />'+\n\t '</br><label>Naziv:</label>&nbsp'+\n\t '<input type=\"text\" name=\"nazivM\" id=\"nazivM\" value=\"\" />'+\n\t '</br><label>Opis:</label>&nbsp'+\n\t \t'<textarea placeholder=\"\" name=\"opisM\" id=\"opisM\"></textarea>'+\n\t '</br><label>Notes:</label>'+\n '<textarea placeholder=\"\" name=\"notesM\" id=\"notesM\"></textarea>'+\n\t '</br><label>Vreme pripreme:</label>'+\n\t '<input type=\"text\" name=\"vremeM\" id=\"vremeM\" value=\"\"/>'+ \n\t '</br><label>Drzava:</label>'+\n\t '&nbsp<select id=\"drzavaListaM\" name=\"drzavaListaM\">'+\n '<option value=\"0\">Drzave...</option></select>'+\n\t\t\t'</br><label>Kategorija:</label>'+\n\t '&nbsp<select id=\"katJeloListaM\" name=\"katJeloListaM\">'+\n '<option value=\"0\">Kategorija...</option></select>'+\n\t\t\t'</br><button id=\"jeloUnos\" name=\"jeloUnos\">Izmeni</button></form>';\t\n\t $(\".sredinaM\").html(a);\n\t \n\t\t\n\t \n\t\t\n$.ajax({\n url: base_url + 'php/kategorije.php',\n type: \"POST\",\n data: {\n\t\t\t\t\tsend:true\n },\n success: function (data,xhr) {\n\t\t\t//var b=\" \";\n\t\t\t\n for(var i=0;i<data.length;i++)\n\t\t\t {\n\t\t\t\t \n\t\t\t\t var b='<option value=\"'+data[i].id_proizvod_kategorija+'\">'+data[i].naziv_kategorija+'</option>';\n\t\t\t\t $(\"#katJeloListaM\").append(b);\n\t\t\t\t \n\t\t\t }\t\t\t\t \n\t\t\t\n\t\t\n\t\t\t\t},\n\t\t\t\terror:function (xhr,status,error){\n var poruka = \"<h1>Nije pronadjen.</h1>\";\n switch(xhr.status) {\n case 404 :\n poruka = \"<h1>Stranica nije pronadjena.</h1>\";\n break;\n case 500:\n poruka = \"<h1>Greska.</h1>\";\n break;\n }console.log(xhr.status); \n \t\t\t\t\n $(\"#feedback\").html(poruka);\n }\n\n });\n\t $.ajax({\n url: base_url + 'php/drzave.php',\n type: \"POST\",\n data: {\n\t\t\t\t\tsend:true\n },\n success: function (data,xhr) {\n\t\t\t//var b=\" \";\n\t\t\t\n for(var i=0;i<data.length;i++)\n\t\t\t {\n\t\t\t\t \n\t\t\t\t var b='<option value=\"'+data[i].id_drzava+'\">'+data[i].naziv_drzave+'</option>';\n\t\t\t\t $(\"#drzavaListaM\").append(b);\n\t\t\t\t \n\t\t\t }\t\t\t\t \n\t\t\t\n\t\t\n\t\t\t\t},\n\t\t\t\terror:function (xhr,status,error){\n var poruka = \"<h1>Nije pronadjen.</h1>\";\n switch(xhr.status) {\n case 404 :\n poruka = \"<h1>Stranica nije pronadjena.</h1>\";\n break;\n case 500:\n poruka = \"<h1>Greska.</h1>\";\n break;\n }console.log(xhr.status); \n \t\t\t\t\n $(\"#feedback\").html(poruka);\n }\n\n });\n\t \n\t \n\t \n\t \n\n\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t \n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"odgovori\":\n\t\ta+='<select id=\"pitanjeListaUnos\" name=\"pitanjeListaUnos\">'+\n '<option value=\"0\">Pitanja...</option></select>&nbsp'+\n\t\t'</br><input type=\"text\" value=\"\" id=\"odgovorM\"/>'+\n\t\t'</br><button class=\"promenaPodaci\" id=\"odgovori\">Izmeni</button>';\n\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t \n$.ajax({\n url: base_url + 'php/pitanjeA.php',\n type: \"POST\",\n data: {\n\t\t\t\t\tsend:true\n },\n success: function (data,xhr) {\n\t\t\t//var b=\" \";\n\t\t\t\n for(var i=0;i<data.length;i++)\n\t\t\t {\n\t\t\t\t \n\t\t\t\t var b='<option value=\"'+data[i].id_pitanje+'\">'+data[i].pitanje+'</option>';\n\t\t\t\t $(\"#pitanjeListaUnos\").append(b);\n\t\t\t\t\n\t\t\t }\t\t\t\t \n\t\t\t\n\t\t\n\t\t\t\t},\n\t\t\t\terror:function (xhr,status,error){\n var poruka = \"<h1>Nije pronadjen.</h1>\";\n switch(xhr.status) {\n case 404 :\n poruka = \"<h1>Stranica nije pronadjena.</h1>\";\n break;\n case 500:\n poruka = \"<h1>Greska.</h1>\";\n break;\n }console.log(xhr.status); \n \t\t\t\t\n $(\"#feedback\").html(poruka);\n }\n\n });\n\n\t $(\".sredinaM\").html(a);\n\t\tdocument.getElementById('id01').style.display='block';\n\t\tbreak;\n\t\tcase\"jeloNamernice\":\n\t\ta+='<select id=\"jeloLista\" name=\"jeloLista\">'+\n '<option value=\"0\">Jela...</option></select>&nbsp'+\n\t\t '<select id=\"namerniceLista\" name=\"namerniceLista\">'+\n '<option value=\"0\">Namernice...</option></select>&nbsp'+\n\t\t'</br><button class=\"promenaPodaci\" id=\"jeloNamernice\">Izmeni</button>';\n\t\t\t $(\".modalHeader\").html(promenjiva+' <span class=\"w3-button w3-display-topright\">&times;</span>');\n\t \n$.ajax({\n url: base_url + 'php/jelo.php',\n type: \"POST\",\n data: {\n\t\t\t\t\tsend:true\n },\n success: function (data,xhr) {\n\t\t\t//var b=\" \";\n\t\t\t\n for(var i=0;i<data.length;i++)\n\t\t\t {\n\t\t\t\t \n\t\t\t\t var b='<option value=\"'+data[i].id_jelo+'\">'+data[i].naziv+'</option>';\n\t\t\t\t $(\"#jeloLista\").append(b);\n\t\t\t\t\n\t\t\t }\t\t\t\t \n\t\t\t\n\t\t\n\t\t\t\t},\n\t\t\t\terror:function (xhr,status,error){\n var poruka = \"<h1>Nije pronadjen.</h1>\";\n switch(xhr.status) {\n case 404 :\n poruka = \"<h1>Stranica nije pronadjena.</h1>\";\n break;\n case 500:\n poruka = \"<h1>Greska.</h1>\";\n break;\n }console.log(xhr.status); \n \t\t\t\t\n $(\"#feedback\").html(poruka);\n }\n\n });\n\t\t\t$.ajax({\n url: base_url + 'php/namernice.php',\n type: \"POST\",\n data: {\n\t\t\t\t\tsend:true\n },\n success: function (data,xhr) {\n\t\t\t//var b=\" \";\n\t\t\t\n for(var i=0;i<data.length;i++)\n\t\t\t {\n\t\t\t\t \n\t\t\t\t var b='<option value=\"'+data[i].id_namernice+'\">'+data[i].naziv+'</option>';\n\t\t\t\t $(\"#namerniceLista\").append(b);\n\t\t\t\t\n\t\t\t }\t\t\t\t \n\t\t\t\n\t\t\n\t\t\t\t},\n\t\t\t\terror:function (xhr,status,error){\n var poruka = \"<h1>Nije pronadjen.</h1>\";\n switch(xhr.status) {\n case 404 :\n poruka = \"<h1>Stranica nije pronadjena.</h1>\";\n break;\n case 500:\n poruka = \"<h1>Greska.</h1>\";\n break;\n }console.log(xhr.status); \n \t\t\t\t\n $(\"#feedback\").html(poruka);\n }\n\n });\n\n\t $(\".sredinaM\").html(a);\n\t\tdocument.getElementById('id01').style.display='block';\n\t\t\n\t\t\n\t\t\n\t\tbreak;\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//kraj switch\n\t}\n\t\n\t\n\t\n\t\n\t\n}", "title": "" }, { "docid": "e3119e1d8570be9853eb7bb8057dd755", "score": "0.5892531", "text": "Mostrar(){\n\t\tJugar.addEventListener('click', e=>{\n\t\te.preventDefault();\n\t\tif (i<4){\n\t\tvar today = new Date();\n\t\tvar time = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n\t\tvar Fecha=time;\n\t\tvar Registro=new Array();\n\t\tvar Jugador=new Array();\n\t\tJugador[i]=this.nombre;\n\t\tRegistro[i]=this.tiro;\n\t\n\t\tSumaTodo+=parseInt(Registro[i]);\n\t\t// condicion si suma final es 18\n\t\tif(SumaTodo==18){\n\t\t\tSumaTodo+=parseInt(10);\n\t\t}\n\t\tlet cuerpo=document.getElementById('Generar');\n\t\tlet contenido=\"<tr>\"\n\t\tcontenido+=\"<th>Nombre</th>\";\n\t\tcontenido+=\"<th> Tiro\" + \" \"+i+\"</th>\";\n\t\tcontenido+=\"<th> Puntaje </th>\";\n\t\tcontenido+=\"<th> Hora</th>\";\n\t\tcontenido+=\"</tr>\";\n\t\tcontenido+=\"<tr>\"\n\t\tcontenido+=\"<td>\"+ this.nombre +\"</td>\"; \n\t\tcontenido+=\"<td>\"+Registro[i]+\"</td>\";\n\t\tcontenido+=\"<td>\"+SumaTodo+\"</td>\";\n\t\tcontenido+=\"<td>\"+Fecha+\"<td>\";\n\t\tcontenido+=\"</tr>\";\n\t\tcuerpo.innerHTML=contenido;\n\t\ti++;\t\n\t\t}\n\t\telse{\n\t\t\talert(\"Intentos agotados\");\n\t\t\t\n\t\t}\n\t\t\n\t\t})\n\t}", "title": "" }, { "docid": "cc371cc4120a52c1588682cd44ec38e8", "score": "0.5890293", "text": "function inventar() {\r\n\t\tvar htmlitem1 = [];\r\n\t\tvar htmlitem2 = [];\r\n\t\tvar htmlitem3 = [];\r\n\r\n\t\tvar fstItem = items.includes(meldungen.items.item1.name[0]);\t// Checken ob Item vorhanden\r\n\t\tvar sndItem = items.includes(meldungen.items.item2.name[0]);\r\n\t\tvar trdItem = items.includes(meldungen.items.item3.name[0]);\r\n\r\n\t\tif (fstItem == true) {\t\t// Texte fürs Inventar, wenn gegenstand vorhanden\r\n\t\t\thtmlitem1 = '<h2>' + meldungen.items.item1.title[0] + ': </h2><p>' + meldungen.items.item1.text[0] + '<br>Stärke: ' + meldungen.items.item1.stärke[0] + '</p>';\r\n\t\t}\r\n\t\tif (sndItem == true) {\r\n\t\t\thtmlitem2 = '<h2>' + meldungen.items.item2.title[0] + ': </h2><p>' + meldungen.items.item2.text[0] + '<br>Stärke: ' + meldungen.items.item2.stärke[0] + '</p>';\r\n\t\t}\r\n\t\tif (trdItem == true) {\r\n\t\t\thtmlitem3 = '<h2>' + meldungen.items.item3.title[0] + ': </h2><p>' + meldungen.items.item3.text[0] + '<br>Stärke: ' + meldungen.items.item3.stärke[0] + '</p>';\r\n\t\t}\r\n\r\n\t\tSwal.fire({\t\t// Inventar Popup\r\n\t\t\tcustomClass: {\r\n\t\t\t\tcontainer: 'inventarpopup',\r\n\t\t\t\tconfirmButton: 'confirm-button-inventar',\r\n\t\t\t\tinput: 'inventar-input',\r\n\t\t\t},\r\n\t\t\tinput: 'select',\r\n\t\t\t// inputValue: '1',\r\n\t\t\tinputOptions: {\r\n\t\t\t\t'Baum': 'Baum',\r\n\t\t\t\t'Eiche': 'Eiche',\r\n\t\t\t\t'Löffel': 'Löffel',\r\n\t\t\t},\r\n\t\t\tinputPlaceholder: 'Wähle einen Gegenstand',\r\n\t\t\t// title: 'Inventar',\r\n\t\t\thtml: htmlitem1 + htmlitem2 + htmlitem3,\r\n\t\t\t\t// imageUrl: './images/firstmsg.png',\r\n\t\t\t// icon: 'info',\r\n\t\t\tshowCancelButton: true,\r\n\t\t\tanimation: false,\r\n\t\t\tgrow: false,\r\n\t\t\tconfirmButtonText: 'Benutzen',\r\n\t\t\tcancelButtonText: 'Zurück',\r\n\t\t\treverseButtons: true,\r\n\t\t\tpreConfirm: function(value) {\t\t// Mit return false bleibt das Popup offen, setTimeout sorgt dafür, dass die Aktion verzögert startet\r\n\t\t\t\tconfBtnAnimation(\".confirm-button-inventar\");\r\n\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\tuseItem(value);\r\n\t\t\t\t\t$('.inventarpopup').remove();\r\n\t\t\t\t}, confBtnDelay);\r\n\t\t\t\treturn false;\r\n\t\t\t} \r\n\t\t})\r\n\t\t\r\n\t\t/* Ab hier Verstecken nicht vorhandener Items */\r\n\t\t\r\n\t\tvar selectcontainer = document.querySelector(\".inventar-input\");\r\n\t\tif (fstItem == false) {\r\n\t\t\tvar match = selectcontainer.querySelectorAll(\"option[value='Baum']\");\r\n\t\t\tmatch[0].style.display = 'none';\r\n\t\t\t\r\n\t\t}\r\n\t\tif (sndItem == false) {\r\n\t\t\tvar match = selectcontainer.querySelectorAll(\"option[value='Eiche']\");\r\n\t\t\tmatch[0].style.display = 'none';\r\n\t\t}\r\n\t\tif (trdItem == false) {\r\n\t\t\tvar match = selectcontainer.querySelectorAll(\"option[value='Löffel']\");\r\n\t\t\tmatch[0].style.display = 'none';\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "0448ccbd806cd1bffe2928bf18e9368a", "score": "0.5888845", "text": "function pantallaPesos(){\n\ticonoDolar.style.color=\"black\";\n\ticonoPesos.style.color=\"#C0AC87\";\n\tif (divCompra.style.display=\"block\"){\n\t\tdivCompra.style.display=\"none\";\n\t\tdivVenta.style.display=\"none\";\n\t\th3SaldoDolar.style.display=\"none\";\n\t\tparrafoDolar.style.display=\"none\";\n\t\tsaldoMaximo.style.display=\"none\";\n\t\tparrafoPesos.style.display=\"block\";\n\t\th3SaldoPesos.style.display=\"block\";\n\t\tpLimExt.style.display=\"block\";\n\t\tactualizarSaldoEnPantalla();\n\t}\n}", "title": "" }, { "docid": "b84f24ace7af1257bc40cc2a89ee259b", "score": "0.5888009", "text": "function NuevoPaciente()\n{\n\t/*$( \"#NewPaciente\" ).dialog({\n\t\t\tautoOpen: false,\n\t\t\tmodal: true,\n\t\t\theight:700,\n\t\t\twidth:800,\n\t\t\tshow: {\n\t\t\t\teffect: \"blind\",\n\t\t\t\tduration: 1000\n\t\t\t},\n\t\t\thide: {\n\t\t\t\teffect: \"explode\",\n\t\t\t\tduration: 1000\n\t\t\t}\n\t\t});\n\n\t\t$( \"#NewPaciente\" ).dialog( \"open\" );*/\n\t\tHome();\n\t\t$(\".Resp1\").html(\"<div class='table-responisve'><table class='table table-bordered table-striped table-condensedn'><tr><td>Cédula:</td><td><input type='text' id='txtcedulaUsu1' onkeyup='VerificarCI()' /></td><td>Pasaporte:</td><td><input type='text' id='txtPasport' /></td></tr><tr><td>Paciente:</td> <td colspan='3'><input type='text' class='span10' id='txtapellidoUsu1' /></td></tr> <tr><td>Medico:</td><td colspan='3'><div class='input-append'><input type='text' class='span12' id='txtnombresUsu1' /><a href='#myModal' role='button' class='btn' data-toggle='modal' onclick='AsgnarMedicoPaciente()'> Buscar</a></div></td></tr><tr><td>Otro:</td><td colspan='3'><textarea id='txtOtro' cols='40' rows='2'></textarea></td></tr></tr><tr><td>Fecha de Nacimiento:</td><td><input type='date' id='txtEdadUsu1' onchange='Calcular();' /><td colspan='2'><input type='text' id='TxtEdad123'/></tr><tr><td>Lugar de Nacimiento:</td><td><input type='text' id='txtLugnacim' /><td>Lugar de Residencia:</td><td><input type='text' id='txtLugres' /></td></tr><tr><td>Sexo:</td><td><select id='txtSex'><option value=''>--Seleccione--</option><option value='Femenino'>Femenino</option><option value='Masculino'>Masculino</option></select></td><!-- <td>Raza:</td> <td><input type='text' id='txtRaza' /></td><tr><td>Religión:</td><td><input type='text' id='txtReligion' /></td> --><td>Estado civil:</td><td><select id='txtEstadociv'><option value=''>--Seleccione un estado civil--</option><option value='Solter@'>Solter@</option><option value='Casad@'>Casad@</option><option value='Divorciad@'>Divorciad@</option><option value='Viud@'>Viud@</option><option value='Union Libre'>Union Libre</option></select></td></tr><tr><td>Instrucción:</td><td><input type='text' id='txtInstr' /></td><!-- <td>Profesión:</td><td><input type='text' id='txtProf' /></td> --></tr><tr><td>Autorizacion:</td><td><input type='text' id='txtautorizacion'/></td><td>Fecha:</td><td><input type='text' id='txtfechaauto' onchange='CalcularFechaVencimiento()' /></td></tr><tr><td>Fecha V.</td><td><input type='text' id='txtfechaautovenc' readonly /></td></tr><tr><!-- <td>Ocupación:</td><td><input type='text' id='txtOcupe' /></td> --><td>Condición del paciente:</td><td><select id='txtCondpac'><option value=''>--Seleccione una condición--</option><option value='Convenio'>Convenio</option><option value='Empresa'>Empresa</option><option value='Particular'>Particular</option></select></td><td><input type='text' id='txtconve2'/></td></tr><tr><td>Dirección:</td><td><input type='text' id='txtdireccionUsu1' /></td><td>Teléfono Domicilio:</td><td><input type='text' id='txtTelef'></td><tr><td>Teléfono Trabajo:</td><td><input type='text' id='txtTelefTraba'></td><td>Celular:</td><td><input type='text' id='txtCelular'></td><tr><td>Correo:</td><td><input type='text' id='txtCorreo'></td></tr><tr><td>Referencia: </td><td><input type='text' id='txtNombresRefe'></td><td>Teléfono de Referencia:</td><td><input type='text' id='txtTelefonoRefe'></td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td colspan='4'><input type='button' id='bntSaveUsu1' class='btn btn-success' onclick='SavePac();' value='Guardar' /></td></tr> </table></div>\");\n\t\t \n\n\n\t\t $('#txtfechaauto').datepicker({\n\t\t\t\t\t\tchangeMonth: true,\n\t\t\t\t\t\tchangeYear: true\n\t\t\t\t\t});\n\t\t$('#txtfechaauto').datepicker( 'option', 'dateFormat', 'yy-mm-dd' );\n\n\n\t$(\"#txtcedulaUsu1\").validarCedulaEC({\n\t\t onValid: function () {\n\t\t\tconsole.log(this);\n\t\t//\t$(\"#bntSaveUsu1\").removeAttr(\"disabled\");\t\n\t\t\t$(\"#txtcedulaUsu1\").css(\"background\",\"#29DF20\");\n\t\t},\n onInvalid: function () {\n console.log(this);\n window.alert(\"cédula inválida.\");\n\t\t $(\"#txtcedulaUsu1\").css(\"background\",\"red\");\n\t\t // $(\"#bntSaveUsu1\").attr(\"disabled\",\"true\");\t\n }\n });\n\t\t$(\"#bntSaveUsu1\").button();\n\t\t\n\t\t\t/*$('#txtEdadUsu1').datepicker({\n\t\t\t\tchangeMonth: true,\n\t\t\t\tchangeYear: true,\n\t\t\t\t onSelect:function()\n\t\t\t\t {\n\t\t\t\t\t setTimeout(function(){Calcular()},500);\n\t\t\t\t }\n\t\t\t});\n\t\t\t$('#txtEdadUsu1').datepicker( 'option', 'dateFormat', 'yy-mm-dd' );\n\t\t\t$('#txtEdadUsu1').datepicker( 'option', 'yearRange', '-99:+0' );\t\t\n\t\t\t//$('#txtEdadUsu1').datepicker('setDate', '1950-01-01');*/\n\t\t\n\t\t//validando campos de texto\n\t\t$(\"#txtapellidoUsu1\").alpha({allow:\" \"}); //restringe todos los numeros y algunos caracteres especiales menos el espacio\n\t\t$(\"#txtnombresUsu1\").alpha({allow:\" \"});\n\t\t//$(\"#txtEdadUsu1\").numeric();\t//restringe letras\n\t\t//$(\"#txtSangre\").alpha({allow:\"+-\"});\n\t\t$(\"#txtNombresFAOC\").alpha({allow:\" \"});\t\t\n\t\t$(\"#txtTelefonoFAOC\").numeric();\n\t\t\n}", "title": "" }, { "docid": "23cbb94cb97280e3ecd14e9d88ea7137", "score": "0.58770263", "text": "function AsignaPopupDisponible(lstFrames, url, ancho, alto, titulo) {\n\n lstFrames.each(function (index) {\n\n var SelectorPopup = '#' + $(this).attr('NombreDivPadre');\n var elemento = $(SelectorPopup);\n\n if (elemento.length > 0) {\n ConfiguracionPopups();\n ConfiguracionPopup(elemento, $(this), url, ancho, alto, titulo);\n\n return false;\n }\n else {\n\n if (elemento.dialog('isOpen') == false) {\n elemento.dialog('open');\n elemento.dialog('isOpen') = true;\n $(this).attr('src', url);\n\n return false;\n }\n\n }\n\n });\n}", "title": "" }, { "docid": "7400d2c2ac09593c56db1bcc62f7a477", "score": "0.5875186", "text": "function PrintSolucitud()\n{\n\t/*SaveSolucitud();\n\t$(\"#PrintSolicitudIn\").attr(\"title\",\"Solicitud - Interconsulta\");\n\t$( \"#PrintSolicitudIn\" ).dialog({\n\t\t\tautoOpen: false,\n\t\t\tmodal: true,\n\t\t\theight:700,\n\t\t\twidth:900,\n\t\t\tshow: {\n\t\t\t\teffect: \"slide\",\n\t\t\t\tduration: 1000\n\t\t\t},\n\t\t\thide: {\n\t\t\t\teffect: \"drop\",\n\t\t\t\tduration: 1000\n\t\t\t}\n\t\t});\n\t$( \"#PrintSolicitudIn\" ).dialog( \"open\" );*/\n\t$( \".modal-body\" ).html(\"<object type='text/html' data='../Reportes/SolicitudInterconsulta.php?idPac=\"+$('#codigoPaciente').val()+\"'></object>\");\n}", "title": "" }, { "docid": "fd1d07b9987cc8e6917429ffa879844e", "score": "0.5874664", "text": "function generate(v0,v1,v2,v3,v4,v5,contain){\n let modal = document.createElement(\"div\");\n modal.setAttribute(\"class\",\"xxx1\");\n let d0 = document.createElement(\"div\");\n d0.setAttribute(\"class\",\"dd10\");\n d0.innerText = \"Rail Ticket\";\n let d1 = document.createElement(\"div\");\n d1.setAttribute(\"class\",\"dd11\");\n d1.innerText = \"Speed: \" + v0;\n let d2 = document.createElement(\"div\");\n d2.setAttribute(\"class\",\"dd12\");\n d2.innerText = \"Train Name: \" + v1;\n let d3 = document.createElement(\"div\");\n d3.setAttribute(\"class\",\"dd13\");\n d3.innerText = \"Person name: \"+v2;\n let d4 = document.createElement(\"div\");\n d4.setAttribute(\"class\",\"dd14\");\n d4.innerText = \"Person Age: \"+v3;\n let d5 = document.createElement(\"div\");\n d5.setAttribute(\"class\",\"dd15\");\n d5.innerText = \"Compartment: \"+v4;\n let d6 = document.createElement(\"div\");\n d6.setAttribute(\"class\",\"dd16\");\n d6.innerText = \"Seats: \"+v5;\n let d7 = document.createElement(\"button\");\n d7.setAttribute(\"class\",\"dd17\");\n d7.innerText = \"Download\";\n let d8 = document.createElement(\"button\");\n d8.setAttribute(\"class\",\"dd18\");\n d8.innerText = \"End\";\n modal.append(d0)\n modal.append(d1);\n modal.append(d2);\n modal.append(d3);\n modal.append(d4);\n modal.append(d5);\n modal.append(d6);\n modal.append(d7);\n modal.append(d8);\n contain.append(modal);\n d7.addEventListener(\"click\",function(){\n let a = document.createElement(\"a\");\n a.href = `data:application/json,${encodeURIComponent(JSON.stringify(modal))}`;\n a.download = \"ticket.json\";\n contain.append(a);\n alert(\"File Sucessfully downloaded and attached to your container\");\n a.click();\n });\n d8.addEventListener(\"click\",function(){\n modal.remove();\n })\n}", "title": "" }, { "docid": "4c826a11cf65c597aa2d3cf760576489", "score": "0.586691", "text": "function pedImpueGenerPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('pedImpueGenerListLayer', 'O');\n\t\tvisibilidad('pedImpueGenerListButtonsLayer', 'O');\n\t\tif(get('pedImpueGenerFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tresetJsAttributeVars();\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\t\n\t//Guardamos los parámetros de la última busqueda. (en la variable javascript)\n\tpedImpueGenerLastQuery = generateQuery();\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripción en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\tfor(var i=0; i < datosTmp.longitud; i++){\n\t\tif(datosTmp.ij(i, 4) == \"true\"){\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.yes.message'), i, 4);\n\t\t}else{\n\t\t\tdatosTmp.ij2(GestionarMensaje('MMGGlobal.checkbox.no.message'), i, 4);\n\t\t}\n\t}\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminación)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:pedImpueGenerViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, pedImpueGenerChoiceColumn) + \"</A>\",\n\t\t\ti, pedImpueGenerChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger sólo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\tpedImpueGenerList.setDatos(datosTmp.filtrar([0,1,2,3,4],'*'));\n\t\n\t//La última fila de datos representa a los timestamps que debemos guardarlos\n\tpedImpueGenerTimeStamps = datosTmp.filtrar([5],'*');\n\t\n\t//SI hay mas paginas reigistramos que es así e eliminamos el último registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\tpedImpueGenerMorePagesFlag = true;\n\t\tpedImpueGenerList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\tpedImpueGenerMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el botón de borrar si estamos en la acción\n\tif(get('pedImpueGenerFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('pedImpueGenerListLayer', 'V');\n\tvisibilidad('pedImpueGenerListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('pedImpueGenerList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\tpedImpueGenerList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(pedImpueGenerMorePagesFlag){\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(pedImpueGenerPageCount > 1){\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('pedImpueGenerPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "title": "" }, { "docid": "81a8cc06c9b0584471117688136c31fe", "score": "0.5864332", "text": "function dettArgomento(argomenti) {\n let codHtml = \"\";\n $(\"#msgCercaArg\").html(\"\").removeClass(\"alert alert-danger\");\n $(\"#risultato\").remove();\n\n if (argomenti.length > 0) {\n codHtml += '<div class=\"row\" id=\"risultato\">';\n codHtml += '<table class=\"table\">';\n codHtml += \"<tr>\";\n codHtml += '<th>Descrizione</th>';\n codHtml += '<th>Azione</th>';\n codHtml += '</tr>';\n\n argomenti.forEach(argomento => {\n codHtml += '<tr id=\"riga_' + argomento._id + '\">';\n codHtml += '<td>' + argomento.descrizione + '</td>';\n codHtml += '<td><button class=\"genric-btn success circle\" onclick=\"addArgCorso(' + argomento._id + ')\"><i class=\"fa fa-plus\" aria-hidden=\"true\"></i></button></td>';\n codHtml += '</tr>';\n });\n\n codHtml += '</table>';\n codHtml += '</div>';\n }\n else {\n $(\"#msgCercaArg\").text(\"Nessun argomento trovato\").addClass(\"alert alert-danger\");\n $(\"#risultato\").remove();\n }\n\n $(\"#dettCorsoMod .modal-body\").append(codHtml);\n}", "title": "" }, { "docid": "41731a211b7ddb71e4215c5a4d99b5b3", "score": "0.5863055", "text": "function omModalGerator(modal_type = 'add', containerSelector) {\n var\n itemID = $(containerSelector).attr('id'),\n pdfLayouts = $(containerSelector).data('pdflayouts').split(',');\n $(containerSelector).css('display', 'block');\n if (modal_type === 'add') {\n // 2nd layer\n // $('<div></div>').attr({\n // class: 'modal2ndlayer'\n // }).appendTo(containerSelector);\n\n // modal form\n // $('<form></form>').attr({\n // action: 'javascript:void(0)',\n // method: 'post',\n // class: 'mail-modal-form'\n // }).appendTo(containerSelector + ' .modal2ndlayer');\n\n // pdf layout selection\n $('<label></label>').attr('for', 'pdf_layouts').text('PDF Layout:')\n .appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form .form-input');\n $('<select></select>').attr({\n name: 'pdf_layouts'\n }).appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form .form-input');\n for (var i = 0; i < pdfLayouts.length; i++) {\n console.log(pdfLayouts[i].replace('_', ' ').toUpperCase());\n $('<option></option>').attr({\n value: pdfLayouts[i]\n }).text(pdfLayouts[i].replace('_', ' ').toUpperCase())\n .appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form .form-input select[name=pdf_layouts]');\n }\n\n // mail number\n $('<label></label>').attr('for', 'mail_number').text('Nomor Surat:')\n .appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form .form-input');\n $('<input>').attr({\n type: 'text',\n name: 'mail_number',\n placeholder: 'Ex: XII/M2/19'\n }).appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form .form-input');\n\n // mail subject\n $('<label></label>').attr('for', 'mail_subject').text('Perihal:')\n .appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form .form-input');\n $('<input>').attr({\n type: 'text',\n name: 'mail_subject',\n placeholder: 'Ex: Rapat Umum'\n }).appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form .form-input');\n\n // // mail contents\n // $('<label></label>').attr('for', 'mail_contents').text('Isi Surat:')\n // .appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form .form-input');\n // $('<textarea></textarea>').attr({\n // name: 'mail_contents',\n // class: 'widgEditor',\n // id: 'mailContentsEditor',\n // style: 'display: none'\n // }).appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form .form-input');\n\n // // hidden input\n // $('<input>').attr({\n // type: 'hidden',\n // name: 'editor_data',\n // value: 'no_data'\n // }).appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form .form-input');\n\n // button save\n $('<button></button>').attr({\n type: 'submit',\n name: 'save_om',\n class: 'button add-om-submit save'\n }).html('<i class=\"fa fa-save\"></i> Simpan').click(function() {\n let\n form = $(containerSelector + ' .modal2ndlayer .mail-modal-form'),\n fdata = {},\n i = 0,\n iframeData = $(\"#mailContentsEditorWidgIframe\").contents().find('body').html();\n\n $(\"#mailContentsEditor\").val(iframeData);\n $(containerSelector + ' .modal2ndlayer .mail-modal-form input[name=editor_data]').val(iframeData);\n for (; i < form[0].length; i++) {\n fdata[form[0][i].name] = form[0][i].value;\n }\n\n $.ajax({\n type: \"POST\",\n url: baseURL() + '/user/om_action_exec',\n data: {\n request_data: JSON.stringify({\n action: 'save',\n om_data: fdata,\n t: $.cookie('t')\n })\n },\n dataType: \"json\",\n }).done(function() {\n\n }).fail(function() {\n\n }).always(function(result) {\n if (result.status == 'success') {\n var pgnt = new Pagination(result.data.user_setting['row_limit'], '.item', 'page-link', '.pagination');\n var hideElement = '';\n var atrgr = new ActionTrigger();\n var id = 0;\n var itemData = JSON.stringify(result.data);\n id = $('.table-container#outgoingMail .item-list tbody .item').length + 1;\n // tambahkan item lenght untuk fungsi pagniate\n if ($(pgnt.itemToPaginate).not(pgnt.itemToPaginate + '.hide').length == pgnt.itemLimit) {\n hideElement = ' hide';\n }\n $('.table-container#outgoingMail .item-list tbody').append('<tr class=\"item id' + id + hideElement + '\"><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>');\n $('.table-container#outgoingMail .item-list tbody tr.item.id' + id).attr('data-itemdata', itemData);\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(0).html('<input type=\"checkbox\" class=\"checkbox item' + id + '\"><span class=\"checkmark item' + id + '\"><i class=\"fa fa-check\"></i></span>');\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(1).text(result.data['mail_number']);\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(2).text(result.data['subject']);\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(3).text(result.data['sender']);\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(4).html(result.data['status']);\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(5).text(result.data['date']);\n $('.table-container#outgoingMail .item-list tbody tr.item.id' + id + ' td').eq(6).append(\n '<button class=\"button action-btn view\" id=\"item' + id + '\"><i class=\"fa fa-eye\"></i></button>'\n );\n $('.table-container#outgoingMail .item-list tbody tr.item.id' + id + ' td').eq(6).append(\n '<button class=\"button action-btn trash\" id=\"item' + id + '\"><i class=\"fa fa-trash\"></i></button>'\n );\n atrgr.defineTrigger('checkboxAction' + id, 'checkbox_action');\n atrgr.defineTrigger('viewMail' + id, 'view_mail');\n atrgr.defineTrigger('throwMailToTrashOM' + id, 'throw_mail_tt');\n atrgr['checkboxAction' + id](id);\n atrgr['throwMailToTrashOM' + id](id, 'om', result.data);\n atrgr['viewMail' + id](id);\n if (result.data.user_setting['paging_status'] !== 1) {\n paginate = pgnt.updatePgNav();\n }\n\n $('.add-om-modal').css('display', 'none');\n $('#addOm').removeAttr('disabled');\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input input').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input select').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input label').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .mail-modal-form button').remove();\n\n $('.action-msg-notification').html('<p><i class=\"fa fa-check-circle\"></i> ' + result.message + '</p>');\n $('.action-msg-notification').removeClass('error');\n $('.action-msg-notification').removeClass('failed');\n $('.action-msg-notification').removeClass('warning');\n $('.action-msg-notification').addClass('success');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n } else if (result.status == 'failed') {\n $('.add-om-modal').css('display', 'none');\n $('#addOm').removeAttr('disabled');\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input input').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input select').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input label').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .mail-modal-form button').remove();\n\n $('.action-msg-notification').html('<p><i class=\"fa fa-exclamation-circle\"></i> ' + result.message + '</p>');\n $('.action-msg-notification').removeClass('success');\n $('.action-msg-notification').removeClass('warning');\n $('.action-msg-notification').removeClass('error');\n $('.action-msg-notification').addClass('failed');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n } else if (result.status == 'error') {\n $('.add-om-modal').css('display', 'none');\n $('#addOm').removeAttr('disabled');\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input input').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input select').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input label').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .mail-modal-form button').remove();\n\n $('.action-msg-notification').html('<p><i class=\"fa fa-exclamation-circle\"></i> ' + result.message + '</p>');\n $('.action-msg-notification').removeClass('success');\n $('.action-msg-notification').removeClass('warning');\n $('.action-msg-notification').removeClass('failed');\n $('.action-msg-notification').addClass('error');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n } else if (result.status == 'warning') {\n $('.add-om-modal').css('display', 'none');\n $('#addOm').removeAttr('disabled');\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input input').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input select').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input label').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .mail-modal-form button').remove();\n\n $('.action-msg-notification').html('<p><i class=\"fa fa-exclamation-triangle\"></i> ' + result.message + '</p>');\n $('.action-msg-notification').removeClass('success');\n $('.action-msg-notification').removeClass('failed');\n $('.action-msg-notification').removeClass('error');\n $('.action-msg-notification').addClass('warning');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n }\n });\n })\n .appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form');\n\n // button send\n $('<button></button>').attr({\n type: 'submit',\n name: 'send_om',\n class: 'button add-om-submit send'\n }).html('<i class=\"fa fa-paper-plane\"></i> Kirim').click(function() {\n let\n form = $(containerSelector + ' .modal2ndlayer .mail-modal-form'),\n fdata = {},\n i = 0,\n iframeData = $(\"#mailContentsEditorWidgIframe\").contents().find('body').html();\n\n $(\"#mailContentsEditor\").val(iframeData);\n $(containerSelector + ' .modal2ndlayer .mail-modal-form input[name=editor_data]').val(iframeData);\n for (; i < form[0].length; i++) {\n fdata[form[0][i].name] = form[0][i].value;\n }\n $.ajax({\n type: \"POST\",\n url: baseURL() + '/user/om_action_exec',\n data: {\n request_data: JSON.stringify({\n action: 'send',\n om_data: fdata,\n t: $.cookie('t')\n })\n },\n dataType: \"json\",\n }).done(function() {\n\n }).fail(function() {\n\n }).always(function(result) {\n if (result.status == 'success') {\n var pgnt = new Pagination(result.data.user_setting['row_limit'], '.item', 'page-link', '.pagination');\n var hideElement = '';\n var atrgr = new ActionTrigger();\n var id = 0;\n var itemData = JSON.stringify(result.data);\n id = $('.table-container#outgoingMail .item-list tbody .item').length + 1;\n // tambahkan item lenght untuk fungsi pagniate\n if ($(pgnt.itemToPaginate).not(pgnt.itemToPaginate + '.hide').length == pgnt.itemLimit) {\n hideElement = ' hide';\n }\n $('.table-container#outgoingMail .item-list tbody').append('<tr class=\"item id' + id + hideElement + '\"><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>');\n $('.table-container#outgoingMail .item-list tbody tr.item.id' + id).attr('data-itemdata', itemData);\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(0).html('<input type=\"checkbox\" class=\"checkbox item' + id + '\"><span class=\"checkmark item' + id + '\"><i class=\"fa fa-check\"></i></span>');\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(1).text(result.data['mail_number']);\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(2).text(result.data['subject']);\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(3).text(result.data['sender']);\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(4).html(result.data['status']);\n $('.table-container#outgoingMail .item-list tbody .item.id' + id + ' td').eq(5).text(result.data['date']);\n $('.table-container#outgoingMail .item-list tbody tr.item.id' + id + ' td').eq(6).append(\n '<button class=\"button action-btn view\" id=\"item' + id + '\"><i class=\"fa fa-eye\"></i></button>'\n );\n $('.table-container#outgoingMail .item-list tbody tr.item.id' + id + ' td').eq(6).append(\n '<button class=\"button action-btn trash\" id=\"item' + id + '\"><i class=\"fa fa-trash\"></i></button>'\n );\n atrgr.defineTrigger('checkboxAction' + id, 'checkbox_action');\n atrgr.defineTrigger('viewMail' + id, 'view_mail');\n atrgr.defineTrigger('throwMailToTrashOM' + id, 'throw_mail_tt');\n atrgr['checkboxAction' + id](id);\n atrgr['throwMailToTrashOM' + id](id, 'om', result.data);\n atrgr['viewMail' + id](id);\n if (result.data.user_setting['paging_status'] !== 1) {\n paginate = pgnt.updatePgNav();\n }\n\n $('.add-om-modal').css('display', 'none');\n $('#addOm').removeAttr('disabled');\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input input').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input select').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input label').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .mail-modal-form button').remove();\n\n $('.action-msg-notification').html('<p>' + result.message + '</p>');\n $('.action-msg-notification').removeClass('error');\n $('.action-msg-notification').removeClass('failed');\n $('.action-msg-notification').removeClass('warning');\n $('.action-msg-notification').addClass('success');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n } else if (result.status == 'failed') {\n $('.add-om-modal').css('display', 'none');\n $('#addOm').removeAttr('disabled');\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input input').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input select').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input label').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .mail-modal-form button').remove();\n\n $('.action-msg-notification').html('<p>' + result.message + '</p>');\n $('.action-msg-notification').removeClass('success');\n $('.action-msg-notification').removeClass('warning');\n $('.action-msg-notification').removeClass('error');\n $('.action-msg-notification').addClass('failed');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n } else if (result.status == 'error') {\n $('.add-om-modal').css('display', 'none');\n $('#addOm').removeAttr('disabled');\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input input').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input select').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input label').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .mail-modal-form button').remove();\n\n $('.action-msg-notification').html('<p>' + result.message + '</p>');\n $('.action-msg-notification').removeClass('success');\n $('.action-msg-notification').removeClass('warning');\n $('.action-msg-notification').removeClass('failed');\n $('.action-msg-notification').addClass('error');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n } else if (result.status == 'warning') {\n $('.add-om-modal').css('display', 'none');\n $('#addOm').removeAttr('disabled');\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input input').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input select').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .form-input label').remove();\n $('.casual-theme.add-om-modal .modal2ndlayer .mail-modal-form button').remove();\n\n $('.action-msg-notification').html('<p>' + result.message + '</p>');\n $('.action-msg-notification').removeClass('success');\n $('.action-msg-notification').removeClass('failed');\n $('.action-msg-notification').removeClass('error');\n $('.action-msg-notification').addClass('warning');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n }\n });\n })\n .appendTo(containerSelector + ' .modal2ndlayer .mail-modal-form');\n }\n $(containerSelector).css('display', 'block');\n }", "title": "" }, { "docid": "85c7dc98995b7b391b50d193b99e8766", "score": "0.5861886", "text": "function showrespostes(tipus){\r\n\t//Variables\r\n\t{\r\n\t\tvar op1= document.getElementById(\"resposta1\");\r\n\t\tvar op2= document.getElementById(\"resposta2\");\r\n\t\tvar op3= document.getElementById(\"resposta3\");\r\n\t\tvar op4= document.getElementById(\"resposta4\");\r\n\t\tvar op5= document.getElementById(\"resposta5\");\r\n\t\tvar lab4=document.getElementById(\"DragOp\");\r\n\t\tvar lab5=document.getElementById(\"DragOp2\");\r\n\t\tvar cat1=document.getElementById(\"cat1\");\r\n\t\tvar op1=document.getElementById(\"resposta1\");\r\n\t}\r\n\tlet selectedValue = tipus.options[tipus.selectedIndex].value;\r\n\tlet subForms = document.getElementsByClassName('subform')\r\n\tfor (let i = 0; i < subForms.length; i += 1) {\r\n\t\tif(selectedValue==\"Swipe\"){\r\n\t\t\tsubForms[0].setAttribute('style', 'display:inline')\r\n\t\t\tsubForms[1].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[2].setAttribute('style', 'display:inline')\r\n\t\t\tsubForms[3].setAttribute('style', 'display:inline')\r\n\t\t\top4.setAttribute('style', 'display:none')\r\n\t\t\top5.setAttribute('style', 'display:none')\r\n\t\t\tlab4.setAttribute('style', 'display:inline')\r\n\t\t\tlab5.setAttribute('style', 'display:inline')\r\n\t\t\top1.required=true;\r\n\t\t\top2.required=true;\r\n\t\t\top3.required=true;\r\n\t\t\top4.required=false;\r\n\t\t\top5.required=false;\t \r\n\t\t}\r\n\t\telse if(selectedValue==\"Drag-categories\"||selectedValue==\"Relació\"){\r\n\t\t\tsubForms[0].setAttribute('style', 'display:inline')\r\n\t\t\tsubForms[1].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[2].setAttribute('style', 'display:inline')\r\n\t\t\tsubForms[3].setAttribute('style', 'display:inline')\r\n\t\t\top4.setAttribute('style', 'display:inline')\r\n\t\t\top5.setAttribute('style', 'display:inline')\r\n\t\t\tlab4.setAttribute('style', 'display:none')\r\n\t\t\tlab5.setAttribute('style', 'display:none')\r\n\t\t\top1.required=true;\r\n\t\t\top2.required=true;\r\n\t\t\top3.required=true;\r\n\t\t\top4.required=true;\r\n\t\t\top5.required=true; \r\n\t\t} \r\n\t\telse if(selectedValue==\"Filtre\" || selectedValue == \"Youtube\"){\r\n\t\t\tsubForms[0].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[1].setAttribute('style', 'display:inline')\r\n\t\t\tsubForms[2].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[3].setAttribute('style', 'display:inline')\r\n\t\t\tcat1.required=false;\r\n\t\t\top1.required=false;\r\n\t\t\top2.required=false;\r\n\t\t\top3.required=false;\r\n\t\t\top4.required=false;\r\n\t\t\top5.required=false;\r\n \t\t}\r\n\t\telse if(selectedValue==\"Opció múltiple\"||selectedValue==\"Ordenar\"){\r\n\t\t\tsubForms[0].setAttribute('style', 'display:inline')\r\n\t\t\tsubForms[1].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[2].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[3].setAttribute('style', 'display:inline')\r\n\t\t\top4.setAttribute('style', 'display:inline')\r\n\t\t\top5.setAttribute('style', 'display:inline')\r\n\t\t\tlab4.setAttribute('style', 'display:none')\r\n\t\t\tlab5.setAttribute('style', 'display:none')\r\n\t\t\tcat1.required=false;\r\n\t\t}\r\n\t\telse if(selectedValue == \"RespuestaLibre\"){\r\n\t\t\tsubForms[0].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[1].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[2].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[3].setAttribute('style', 'display:block')\r\n\t\t\top4.setAttribute('style', 'display:none')\r\n\t\t\top5.setAttribute('style', 'display:none')\r\n\t\t\tlab4.setAttribute('style', 'display:none')\r\n\t\t\tlab5.setAttribute('style', 'display:none')\r\n\t\t\tcat1.required=false;\r\n\t\t\top1.required=false;\r\n\t\t}else if(selectedValue == \"Buscador\"){\r\n\t\t\tsubForms[0].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[1].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[2].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[3].setAttribute('style', 'display:block')\r\n\t\t\top4.setAttribute('style', 'display:none')\r\n\t\t\top5.setAttribute('style', 'display:none')\r\n\t\t\tlab4.setAttribute('style', 'display:none')\r\n\t\t\tlab5.setAttribute('style', 'display:none')\r\n\t\t\tcat1.required=false;\r\n\t\t\top1.required=false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tsubForms[0].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[1].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[2].setAttribute('style', 'display:none')\r\n\t\t\tsubForms[3].setAttribute('style', 'display:none')\r\n\t\t\top4.setAttribute('style', 'display:none')\r\n\t\t\top5.setAttribute('style', 'display:none')\r\n\t\t\tlab4.setAttribute('style', 'display:none')\r\n\t\t\tlab5.setAttribute('style', 'display:none')\r\n\t\t} \r\n \t}\r\n}", "title": "" }, { "docid": "0256d3f10579dba204d24e4a352da7c3", "score": "0.5858874", "text": "function generer() {\n\n function phraseAleatoire(motArrondi) {\n return motArrondi[Math.floor(Math.random() * motArrondi.length)];\n\n }\n\n /* Déclaration de la variable newPhrase qui va contenir la phrase générée aléatoirement grâce à la fonciton phraseAleatoire\n * intégrée dans la fonction generer(permettant de cliquer pour générer une phrase aléatoire).\n */\n var newPhrase = \"\";\n newPhrase += phraseAleatoire(nom) + \" \" + phraseAleatoire(verbe) + \" \" + phraseAleatoire(complement) + \".\"\n\n // Stockage du paragraphe récupéré dans la page vue html \n var para = document.getElementById(\"phraseAleatoireGeneree\");\n\n // design du paragraphe généré : \n \n para.style.fontWeight = \"bold\";\n para.style.color = \"green\";\n para.style.backgroundColor = \"#D3D3D8\";\n para.style.display = \"inline-block\";\n para.style.textAlign = \"center\";\n para.style.paddingTop = \"25px\";\n para.style.width = \"100%\";\n para.style.height = \"50px\";\n \n // Injection de la phrase générée dans le innerHTML du paragrpahe contenu dans la variable para.\n para.innerHTML = newPhrase;\n\n\n\n\n /*Débogage développeur => Pour les tests via la console (touche F12)*/\n// console.log(phraseAleatoire(nom) + \" \" + phraseAleatoire(verbe) + \" \" + phraseAleatoire(complement) + \".\");\n\n\n}", "title": "" }, { "docid": "5f35b15aaa54403e6ec653d32fbb8b21", "score": "0.5858222", "text": "function callback_menu(tooltips)\n{\n\tmodal.style.display = \"block\";\n\tmodal_content.innerHTML = \"\";\n\n\tvar header = document.createElement(\"span\");\n\theader.style.fontSize = \"25px\";\n\theader.innerHTML = this.name + \" Options\";\n\tmodal_content.appendChild(header);\n\tmodal_content.innerHTML += \"<br><br>\";\n\n\tvar values = (this.temp_values !== null ? this.temp_values : this.values);\n\tfor (let key in values)\n\t{\n\t\tvar type = typeof(values[key]);\n\n\t\tif (type == \"boolean\")\n\t\t{\n\t\t\tvar btn = document.createElement(\"button\");\n\t\t\tbtn.setAttribute(\"id\", this.name + \"_\" + key);\n\t\t\tbtn.style.width = \"150px\";\n\t\t\tbtn.style.color = (values[key] ? \"green\" : \"#919191\");\n\t\t\tbtn.innerHTML = key; // + (this.values[key] ? \" [ON]\" : \" [OFF]\");\n\t\t\tmodal_content.appendChild(btn);\n\t\t}\n\t\telse if (type == \"number\")\n\t\t{\n\t\t\tmodal_content.innerHTML += key + \"&nbsp&nbsp&nbsp\";\n\t\t\tvar input = document.createElement(\"input\");\n\t\t\tinput.setAttribute(\"id\", this.name + \"_\" + key);\n\t\t\tinput.setAttribute(\"type\", \"number\");\n\t\t\tinput.setAttribute(\"value\", values[key]);\n\t\t\tinput.style.width = \"75px\";\n\t\t\tinput.style.textAlign = \"center\";\n\t\t\tmodal_content.appendChild(input);\n\t\t}\n\t\telse if (type == \"string\")\n\t\t{\n\t\t\tmodal_content.innerHTML += key + \"&nbsp&nbsp&nbsp\";\n\t\t\tvar input = document.createElement(\"input\");\n\t\t\tinput.setAttribute(\"id\", this.name + \"_\" + key);\n\t\t\tinput.setAttribute(\"value\", values[key]);\n\t\t\tinput.style.textAlign = \"center\";\n\t\t\tmodal_content.appendChild(input);\n\t\t}\n\n\t\tmodal_content.innerHTML += \"&nbsp&nbsp&nbsp&nbsp\";\n\n\t\tif (tooltips[key])\n\t\t{\n\t\t\tvar tooltip = document.createElement(\"div\");\n\t\t\ttooltip.setAttribute(\"id\", this.name + \"_\" + key + \"_\" + \"tooltip\");\n\t\t\ttooltip.style.position = \"absolute\";\n\t\t\ttooltip.style.display = \"inline-block\";\n\t\t\ttooltip.style.border = \"1px dotted black\";\n\t\t\ttooltip.style.padding = \"2px 5px\";\n\t\t\ttooltip.innerHTML = \"?\";\n\n\t\t\tvar tooltip_text = document.createElement(\"span\");\n\t\t\ttooltip_text.setAttribute(\"id\", \"tooltip\");\n\t\t\ttooltip_text.setAttribute(\"id\", this.name + \"_\" + key + \"_\" + \"tooltip_text\");\n\t\t\ttooltip_text.innerHTML = tooltips[key];\n\t\t\ttooltip_text.style.visibility = \"hidden\";\n\t\t\ttooltip_text.style.width = \"350px\";\n\t\t\ttooltip_text.style.backgroundColor = \"#555555\";\n\t\t\ttooltip_text.style.color = \"white\";\n\t\t\ttooltip_text.style.textAlign = \"center\";\n\t\t\ttooltip_text.style.borderRadius = \"6px\";\n\t\t\ttooltip_text.style.padding = \"5px\";\n\t\t\ttooltip_text.style.position = \"absolute\";\n\t\t\ttooltip_text.style.zIndex = 1;\n\t\t\ttooltip_text.style.bottom = \"100%\";\n\n\t\t\ttooltip.appendChild(tooltip_text);\n\t\t\tmodal_content.appendChild(tooltip);\n\t\t}\n\n\t\tmodal_content.innerHTML += \"<br><br>\";\n\t}\n\n\t// For some reason adding the event listeners doesn't work in the same loop\n\tfor (let key in this.values)\n\t{\n\t\tvar ele = document.getElementById(this.name + \"_\" + key);\n\t\tvar type = typeof(this.values[key]);\n\t\tif (type == \"boolean\") ele.addEventListener(\"click\", callback_menu_item.bind(this, key, ele, type));\n\t\telse if (type == \"number\" || type == \"string\") ele.addEventListener(\"change\", callback_menu_item.bind(this, key, ele, type));\n\n\t\tif (tooltips[key])\n\t\t{\n\t\t\tvar tooltip = document.getElementById(this.name + \"_\" + key + \"_\" + \"tooltip\");\n\t\t\ttooltip.addEventListener(\"mouseenter\", function() { this.children[0].style.visibility = \"visible\"; });\n\t\t\ttooltip.addEventListener(\"mouseleave\", function() { this.children[0].style.visibility = \"hidden\"; });\n\t\t}\n\t}\n}", "title": "" }, { "docid": "adec6a3f93907ed4173094927dc9593e", "score": "0.5855055", "text": "function MostrarVentanaSeEgre(id){\n if (id == '1') {\n document.getElementById('v-pills-uno').style.display = '';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('v-pills-siete').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none';\n } \n if (id == '2') {\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = '';\n document.getElementById('v-pills-tres').style.display = 'none'; \n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('v-pills-siete').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none';\n } \n if (id == '3') {\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = ''; \n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('v-pills-siete').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none';\n } \n if (id == '4'){\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = '';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('v-pills-siete').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none'; \n }\n if (id == '5'){\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = '';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('v-pills-siete').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none'; \n }\n if (id == '6'){\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = '';\n document.getElementById('v-pills-siete').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none'; \n }\n if (id == '7'){\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('v-pills-siete').style.display = '';\n document.getElementById('reportPage').style.display = ''; \n }\n if (id == '8'){\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('v-pills-siete').style.display = 'none';\n document.getElementById('reportPage').style.display = ''; \n }\n}", "title": "" }, { "docid": "3dddd5213bbab0967fd63376f45a8078", "score": "0.5851216", "text": "function response_crear_editar_content(result, vista){\n\n //crear\n if( vista == 1 ){\n if ( $('.list > tr:last-of-type').clone().appendTo('.list') ){\n $('.list > tr:last-of-type').attr('data-id', result.paciente.id)\n }\n }\n limpiar_formulario_pacientes()\n $('.vistas').hide()\n $('#list').show()\n\n //datos actualizados del $paciente\n setTimeout(function(){\n\n var paciente = '.row-id[data-id=\"'+result.paciente.id+'\"]'\n\n console.log( result.paciente );\n\n //Listar paciente en fila\n $(paciente+' .identificacion_id').html(result.paciente.identificacion.id)\n $(paciente+' .name').html(result.paciente.identificacion.name)\n\n $(paciente+' .documento').html(result.paciente.documento)\n $(paciente+' .nombre_1').html(result.paciente.nombre_1)\n $(paciente+' .nombre_2').html(result.paciente.nombre_2)\n $(paciente+' .apellido_1').html(result.paciente.apellido_1)\n $(paciente+' .apellido_2').html(result.paciente.apellido_2)\n //$(paciente+' .txt-name').html(n1+' '+n2+' '+n3+' '+n4)\n $(paciente+' .edad').html(result.paciente.edad)\n $(paciente+' .sexo').html(result.paciente.sexo)\n $(paciente+' .celular').html(result.paciente.celular)\n\n $(paciente+' .dev-offline-paciente').attr('data-id', result.paciente.id)\n\n\n //cargar botones solo al crear\n if( vista == 1 ){\n /*************************** [6]\n ** BOTON VER PACIENTE **\n ***************************/\n $(paciente+' .dev-ver-paciente').click(function(){\n ver_paciente( $(this).parent('td').parent('tr').data('id') )\n })\n\n /****************************** [4]\n ** VISTA EDITAR PROFESIONAL **\n ******************************/\n $(paciente+' .dev-edit-paciente').click(function(){\n $('#registrar').hide()\n $('#editar').show()\n editar_paciente( $(this).parent('td').parent('tr').data('id') )\n })\n\n /********************************** [8]\n ** BOTON DESACTIVAR PROFESIONAL **\n **********************************/\n $(paciente+' .dev-offline-paciente').click(function(){\n active_profesional($(this).parent('td').parent('tr').data('id'))\n })\n }\n\n var n_rows = $('.dev-table-fix table thead tr th').length\n for( var i = 1; i <= n_rows; i++ ){\n $('.dev-stick > tr > th:nth-child('+i+')').width( $('.dev-table-fix table thead tr th:nth-child('+i+')').width() )\n }\n },300)\n\n}", "title": "" }, { "docid": "94e2a01886caaac93ca63dee496c5b14", "score": "0.58472335", "text": "function agregaComentario(comentario, user_name, user_id){\n\tvar l2 = '';\n\tvar l1 = '';\n\tvar l8 = '';\n\n\n// Validamos si el usuario acaba de agregar el comentario o estamos leyendo todos\nif (user_name != undefined){\n\tnombre = user_name\n\t// Como el usuario conectado acaba de crear el comentario entonces el lo puede eliminar\n\tl2 = \t'<button class=\"pull-right btn btn-default btn-xs\" onclick=\"mandaEliminarComentario(\\''+comentario._id+'\\')\" rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Elimina tu comentario\">'+\n\t\t\t\t'<span class=\"text-danger glyphicon glyphicon-trash\"></span></button>';\n}\nelse{\n\tnombre = comentario._creador.name\n\t// Valido que el usario conectado haya creado el comentario xD\n\tif (user_id == comentario._creador._id){\n\t\tl2 = \t'<button class=\"pull-right btn btn-default btn-xs\" onclick=\"mandaEliminarComentario(\\''+comentario._id+'\\')\" rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Elimina tu comentario\">'+\n\t\t\t\t\t'<span class=\"text-danger glyphicon glyphicon-trash\"></span></button>';\n\t}\t\n}\n// Comprobamos que el que creo el articulo es que esta comentando o sea que el vendedor comente su articulo xD\nif (comentario._articulo._creador == comentario._creador._id){\n\tl1 = '<div id=\"'+comentario._id+'\" class=\"panel panel-default comentarioVendedor\"><div class=\"panel-body\">'+\n\t\t\t\t'<div class=\"col-lg-2\">'+\n\t\t\t\t\t'<p class=\"text-primary\">';\n}else{\n\tl1 = '<div id=\"'+comentario._id+'\" class=\"panel panel-default\"><div class=\"panel-body\">'+\n\t\t\t'<div class=\"col-lg-2\">'+\n\t\t\t\t'<p class=\"text-primary\">';\n}\nvar positivos = 0;\nvar negativos = 0;\nvar yaCalifico = false;\n$.each(comentario.calificacion, function(index, calificacion){\n\tif (calificacion.calificacion == true)\n\t\tpositivos++;\n\telse\n\t\tnegativos++;\n\tif (calificacion.usuario == user_id)\n\t\tyaCalifico = true\n\n});\n\n\nif (yaCalifico == true){\n\t\tl8 =\t'<button id=\"'+comentario._id+'btn-negativos\" class=\"pull-right btn btn-default btn-xs\" disabled rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Vota negativo\">'+\n\t\t\t\t\t'<span id=\"'+comentario._id+'negativos\" class=\"text-danger glyphicon glyphicon-minus\">'+negativos+'</span></button>'+\n\t\t\t\t'<button id=\"'+comentario._id+'btn-positivos\" class=\"pull-right btn btn-default btn-xs\" disabled rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Vota positivo\">'+\n\t\t\t\t\t'<span id=\"'+comentario._id+'positivos\" class=\"text-success glyphicon glyphicon-ok\">'+positivos+'</span></button>';\n}else{\n\t\tl8 =\t'<button id=\"'+comentario._id+'btn-negativos\" class=\"pull-right btn btn-default btn-xs\" onclick=\"calificaComentario(\\''+comentario._id+'\\', false)\" rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Vota negativo\">'+\n\t\t\t\t\t'<span id=\"'+comentario._id+'negativos\" class=\"text-danger glyphicon glyphicon-minus\">'+negativos+'</span></button>'+\n\t\t\t\t'<button id=\"'+comentario._id+'btn-positivos\" class=\"pull-right btn btn-default btn-xs\" onclick=\"calificaComentario(\\''+comentario._id+'\\', true)\" rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Vota positivo\">'+\n\t\t\t\t\t'<span id=\"'+comentario._id+'positivos\" class=\"text-success glyphicon glyphicon-ok\">'+positivos+'</span></button>';\n}\n\n\nfecha = new Date(comentario.fecha_creacion);\n\tl1 = l1\n\tl2 = l2\nvar l3 =\t\t\t'<strong>'+nombre+':</strong><br>';\nvar l4 =\t\t\t'<small class=\"text-muted\">'+fecha.toLocaleString()+'</small>';\nvar l5 =\t\t'</p>';\nvar l6 =\t'</div>';\nvar l7 =\t'<div class=\"col-lg-10\">';\n\tl8 = l8\nvar l9 = \t\t'<button class=\"pull-right btn btn-default btn-xs\" onclick=\"respondeComentario(\\''+comentario._id+'\\')\" rel=\"tooltip\" data-toggle=\"tooltip\" title=\"Responde a este comentario\">'+\n\t\t\t\t\t'<span class=\"text-primary glyphicon glyphicon-comment\"></span></button>';\nvar l10 =\t\t'<small id=\"wordwrap\">'+comentario.comentario+' </small>';\nvar l11 =\t'</div>';\nvar l12 = '</div></div><div id=\"'+comentario._id+'respuestas\" class=\"col-lg-offset-1\"></div>';\n\nvar comentarioHTML = l1+l2+l3+l4+l5+l6+l7+l8+l9+l10+l11+l12;\nif (comentario.respuesta != undefined){\n\tif ( $('#'+comentario.respuesta+'respuestas').length ) {\n\t\t$('#'+comentario.respuesta+'respuestas').append(comentarioHTML);\n\t}else{\n\t\t$('#mostrarComentarios').prepend(comentarioHTML);\n\t}\n}else{\n\t$('#mostrarComentarios').prepend(comentarioHTML);\n}\n\n\n}", "title": "" }, { "docid": "e8f29d2acb647eafa563c90b3c667972", "score": "0.5845886", "text": "function CertificadoOtros()\n{\n\t/*\n\t\n\t$( \"#AreaCertificados\" ).attr(\"title\",\"Certificado Otros\");\n\t$( \"#AreaCertificados\" ).dialog({\n\t\t\tautoOpen: false,\n\t\t\tmodal: true,\n\t\t\theight:300,\n\t\t\twidth:750,\n\t\t\tshow: {\n\t\t\t\teffect: \"slide\",\n\t\t\t\tduration: 1000\n\t\t\t},\n\t\t\thide: {\n\t\t\t\teffect: \"drop\",\n\t\t\t\tduration: 1000\n\t\t\t}\n\t\t});\n\n\t\t$( \"#AreaCertificados\" ).dialog( \"open\" );*/\n\t\t//aqui esta el div para capturaora el texto a imprimir en el certidicado de otros es: \tTextoParaCertificadoOtros\n\t\tHome();\n\t\t$(\".Resp1\").html(\"<center><table> <tr> <td><center><h1>CERTIFICADO</h1></center></td> </tr> <tr> <td><label for='txtcertificadootros'></label> <textarea name='txtcertificadootros' style='width:600px;' id='txtcertificadootros' cols='200' rows='3'></textarea></td> </tr> <tr> <td><center><input type='button' class='btn btn-primary' onclick='ImpCertificadoOtros()' value='Imprimir' /></center></td> </tr> </table></center>\");\n}", "title": "" }, { "docid": "5a0cd729fc1c21cda10c2c2afe57af73", "score": "0.58432126", "text": "function mostraModaleConfermaStampaRicevuta()\n {\n\n modaleConferma.modal(\"show\");\n }", "title": "" }, { "docid": "0fb501e2309e8759b8937ff353ffdf3a", "score": "0.58424765", "text": "makeHeadModal(i){\n switch (i) {\n case -1:\n return 'Algo paso :(';\n case 0: \n return 'Enviando Formulario:';\n case 1:\n return 'Felicitaciones :D';\n }\n }", "title": "" }, { "docid": "babe41ff1f997078a7b46a4693ad74c1", "score": "0.5842252", "text": "function mostrarPaginaEjercicios(){\n\tframeDerecho.location = \"ejercicios.html\";\n}", "title": "" }, { "docid": "a6e249297c4024138047e84844043c39", "score": "0.5841768", "text": "function PrintReceEpi(code){\n\t//SaveEpicrisis();\n\n\tsetTimeout(function(){\n\t\n\t/*$(\"#ImpReceEpicrisis\").attr(\"title\",\"Receta\");\n\t$( \"#ImpReceEpicrisis\" ).dialog({\n\t\t\tautoOpen: false,\n\t\t\tmodal: true,\n\t\t\theight:600,\n\t\t\twidth:1000,\n\t\t\tshow: {\n\t\t\t\teffect: \"blind\",\n\t\t\t\tduration: 1000\n\t\t\t},\n\t\t\thide: {\n\t\t\t\teffect: \"explode\",\n\t\t\t\tduration: 1000\n\t\t\t}\n\t\t});\n\t\t$( \"#ImpReceEpicrisis\" ).dialog( \"open\" );\t*/\n\t\t$( \".modal-body\" ).html(\"<object type='text/html' data='../Reportes/RecetaEpicrisis.php?id=\"+code+\"'></object>\");\n\n\t},1000);\t\n\n\n}", "title": "" }, { "docid": "dcaf3d3d7ecddcd35e91e2b9a2992f9d", "score": "0.58410376", "text": "function MostrarVentanaSE(id){\n if (id == '1') {\n document.getElementById('v-pills-uno').style.display = '';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none';\n } \n if (id == '2') {\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = '';\n document.getElementById('v-pills-tres').style.display = 'none'; \n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none';\n } \n if (id == '3') {\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = ''; \n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none';\n } \n if (id == '4'){\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = '';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none'; \n }\n if (id == '5'){\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = '';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('reportPage').style.display = 'none'; \n }\n if (id == '6'){\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = '';\n document.getElementById('reportPage').style.display = 'none'; \n }\n if (id == '7'){\n document.getElementById('v-pills-uno').style.display = 'none';\n document.getElementById('v-pills-dos').style.display = 'none';\n document.getElementById('v-pills-tres').style.display = 'none';\n document.getElementById('v-pills-cuatro').style.display = 'none';\n document.getElementById('v-pills-cinco').style.display = 'none';\n document.getElementById('v-pills-seis').style.display = 'none';\n document.getElementById('reportPage').style.display = ''; \n }\n}", "title": "" } ]
535a77e5cde03cde22285c72d27e55cd
Read and parse a single property file
[ { "docid": "8c4bcd9e552eae8f206044e4a904dd40", "score": "0.7380771", "text": "function parsePropertyFile(file) {\n return new Promise((resolve,reject)=>{\n var rdr = new FileReader()\n rdr.addEventListener(\"load\",(evt)=>{\n var rows = rdr.result.split(/\\r\\n?|\\n/)\n var prop = new i18n.Properties({name:file.name,rows:rows})\n resolve(prop)\n })\n rdr.readAsText(file)\n })\n }", "title": "" } ]
[ { "docid": "91456ec6916b25839c57298833097f1f", "score": "0.70747274", "text": "function readProp() {\n\n\t// Work on a per-line basis so that we never surpass a line and read stuff \n\t// from another property by accident.\n\tlet index = val.indexOf('\\n');\n\tlet line = val.slice(0, index);\n\tadvance(index);\n\n\tlet temp = val;\n\tval = line;\n\n\tlet id = readHex();\n\tuntil(':');\n\n\t// Read a potential comment.\n\tws();\n\tlet comment = readComment();\n\n\t// Read the values.\n\tuntil('=');\n\n\t// Read the type.\n\tindex = val.indexOf(':');\n\tlet type = val.slice(0, index);\n\tadvance(index+1);\n\n\t// Read the resp.\n\tindex = val.indexOf(':');\n\tlet reps = Number(val.slice(0, index));\n\tadvance(index+1);\n\n\tlet value = readValue(type, reps);\n\n\t// Restore.\n\tval = temp;\n\n\t// Consume trailing whitespace.\n\tws();\n\n\treturn {\n\t\t\"id\": id,\n\t\t\"comment\": comment,\n\t\t\"type\": type,\n\t\t\"value\": value\n\t};\n\n}", "title": "" }, { "docid": "1de3545f51d5bebffb14e802d88cf583", "score": "0.6069771", "text": "function parseProperties(text, parsedPropertiesCallback) {\r\n var dictionary = {};\r\n\r\n // token expressions\r\n var reBlank = /^\\s*|\\s*$/;\r\n var reComment = /^\\s*#|^\\s*$/;\r\n var reSection = /^\\s*\\[(.*)\\]\\s*$/;\r\n var reImport = /^\\s*@import\\s+url\\((.*)\\)\\s*$/i;\r\n var reSplit = /^([^=\\s]*)\\s*=\\s*(.+)$/; // TODO: escape EOLs with '\\'\r\n\r\n // parse the *.properties file into an associative array\r\n function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {\r\n var entries = rawText.replace(reBlank, '').split(/[\\r\\n]+/);\r\n var currentLang = '*';\r\n var genericLang = lang.split('-', 1)[0];\r\n var skipLang = false;\r\n var match = '';\r\n\r\n function nextEntry() {\r\n // Use infinite loop instead of recursion to avoid reaching the\r\n // maximum recursion limit for content with many lines.\r\n while (true) {\r\n if (!entries.length) {\r\n parsedRawLinesCallback();\r\n return;\r\n }\r\n var line = entries.shift();\r\n\r\n // comment or blank line?\r\n if (reComment.test(line))\r\n continue;\r\n\r\n // the extended syntax supports [lang] sections and @import rules\r\n if (extendedSyntax) {\r\n match = reSection.exec(line);\r\n if (match) { // section start?\r\n // RFC 4646, section 4.4, \"All comparisons MUST be performed\r\n // in a case-insensitive manner.\"\r\n\r\n currentLang = match[1].toLowerCase();\r\n skipLang = (currentLang !== '*') &&\r\n (currentLang !== lang) && (currentLang !== genericLang);\r\n continue;\r\n } else if (skipLang) {\r\n continue;\r\n }\r\n match = reImport.exec(line);\r\n if (match) { // @import rule?\r\n loadImport(baseURL + match[1], nextEntry);\r\n return;\r\n }\r\n }\r\n\r\n // key-value pair\r\n var tmp = line.match(reSplit);\r\n if (tmp && tmp.length == 3) {\r\n dictionary[tmp[1]] = evalString(tmp[2]);\r\n }\r\n }\r\n }\r\n nextEntry();\r\n }\r\n\r\n // import another *.properties file\r\n function loadImport(url, callback) {\r\n xhrLoadText(url, function(content) {\r\n parseRawLines(content, false, callback); // don't allow recursive imports\r\n }, function () {\r\n console.warn(url + ' not found.');\r\n callback();\r\n });\r\n }\r\n\r\n // fill the dictionary\r\n parseRawLines(text, true, function() {\r\n parsedPropertiesCallback(dictionary);\r\n });\r\n }", "title": "" }, { "docid": "482ec14c761a100df4a7314e6b0bd298", "score": "0.59610134", "text": "read () {\n this.configObj = JSON.parse(fs.readFileSync(this.configPath, 'utf8'))\n }", "title": "" }, { "docid": "28f9ea37f7eac69c0687cb500df8574d", "score": "0.5935783", "text": "function GetPropsFromFile(text) {\r\n let result1 = this.GetMyLine(text);\r\n return this.GetProps(result1);\r\n}", "title": "" }, { "docid": "adfdfb7ba15c65f5673f664b32e5e6ed", "score": "0.5762585", "text": "function setPropertiesFilePath(propertiesFilePath){\n if(fileExists(propertiesFilePath)) {\n properties = propertiesFileReader(propertiesFilePath);\n }\n}", "title": "" }, { "docid": "7db0275f535c7912cebfae8a7fd01d7a", "score": "0.552974", "text": "function processSM(filepath) {\n\t// object that will hold all the properties\n\tvar props = {};\n\n\t// get the raw data\n\tvar raw = readTextFile(filepath);\n\t\n\t// remove comments and split by line\n\tvar rawlines = raw[0].split('\\n');\n\tfor (var k = 0; k < rawlines.length; k++) {\n\t\trawlines[k] = rawlines[k].split('//')[0].trim();\n\t}\n\tvar rawtext = rawlines.join('\\n');\n\tvar lines = rawtext.split(';');\n\t\n\tprops.lastUpdated = raw[1];\t\t\t\t\t\t\t\t\t\t\t\t\t// last updated\n\t\n\t// file path related properties\n\tvar rootpath = filepath.split('/');\n\tprops.foldername = rootpath[rootpath.length-2];\t\t\t\t\t\t\t\t// folder name\n\tprops.smfile = rootpath[rootpath.length-1];\t\t\t\t\t\t\t\t\t// sm file name\n\tprops.dwifile = props.smfile.substring(0,props.smfile.length-2)+'dwi';\t\t// dwi file name\n\trootpath[rootpath.length-1] = '';\n\tprops.rootpath = rootpath.join('/');\t\t\t\t\t\t\t\t\t\t// root folder\n\t\n\tprops.levels = {\n\t\t'4k': [],\n\t\t'6k': [],\n\t\t'8k': []\n\t};\n\t\n\tfor (var rawline of lines) {\n\t\tvar line = rawline.trim();\n\t\tline = line.split(':');\n\t\tvar prop = line[0].split('#');\n\t\tprop = prop[prop.length-1];\n\t\tvar value = line.slice(1,line.length).join(':').trim();\n\t\t\n\t\t// get rid of blank property\n\t\tif (!prop) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// specific properties that require more handling\n\t\tswitch (prop) {\n\t\t\tcase 'BPMS':\n\t\t\t\tvar bpms = [];\n\t\t\t\tvar rawbpms = value.split(',');\n\t\t\t\tfor (var rawbpm of rawbpms) {\n\t\t\t\t\tvar bpm = rawbpm.trim().split('=');\n\t\t\t\t\tbpm[0] = +bpm[0];\n\t\t\t\t\tbpm[1] = +bpm[1];\n\t\t\t\t\tbpms.push(bpm);\n\t\t\t\t}\n\t\t\t\tprops[prop] = bpms;\n\t\t\t\tbreak;\n\t\t\tcase 'STOPS':\n\t\t\t\tvar stops = [];\n\t\t\t\tvar rawstops = value.split(',');\n\t\t\t\tfor (var rawstop of rawstops) {\n\t\t\t\t\tvar stop = rawstop.trim().split('=');\n\t\t\t\t\tif (stop.length === 1) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstop[0] = +stop[0];\n\t\t\t\t\tstop[1] = +stop[1];\n\t\t\t\t\tstops.push(stop);\n\t\t\t\t}\n\t\t\t\tprops[prop] = stops;\n\t\t\t\tbreak;\n\t\t\tcase 'XMODBPMS':\n\t\t\t\tvar bpms = [];\n\t\t\t\tvar rawbpms = value.split(',');\n\t\t\t\tfor (var rawbpm of rawbpms) {\n\t\t\t\t\tvar bpm = rawbpm.trim().split('=');\n\t\t\t\t\tbpm[0] = +bpm[0];\n\t\t\t\t\tbpm[1] = +bpm[1];\n\t\t\t\t\tbpms.push(bpm);\n\t\t\t\t}\n\t\t\t\tprops[prop] = bpms;\n\t\t\t\tbreak;\n\t\t\tcase 'XMODSTOPS':\n\t\t\t\tvar stops = [];\n\t\t\t\tvar rawstops = value.split(',');\n\t\t\t\tfor (var rawstop of rawstops) {\n\t\t\t\t\tvar stop = rawstop.trim().split('=');\n\t\t\t\t\tif (stop.length === 1) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstop[0] = +stop[0];\n\t\t\t\t\tstop[1] = +stop[1];\n\t\t\t\t\tstops.push(stop);\n\t\t\t\t}\n\t\t\t\tprops[prop] = stops;\n\t\t\t\tbreak;\n\t\t\tcase 'NOTES':\n\t\t\t\tvar chart = {};\n\t\t\t\t// split out the chart properties first\n\t\t\t\tvar setup = value.split(':');\n\t\t\t\tvar type = setup[0].trim();\n\t\t\t\t// check for number of columns\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 'dance-single':\n\t\t\t\t\t\tvar cols = 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'dance-solo':\n\t\t\t\t\t\tvar cols = 6;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'dance-double':\n\t\t\t\t\t\tvar cols = 8;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvar cols = 6;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// other properties\n\t\t\t\tchart.level = setup[2].trim();\n\t\t\t\tchart.diff = +(setup[3].trim());\n\t\t\t\t// notes\n\t\t\t\tvar rawmeasures = setup[setup.length-1].split(',');\n\t\t\t\tvar measures = [];\n\t\t\t\tfor (var rawmeasure of rawmeasures) {\n\t\t\t\t\tvar measureraw = '';\n\t\t\t\t\t// concat all lines after trimming\n\t\t\t\t\tvar rawmeasurelines = rawmeasure.split('\\n');\n\t\t\t\t\tfor (var rawmeasureline of rawmeasurelines) {\n\t\t\t\t\t\tmeasureraw += rawmeasureline.trim();\n\t\t\t\t\t}\n\t\t\t\t\t// split by number of columns\n\t\t\t\t\tvar measure = [];\n\t\t\t\t\tfor (var k = 0; k < measureraw.length; k+=cols) {\n\t\t\t\t\t\tmeasure.push(measureraw.slice(k,k+cols));\n\t\t\t\t\t}\n\t\t\t\t\tmeasures.push(measure);\n\t\t\t\t}\n\t\t\t\tchart.notes = measures;\n\t\t\t\t// add it to the final object\n\t\t\t\tvar mode = ''+cols+'k';\n\t\t\t\tprops.levels[mode].push(chart);\n\t\t\t\tbreak;\n\t\t\tcase 'OFFSET':\n\t\t\tcase 'SAMPLELENGTH':\n\t\t\tcase 'SAMPLESTART':\n\t\t\t\tprops[prop] = +value;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tprops[prop] = value;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t\n\treturn props;\n}", "title": "" }, { "docid": "10bf85506323c023747bb810a8fb4295", "score": "0.5470125", "text": "function readFiles(files) {\n var aFiles = Array.from(files)\n return Promise.all(aFiles.map(file=>parsePropertyFile(file)))\n }", "title": "" }, { "docid": "73a4a57a93e27da6a37c6010264a47fd", "score": "0.54389715", "text": "parseProps(offset) {\n const {\n inFlow,\n parent,\n src\n } = this;\n const props = [];\n let lineHasProps = false;\n offset = this.atLineStart ? PlainValue.Node.endOfIndent(src, offset) : PlainValue.Node.endOfWhiteSpace(src, offset);\n let ch = src[offset];\n\n while (ch === PlainValue.Char.ANCHOR || ch === PlainValue.Char.COMMENT || ch === PlainValue.Char.TAG || ch === '\\n') {\n if (ch === '\\n') {\n let inEnd = offset;\n let lineStart;\n\n do {\n lineStart = inEnd + 1;\n inEnd = PlainValue.Node.endOfIndent(src, lineStart);\n } while (src[inEnd] === '\\n');\n\n const indentDiff = inEnd - (lineStart + this.indent);\n const noIndicatorAsIndent = parent.type === PlainValue.Type.SEQ_ITEM && parent.context.atLineStart;\n if (src[inEnd] !== '#' && !PlainValue.Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;\n this.atLineStart = true;\n this.lineStart = lineStart;\n lineHasProps = false;\n offset = inEnd;\n } else if (ch === PlainValue.Char.COMMENT) {\n const end = PlainValue.Node.endOfLine(src, offset + 1);\n props.push(new PlainValue.Range(offset, end));\n offset = end;\n } else {\n let end = PlainValue.Node.endOfIdentifier(src, offset + 1);\n\n if (ch === PlainValue.Char.TAG && src[end] === ',' && /^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+,\\d\\d\\d\\d(-\\d\\d){0,2}\\/\\S/.test(src.slice(offset + 1, end + 13))) {\n // Let's presume we're dealing with a YAML 1.0 domain tag here, rather\n // than an empty but 'foo.bar' private-tagged node in a flow collection\n // followed without whitespace by a plain string starting with a year\n // or date divided by something.\n end = PlainValue.Node.endOfIdentifier(src, end + 5);\n }\n\n props.push(new PlainValue.Range(offset, end));\n lineHasProps = true;\n offset = PlainValue.Node.endOfWhiteSpace(src, end);\n }\n\n ch = src[offset];\n } // '- &a : b' has an anchor on an empty node\n\n\n if (lineHasProps && ch === ':' && PlainValue.Node.atBlank(src, offset + 1, true)) offset -= 1;\n const type = ParseContext.parseType(src, offset, inFlow);\n return {\n props,\n type,\n valueStart: offset\n };\n }", "title": "" }, { "docid": "95e27a5bd8ca03fa87f4e5926855483f", "score": "0.5396879", "text": "function parseProperties( properties, groupName ) {\n\t\tvar group = properties.match( groupsPatterns[ groupName ] );\n\t\treturn group ? trim( group[ 1 ] ) : null;\n\t}", "title": "" }, { "docid": "14a1cd55f8e14a9089000ecb2f49ee9d", "score": "0.5349284", "text": "parseProps(offset) {\n const {\n inFlow,\n parent,\n src\n } = this;\n const props = [];\n let lineHasProps = false;\n offset = _Node.default.endOfWhiteSpace(src, offset);\n let ch = src[offset];\n\n while (ch === constants.Char.ANCHOR || ch === constants.Char.COMMENT || ch === constants.Char.TAG || ch === '\\n') {\n if (ch === '\\n') {\n const lineStart = offset + 1;\n\n const inEnd = _Node.default.endOfIndent(src, lineStart);\n\n const indentDiff = inEnd - (lineStart + this.indent);\n const noIndicatorAsIndent = parent.type === constants.Type.SEQ_ITEM && parent.context.atLineStart;\n if (!_Node.default.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;\n this.atLineStart = true;\n this.lineStart = lineStart;\n lineHasProps = false;\n offset = inEnd;\n } else if (ch === constants.Char.COMMENT) {\n const end = _Node.default.endOfLine(src, offset + 1);\n\n props.push(new _Range.default(offset, end));\n offset = end;\n } else {\n let end = _Node.default.endOfIdentifier(src, offset + 1);\n\n if (ch === constants.Char.TAG && src[end] === ',' && /^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+,\\d\\d\\d\\d(-\\d\\d){0,2}\\/\\S/.test(src.slice(offset + 1, end + 13))) {\n // Let's presume we're dealing with a YAML 1.0 domain tag here, rather\n // than an empty but 'foo.bar' private-tagged node in a flow collection\n // followed without whitespace by a plain string starting with a year\n // or date divided by something.\n end = _Node.default.endOfIdentifier(src, end + 5);\n }\n\n props.push(new _Range.default(offset, end));\n lineHasProps = true;\n offset = _Node.default.endOfWhiteSpace(src, end);\n }\n\n ch = src[offset];\n } // '- &a : b' has an anchor on an empty node\n\n\n if (lineHasProps && ch === ':' && _Node.default.atBlank(src, offset + 1, true)) offset -= 1;\n const type = ParseContext.parseType(src, offset, inFlow);\n return {\n props,\n type,\n valueStart: offset\n };\n }", "title": "" }, { "docid": "4f1f84f412e0404f7b5d829a7ec96c42", "score": "0.5303678", "text": "static loadOptionsFromFile(filepath) {\n try {\n const configContent = fs.readFileSync(filepath, 'utf-8');\n const contents = JSON.parse(configContent);\n return this.validateOptions(contents);\n }\n catch (error) {\n // swallow \"not found\" errors because they are so common / expected\n if (error && error.code === 'ENOENT') {\n logger.debug('no polymer config file found', { file: filepath });\n return null;\n }\n // otherwise, throw an exception\n throw error;\n }\n }", "title": "" }, { "docid": "60d3b83bdccccdff467206b21f3194e6", "score": "0.5292264", "text": "function loadUserSettingsFromConfigFile() {\n var fileConfig = createConfigFileObj();\n try {\n fileConfig.open(\"r\");\n if (fileConfig.error == \"\") {\n var userSettings = getDefaultUserSettings(); // get default settings so we can match property names from config file\n for(;;) {\n var line = fileConfig.readln();\n if (fileConfig.error != \"\")\n break;\n var fields = line.split(':');\n var prop = fields[0];\n var value = fields[1];\n if (prop in userSettings) // make sure value from file is a setting we know about\n userSettings[prop] = value;\n else\n throw \"unknown property\"; // caught below\n }\n fileConfig.close();\n if (userSettings.dataVersion == UserSettingsDataVersion)\n return userSettings;\n // else mismatched version of user settings (older/newer script creatd them). use defaults\n }\n } catch(e) {\n // config file not created yet or some error in opening/reading it\n $.writeln('hello');\n }\n return getDefaultUserSettings();\n}", "title": "" }, { "docid": "c000519cecd8d5c7575ba6042dc11f0a", "score": "0.52840567", "text": "readMapProperties() {\n\n\t\tconst file = this.archive.get( \"war3mapExtra.txt\" );\n\t\tif ( file ) return new IniFile( this.bufferToString( new Uint8Array( file.arrayBuffer() ) ) );\n\n\t}", "title": "" }, { "docid": "bb227dc0f630d6013bb6d686a4ac849f", "score": "0.5237308", "text": "async loadProperties() {\n this.resolveProperties(await this.globalConfig.read(), this.localConfig && (await this.localConfig.read()));\n ConfigAggregator.encrypted = false;\n }", "title": "" }, { "docid": "7a0d714ae9338d05588445cb0233c68c", "score": "0.5225645", "text": "function readAFile( filename ) {\n var obj = JSON.parse(fs.readFileSync( filename ).toString());\n return obj;\n}", "title": "" }, { "docid": "9cb24630e01b828ace9f1d14de33cada", "score": "0.52194726", "text": "function readGitConfigFile(path) {\n var file = new File(path);\n var o = null;\n var parts;\n if (file.exists) {\n o = {};\n file.open('r');\n while(!file.eof) {\n parts = file.readln().split('=');\n if (parts.length > 1) {\n o[trim(parts[0])] = trim(parts[1]);\n }\n }\n file.close();\n }\n return o;\n}", "title": "" }, { "docid": "9fe20f68044eda5a95b8d3480f522327", "score": "0.5201118", "text": "function loadGameProperties(gamePropertiesCsvPath) {\n const properties = parse(fs.readFileSync(gamePropertiesCsvPath, \"utf8\"), {\n columns: true,\n cast: true\n });\n return properties.map(game => ({\n gameId: game.game_id,\n displayName: game.display_name,\n scoreMultiplier: game.score_multiplier\n }));\n}", "title": "" }, { "docid": "b69fa9566d25c6ccf3f9e5580edb0357", "score": "0.5167191", "text": "parseConfig(path) {\n return require('yamljs').parse(this.read(path));\n }", "title": "" }, { "docid": "8ac8cda5771444eccfa9c626c5042cd6", "score": "0.5133899", "text": "function GLSettings_parseFile(fileText) {\n\t// break whole text string into an array of lines based on endline character\n\tvar lines = fileText.split(\"\\n\");\n\t// count number of indices in array\n\tvar numLines = lines.length;\n\t// parse file\n\tfor (var i = 0; i < numLines; i++) {\n\t\t// get the current line\n\t\tvar line = lines[i];\n\t\t// skip empty lines early\n\t\tif (lines[i].length < 2) {\n\t\t\tcontinue;\n\t\t}\n\t\t// skip comment lines early\n\t\tif (lines[i][0] == '#') {\n\t\t\tcontinue;\n\t\t}\n\t\t// tokenise\t\t\n\t\tvar tokens = lines[i].split(\" \");\n\t\tvar numTokens = tokens.length;\n\t\t// set background colour\n\t\tif (tokens[0] == \"setBackgroundColour\") {\n\t\t\t// cut out everything that isn't numbers, dots, or commas\n\t\t\t// should use a better regular expression to allow comments at the end\n\t\t\tvar subStr = lines[i].replace(/[^0-9.,]+/g, '');\n\t\t\t// split tokens based on commas and store in an array of strings\n\t\t\tvar rgb = subStr.split(',');\n\t\t\t// convert string array into floats\n\t\t\t// these are stored in a global instance - in a better class we might pass instance as a param\n\t\t\t// to this function instead.\n\t\t\tgGLSettings.mBackgroundColour.r = parseFloat(rgb[0]);\n\t\t\tgGLSettings.mBackgroundColour.g = parseFloat(rgb[1]);\n\t\t\tgGLSettings.mBackgroundColour.b = parseFloat(rgb[2]);\n\t\t\tcontinue;\n\t\t}\t\n\t\t// unknown line warning so that user can double-check i.e. typos or change of spec\n\t\talert(\"WARNING unknown setting: \" + line);\n\t}\n}", "title": "" }, { "docid": "84925838c19025ddb4a2b89821beb280", "score": "0.51279724", "text": "function parseProperty(value) {\n console.log('parse', value)\n return value\n }", "title": "" }, { "docid": "ba30e287dd4e3c223e6d91eff7fdefe4", "score": "0.51004714", "text": "function readProperties() {\n var url = 'https://api.evrythng.com/thngs/' + id + '/properties?access_token=' + token;\n $.getJSON(url, function(data) {\n for (var item of data) {\n updateProperty(item);\n }\n });\n }", "title": "" }, { "docid": "4b3a75da3d844082d6ab4e32f829778c", "score": "0.50994384", "text": "function readProperty(path, parent) {\n // Get the topmost property name\n const property = path.shift();\n\n // Check if it exists\n if (parent[property]) {\n // If there are no more properties after this, return the value of the property\n if (path.length == 0) {\n return parent[property];\n } else {\n // Else keep looking deeper\n return readProperty(path, parent[property]);\n }\n } else {\n // Return undefined if the property does not exist\n return undefined;\n }\n}", "title": "" }, { "docid": "5fa11fd665a6d93c98d6f4735bdff970", "score": "0.5081677", "text": "function load_config(config_file)\n{\n\tvar self = this;\n\t//self.params=params;\n\tvar constants;\n\t//var const_fields=[];\n\t\n\t\n\tlet rawdata = fs.readFileSync(config_file);\n\tlet config_data = JSON.parse(rawdata);\n\treturn config_data;\n\t\n\t\n}", "title": "" }, { "docid": "eb860dfab4ec293df0ea138d27738721", "score": "0.5080439", "text": "function getProperties(fileName) {\n if (!fileName)\n return [];\n var stat = fs.statSync(fileName);\n var baseName = File.PATH.basename(fileName);\n var result = [\n { key: \"fileName\", value: baseName },\n { key: \"filePath\", value: fileName }\n ];\n for (var key in stat) {\n if (stat.hasOwnProperty(key)) {\n result.push({\n key: key,\n value: stat[key]\n });\n }\n }\n return result;\n }", "title": "" }, { "docid": "16aed5f659391898d3a9815a5bdb9ee1", "score": "0.5059282", "text": "static loadConfigFromFile(filepath) {\n const configParsed = ProjectConfig.loadOptionsFromFile(filepath);\n if (!configParsed) {\n return null;\n }\n return new ProjectConfig(configParsed);\n }", "title": "" }, { "docid": "6db1ec994133193dc796d9c844543ecf", "score": "0.5055106", "text": "function readConf() {\n var config = fs.readFileSync(CONF_FILE, 'utf-8');\n if(!config) return null;\n\n var parsed = toml.parse(config);\n return parsed;\n}", "title": "" }, { "docid": "7ad6bfd2858c151f2b125d20e1bd540c", "score": "0.5046828", "text": "function parseProperties(data, startIndex, endIndex) {\n const properties = Object.assign(data.properties[data.featureIds.value[startIndex]]);\n for (const key in data.numericProps) {\n properties[key] = data.numericProps[key].value[startIndex];\n }\n return properties;\n}", "title": "" }, { "docid": "e1c3d59e135fd3f41dcbb091398db8f6", "score": "0.4969488", "text": "function readFromFile(){\n try { \n var data = fs.readFileSync('store.json', 'utf8');\n obj = JSON.parse(data);\n return obj; \n } catch(e) {\n console.log('Error:', e.stack);\n } \n}", "title": "" }, { "docid": "e1c6c91cb26c694994d80314e4f55e6f", "score": "0.49618945", "text": "readFile ( file_path, label = '' ) {\n let config = {}\n\n try {\n let data = fs.readFileSync(file_path, 'utf8')\n let extension = path.extname(file_path)\n if ( extension === '.json' ) {\n debug('readFile reading json file', file_path)\n config = JSON.parse( data )\n } else {\n debug('readFile reading yaml file', file_path)\n config = yaml.load( data )\n }\n this.debug('readFile loaded yaml from file', file_path)\n\n } catch (err) {\n this.logger.error(err)\n throw new ConfigError(`Can't load config ${label} - ${file_path}`)\n }\n\n this.debug('readFile got config', file_path, config)\n return config\n }", "title": "" }, { "docid": "d98999bf2f74d7074f783263c4a7da8b", "score": "0.49483934", "text": "parseFromFile(file)\n\t{\n\t\tlet\tstr = fs.readFileSync(file).toString();\n\t\tlet listaStr = str.split(os.EOL);\n\t\tlet struct = {};\n\n\t\tlistaStr.forEach((str)=>{\n\t\t\tstruct[this.cleanStr(str)]=1;\n\t\t});\n\n\t\treturn struct;\n\t}", "title": "" }, { "docid": "cf322c06d37c0f6f4cbc920427878454", "score": "0.49288973", "text": "parseData(filePath) {\n return JSON.parse(fs.readFileSync(filePath, 'utf8'))\n }", "title": "" }, { "docid": "133b5cefbb3ed8154d994b6c42af67e2", "score": "0.4927403", "text": "function readConfigurationFile(fileName) {\n\ttry {\n\t\tvar content = fs.readFileSync(fileName);\n\t\treturn JSON.parse(content);\n\t}\n\tcatch(err) {\n\t\tthrowException(\"Error\", \"FATAL\", \"Couldn't access configuration file\");\n\t}\n\n}", "title": "" }, { "docid": "5469a565127149ab45f62baa1b33dcb0", "score": "0.49025196", "text": "parseJSONProperties (feature) {\n if (this.parse_json_type !== PARSE_JSON_TYPE.NONE) {\n const props = feature.properties;\n\n // if specified, check list of explicit properties to parse\n if (this.parse_json_type === PARSE_JSON_TYPE.SOME) {\n this.parse_json_prop_list.forEach(p => {\n try {\n props[p] = JSON.parse(props[p]);\n } catch (e) {\n // continue with original value if couldn't parse as JSON\n }\n });\n }\n // otherwise try to parse all properties\n else {\n for (const p in props) {\n // check if this property looks like JSON, and parse if so\n if (PARSE_JSON_TEST.indexOf(props[p][0]) > -1) {\n try {\n props[p] = JSON.parse(props[p]);\n } catch (e) {\n // continue with original value if couldn't parse as JSON\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "6a0378a4b77911879fffc6a1af713009", "score": "0.4889037", "text": "function readUser() {\n\n fs.readFile('./resources/login.config', 'utf8', function(err, data) {\n if (err) throw err;\n\n\n var startIndexU = 10;//username:\n var endIndexU = -1;\n var startIndexP = data.search(\"password: \") + 10;\n var endIndexP = data.length;\n\n //line-Endings \\n oder \\r\\n\n if (data.search(\"\\r\\n\") == -1){\n endIndexU = data.indexOf(\"\\n\");\n\n }else{\n endIndexU = data.indexOf(\"\\r\\n\");\n }\n\n if (endIndexU == -1){\n //error\n }\n\n user.username = data.slice(startIndexU, endIndexU);\n user.password = data.slice(startIndexP, endIndexP);\n\n\n });\n\n\n }", "title": "" }, { "docid": "4f30a69bf57bd783a25fdfd0a0f612e7", "score": "0.4882727", "text": "function defaultParser(filepath) {\n\t\tvar data = fs.readFileSync(filepath, \"utf8\");\n\t\treturn JSON.parse(data);\n\t}", "title": "" }, { "docid": "262459706fb64896b86ed72a47cb8d76", "score": "0.48662403", "text": "function parseProperties(data) {\r\n\t\t\r\n\tfeedItem = data;\r\n\tloadFeed();\r\n}", "title": "" }, { "docid": "97a363fa4f2fa4d7bce34c1f19a37e27", "score": "0.48545796", "text": "function parse(src) {\n const obj = {}\n\n\n src.toString().split(NEWLINES_MATCH).forEach(function(line) {\n const key_value = line.match(RE_INI_KEY_VAL)\n if (key_value != null) {\n const key = key_value[1]\n obj[key] = (key_value[2])\n }\n })\n return obj\n}", "title": "" }, { "docid": "4c634d81efcae165cd508147eb280d4f", "score": "0.48401892", "text": "function parseSettings(data)\n{\n let json = JSON.parse(data);\n const properties = {\n // paths\n input_path: \".\",\n output_path: \".\",\n input_pages_path: \"pages\",\n output_pages_path: \"pages\",\n resources: \"resources\",\n\n templates: [\n // name:\n // path:\n ],\n\n // site settings\n base_url: \"/\",\n title: null,\n default: \"default\",\n\n // optimization options\n client_markdown: true,\n \n };\n\n for (property in json)\n {\n settings[property] = json[property];\n }\n\n for (property in properties)\n {\n if (settings[property] == null)\n {\n settings[property] = properties[property];\n }\n }\n}", "title": "" }, { "docid": "4b6d1a7e43c8121e81a1d3f5d3ef46b9", "score": "0.4838817", "text": "static readConfig(){\n\n\t\tif (!this.opened) throw Error(\"Call openConfig() before readConfig()\");\n\t\n\t\tlet config;\n\t\n\t\ttry {\n\t\t\tconfig = JSON.parse(fs.readFileSync(configPath));\n\t\t} catch (err){\n\t\t\tif (err instanceof SyntaxError){\n\t\t\t\tconfig = {};\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (config.version === undefined){\n\t\t\tthis.writeDefaultConfig();\n\t\t\treturn this.readConfig();\n\t\t}\n\t\n\t\treturn config;\n\t}", "title": "" }, { "docid": "e8ae9694bc89a159abdfe2daac70221c", "score": "0.48357671", "text": "function readSettings (filePath) {\n 'use strict'\n\n var settingsString = ''\n var inFile = new File(filePath, 'read', 'JSON')\n\n if (inFile.isopen) {\n while (inFile.position < inFile.eof) {\n settingsString += inFile.readstring(800)\n }\n inFile.close()\n return JSON.parse(settingsString).networking\n\n } else {\n throw new Error('Could not read JSON file')\n }\n}", "title": "" }, { "docid": "704ad9f96bade6a0eb5242b42f8e7778", "score": "0.48313153", "text": "function maybeReadIni(f) {\n let txt\n try {\n txt = fs.readFileSync(f, 'utf8')\n } catch (err) {\n if (err.code === 'ENOENT') {\n return ''\n } else {\n throw err\n }\n }\n return ini.parse(txt)\n}", "title": "" }, { "docid": "4930e042bd46738042cf38f29d4c76a6", "score": "0.48309827", "text": "function readProfiles() {\n const profiles = fs.readFileSync('./data/profiles.json');\n const parsedData = JSON.parse(profiles);\n return parsedData;\n}", "title": "" }, { "docid": "48e3a5ee1018b0af184b140872563fff", "score": "0.48284945", "text": "function convertConanPropertiesToMap(propertiesContent) {\n if (!propertiesContent) {\n return {};\n }\n let map = {};\n let lines = propertiesContent.split(os.EOL);\n for (let i = 0; i < lines.length; i++) {\n let parts = lines[i].split(\"=\");\n let key = parts[0];\n parts.splice(0, 1);\n map[key] = parts.join(\"=\");\n }\n return map;\n}", "title": "" }, { "docid": "cec2ea7813237535678f91a481b38ead", "score": "0.4812466", "text": "readDataFile(path) {\n this.rawData = fs.readFileSync(path, 'utf-8');\n this.data = JSON.parse(this.rawData);\n\n return this.data;\n }", "title": "" }, { "docid": "1fb2a620cdb96d7cd85ceca9f76beac2", "score": "0.48093408", "text": "function getAllProps(ramlURL) {\n\n // fetch the RAML data from the URL, parse it as JSON, then\n // extract and return the \"properties\" object\n\n var url = ramlURL;\n console.log(\"fetching URL: \" + url);\n \n var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true});\n //Logger.log(response);\n \n var json = response.getContentText();\n var data = JSON.parse(json);\n //Logger.log(data);\n \n var props = data[\"properties\"];\n return props;\n \n}", "title": "" }, { "docid": "3a1362e3d120013bf222a7e2cb9f1710", "score": "0.48010176", "text": "static getValue(state, key) {\n const loadedProperties = state.config.get(Properties.PROPERTIES);\n if (!loadedProperties) {\n return null;\n }\n if (!loadedProperties.has(key)) {\n return null;\n }\n return loadedProperties.get(key).value;\n }", "title": "" }, { "docid": "57d8e68c250e96b66bc58ea23467613e", "score": "0.47999796", "text": "function parseFile( path ) {\n var folderPath = getFolder( path ) || \".\";\n var content = grunt.file.read( path );\n\n return JSON.parse( content, function( key, value ) {\n\n if ( options.stripComments && key === \"{{comment}}\" ) return undefined;\n\n var match = ( typeof value === \"string\" ) ? value.match( options.parsePattern ) : null;\n\n if ( match ) {\n var fullPath = folderPath + \"/\" + match[ 1 ];\n\n return isDirectory( fullPath ) ? parseDirectory( fullPath ) : parseFile( fullPath );\n }\n\n return value;\n\n } );\n\n }", "title": "" }, { "docid": "0db0196457a733fa2daab0e41f04d703", "score": "0.47855031", "text": "async getProperties(props, allprop) {\n let propertyValues = await this.getPropertyValues();\n if (!allprop) {\n propertyValues = propertyValues.filter(item => props.findIndex(p => p.name === item.qualifiedName.name) > -1);\n }\n return propertyValues;\n }", "title": "" }, { "docid": "75e8580cde8828dcc52e9251eb06a746", "score": "0.47832868", "text": "function fileParser(pathFile) {\n return {\n data: fs.readFileSync(pathFile).toString().split('\\n')\n }\n}", "title": "" }, { "docid": "d4c7c0d5732c3b97856b036d60417cfe", "score": "0.47832352", "text": "function load_ini_json(){\n try{\n var ini_json = JSON.parse(fs.readFileSync('./ini.json', 'utf8'));\n }catch(e){\n var ini_json = { };\n }\n return ini_json;\n}", "title": "" }, { "docid": "e0f2f2db86d148220d845fa3b1b577f3", "score": "0.47794", "text": "constructor (fname) {\n this.spec = YAML.load(fname)\n }", "title": "" }, { "docid": "98b8194e564b1798fe6c938e584fb54b", "score": "0.47569728", "text": "setPropertyParser (callback) {\r\n this.parseProperty = callback\r\n }", "title": "" }, { "docid": "0033f8b18661de14fa04104ba8967379", "score": "0.47533405", "text": "readParams(filename) {\n var BufferedReader = Java.type(\"java.io.BufferedReader\");\n \tvar FileReader = Java.type(\"java.io.FileReader\");\n var br = new BufferedReader;\n br = null;\n var fr = new FileReader;\n fr = null;\n \t\tfr = new FileReader(filename);\n \t\tbr = new BufferedReader(fr);\n \t\tvar line = null;\n \t\twhile ((line = br.readLine()) != null) {\n \t\t\tvar tok = line.split(\" \"); /// Check this================================\n \t\t\tif (tok[0].equals(\"ALL\")) { /// CHeck this////////////////////////////////\n \t\t\t\tfor (var m = 0; m < this.BodyState.NUM_STATES; ++m) {\n \t\t\t\t\tlogData(m,parseBodyOrgan(tok[1]),tok[2],Double.valueOf(tok[3])); // Check this\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tlogData(parseBodyState(tok[0]),parseBodyOrgan(tok[1]),tok[2],Double.valueOf(tok[3]));\n \t\t\t}\n \t\t}\n \t\n }", "title": "" }, { "docid": "c64e09050f021991779528c207cf0524", "score": "0.47516462", "text": "async load_config() {\n var data = fs.readFileSync(this.CONIFG_FILE),\n config = {};\n try {\n config = JSON.parse(data);\n } catch (e) {\n this.quit('Error parsing config data');\n }\n\n this.config = config;\n }", "title": "" }, { "docid": "0a6b39443e9331aeeed544e3308ff678", "score": "0.47513884", "text": "function FileProperties(props) {\n props = props || {};\n\n function _get(val) {\n return function () {\n return props[val];\n };\n }\n\n this.__defineGetter__(\"dateCreated\", _get(\"dateCreated\")); //tablet only\n this.__defineGetter__(\"dateModified\", _get(\"dateModified\"));\n this.__defineGetter__(\"directory\", _get(\"directory\"));\n this.__defineGetter__(\"fileExtension\", _get(\"fileExtension\"));\n this.__defineGetter__(\"isHidden\", _get(\"isHidden\"));\n this.__defineGetter__(\"isReadonly\", _get(\"isReadonly\")); //handset only\n this.__defineGetter__(\"mimeType\", _get(\"mimeType\")); //handset only\n this.__defineGetter__(\"size\", _get(\"size\"));\n }", "title": "" }, { "docid": "f433bcd35cfeec32422e498f8187fc00", "score": "0.47493044", "text": "function parse(file) {\n return fs.readFileSync(file, 'UTF-16LE').replace(/^\\uFEFF/, '').split('\\n').\n filter(line => !!line.length).map(line => {\n let split = line.indexOf('=');\n return [line.substring(0, split), line.substring(split + 1).trim()]\n });\n}", "title": "" }, { "docid": "52a1ecd367b2d3044e7c17dbbe74f76d", "score": "0.47461897", "text": "loadPropertiesSync() {\n this.resolveProperties(this.globalConfig.readSync(), this.localConfig && this.localConfig.readSync());\n }", "title": "" }, { "docid": "21b589134b5f67c318544283c343c596", "score": "0.474215", "text": "function getProp(str, propName){\n\t// get start of the property name\n\tvar propPart = str.split(propName)[1];\n\tvar quotationType = str.indexOf('\"')>-1 && (str.indexOf('\\'') === -1 || str.indexOf('\\'')<str.indexOf('\"')) ? '\"': '\\'';\n\t// return property's value\n\treturn propPart.substr(\n\t\tpropPart.indexOf(quotationType) + 1,\n\t\tpropPart.substr(propPart.indexOf(quotationType) + 1, propPart.length - (propPart.indexOf(quotationType) + 1)).indexOf(quotationType)\n\t);\n}", "title": "" }, { "docid": "ee9f3c7553258c6a7accd1f4c259e75d", "score": "0.47407207", "text": "function parseINIString(data){\r\n var regex = {\r\n section: /^\\s*\\[\\s*([^\\]]*)\\s*\\]\\s*$/,\r\n param: /^\\s*([^=]+?)\\s*=\\s*(.*?)\\s*$/,\r\n comment: /^\\s*;.*$/\r\n };\r\n //console.log( \"DATA FILE:\");\r\n //console.log( data);\r\n var value = {};\r\n var lines = data.split(/[\\r\\n]+/);\r\n var section = null;\r\n lines.forEach(function(line){\r\n if(regex.comment.test(line)){\r\n return;\r\n }else if(regex.param.test(line)){\r\n var match = line.match(regex.param);\r\n if(section){\r\n value[section][match[1].toLowerCase()] = match[2];\r\n }else{\r\n value[match[1].toLowerCase()] = match[2];\r\n }\r\n }else if(regex.section.test(line)){\r\n var match = line.match(regex.section);\r\n value[match[1]] = {};\r\n section = match[1];\r\n //console.log( value);\r\n }else if(line.length == 0 && section){\r\n section = null;\r\n };\r\n });\r\n //console.log( \"INI FILE\");\r\n //console.log( value);\r\n return value;\r\n}", "title": "" }, { "docid": "9c11bb692bb91911415fb0fb7ea989b3", "score": "0.4738367", "text": "_parseScenarioProperties(data) {\n return [data.readUInt16LE(0), data.readUInt16LE(2)]\n }", "title": "" }, { "docid": "6be24b536e16ae8b044b1493f3e07196", "score": "0.4735665", "text": "parse (file)\n {\n const reader = new FileReader();\n reader.readAsText(file);\n new Promise((resolve, reject) => {\n reader.onload = function(event) {\n resolve(reader.result)\n }\n })\n }", "title": "" }, { "docid": "e6ecac382902fc78a7b8e2864a8b1c47", "score": "0.47342533", "text": "read (thing, name) {\n var getValue = function (resolve, reject) {\n \tconst uri = thing.uri + \"/properties/\" + name;\n \t\n \tconst opts = {\n\t\t\t\tmethod: \"GET\",\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json'\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n \tfetch(uri, opts).then(response => {\n \t\tif (response.ok) {\n \t\t\t//console.log(\"got value \");\n \t\t\tresolve(response.json());\n \t\t} else\n \t\t\tthrow(new Error(\"property is unknown or unreadable\"));\n \t}).catch(err => {\n \t\tconsole.log(\"couldn't get property \" + name);\n \t\treject(err);\n \t});\n };\n \n return new Promise(function (resolve, reject) {\n getValue(resolve, reject);\n });\n }", "title": "" }, { "docid": "e6ecac382902fc78a7b8e2864a8b1c47", "score": "0.47342533", "text": "read (thing, name) {\n var getValue = function (resolve, reject) {\n \tconst uri = thing.uri + \"/properties/\" + name;\n \t\n \tconst opts = {\n\t\t\t\tmethod: \"GET\",\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json'\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n \tfetch(uri, opts).then(response => {\n \t\tif (response.ok) {\n \t\t\t//console.log(\"got value \");\n \t\t\tresolve(response.json());\n \t\t} else\n \t\t\tthrow(new Error(\"property is unknown or unreadable\"));\n \t}).catch(err => {\n \t\tconsole.log(\"couldn't get property \" + name);\n \t\treject(err);\n \t});\n };\n \n return new Promise(function (resolve, reject) {\n getValue(resolve, reject);\n });\n }", "title": "" }, { "docid": "8b40168225e9c73bd2137729f8677b78", "score": "0.4732797", "text": "function loadPoll(filename) {\n const filepath = path.join(__dirname, 'data', filename)\n return JSON.parse(fs.readFileSync(filepath))\n}", "title": "" }, { "docid": "2c838efd6ea19dfd9c3526e0c9ebf879", "score": "0.4726166", "text": "function readAndTokenizeInput(file) {\n return fs.readFileSync(file, \"utf8\")\n .split(\"\\r\\n\\r\\n\")\n .map(x => x.replace(/\\r\\n/g, \" \"))\n .map(x => x.split(\" \"))\n .map(x => {\n // this might actually be a reduce()\n let values = x.map(y => y.split(\":\"))\n let obj = {};\n values.forEach(value => obj[value[0]] = value[1]);\n return obj;\n });\n}", "title": "" }, { "docid": "21b1abb35f20cf6b7f3abf165dc32ead", "score": "0.47158086", "text": "function parseFile(err, data) {\n if (err) {\n console.log(`problem parsing`, err);\n }\n configFilePoker(data);\n}", "title": "" }, { "docid": "a996862ac876bdbd06d0b83c9d9f06e1", "score": "0.4715789", "text": "function readOptions (filename) {\r\n let options\r\n\r\n try {\r\n options = require(filename)\r\n } catch(e) {\r\n console.error(`No config file found at: ${filename}`)\r\n\r\n options = {}\r\n }\r\n\r\n return options\r\n}", "title": "" }, { "docid": "8e397ee3f0aac0ec181a2e7f8e767870", "score": "0.47128487", "text": "function readConfigSetting(configName,configFile){\n if (arguments.length == 1){\n configFile = '../config';\n }\n var configFilePath = __dirname+\"/\"+configFile\n var configContents = readFile(configFilePath);\n var configJSONStr = configContents.replace(/#.*(\\n|$)/g,'\\n');\n configJSONStr = configJSONStr.replace(/^\\n/,'');\n configJSONStr = configJSONStr.replace(/\\n$/,'');\n configJSONStr = '{'+configJSONStr.replace(/\\n/g,',')+'}';\n var configJSON = JSON.parse(configJSONStr);\n return configJSON[configName];\n}", "title": "" }, { "docid": "b556511b532909debc82bf07f28a87e2", "score": "0.47008395", "text": "function parseProperty (value, propDefinition) {\n value = (value === undefined || value === null) ? propDefinition.default : value;\n return propDefinition.parse(value);\n}", "title": "" }, { "docid": "91274023e75447cf2d6b238bffc5a3bd", "score": "0.46891278", "text": "read() {\n return JSON.parse(File.find(this.path).read());\n }", "title": "" }, { "docid": "65778143b72b218477713851ec14df21", "score": "0.467846", "text": "read() {\n try {\n const config = YamlService.read(this.location);\n return config;\n } catch (error) {\n return {};\n }\n }", "title": "" }, { "docid": "bb0dbfd6fc552f77b2201e1d2abd0134", "score": "0.46767098", "text": "function getPropConfig(prop) {\n return (Array.isArray(prop)) ? prop[1] : {};\n }", "title": "" }, { "docid": "5601403a7acec523c797dd5cbc0cf57a", "score": "0.46694848", "text": "function config() {\n var tokens = fs.readFileSync(configPath)\n .toString()\n .split(RegExp(/\\s+/));\n for (var i = 0; i < tokens.length; i += 3) {\n var variable = tokens[i];\n var value = tokens[i + 2];\n switch (variable) {\n case 'bindingPath':\n wigglePath = value;\n break;\n case 'networkPath':\n networkPath = value;\n break;\n case 'expressionPath':\n expressionPath = value;\n break;\n case 'bigWigToWigPath':\n bigWigToWigPath = value;\n break;\n case 'uploadPath':\n uploadPath = value;\n break;\n case 'bedPath':\n bedPath = value;\n break;\n }\n }\n}", "title": "" }, { "docid": "cd5719f57009dcc7225ff3b61f6e0df2", "score": "0.46478045", "text": "function updatePostProperties() {\r\n if (getCpsPath() == undefined) {\r\n return;\r\n }\r\n fixEOL();\r\n executeCommand('propertyList.interrogatePost');\r\n wait(100);\r\n\r\n var updatedProperties = [];\r\n var hash = getHash(getCpsPath());\r\n var jsonTemp = path.join(propertyJSONpath, hash + \"_temp.json\");\r\n if (fileExists(jsonTemp)) {\r\n var lines = fs.readFileSync(jsonTemp);\r\n if (lines.length > 1) {\r\n var obj = JSON.parse(lines);\r\n if (obj.properties) {\r\n updatedProperties.push(\"properties = \") // add properties object to the output\r\n var newProperties = JSON.stringify(obj.properties, null, 2);\r\n updatedProperties.push(newProperties.replace(/\"(\\w+)\"\\s*:/g, '$1:')) // removes quotation marks from object keys\r\n updatedProperties.push(\";\");\r\n } else {\r\n message(\"This post processor does not have any properties defined.\");\r\n return;\r\n }\r\n }\r\n if (fileExists(jsonTemp)) {\r\n fs.unlinkSync(jsonTemp);\r\n }\r\n } else {\r\n errorMessage(\"Property JSON file does not exist.\");\r\n return;\r\n }\r\n fs.readFile(getCpsPath(), function (err, data) {\r\n if (err) throw err;\r\n var array = data.toString().split('\\n');\r\n var deleteLine = false;\r\n var countbrackets = 0;\r\n var countbrackets2 = 0;\r\n var insideFunction = false;\r\n var skipLine = false;\r\n var skipMultiLine = false;\r\n var foundProblem = false;\r\n for (var i = 0; i < array.length; ++i) {\r\n var str = array[i].replace(/\\s/g, ''); // remove any whitespace to use 'str' for comparisons\r\n if (str.startsWith(\"function\") && str.includes(\"{\")) {\r\n insideFunction = true;\r\n }\r\n if (insideFunction) {\r\n if (str.startsWith(\"//\")) {\r\n skipLine = true;\r\n }\r\n if (str.startsWith(\"/**\") || str.startsWith(\"/*\")) {\r\n skipMultiLine = true;\r\n }\r\n if (!skipLine && !skipMultiLine) {\r\n if (str.includes(\"{\")) {\r\n ++countbrackets;\r\n }\r\n if (str.includes(\"}\")) {\r\n --countbrackets;\r\n }\r\n }\r\n skipLine = false;\r\n if (str.includes(\"*/\")) {\r\n skipMultiLine = false\r\n }\r\n if (countbrackets == 0) {\r\n insideFunction = false;\r\n }\r\n }\r\n if (!insideFunction) {\r\n if (str.includes(\"properties=\") || str.includes(\"propertyDefinitions=\") ||\r\n str.startsWith(\"properties.\") || str.startsWith(\"propertyDefinitions.\") ||\r\n str.startsWith(\"//user-definedpropertydefinitions\")) {\r\n deleteLine = true;\r\n }\r\n }\r\n if (deleteLine) {\r\n if (str.includes(\"{\")) {\r\n ++countbrackets2;\r\n }\r\n if (str.includes(\"}\")) {\r\n --countbrackets2;\r\n }\r\n if (countbrackets2 == 0) {\r\n deleteLine = false; // end of object\r\n }\r\n if (deleteLine) {\r\n array[i] = ''\r\n continue;\r\n } else {\r\n array[i] = updatedProperties.join(''); // adds new property object to the cps file\r\n updatedProperties = [];\r\n }\r\n }\r\n var isAssignment = false;\r\n var remainingString = \"\";\r\n if (array[i].includes(\"properties.\")) {\r\n isAssignment = str.search(/^properties.*?(?==)|properties[=\\n\\r]/gm) > -1;\r\n if (isAssignment) {\r\n var propertyKey = str.slice(str.indexOf(\".\") + 1, str.indexOf(\"=\"));\r\n\r\n var endPosition = array[i].slice(array[i].indexOf(\"=\") + 1).search(/[*\\;/]/g) // find semicolon or begin of comment\r\n if (endPosition == -1) {\r\n endPosition = array[i].length;\r\n }\r\n propertyValue = array[i].slice(array[i].indexOf(\"=\") + 1).substring(1, endPosition).replace(/\\n|\\r/g, \"\");\r\n\r\n if (str.slice(str.indexOf(\"=\")).search(/[*\\;/]/g) > -1) { // extract remaining line, stop if there is a comment or semicolon\r\n remainingString = array[i].substring(array[i].search(/[*\\;/]/g)).replace(/\\n|\\r/g, '');\r\n }\r\n if (propertyKey == \"\" || propertyValue == \"\") {\r\n message(\"Failed to read property \" + \"\\\"\" + propertyKey + \"\\\" \" + propertyValue + \" in line \" + (i + 1));\r\n array[i] = \"ERROR\" + str + '\\n'; // add error text to the output line\r\n foundProblem = true;\r\n continue;\r\n }\r\n array[i].search(/^(\\s*)/);\r\n var leadingSpaces = RegExp.$1;\r\n array[i] = leadingSpaces + \"setProperty(\\\"\" + propertyKey + \"\\\",\" + propertyValue + \")\" + remainingString + '\\n';\r\n }\r\n if (!array[i].includes(\"error\") && !array[i].includes(\"warning\") && !array[i].includes(\"longDescription\")) { // skip post error / warning message lines\r\n // var re = /properties.(.?[^\\s\\)\\],.;+}*]*)/g; // regex to find property object name\r\n var re = /properties.(.?[^\\s\\)\\],.+;}*-]*)/g; // regex to find property object name\r\n var numberOfMatches = (array[i].match(re) || []).length;\r\n for (var j = 0; j < numberOfMatches; ++j) {\r\n array[i].search(re);\r\n array[i] = array[i].replace(\"properties.\" + RegExp.$1, \"getProperty(\\\"\" + RegExp.$1 + \"\\\")\");\r\n }\r\n }\r\n }\r\n if (str.includes(\"minimumRevision\")) {\r\n var minimumRev = str.match(/[0-9][0-9][0-9][0-9][0-9]/g);\r\n var requiredRev = 45702; // new minimum required version to support getProperty()\r\n if (parseInt(minimumRev) < requiredRev) {\r\n array[i] = str.replace(\"minimumRevision=\" + minimumRev.toString(), \"minimumRevision = \" + requiredRev) + '\\n';\r\n }\r\n }\r\n array[i] = array[i].replace('\\r', '\\r\\n'); // fix CRLF for each line\r\n }\r\n array.push('\\r\\n' +\r\n \"function setProperty(property, value) {\" + '\\r\\n' +\r\n \" properties[property].current = value;\" + '\\r\\n' +\r\n \"}\" + '\\r\\n'\r\n );\r\n\r\n var fileName = getFileName(getCpsPath());\r\n var currentFolder = path.dirname(getCpsPath());\r\n var targetFolder = path.join(currentFolder, \"updatedPosts\");\r\n makeFolder(targetFolder);\r\n var cpsFilePath = path.join(targetFolder, fileName);\r\n var file = fs.createWriteStream(cpsFilePath);\r\n file.on('error', function (errors) { });\r\n file.write(array.join(''));\r\n file.end();\r\n if (!foundProblem) {\r\n message(\"Success, the updated postprocessor is located here: \" + cpsFilePath);\r\n } else {\r\n message(\"Completed with errors, the updated postprocessor is located here: \" + cpsFilePath);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "8c7c40e69528ed159d7918cd108d1e1a", "score": "0.4643816", "text": "loadFile() {\n const configPath = this.path + '/' + this.file\n\n try {\n if (fs.existsSync(configPath)) {\n return yaml.safeLoad(fs.readFileSync(configPath, 'utf8'))\n }else {\n output.error('The config file (' + configPath + ') does not exist')\n this.errors = true\n }\n } catch(err) {\n output.error(err.message)\n this.errors = true\n }\n }", "title": "" }, { "docid": "8301b6e26e88063ffe706157f3b8682f", "score": "0.4642822", "text": "function readConfig(filename) {\n\tlet data = fs.readFileSync(filename);\n\t\t\n\tlet peers = [];\n\t\t\n\tfor (i = 0; i < data.length; i++) {\n\t\tlet peer = {\n\t\t\t\"ip\": data[i++].toString() + \".\" + data[i++].toString() + \".\" + data[i++].toString() + \".\" + data[i++].toString(),\n\t\t\t\"gport\": data.readUint16BE(i++),\n\t\t\t\"pport\": data.readUint16BE(++i)\n\t\t}\n\t\t\n\t\ti += 2;\n\t\tpeers.push(peer);\n\t}\n\t\n\treturn peers;\n}", "title": "" }, { "docid": "045c70ed93870ea725c3a17619f487e3", "score": "0.46410456", "text": "function loadOptions()\n{\n\tvar prefs = storage_data.resolve('prefs.js');\n\n\t// Return if there is no prefs file\n\tif(!prefs.exists)\n\t\treturn;\n\n\tvar fstream = prefs.open(null, 'r');\n\t\n\t// Loop through the lines in the file\n\twhile(fstream.bytesAvailable>0)\n\t{\n\t\tvar line = fstream.readLine();\n\t\tvar item = line.split('=');\n\t\t// Skip invalid lines\n\t\tif (item.length!=2) continue;\n\t\t\n\t\tfor (var opt in options)\n\t\t{\n\t\t\tif (item[0]!=opt) continue;\n\t\t\tswitch (options[opt].type) {\n\t\t\t\tcase 'array':\n\t\t\t\t\tif (item[1]!='null')\n\t\t\t\t\t\toptions[opt].value = item[1].split(',');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'string':\n\t\t\t\t\toptions[opt].value = item[1];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bool':\n\t\t\t\t\toptions[opt].value = (item[1]=='true') ? true : false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'int':\n\t\t\t\t\toptions[opt].value = parseInt(item[1], 10);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tfstream.close();\n}", "title": "" }, { "docid": "4c420ae3a6d163da4662111062fc35b6", "score": "0.46205693", "text": "readJSON (fileName) {\n return JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'data', fileName), 'utf8'))\n }", "title": "" }, { "docid": "2ee2c7e21a653d2008118dfbdfddd0e2", "score": "0.46183836", "text": "function loadConfig() {\n var args = process.argv.slice(2); // remove unneeded boilerplate args\n if (args[0] != '--config') {\n console.error('arguments: --config CONFIG [--state STATE] [--properties CATALOG]');\n return new Promise(function (resolve, reject) {\n reject(\"missing required '--config' argument\");\n });\n }\n else {\n return lib.readFile(args[1]).then(function (buffer$$1) {\n let config = JSON.parse(buffer$$1.toString());\n // if (config instanceof configType) {\n // }\n return { config: config };\n });\n }\n}", "title": "" }, { "docid": "610c1d41e30852705a0fd5909aeabcdb", "score": "0.4615648", "text": "function jsonParse(filepath) {\n try {\n let rawdata = fs.readFileSync(filepath);\n //console.log(JSON.parse(rawdata));\n return JSON.parse(rawdata);\n } catch (err) {\n console.error(err);\n return \" \";\n }\n}", "title": "" }, { "docid": "a89ec9815030422603733c01aa2773a5", "score": "0.46084914", "text": "function parsePropertyDeclarations(fileClass) {\n return fileClass.getInstanceProperties()\n .reduce((props, prop) => {\n const propName = prop.getName();\n return propName ? props.add(propName) : props; // don't add unnamed properties (not sure how we would have one of those, but seems its possible according to the TsSimpleAst types)\n }, new Set());\n}", "title": "" }, { "docid": "1099e2b448f7fefb4812df3e494fd6f9", "score": "0.46068454", "text": "function spiltProp(p) {\n var prop = {};\n if (!p || p.length == 0) {\n return prop;\n }\n for (var i = -1, coll = p.split(','), l = coll.length; ++i < l;) {\n var namevalue = coll[i].split('=');\n prop[namevalue[0]] = namevalue[1];\n }\n return prop;\n}", "title": "" }, { "docid": "747ce2d91b49cc126e7b34a5b272b0ab", "score": "0.46016726", "text": "function properties() {\n const markdown = fs.readFileSync(MD_FILE).toString();\n const strings = markdown.match(/<!-+[\\s|\\n]*@([a-z]+)\\s+([a-z0-9-]+)[\\s|\\n]*-+>/ig) || [];\n\n return strings.reduce((all, s) => {\n const chunks = s.match(/<!-+[\\s|\\n]*@([a-z]+)\\s+([a-z0-9-]+)[\\s|\\n]*-+>/i);\n if (chunks && chunks.length === 3) {\n all[chunks[1]] = chunks[2]\n }\n return all;\n }, {})\n}", "title": "" }, { "docid": "333a66d59974fbed4f1e55a247f4ad49", "score": "0.46009058", "text": "function loadConfig() {\n var args = process.argv.slice(2); // remove unneeded boilerplate args\n if (args[0] != '--config') {\n console.error('arguments: --config CONFIG [--state STATE] [--properties CATALOG]');\n return new Promise(function (resolve, reject) {\n reject(\"missing required '--config' argument\");\n });\n }\n else {\n return lib$1.readFile(args[1]).then(function (buffer) {\n let config = JSON.parse(buffer.toString());\n // if (config instanceof configType) {\n // }\n return { config: config };\n });\n }\n}", "title": "" }, { "docid": "cd154937272e9341c1745bf73191173a", "score": "0.4600159", "text": "parsePropertyDefinition() {\n let fs = this.pushFunctionState_(FUNCTION_STATE_SCRIPT);\n let result = this.parsePropertyDefinition_();\n this.popFunctionState_(fs);\n return result;\n }", "title": "" }, { "docid": "5b107aeec76c003ef801825f5b0f1fe9", "score": "0.45905074", "text": "function parsePLS(contents) {\r\n\t\tvar lines = contents.split(/\\n/);\r\n\t\tvar plsInfo = {};\r\n\t\tvar recordList = [];\t\r\n\t\t\r\n\t\t//the fun way to get objects from the array.\r\n\t\tfunction records(index) {\r\n\t\t\tif (typeof recordList[index] === 'undefined') {\r\n\t\t\t\trecordList[index] = {};\r\n\t\t\t}\r\n\t\t\treturn recordList[index];\r\n\t\t}\r\n\t\t\r\n\t\tfor (var c = 0; c < lines.length; c++) {\r\n\t\t\tvar line = lines[c];\r\n\t\t\tvar match = line.match(/^.*(\\d)=/);\r\n\t\t\tif (match != null) var num = parseInt(match[1]) - 1; //not always used.\r\n\t\t\t\r\n\t\t\tvar value = line.split('=')[1];\r\n\t\t\t\r\n\t\t\tif (line.indexOf('File') == 0) {\r\n\t\t\t\trecords(num).file = value;\r\n\t\t\t}\r\n\t\t\telse if (line.indexOf('Title') == 0) {\r\n\t\t\t\trecords(num).title = value;\r\n\t\t\t}\r\n\t\t\telse if (line.indexOf('Length') == 0) {\r\n\t\t\t\trecords(num).length = parseInt(value);\r\n\t\t\t}\r\n\t\t\telse if (line.indexOf('Version') == 0) {\r\n\t\t\t\tplsInfo.version = parseInt(value);\r\n\t\t\t}\r\n\t\t\telse if (line.indexOf('NumberOfEntries') == 0) {\r\n\t\t\t\tplsInfo.length = parseInt(value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tplsInfo.records = recordList;\r\n\t\t\r\n\t\treturn plsInfo;\r\n\t}", "title": "" }, { "docid": "549d93c404f36a0f7378f2bff13ab405", "score": "0.4581902", "text": "function loadIniFromFile(file, closure) {\n \"use strict\";\n var reader = new FileReader();\n reader.onload = function(e) {\n var text = e.target.result;\n try {\n closure(parseIniFromText(text));\n } catch (err) {\n window.alert(\"Error parsing undertale.ini: \" + err);\n }\n };\n reader.readAsText(file);\n}", "title": "" }, { "docid": "549d93c404f36a0f7378f2bff13ab405", "score": "0.4581902", "text": "function loadIniFromFile(file, closure) {\n \"use strict\";\n var reader = new FileReader();\n reader.onload = function(e) {\n var text = e.target.result;\n try {\n closure(parseIniFromText(text));\n } catch (err) {\n window.alert(\"Error parsing undertale.ini: \" + err);\n }\n };\n reader.readAsText(file);\n}", "title": "" }, { "docid": "daab494fdbb8a8c3d66b9bdb3be17b1c", "score": "0.45743054", "text": "function parseBlockProperties(text, caseSensitive = false) {\n if (!text.trim()) return null;\n let properties = {}\n try {\n eval(`properties = {${text}}`);\n } catch(err) {\n console.log(`Trouble parsing properties: \"${text}\"`);\n if (err instanceof ReferenceError) {\n console.log('Did you remember to put quotation marks around ' +\n 'your string and commas between properties?');\n } else if (err instanceof SyntaxError) {\n console.log('Did you remember to add quotation marks?');\n }\n return null;\n }\n if (caseSensitive) return properties;\n // all property keys must be converted to lowercase\n let lower = {};\n for (let property in properties) {\n lower[property.toLowerCase()] = properties[property];\n }\n return lower;\n}", "title": "" }, { "docid": "5e09211fc1a78f6dd51f6288a66ec852", "score": "0.45720953", "text": "function parseConfigFile(file) {\n let configFile = {};\n if (!_.isEmpty(file)) {\n try {\n configFile = JSON5.parse(file);\n } catch (err) {\n // console.error('something went wrong with parsing the launch file', err);\n configFile = {};\n }\n }\n return configFile;\n}", "title": "" }, { "docid": "f242109830fdfc88ee67bd901fab075c", "score": "0.4563028", "text": "static get properties() {\n\n // name: {\n // Type: String\n // },\n //Puth always namepath to change the path just in case.\n // namePath: {\n // Type: String,\n // value: 'name'\n // }\n }", "title": "" }, { "docid": "d799caa8899fa20508bdd11c7c19095a", "score": "0.45612702", "text": "function parseFile(filename) {\n const fs = require('fs');\n let data = fs.readFileSync(filename, 'utf8');\n return data.split(\"\\n\").slice(0,-1);\n}", "title": "" }, { "docid": "a2a34fc8cab6448e803fc812690d7f8b", "score": "0.45565784", "text": "read(defsPfile) {\n\t\texpect(defsPfile, ['Pfile', 'null']);\n\t\t\n\t\tif (defsPfile == null)\n\t\t\treturn;\n\t\t\n\t\tif (!defsPfile.exists()) {\n\t\t\tterminal.abnormal(`--defs file not found ${defsPfile.name}`);\n\t\t\treturn;\n\t\t}\n\t\t// terminal.trace(`Reading defs from ${defsPfile.name}`);\n\t\t\n\t\ttry {\n\t\t\tvar tr = new TextReader();\n\t\t\ttr.open(defsPfile.name);\n\t\t\tvar line = '';\n\t\t\twhile ((line = tr.getline()) != null)\n\t\t\t\tthis.parseLine(line);\n\t\t\ttr.close();\n\t\t}\n\t\tcatch(err) {\n\t\t\tterminal.abnormal(err.message);\n\t\t}\n\t}", "title": "" }, { "docid": "4930c899de1794b09be4799690410cc0", "score": "0.45546892", "text": "function nestedRead(structure, propertyList) {\n var current = structure;\n for (var i = 0; i < propertyList.length; i++) {\n if (!current.hasOwnProperty(propertyList[i])) {\n return false;\n }\n current = current[propertyList[i]];\n }\n return current;\n}", "title": "" }, { "docid": "33017c5a7c2dea11c03913d7af5357e9", "score": "0.4548913", "text": "function loadjson(filepath){\n try{\n let content = fs.readFileSync(filepath);\n return JSON.parse(content);\n }catch(err){\n logger.error(err.message);\n }\n return null;\n}", "title": "" }, { "docid": "6ee23c59f76e096f4f1ca5b2cf05028c", "score": "0.45476413", "text": "parseFile (fullName, parser) {\n return new Promise((resolve, reject) => {\n winston.debug('Trying to read file %s', fullName)\n fs.readFile(fullName, 'utf8', (err, content) => {\n if (err) {\n reject(err)\n } else {\n try {\n resolve(parser(content))\n } catch (err) {\n reject(err)\n }\n }\n })\n })\n }", "title": "" }, { "docid": "4d250520ddf873bf72b7b94aac0e6ba7", "score": "0.454689", "text": "parse(buff) {\n\n\t\tconst rs = new Stream(buff);\n\t\tlet id = this.id = rs.string(8);\n\n\t\t// Check the id's 4the byte. If this is \"T\", then we're reading in a \n\t\t// text exemplar. Otherwise we're reading a binary one. Can't find any \n\t\t// documentation on the textual representation though, but ok.\n\t\tlet text = id[3] === 'T';\n\t\tif (id[3] === 'T') {\n\t\t\tthis.parseFromString(buff.toString('utf8'));\n\n\t\t\t// Not parsing for now.\n\t\t\treturn this;\n\t\t}\n\n\t\t// Get the parent cohort TGI. Set to 0 in case of no parent.\n\t\tthis.parent = [rs.uint32(), rs.uint32(), rs.uint32()];\n\n\t\t// Read all properties one by one.\n\t\tconst count = rs.uint32();\n\t\tconst props = this.props = new Array(count);\n\t\tconst table = this.table = Object.create(null);\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tlet prop = props[i] = new Property();\n\t\t\tprop.parse(rs);\n\t\t}\n\n\t\t// Create the property table as well.\n\t\tthis.createTable();\n\n\t\treturn this;\n\n\t}", "title": "" }, { "docid": "c342c049f1045561162c6b523036267e", "score": "0.45442638", "text": "function loadConfig() {\n // let ymlFile = fs.readFileSync('config.yml', 'utf8');\n // return yaml.load(ymlFile);\n\n let configFile = fs.readFileSync('config.json', 'utf-8');\n return JSON.parse(configFile);\n}", "title": "" }, { "docid": "a8ce4e8b9a999200e6795a38a07036da", "score": "0.45428675", "text": "function loadFile() {\n try {\n const data = fs.readFileSync('people.json')\n return JSON.parse(data)\n } catch (e) {\n return []\n }\n}", "title": "" }, { "docid": "36554c97773ed03efae423b31e2ad0fb", "score": "0.45388857", "text": "function parseFile(filename) {\n\t\tfile = OpenRawFile(filename);\n\t\tvar text = CreateStringFromByteArray(file.read(file.getSize()));\n\t\tfile.close();\n\t\treturn this.parseText(text);\n\t}", "title": "" } ]
23fa36c898f2c969c49f3f8aa285baea
create chart data entity state based this is used for pie, doughnut, polarArea,radar, simple bar chart because we do not need time series only the current state values.
[ { "docid": "91ba1ac2a834495b5f89c7810a613969", "score": "0.60507226", "text": "createChartData() {\n /**\n * entities : all entities data and options\n * entityOptions : global entities options\n */\n if (!this.entity_items.isValid()) return null\n // const _data = this.entity_items.getData()\n\n const _data = this.entity_items.getChartLabelAndData()\n\n if (_data.length === 0) {\n console.error(\"Create Chart Data, no Data present !\")\n return null\n }\n\n let _defaultDatasetConfig = {\n mode: \"current\",\n unit: \"\"\n }\n\n let _graphData = this.getDefaultGraphData()\n _graphData.config.mode = \"simple\"\n\n /**\n * merge entity options\n */\n if (this.entity_options) {\n _defaultDatasetConfig = {\n ..._defaultDatasetConfig,\n ...this.entity_options\n }\n }\n\n /**\n * merge dataset_config\n * all entity labels\n * add dataset entities\n */\n _graphData.data.labels = _data.labels //this.entity_items.getNames()\n _graphData.data.datasets[0] = _defaultDatasetConfig\n _graphData.data.datasets[0].label = this.card_config.title || \"\"\n /**\n * add the unit\n */\n if (this.entity_options && this.entity_options.unit) {\n _graphData.data.datasets[0].unit = this.entity_options.unit || \"\"\n } else {\n _graphData.data.datasets[0].units = this.entity_items.getEntitieslist().map((item) => item.unit)\n }\n\n /**\n * case horizontal bar\n */\n\n if (this.card_config.chart.isChartType(\"horizontalbar\")) {\n _graphData.data.datasets[0].indexAxis = \"y\"\n }\n\n /**\n * custom colors from the entities\n */\n let entityColors = _data.colors //this.entity_items.getColors()\n\n if (this.entity_options && this.entity_options.gradient != undefined) {\n _graphData.config.gradient = true\n }\n\n if (entityColors.length === _graphData.data.labels.length) {\n _graphData.data.datasets[0].backgroundColor = entityColors\n _graphData.data.datasets[0].showLine = false\n } else {\n if (this.card_config.chart.isChartType(\"radar\")) {\n _graphData.data.datasets[0].backgroundColor = COLOR_RADARCHART\n _graphData.data.datasets[0].borderColor = COLOR_RADARCHART\n _graphData.data.datasets[0].borderWidth = 1\n _graphData.data.datasets[0].pointBorderColor = COLOR_RADARCHART\n _graphData.data.datasets[0].pointBackgroundColor = COLOR_RADARCHART\n _graphData.data.datasets[0].tooltip = true\n _graphData.config.gradient = false\n } else {\n /**\n * get backgroundcolor from DEFAULT_COLORS\n */\n entityColors = DEFAULT_COLORS.slice(1, _data.data.length + 1)\n _graphData.data.datasets[0].backgroundColor = entityColors\n _graphData.data.datasets[0].borderWidth = 0\n _graphData.data.datasets[0].showLine = false\n }\n }\n _graphData.data.datasets[0].data = _data.data\n _graphData.config.segmentbar = false\n\n /**\n * add the data series and return the new graph data\n */\n if (this.card_config.chart.isChartType(\"bar\") && this.card_config.chartOptions && this.card_config.chartOptions.segmented) {\n const newData = this.createSimpleBarSegmentedData(_graphData.data.datasets[0])\n if (newData) {\n _graphData.data.datasets[1] = {}\n _graphData.data.datasets[1].data = newData.data\n _graphData.data.datasets[1].tooltip = false\n _graphData.data.datasets[1].backgroundColor = newData.backgroundColors\n _graphData.data.datasets[1].borderWidth = 0\n _graphData.data.datasets[1].showLine = false\n _graphData.config.segmentbar = newData.data.length !== 0\n }\n }\n return _graphData\n }", "title": "" } ]
[ { "docid": "b4c41a03d2ef143f5d18bb4ae079e7ee", "score": "0.65665066", "text": "function createSeries(stateData) {\n // Map each state into its series\n let orderedStates = sortStates(stateData);\n return orderedStates.map(state =>\n ({\n type: \"spline\",\n name: state,\n color: colourMapping[state],\n showInLegend: true,\n dataPoints: createInstances(stateData, state)\n })\n )\n}", "title": "" }, { "docid": "8c367a30082e564e51140ac3d16ae4c4", "score": "0.6518457", "text": "function generateStateChartData(state, start_date, end_date) {\n document.getElementById(\"chart-missing\").style.display = \"none\";\n var state_historical_data = getStateSpecificHistorical(state, historicalCovidData, start_date, end_date);\n var state_forecast_data = getStateSpecificForecast(state, forecastData, start_date, end_date);\n state_forecast_data.unshift(state_historical_data[0]);\n var chartData = {\n datasets: [\n {\n label: 'Total Cases',\n backgroundColor: 'rgba(255,0,0,0.25)',\n borderColor: 'red',\n data: state_historical_data,\n },\n {\n label: 'Forecasted',\n backgroundColor: 'rgba(0,0,255,0.25)',\n borderColor: 'blue',\n data: state_forecast_data,\n },\n ]\n }\n var trendlineSelected = document.getElementById('trendline-option').checked;\n if (trendlineSelected === true){\n chartData.datasets[1][\"trendlineLinear\"] = {\n style: \"rgba(255,0,255, .8)\",\n lineStyle: \"solid\",\n width: 3\n };\n } \n return chartData;\n}", "title": "" }, { "docid": "339269b03237b5dd27516b63527766cf", "score": "0.63537085", "text": "drawChart() {\n const db = this.props.session;\n\n const state = db.Division\n .filter(d => d.level === 'state')\n .first();\n\n if (!state || !state.topojson) return;\n\n this.chart.create(\n `#demographic-map-${this.props.data_key}`,\n state.topojson,\n `https://www.politico.com/interactives/elections/data/us-census/acs5/2015/${window.appConfig.stateFips}/${this.props.variable}.json`,\n {\n range: ['#f7e9c9', '#f3ddac', '#edcd83', '#e7bc5a', '#c8951e'],\n projection: d3.geoMercator,\n scaleType: d3.scaleThreshold,\n noData: '#e2e2e2',\n censusAccessor: this.props.accessor,\n },\n );\n }", "title": "" }, { "docid": "fe4d08e7d641beb0d6b6a24fc0598788", "score": "0.6237726", "text": "createHistoryChartData() {\n let _graphData = this.getDefaultGraphData()\n\n _graphData.config.options.fill = false\n _graphData.config.mode = \"history\"\n\n const entities = this.entity_items.getEntityIds()\n entities.forEach((id) => {\n /**\n * current selected entity\n */\n const _entity = this.entity_items.items[id]\n let _entityOptions = { ...this.entity_items.getOptions(id) }\n\n /**\n * default Dataset Properties\n */\n let _options = {\n label: _entity.name || \"unkonwn\",\n unit: _entity.unit || \"\",\n pointRadius: 0,\n current: _entity.state || 0.0,\n last_changed: _entity.last_changed || new Date(),\n mode: \"history\"\n }\n if (this.card_config.chart.isChartType(\"horizontalbar\")) {\n _options.indexAxis = \"y\"\n }\n\n if (this.card_config.chart.isChartType(\"radar\")) {\n _options.pointRadius = 12\n _options.hoverRadius = 18\n _options.hitRadius = 22\n }\n\n if (this.entity_options) {\n _options = { ..._options, ...this.entity_options }\n _graphData.config.options = { ..._graphData.config.options, ...this.entity_options }\n }\n\n /**\n * add all options from style settings\n */\n _options = { ..._options, ..._entityOptions }\n _graphData.config.options.fill = _entityOptions.fill || CT_BARCHARTS.includes(this.card_config.chart)\n\n if (_entityOptions.fill && _entityOptions.gradient && _entityOptions.gradient.colors) {\n const _axis = _options.indexAxis === \"y\" ? \"x\" : \"y\"\n _options.gradient = {\n backgroundColor: {\n axis: _axis,\n colors: _entityOptions.gradient.colors\n }\n }\n _options.labelcolor = _entityOptions.gradient.colors[0]\n _options.borderColor = _entityOptions.gradient.colors[0] || DEFAULT_COLORS[_graphData.config.series]\n _graphData.config.gradient = true\n } else {\n if (_entityOptions.backgroundColor === undefined) {\n _options.backgroundColor = DEFAULT_COLORS[_graphData.config.series]\n _options.borderColor = DEFAULT_COLORS[_graphData.config.series]\n } else {\n _options.backgroundColor = _options.backgroundColor || _options.backgroundColor || _options.color\n _options.borderColor = _options.borderColor || _options.backgroundColor || _options.color\n }\n }\n /**\n * check used trendline\n */\n if (_entityOptions.trendlineLinear) {\n _graphData.config.trendline = true\n } \n /**\n * check used thresholds\n */\n if (this.card_config.chartOptions.thresholds) {\n _graphData.config.thresholds = true\n }\n /**\n * check secondary axis\n */\n if (!_graphData.config.secondaryAxis) {\n _graphData.config.secondaryAxis = _entityOptions.yAxisID != undefined || _entityOptions.xAxisID != undefined\n }\n\n /**\n * add the options, labels and data series\n */\n if (_graphData.config.options.mode.timeaxis == false) {\n /**\n * category based datasets\n */\n const _seriesdata = this.entity_items.getDataset(id)\n _graphData.config.multiseries = false\n if (_seriesdata && _seriesdata.data) {\n _graphData.data.labels = _seriesdata.labels\n if (this.card_config.chart.isChartType(\"pie\") || this.card_config.chart.isChartType(\"doughnut\")) {\n _graphData.data.labels = this.entity_items.getNames()\n _graphData.config.multiseries = true\n }\n _options.data = _seriesdata.data\n _graphData.config.useTimeSeries = _graphData.config.options.mode.timescale\n }\n } else {\n /**\n * time axis based datasets\n */\n if (_entity.seriesdata && _entity.seriesdata.data) {\n _options.data = _entity.seriesdata.data\n _graphData.config.datascales = _entity.datascales\n _graphData.config.timescale = _graphData.config.options.mode.timescale\n }\n }\n\n _graphData.data.datasets.push(_options)\n _graphData.config.series++\n })\n return _graphData\n }", "title": "" }, { "docid": "795a78bc4ef87c084fcaaa93bfb78423", "score": "0.6192933", "text": "function getDataState() {\n return {\n initialized: DataStore.isInitialized(),\n tempChartValues: DataStore.getTemperatureChart(),\n humidityChartValues: DataStore.getHumidityChart(),\n lastTemp: DataStore.getLastTemperature(),\n lastHumidity: DataStore.getLastHumidity(),\n redraw: DataStore.shouldBeRedrawn()\n };\n}", "title": "" }, { "docid": "495016c3b9bab5c6a3f938bc56fb2dd6", "score": "0.61373127", "text": "function types(d){\r\n if(d.state === \"all\"){\r\n d.dt = d.date\r\n d.x = parseInt(d.dt)\r\n d.y = +d.beePop;\r\n }\r\n\r\n\t return d;\r\n\t }", "title": "" }, { "docid": "7e48d545b4c10ec92f9cf9bd4e192fba", "score": "0.6079554", "text": "function StateGraph({ stateData }) {\n // CanvasJS API settings\n const [graphOptions, setGraphOptions] = useState(null);\n // Display loading text if data is not yet parsed\n const [isLoading, setIsLoading] = useState(true);\n\n useEffect(() => {\n setGraphOptions({\n data: createSeries(stateData),\n animationEnabled: true,\n height: 315,\n title: {\n fontFamily:\n \"Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif\",\n fontSize: 20\n },\n axisX: {\n labelFontFamily: \"sans-serif\",\n //valueFormatString: 'MMM DD'\n },\n axisY: {\n labelFontFamily: \"sans-serif\"\n },\n legend: {\n verticalAlign: \"top\",\n fontFamily: \"sans-serif\"\n },\n toolTip: {\n shared: true,\n //valueFormatString: 'MMM DD'\n }\n })\n\n setIsLoading(false);\n }, [stateData]);\n\n return (\n <div className=\"card\">\n <h2>Confirmed Cases in Australian States</h2>\n {isLoading ? <p>Loading...</p> : <CanvasJSChart options={graphOptions} style={{ paddingLeft: '500px' }} />}\n </div>\n );\n}", "title": "" }, { "docid": "aa2148aeda345f7a5d10cf9b0cbe41f4", "score": "0.60696846", "text": "prepareChartData() {\n\n let preparedData = [];\n\n for (var i = 0; i < this.state.days.length; i++) {\n\n let day = this.state.days[i];\n\n preparedData.push({\n x: i,\n y: day.amount\n })\n }\n\n this.setState({ preparedData: [] }, () => { this.setState({ preparedData: preparedData }) });\n\n }", "title": "" }, { "docid": "50cbb5d93f6c07aaa5fad66ec0d02fd7", "score": "0.60387874", "text": "function App() {\n \n const [chartData, setChartData] = useState({})\n \n useEffect(() => {\n async function fetchData(){\n //quando a pagina carregar essa funçao sera ativada\n const resp = await fetch('https://raw.githubusercontent.com/wcota/covid19br/master/cases-brazil-total.csv')\n //essa url dos dados que vc me deu\n const data = await resp.text()\n const x = data.split(/\\n/).splice(1)\n //x retornara um array\n\n const states = x.map(item => {\n let each = item.split(',')\n let state = each[1]\n // ignora essa logia, so estou passando o formato csv para json( para javascript )\n\n let totalCases = each[2]\n let numCases = parseInt(totalCases)\n let death = each[5]\n return {state, numCases, death}\n // \"colocos os dados nos objs(chave e valor), poderia colocar ou outros mas apenas coloquei esses 3\"\n // \n }) \n return states\n } \n\n fetchData().then(item => {\n chart(...item)\n //coloco os dados na funçao chart q esta a baixo\n }) \n \n}, []) \n\n \nfunction chart(...item){\n // console.log(...item)\n const y = [...item]\n y.shift()\n y.pop()\n\n let states = y.map(docs => {\n return docs.state\n})\n\nlet number = y.map( item => {\n return item.numCases\n})\n\nlet deaths = y.map(item => {\n return item.death\n})\n\n//colo separado os estado, casos e numero de mortes para \"construçao do grafico\"\n\n\n setChartData({\n \n labels: states, \n\n datasets: [\n {\n label: 'Total',\n data: number ,\n backgroundColor: 'rgba(75, 192,198,0.6)',\n //dados para o total\n\n },\n {\n label: 'Death',\n data: deaths ,\n backgroundColor: '#ff0000',\n //numero de mortes\n }\n ], \n borderWidth: 4\n //dados para o grafico\n })\n\n}\n\n return (\n <div>\n <h1>Test</h1>\n <div style={{ height: \"2000px\", width: \"1300px\" }}>\n <Bar data={chartData} options={{ responsive: true ,\n //chartData => declarei la em cima como obj\n title: {text: 'Grafic'}}} legend={{\n display:true,\n position:'top' \n }} />\n {/* coloco os dados dentro do \"Bar\" que importei la em cima, coloco algumas opçoes de estilo\n para tentar fazer bonito :(*/}\n\n </div>\n\n </div>\n );\n}", "title": "" }, { "docid": "05042b4c1db797222c8ab53e38702df8", "score": "0.6038376", "text": "function buildStateBar() {\n\nd3.json(StateUrl).then(function (data) {\n\n // Delete id field in State Data\n delete data[0]._id;\n\n // Create List of All States\n var allStateData = data[0];\n\n console.log(allStateData); \n\n // D3 select tag\n var dropdownMenu = d3.select(\"#selStateEnergy\");\n\n // Assign the value of the dropdown menu option to a variable\n var stateSelection = dropdownMenu.property(\"value\");\n\n console.log(stateSelection);\n\n var stateEntries = Object.entries(allStateData); \n\n console.log(stateEntries);\n\n var barBio = 0;\n var barGeo = 0;\n var barHydro = 0;\n var barSolar = 0;\n var barWind = 0;\n\n stateEntries.forEach(function(state){\n \n var stateData = Object.values(state);\n\n barBio += Object.values(stateData[1])[0];\n barGeo += Object.values(stateData[1])[1];\n barHydro += Object.values(stateData[1])[2];\n barSolar += Object.values(stateData[1])[3];\n barWind += Object.values(stateData[1])[4];\n \n });\n\n\n stateEntries.forEach(function(state){\n \n var stateData = Object.values(state);\n\n if (stateSelection === state[0]) {\n \n console.log(stateData);\n\n var titleBar = `${state[0]} Renewable Energy Use`\n var trace = {\n type: \"bar\",\n x: Object.keys(stateData[1]),\n y: Object.values(stateData[1]),\n marker:{\n color: ['#8c564b', '#17becf', '#7f7f7f', '#bcbd22', '#e377c2']\n }\n }\n console.log(trace);\n var data = [trace];\n // Create Layout\n var layout = {\n title: titleBar,\n xaxis: {\n title: \"Energy Source\",\n },\n yaxis: {\n title: 'British Thermal Units (BTU)',\n autorange: true,\n }\n };\n\n // Add Plot\n Plotly.newPlot(\"stateBar\", data, layout);\n }\n else if (stateSelection === 'All') {\n\n var titleBar = `All States Renewable Energy Use`\n var trace = {\n type: \"bar\",\n x: Object.keys(stateData[1]),\n y: [barBio, barGeo, barHydro, barSolar, barWind],\n marker:{\n color: ['#8c564b', '#17becf', '#7f7f7f', '#bcbd22', '#e377c2']\n }\n }\n var data = [trace];\n // Create Layout\n var layout = {\n title: titleBar,\n xaxis: {\n title: \"Energy Source\",\n },\n yaxis: {\n title: 'British Thermal Units (BTU)',\n autorange: true,\n }\n };\n // Add Plot\n Plotly.newPlot(\"stateBar\", data, layout);\n }\n }) \n});\n}", "title": "" }, { "docid": "7490b1cbd578ae2c358067fc0fe4b753", "score": "0.60348165", "text": "function HeatMapChart() {\n const [data] = useState([\n {\n month: \"Jan\",\n \"anger\": 67,\n \"angerColor\": \"hsl(290, 70%, 50%)\",\n fear: 35,\n fearColor: \"hsl(171, 70%, 50%)\",\n sadness: 30,\n sadnessColor: \"hsl(154, 70%, 50%)\",\n disgust: 10,\n disgustColor: \"hsl(329, 70%, 50%)\",\n surprise: 9,\n surpriseColor: \"hsl(319, 70%, 50%)\",\n anticipation: 95,\n anticipationColor: \"hsl(138, 70%, 50%)\",\n trust: 46,\n trustColor: \"hsl(255, 70%, 50%)\",\n joy: 50,\n joyColor: \"hsl(20, 70%, 50%)\",\n },\n {\n month: \"Feb\",\n \"anger\": 84,\n \"angerColor\": \"hsl(200, 70%, 50%)\",\n fear: 15,\n fearColor: \"hsl(217, 70%, 50%)\",\n sadness: 33,\n sadnessColor: \"hsl(138, 70%, 50%)\",\n disgust: 66,\n disgustColor: \"hsl(76, 70%, 50%)\",\n surprise: 94,\n surpriseColor: \"hsl(110, 70%, 50%)\",\n anticipation: 66,\n anticipationColor: \"hsl(181, 70%, 50%)\",\n trust: 4,\n trustColor: \"hsl(101, 70%, 50%)\",\n joy: 72,\n joyColor: \"hsl(220, 70%, 50%)\",\n },\n {\n month: \"Mar\",\n \"anger\": 90,\n \"angerColor\": \"hsl(297, 70%, 50%)\",\n fear: 89,\n fearColor: \"hsl(213, 70%, 50%)\",\n sadness: 11,\n sadnessColor: \"hsl(209, 70%, 50%)\",\n disgust: 6,\n disgustColor: \"hsl(327, 70%, 50%)\",\n surprise: 36,\n surpriseColor: \"hsl(208, 70%, 50%)\",\n anticipation: 60,\n anticipationColor: \"hsl(203, 70%, 50%)\",\n trust: 42,\n trustColor: \"hsl(205, 70%, 50%)\",\n joy: 5,\n joyColor: \"hsl(301, 70%, 50%)\",\n },\n {\n month: \"Apr\",\n \"anger\": 42,\n \"angerColor\": \"hsl(71, 70%, 50%)\",\n fear: 38,\n fearColor: \"hsl(217, 70%, 50%)\",\n sadness: 25,\n sadnessColor: \"hsl(136, 70%, 50%)\",\n disgust: 36,\n disgustColor: \"hsl(223, 70%, 50%)\",\n surprise: 69,\n surpriseColor: \"hsl(352, 70%, 50%)\",\n anticipation: 52,\n anticipationColor: \"hsl(139, 70%, 50%)\",\n trust: 50,\n trustColor: \"hsl(328, 70%, 50%)\",\n joy: 48,\n joyColor: \"hsl(162, 70%, 50%)\",\n },\n {\n month: \"May\",\n \"anger\": 73,\n \"angerColor\": \"hsl(70, 70%, 50%)\",\n fear: 80,\n fearColor: \"hsl(10, 70%, 50%)\",\n sadness: 56,\n sadnessColor: \"hsl(32, 70%, 50%)\",\n disgust: 94,\n disgustColor: \"hsl(17, 70%, 50%)\",\n surprise: 22,\n surpriseColor: \"hsl(218, 70%, 50%)\",\n anticipation: 26,\n anticipationColor: \"hsl(2, 70%, 50%)\",\n trust: 43,\n trustColor: \"hsl(231, 70%, 50%)\",\n joy: 11,\n joyColor: \"hsl(226, 70%, 50%)\",\n },\n {\n month: \"Jun\",\n \"anger\": 91,\n \"angerColor\": \"hsl(114, 70%, 50%)\",\n fear: 58,\n fearColor: \"hsl(204, 70%, 50%)\",\n sadness: 29,\n sadnessColor: \"hsl(206, 70%, 50%)\",\n disgust: 38,\n disgustColor: \"hsl(208, 70%, 50%)\",\n surprise: 88,\n surpriseColor: \"hsl(346, 70%, 50%)\",\n anticipation: 74,\n anticipationColor: \"hsl(337, 70%, 50%)\",\n trust: 91,\n trustColor: \"hsl(251, 70%, 50%)\",\n joy: 99,\n joyColor: \"hsl(194, 70%, 50%)\",\n },\n {\n month: \"Jul\",\n \"anger\": 57,\n \"angerColor\": \"hsl(76, 70%, 50%)\",\n fear: 81,\n fearColor: \"hsl(160, 70%, 50%)\",\n sadness: 76,\n sadnessColor: \"hsl(254, 70%, 50%)\",\n disgust: 77,\n disgustColor: \"hsl(320, 70%, 50%)\",\n surprise: 58,\n surpriseColor: \"hsl(258, 70%, 50%)\",\n anticipation: 14,\n anticipationColor: \"hsl(102, 70%, 50%)\",\n trust: 3,\n trustColor: \"hsl(283, 70%, 50%)\",\n joy: 63,\n joyColor: \"hsl(143, 70%, 50%)\",\n },\n {\n month: \"Aug\",\n \"anger\": 74,\n \"angerColor\": \"hsl(79, 70%, 50%)\",\n fear: 98,\n fearColor: \"hsl(158, 70%, 50%)\",\n sadness: 36,\n sadnessColor: \"hsl(278, 70%, 50%)\",\n disgust: 56,\n disgustColor: \"hsl(57, 70%, 50%)\",\n surprise: 97,\n surpriseColor: \"hsl(339, 70%, 50%)\",\n anticipation: 90,\n anticipationColor: \"hsl(335, 70%, 50%)\",\n trust: 1,\n trustColor: \"hsl(41, 70%, 50%)\",\n joy: 40,\n joyColor: \"hsl(3, 70%, 50%)\",\n },\n {\n month: \"Sep\",\n \"anger\": 1,\n \"angerColor\": \"hsl(305, 70%, 50%)\",\n fear: 50,\n fearColor: \"hsl(277, 70%, 50%)\",\n sadness: 36,\n sadnessColor: \"hsl(86, 70%, 50%)\",\n disgust: 74,\n disgustColor: \"hsl(304, 70%, 50%)\",\n surprise: 91,\n surpriseColor: \"hsl(346, 70%, 50%)\",\n anticipation: 47,\n anticipationColor: \"hsl(99, 70%, 50%)\",\n trust: 87,\n trustColor: \"hsl(86, 70%, 50%)\",\n joy: 3,\n joyColor: \"hsl(219, 70%, 50%)\",\n },\n {\n month: \"Oct\",\n \"anger\": 100,\n \"angerColor\": \"hsl(250, 70%, 50%)\",\n fear: 65,\n fearColor: \"hsl(214, 70%, 50%)\",\n sadness: 94,\n sadnessColor: \"hsl(112, 70%, 50%)\",\n disgust: 71,\n disgustColor: \"hsl(61, 70%, 50%)\",\n surprise: 85,\n surpriseColor: \"hsl(95, 70%, 50%)\",\n anticipation: 91,\n anticipationColor: \"hsl(216, 70%, 50%)\",\n trust: 100,\n trustColor: \"hsl(200, 70%, 50%)\",\n joy: 65,\n joyColor: \"hsl(345, 70%, 50%)\",\n },\n {\n month: \"Nov\",\n \"anger\": 75,\n \"angerColor\": \"hsl(52, 70%, 50%)\",\n fear: 15,\n fearColor: \"hsl(244, 70%, 50%)\",\n sadness: 33,\n sadnessColor: \"hsl(57, 70%, 50%)\",\n disgust: 5,\n disgustColor: \"hsl(69, 70%, 50%)\",\n surprise: 13,\n surpriseColor: \"hsl(137, 70%, 50%)\",\n anticipation: 13,\n anticipationColor: \"hsl(201, 70%, 50%)\",\n trust: 43,\n trustColor: \"hsl(177, 70%, 50%)\",\n joy: 53,\n joyColor: \"hsl(36, 70%, 50%)\",\n },\n {\n month: \"Dec\",\n \"anger\": 98,\n \"angerColor\": \"hsl(210, 70%, 50%)\",\n fear: 74,\n fearColor: \"hsl(329, 70%, 50%)\",\n sadness: 90,\n sadnessColor: \"hsl(143, 70%, 50%)\",\n disgust: 53,\n disgustColor: \"hsl(316, 70%, 50%)\",\n surprise: 10,\n surpriseColor: \"hsl(128, 70%, 50%)\",\n anticipation: 3,\n anticipationColor: \"hsl(157, 70%, 50%)\",\n trust: 17,\n trustColor: \"hsl(240, 70%, 50%)\",\n joy: 16,\n joyColor: \"hsl(181, 70%, 50%)\",\n },\n ]);\n\n return (\n <>\n <div className=\"boxSize\">\n <ResponsiveHeatMap\n data={data}\n keys={[\n \"anger\",\n \"fear\",\n \"sadness\",\n \"disgust\",\n \"surprise\",\n \"anticipation\",\n \"trust\",\n \"joy\",\n ]}\n indexBy=\"month\"\n margin={{ top: 100, right: 60, bottom: 60, left: 60 }}\n forceSquare={true}\n sizeVariation={0.5}\n padding={1}\n axisTop={{\n orient: \"top\",\n tickSize: 5,\n tickPadding: 5,\n tickRotation: -90,\n legend: \"\",\n legendOffset: 36,\n }}\n axisRight={null}\n axisBottom={null}\n axisLeft={{\n orient: \"left\",\n tickSize: 5,\n tickPadding: 5,\n tickRotation: 0,\n legend: \"month\",\n legendPosition: \"middle\",\n legendOffset: -40,\n }}\n cellOpacity={1}\n cellBorderColor={{ from: \"color\", modifiers: [[\"darker\", \"0.2\"]] }}\n labelTextColor={{ from: \"color\", modifiers: [[\"darker\", 1.8]] }}\n defs={[\n {\n id: \"lines\",\n type: \"patternLines\",\n background: \"inherit\",\n color: \"rgba(0, 0, 0, 0.1)\",\n rotation: -45,\n lineWidth: 4,\n spacing: 7,\n },\n ]}\n fill={[{ id: \"lines\" }]}\n animate={true}\n motionStiffness={80}\n motionDamping={9}\n hoverTarget=\"cell\"\n cellHoverOthersOpacity={0.25}\n />\n </div>\n </>\n );\n}", "title": "" }, { "docid": "8ac0203a32a299153882a39a1cb050e1", "score": "0.6034196", "text": "constructor(props) {\n super(props);\n this.state = {\n datasets: {}, \n labels: [], \n dateA: timeToDate((new Date()).getTime() - 1000*60*60*24*7),\n dateB: timeToDate((new Date()).getTime()),\n };\n this.stocks = this.props.stocks;\n this.resolution = \"1m\";\n this.updateChart1m = this.updateChart1m.bind(this);\n this.updateChart3m = this.updateChart3m.bind(this);\n this.updateChart6m = this.updateChart6m.bind(this);\n this.updateChart1y = this.updateChart1y.bind(this);\n this.updateChart2y = this.updateChart2y.bind(this);\n this.updateChart5y = this.updateChart5y.bind(this);\n this.updateChartCustom = this.updateChartCustom.bind(this);\n this.updateDateA = this.updateDateA.bind(this);\n this.updateDateB = this.updateDateB.bind(this);\n }", "title": "" }, { "docid": "93c23101e44ae1a2db618e7991c9102f", "score": "0.6024722", "text": "setSalesProductShelfChart(state, payload) {\n const data = {...payload}\n\n // Mapping data\n const dataTmp = _.cloneDeep(data)\n let barChartData = _.cloneDeep(barChartSaleProductData)\n\n barChartData.labels = _.map(data, function (item) {\n return item.shelf_no\n })\n\n // map data for sales\n barChartData.datasets[0].data = _.map(dataTmp, function (item) {\n return Number(item['total_sales_amount'])\n })\n\n // map data for product\n barChartData.datasets[1].data = _.map(dataTmp, function (item) {\n return Number(item['total_sales_quantity'])\n })\n\n state.salesProductShelfChart = barChartData\n }", "title": "" }, { "docid": "66d20edf17e8619a276645ea180a4b18", "score": "0.59801936", "text": "function createData(State) {\n\n // API call\n d3.json(url).then(data => {\n let dataCopy1 = data;\n\n // filter by State and use filter to generate needed data\n let filteredData = dataCopy1.filter(item => item.State.toString() === State)[0];\n console.log(filteredData);\n \n // build pandemic data for selected state\n let stateInfo = d3.select(\"#sample-metadata\");\n stateInfo.html(\"\");\n Object.entries(filteredData).forEach(key => {\n stateInfo\n .append(\"h5\")\n .text(key[0] + \": \" + key[1]) \n });\n });\n}", "title": "" }, { "docid": "f5ec37939a09aebf621d77ec92119021", "score": "0.5922146", "text": "chooseBarDataset(state, setGlobalState) {\n console.log(\"choosing bar dataset\")\n\n // All students\n if (state.selectedPop === \"All Students\") {\n this.barState.math = this.state.allMath.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n this.barState.ela = this.state.allELA.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n // Economic disadvantaged\n } else if (state.selectedPop === \"Economic Disadvantaged\") {\n this.barState.math = state.mathEcon.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n this.barState.ela = state.elaEcon.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n // English learners\n } else if (state.selectedPop === \"English Learners\") {\n this.barState.math = state.mathEng.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n this.barState.ela = state.elaEng.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n // Female\n } else if (state.selectedPop === \"Female\") {\n this.barState.math = state.mathFemale.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n this.barState.ela = state.elaFemale.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n // Male\n } else if (state.selectedPop === \"Male\") {\n this.barState.math = state.mathMale.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n this.barState.ela = state.elaMale.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n // Students with disabilities\n } else if (state.selectedPop === \"Students with Disabilities\") {\n this.barState.math = state.mathDis.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n this.barState.ela = state.elaDis.sort((a, b) => {\n return d3.descending(a.PercentMeet, b.PercentMeet)\n });\n }\n }", "title": "" }, { "docid": "50881321b781d6c842219ecbd6346bc6", "score": "0.5913265", "text": "function setGraph(data, datetime, type, setState) {\n\n let total = 0, discount = 0, netProfit = 0, cost = 0, dataG = [], ranges = [], x = [];\n\n if (type === 'd') {\n x = data.filter(n => dateformat(n.p_dateSale, \"yyyy-mm-dd\") === dateformat(datetime, \"yyyy-mm-dd\"));\n\n for (let ho = 0; ho < 25; ho++) {\n let time = x.filter(n => dateformat(n.p_dateSale, \"H\") === ho.toString());\n let ho_total = 0;\n time.forEach(n => ho_total += n.p_total);\n dataG.push(ho_total);\n }\n\n ranges = day;\n } else if (type === 'm') {\n\n x = data.filter(n => dateformat(n.p_dateSale, \"yyyy-mm\") === dateformat(datetime, \"yyyy-mm\"));\n\n for (let ho = 1; ho < 32; ho++) {\n let time = x.filter(n => dateformat(n.p_dateSale, 'd') === ho.toString());\n let ho_total = 0;\n time.forEach(n => ho_total += n.p_total);\n dataG.push(ho_total);\n }\n\n ranges = month;\n\n } else if (type === 'y') {\n x = data.filter(n => dateformat(n.p_dateSale, \"yyyy\") === dateformat(datetime, \"yyyy\"));\n\n for (let ho = 1; ho < 13; ho++) {\n let time = x.filter(n => dateformat(n.p_dateSale, 'm') === ho.toString());\n let ho_total = 0;\n time.forEach(n => ho_total += n.p_total);\n dataG.push(ho_total);\n }\n\n ranges = year;\n }\n\n let baht = x.filter(n => n.p_typediscount === \"฿\");\n let percent = x.filter(n => n.p_typediscount === \"%\");\n\n // calculate discount\n percent.forEach(n => discount += (n.p_sumtotal / 100) * n.p_discount);\n baht.forEach(n => discount += n.p_discount);\n\n //calculate total AND cost\n x.forEach(n => {\n // total\n total += n.p_total;\n // cost\n const { order } = JSON.parse(n.p_order);\n order.forEach(i => cost += i.p_cost * i.count);\n });\n\n //calculate net profit\n netProfit = total - cost;\n\n setState({ total, discount, netProfit, cost }, ranges, datetime, dataG);\n}", "title": "" }, { "docid": "795438dfeb410acf1be5844dd2efc01c", "score": "0.5847896", "text": "function createViewState(schema, data) {\n const cellsMetadata = data.metadata.slice(0);\n\n /*\n construct a copy of the ranges object that only has categorical\n replace all counts with bool flags\n ie., everything starts out checked\n we mutate this map in the actions below\n */\n const categoricalAsBooleansMap = {};\n _.each(data.ranges, (value, key) => {\n if (\n key !== \"CellName\" &&\n value.options /* it's categorical, it has options instead of ranges */\n ) {\n const optionsAsBooleans = {};\n _.each(value.options, (_value, _key) => {\n optionsAsBooleans[_key] = true;\n });\n categoricalAsBooleansMap[key] = optionsAsBooleans;\n }\n });\n\n const graph = data.graph;\n _.each(cellsMetadata, (cell, idx) => {\n cell.__cellIndex__ = idx;\n cell.__color__ =\n \"rgba(0,0,0,1)\"; /* initial color for all cells in all charts */\n cell.__colorRGB__ = parseRGB(cell.__color__);\n cell.__x__ = graph[idx][1];\n cell.__y__ = graph[idx][2];\n });\n\n // Build the selection crossfilter.\n //\n let cellsCrossfilter = crossfilter(cellsMetadata);\n let cellsDimensionsMap = {};\n cellsDimensionsMap.x = cellsCrossfilter.dimension(r => r.__x__, Float32Array);\n cellsDimensionsMap.y = cellsCrossfilter.dimension(r => r.__y__, Float32Array);\n\n // Now walk the schema and make an appropriate dimension for each\n // metadata field. This is a simplistic mapping, and could be\n // optmized to use smaller scalars (to save memory) or larger\n // floating point where precision is needed.\n //\n _.forEach(schema, (attributes, key) => {\n if (key !== \"CellName\") {\n const dimensionType = deduceDimensionType(attributes, key);\n if (dimensionType) {\n cellsDimensionsMap[key] = cellsCrossfilter.dimension(\n r => r[key],\n dimensionType\n );\n }\n }\n });\n\n return {\n cellsMetadata,\n crossfilter: {\n cells: cellsCrossfilter,\n dimensionMap: cellsDimensionsMap\n },\n categoricalAsBooleansMap\n };\n}", "title": "" }, { "docid": "64355312596cf558baa7b3b3cc796940", "score": "0.58245856", "text": "createHistoryBubbleData() {\n if (!this.entity_items.isValid()) return null\n\n let _seriesData = this.entity_items.getSeriesData()\n\n if (_seriesData && _seriesData.length % 3 === 0) {\n let _graphData = this.getDefaultGraphData()\n for (let r = 0; r < _seriesData.length; r += 3) {\n const _attr = this.entity_items.getOptions(r + 2) || {}\n let _data = []\n _seriesData[r].data.forEach(function (e, i) {\n if (_seriesData[r + 1].data[i] && _seriesData[r + 2].data[i]) {\n _data.push({\n x: parseFloat(_seriesData[r + 0].data[i].y) || 0.0,\n y: parseFloat(_seriesData[r + 1].data[i].y || 0.0),\n r: parseFloat(_seriesData[r + 2].data[i].y || 0.0)\n })\n }\n })\n let _options = {\n label: this.entity_items.getEntity(r + 2).name || \"\",\n unit: this.entity_items.getEntity(r + 2).unit || \"\",\n scale: this.entity_items.getEntity(r + 2).scale || 1,\n backgroundColor: _attr.backgroundColor || DEFAULT_COLORS[17 + r * 5],\n borderColor: _attr.borderColor || DEFAULT_COLORS[17 + r * 5]\n // TODO: min, max, avg values\n }\n if (_attr && _attr.pointStyle) {\n _options.pointStyle = _attr.pointStyle\n _options.pointRadius = 6\n }\n if (_attr && _attr.pointRadius) {\n _options.pointRadius = _attr.pointRadius\n }\n if (this.entity_options) {\n _options = { ..._options, ...this.entity_options }\n _graphData.config.options = this.entity_options\n }\n if (_attr) _options = { ..._options, ..._attr }\n _options.data = _data\n _graphData.data.datasets.push(_options)\n }\n if (_graphData.data.datasets.length) {\n _graphData.config.options.bubble = true\n return _graphData\n }\n }\n console.error(\"BubbleChart setting not valid for \", this.entity_items.getNames())\n return null\n }", "title": "" }, { "docid": "e66ee7c972cfd4a8fa58448216da3553", "score": "0.5823563", "text": "nrqlChartData(platformUrlState) {\n const { duration } = platformUrlState.timeRange;\n const durationInMinutes = duration / 1000 / 60;\n return [\n {\n title: 'Page Views per City',\n nrql: `SELECT count(*) FROM PageView WHERE appName = 'Demo ASP.NET' SINCE 1 week ago FACET city`,\n chartType: 'pie'\n },\n {\n title: 'Response Time Distribution (ms)',\n nrql: `SELECT histogram(duration,20,20) FROM PageView SINCE yesterday`\n },\n {\n title: 'Engagement by Hour',\n nrql: `SELECT uniqueCount(session) FROM PageView SINCE 7 days ago FACET hourOf(timestamp)`,\n chartType: 'pie'\n },\n {\n title: 'Browsers',\n nrql: `SELECT percentage(uniqueCount(session), WHERE userAgentName = 'IE') AS '% of IE Users', percentage(uniqueCount(session), WHERE userAgentName = 'Chrome') AS '% of Chrome Users', percentage(uniqueCount(session), WHERE userAgentName = 'Firefox') AS '% of Firefox Users', percentage(uniqueCount(session), WHERE userAgentName = 'Safari') AS '% of Safari Users' FROM PageView SINCE 7 days ago`,\n chartType: 'billboard'\n }\n ];\n }", "title": "" }, { "docid": "426270b317bd4119fa7fff5767a97b77", "score": "0.5794336", "text": "function importState(state) {\n\n\t\t\t\t\t\t// Load a state object created by exportState().\n\t\t\t\t\t\tscope.title = state.title;\n\t\t\t\t\t\tscope.durationDim = scope.durationDims ? scope.durationDims.filter(function(d) { return d.key === state.durationDim; })[0] : null;\n\t\t\t\t\t\tscope.tooltipLabelDim = scope.labelDims ? scope.labelDims.filter(function(d) { return d.key === state.tooltipLabelDim; })[0] : null;\n\t\t\t\t\t\tscope.groupDim = scope.labelDims ? scope.labelDims.filter(function(d) { return d.key === state.groupDim; })[0] : null;\n\t\t\t\t\t\tscope.xGroupDim = scope.labelDims ? scope.labelDims.filter(function(d) { return d.key === state.xGroupDim; })[0] : null;\n\t\t\t\t\t\tscope.xSortDim = scope.labelDims ? scope.labelDims.filter(function(d) { return d.key === state.xSortDim; })[0] : null;\n\n\t\t\t\t\t\tscope.mode = state.mode;\n\n\t\t\t\t\t}", "title": "" }, { "docid": "ca806d5520a2480d47d2b459d2c61122", "score": "0.57803106", "text": "function types3(d){\r\n if(field === d.state){\r\n d.dt = d.date\r\n d.x = parseInt(d.dt)\r\n d.y = +d.beePop;\r\n }\r\n return d;\r\n }", "title": "" }, { "docid": "ab8256241be2c986a11fd344e8bffaf4", "score": "0.5764981", "text": "function getData(week_ending_date, state) {\n let byWeek, trace;\n if (!(byWeek = lookup[week_ending_date])) { // initially, this IS false ... enter brackets\n byWeek = lookup[week_ending_date] = {};\n }\n if (!(trace = byWeek[state])) {\n trace = byWeek[state] = {\n x: [],\n y: [],\n id: [],\n text: [],\n mode: 'markers' // want markers on plot\n };\n }\n return trace;\n }", "title": "" }, { "docid": "8457694ec0ba3aa1b64bd8a8f598cceb", "score": "0.57412606", "text": "constructor(props) {\n super();\n this.state = {\n // you can add new states here\n carbonData: null,\n methaneData: null,\n nitrousData: null,\n temperatureData: null,\n\n //get plastic and repeat for others\n macroGrowth2050: macroGrowth2050.macroGrowth2050,\n microGrowth2050: microGrowth2050.microGrowth2050,\n\n //sea seaLevelRise\n seaLevelRise: seaLevelRise.seaLevelRise,\n\n currentDate: new Date(\"1950-11-01\"), // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\n dataIsLoaded: false,\n };\n }", "title": "" }, { "docid": "530b56750f0f82478f787bc288f99316", "score": "0.5740902", "text": "getSeriesData() {\n if (!this._isValid) return null;\n let _seriesData = [];\n for (const list of this.stateHistories) {\n if (list.length === 0) continue;\n if (!list[0].state) continue;\n const items = this.getdata(list);\n _seriesData.push(items);\n }\n return _seriesData;\n }", "title": "" }, { "docid": "36b2f64eb46ac05bcc4870fc2634ec3c", "score": "0.5714862", "text": "setBatchBarChartData(batchData){\n let nndata= []\n let labels = \"\"\n let predicts = \"\"\n if(batchData != null){\n labels = batchData[\"labels\"]\n predicts = batchData[\"predicts\"]\n }\n \n for(let j=0 ; j < labels.length ; j++){\n let ttt = 0\n let fff = 0\n for(let k=0 ; k < predicts[j].length ; k++){//총 합을 구하고 맞춘 값과 못 맞춘 값을 나누어야 한다.\n if(j == k){\n ttt = predicts[j][k]\n }else{\n fff += predicts[j][k]\n }\n }\n nndata.push({name: labels[j], trueData: ttt, falseData: fff, predicts:predicts[j]})\n }\n\n this.state.NN_Labels = labels\n this.state.NN_Data = nndata \n // this.setState({ NN_Data: nndata })\n // 최초 Pie 차트를 보여준다.\n if(batchData == null){\n labels = [\"blank\"]\n }\n this.stackBarChartOnClick(labels[0])\n }", "title": "" }, { "docid": "8aac3d2f03ccdddc64def6bdfb0b3d50", "score": "0.5687295", "text": "async function doviz_rt_states_graph() {\n let data = await fetch_imaginea_json(\"rt_india_states\");\n\n let spec = {\n width: 'container',\n // height: 300,\n data: { values: data },\n facet: {\n column: {field: 'state_name', type: 'ordinal', sort: { op: 'max', field: 'rt', order: 'descending' }},\n\n },\n //height: 'container',\n spec: {\n layer: [\n {\n mark: { type: \"area\", color: \"gainsboro\" },\n encoding: {\n x: { field: \"date\", title: \"Date\", type: \"temporal\" },\n y: { field: \"p05\", type: \"quantitative\" },\n y2: { field: \"p95\", type: \"quantitative\" },\n tooltip: [\n { field: \"date\", title: \"Date\", type: \"temporal\" },\n { field: \"p05\", title: \"5%tile\", type: \"quantitative\" },\n { field: \"rt\", title: \"Est. Rt\", type: \"quantitative\" },\n { field: \"p95\", title: \"95%tile\", type: \"quantitative\" },\n { field: \"daily_cases\", title: \"Cases\", type: \"quantitative\" }\n ]\n }\n },\n {\n mark: { type: \"area\", color: \"silver\" },\n encoding: {\n x: { field: \"date\", title: \"Date\", type: \"temporal\" },\n y: { field: \"p25\", type: \"quantitative\" },\n y2: { field: \"p75\", type: \"quantitative\" },\n tooltip: [\n { field: \"date\", title: \"Date\", type: \"temporal\" },\n { field: \"p25\", title: \"25%tile\", type: \"quantitative\" },\n { field: \"rt\", title: \"Est. Rt\", type: \"quantitative\" },\n { field: \"p75\", title: \"75%tile\", type: \"quantitative\" },\n { field: \"daily_cases\", title: \"Cases\", type: \"quantitative\" }\n ]\n }\n },\n {\n mark: { type: 'line', point: { size: 20, color: 'red' }, color: \"red\" },\n encoding: {\n x: { field: \"date\", title: \"Date\", type: \"temporal\" },\n y: { field: \"rt\", title: \"Estimated Rt\", type: \"quantitative\" },\n tooltip: [\n { field: \"date\", title: \"Date\", type: \"temporal\" },\n { field: \"rt\", title: \"Est. Rt\", type: \"quantitative\" },\n { field: \"daily_cases\", title: \"Cases\", type: \"quantitative\" }\n ]\n\n }\n },\n {\n data: { values: [{y: 1.0}] },\n mark: { type: 'rule', color: \"lime\", size: 3 },\n encoding: {\n y: { field: 'y', type: 'quantitative' }\n }\n }\n ]\n }\n };\n\n vegaEmbed('#vis_rt_states_graph', spec);\n}", "title": "" }, { "docid": "8f51845f0a8a7eef90d2c5263cad4291", "score": "0.5664831", "text": "function fillData(state) {\n var tooltipTxt = '<strong>'+state.state+'</strong>'+': '+state.avg+'%';\n d3Map.map.select('#'+state.ID)\n .on(\"mouseover\", function(d){return d3Map.tooltip.style(\"visibility\", \"visible\").html(function(d){return tooltipTxt;});})\n .on(\"mousemove\", function(){return d3Map.tooltip.style(\"top\",\n (d3.event.pageY-10)+\"px\").style(\"left\",(d3.event.pageX+10)+\"px\");})\n .on(\"mouseout\", function(){return d3Map.tooltip.style(\"visibility\", \"hidden\");})\n .transition()\n .style('fill', colorSet(state.avg))\n .duration(200); \n }", "title": "" }, { "docid": "9dd0650a4c05fa3b72a3405b9285166a", "score": "0.5663209", "text": "function createInstances(stateData, state) {\n let instances = [];\n\n for (let day in stateData) {\n let arr = day.split(\"-\");\n const cases = stateData[day], date = new Date(arr[0], arr[1] - 1, arr[2]);\n\n instances.push({\n y: cases[state][0],\n label: date.toLocaleDateString('default', { month: 'long' }) + ' ' + date.getDate()\n });\n }\n\n return instances;\n}", "title": "" }, { "docid": "2dfefa0a9398026f1a9ea84d3d131389", "score": "0.566051", "text": "function insChart(state) {\n const { ctx } = state\n const { x0, y0, x1, y1 } = state.chart.position\n const { width, height } = state.chart\n ctx.save()\n\n \n insEjes(state, x0, y0, x1, y1)\n insFlechas(state, x0, y0, x1, y1)\n // insBarras(state)\n ctx.restore()\n ctx.save()\n }", "title": "" }, { "docid": "5d30866fdc20139922fbfc96b431b946", "score": "0.5654949", "text": "function render() {\n d3.csv(\"data/death-by-police.csv\").then(function (raw_data) {\n let data = raw_data\n .filter(d => d.date.substring(0,4) == '2019'); /// data in year 2019\n\n let countByState = d3_array.rollup(data, v => v.length, d => d.state); //count of each state\n data.sort((a, b) => d3.descending(countByState.get(a.state), countByState.get(b.state))); // sort by count\n\n data.map(d => d.age === '' ? d.age ='Unknown': d.age);\n data.map(d => d.gender === 'F' ? d.gender ='Female': d.gender ='Male');\n // console.log(newdata);\n chart.selectAll('rect').remove();\n\n // Append new squares\n const squares = chart.selectAll('rect')\n .data(data, function (d) { return d.name; })\n\n squares.enter().append('rect')\n .attr('x', (d, i) => {\n const n = i % numPerRow;\n return scale(n);\n })\n .attr('y', (d, i) => {\n const n = Math.floor(i / numPerRow);\n return scale(n);\n })\n .attr('fill','var(--grey1)')\n .attr('ry', 10)\n .attr('rx', 10)\n .attr('width', squareSize)\n .attr('height', squareSize)\n .on(\"mouseover\", handleMouseOver)\n .on(\"mouseout\", handleMouseOut)\n .transition().delay(function (d, i) { return .9 * i; })\n .attr(\"class\", (d) => { return d.state; });\n\n\n function handleMouseOver(d) {\n // highlight rect \n d3.select(this).style(\"fill\", d => myColor(countByState.get(d.state)));\n tooltip.transition()\n .duration(30)\n .style(\"opacity\", 1)\n tooltip.html(\"Age: \" + d.age + \"<br>Gender: \" + d.gender + \"<br>Location: \" + d.city + \", \"+ d.state + \"<br>Flee: \" + d.flee);\n\n d3.select('.unit-US' + stateCodeToFips[d.state]).classed(\"map-state-highlighted\", true);\n }\n\n function handleMouseOut(d) {\n // unhighlight color\n d3.select(this).style(\"fill\", 'var(--grey1)');\n tooltip.transition()\n .duration(30)\n .style(\"opacity\", 0);\n\n d3.select('.unit-US' + stateCodeToFips[d.state]).classed(\"map-state-highlighted\", false);\n }\n\n // Map to Grid\n const mapData = d3_array.rollups(data, v => v.length, d => d.state).map(([k, v]) => {return {fips: \"US\"+stateCodeToFips[k], count: v}}); // return {fip, count}\n\n map.postUpdate(() => {\n d3.selectAll('.unit')\n .on(\"click\", (d) => {\n const stateName = fipsToStateCode[d.properties.fips.slice(2)];\n d3.selectAll('.'+stateName).style(\"fill\", d => myColor(countByState.get(d.state)));\n\n tooltipState.transition()\n .duration(30)\n .style(\"opacity\", 1)\n tooltipState.html(\"<br><br>State: \" + stateName + \"<br>Deaths: \" + countByState.get(stateName));\n })\n .on(\"mouseout\", (d) => {\n const stateName = fipsToStateCode[d.properties.fips.slice(2)];\n d3.selectAll('.'+ stateName).style(\"fill\", 'var(--grey1)');\n\n tooltipState.transition()\n .duration(30)\n .style(\"opacity\", 0)\n });\n })\n .draw(d3.select('#mappppp').datum(mapData));\n });\n }", "title": "" }, { "docid": "bfd809789ae140ccb8f6052bd5ecbecf", "score": "0.5642406", "text": "function pieChart() {\n let results = countStates();\n let states = results[0];\n let total = results[1];\n\n // Draw pie chart\n let radius = 75;\n let lastAngle = 0;\n for (let i = 0; i < states.length; i++) {\n let angle = states[i] / total * TWO_PI;\n if (angle === 0) continue;\n\n // Arc\n fill(COLORS[i].concat(191));\n noStroke();\n ellipseMode(RADIUS);\n arc(100, 100, radius, radius, lastAngle, lastAngle + angle);\n lastAngle += angle;\n }\n}", "title": "" }, { "docid": "7a4d352050be4ffa22f948c0703d33b8", "score": "0.56201535", "text": "setValues(){\n\n //helpers for temporary saving\n let stateLabels = [];\n let stateSeries = [];\n try {\n //iterate all selected scenarios\n this.props.myScenarios.forEach(scenario => {\n\n //helper array for temp savin data\n let stateData = [];\n\n //iterate indicators starting from categories\n this.props.myIndicators.forEach(category => {\n \n //iterate indicators and save values to temp array\n category.ind.forEach(indicator => {\n let key = indicator.value;\n let label = indicator.label;\n let indData = this.getValue(key, scenario);\n stateLabels.push(label);\n stateData.push(indData);\n });\n });\n\n //create series for each scenario\n stateSeries.push({\n type: 'column',\n name: scenario.label,\n data: stateData\n });\n });\n } catch (error) {\n console.log(error.message)\n }\n\n //save labels and series to member arrays\n this.labels = stateLabels;\n this.series = stateSeries;\n \n }", "title": "" }, { "docid": "0059bf350ecad2a61a0c6ca743bb9699", "score": "0.5606727", "text": "constructor(props) {\n super(props);\n this.state = {\n tableHead: ['Month', 'Category', 'Price'],\n widthArr: [100, 100, 100, 100, 120],\n data:[],\n isLoding:true,\n month:''\n };\n }", "title": "" }, { "docid": "dbcd87d38d7b6dcc770f114ce7c1f483", "score": "0.55929", "text": "function buildCharts() {\n console.log(\"hello2\");\n d3.json(StateEnergySourceURL).then(function(stateEData2) {\n console.log(stateEData2[0]);\n\n var stateEData = stateEData2[0];\n // var pielabels = Object.entries(stateEData).map(key =>\n // key)\n\n var coal = stateEData[\"Fossil Fuel - Coal\"]; //[\"Fossil Fuel - Coal\"]\n console.log(stateEData);\n var naturalGas = stateEData[\"Fossil Fuel - Natural Gas\"]; //[\"Fossil Fuel - Natural Gas\"]\n var crudeOil = stateEData['Fossil Fuel - Crude Oil']; //['Fossil Fuel - Crude Oil']\n var nuclear = stateEData['Nuclear Power']; //['Nuclear Power']\n var bioFuels = stateEData['BioFuels']; //['BioFuels']\n var woodWaste = stateEData['Wood and Waste']; //['Wood and Waste']\n var other = stateEData['Other']; //['Other']\n\n var pieDataArr = [\n\n coal, // 1\n naturalGas, // 2\n crudeOil, // 3\n nuclear, // 4\n bioFuels, //5\n woodWaste, //6\n other //7\n\n ]\n //var values = Object.entries(stateEData).map((key, value) => value)\n\n var ctx = document.getElementById('pieChart')\n var myPieChart = new Chart(ctx, {\n type: 'doughnut',\n data: {\n datasets: [{\n data: pieDataArr,\n backgroundColor: [\n 'rgb(191, 63, 63)',\n 'rgb(86, 239, 35)',\n 'rgb(239, 188, 35)',\n 'rgb(35, 86, 239)',\n 'rgb(239, 86, 35)',\n 'rgb(188, 35, 239)',\n '#74c476',\n ]\n }],\n labels: [\"Fossil Fuel - Coal\",\n \"Fossil Fuel - Natural Gas\",\n \"Fossil Fuel - Crude Oil\",\n \"Nuclear Power\",\n \"BioFuels\",\n \"Wood and Waste\",\n \"Other\"\n ]\n },\n options: {\n title: {\n display: true,\n text: \"State Energy production by Source (million BTU)\",\n fontSize: 20, \n fontColor: \"white\"\n },\n legend: {\n position: 'right',\n alignment: 'center',\n \n labels: {\n boxWidth: 10,\n fontColor: \"white\"\n }\n }\n }\n });\n return myPieChart\n }).\n catch(function errorHandler(err) {\n err.message; // 'Oops!'\n });\n}", "title": "" }, { "docid": "ac442b9e040f05f0c45fa9a782703e10", "score": "0.5588246", "text": "createBubbleChartData() {\n if (!this.entity_items.isValid()) return null\n let _graphData = null\n\n let numEntyties = this.entity_items.getSize()\n let _entities = this.entity_items.getEntitieslist()\n\n if (numEntyties % 3 === 0) {\n _graphData = this.getDefaultGraphData()\n _graphData.config.mode = \"simple\"\n for (let i = 0; i < _entities.length; i += 3) {\n const _attr = this.entity_items.getOptions(i + 1)\n let _options = {\n label: _entities[i + 2].name || \"\",\n scale: _attr.scale || 1.0,\n unit: _entities[i + 2].unit || \"\",\n backgroundColor: _attr.backgroundColor || DEFAULT_COLORS[24 + i * 5],\n borderColor: _attr.borderColor || DEFAULT_COLORS[24 + i * 5]\n }\n if (this.entity_options) {\n _options = { ...this.entity_options, ..._options }\n _graphData.config.options = this.entity_options\n }\n if (this.entity_options && this.entity_options.gradient !== undefined) {\n _graphData.config.gradient = true\n }\n if (_attr && _attr.pointStyle) {\n _options.pointStyle = _attr.pointStyle\n _options.pointRadius = 6\n }\n if (_attr && _attr.pointRadius) {\n _options.pointRadius = _attr.pointRadius\n }\n _options.data = [\n {\n x: _entities[i].state || 0.0,\n y: _entities[i + 1].state || 0.0,\n r: _entities[i + 2].state || 0.0\n }\n ]\n if (_attr) _options = { ..._options, ..._attr }\n _graphData.data.datasets.push(_options)\n }\n _graphData.config.options.bubble = true\n } else {\n console.error(\"BubbleChart setting not valid\", _entities)\n }\n return _graphData\n }", "title": "" }, { "docid": "6e2a64fa795aafa91c82f68462197c72", "score": "0.5588041", "text": "changeDataForBarChart() {\n const barChartData = this.state.barChartData\n const arr = this.state.rangeData\n for (var i = 0; i < 20; i++) {\n barChartData[i + 1] = [arr[i][0].toString() + ':' + arr[i][1].toString(), arr[i][2]]\n }\n this.setState({\n barChartData: barChartData\n })\n }", "title": "" }, { "docid": "f61a0d12599568cf826626106221a7cf", "score": "0.55873317", "text": "saveState() {\n this.savedState = {\n description: this.description,\n name: this.name,\n rangeName: this.rangeName,\n selectedTotals: this.selectedTotals.slice() || [],\n cardExportInfos: this.cardExportInfos.slice() || [],\n yAxis: angular.copy(this.yAxis),\n xAxis: angular.copy(this.xAxis),\n multipleAxis: this.multipleAxis,\n noSort: this.noSort,\n showGroupingAsPercentage: this.showGroupingAsPercentage,\n showCompareStats: this.showCompareStats,\n showTableTotals: this.showTableTotals,\n isTransposeTable: this.isTransposeTable,\n timezone: this.timezone,\n useTimezone: this.useTimezone,\n startDayOfWeek: this.startDayOfWeek,\n useStartDayOfWeek: this.useStartDayOfWeek,\n fillChart: this.fillChart,\n showTrendLine: this.showTrendLine,\n extendTrendLine: this.extendTrendLine,\n goal: this.goal,\n showValueLabels: this.showValueLabels,\n columnSorting: this.columnSorting.getState(),\n columnPosition: this.columnPosition.getJson(),\n chartSettings: this.chartSettings.getJson(),\n fromDate: moment(this.fromDate),\n toDate: moment(this.toDate),\n moving: this.moving,\n frequencies: this.frequencies.getState(),\n types: this.types.getState(),\n metrics: this.metrics.getState(),\n groupings: this.groupings.getState(),\n formulas: this.formulas.getState(),\n filters: this.filters.getState(),\n drill: this.drill.getState(),\n image: this.image.getState()\n };\n }", "title": "" }, { "docid": "7950d0b57116436a916030f88dea607e", "score": "0.55805874", "text": "chartDataBuilder(array) {\n console.log(\"test\", this.state.lifeExpectancy);\n let termsArray = [\n \"population\",\n \"lifeExpectancy\",\n \"childLaborPercentage\",\n \"readingLevel\",\n \"sentiment\",\n \"subjectivity\",\n \"enrollment\"\n ];\n console.log(array);\n let dataset = [];\n for (let i = 0; i < array.length; i++) {\n console.log(\"Loop number\", i, array[i]);\n if (array[i] === termsArray[2]) {\n dataset.push(this.state.childLaborPercentage);\n } else if (array[i] === termsArray[1]) {\n dataset.push(this.state.lifeExpectancy);\n } else if (array[i] === termsArray[0]) {\n dataset.push(this.state.population);\n } else if (array[i] === termsArray[3]) {\n dataset.push(this.state.readingLevel);\n } else if (array[i] === termsArray[4]) {\n dataset.push(this.state.sentiment);\n } else if (array[i] === termsArray[5]) {\n dataset.push(this.state.subjectivity);\n } else if (array[i] === termsArray[6]) {\n dataset.push(this.state.enrollment);\n }\n }\n console.log(\"Dataset here\", dataset);\n return dataset;\n }", "title": "" }, { "docid": "58b23d5152c52ffccaf49399ae159586", "score": "0.557691", "text": "function data(state) {\n var dataNode = (0, _createDataNode2.default)(context, typeof state === \"string\" || Array.isArray(state) ? { source: state, type: \"root\" } : _extends({}, state, { type: \"root\" }));\n childNodes.push(dataNode);\n return dataNode;\n }", "title": "" }, { "docid": "3deb7339a110ec329f7455c9ab65af9b", "score": "0.55739033", "text": "handleChartData(props) {\n const { tags, reportSummary } = props;\n const time = this.getTimeBasedOnMode();\n const mode = this.state.isBatch ? 'batch' : 'realtime';\n if (Object.keys(tags).length && reportSummary.items && reportSummary.items.length) {\n const chartDataParams = getFormattedChartData({\n 'allTags': tags,\n 'timeRange': time,\n 'reportSummaryData': reportSummary,\n 'mode': mode,\n });\n this.setState(chartDataParams);\n } else {\n this.setState({\n 'barChartData': [],\n // 'pieChartData': [], RS-4379 Hiding piechart and grouped bar chart for the time\n // 'stackedBarChartData': [],\n });\n }\n }", "title": "" }, { "docid": "cf6e7c749a2017e87d049ad6c8db8f56", "score": "0.5561407", "text": "async function doviz_rt() {\n let data = await fetch_imaginea_json(\"rt_daily_summary\");\n\n let spec = {\n width: 'container',\n data: { values: data.states },\n //height: 'container',\n layer: [\n {\n mark: {\n type: \"errorbar\",\n color: \"grey\",\n ticks: true\n },\n encoding: {\n x: {\n field: \"p95\",\n type: \"quantitative\",\n title: \"Rt\"\n },\n x2: {\n field: \"p05\"\n },\n y: {\n field: \"state_name\",\n type: \"ordinal\",\n title: \"State\",\n sort: null\n },\n tooltip: [\n { field: \"state_name\", type: \"nominal\", title: \"State\" },\n { field: \"p05\", type: \"quantitative\", title: \"5 %tile\", format: \".2f\" },\n { field: \"p95\", type: \"quantitative\", title: \"95 %tile\", format: \".2f\" }\n ]\n }\n },\n {\n mark: {\n type: \"errorbar\",\n color: \"crimson\",\n ticks: true\n },\n encoding: {\n x: {\n field: \"p75\",\n type: \"quantitative\",\n title: \"Rt\"\n },\n x2: {\n field: \"p25\"\n },\n y: {\n field: \"state_name\",\n type: \"ordinal\",\n title: \"State\",\n sort: null\n },\n tooltip: [\n { field: \"state_name\", type: \"nominal\", title: \"State\" },\n { field: \"p25\", type: \"quantitative\", title: \"25 %tile\", format: \".2f\" },\n { field: \"p75\", type: \"quantitative\", title: \"75 %tile\", format: \".2f\" }\n ] \n }\n }, \n {\n mark: {\n type: \"point\",\n filled: true,\n color: \"blue\",\n size: 50\n },\n encoding: {\n x: {\n field: \"rt\",\n type: \"quantitative\"\n },\n y: {\n field: \"state_name\",\n type: \"ordinal\",\n title: \"State\",\n sort: null\n },\n tooltip: [\n { field: \"state_name\", type: \"nominal\", title: \"State\" },\n { field: \"rt\", type: \"quantitative\", title: \"Mean Rt\", format: \".2f\" },\n { field: \"p05\", type: \"quantitative\", title: \"5 %tile\", format: \".2f\" },\n { field: \"p95\", type: \"quantitative\", title: \"95 %tile\", format: \".2f\" },\n { field: \"p25\", type: \"quantitative\", title: \"25 %tile\", format: \".2f\" },\n { field: \"p75\", type: \"quantitative\", title: \"75 %tile\", format: \".2f\" },\n\n { field: \"daily_cases\", type: \"quantitative\", title: \"Cases\" },\n { field: \"date\", type: \"nominal\", title: \"Date\" }\n ]\n }\n },\n {\n data: { values: [{rt: 1.0}] },\n mark: { type: \"rule\", color: \"darkgrey\", size: 3 },\n encoding: {\n x: { field: \"rt\", type: \"quantitative\" }\n }\n }\n ]\n };\n\n vegaEmbed('#vis_rt', spec);\n}", "title": "" }, { "docid": "c6e00af41522172f09f94a40a1abef27", "score": "0.55522954", "text": "constructor(props) {\n super(props);\n this.state = {\n pbs: [],\n dts: [],\n tds: [],\n daotaos: [],\n cvs: [],\n };\n }", "title": "" }, { "docid": "156b8e4b44328a494fe10b9f71ea9485", "score": "0.5540526", "text": "showState(data) {\n let d = JSON.parse(data);\n this._createState(d.state, d.name);\n }", "title": "" }, { "docid": "93416809e46b194ae005ab2c1a69d23e", "score": "0.55363625", "text": "draw(state, setGlobalState) {\n\n // Update state data\n this.chooseBarDataset(state, setGlobalState);\n\n // Clear out the bar chart\n this.clearBar(this.svgMath);\n\n // Draw the bar: canvas, data, titleID, newTitle, subtitleID, newSubtitle, colorscale\n this.createBar(this.svgMath, \n this.barState.math,\n \"#chart3-title\", \n \"Average Miles School Bus Travels Per Day\",\n \"#chart3-subtitle\", \n \"Bars are colored by Math test proficiency. Blue: >50% of the population was proficient in 2016; Dark Gray: 0% proficiency.\", \n this.waffleMathColor,state, setGlobalState);\n }", "title": "" }, { "docid": "5e84cceb6bdab088863a103fa656f841", "score": "0.5526568", "text": "function updateState() {\n // Margin for bar chart\n var margin3 = {top: 20, right: 20, bottom: 30, left: 40},\n width3 = 500 - margin3.left - margin3.right,\n height3 = 340 - margin3.top - margin3.bottom;\n\n // Creating bar graph\n svg3 = d3.select(\"#barchart\").append(\"svg\")\n .attr(\"width\", width3 + margin3.left + margin3.right)\n .attr(\"height\", height3 + margin3.top + margin3.bottom)\n .append(\"g\")\n .attr(\"transform\",\n \"translate(\" + margin3.left + \",\" + margin3.top + \")\");\n\n // Bar graph vars\n var xScaleBar = d3.scale.ordinal().rangeRoundBands([0, width3], 0.1);\n var xAxisBar = d3.svg.axis().scale(xScaleBar);\n\n // Reload in the data for bar graph\n d3.csv(\"data.csv\", function (d) {\n d.State = d.State;\n d.red = d.Red;\n d.Total = +d.Total;\n d.Percentage = +d.Percentage * 100;\n d.TechDegs = d.SET;\n d.Humanities = +d.Humanities;\n d.Social = +d.Social;\n d.Sciences = +d.Sciences;\n d.Engineering = +d.Engineering;\n d.Education = +d.Education;\n d.Business = +d.Business;\n d.Other = +d.Other;\n d.Abbr = d.Abbr\n\n return d;\n\n }, function (error, data) {\n xScaleBar.domain([\"Humanities\", \"Social\", \"Sciences\", \"Engineering\", \"Education\", \"Business\", \"Other\"]);\n\n // Did this code from sratch (was very challenging to figure out)\n // Grabbed the row we wanted based on state and year\n var row = data.filter(function(d) {\n return d.Year == year && d.Abbr == state;\n });\n row = row[0];\n // Put the grabbed data into an array based on the values\n var barData = [\n {\n y: row.Humanities,\n x: \"Humanities\"\n\n },\n {\n x: \"Social\",\n y: row.Social\n },\n {\n x: \"Sciences\",\n y: row.Sciences\n },\n {\n x: \"Engineering\",\n y: row.Engineering\n },\n {\n x: \"Education\",\n y: row.Education\n },\n {\n x: \"Business\",\n y: row.Business\n },\n {\n x: \"Other\",\n y: row.Other\n }\n ];\n\n // Made the y-axis scales based on the new barData we made\n var barYScale = d3.scale.linear()\n .domain([0, d3.max(barData, function(d) {return d.y})])\n .range([height3, 0]);\n\n var barYAxis = d3.svg.axis().scale(barYScale).orient(\"left\");\n\n // Created the bar graph from the new barData we made\n svg3.append(\"div\")\n .append(\"text\")\n .attr(\"class\", \"label\")\n .text(state);\n\n svg3.append('g')\n .attr('class', 'x axis')\n .attr(\"transform\", \"translate(0,\" + height3 + \")\")\n .attr(\"x\", width3)\n .call(xAxisBar);\n\n svg3.append('g')\n .attr('class', 'y axis')\n .attr(\"y\", height3)\n .call(barYAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"end\")\n .text(\"Number of Degrees\");\n\n svg3.append('g')\n .selectAll(\".bar\")\n .data(barData)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"width\", xScaleBar.rangeBand())\n .attr(\"y\", function (d) {\n return barYScale(d.y);\n })\n .attr('x', function(d) {\n return xScaleBar(d.x);\n })\n .attr(\"height\", function (d) {\n return (barYScale(0) - barYScale(d.y));\n });\n\n\n });\n\n}", "title": "" }, { "docid": "5936f7c122749e2e860d98702faeaf38", "score": "0.55243444", "text": "computeState(props = this.props) {\n let lineColors = [\n '#11d48b', '#115ad4', '#d4115a',\n '#d48b11', '#8800d4'\n ]\n if (props.view.isFetched) {\n let plotlyData = props.view.selectorConfig.map(config => {\n if (config.as) {\n return this.convertToPlotlySeries(\n config.as,\n props.view.country,\n props.view.risk,\n props.data\n )\n }\n return {}\n }).filter(value => {\n return value !== undefined\n })\n plotlyData.forEach((trace, idx) => {\n trace.line = {\n color: lineColors[idx]\n }\n })\n // Start of annotations are added\n plotlyData.splice(6, 0, {\n // type: 'scatter',\n mode: 'markers',\n x: this.state.annotation_dates,\n y: this.state.annotation_dates.map(function(x) {\n return 0\n }),\n marker: {\n symbol: 'triangle-up',\n color: '#FFA500',\n size: 16,\n // opacity: 0.5\n\n },\n legendgroup: 'Annotations',\n name: 'Annotations',\n hoveron: 'points',\n hoverinfo: 'text',\n // hoverlabel: { textposition: 'middle-left', },\n text: this.state.annotation_notes\n });\n // End of annotations are added\n return {\n plotlyData: plotlyData\n }\n }\n return {}\n }", "title": "" }, { "docid": "d27d1a5e313b9a5825b4e58562f16e1d", "score": "0.55222934", "text": "function machine_status(data) {\n\n let avg_efficiency = 0;\n let running = data.filter(d => d['State'] == '0').length;\n let powerOff = data.filter(d => d['State'] == '1').length;\n let offLine = data.filter(d => d['State'] == '56');\n let notSycn = data.filter(d => d['State'] == '65535');\n let stop = data.filter(d => d['State'] != '1' && d['State'] != '56' && d['State'] != '65535' && d['State'] != '0').length;\n\n if (document.getElementById('machine_summary') != null) {\n echarts.dispose(document.getElementById('machine_summary'))\n }\n let myChart = echarts.init(document.getElementById('machine_summary'));\n\n //pie data\n let filterdata = data.filter(d => parseInt(d['WorkEfficiency']) > 0 || d['TimeEfficiency'])\n let y_1 = filterdata.map(d => parseFloat(d['WorkEfficiency']))\n let average = (array) => array.reduce((a, b) => a + b) / array.length;\n avg_efficiency = average(y_1).toFixed(2)\n\n let colorPalette = ['#14ca75', '#4a8df6', '#dea33d', '#f36069'];\n let pie_data = [0, 0, 0, 0]\n for (let i in y_1) {\n if (y_1[i] < 80) {\n pie_data[3] += 1;\n } else if (y_1[i] >= 80 && y_1[i] < 90) {\n pie_data[2] += 1;\n } else if (y_1[i] >= 90 && y_1[i] < 95) {\n pie_data[1] += 1;\n } else {\n pie_data[0] += 1;\n }\n }\n\n let option = {\n\n tooltip: {\n trigger: 'item',\n transitionDuration: 0,\n formatter: '{a} <br/>{b} : {c} ({d}%)'\n },\n grid: {\n top: '16%',\n left: '15%',\n right: '6%',\n bottom: '8%'\n },\n legend: {\n itemWidth: fontSize(0.08),\n itemHeight: fontSize(0.08),\n left: 'center',\n top: \"1%\",\n data: ['95%~100%', '90%~95%', '80%~90%', '<80%'],\n textStyle: {\n color: function(d, i) { return colorPalette[i] },\n fontSize: fontSize(0.12)\n }\n },\n series: [{\n name: 'work efficiency',\n type: 'pie',\n radius: ['30%', '45%'],\n center: ['57%', '57%'],\n roseType: 'area',\n data: [\n { value: pie_data[0], name: '95%~100%' },\n { value: pie_data[1], name: '90%~95%' },\n { value: pie_data[2], name: '80%~90%' },\n { value: pie_data[3], name: '<80%' }\n ],\n label: { //饼图图形上的文本标签\n normal: {\n show: true,\n position: 'outside', //标签的位置\n textStyle: {\n fontSize: fontSize(0.13) //文字的字体大小\n },\n formatter: '{c}' + '\\n' + '({d}%) '\n\n\n }\n },\n emphasis: {\n itemStyle: {\n shadowBlur: 10,\n shadowOffsetX: 0,\n shadowColor: 'rgba(0, 0, 0, 0.5)'\n }\n },\n color: colorPalette,\n tooltip: {\n trigger: 'item',\n formatter: '{a} <br/>{b} : {c} ({d}%)'\n },\n labelLine: { //引导线设置\n normal: {\n show: true, //引导线显示\n length: 0.001\n }\n },\n }]\n };\n\n\n myChart.clear();\n myChart.setOption(option);\n window.addEventListener(\"resize\", function() {\n\n myChart.resize();\n\n });\n document.getElementById('ms_avg').innerText = ' ' + avg_efficiency + '%';\n document.getElementById('ms_run').innerText = running;\n document.getElementById('ms_stop').innerText = stop;\n document.getElementById('ms_off').innerText = powerOff;\n offLine = offLine.map(d => '#' + d['MachCode'])\n document.getElementById('ms_line').innerText = offLine.length + ' (' + offLine.toString() + ')';\n notSycn = notSycn.map(d => '#' + d['MachCode'])\n document.getElementById('ms_ns').innerText = notSycn.length + ' (' + notSycn.toString() + ')';\n\n}", "title": "" }, { "docid": "5b3813356b9f8aab47e8dba5ce16e65e", "score": "0.5514122", "text": "constructor(props) {\n super(props);\n\n // See src/components/graphs/README for an explanation of the content and\n // usage of state values. This is important for understanding how this\n // component works.\n\n this.state = {\n prevArea: null,\n fetchingData: false,\n data: null,\n dataError: null,\n };\n }", "title": "" }, { "docid": "7cfce4f28bdc84f9ccc44ca614eb6b61", "score": "0.5508972", "text": "constructor(props, context) {\n super(props, context);\n\n this.onTestChartMenuClick = this.onTestChartMenuClick.bind(this);\n\n\n this.state = {\n testChartTitle: CHART_TITLE_ENUM.TEST,\n testChartData: [],\n testChartLabels: [],\n testChartMenu: [],\n testChartColorArray: [],\n devChartLegendData: []\n };\n\n\n\n }", "title": "" }, { "docid": "8659281bd0477ec4fbc01b7e992925bc", "score": "0.5505738", "text": "function init() {\n buildDropdown();\n buildCharts();\n stateSummary();\n // createData();\n \n}", "title": "" }, { "docid": "251df060d32d8499f29067b868586d2c", "score": "0.5501187", "text": "constructor(props) {\n super(props);\n\n this.state = {\n selectedFoot: 0, //0 if the user is viewing the left foot, 1 for right foot\n selectedTreatment: 0, //Point on graph user selected to view\n rightFootData: [],\n leftFootData: [],\n leftFootDates: [], //Dates images were taken of toes on the left foot\n rightFootDates: [], //Dates images were taken of toes on the right foot\n toeData: {}, //Data recieved from the server\n imageUrls: [], //List of data like: {imageName: \"1.PNG\", url : \"\"}\n dataLoaded: false, //Used for showing the loading screen until all data are loaded\n };\n }", "title": "" }, { "docid": "17f36a3506bae8764dddc710f7e51272", "score": "0.54985386", "text": "_getConfigForPieChart() {\n // work with latest year's data\n // const data = this.data.filter(row => row.year === this.latestYear);\n\n // group data by state (data series) to see if we are displaying state or national data\n const groupedByLocation = _groupBy(CONFIG.locationId)(this.data);\n\n // use National data by default\n let groupedData = groupedByLocation.US || [];\n const state = _without(Object.keys(groupedByLocation), 'US').shift();\n\n // .. but if there are two locations, use state's\n if (state) {\n groupedData = groupedByLocation[state];\n }\n\n // use side effects to get a single unit value\n let unit;\n\n const transformedData = _flow(\n _groupBy(CONFIG.breakoutId),\n _reduce((groupedByBreakout, valuesByBreakout, breakout) => {\n const label = valuesByBreakout[0][CONFIG.breakoutLabel];\n const data = _find(valuesByBreakout, { year: this.latestYear });\n let value = 0;\n\n if (data) {\n // side effect\n if (unit === undefined || unit === '') {\n unit = data.data_value_unit || '';\n }\n\n value = data.data_value;\n }\n\n return {\n ...groupedByBreakout,\n [breakout]: { value, label }\n };\n }, {})\n )(groupedData);\n // const transformedData = _.chain(groupedData)\n // .groupBy(CONFIG.breakoutId)\n // .reduce((groupedByBreakout, valuesByBreakout, breakout) => {\n // const label = valuesByBreakout[0][CONFIG.breakoutLabel];\n // const data = _find(valuesByBreakout, { year: this.latestYear });\n // let value = 0;\n\n // if (data) {\n // // side effect\n // if (unit === undefined || unit === '') {\n // unit = data.data_value_unit || '';\n // }\n\n // value = data.data_value;\n // }\n\n // return Object.assign({}, groupedByBreakout, {\n // [breakout]: { value, label }\n // });\n // }, {})\n // .value();\n\n // generate data array based on categories (order is important)\n const columns = (_flow(\n _groupBy(CONFIG.breakoutId),\n _keys(),\n _sortBy((x) => x)\n )(groupedData)).map(\n (breakout) => [transformedData[breakout].label].concat(transformedData[breakout].value)\n );\n // const columns = _.chain(groupedData)\n // .groupBy(CONFIG.breakoutId)\n // .keys()\n // .sortBy()\n // .value()\n // .map(breakout =>\n // [transformedData[breakout].label].concat(transformedData[breakout].value));\n\n return {\n size: {\n height: CONFIG.map.defaults.height || 320\n },\n data: {\n columns\n },\n custom: {\n unit\n }\n };\n }", "title": "" }, { "docid": "daf3b6938681ab24ad7d4cd06e86eedd", "score": "0.5497685", "text": "constructor(props) {\n super(props);\n\n this.state = {\n graphReady: false,\n graphData: [],\n xDomain: [],\n selectedSkillCategory: 1,\n timeFrameSelected: false,\n modalVisible: false,\n checkedItemTime: periods.week,\n selectedTimeFrame: periods.week,\n skillList: [],\n checkedItemSkill: 1,\n data: [],\n selectedRecipients: [],\n snapshotFile: '',\n emailModalVisible: false,\n };\n }", "title": "" }, { "docid": "8786956a195024fe855604f235af163b", "score": "0.54960334", "text": "handleClick(event) {\n const target = event.target.getAttribute('value');\n var dataset = this.state.chartData\n var tempStats = []\n var tempToday = false;\n if (target === this.state.dateRange[0]) {\n tempToday = true;\n }\n Object.keys(this.state.data[target]).map((key) => {\n tempStats = [...tempStats, this.state.data[target][key]]\n })\n var count = 0;\n tempStats.forEach(item=>count+=item);\n dataset.datasets[0].data = tempStats;\n this.setState({\n checkedIn: count,\n today : tempToday,\n stats:tempStats,\n day : target,\n chartData : dataset\n })\n }", "title": "" }, { "docid": "09df24e5d84d3db4e7064b7e2ab9b0c8", "score": "0.54749805", "text": "generateLocalData() {\n this.setState({ display: Display.LOADING });\n const randomData = [\n Math.floor(Math.random() * 100 + 1),\n Math.floor(Math.random() * 100 + 1),\n Math.floor(Math.random() * 100 + 1),\n ];\n const newData = {\n ...this.state.chartData,\n datasets: [{ ...this.state.chartData.datasets[0], data: randomData }],\n };\n\n this.setState({ display: Display.FRONTEND, chartData: newData });\n }", "title": "" }, { "docid": "c250bb1f1cde8c4f61a0eaccd7aee407", "score": "0.5467975", "text": "async function fetchStateData() {\n setIsLoading(true);\n const statesData = await getDataByState(drillDown.date)\n\n for (const stateData of statesData) {\n setRows(prevState => (\n [...prevState, createData(stateData.region.province, stateData.confirmed, stateData.deaths)] \n )) \n } \n setIsLoading(false);\n }", "title": "" }, { "docid": "154b8c9922275442b88d5ba26ff614b6", "score": "0.5464499", "text": "function buildStatusPieChart(country, data) {\n\n // Initialize an empty array to store selected info for pie chart\n var plotData = [];\n\n // Initialize an empty array to store number of married billionaires\n var total = 0;\n\n // If \"All\" is selected assign all data to chart data\n if (country === \"All\") {\n plotData = data;\n total = Object.keys(data).length;\n } else {\n // Fitler data for the selected country\n plotData = data.filter(sample => sample.country == country);\n total = Object.keys(plotData).length;\n }\n\n // Create set of unique status values\n var unique = new Set(plotData.map(x => x[\"status\"]));\n\n // Get unique set values\n var setValues= unique.values();\n\n // Create empty object to store unique values\n var uniqueValues = {};\n\n // Save each unique status value as object's key\n for (var i = 0; i < unique.size; i++) {\n uniqueValues[setValues.next().value] = 0;\n };\n\n // Count number of unique status values for selected country\n plotData.forEach((event) => {\n if (Object.values(event)[17] === null) {\n uniqueValues[\"null\"] += 1;\n } else {\n Object.entries(uniqueValues).forEach(([key, value]) => {\n if (Object.values(event)[17] === key) {\n uniqueValues[key] += 1;\n };\n }); \n };\n }); \n\n // Rename 'null' key as 'Unknown'\n delete Object.assign(uniqueValues, {[\"Unknown\"]: uniqueValues[null]})[null];\n\n // Calculate number of married billionaires for selected country\n var married = uniqueValues.Married/total * 100;\n\n // Update the text box\n var selectMarried= d3.select(\"#married\");\n selectMarried.text(`${married.toFixed(1)}% of billionaires are married`);\n\n // Create object with pie chart colors\n var colors = {\n \"Married\": '#b55c52', \n \"Unknown\": '#eff0eb',\n \"Divorced\": '#95c281',\n \"Widowed\": '#4f8b67',\n \"Single\": '#fb4949',\n \"In Relationship\": '#bfb6b1',\n \"Separated\": '#676664',\n \"Widowed, Remarried\": '#91b6c6',\n \"Engaged\": '#fc8186'\n };\n\n // Initialize an empty array to store colors for current country\n var currentColors = {};\n\n // Assign colors for current country\n Object.keys(uniqueValues).forEach((test) => {\n Object.entries(colors).forEach(([key, value]) => {\n if (key === test) { \n currentColors[test] = value;\n };\n });\n });\n\n // Define trace parameters\n var trace1 = {\n labels: Object.keys(uniqueValues),\n values: Object.values(uniqueValues),\n type: 'pie',\n marker: {colors:Object.values(currentColors)},\n domain: {x: [0, 3.2]}\n };\n\n // Assign data for plot\n var data = [trace1];\n\n // Define layout parameters\n var layout = {\n autosize: false,\n width: 500,\n height: 350,\n margin: {\n l: 50,\n r: 50,\n b: 0,\n t: 0,\n pad: 1\n },\n legend: {\n x: 1,\n y: 0.5\n }\n };\n\n // Render the plot to the div tag with id \"status\"\n Plotly.newPlot(\"status\", data, layout);\n}", "title": "" }, { "docid": "aac8dca96e0761c6a882daf0396012df", "score": "0.5457477", "text": "function stateMouseover(e) {\n var $state = $(this),\n stateName = d3.select(this).attr('name'),\n stateId = getIdSelector('state_' + stateName),\n stateName = stateName.restoreSpaces(),\n dataIndex = getStateKeyByName(stateName, 'data'),\n $tooltipText = $(getIdSelector('tooltip_text')),\n $tooltipPlate = $(getIdSelector('tooltip_plate')),\n marketGrowth,\n myGrowth,\n gap,\n tooltipText;\n\n currentStateName = stateName;\n currentHoverStateIndex = dataIndex;\n\n // highlight the state polygon\n highlight(stateId, true);\n\n // display the stats for this state\n drawChart(dataIndex);\n\n // display tooltip\n tooltipText = '<span class=\"tooltip_state_name\"><b>' + $state.attr('name').restoreSpaces() + '</b></span>';\n if (dataIndex > -1) {\n marketGrowth = dataArray[dataIndex][marketGrowthIndex].text;\n myGrowth = dataArray[dataIndex][myGrowthIndex].text;\n gap = dataArray[dataIndex][gapIndex].text;\n tooltipText = tooltipText +\n '<br>' +\n 'Market Growth: <span class=\"tooltip_span\" measure_index=\"2\"><b>' + marketGrowth + '</b></span>' +\n '<br>' +\n 'My Growth: <span class=\"tooltip_span\" measure_index=\"3\"><b>' + myGrowth + '</b></span>' +\n '<br>' +\n 'Gap: <span class=\"tooltip_span\" measure_index=\"4\"><b>' + gap + '</b></span>';\n\n }\n //console.log(stateName, dataIndex, marketGrowthIndex, marketGrowth, dataArray[dataIndex][marketGrowthIndex]);\n\n $tooltipText.html(tooltipText);\n $tooltipPlate.removeClass('hide');\n\n // position tooltip\n $tooltipPlate.offset({\n top: e.pageY + 10,//(canvasTop + e.offsetY + svgHeight * 0.1),\n left: e.pageX + 10//(canvasLeft + e.offsetX + svgWidth * 0.1)\n });\n\n // set wide class\n if(isWide) {\n $tooltipText.addClass('wide');\n }\n }", "title": "" }, { "docid": "22591290297389fa794e239053ae9d69", "score": "0.544125", "text": "function init() {\n const { values } = state;\n const selectElement = d3.select(\"#dropdown\").on(\"change\", function() {\n state.selection = this.value; // + UPDATE STATE WITH YOUR SELECTED VALUE\n console.log(\"new value is\", this.value);\n draw(); // re-draw the graph based on this new selection\n });\n\n // add in dropdown options from the unique values in the data\n selectElement\n .selectAll(\"option\")\n .data(values) // + ADD DATA VALUES FOR DROPDOWN\n .join(\"option\")\n .attr(\"value\", d => d)\n .text(d => d);\n\n xScale = d3\n .scaleTime()\n .domain(d3.extent(state.data, d => d.DATE))\n .range([margin.left, width - margin.right]);\n\n yScale = d3\n .scaleLinear()\n .domain([0, d3.max(state.data, d => d[state.selection])])\n .range([height - margin.bottom, margin.top]);\n\n xAxis = d3.axisBottom(xScale);\n yAxis = d3.axisLeft(yScale);\n\n // + CREATE SVG ELEMENT\n svg = d3\n .select(\"#d3-container\")\n .append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n svg\n .append(\"g\")\n .attr(\"class\", \"axis x-axis\")\n .attr(\"transform\", `translate(0,${height - margin.bottom})`)\n .call(xAxis)\n .append(\"text\")\n .attr(\"class\", \"axis-label\")\n .attr(\"x\", \"50%\")\n .attr(\"dy\", \"3em\")\n .text(\"Date\");\n\n svg\n .append(\"g\")\n .attr(\"class\", \"axis y-axis\")\n .attr(\"transform\", `translate(${margin.left},0)`)\n .call(yAxis)\n .append(\"text\")\n .attr(\"class\", \"axis-label\")\n .attr(\"y\", \"50%\")\n .attr(\"dx\", \"-3em\")\n .attr(\"writing-mode\", \"vertical-rl\")\n .text(\"Unemployment Rate\");\n\n draw(); // calls the draw function\n}", "title": "" }, { "docid": "cdfa187e9175c92814e45c08f4d0e652", "score": "0.5429681", "text": "createHistoryScatterData() {\n if (!this.entity_items.isValid()) return null\n\n let _seriesData = this.entity_items.getSeriesData()\n\n if (_seriesData && _seriesData.length % 2 === 0) {\n let _graphData = this.getDefaultGraphData()\n _graphData.config.mode = \"history\"\n\n for (let r = 0; r < _seriesData.length; r += 2) {\n const _attr = this.entity_items.getOptions(r) || {}\n let _data = []\n _seriesData[r].data.forEach(function (e, i) {\n if (_seriesData[r].data[i] && _seriesData[r + 1].data[i]) {\n _data.push({\n x: parseFloat(_seriesData[r + 0].data[i].y) || 0.0,\n y: parseFloat(_seriesData[r + 1].data[i].y || 0.0)\n })\n }\n })\n /**\n * default options\n */\n let _options = {\n label: this.entity_items.getEntity(r).name || \"\",\n unit: this.entity_items.getEntity(r).unit || \"\",\n hoverRadius: 18,\n pointRadius: 16,\n hitRadius: 22,\n backgroundColor: _attr.backgroundColor || DEFAULT_COLORS[27 + r * 5],\n borderColor: _attr.borderColor || DEFAULT_COLORS[27 + r * 5]\n }\n if (this.entity_options) {\n _options = { ..._options, ...this.entity_options }\n _graphData.config.options = this.entity_options\n }\n if (_attr) _options = { ..._options, ..._attr }\n\n _options.data = _data\n _graphData.data.datasets.push(_options)\n }\n if (_graphData.data.datasets.length) {\n _graphData.config.options.bubble = true\n return _graphData\n }\n }\n console.error(\"ScatterChart setting not valid for \", this.entity_items.getNames())\n return null\n }", "title": "" }, { "docid": "0bcbcba79eaa882883f380bc553f7e0d", "score": "0.5425154", "text": "function barStatePlot (stateFrequency) \n{\n const Frequency = [];\n Object.values(stateFrequency).forEach(state_value => Frequency.push(state_value))\n console.log(Frequency)\n const States = [];\n Object.keys(stateFrequency).forEach(state_key => States.push(state_key))\n console.log(States)\n \n // Create trace object for plotting\n const trace1 = {\n x: States,\n y: Frequency,\n type: \"bar\"\n };\n const data = [trace1];\n const layout = {\n plot_bgcolor:\"black\",\n paper_bgcolor:\"#FFF3\",\n margin:{l:50,r:50,b:50,t:50},\n title: {\n text:\"UFO Sightings Statewise\",\n font:{\n family: 'Georgia,serif',\n color:'white',\n size: 24\n },\n xanchor: 'center',\n yanchor:'top'\n },\n xaxis:{\n title: {\n text: \"State\",\n font: {\n family:'Arial,Helvetica,sans-serif',\n size: 20,\n color: 'white',\n }\n },\n showgrid: false,\n tickmode: 'auto',\n ticks:'inside',\n tickcolor:'white',\n tickwidth: 2,\n tickfont:{\n family:'Georgia,serif',\n size: 14,\n color: 'white',\n }\n },\n yaxis:{\n title: {\n text: \"UFO Sightings\",\n font: {\n family:'Arial,Helvetica,sans-serif',\n size: 20,\n color: 'white',\n }\n },\n showgrid: true,\n gridcolor: 'white',\n gridwidth: 1,\n tickfont:{\n family:'Arial,Helvetica,sans-serif',\n size: 14,\n color: 'white',\n } \n }\n };\n const config ={responsive:true}\n Plotly.newPlot(\"plot\",data,layout,config);\n\n return false;\n}", "title": "" }, { "docid": "a4dc932c23aedb19174fb7ac3621d452", "score": "0.5422706", "text": "function Home(props) {\n const [states, setStates] = useState([]);\n const [stateDistrictWiseData, setStateDistrictWiseData] = useState({});\n const [stateTestData, setStateTestData] = useState({});\n const [fetched, setFetched] = useState(false);\n const [graphOption, setGraphOption] = useState(1);\n const [lastUpdated, setLastUpdated] = useState('');\n //const [timeseries, setTimeseries] = useState({});\n const [tfseries, setTfseries] = useState([]);\n const [wa1series, setWa1series] = useState([]);\n const [eventseries, setEventseries] = useState([]);\n const [psseries, setPsseries] = useState([]);\n const [nfseries, setNfseries] = useState([]);\n const [activeStateCode, setActiveStateCode] = useState('TT');\n const [activityLog, setActivityLog] = useState([]);\n const [regionHighlighted, setRegionHighlighted] = useState(undefined);\n\n useEffect(() => {\n if (fetched === false) {\n getStates();\n }\n }, [fetched]);\n\n const varToString = varObj => Object.keys(varObj)[0]\n\n const getStates = async () => {\n try {\n var [\n response,\n stateDistrictWiseResponse,\n {data: statesDailyResponse},\n updateLogResponse,\n stateTestResponse,\n wb, up, ka, dl, mh, kl, pb, tg, or, tn, rj, gj, mp, ar, as, br, ct, ga, hr, hp, jh, mn, ml, mz, nl, tr, ut, an, jk, la, py, ap\n ] = await Promise.all([\n axios.get('https://api.covid19india.org/data.json'),\n axios.get('https://api.covid19india.org/state_district_wise.json'),\n axios.get('https://api.covid19india.org/states_daily.json'),\n axios.get('https://api.covid19india.org/updatelog/log.json'),\n axios.get('https://api.covid19india.org/state_test_data.json'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vSmp1d4JTafcB1Hjzao3WNJcm1Wdjf3LnYi17mr-_Q7Phb7z6_oJ7I_W4qThRCzoHeJ6JHMhFBU0XTr/pub?output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQd55jh-Nn_tbEszeSeF7drdccNXDyW64QRlWwvM7ZjjYxWlBTxa8P6vLJt2hG4Mgrxy_QRZCXstQpX/pub?gid=1922732720&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQ-a8PI2AZidMoYQPJa_1AyOmYbfppLMkeGjH_jDkzyctgRC844iBPApBN66On2E2pS_DtvhY6pUDVT/pub?output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQlJPByX5bzt28DzOm3am0EIgqxPGOyBd3Xo6_anwTdmS_XwiSJ2KfoM2KbBNKAO94TJj7UQEkA_SwS/pub?output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQZQcxULMah8VLC8DfVu5pNV7FnfhOm-YBlRvs7VIHsdxwKhH3ATkHrypDctIMQbu0BKzCzESJ3zSXH/pub?output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vS5g9NkQABSe8gEvfrh21e9yscusVlxj_UOLPbdp0FU4-1am12qUpIHudOXMFldRx_Q_OagrHRyMD0-/pub?gid=1081961011&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vSP6A9uiaDANSP57k3-ukvq_69cVDxQJJIJpILlIyznn4171Hv641gCe0Fr1Imgm9MoVKiy7oF0RmJ7/pub?gid=993901126&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQzHHJK2uRm-89URV0Y5EdSgyULs-Zfk_AxIo_JF53sO2DSaou05gyFFD6MpdVuV9eRstTV0kv0vp_f/pub?output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQcuNGXPh6lyyEVZuMZDE7nf9hh9fXdo-ScRGu_52gOQVVK7iDy3_dWVDZBKWsfJWi-YfdIQ6BIcK4I/pub?output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQEap7wAjiaQv-m5r800dbaOezhKOhSejoFDH-J00aw2HXlweyYQ7xu9eU7uTpHruNwAojTubpzFFeL/pub?output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vTNsGwpfY6IRkSc0S9zs89UPRAIgQQIYfHr9ZA1oqatUXyvDnFDviNuich0Q9umZreOWcGJqWcEgjqt/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vTuPdEUzM5q0sPtNFJR3znhr6_C1vLiir4c9x0ZhHY_E0xF1yyPqVIF2MXoCtrIS1rCo1x6otQDeOmR/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vSDnB6BYXlUf_Ds7HdrrFwVnqDKnnxFg15_jyDm_Dl-bS0o6gP82aKLGy-vj7yZW3WQiHS0Ef-OWyCk/pub?gid=0&single=true&output=csv'),\n //new added states\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vSy1O3_KfPaHsdm21NqB4VliAMopDyd_dyKgMHHrvJYuy9TPMutAjr2DP0A2AWmvhePyhEupKIEaz7P/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQ4jkqdKULkWuxKJq28y370xv9CmFJQrrSya6C3VJerBxf7ym75ocnftR5y4UVEx5N-IJUmFLwzGa_Z/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQBUqNt912EQMI5tu18AaXzJFdqb_kfbyxorosJE-qT820B6CF3-W7tTmkfedRTLwF4Chx0Yg9Xl565/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vTqrz-BPWB6-qDOWYTwTtDhQBbmAFsVpAe_Xr4aZ3a5P0T0hkARRDnaHF25a4SCl8eNtEgxiu6z5UwN/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQgUbqRSuppeO3GX7ySorbvwxsIq5Xz5benN025ZuWB-5cUX_295s0GwUPDhMH5XJkp7Os--AdOoBmy/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vSjTwm4qPq4QLiB6x1LyEqNAxnvOohnRyGSRbNq_ThRiKfa7xlqsmUzZh3CbqSsujuTbMYHDgYs7cP5/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQZV2z023VO-Dy5qsMH_CMrB3VsjjOW0vzhFtQppWrW3FDQJBx7r7_o4mIlzGzl-5RLWktqPvNm-ctf/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQkisSNI7PaOgqRjc5nko5SN4tSK7bCAu29ec9bzV_pjCNZtiW9TS0s4ethcnmmgTy-LhMuzfxt4AQ7/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vQE67PzCWymINN6KW3lwh6f9TazOlp2raO-ists2q4I2ZQff2fNPJz9x-hX3DzdGGL9Of66WgQVWG15/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vTJvG4vS2dtvjXKEzSFVHnWQFvDApj_BT3HicCo8ILOHW8tutxIPP0Ad32FN6L04MMQOzeyUWz7e_BY/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vTeaR4_Uxe00DwqrfqMspz7rVrYGp6vyIceZrfhhCj4sC7mMwMyW-v1xBLBGwV0zAd54x8-4DoArYqP/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vTYrqu0WJhHKFPfR3V5JqFhYJ0l4YMondHoc7jOSFlSt7KCYCW0-XzCjdAzF8Zuttn1ATrqSVwEY05i/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vRojnEepHTJY-Tphoc5SJwuPTzKdqw8CIVFXfkOR_KTC4NoFyqSC_6whKpwbWDqNDdWqwF5IVjNc8Jv/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vTsTNhSMJHlaqrjjzaj-Wvr3UdZLx9kEMp3IzsO0YNVG1t9_eYFyryxHeguc6yfEMjy65UBZVivpDKe/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vTE-_ds94oUBtNKbJsO1vOHHJinL8hXvpuh5Cj7O09JMGVAZZamxE27IsTBiZzRgO197R5jD9El4G-7/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vR6hdU48OumqI6C60GZFMTol8RTsSTNH3phNoQeqacPwhSamXzaKW4GdxJ72nCljRnbulg444Hu44YW/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vT1VDQws4AuKQ4gLw19BKnBwyNfFC1qzjFWbpjobS8av4oOQitZNl66tHHSxxvhV2dBKjnr6ZVm9SYR/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vTgpwjlWkiKGGqK_KCsxBCrUTs8AzUvx67fZRXQowHLKIn1mzXAOt3ZKXSLUcdTAp4nTvVVIle8KWC2/pub?gid=0&single=true&output=csv'),\n axios.get('https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vRKjNMXYXaPY1Vb0ZfTZcGqMyNYcBkelf5sfwc0IR0_Rs7VQ-h6qLEWDCYi7Ad2LyEFiENDkbGW3ZH-/pub?gid=0&single=true&output=csv'),\n\n\t ]);\n setStates(response.data.statewise);\n const ts = parseStateTimeseries(statesDailyResponse);\n var forPreprocessing = {\"WB\": wb, \"UP\": up, \"KA\": ka, \"DL\": dl, \"MH\": mh, \"KL\": kl, \"PB\": pb, \"TG\": tg, \"OR\": or, \"TN\": tn, \"RJ\": rj, \"GJ\": gj, \"MP\": mp,\n \"AR\": ar, \"AS\": as, \"BR\": br, \"CT\": ct, \"GA\": ga, \"HR\": hr, \"HP\": hp, \"JH\": jh, \"MN\": mn, \"ML\": ml, \"MZ\": mz, \"NL\": nl, \"TR\": tr, \"UT\": ut, \"AN\": an, \"JK\": jk, \"LA\":la, \"PY\":py, \"AP\": ap};\n for(var stateSheet in forPreprocessing){\n forPreprocessing[stateSheet] = preprocess(prettifyData(Papa.parse(forPreprocessing[stateSheet].data, {delimiter: ','})))\n }\n const finalData = processForChart(forPreprocessing);\n\t //console.log(finalData)\n var tfValues = gettfValues(finalData);\n var nfValues = getnfValues(finalData);\n var psValues = getpsValues(ts);\n\t //console.log(tfValues['DL'])\n var wa1Values = getwa1Values(finalData);\n psValues['TT']=psValues['DL'];\n\t tfValues['TT']=tfValues['DL'];\n\t nfValues['TT']=nfValues['DL'];\n\t wa1Values['TT']=wa1Values['DL'];\n setTfseries(tfValues);\n setPsseries(psValues);\n setNfseries(nfValues);\n\t //console.log(nfseries)\n setWa1series(wa1Values);\n\t setEventseries(eventdata());\n setLastUpdated(response.data.statewise[0].lastupdatedtime);\n setStateTestData(stateTestResponse.data.states_tested_data.reverse());\n setStateDistrictWiseData(stateDistrictWiseResponse.data);\n setActivityLog(updateLogResponse.data);\n setFetched(true);\n\t //console.log(formatDate1(lastUpdated))\n } catch (err) {\n console.log(err);\n }\n };\n\n const onMapHighlightChange = useCallback(({statecode}) => {\n setActiveStateCode(statecode);\n //console.log(activeStateCode);\n }, []);\n \n const normalise = (nf, maxp) => {\n\tvar max = 0;\n\tfor(var x=0; x < nf.length; x++){\n\t if(nf[x][1] > max){\n\t\t max = nf[x][1];\n\t }\n\t}\n\tfor(var i=0; i < nf.length; i++){\n\t nf[i][1] *= (maxp / max);\n\t}\n\treturn nf;\n }\n\n const refs = [useRef(), useRef(), useRef()];\n\n return (\n <React.Fragment>\n <div className=\"Home\">\n <div className=\"home-left\">\n \n\t\t {fetched && (\n\t\t <React.Fragment>\n\t\t <MapExplorer\n forwardRef={refs[1]}\n states={states}\n stateDistrictWiseData={stateDistrictWiseData}\n stateTestData={stateTestData}\n\t\t\t regionHighlighted={regionHighlighted}\n onMapHighlightChange={onMapHighlightChange}\n\t\t />\n\t\t {/* <h3><br />Select a state to compare plots:</h3>\n\t\t <div className=\"trends-state-name\">\n <select style={{margin:'0px'}}\n onChange={({target}) => {\n setActiveStateCode1(target.value);\n }}\n >\n <option value=\"TT\">None</option>\n <option value=\"WB\">West Bengal</option>\n <option value=\"UP\">Uttar Pradesh</option>\n <option value=\"KA\">Karnataka</option>\n <option value=\"DL\">Delhi</option>\n <option value=\"MH\">Maharashtra</option>\n <option value=\"KL\">Kerala</option>\n <option value=\"PB\">Punjab</option>\n <option value=\"TG\">Telangana</option>\n <option value=\"OR\">Odisha</option>\n <option value=\"TN\">Tamil Nadu</option>\n <option value=\"RJ\">Rajasthan</option>\n <option value=\"MP\">Madhya Pradesh</option>\n <option value=\"GJ\">Gujarat</option>\n \n </select>\n </div> */}\n \n\t\t </React.Fragment>\n\t\t )}\n\t\t <div\n className=\"updates-header fadeInUp\"\n style={{animationDelay: '1.5s'}}\n >\n <h1>Updates</h1>\n <h2>{format(new Date(), 'd MMM')}</h2>\n </div>\n\n <div className=\"updates fadeInUp\" style={{animationDelay: '1.7s'}}>\n {activityLog\n .slice(-5)\n .reverse()\n .map(function (activity, index) {\n activity.update = activity.update.replace('\\n', '<br/>');\n return (\n <div key={index} className=\"update\">\n <h5>\n {formatDistance(\n new Date(activity.timestamp * 1000),\n new Date()\n ) + ' Ago'}\n </h5>\n <h4\n dangerouslySetInnerHTML={{\n __html: activity.update,\n }}\n ></h4>\n </div>\n );\n })}\n </div>\n </div>\n\n <div className=\"home-right\">\n {fetched && (\n <React.Fragment>\n <div className=\"header fadeInUp\" style={{animationDelay: '1s'}}>\n\t\t\t\t<div className=\"header-mid\">\n\t\t\t\t <div className=\"titles\">\n\t\t\t\t\t<h1>Social Media Analysis</h1>\n\t\t\t\t\t<h6 style={{fontWeight: 600}}>An initiative by ICG for WHO's Office for South East Asia</h6>\n\t\t\t\t </div>\n\t\t\t\t <div className=\"last-update\">\n\t\t\t\t\t<h6>Last Updated</h6>\n\t\t\t\t\t<h6 style={{color: '#28a745', fontWeight: 600}}>\n\t\t\t\t\t {isNaN(Date.parse(formatDate1(lastUpdated)))\n\t\t\t\t\t\t? ''\n\t\t\t\t\t\t: formatDistance(\n\t\t\t\t\t\t\tnew Date(formatDate1(lastUpdated)),\n\t\t\t\t\t\t\tnew Date()\n\t\t\t\t\t\t ) + ' Ago'}\n\t\t\t\t\t</h6>\n\t\t\t\t\t<h6 style={{color: '#28a745', fontWeight: 600}}>\n\t\t\t\t\t {isNaN(Date.parse(formatDate1(lastUpdated)))\n\t\t\t\t\t\t? ''\n\t\t\t\t\t\t: formatDateAbsolute(lastUpdated)}\n\t\t\t\t\t</h6>\n\t\t\t\t </div>\n\t\t\t\t</div>\n\t\t\t </div>\n\n {/*<TimeSeries\n //timeseries={timeseries[activeStateCode]}\n\t\t\t\ttimeseries={timeseries}\n type={graphOption}\n mode={timeseriesMode}\n logMode={timeseriesLogMode}\n />*/}\n\t\t\t <div className=\"fadeInUp\" style={{animationDelay: '0.5s'}}>\n\t\t\t <div className=\"pills\">\n\t\t\t\t<Modal1 />\n\t\t\t </div>\n\t\t\t <p />\n {tfseries[activeStateCode].length != 0 && <ApexChart series={[{name: getStateName(activeStateCode), type:'area', data: tfseries[activeStateCode]}, \n {name: 'First COVID-related Death', type:'scatter', data: [eventseries[0]]}, \n {name: 'Announcement of Janta Curfew', type:'scatter', data: [eventseries[1]]}, \n {name: 'Junta Curfew Observed', type:'scatter', data: [eventseries[2]]}, \n {name: 'Announcement of Diya Jalao', type:'scatter', data: [eventseries[4]]}, \n {name: 'Diya Jalao Observed at 9PM', type:'scatter', data: [eventseries[5]]},\n {name: 'Announcement of Lockdown Extension', type:'scatter', data: [eventseries[6]]}, \n {name: 'Lockdown Announced', type:'scatter', data: [eventseries[3]]},\n {name: getStateName(activeStateCode)+\" (Moving Average)\", type:'area', data: wa1series[activeStateCode]}]}/>}\n\t\t\t {tfseries[activeStateCode].length == 0 && <ApexChart series={[{name: getStateName(activeStateCode), data: tfseries[activeStateCode]}]}/>}\n\t\t\t <div className=\"pills\">\n\t\t\t\t<Modal />\n\t\t\t </div>\n\t\t\t <p />\n\t\t\t <ApexChart1 series={[{name: 'Twitter Volume/Day', type:'area', data: normalise(nfseries[activeStateCode], psseries[activeStateCode].slice(-1)[0][1])}, {name: 'Positive Cases', type:'area', data: psseries[activeStateCode]}, {name: 'First COVID-related Death', type:'scatter', data: [eventseries[0]]}, {name: 'Announcement of Janta Curfew', type:'scatter', data: [eventseries[1]]}, {name: 'Junta Curfew Observed', type:'scatter', data: [eventseries[2]]}, {name: 'Announcement of Diya Jalao', type:'scatter', data: [eventseries[4]]}, {name: 'Diya Jalao Observed at 9PM', type:'scatter', data: [eventseries[5]]}, {name: 'Announcement of Lockdown Extension', type:'scatter', data: [eventseries[6]]}, {name: 'Lockdown Announced', type:'scatter', data: [eventseries[3]]}]}/>\n {/* <ApexChart1 series={[{name: 'Twitter Volume/Day', type:'area', data: normalise(nfseries[activeStateCode], psseries[activeStateCode].slice(-1)[0][1])}, */}\n {/* {name: 'Positive Cases', type:'area', data: psseries[activeStateCode]}]}/> */}\n\t\t\t </div>\n </React.Fragment>\n )}\n </div>\n </div>\n </React.Fragment>\n );\n}", "title": "" }, { "docid": "3077ad57fcd5d6de3e4cd61775a89144", "score": "0.5406696", "text": "function main() {\n document.getElementById('header').innerHTML = events.SETUP['TIME'];\n var chartSpec = {\n element: document.getElementById('chart'),\n data: {\n parameterEvents: events['parameterEvents'],\n dsnEvents: events['dsnEvents'],\n modeEvents: events['modeEvents']\n },\n rows: [{\n title: 'Spacecraft States',\n layers: [{\n type: 'symbol',\n color: 'blue',\n shape: 'diamond',\n from: 'parameterEvents',\n mappings: function(d) {\n return {\n x: utc(d.time),\n y: d.state,\n text: d.text,\n fill: d.color\n }\n },\n adjustments: function(item) {\n var size = Math.min(18, item.size);\n return {\n y: item.y + size * 0.05,\n size: size * 0.9\n };\n }\n }, {\n type: 'label',\n from: 'parameterEvents',\n mappings: function(d) {\n return {\n x: utc(d.time),\n y: d.state,\n text: d.text,\n fill: d.color\n }\n },\n adjustments: function(item) {\n var size = Math.min(18, item.size);\n return {\n y: item.y + size * 0.05,\n size: size * 0.9\n };\n }\n }]\n }, {\n title: 'TLM Output Mode',\n layers: [{\n type: 'symbol',\n shape: 'diamond',\n from: 'modeEvents',\n mappings: function(d) {\n return {\n x: utc(d.time),\n y: d.state,\n text: d.text,\n fill: d.color\n }\n },\n adjustments: function(item) {\n var size = Math.min(18, item.size);\n return {\n y: item.y + size * 0.05,\n size: size * 0.9\n };\n }\n }, {\n type: 'label',\n from: 'modeEvents',\n mappings: function(d) {\n return {\n x: utc(d.time),\n y: d.state,\n text: d.text,\n fill: d.color\n }\n },\n adjustments: function(item) {\n var size = Math.min(18, item.size);\n return {\n y: item.y + size * 0.05,\n size: size * 0.9\n };\n }\n }]\n }, {\n title: 'DSN Coverage',\n mappings: function(d) {\n return {\n x: utc(d.start),\n x2: utc(d.end)\n };\n },\n layers: [{\n type: 'rect',\n from: 'dsnEvents',\n mappings: function(d) {\n return {\n x: utc(d.start),\n x2: utc(d.end),\n y: d.ant,\n fill: d.color\n }\n }\n }, {\n type: 'label',\n from: 'dsnEvents',\n mappings: function(d) {\n return {\n x: utc(d.start),\n x2: utc(d.end),\n y: d.ant,\n text: d.user,\n fill: d.color\n }\n },\n adjustments: function(item) {\n var size = Math.min(18, item.size);\n return {\n y: item.y + size * 0.05,\n size: size * 0.9\n };\n }\n }, {\n type: 'label',\n from: 'dsnEvents',\n anchor: 'right',\n fill: 'none',\n maxItems: 50,\n mappings: function(d) {\n return {\n text: d3.time.format.utc('%H:%M')(utc(d.start)),\n x: utc(d.start),\n y: d.ant\n };\n },\n adjustments: function(d) {\n return {\n // Slightly shrink the start/end times relative to the main labels\n size: d.size * 0.4,\n };\n }\n },{\n type: 'label',\n from: 'dsnEvents',\n anchor: 'left',\n fill: 'none',\n maxItems: 50,\n mappings: function(d) {\n return {\n text: d3.time.format.utc('%H:%M')(utc(d.end)),\n x: utc(d.end),\n y: d.ant\n };\n },\n adjustments: function(d) {\n return {\n // Slightly shrink the start/end times relative to the main labels\n size: d.size * 0.4,\n };\n }\n }\n ]\n }\n ]\n }\n var chart = new Timely.Chart(chartSpec);\n var $win = $(window);\n\n function redraw() {\n chart.setWidth($win.width() - 50)\n .setHeight($win.height() - 50)\n .draw();\n }\n\n $win.resize(redraw);\n\n redraw();\n}", "title": "" }, { "docid": "f9a0a2fe0e9c812043450aafb81eee7f", "score": "0.5405227", "text": "update (electionResult, colorScale){\n\n // ******* TODO: PART II *******\n\n //Group the states based on the winning party for the state;\n //then sort them based on the margin of victory\n\n //Create the stacked bar chart.\n //Use the global color scale to color code the rectangles.\n //HINT: Use .electoralVotes class to style your bars.\n\n //Display total count of electoral votes won by the Democrat and Republican party\n //on top of the corresponding groups of bars.\n //HINT: Use the .electoralVoteText class to style your text elements; Use this in combination with\n // chooseClass to get a color based on the party wherever necessary\n\n //Display a bar with minimal width in the center of the bar chart to indicate the 50% mark\n //HINT: Use .middlePoint class to style this bar.\n\n //Just above this, display the text mentioning the total number of electoral votes required\n // to win the elections throughout the country\n //HINT: Use .electoralVotesNote class to style this text element\n\n //HINT: Use the chooseClass method to style your elements based on party wherever necessary.\n\n //******* TODO: PART V *******\n //Implement brush on the bar chart created above.\n //Implement a call back method to handle the brush end event.\n //Call the update method of shiftChart and pass the data corresponding to brush selection.\n //HINT: Use the .brush class to style the brush.\n\n\n }", "title": "" }, { "docid": "542e436bb13546ee9a4f15d7a03f19a3", "score": "0.5399148", "text": "getdata() {\n if (!this._isValid) return null;\n try {\n if (!this.datasource) return;\n if (this.datasource && !this.datasource.length) return;\n const _num = (n) => (n === parseInt(n) ? Number(parseInt(n)) : Number(parseFloat(n).toFixed(2)));\n const _aggr = this.aggregate;\n const groups = this._buildGroupdata();\n if (!groups) {\n console.error(\"No data found\");\n }\n // build the results\n return Object.keys(groups).map(function (group) {\n let items = groups[group].filter(\n (item) => item.state && !isNaN(parseFloat(item.state)) && isFinite(item.state)\n );\n if (items && items.length === 0) {\n return {\n y: 0.0,\n x: \"\"\n };\n }\n if (_aggr == \"first\") {\n const item = items.shift();\n return {\n y: _num(item.state || 0.0),\n x: item.last_changed\n };\n }\n if (_aggr == \"last\") {\n const item = items[items.length - 1];\n return {\n y: _num(item.state || 0.0),\n x: item.last_changed\n };\n }\n if (_aggr == \"max\") {\n return items.reduce((a, b) =>\n a.state > b.state\n ? {\n y: _num(a.state || 0.0),\n x: a.last_changed\n }\n : { y: _num(b.state), x: b.last_changed }\n );\n }\n if (_aggr == \"min\")\n return items.reduce((a, b) =>\n a.state < b.state\n ? {\n y: _num(a.state || 0.0),\n x: a.last_changed\n }\n : {\n y: _num(b.state || 0.0),\n x: b.last_changed\n }\n );\n if (_aggr == \"sum\") {\n const val = items.reduce((sum, entry) => sum + _num(entry.state), 0);\n return {\n y: val || 0.0,\n x: items[0].last_changed\n };\n }\n if (_aggr == \"avg\") {\n const val = items.reduce((sum, entry) => sum + _num(entry.state), 0) / items.length;\n return {\n y: val || 0.0,\n x: items[0].last_changed\n };\n }\n return items.map((items) => {\n return {\n y: _num(items.state || 0.0),\n x: items.timestamp\n };\n });\n });\n } catch (err) {\n console.error(\"Build Histroydata\", err.message, err);\n }\n }", "title": "" }, { "docid": "280191888f19d0797faeee026bf2210c", "score": "0.5398207", "text": "function init() {\n let stateIdButton = d3.select(\"#selDataset\");\n\n // API call\n d3.json(url).then(function(data) {\n let dataCopy2 = data;\n console.log(dataCopy2);\n\n // append states in an smpty list\n let states = [];\n dataCopy2.forEach(item => states.push(item.State));\n\n // select only unique state names\n let uniqueStates = states.filter((onlyUnique));\n console.log(uniqueStates);\n\n // update values based on selected state\n uniqueStates.forEach(name => {\n stateIdButton.append(\"option\") \n .text(name) \n .property(\"value\")\n \n });\n \n // call functions to build charts and state data based on selected state\n createPlots(uniqueStates[0]);\n createData(uniqueStates[0]);\n });\n}", "title": "" }, { "docid": "1075bf5694e10a9c406791540d54ab89", "score": "0.53947806", "text": "function create_weather_prediction(state) {\n function matches(weather_data) {\n if (state === weather_data.state)\n return true\n else\n return false\n }\n\n function setTo(_to) {\n state.to = _to\n }\n\n function setFrom(_from) {\n state.from = _from\n }\n\n function getTo() {\n return state.to\n }\n\n function getFrom() {\n return state.from\n }\n\n function getState() {\n return state\n }\n let event = create_event(state)\n let dataType = create_data_type(state)\n return {\n matches,\n setTo,\n setFrom,\n getTo,\n getFrom,\n getState,\n ...event,\n ...dataType\n }\n}", "title": "" }, { "docid": "72af080f8d760f24dbe577471cb1adea", "score": "0.53854424", "text": "function init() {\n // + SCALES\n xScale = d3\n .scaleTime()\n .domain(d3.extent(state.data, d => new Date(d.date)))\n .range([margin.left, width - margin.right]);\n\n yScale = d3\n .scaleLinear()\n .domain([0, d3.max(state.data, d => d.fahrenheit)])\n .range([height - margin.bottom, margin.top]);\n // + AXES\n\n const xAxis = d3.axisBottom(xScale);\n yAxis = d3.axisLeft(yScale);\n \n\n // + UI ELEMENT SETUP\n\n const selectElement = d3.select(\"#dropdown\").on(\"change\", function() {\n // `this` === the selectElement\n // 'this.value' holds the dropdown value a user just selected\n state.selectedState = this.value; // + UPDATE STATE WITH YOUR SELECTED VALUE\n console.log(\"new value is\", this.value);\n draw(); // re-draw the graph based on this new selection\n });\n\n // add in dropdown options from the unique values in the data\n selectElement\n .selectAll(\"option\")\n .data([\n ...Array.from(new Set(state.data.map(d => d.States))),\n default_selection,\n ])\n .join(\"option\")\n .attr(\"value\", d => d)\n .text(d => d);\n\n // + SET SELECT ELEMENT'S DEFAULT VALUE (optional)\n \n selectElement.property(\"value\", default_selection);\n \n // + CREATE SVG ELEMENT\n\n svg = d3\n .select(\"#d3-container\")\n .append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n // + CALL AXES\n\n svg\n .append(\"g\")\n .attr(\"class\", \"axis x-axis\")\n .attr(\"transform\", `translate(0,${height - margin.bottom})`)\n .call(xAxis)\n .append(\"text\")\n .attr(\"class\", \"axis-label\")\n .attr(\"x\", \"50%\")\n .attr(\"dy\", \"3em\")\n //.text(\"Month\");\n\n svg\n .append(\"g\")\n .attr(\"class\", \"axis y-axis\")\n .attr(\"transform\", `translate(${margin.left},0)`)\n .call(yAxis)\n .append(\"text\")\n .attr(\"class\", \"axis-label\")\n .attr(\"y\", \"50%\")\n .attr(\"dx\", \"-3em\")\n .attr(\"writing-mode\", \"vertical-rl\")\n .text(\"Average Temperature in ℉ \");\n\n draw(); // calls the draw function\n}", "title": "" }, { "docid": "0a8ed2fa9a6407b20b1859f5e5425f1a", "score": "0.5380042", "text": "loadDataToState(dataType, dataRange, formattedData) {\n var obj = Object.assign({}, this.state);\n obj.data = obj.data || {};\n obj.data[dataType] = obj.data[dataType] || {};\n obj.data[dataType][dataRange] = obj.data[dataType][dataRange] || {};\n obj.data[dataType][dataRange] = formattedData;\n\n this.setState(obj);\n }", "title": "" }, { "docid": "b2cee40921102e49d5dd872c739b1ec5", "score": "0.5377288", "text": "getHistoryGraphData() {\n try {\n switch (this.card_config.chart) {\n case \"bubble\":\n this.entity_options.mode = CT_DATASCALEMODES[this.card_config.chart]\n this.graphData = this.createHistoryBubbleData()\n break\n case \"scatter\":\n this.entity_options.mode = CT_DATASCALEMODES[this.card_config.chart]\n this.graphData = this.createHistoryScatterData()\n break\n case \"bar\":\n case \"horizontalbar\":\n if (this.entity_options && this.entity_options.mode && this.entity_options.mode.history) {\n /**\n * create aggregated state chart\n */\n this.graphData = this.createHistoryChartData()\n } else {\n /**\n * create state based chart\n */\n this.graphData = this.createChartData()\n }\n break\n case \"pie\":\n case \"doughnut\":\n /**\n * check multiseries\n */\n if (\n this.card_config &&\n this.card_config.chartOptions &&\n this.card_config.chartOptions.multiseries === true &&\n this.entity_options &&\n this.entity_options.mode &&\n this.entity_options.mode.history\n ) {\n this.graphData = this.createHistoryChartData()\n } else {\n this.entity_options.mode = CT_DATASCALEMODES[this.card_config.chart]\n this.graphData = this.createChartData()\n }\n break\n default:\n /**\n * default is usde for all other charts\n */\n this.graphData = this.createHistoryChartData()\n break\n }\n if (this.graphData) {\n return this.graphData\n } else {\n console.error(\"Error getHistoryGraphData, no data present!\")\n }\n } catch (err) {\n console.error(\"Build History GraphData\", err.message, err)\n }\n return null\n }", "title": "" }, { "docid": "c0975fa02aeb3e937b250fdf7b5d0883", "score": "0.5371149", "text": "_buildState(inState, entityConfig) {\r\n if (isNaN(inState))\r\n return inState;\r\n \r\n const state = Number(inState);\r\n \r\n if (entityConfig.decimals === undefined || Number.isNaN(entityConfig.decimals) || Number.isNaN(state))\r\n return Math.round(state * 100) / 100;\r\n \r\n const x = 10 ** entityConfig.decimals;\r\n return (Math.round(state * x) / x).toFixed(entityConfig.decimals);\r\n }", "title": "" }, { "docid": "cb70f1af607004ba1064cdb6116276b9", "score": "0.53696567", "text": "function callbackForStateChange(state){\n \n switch(state){\n case '0':\n\n \n \n //set the data for main chart\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n \n mainSeriesData = [];\n totalMainIssues = 0;\n\n for(var i = 0; i < productData.length; i++){\n name = dummyArea[i];\n y = productData[i].issues;\n totalMainIssues += y\n\n mainSeriesData.push({name: name, y: y});\n }\n\n currentMainChartTitle = \"Total : \" + totalMainIssues;\n currentMainChartSubtitle = null;\n\n currentMainChartData = [{\n name: \"Products\", \n colorByPoint: true, data: mainSeriesData,\n // events: {\n // click: function(e){\n // currentProduct = e.point.name;\n // currentState = \"12\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n\n \n document.getElementById(\"main-graph-header\").innerHTML = \"<h5>Area Breakdown Chart</h5>\";\n\n //set the data for the issuetype chart\n issuetypeData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.issuetype;\n\n issuetypeSeriesData = [];\n totalIssuetypeIssues = 0;\n\n for(var i = 0; i < issuetypeData.length; i++){\n name = issuetypeData[i].name;\n y = issuetypeData[i].issues;\n\n totalIssuetypeIssues += y;\n\n issuetypeSeriesData.push({name: name, y: y});\n }\n\n currentIssueTypeChartData = [{\n name: \"Issue type\", \n colorByPoint: true, data: issuetypeSeriesData,\n events: {\n click: function(e){\n currentIssueType = e.point.name;\n currentState = \"05\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n currentIssueTypeChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentIssueTypeChartSubtitle = \"Click on the slices to view severity breakdown\";\n\n\n //set the data for the severity chart\n severityData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.severity;\n\n severitySeriesData = [];\n totalSeverityIssues = 0;\n\n for(var i = 0; i < severityData.length; i++){\n name = severityData[i].name;\n y = severityData[i].issues;\n\n totalSeverityIssues += y;\n\n severitySeriesData.push({name: name, y: y});\n }\n\n currentSeverityChartData = [{\n name: \"Severity\",\n colorByPoint: true, data: severitySeriesData,\n events: {\n click: function(e){\n currentSeverity = e.point.name;\n currentState = \"06\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n currentSeverityChartTitle = \"Total : \" + totalSeverityIssues;\n currentSeverityChartSubtitle = \"Click on the slices to view issue type breakdown\";\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalMainIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalMainIssues;\n currentPlatformChartSubtitle = null;\n \n createCharts();\n\n break;\n\n case '05':\n \n \n\n //set the data for the severity chart\n issueTypeData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.issuetype;\n issueTypeIndex = issueTypeData.map(function(d){return d['name']}).indexOf(currentIssueType);\n\n severityData = issueTypeData[issueTypeIndex].severity;\n\n severitySeriesData = [];\n totalSeverityIssues = 0;\n\n for(var i = 0; i < severityData.length; i++){\n name = severityData[i].name;\n y = severityData[i].issues;\n\n totalSeverityIssues += y;\n\n severitySeriesData.push({name: name, y: y});\n }\n\n currentSeverityChartData = [{\n name: \"Severity\",\n colorByPoint: true, data: severitySeriesData,\n // events: {\n // click: function(e){\n // currentSeverity = e.point.name;\n // currentState = \"16\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n\n currentSeverityChartTitle = \"Total : \" + totalSeverityIssues;\n currentSeverityChartSubtitle = null;\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalSeverityIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalSeverityIssues;\n currentPlatformChartSubtitle = null;\n\n createSeverityChart();\n createPlatformChart();\n break;\n\n case '06':\n\n //set the data for the issuetype chart\n severityData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.severity;\n severityIndex = severityData.map(function(d){return d['name']}).indexOf(currentSeverity);\n issuetypeData = severityData[severityIndex].issuetype;\n \n issuetypeSeriesData = [];\n totalIssuetypeIssues = 0;\n \n for(var i = 0; i < issuetypeData.length; i++){\n name = issuetypeData[i].name;\n y = issuetypeData[i].issues;\n \n totalIssuetypeIssues += y;\n \n issuetypeSeriesData.push({name: name, y: y});\n }\n \n currentIssueTypeChartData = [{\n name: \"Issue type\", \n colorByPoint: true, data: issuetypeSeriesData,\n // events: {\n // click: function(e){\n // currentIssueType = e.point.name;\n // currentState = \"05\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n \n currentIssueTypeChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentIssueTypeChartSubtitle = null;\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalIssuetypeIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentPlatformChartSubtitle = null;\n\n createIssueTypeChart();\n createPlatformChart();\n \n break;\n \n case '1':\n \n \n //set the data for main chart\n productIndex = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products.map(function(d){return d['name']}).indexOf(currentArea);\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products.slice(productIndex, productIndex+1);\n \n mainSeriesData = [];\n totalMainIssues = 0;\n\n for(var i = 0; i < productData.length; i++){\n name = productData[i].name;\n y = productData[i].issues;\n totalMainIssues += y\n\n mainSeriesData.push({name: name, y: y});\n }\n\n currentMainChartData = [{\n name: \"Products\", \n colorByPoint: true, data: mainSeriesData,\n // events: {\n // click: function(e){\n // currentProduct = e.point.name;\n // currentState = \"12\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n\n document.getElementById(\"main-graph-header\").innerHTML = \"<h5>Product Breakdown Chart</h5>\";\n currentMainChartTitle = \"Total : \" + totalMainIssues; \n currentMainChartSubtitle = null;\n\n //set the data for the issuetype chart\n\n \n\n issuetypeData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products[productIndex].issuetype;\n\n issuetypeSeriesData = [];\n totalIssuetypeIssues = 0;\n\n for(var i = 0; i < issuetypeData.length; i++){\n name = issuetypeData[i].name;\n y = issuetypeData[i].issues;\n\n totalIssuetypeIssues += y;\n\n issuetypeSeriesData.push({name: name, y: y});\n }\n\n currentIssueTypeChartData = [{\n name: \"Issue type\", \n colorByPoint: true, data: issuetypeSeriesData,\n events: {\n click: function(e){\n currentIssueType = e.point.name;\n currentState = \"15\";\n callbackForStateChange(currentState);\n }\n }\n }]\n \n currentIssueTypeChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentIssueTypeChartSubtitle = \"Click on the slices to view severity breakdown\";\n\n\n //set the data for the severity chart\n severityData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products[productIndex].severity;\n\n severitySeriesData = [];\n totalSeverityIssues = 0;\n\n for(var i = 0; i < severityData.length; i++){\n name = severityData[i].name;\n y = severityData[i].issues;\n\n totalSeverityIssues += y;\n\n severitySeriesData.push({name: name, y: y});\n }\n\n currentSeverityChartData = [{\n name: \"Severity\",\n colorByPoint: true, data: severitySeriesData,\n events: {\n click: function(e){\n currentSeverity = e.point.name;\n currentState = \"16\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n currentSeverityChartTitle = \"Total : \" + totalSeverityIssues;\n currentSeverityChartSubtitle = \"Click on the slices to view issue type breakdown\";\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalMainIssues, 0]\n }];\n \n \n \n currentPlatformChartTitle = \"Total : \" + totalMainIssues;\n currentPlatformChartSubtitle = null;\n \n createCharts();\n\n document.getElementById(\"version-choice\").innerHTML = \"<option value='none'>Select a product</option>\"\n \n break;\n\n case '12':\n \n\n //set the data for main chart\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n versionData = productData[productIndex].version;\n \n mainSeriesData = [];\n totalMainIssues = 0;\n\n for(var i = 0; i < versionData.length; i++){\n name = versionData[i].name;\n y = versionData[i].issues;\n totalMainIssues += y\n\n mainSeriesData.push({name: name, y: y});\n }\n\n currentMainChartData = [{\n name: \"Products\", \n colorByPoint: true, data: mainSeriesData,\n // events: {\n // click: function(e){\n // currentVersion = e.point.name;\n // currentState = \"123\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n\n document.getElementById(\"main-graph-header\").innerHTML = \"<h5>Version Breakdown Chart</h5>\";\n currentMainChartTitle = \"Total : \" + totalMainIssues;\n currentMainChartSubtitle = null;\n\n //set the data for the issuetype chart\n\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n issuetypeData = productData[productIndex].issuetype;\n\n issuetypeSeriesData = [];\n totalIssuetypeIssues = 0;\n\n for(var i = 0; i < issuetypeData.length; i++){\n name = issuetypeData[i].name;\n y = issuetypeData[i].issues;\n\n totalIssuetypeIssues += y;\n\n issuetypeSeriesData.push({name: name, y: y});\n }\n\n currentIssueTypeChartData = [{\n name: \"Issue type\", \n colorByPoint: true, data: issuetypeSeriesData,\n // events: {\n // click: function(e){\n // currentIssueType = e.point.name;\n // currentState = \"125\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n\n currentIssueTypeChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentIssueTypeChartSubtitle = \"Click on the slices to view severity breakdown\";\n\n\n //set the data for the severity chart\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n severityData = productData[productIndex].severity;\n\n severitySeriesData = [];\n totalSeverityIssues = 0;\n\n for(var i = 0; i < severityData.length; i++){\n name = severityData[i].name;\n y = severityData[i].issues;\n\n totalSeverityIssues += y;\n\n severitySeriesData.push({name: name, y: y});\n }\n\n currentSeverityChartData = [{\n name: \"Severity\",\n colorByPoint: true, data: severitySeriesData,\n // events: {\n // click: function(e){\n // currentSeverity = e.point.name;\n // currentState = \"126\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n\n currentSeverityChartTitle = \"Total : \" + totalSeverityIssues;\n currentSeverityChartSubtitle = \"Click on the slices to view issue type breakdown\";\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalMainIssues, 0]\n }];\n \n \n currentPlatformChartTitle = \"Total : \" + totalMainIssues;\n currentPlatformChartSubtitle = null;\n\n createCharts();\n\n break;\n\n case '15':\n \n \n\n //set the data for the severity chart\n productIndex = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products.map(function(d){return d['name']}).indexOf(currentArea);\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products.slice(productIndex, productIndex+1);\n\n currentProductData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products[productIndex];\n \n issueTypeData = currentProductData.issuetype;\n issueTypeIndex = issueTypeData.map(function(d){return d['name']}).indexOf(currentIssueType);\n\n severityData = issueTypeData[issueTypeIndex].severity;\n\n severitySeriesData = [];\n totalSeverityIssues = 0;\n\n for(var i = 0; i < severityData.length; i++){\n name = severityData[i].name;\n y = severityData[i].issues;\n\n totalSeverityIssues += y;\n\n severitySeriesData.push({name: name, y: y});\n }\n\n currentSeverityChartData = [{\n name: \"Severity\",\n colorByPoint: true, data: severitySeriesData,\n // events: {\n // click: function(e){\n // currentSeverity = e.point.name;\n // currentState = \"16\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n\n currentSeverityChartTitle = \"Total : \" + totalSeverityIssues;\n currentSeverityChartSubtitle = null;\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalSeverityIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalSeverityIssues;\n currentPlatformChartSubtitle = null;\n\n createSeverityChart();\n createPlatformChart();\n break;\n\n case '16':\n\n //set the data for the issuetype chart\n\n productIndex = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products.map(function(d){return d['name']}).indexOf(currentArea);\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products.slice(productIndex, productIndex+1);\n\n currentProductData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products[productIndex];\n\n severityData = currentProductData.severity;\n severityIndex = severityData.map(function(d){return d['name']}).indexOf(currentSeverity);\n issuetypeData = severityData[severityIndex].issuetype;\n \n issuetypeSeriesData = [];\n totalIssuetypeIssues = 0;\n \n for(var i = 0; i < issuetypeData.length; i++){\n name = issuetypeData[i].name;\n y = issuetypeData[i].issues;\n \n totalIssuetypeIssues += y;\n \n issuetypeSeriesData.push({name: name, y: y});\n }\n \n currentIssueTypeChartData = [{\n name: \"Issue type\", \n colorByPoint: true, data: issuetypeSeriesData,\n // events: {\n // click: function(e){\n // currentIssueType = e.point.name;\n // currentState = \"05\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n \n currentIssueTypeChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentIssueTypeChartSubtitle = null;\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalIssuetypeIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentPlatformChartSubtitle = null;\n\n createIssueTypeChart();\n createPlatformChart();\n break;\n\n case '123':\n \n\n //set the data for main chart\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n \n \n componentData = productData[productIndex].components;\n componentIndex = componentData.map(function(d){return d['name']}).indexOf(currentComponent);\n\n \n \n mainSeriesData = [];\n totalMainIssues = 0;\n\n for(var i = 0; i < componentData.length; i++){\n name = componentData[i].name;\n y = componentData[i].issues;\n totalMainIssues += y\n\n mainSeriesData.push({name: name, y: y});\n }\n\n currentMainChartData = [{\n name: \"Products\", \n colorByPoint: true, data: mainSeriesData,\n events: {\n click: function(e){\n currentComponent = e.point.name;\n currentState = \"1234\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n document.getElementById(\"main-graph-header\").innerHTML = \"<h5>Component Breakdown Chart</h5>\";\n currentMainChartTitle = \"Total : \" + totalMainIssues;\n currentMainChartSubtitle = \"Click on the columns to view issue types and severity breakdown\";\n \n\n //set the data for the issuetype chart\n\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n versionData = productData[productIndex].version;\n versionIndex = versionData.map(function(d){return d['name']}).indexOf(currentVersion);\n\n issuetypeData = versionData[versionIndex].issuetype;\n\n issuetypeSeriesData = [];\n totalIssuetypeIssues = 0;\n\n for(var i = 0; i < issuetypeData.length; i++){\n name = issuetypeData[i].name;\n y = issuetypeData[i].issues;\n\n totalIssuetypeIssues += y;\n\n issuetypeSeriesData.push({name: name, y: y});\n }\n\n currentIssueTypeChartData = [{\n name: \"Issue type\", \n colorByPoint: true, data: issuetypeSeriesData,\n events: {\n click: function(e){\n currentIssueType = e.point.name;\n currentState = \"1235\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n currentIssueTypeChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentIssueTypeChartSubtitle = \"Click on the slices to view severity breakdown\";\n\n\n //set the data for the severity chart\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n versionData = productData[productIndex].version;\n versionIndex = versionData.map(function(d){return d['name']}).indexOf(currentVersion);\n \n severityData = versionData[versionIndex].severity;\n\n severitySeriesData = [];\n totalSeverityIssues = 0;\n\n for(var i = 0; i < severityData.length; i++){\n name = severityData[i].name;\n y = severityData[i].issues;\n\n totalSeverityIssues += y;\n\n severitySeriesData.push({name: name, y: y});\n }\n\n currentSeverityChartData = [{\n name: \"Severity\",\n colorByPoint: true, data: severitySeriesData,\n events: {\n click: function(e){\n currentSeverity = e.point.name;\n currentState = \"1236\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n currentSeverityChartTitle = \"Total : \" + totalSeverityIssues;\n currentSeverityChartSubtitle = \"Click on the slices to view issue type breakdown\";\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalSeverityIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalSeverityIssues;\n currentPlatformChartSubtitle = null;\n\n createCharts();\n break;\n\n case '1235':\n debugger;\n //set the data for the severity chart\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n versionData = productData[productIndex].version;\n versionIndex = versionData.map(function(d){return d['name']}).indexOf(currentVersion);\n\n issueTypeData = versionData[versionIndex].issuetype;\n issueTypeIndex = issueTypeData.map(function(d){return d['name']}).indexOf(currentIssueType);\n\n severityData = issueTypeData[issueTypeIndex].severity;\n\n severitySeriesData = [];\n totalSeverityIssues = 0;\n\n for(var i = 0; i < severityData.length; i++){\n name = severityData[i].name;\n y = severityData[i].issues;\n\n totalSeverityIssues += y;\n\n severitySeriesData.push({name: name, y: y});\n }\n\n currentSeverityChartData = [{\n name: \"Severity\",\n colorByPoint: true, data: severitySeriesData,\n // events: {\n // click: function(e){\n // currentSeverity = e.point.name;\n // currentState = \"16\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n\n currentSeverityChartTitle = \"Total : \" + totalSeverityIssues;\n currentSeverityChartSubtitle = null;\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalSeverityIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalSeverityIssues;\n currentPlatformChartSubtitle = null;\n\n createSeverityChart();\n createPlatformChart();\n break;\n\n case '1236':\n debugger;\n //set the data for the issuetype chart\n\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n versionData = productData[productIndex].version;\n versionIndex = versionData.map(function(d){return d['name']}).indexOf(currentVersion);\n\n severityData = versionData[versionIndex].severity;\n severityIndex = severityData.map(function(d){return d['name']}).indexOf(currentSeverity);\n \n issuetypeData = severityData[severityIndex].issuetype;\n \n issuetypeSeriesData = [];\n totalIssuetypeIssues = 0;\n \n for(var i = 0; i < issuetypeData.length; i++){\n name = issuetypeData[i].name;\n y = issuetypeData[i].issues;\n \n totalIssuetypeIssues += y;\n \n issuetypeSeriesData.push({name: name, y: y});\n }\n \n currentIssueTypeChartData = [{\n name: \"Issue type\", \n colorByPoint: true, data: issuetypeSeriesData,\n // events: {\n // click: function(e){\n // currentIssueType = e.point.name;\n // currentState = \"05\";\n // callbackForStateChange(currentState);\n // }\n // }\n }]\n \n currentIssueTypeChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentIssueTypeChartSubtitle = null;\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalIssuetypeIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentPlatformChartSubtitle = null;\n\n createIssueTypeChart();\n createPlatformChart();\n break;\n\n case '1234':\n\n //set the titles for the chart\n currentMainChartTitle = \"Products\";\n currentIssueTypeChartTitle = \"Issue types\";\n currentSeverityChartTitle = \"Severity\";\n currentPlatformChartTitle = \"Platform\";\n\n //set the data for main chart\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n componentData = productData[productIndex].components;\n componentIndex = componentData.map(function(d){return d['name']}).indexOf(currentComponent);\n\n\n \n mainSeriesData = [];\n totalMainIssues = 0;\n\n for(var i = 0; i < componentData.length; i++){\n name = componentData[i].name;\n y = componentData[i].issues;\n totalMainIssues += y\n\n mainSeriesData.push({name: name, y: y});\n }\n\n currentMainChartData = [{\n name: \"Components\", \n data: mainSeriesData,\n events: {\n click: function(e){\n \n currentComponent = e.point.name;\n currentState = \"1234\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n currentMainChartSubtitle = \"Click on the columns to view issue types and severity breakdown\";\n\n //set the data for the issuetype chart\n\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n componentData = productData[productIndex].components;\n componentIndex = componentData.map(function(d){return d['name']}).indexOf(currentComponent);\n\n issuetypeData = componentData[componentIndex].issuetype;\n\n issuetypeSeriesData = [];\n totalIssuetypeIssues = 0;\n\n for(var i = 0; i < issuetypeData.length; i++){\n name = issuetypeData[i].name;\n y = issuetypeData[i].issues;\n\n totalIssuetypeIssues += y;\n\n issuetypeSeriesData.push({name: name, y: y});\n }\n\n currentIssueTypeChartData = [{\n name: \"Issue type\", \n colorByPoint: true, data: issuetypeSeriesData,\n events: {\n click: function(e){\n currentIssueType = e.point.name;\n currentState = \"12345\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n currentIssueTypeChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentIssueTypeChartSubtitle = \"Click on the slices to view severity breakdown\";\n\n\n //set the data for the severity chart\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n componentData = productData[productIndex].components;\n componentIndex = componentData.map(function(d){return d['name']}).indexOf(currentComponent);\n\n severityData = componentData[componentIndex].severity;\n\n severitySeriesData = [];\n totalSeverityIssues = 0;\n\n for(var i = 0; i < severityData.length; i++){\n name = severityData[i].name;\n y = severityData[i].issues;\n\n totalSeverityIssues += y;\n\n severitySeriesData.push({name: name, y: y});\n }\n\n currentSeverityChartData = [{\n name: \"Severity\",\n colorByPoint: true, data: severitySeriesData,\n events: {\n click: function(e){\n currentSeverity = e.point.name;\n currentState = \"12346\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n currentSeverityChartTitle = \"Total : \" + totalSeverityIssues;\n currentSeverityChartSubtitle = \"Click on the slices to view issue type breakdown\";\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalIssuetypeIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentPlatformChartSubtitle = null;\n\n createIssueTypeChart();\n createSeverityChart();\n createPlatformChart();\n\n break;\n\n \n\n case '12345':\n\n\n //set the data for the severity chart\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n componentData = productData[productIndex].components;\n componentIndex = componentData.map(function(d){return d['name']}).indexOf(currentComponent);\n\n issuetypeData = componentData[componentIndex].issuetype;\n issuetypeIndex = issuetypeData.map(function(d){return d['name']}).indexOf(currentIssueType);\n\n severityData = issuetypeData[issuetypeIndex].severity;\n\n severitySeriesData = [];\n totalSeverityIssues = 0;\n\n for(var i = 0; i < severityData.length; i++){\n name = severityData[i].name;\n y = severityData[i].issues;\n\n totalSeverityIssues += y;\n\n severitySeriesData.push({name: name, y: y});\n }\n\n currentSeverityChartData = [{\n name: \"Severity\",\n colorByPoint: true, data: severitySeriesData,\n events: {\n click: function(e){\n currentSeverity = e.point.name;\n currentState = \"126\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n currentSeverityChartTitle = \"Total : \" + totalSeverityIssues;\n currentSeverityChartSubtitle = null;\n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalSeverityIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalSeverityIssues;\n currentPlatformChartSubtitle = null;\n\n \n createSeverityChart();\n createPlatformChart();\n break;\n\n case '12346':\n debugger;\n //set the titles for the chart\n currentMainChartTitle = \"Products\";\n currentIssueTypeChartTitle = \"Issue types\";\n currentSeverityChartTitle = \"Severity\";\n currentPlatformChartTitle = \"Platform\";\n\n \n\n //set the data for the issuetype chart\n\n productData = WSO2_PRODUCT_COMPONENT_ISSUES_DATA.products;\n productIndex = productData.map(function(d){return d['name']}).indexOf(currentProduct);\n\n componentData = productData[productIndex].components;\n componentIndex = componentData.map(function(d){return d['name']}).indexOf(currentComponent);\n\n severityData = componentData[componentIndex].severity;\n severityIndex = severityData.map(function(d){return d['name']}).indexOf(currentSeverity);\n\n issuetypeData = severityData[severityIndex].issuetype;\n\n issuetypeSeriesData = [];\n totalIssuetypeIssues = 0;\n\n for(var i = 0; i < issuetypeData.length; i++){\n name = issuetypeData[i].name;\n y = issuetypeData[i].issues;\n\n totalIssuetypeIssues += y;\n\n issuetypeSeriesData.push({name: name, y: y});\n }\n\n currentIssueTypeChartData = [{\n name: \"Issue type\", \n colorByPoint: true, data: issuetypeSeriesData,\n events: {\n click: function(e){\n currentIssueType = e.point.name;\n currentState = \"12345\";\n callbackForStateChange(currentState);\n }\n }\n }]\n\n currentIssueTypeChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentIssueTypeChartSubtitle = null;\n\n\n \n\n //set the data for the platform chart\n \n \n currentPlatformChartData = [{\n name: 'Platform',\n data: [totalIssuetypeIssues, 0]\n }];\n \n currentPlatformChartTitle = \"Total : \" + totalIssuetypeIssues;\n currentPlatformChartSubtitle = null;\n\n createIssueTypeChart();\n \n createPlatformChart();\n break;\n\n case '123456':\n break;\n\n case '123465':\n break;\n\n }\n\n}", "title": "" }, { "docid": "8b88c6dc18b2de307b892bd3f04d26c3", "score": "0.53666866", "text": "generateDatasets(props) {\n let datasets = [];\n\n //Create a dataset object that Chart.js to understand\n props.data.forEach(function (data) {\n datasets.push({\n label: data.label,\n data: data.data,\n fill: false,\n tension: 0,\n borderColor: data.color,\n borderWidth: 8,\n pointRadius: 0,\n pointHitRadius: 10\n });\n }, this);\n\n //Let the React wrapper for Chart.js update the view\n this.setState({\n values: {\n datasets\n }\n });\n }", "title": "" }, { "docid": "7749c16ac9f3af1590baf827db822db2", "score": "0.5357605", "text": "getChartData(canvas) {\n let ctx = canvas.getContext(\"2d\");\n let gradientStroke = ctx.createLinearGradient(0, 230, 0, 50);\n\n gradientStroke.addColorStop(1, \"rgba(208, 72, 182, 0.2)\");\n gradientStroke.addColorStop(0.4, \"rgba(208, 72, 182, 0.0)\");\n gradientStroke.addColorStop(0, \"rgba(208, 72, 182, 0)\"); //purple colors\n\n let config = {}\n config.datasets = mainCharts[this.props.bigChartData].datasets(this.state.data, gradientStroke);\n config.labels = mainCharts[this.props.bigChartData].labels(this.state.date);\n\n return config;\n }", "title": "" }, { "docid": "df60201a9fb5f5ebb3a11133334e6d67", "score": "0.53557587", "text": "constructor() {\n super();\n this.state = {\n name: \"\",\n gender : \"\",\n department: \"\",\n dob: \"\",\n date: new Date(\"01-01-1900\")\n }\n }", "title": "" }, { "docid": "af26c615c257d8519bafad70da753e6f", "score": "0.5354738", "text": "createBar(canvas, data, titleID, newTitle, subtitleID, newSubtitle, colorScale, state, setGlobalState) {\n\n // Sort the data by percent that are proficient and bus distance\n data = data\n .filter(d => {return d.BusDistance > 0})\n .sort((a, b) => {\n return d3.descending(b.PercentMeet, a.PercentMeet)\n })\n .sort((a, b) => {\n return d3.descending(b.BusDistance, a.BusDistance)\n });\n\n let height = this.canvasHeight\n let width = this.canvasWidth\n\n // Set the xScale and yScale of the bar chart\n let xScale = d3\n .scaleBand()\n .domain(data.map(d => d.School))\n .range([this.margin.left, width]);\n\n let yScale = d3\n .scaleLinear()\n .domain([0, 2665]) // hard coded max distance to 2665 to keep scale the same\n .range([height, this.margin.top])\n\n // Y Axis\n let yAxis = canvas\n .append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(d3.axisLeft(yScale).ticks(5))\n .attr(\"transform\", \"translate(40, 0)\")\n .style(\"opacity\", 0)\n .transition()\n .duration(400)\n .style(\"opacity\", 1);\n\n // Draw bar chart\n let bar = canvas\n .selectAll(\".bar\")\n .data(data, key => key)\n .enter()\n .append(\"rect\")\n .attr(\"x\", d => xScale(d.School))\n .attr(\"y\", d => yScale(d.BusDistance))\n .attr(\"width\", xScale.bandwidth())\n .attr(\"height\", d => (height - yScale(d.BusDistance)))\n .style(\"fill\", d => colorScale(d.category))\n .attr(\"opacity\", 0)\n .attr(\"id\", function (d, i) {\n return d.School.replace(/[^A-Z0-9]/ig, \"\")\n })\n .on(\"mouseover\", function (d) {\n d3.selectAll(\"#\" + this.id)\n .style(\"opacity\", \"0.5\")\n\n // tooltip\n d3.select('body')\n .append('div')\n .attr('class', 'waffle-tooltip')\n .attr('style', 'position: absolute;')\n .style('left', (d3.event.pageX - 40) + 'px')\n .style('top', (d3.event.pageY - 250) + 'px')\n .html(\"<b style='font-size: 18px;'>\" + d.School + \"</b><br>\" + d.City + \", \" + d.State + \"<br><br>Buses have to travel an average of <b style='font-size: 14px; color: white;'>\" + Math.floor(d.BusDistance) + \" miles</b> to take students to this school per day <br><br><b style='font-size: 10px; font-weight: 400;'>\" + Math.floor(d.PercentMeet * 100) + \"% of the chosen population in this school (\" + state.selectedPop + \") is proficient in \" + d.Subject + \"</b>\")\n .style(\"opacity\", 0)\n .transition()\n .duration(200)\n .style(\"opacity\", 0.9);\n })\n .on(\"mouseout\", function (d) {\n d3.selectAll(\"#\" + this.id)\n .transition(d3.easeElastic)\n .duration(50)\n .style(\"opacity\", \"1\")\n\n d3.selectAll(\".waffle-tooltip\")\n .remove();\n })\n .transition()\n .delay(d => d.Index)\n .attr(\"opacity\", 1)\n\n // Transition the title\n let titleVar = d3.select(titleID)\n .style(\"opacity\", \"1\")\n .transition(d3.easeElastic)\n .duration(200)\n .style(\"opacity\", \"0\")\n .transition(d3.easeElastic)\n .duration(200)\n .text(newTitle)\n .style(\"opacity\", \"1\");\n\n let subtitleVar = d3.select(subtitleID)\n .style(\"opacity\", \"1\")\n .transition(d3.easeElastic)\n .duration(200)\n .style(\"opacity\", \"0\")\n .transition(d3.easeElastic)\n .duration(200)\n .text(newSubtitle)\n .style(\"opacity\", \"1\");\n\n // Define the average\n const average = d3.sum(data, d => d.BusDistance) / data.length;\n\n // Tribal school average line function\n let avgLine = d3.line()\n .x(function (d, i) {\n return xScale(d.School);\n })\n .y(function (d, i) {\n return yScale(average);\n });\n\n canvas.append(\"path\")\n .datum(data)\n .attr(\"class\", \"mean\")\n .attr(\"d\", avgLine)\n .style(\"opacity\", \"0\")\n .transition(d3.easeElastic)\n .duration(800)\n .style(\"opacity\", \"0.4\");\n\n canvas\n .append(\"text\")\n .attr(\"class\", \"avg-subtitle\")\n .attr(\"transform\", \"translate(\" + (width - 3) + \",\" + yScale(average) + \")\")\n .attr(\"dy\", \"1.2em\")\n .attr(\"text-anchor\", \"end\")\n .style(\"fill\", \"#212121\")\n .html(\"Average distance for population (\" + state.selectedPop + \"): \" + Math.floor(average) + \" miles\")\n .style(\"opacity\", \"0\")\n .transition(d3.easeElastic)\n .duration(200)\n .style(\"opacity\", \"1\");\n\n }", "title": "" }, { "docid": "f8f92a933727e7de2ece2534699cee78", "score": "0.534009", "text": "setLineChartData(lineData){\n function pad(n, width) {\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n;\n }\n\n function sortByKey(array, key) {\n return array.sort(function(a, b) {\n var x = a[key]; var y = b[key];\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\n });\n }\n\n function sortData(data, id){\n let nnInfoNewList = [];\n if (data != null) {\n for (var i in data) {\n nnInfoNewList[i] = data[i];\n }\n }\n\n nnInfoNewList = sortByKey(nnInfoNewList, id);\n return nnInfoNewList\n }\n\n let best = lineData['best']\n let bygen = lineData['bygen']\n\n let data = []\n \n \n for(let rows in bygen){\n let subData = {}\n let row = bygen[rows]\n let rowSort = sortData(row, \"acc\")\n let avg = 0\n let avgcnt = 0\n let maxcnt =1\n subData['name'] = 'Gen'+pad(rows*1+1,3)\n for(let i=rowSort.length-1 ; i>=0 ; i--){\n subData[pad(maxcnt,2)] = (rowSort[i]['acc']*100).toFixed(2)*1\n if(rowSort[i]['survive'] === true){\n avg = avg + (rowSort[i]['acc']*100).toFixed(2)*1\n avgcnt += 1\n }\n \n if(this.state.NN_Labels.indexOf(pad(maxcnt,2)) == -1){\n this.state.NN_Labels.push(pad(maxcnt,2))\n }\n \n if(maxcnt >= this.state.barCnt){\n break\n }\n maxcnt += 1\n }\n if(avgcnt > 1){\n subData['avg'] = (avg/avgcnt).toFixed(2)*1\n }else{\n subData['avg'] = 0\n }\n \n data.push(subData)\n\n }\n\n this.state.NN_Labels = this.state.NN_Labels.sort()\n this.state.NN_Data = data\n }", "title": "" }, { "docid": "bc227271af14cb0ef355caa832811090", "score": "0.53229165", "text": "changeDiagram(event) {\n var chartNew,\n chartNewForOrders;\n\n chartNew = this.generateLineChartForSales(this.state.currencySymbol);\n chartNewForOrders = this.generateLineChartForOrderCount();\n\n if (event.target.id === 'renderstyle-bar') {\n this.setState({ diagramType: 'bar'});\n chartNew.transform('bar');\n chartNewForOrders.transform('bar');\n } else {\n this.setState({ diagramType: 'line'});\n chartNew.transform('line');\n chartNewForOrders.transform('line');\n\n }\n }", "title": "" }, { "docid": "284cf43665a17e9ee97fc6cdf3fd0fd0", "score": "0.5320519", "text": "static getDerivedStateFromProps(props, state) {\n console.log('>>>>>>>>>>>>>>>> LineChart > getDerivedStateFromProps() <<<<<<<<<<<<<<<<<<<<<<');\n return null;\n }", "title": "" }, { "docid": "8ded1ded987831e0fddb623a2fdccaa2", "score": "0.52860534", "text": "function renderStates(\n stateCircles,\n newXScale,\n chosenXAxis,\n newYScale,\n chosenYAxis\n) {\n stateCircles\n .transition()\n .duration(1000)\n .attr(\"cx\", (rawData) => newXScale(rawData[chosenXAxis]))\n .attr(\"cy\", (rawData) => newYScale(rawData[chosenYAxis]));\n\n return stateCircles;\n}", "title": "" }, { "docid": "68fc21c4deb53336a9099bed1b64277a", "score": "0.5282618", "text": "render() {\n const data = this.state.data;\n return (\n <ChartWrapper data={data}/>\n );\n }", "title": "" }, { "docid": "6c823cde8dc88d5c647a8de48866ea26", "score": "0.5276619", "text": "_state(data) {\n const { changed, children } = data;\n\n // Need to specifically check for false because this value is undefined\n // when a machine first boots up\n if(changed === false) {\n return false;\n }\n\n // Save off the event, but only the fields we need\n this._data = {\n __proto__ : null,\n\n value : data.value,\n event : data.event,\n context : data.context,\n };\n\n const { _children } = this;\n \n // Clear out any old children that are no longer being tracked\n _children.forEach((child, key) => {\n if(key in children) {\n return;\n }\n\n child.teardown();\n child = null;\n\n _children.delete(key);\n });\n\n // Add any new children to be tracked\n Object.keys(children).forEach((id) => {\n if(_children.has(id)) {\n return;\n }\n\n const service = children[id];\n\n // Not a statechart, abort!\n if(!service.initialized || !service.state) {\n return;\n }\n\n // Create the child ComponentTree instance, trigger re-walks of the parent after it chnages\n _children.set(id, new ComponentTree(service, () =>\n this._run()\n ));\n });\n \n return this._run();\n }", "title": "" }, { "docid": "1083e276dffb52221d94696822091eda", "score": "0.526777", "text": "constructor(props) {\n super(props);\n this.state = ({\n weather: '',\n temp: 0,\n humidity: 0,\n wind: 0,\n antipode_weather: '',\n antipode_temp: 0,\n antipode_humidity: 0,\n antipode_wind: 0\n })\n }", "title": "" }, { "docid": "2c7f1a150fbc7db1f618e271f56375cd", "score": "0.5261078", "text": "current2(metric) {\n this.setState(prevState => {\n let todaysValue = Object.assign({}, prevState.todaysValue);\n todaysValue[metric] = (parseFloat(maindata[Object.keys(maindata)[0]][metric]))\n return { todaysValue };\n })\n }", "title": "" }, { "docid": "5a3c12ab800cf6daa21f2faec40a50a0", "score": "0.52541953", "text": "function fill_data_for_state(data) {\n\n // Population\n fill_values(\"pop\",data['sum']['pop']);\n $('input[name=init_pop]').val(data['sum']['pop']);\n $('#pop_val').text(data['sum']['pop']);\n\n // Non-Tracked Factor\n fill_values(\"non_tracked_factor\",default_non_tracked_factor);\n\n // Current # of cases\n fill_values(\"total_infected\",parseInt(data['sum']['cur_total_cases'])); \n $('#total_infected').val(data['sum']['cur_total_cases']);\n\n // Daily Case Growth\n var daily_cg = get_daily_growth(data); \n fill_values(\"new_case_growth_per_day\",daily_cg<=1?2:daily_cg.toFixed(2));\n\n // Mortality Rate\n var mortality_rate = get_mortality_rate(data); \n fill_values(\"mortality_rate\",parseFloat(mortality_rate)<=.5?.6:mortality_rate.toFixed(2));\n \n \n fill_values(\"non_tracked_factor\",default_non_tracked_factor);\n fill_values(\"herd_immunity_threshold\",default_herd_immunity_treshold);\n \n $('input[name=last_day_of_data]').val(data['sum']['last_update']); \n $('input[name=current_dead]').val(data['sum']['cur_total_deaths']);\n \n\n}", "title": "" }, { "docid": "b5256c6066810a1c9c227839009d241f", "score": "0.5248658", "text": "function createPlots(State) {\n\n // querry API using base url\n d3.json(url).then(function(data) {\n\n // filter data by State and use the filter to extract need information to build charts\n let covidData = data.filter(item => item.State.toString() === State);\n console.log(covidData);\n\n // create empy list and append states to it\n let states = [];\n covidData.forEach(item => states.push(item.State));\n console.log(states);\n\n // append average cases to an empty list\n let averageCases = [];\n covidData.forEach(item => averageCases.push(item.Average_cases));\n console.log(averageCases);\n\n // append dates to an empty list\n let dates= [];\n covidData.forEach(item => dates.push(item.Date));\n console.log(dates);\n\n // append average deaths to an empty list\n let averageDeaths = [];\n covidData.forEach(item => averageDeaths.push(item.Average_death));\n console.log(averageDeaths);\n\n // append death percentage to an empty list\n let deathPercent = [];\n covidData.forEach(item => deathPercent.push(item.Death_percent));\n console.log(deathPercent);\n \n // build horizontal bar chart to show monthly status\n let barTrace = {\n x: averageCases.reverse(),\n y: dates.reverse(),\n orientation: 'h',\n type: 'bar',\n text: averageDeaths.reverse()\n };\n\n let dataTrace = [barTrace];\n \n let barLayout = {\n title: \"COVID-19 Average Cases And Deaths\",\n margin: {\n l: 100,\n r: 100,\n t: 100,\n b: 100\n }\n };\n \n Plotly.newPlot('bar', dataTrace, barLayout); \n\n // build gauge chart t show recovery percentage \n let filteredRecovery = covidData.filter(item => item.State.toString() === State);\n console.log(filteredRecovery);\n\n // append recovery percentage to an empty list\n let recovery = [];\n filteredRecovery.forEach(item => recovery.push(item.Recovery_percent));\n console.log(recovery);\n\n // Enter the recovery between 0 and 180\n let level = parseFloat(recovery)*1.7;\n\n // Trig to calc meter point\n let degrees = 180 - level;\n let radius = 0.5;\n let radians = (degrees * Math.PI) / 180;\n let x = radius * Math.cos(radians);\n let y = radius * Math.sin(radians);\n\n // Path: may have to change to create a better triangle\n let mainPath = \"M -.0 -0.05 L .0 0.05 L \";\n let pathX = String(x);\n let space = \" \";\n let pathY = String(y);\n let pathEnd = \" Z\";\n let path = mainPath.concat(pathX, space, pathY, pathEnd);\n let gaugeData = [\n {\n type: \"scatter\",\n x: [0],\n y: [0],\n marker: { size: 12, color: \"850000\" },\n showlegend: false,\n name: \"Freq\",\n text: level,\n hoverinfo: \"text+name\"\n },\n {\n values: [50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50],\n rotation: 90,\n text: [\"99-100\", \"98-99\", \"97-98\", \"96-97\", \"95-96\", \"94-95\", \"93-94\", \"92-93\", \"91-92\", \"90-91\", \"\"],\n textinfo: \"text\",\n textposition: \"inside\",\n marker: {\n colors: [\n \"rgba(0, 100, 11, .5)\",\n \"rgba(0, 105, 11, .5)\",\n \"rgba(10, 120, 22, .5)\",\n \"rgba(14, 127, 0, .5)\",\n \"rgba(110, 154, 22, .5)\",\n \"rgba(170, 202, 42, .5)\",\n \"rgba(202, 209, 95, .5)\",\n \"rgba(210, 206, 145, .5)\",\n \"rgba(232, 226, 202, .5)\",\n \"rgba(240, 230, 215, .5)\",\n \"rgba(255, 255, 255, 0)\"\n ]\n },\n labels: [\"99-100\", \"98-99\", \"97-98\", \"96-97\", \"95-96\", \"94-95\", \"93-94\", \"92-93\", \"91-92\", \"90-91\", \"\"],\n hoverinfo: \"label\",\n hole: 0.5,\n type: \"pie\",\n showlegend: false\n }\n ];\n\n let gaugeLayout = {\n shapes: [\n {\n type: \"path\",\n path: path,\n fillcolor: \"850000\",\n line: {\n color: \"850000\"\n }\n }\n ],\n title: \"<b>Recovery Percentage</b> <br> Per Total Confirmed Cases\",\n height: 500,\n width: 500,\n xaxis: {\n zeroline: false,\n showticklabels: false,\n showgrid: false,\n range: [-1, 1]\n },\n yaxis: {\n zeroline: false,\n showticklabels: false,\n showgrid: false,\n range: [-1, 1]\n }\n };\n\n Plotly.newPlot(\"gauge\", gaugeData, gaugeLayout);\n\n // build line chart to show trend of average cases and death percentage during time period\n let lineTrace = {\n x: dates,\n y: averageCases,\n mode: \"lines\",\n marker: {\n size:averageCases ,\n // color: averageDeaths\n },\n text: deathPercent.reverse()\n };\n\n let lineData = [lineTrace];\n\n let lineLayout = {\n xaxis: {title: \"Dates\"},\n yaxis: {title: \"Average Cases\"},\n height: 500,\n width: 900,\n title: \"Covid-19 Average Stats\"\n };\n\n Plotly.newPlot('line', lineData, lineLayout);\n }).catch(err => console.log(err));\n}", "title": "" }, { "docid": "4bd8feff5a783cbb410e67c9d4de61a5", "score": "0.52446115", "text": "constructor(props) {\n super(props);\n /**\n * The user can select to filter/highlight from suites \n * and benchmarks, the unique values of both are calculated here and assigned to the state int he constructor\n */\n \n \n let options = [...new Set(data.data.map(x => x[\"Suite\"]))];\n const suiteOptions = options.map(x => {\n return { value: x, label: x };\n });\n options = [...new Set(data.data.map(x => x[\"Category\"]))];\n const benchmarkCategories = options.map(x => {\n return { value: x, label: x };\n });\n // Calculate the median Performance increase in each benchmark category and suite\n const categoryMedians = this.calcStats(\n data.data,\n \"Category\",\n \"Relative Performance\"\n );\n const medians = this.calcStats(data.data, \"Suite\", \"Relative Performance\");\n console.log(\"categoryMedians\", categoryMedians);\n\n this.state = {\n data: data.data,\n medians: medians,\n // Initiall scatterdata is the same as 'data', scatterdata can be filtered by the user\n scatterData: data.data,\n selectedSuites: null,\n selectedBenchmarks: null,\n suiteOptions: suiteOptions,\n benchmarkCategoryOptions: benchmarkCategories,\n // categoryMedians are shown in the table under the scatterplot\n categoryMedians: categoryMedians,\n // modalData will contain data selected to be displayed as a table in the modal.\n modalData: [],\n showSummaryModal: false\n };\n }", "title": "" }, { "docid": "7926f233ae0934869beec86addbb3cb6", "score": "0.5243568", "text": "function initializeState() {\n var state = {};\n state.balls = [];\n\n for (var i = 0; i < 5; i++) {\n var newBall = {};\n newBall.x = i * 50 + 40;\n newBall.y = i * 10 + 30;\n newBall.dx = 10;\n newBall.dy = 0;\n newBall.m = 1;\n newBall.r = 20;\n state.balls.push(newBall);\n }\n\n state.room = {};\n state.room.width = 300;\n state.room.height = 300;\n\n state.totalEnergy = 0;\n return state;\n}", "title": "" }, { "docid": "c7700280712ccb4d2cac9fc0a82b2a07", "score": "0.5239548", "text": "constructor(props) {\n super(props);\n this.state = {\n dataArray: [],\n dataOfMonths: [],\n totalData: [],\n pushMonthsData: [],\n dataOfInterest: [],\n pushInterestData: [],\n pushTotalData: [],\n minInterest: 2,\n maxInterest: 10,\n value: 6,\n stmt1: \"Loan of $\",\n stmt2: \"taken for\",\n stmt3: \"months at an interest of\",\n stmt4: \"%.Total payable amount is $\",\n receivedLoanData: 500 \n }\n }", "title": "" }, { "docid": "50c31ea98902353983be764f13aad1a0", "score": "0.5237006", "text": "renderDevChart() {\n \n let statusChart = (\n <DoughnutChart\n textCenter={this.state.testChartTitle}\n centerFontSize = { 22 }\n numbers={this.state.testChartData}\n percentageView={true}\n tooltip={this.state.testChartLabels}\n arcRadius={50}\n selectedStrokeColor={DOUGHNUT_CHART_HIGHLIGHT_COLOR}\n colorArray={this.state.testChartColorArray}\n menuClick={this.onTestChartMenuClick}\n menu = { this.state.testChartMenu }\n legends = { true }\n legendsData = { this.state.devChartLegendData }\n />\n\n );\n\n if (this.state.testChartData && this.state.testChartData.length > 0) {\n return statusChart;\n }\n }", "title": "" }, { "docid": "3c6efd8befd5eec6c2af404997b80d4a", "score": "0.5224442", "text": "function updateState(state) {\n\n var model = state.data\n , curday = model.daily[model.daily.length - 1]\n , curweek = model.weekly[model.weekly.length - 1]\n , curmonth = model.monthly[model.monthly.length - 1]\n , date = new Date(currentDate)\n , templates = clone(state.templates)\n , curhour\n , newvalues;\n\n // Update hours\n model.hourly.push(createEntry(date, templates));\n if (model.hourly.length > HOURS_PER_DAY / 2) {\n model.hourly.shift();\n }\n\n curhour = model.hourly[model.hourly.length - 1];\n newvalues = curhour.values;\n\n // Update days\n if (curday && date.getDate() == curday.date.getDate()) {\n curday = addValue(curday, newvalues);\n }\n else {\n model.daily.push(clone(curhour));\n }\n if (model.daily.length > DAYS_PER_WEEK) {\n model.daily.shift();\n }\n\n // Update weeks\n if (curweek && curweek.ct < HOURS_PER_WEEK) {\n curweek = addValue(curweek, newvalues);\n }\n else {\n model.weekly.push(clone(curhour));\n }\n if (model.weekly.length > WEEKS_PER_PERIOD) {\n model.weekly.shift();\n }\n\n // Update months\n if (curmonth && date.getMonth() == curday.date.getMonth()) {\n curmonth = addValue(curmonth, newvalues);\n }\n else {\n model.monthly.push(clone(curhour));\n }\n if (model.monthly.length > MONTHS_PER_YEAR) {\n model.monthly.shift();\n }\n }", "title": "" }, { "docid": "2dfb7a69cfe9533c6e4ade75c924bc6c", "score": "0.5223634", "text": "constructor(forecastData, pollData) {\n this.forecastData = forecastData;\n this.tableData = [...forecastData];\n // add useful attributes\n for (let forecast of this.tableData)\n {\n forecast.isForecast = true;\n forecast.isExpanded = false;\n }\n this.pollData = pollData;\n this.headerData = [\n {\n sorted: false,\n ascending: false,\n key: 'state', \n alterFunc: d => d\n },\n {\n sorted: false,\n ascending: false,\n key: 'margin',\n alterFunc: d => Math.abs(+d)\n },\n {\n sorted: false,\n ascending: false,\n key: 'winstate_inc',\n alterFunc: d => +d\n },\n ]\n\n this.vizWidth = 300;\n this.vizHeight = 30;\n this.smallVizHeight = 20;\n\n this.scaleX = d3.scaleLinear()\n .domain([-100, 100])\n .range([0, this.vizWidth]);\n\n this.attachSortHandlers();\n this.drawLegend();\n }", "title": "" }, { "docid": "fa7fa5a773602b17261aef5c5e281a0b", "score": "0.5221871", "text": "function insValoresEjes(state) {\n const { ctx, chart } = state\n const { tags, values } = chart\n ctx.save()\n let valuesAxisX = values\n let valuesAxisY = tags\n if (chart.orientation == 'vertical') {\n valuesAxisX = tags\n valuesAxisY = values\n }\n insValuesX(state, valuesAxisX)\n insValuesY(state, valuesAxisY)\n ctx.restore()\n ctx.save()\n }", "title": "" }, { "docid": "a92278c2c690e21997c87905c1b7cadc", "score": "0.5218304", "text": "function init_state_2y(gState, data) {\n init_state_0(gState, data);\n\n gState.scenario_max_length = 365 * 2;\n gState.start_no = 0;\n\n\n gState.events = [\n new DynParEvent(1, \"bck_rate\", 0.001, \"January 1st, novel virus reported.\"),\n new DynParEvent(20, \"bck_rate\", 0.005, \"January 20th, infected people have started travelling into the country in significant numbers.\"),\n new ToggleTTIEvent(30, \"Starting Trace and Isolate Program focusing on people coming in from affected regions.\"),\n new DynParEvent(31+24, \"bck_rate\", 0.1, \"February 24th, the virus is spreading through neighbouring countries, full blown arrival here is only a matter of time now.\"),\n new SetCMLevelEvent(31+26, 1, \"First counter measures are taken. Initial focus is to slow down the virus until more is known.\"),\n new SetCMLevelEvent(31+30, 2, \"As cases continue to rise measures are intensified.\"),\n new SetCMLevelEvent(31+30+10, 3, \"As cases continue to rise measures are intensified.\"),\n new SetCMLevelEvent(31+30+20, 4, \"20th of March, a a strong set of measures is taken.\"),\n new ToggleHL20Event(180, \"Hard lockdown for >20 in effect.\"),\n new DynParEvent(365, \"bck_rate_m\", 5., \"January 1st, B.1.1.7 mutation appears among travelers coming into Germany.\"),\n new DynParEvent(380, \"vac_rate\", 0.001, \"Vaccinations starting slowly.\"),\n new SetCMLevelEvent(400, 4, \"Increasing counter measures.\"),\n new DynParEvent(440, \"vac_rate\", 0.01, \"Vaccinations picking up steam.\"),\n ];\n}", "title": "" }, { "docid": "020e61f0df6b24e6f52698760f1473b3", "score": "0.52181995", "text": "function setState() {\n var state = {\n selectGroup: [],\n currentTool: \"select\",\n currentColor: null,\n buttonsObject: {\n tool: [\"select\", \"rect\", \"circle\", \"delete\"],\n color: [\"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"indigo\", \"violet\"],\n zindex: [\"back\", \"backward\", \"forward\", \"front\"],\n },\n currentShape: undefined,\n }\n return state;\n}", "title": "" }, { "docid": "16a5e1396347b7e84125cd1bf5f2cf08", "score": "0.52112406", "text": "function DTXDataObject(){\n this.chartInfo = {\n \"title\": \"\",\n \"artist\": \"\",\n \"bpm\": 0.0,\n \"drumlevel\": 0.00,\n \"guitarlevel\": 0.00,\n \"basslevel\": 0.00\n };\n this.metadata = {};\n this.barGroups = [];\n }", "title": "" }, { "docid": "7203b70fb009485e2e0dfb5db83a88a3", "score": "0.5201126", "text": "render() { \n \n return (\n <div className=\"App\">\n <Header />\n <Form getData={this.getData} />\n <div>\n {\t\n this.state.startDate && this.state.endDate && <p> \n <Bar data={this.state.chartData}\n width={100}\n height={400}\n options={{ maintainAspectRatio: false }} />\n </p> \n }\n </div>\n <div>\n {\n this.state.shortName && <p style={{color:'blue'}}>Region:\n <span style={{color:'black'}}> {this.state.shortName}</span> \n </p>\n }\n {\n this.state.intensityIndex && <p style={{color:'blue'}}>Intensity Index:\n <span style={{color:'black'}}> {this.state. intensityIndex}</span> \n </p>\n } \n {\n this.state.minTimeStamp && <p style={{color:'blue'}}>Timestamp of the minimum carbon Intensity:\n <span style={{color:'black'}}>{this.state.minTimeStamp}</span> \n </p>\n } \n \n {\n this.state.maxTimeStamp && <p style={{color:'blue'}}>Timestamp of the maximum carbon Intensity:\n <span style={{color:'black'}}>{this.state.maxTimeStamp}</span> \n </p>\n } \n {\n this.state.average && <p style={{color:'blue'}}>Average Carbon Intisity within the date range:\n <span style={{color:'black'}}> {this.state.average}</span> \n </p>\n } \n \n \n {\n this.state.Min && <p style={{color:'blue'}}>Minmum Carbon Intisity within the date range:\n <span style={{color:'black'}}>{this.state.Min}</span> \n </p>\n } \n \n {\n this.state.Max && <p style={{color:'blue'}}>Maximum Carbon Intisity within the date range:\n <span style={{color:'black'}}> {this.state.Max}</span>\n </p>\n } \n </div>\n \n </div>\n );\n }", "title": "" }, { "docid": "8bdf5d923c4d0fea6ccf4e8ee4fcd4a4", "score": "0.51992655", "text": "renderVisualization(vis) {\n switch (this.checkVisType(vis.visType)) {\n case 1:\n return (<BarChart key={ vis.dataRange + vis.dataType + this.checkVisType(vis.visType) }\n className=\"dash__component\"\n ylabel={dateTypeToyLabelMap[vis.dataType]}\n data={ this.state.data[vis.dataType][vis.dataRange] } title={ vis.dataType }\n colour={ vis.colour } dataRange={ vis.dataRange }/>);\n break;\n case 2:\n return (<BrushLineGraph key={vis.dataRange + vis.dataType + this.checkVisType(vis.visType) }\n dataRange={ vis.dataRange } className=\"dash__component\"\n ylabel={dateTypeToyLabelMap[vis.dataType]}\n data={ this.state.data[vis.dataType][vis.dataRange] } title={ vis.dataType }\n colour={ vis.colour }/>);\n break;\n case 3:\n return (<Donut key={vis.dataRange + vis.dataType + this.checkVisType(vis.visType) }\n dataRange={ vis.dataRange } className=\"dash__component\"\n data={ this.state.data[vis.dataType][vis.dataRange] } title={ vis.dataType }\n colour={ vis.colour }/>);\n break;\n case 4:\n // Note: clock only works for Daily dataRange\n return (<Clock key={vis.dataRange + vis.dataType + this.checkVisType(vis.visType) }\n dataRange={ vis.dataRange } className=\"dash__component\"\n ylabel={dateTypeToyLabelMap[vis.dataType]}\n data={ this.state.data[vis.dataType][vis.dataRange] } title={ vis.dataType }\n colour={ vis.colour }/>);\n break;\n default:\n console.log(\"Unkown Data visualizations\");\n break;\n }\n }", "title": "" }, { "docid": "7589e5201bec743a076c5e5d89507e71", "score": "0.51987463", "text": "update_piechart(from_datetime, to_date_times){\n var pie_chart_data = this.state.pie_chart_data\n for (let i =0; i < pie_chart_data.length; i++) {\n pie_chart_data[i].value = Math.floor(Math.random() * 40 + 60)\n }\n pie_chart_data = this.sort_by_value(pie_chart_data)\n this.setState({\n pie_chart_data: pie_chart_data\n })\n }", "title": "" }, { "docid": "da120a219500bd8b2a8a9ec251998acb", "score": "0.5180911", "text": "constructor(props){\n super(props);\n \n var flight= this.props.data.data.request.airline.fsCode+this.props.data.data.request.flight.interpreted;\n var status=this.props.data.data.flightStatuses;\n var airports={};\n\n for(var index in this.props.data.data.appendix.airports)\n {\n \tairport=this.props.data.data.appendix.airports[index];\n \tairports[airport.fs]=airport.name;\n }\n childrenEstates={};\n status.map((item,index)=>\n \t{\n \t\tchildrenEstates[index]={enabledDep: false,enableArr:false,selectedArr:false,selectedDep:false};\n \t})\n this.state={flight:flight,airports:airports,status:status,count:0,childrenEstates:childrenEstates};\n }", "title": "" } ]
41a98f1eb27d921df2233241f74d4f2d
function update() cycles through the hours of accidents
[ { "docid": "a94b4382c9affd9d7a113925031e3c01", "score": "0.0", "text": "function update(hour) {\n\n // remove the text for showing the total numbers of accident in the hour of day time\n d3.selectAll('#total').remove();\n\n // if hours = -1, show all traffic accidents\n if (hour === -1) {\n var filtered = nested;\n var opacity = .1;\n var radius = 1;\n var headline = \"Arteries of Accidents across US States\";\n var string = \"Amount of Accidents: \" + filtered.length;\n console.log(string);\n } else {\n var filtered = nested.filter(function(d) {\n return d.values[0].key == hour;\n });\n var opacity = .5;\n var headline = \"Arteries of Accidents across US States, at \" + hour + \":00 o'clock\";\n var string = \"Amount of Accidents at \" + hour + \":00: \"+ filtered.length;\n console.log(string);\n }\n\n var circles = g.selectAll('circle')\n .data(filtered, key_func);\ndebugger;\n circles.exit()\n .transition()//.duration(500)\n .style('opacity', 0)\n .remove();\n\n circles.enter()\n .append(\"circle\")\n //.transition()\n //.duration(500)\n .attr('cx', function(d) { return d.values[0].values['x']; })\n .attr('cy', function(d) { return d.values[0].values['y']; })\n .attr('fill', 'red')\n .style('r' , 1)\n .style('opacity', opacity);\n d3.select('chart.chart h2').text(headline);\n var text = svg.append('text')\n .attr('id', 'total')\n .text(string)\n .attr('x', width * .75)\n .attr('y', height * .01)\n .attr('dy','3em')\n .style(\"font-weight\", 600)\n .style(\"font-size\", \"1.1em\");\n // obtain its bounding box (without considering transforms)\n var bbox = text[0][0].getBBox()\n\n // insert a rect beneath the text, to represent the bounding box\n svg.append('rect','text')\n .attr('x', bbox.x)\n .attr('y', bbox.y)\n .attr('width', bbox.width + 5)\n .attr('height', bbox.height + 5)\n .style('fill', 'lightgrey')\n .style('opacity', .4)\n }", "title": "" } ]
[ { "docid": "493ec19138b196e7a6423cfe68224928", "score": "0.6360628", "text": "function increment_hour()\r\n{\r\n\thours++;\r\n}", "title": "" }, { "docid": "a5e9ddec66f24d33c3ad9ab3d224b09c", "score": "0.6348712", "text": "function addHour()\n{\n if (gameTimeData.hour !== 24)\n {\n gameTimeData.hour++;\n }\n else\n {\n gameTimeData.hour = 1;\n addDay();\n }\n constructTimeSection()\n addhourlyIncome();\n}", "title": "" }, { "docid": "e5aa748b9df62a6add67e6b2b2f1f213", "score": "0.6286373", "text": "updateNPCs(deltatime) {\n this.activeEncounterCharacters.forEach((character) => character.update(deltatime));\n }", "title": "" }, { "docid": "54ffa1cfbc307b2ed31f2fbf6abc96fc", "score": "0.62150764", "text": "function timeChanges() {\n const [hours, minutes] = tzAdjust();\n \n setTime(hours, minutes);\n nightFilter(hours);\n setGreeting(hours, minutes);\n}", "title": "" }, { "docid": "5656a4a0da0830c419d7e5aade2a7ba3", "score": "0.6202656", "text": "function hourUpdater() {\n // get current number of hours\n var currentHour = moment().hours();\n\n // loop over time blocks\n $(\".time-block\").each(function () {\n// blockHour is how the function compares an hour to the currentHour from moment\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n\n// check if we've moved past this time\n// 'remove' and add'' class in this case effect the green/red shading based on current time\n// 'past', 'present', and 'future', are style id's, and effect coloration of the rows\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": "c1cbe8e6966c539b19dc04212fd4516d", "score": "0.61963826", "text": "function hourUpdater(){\n var currentHour = moment().hours();\n\n\n $(\".time-block\").each(function(){\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n\n// Matching the hour establish by the planner (block hour) to moment (the true time shown in currentHour), this shows that currentHour is past block hour, giving it\n// \"past\" css attibutes. Grey Color\n if (blockHour < currentHour){\n $(this).addClass(\"past\");\n }\n//Planners hour and Moments hour is the same, \"past\" changes to present, so \"present\" attributes in css is applied(yellow)\n else if (blockHour === currentHour){\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n//Moments hour is beyond past and present hours, \"present\" changes to future, so \"future\" attributes in css is applied (green)\n else{\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n\n }\n })\n }", "title": "" }, { "docid": "94733373792ecb6bf5386fc41b60417a", "score": "0.6153059", "text": "function updateTime() {\n\n }", "title": "" }, { "docid": "2330eb3f8c37b45f3b97b5135e16d37e", "score": "0.6064598", "text": "function changeHours(index, hours){\n for(var i = index; i < days.length;i++){\n days[i].balance += hours;\n }\n }", "title": "" }, { "docid": "0ce8716472ee58ceb036a30b8f79c261", "score": "0.60351413", "text": "function hourUpdater() {\n //get the current number of hours using moment()\n var currentHour = moment().hours;\n var totalTimeBlock = $(\".total-block\").length;\n\n //loop through the time blocks\n for (let i = 0; i < totalTimeBlock; i++) {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n\n // check if the current hour is greater than our previous hour then add a class called past, if block is equal to currentHour then remove past class and add present class\n // else remove past class, present class and add future class. \n if (blockHour < currentHour) {\n $(this).addClass(\"past\");\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(\"past\");\n }\n }\n }", "title": "" }, { "docid": "de22142458ac8737c04696e7cd7a2266", "score": "0.6032556", "text": "function updateTime() {\n\n}", "title": "" }, { "docid": "6a145a99d722d1505b7aad766d51afb2", "score": "0.60186696", "text": "function update() {\n\tvar date = new Date();\n\tvar seconds = date.getSeconds() + date.getMilliseconds()/1000;\n\tvar minutes = date.getMinutes() + seconds/60;\n\tvar hours = date.getHours() + minutes/60;\n\t// hours = hours > 23 ? 0 : hours + 1;\n\tvar hours12 = ((hours + 11) % 12 + 1);\n\tconsole.log(hours);\n\n\tvar bLeft = y * (12 - (hours12 - 1))/12;\n\tvar bRight = y * (60 - minutes)/60;\n\tvar aLeft = computeA(bLeft);\n\tvar aRight = computeA(bRight);\n\n\tvar leftTextPosition = computeTextPosition(bLeft);\n\tvar rightTextPosition = computeTextPosition(bRight);\n\n\tvar state = {\n\t\tam: hours < 12,\n\t\taLeft,\n\t\taRight,\n\t\tbLeft,\n\t\tbRight,\n\t\taLeftText: aLeft / 2,\n\t\tbLeftText: leftTextPosition.b,\n\t\tleftTextTop: leftTextPosition.top,\n\t\tleftText: Math.floor(hours12).toString(),\n\t\taRightText: (x + aRight)/2,\n\t\tbRightText: rightTextPosition.b,\n\t\trightTextTop: rightTextPosition.top,\n\t\trightText: pad(Math.floor(minutes), 2),\n\t}\n\n\treturn computeEasterEggs(date, state);\n}", "title": "" }, { "docid": "830bb085d5bb5c0f967b1f3c2f15c63e", "score": "0.5992614", "text": "function updateHours() {\n var currentHour = moment().hours();\n $(\".input-text\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\"));\n\n if (currentHour > blockHour) {\n $(this).addClass(\"past\");\n } else if (currentHour === blockHour) {\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": "e4eea305b0b6ab4ee23e8c212f29f8e7", "score": "0.5981458", "text": "function hourUpdater() {\n\n var currentHours = moment().hours()\n \n $('time-block').each(function() {\n let currentBlockHour = $(this).attr(\"id\").split(\"-\")[1]\n \n if (currentBlockHour < currentHours) {\n $(this).addClass('past')\n } else if (currentBlockHour === currentHours) {\n $(this).addClass('present')\n $(this).removeClass('past')\n } else {\n $(this).addClass('future')\n $(this).removeClass('present')\n }\n )\n}", "title": "" }, { "docid": "84a21a8d62af6ac1f3b2838bbfdb7fd5", "score": "0.5946916", "text": "updateInformation() {\n this.updateLastSignOfLife();\n }", "title": "" }, { "docid": "d204681bb7187c6bc95aa3bf7a3d8794", "score": "0.58625776", "text": "function addhourlyIncome()\n{\n userData.credits += userData.hourlyIncome;\n constructIncome();\n}", "title": "" }, { "docid": "6e23f725300bece0b1cc469b3b2f0a14", "score": "0.58250254", "text": "function updateClock() {\n \n let todayDate = new Date();\n let hours = todayDate.getHours() % 12;\n let mins = todayDate.getMinutes();\n let secs = todayDate.getSeconds();\n \n dateText.text = todayDate.getDate();\n monthText.text = util.monthName[todayDate.getMonth()];\n hourHand.groupTransform.rotate.angle = hoursToAngle(hours, mins);\n minHand.groupTransform.rotate.angle = minutesToAngle(mins);\n secHand.groupTransform.rotate.angle = secondsToAngle(secs);\n \n //when hour is 0 match it with 12\n if(hours == 0)\n {\n hours = 12;\n }\n \n // daily activity every 10 seconds\nupdateDailyActivity();\n\n}", "title": "" }, { "docid": "b06b9f8c9288cc99afab32573510b555", "score": "0.581697", "text": "function increment_stopwatch_hour()\r\n{\r\n\tstopwatch_hour++;\r\n}", "title": "" }, { "docid": "be615ebc7ebef7ef8b92b2bab224287d", "score": "0.5792764", "text": "function updateClock() {\n let date = new Date();\n let month = date.getMonth()+1;\n let day = util.getDayName(date.getDay());\n let monthDay = date.getDate();\n let year = date.getFullYear();\n let hours = date.getHours();\n let mins = util.zeroPad(date.getMinutes());\n let bat = Math.floor(battery.chargeLevel) + \"%\"\n let amPm = util.isAmPm(hours);\n \n if(amPm === \"pm\") { hours = hours - 12; }\n hours = (hours === 0) ? 12 : hours;\n \n dateLabel.text = `${month}/${monthDay}/${year}`;\n dateName.text = day;\n time.text = `${hours}:${mins}${amPm}`;\n batteryLabel.text = `${bat}`;\n batteryIcon.href = util.setBatteryIcon(battery.chargeLevel);\n \n stepcount.text = steps.text = today.local.steps;\n calories.text = today.local.calories;\n distance.text = today.local.distance / 1,609.344;\n activity.text = today.local.activeMinutes;\n \n stepcountGoal.text = goals.steps;\n caloriesGoal.text = goals.calories;\n distanceGoal.text = goals.distance / 1,609.344;\n activityGoal.text = goals.activeMinutes;\n \n stepBar.sweepAngle = (today.local.steps / goals.steps) * 90;\n calBar.sweepAngle = (today.local.calories / goals.calories) * 90;\n activityBar.sweepAngle = (today.local.activeMinutes / goals.activeMinutes) * 90;\n distanceBar.sweepAngle = (today.local.distance / goals.distance) * 90;\n}", "title": "" }, { "docid": "4dc69fae8e20e13c571ed433c6cdc25b", "score": "0.5775542", "text": "function updateHour(){\n // Gathers the current hour\n var currentHour = moment().hours();\n\n // Like a for loop that goes thru each schedule row\n $('.row').each(function(){\n // Gathers the id representing the hour\n var plannerHour = parseInt($(this).attr('id'));\n \n // If statement that determines if task is either past, present, or future\n if(plannerHour < currentHour){\n console.log(plannerHour < currentHour);\n $(this).addClass('past');\n } \n else if(plannerHour === currentHour){\n console.log(10);\n $(this).removeClass('past');\n $(this).addClass('present');\n } \n else{\n console.log(plannerHour === currentHour);\n $(this).removeClass('past');\n $(this).removeClass('present');\n $(this).addClass('future');\n }\n });\n }", "title": "" }, { "docid": "0be4f24445b70c8f642205a3733bf36b", "score": "0.5771957", "text": "function updateTime(){\n\n //segundos\n if(vm.countdown[3].amount<=0){\n vm.countdown[3].amount=59;\n //minutos \n if(vm.countdown[2].amount<=0){\n vm.countdown[2].amount=59;\n //horas \n if(vm.countdown[1].amount<=0){\n vm.countdown[1].amount=23;\n //días\n vm.countdown[0].amount--;\n }else \n vm.countdown[1].amount--;\n\n }else\n vm.countdown[2].amount--;\n\n }else\n vm.countdown[3].amount--;\n\n\n }", "title": "" }, { "docid": "358ef9377f65d0b47c4ed7734ac91e25", "score": "0.57668984", "text": "function hourTracker() {\n // using third party API //\n var currentHour = moment().hour();\n // setting a loop up for time-block //\n $(\".time-block\").each(function(){\n // giving the blockHour an actual number & dividing hour string into an array //\n var blockHour = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n \n // Color-coordinating hours (connecting CSS file to display on page through if and else statements)\n if (blockHour < currentHour){\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n }\n else if (blockHour === currentHour) {\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 })\n // calling the function //\n }", "title": "" }, { "docid": "9cbb23d5a0bca260d44adc2a5b143c2b", "score": "0.57460225", "text": "function updateTimeTable() {\n\t//TODO: This counts tabs even when user is using some other application\n\tconsole.log(Date.now(), \"updateTimeTable called\")\n\tchrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n\t\tfor (let i = 0; i < tabs.length; i++) {\n\t\t\tlet currHostname = extractHostname(tabs[i].url)\n\t\t\tif (!(currHostname in window.timeTable)) window.timeTable[currHostname] = 0;\n\t\t\t\n\t\t\twindow.timeTable[currHostname] += timeTableUpdateFrequency;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "19055741a91cfea5111cd17c3cf4359b", "score": "0.57456416", "text": "function updateHourlyStats() {\n\t//Planned data package order: [0]Hour of the Day |\n\t// [1]NY Fight Exp | [2]NY Fight Win Count | [3]NY Fight Loss Count | [4]NY Fight $ Won | [5]NY Fight $Lost |\n\t// [6]NY Rob Exp | [7]NY Rob Success Count | [8]NY Rob Fail Count | [9]NY Rob $Won | [10]NY Rob $Lost |\n\t// [11]NY Fight Loss Crit Hit Count | [12]NY Fight Loss Bodyguard Count | [13]NY Fight Loss Too Strong Count |\n\t// Variables below not yet created\n\t// [x]NY Capo $US | [x]NY Assist Exp | [x]NY Assist $US |\n\t// [x]NY Attacked Exp(net after deaths) | [x]NY Attacked $Won | [x]NY Attacked $Lost |\n\t// [x]NY Robbed Exp | [x]NY Robbed $Won | [x]NY Robbed $Lost |\n\t// [x]NY Job Count | [x]NY Job Exp | [x]NY Job $Made |\n\t// >>> BEGIN CUBA <<<\n\t// [x]Cuba Fight Exp | [x]Cuba Fight Win Count | [x]Cuba Fight Loss Count | [x]Cuba Fight $C Won | [x]Cuba Fight $C Lost |\n\t// [x]Cuba Fight Loss Crit Hit Count | [x]Cuba Fight Loss Bodyguard Count | [x]Cuba Fight Loss Too Strong Count |\n\t// [x]Cuba Capo $C | [x]Cuba Assist Exp | [x]Cuba Assist $C |\n\t// [x]Cuba Attacked Exp(net after deaths) | [x]Cuba Attacked $C Won | [x]Cuba Attacked $C Lost |\n\t// [x]Cuba Robbed Exp | [x]Cuba Robbed $C Won | [x]Cuba Robbed $C Lost |\n\t// [x]Cuba Job Count | [x]Cuba Job Exp | [x]Cuba Job $C Made\n\t\n\t// Max potential storage 41 * 24 = 984 elements\n\t\n\t var i, currentTime = new Date();\n\t var currentHour = currentTime.getHours();\n\t\n\t var hrDataPack = \"\";\n\t hrDataPack = currentHour + '|' + GM_getValue('fightExpNY', 0) + '|' + GM_getValue('fightWinsNY', 0) + '|' +\n\t GM_getValue('fightLossesNY', 0) + '|' + GM_getValue('fightWin$NY', 0) + '|' + GM_getValue('fightLoss$NY', 0) + '|' +\n\t GM_getValue('fightLossCHNY', 0) + '|' + GM_getValue('fightLossBGCHNY', 0) + '|'+ GM_getValue('fightLossStrongNY', 0);\n\t\n\t if (GM_getValue('hourlyStats', '0') == '0') {\n\t GM_setValue('hourlyStats', hrDataPack);\n\t } else {\n\t //pull existing stored hourly stats\n\t var splitValues = GM_getValue('hourlyStats', '').split(',');\n\t if (splitValues.length < 24) {\n\t splitValues.push(currentHour + '|0|0|0|0|0|0|0|0');\n\t }else {\n\t if ((GM_getValue('hourOfDay')*1 == 23 && currentHour != 0 )|| currentHour -1 != GM_getValue('hourOfDay')*1 && GM_getValue('hourOfDay') != isNaN(GM_getValue('hourOfDay'))){\n\t //We missed some hours so we need to carry the last good values forward\n\t var tempHour;\n\t if (GM_getValue('hourOfDay')*1 > currentHour){\n\t tempHour = currentHour + 24;\n\t }else{\n\t tempHour = currentHour;\n\t }\n\t\n\t for (i = GM_getValue('hourOfDay')*1 + 1; i < GM_getValue('hourOfDay')*1 + (tempHour - GM_getValue('hourOfDay')*1); i++){\n\t var valString = splitValues[GM_getValue('hourOfDay')];\n\t valString = valString.substring(valString.indexOf('|'), valString.length);\n\t if (i > 23){\n\t splitValues.push(String(i-24) + valString);\n\t }else {\n\t splitValues.push(i + valString);\n\t }\n\t }\n\t }\n\t }\n\t //create temp arrays\n\t var hourlyFightExpNY = new Array(24); //position [1]\n\t var hourlyFightWinsNY = new Array(24); //position [2]\n\t var hourlyFightLossesNY = new Array(24); //position [3]\n\t var hourlyFightWin$NY = new Array(24); //position [4]\n\t var hourlyFightLoss$NY = new Array(24); //position [5]\n\t var hourlyLossCrHitNY = new Array(24); //position [6]\n\t var hourlyLossBgCrHitNY = new Array(24); //position [7]\n\t var hourlyLossStrongNY = new Array(24); //position [8]\n\t\n\t // Organize Hourly stat data into ordered sets\n\t for (i = 0; i < splitValues.length; i++){\n\t //check length of each datapack to ensure it is the right size and fills missing with zeroes\n\t //this addresses issues when adding new metrics to the datapackage\n\t if (splitValues[i].split('|').length < 9) {\n\t for (var n = splitValues[i].split('|').length; n < 9; n++){\n\t splitValues[i] += '|0';\n\t }\n\t }\n\t if (splitValues[i].split('|')[0] == currentHour) {\n\t //pull data from same time day prior for \"25th\" hour\n\t var fightExpNY25 = splitValues[i].split('|')[1]*1;\n\t var fightWinsNY25 = splitValues[i].split('|')[2]*1;\n\t var fightLossesNY25 = splitValues[i].split('|')[3]*1;\n\t var fightWin$NY25 = splitValues[i].split('|')[4]*1;\n\t var fightLoss$NY25 = splitValues[i].split('|')[5]*1;\n\t var fightLossCrHitNY25 = splitValues[i].split('|')[6];\n\t var fightLossBgCrHitNY25 = splitValues[i].split('|')[7];\n\t var fightLossStrongNY25 = splitValues[i].split('|')[8];\n\t //Insert current hour values\n\t hourlyFightExpNY[splitValues[i].split('|')[0]] = hrDataPack.split('|')[1]*1;\n\t hourlyFightWinsNY[splitValues[i].split('|')[0]] = hrDataPack.split('|')[2]*1;\n\t hourlyFightLossesNY[splitValues[i].split('|')[0]] = hrDataPack.split('|')[3]*1;\n\t hourlyFightWin$NY[splitValues[i].split('|')[0]] = hrDataPack.split('|')[4]*1;\n\t hourlyFightLoss$NY[splitValues[i].split('|')[0]] = hrDataPack.split('|')[5]*1;\n\t hourlyLossCrHitNY[splitValues[i].split('|')[0]] = hrDataPack.split('|')[6]*1;\n\t hourlyLossBgCrHitNY[splitValues[i].split('|')[0]] = hrDataPack.split('|')[7]*1;\n\t hourlyLossStrongNY[splitValues[i].split('|')[0]] = hrDataPack.split('|')[8]*1;\n\t } else {\n\t //populate other hourly data\n\t hourlyFightExpNY[splitValues[i].split('|')[0]] = splitValues[i].split('|')[1]*1;\n\t hourlyFightWinsNY[splitValues[i].split('|')[0]] = splitValues[i].split('|')[2]*1;\n\t hourlyFightLossesNY[splitValues[i].split('|')[0]] = splitValues[i].split('|')[3]*1;\n\t hourlyFightWin$NY[splitValues[i].split('|')[0]] = splitValues[i].split('|')[4]*1;\n\t hourlyFightLoss$NY[splitValues[i].split('|')[0]] = splitValues[i].split('|')[5]*1;\n\t hourlyLossCrHitNY[splitValues[i].split('|')[0]] = splitValues[i].split('|')[6]*1;\n\t hourlyLossBgCrHitNY[splitValues[i].split('|')[0]] = splitValues[i].split('|')[7]*1;\n\t hourlyLossStrongNY[splitValues[i].split('|')[0]] = splitValues[i].split('|')[8]*1;\n\t }\n\t }\n\t\n\t //Prep Arrays for hourly graphing\n\t var fightExpNY = prepStatsArray(hourlyFightExpNY, currentHour);\n\t var fightWinsNY = prepStatsArray(hourlyFightWinsNY, currentHour);\n\t var fightLossesNY = prepStatsArray(hourlyFightLossesNY, currentHour);\n\t var fightWin$NY = prepStatsArray(hourlyFightWin$NY, currentHour);\n\t var fightLoss$NY = prepStatsArray(hourlyFightLoss$NY, currentHour);\n\t var fightLossCHNY = prepStatsArray(hourlyLossCrHitNY, currentHour);\n\t var fightLossBGCHNY = prepStatsArray(hourlyLossBgCrHitNY, currentHour);\n\t var fightLossStrongNY = prepStatsArray(hourlyLossStrongNY, currentHour);\n\t\n\t //Add 25th hour data to beginning of graphing arrays\n\t fightExpNY.unshift(fightExpNY25);\n\t fightWinsNY.unshift(fightWinsNY25);\n\t fightLossesNY.unshift(fightLossesNY25);\n\t fightWin$NY.unshift(fightWin$NY25);\n\t fightLoss$NY.unshift(fightLoss$NY25);\n\t fightLossCHNY.unshift(fightLossCrHitNY25);\n\t fightLossBGCHNY.unshift(fightLossBgCrHitNY25);\n\t fightLossStrongNY.unshift(fightLossStrongNY25);\n\t\n\t //create hour labels based on current hour\n\t var hourLabels = \"\";\n\t for (i = 0; i < 24; i += 2) {\n\t var ind;\n\t var hrdisp;\n\t ind = (currentHour *1) - i;\n\t if (ind < 0) {ind = 24 + ind;}\n\t if (ind > 11) {hrdisp = String((12 - ind) * -1) + 'p';} else {hrdisp = String(ind) + 'a';}\n\t hrdisp = (hrdisp == '0a') ? '12a' : hrdisp;\n\t hrdisp = (hrdisp == '0p') ? '12p' : hrdisp;\n\t hourLabels = '|' + hrdisp + hourLabels;\n\t }\n\t hourLabels = '|' + hourLabels.split('|')[12] + hourLabels;\n\t\n\t //lets make some graphs!\n\t //statSpecs Array Format: [0]Min, [1]Max. [2]Avg [3]Sum [4]Valid Data Count\n\t var statSpecsArrayA = [];\n\t var statSpecsArrayB = [];\n\t\n\t var graphOutput = \"\";\n\t\n\t //Gain rate per hour\n\t gainRateNY = [];\n\t for (i = 0; i < fightWinsNY.length; i++) {\n\t gainRateNY[i] = fightExpNY[i]/(fightWinsNY[i] + fightLossesNY[i]);\n\t if (isNaN(gainRateNY[i])) { gainRateNY[i] = 0; }\n\t gainRateNY[i] = Math.round(gainRateNY[i] * Math.pow(10,2))/Math.pow(10,2);\n\t }\n\t statSpecsArrayA = getStatSpecs(gainRateNY, 0);\n\t graphOutput = '<IMG SRC=\"' + 'http://chart.apis.google.com/chart?cht=ls&chf=bg,s,111111&chts=BCD2EA,12&chtt=NY+Fight+Gain+Rate+per+Hr+of+Day|Min.+=+' + String(statSpecsArrayA[0]) + '+++Max.+=+' +String(statSpecsArrayA[1]) + '+++Avg+=+' + String(statSpecsArrayA[2]) + '/hr&chs=315x150&chxt=x,y&chxl=0:' + hourLabels + '&chxtc=0,10|1,-300&chxr=1,' + statSpecsArrayA[0] + ',' + statSpecsArrayA[1] + '&chds=' + statSpecsArrayA[0] + ',' + statSpecsArrayA[1] + '&chm=D,04B4AE,0,0,4|o,05E6DE,0,-1.0,6&chd=t:' + String(gainRateNY) + '\"/>';\n\t\n\t //NY Fight XP gains per hour\n\t var diffArrayA = getArrayDiffs(fightExpNY);\n\t statSpecsArrayA = getStatSpecs(diffArrayA, 0);\n\t graphOutput += '<br><br>' + '<IMG SRC=\"' + 'http://chart.apis.google.com/chart?cht=ls&chf=bg,s,111111&chts=BCD2EA,12&chtt=Total+NY+Fight+XP+Gained+per+Hr+of+Day|Min.+=+' + String(statSpecsArrayA[0]) + '+++Max.+=+' +String(statSpecsArrayA[1]) + '+++Avg+=+' + String(statSpecsArrayA[2]) + '/hr&chs=315x150&chxt=x,y&chxl=0:' + hourLabels + '&chxtc=0,10|1,-300&chxr=1,' + statSpecsArrayA[0] + ',' + statSpecsArrayA[1] + '&chds=' + statSpecsArrayA[0] + ',' + statSpecsArrayA[1] + '&chm=D,92ED97,0,0,4|o,25DA2E,0,-1.0,6&chd=t:' + String(diffArrayA) + '\"/>';\n\t\n\t //NY Fight Wins/Losses since reset chart\n\t var NYfightWinPct = (GM_getValue('fightWinsNY', 0)/(GM_getValue('fightWinsNY', 0) + GM_getValue('fightLossesNY', 0)))*100;\n\t if (isNaN(NYfightWinPct)){NYfightWinPct = 0;} else {NYfightWinPct = Math.round(NYfightWinPct * Math.pow(10, 1))/Math.pow(10, 1);}\n\t var NYfightLosePct = (GM_getValue('fightLossesNY', 0)/(GM_getValue('fightWinsNY', 0) + GM_getValue('fightLossesNY', 0)))*100;\n\t if (isNaN(NYfightLosePct)) {NYfightLosePct = 0; } else {NYfightLosePct = Math.round(NYfightLosePct * Math.pow(10, 1))/Math.pow(10, 1);}\n\t\n\t //NY Fight Loss Type breakdown pie\n\t var NYStrongLossPct = (GM_getValue('fightLossStrongNY', 0)/GM_getValue('fightLossesNY', 0))*100;\n\t if (isNaN(NYStrongLossPct)){NYStrongLossPct = 0;}else{NYStrongLossPct = Math.round(NYStrongLossPct * Math.pow(10, 1))/Math.pow(10, 1);}\n\t var NYCHLossPct = (GM_getValue('fightLossCHNY', 0)/GM_getValue('fightLossesNY', 0))*100;\n\t if (isNaN(NYCHLossPct)){NYCHLossPct = 0;}else{NYCHLossPct = Math.round(NYCHLossPct * Math.pow(10, 1))/Math.pow(10, 1);}\n\t var NYBGCHLossPct = (GM_getValue('fightLossBGCHNY', 0)/GM_getValue('fightLossesNY', 0))*100;\n\t if (isNaN(NYBGCHLossPct)){NYBGCHLossPct = 0;}else{NYBGCHLossPct = Math.round(NYBGCHLossPct * Math.pow(10, 1))/Math.pow(10, 1);}\n\t\n\t graphOutput += '<br><br>' + '<IMG SRC=\"' + 'http://chart.apis.google.com/chart?cht=p3&chf=bg,s,111111&chts=BCD2EA,12&chco=52E259|EC2D2D&chdl=' + String(NYfightWinPct) + '%|'+ String(NYfightLosePct) + '%&chdlp=t&chtt=NY+Fight+Wins+vs+Losses|since+stats+reset&chs=157x150&chd=t:' + String(NYfightWinPct) + ',' + String(NYfightLosePct) + '\"/>' +\n\t '<IMG SRC=\"' + 'http://chart.apis.google.com/chart?cht=p3&chf=bg,s,111111&chts=BCD2EA,12&chco=EC2D2D&chdl=CH:' + String(NYCHLossPct) + '%|BG:'+ String(NYBGCHLossPct) + '%|TS:'+ String(NYStrongLossPct) + '%&chdlp=t&chtt=NY+Fight+Losses+by+Type&chs=157x150&chd=t:' + String(NYCHLossPct) + ',' + String(NYBGCHLossPct) + ',' + String(NYStrongLossPct) + '\"/><br>' +\n\t '<span style=\"color:#888888;\">CH = Critical Hit &#166; BG = Bodyguard Critical Hit &#166; TS = Too Strong</span>';\n\t\n\t //NY Fight $ Won/lost line graph\n\t statSpecsArrayA = getStatSpecs(fightWin$NY, 0);\n\t statSpecsArrayB = getStatSpecs(fightLoss$NY, 0);\n\t if (statSpecsArrayB[0]*1 < statSpecsArrayA[0]*1) {\n\t statSpecsArrayA[0] = statSpecsArrayB[0];\n\t }\n\t if (statSpecsArrayB[1]*1 > statSpecsArrayA[1]*1) {\n\t statSpecsArrayA[1] = statSpecsArrayB[1];\n\t }\n\t graphOutput += '<br><br>' + '<IMG SRC=\"' + 'http://chart.apis.google.com/chart?cht=ls&chf=bg,s,111111&chts=BCD2EA,12&chtt=Total+NY+Fight+$+Won+vs.+Lost+by+Hr+of+Day&chs=315x150&chxt=x,y&chxl=0:' + hourLabels + '&chxtc=0,10|1,-300&chxr=1,' + statSpecsArrayA[0] + ',' + statSpecsArrayA[1] + '&chds=' + statSpecsArrayA[0] + ',' + statSpecsArrayA[1] + '&chm=D,92ED97,0,0,4|o,25DA2E,0,-1.0,6|D,F05C5C,1,0,4|o,D21414,1,-1.0,6&chd=t:' + String(fightWin$NY) + '|' + String(fightLoss$NY) + '\"/>';\n\t\n\t //addToLog('info Icon', graphOutput);\n\t graphOutput = '<span style=\"color:#669999;\">Stats as of: ' + currentTime.toLocaleString() + '</span><br>' + graphOutput;\n\t GM_setValue('graphBox', graphOutput);\n\t\n\t //re-pack hourly stats and save to GM variable\n\t hrDataPack = [];\n\t for (i = 0; i < 24; i++){\n\t hrDataPack[i]= i + '|' + hourlyFightExpNY[i] + '|' + hourlyFightWinsNY[i] + '|' + hourlyFightLossesNY[i] + '|' +\n\t hourlyFightWin$NY[i] + '|' + hourlyFightLoss$NY[i] + '|' + hourlyLossCrHitNY[i] + '|' + hourlyLossBgCrHitNY[i] +\n\t '|' + hourlyLossStrongNY[i];\n\t }\n\t GM_setValue('hourlyStats', String(hrDataPack));\n\t\n\t }\n\t GM_setValue('hourOfDay', String(currentHour));\n\t}", "title": "" }, { "docid": "6813cc20fb709279646ca3536bc1ec0f", "score": "0.57452786", "text": "function startTimeCheckInterval() {\n setInterval(() => {\n udpateBlockColors(currentHour)\n currentHour = parseInt(moment().hour())\n }, 60000)\n}", "title": "" }, { "docid": "9a6fb5482e42cffc3297fb5603c0c1e5", "score": "0.57419467", "text": "function updateHour() {\n //current hour\n var currentHour = moment().hours();\n //loop over each time block\n $(\".time-block\").each(function() {\n var hourBlock = parseInt($(this).attr(\"id\"))\n \n //if hour is past\n if(hourBlock < currentHour){\n $(this).addClass(\"past\")\n }\n //if hour is current\n else if(hourBlock === currentHour) {\n $(this).addClass(\"present\")\n }\n //if hour is future\n else {\n $(this).addClass(\"future\")\n }\n });\n}", "title": "" }, { "docid": "11388ddaf13a1787165dfaaa64f15e3b", "score": "0.570041", "text": "function updateHour() {\n var currentHour = moment().hours();\n $(\".time-block\").each(function() {\n let hour = parseInt($(this).attr('id'));\n if (hour < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).removeClass(\"future\");\n } else if (hour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n } else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n}", "title": "" }, { "docid": "de5dd0b5ffc711747295298be46886cc", "score": "0.56974083", "text": "function updateTime() {\n\t\tvar strHours = document.getElementById(\"str-hours\"),\n\t\tstrMinutes = document.getElementById(\"str-minutes\"), \n\t\tdatetime = tizen.time.getCurrentDateTime(), \n\t\thour = datetime.getHours(), \n\t\tminute = datetime.getMinutes();\n\n\t\tstrHours.innerHTML = hour;\n\t\tstrMinutes.innerHTML = minute;\n\n\t\tif (hour < 10) {\n\t\t\tstrHours.innerHTML = \"0\" + hour;\n\t\t}\n\t\tif (minute < 10) {\n\t\t\tstrMinutes.innerHTML = \"0\" + minute;\n\t\t}\n\t}", "title": "" }, { "docid": "7822a66033a68d90113d9b74938694da", "score": "0.56918514", "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": "212b2d95598a3e264f1daadcad980ffd", "score": "0.56724995", "text": "function updateCalendar() {\n updateEachBlock(block8am, 8)\n updateEachBlock(block9am, 9)\n updateEachBlock(block10am, 10)\n updateEachBlock(block11am, 11)\n updateEachBlock(block12pm, 12)\n updateEachBlock(block1pm, 13)\n updateEachBlock(block2pm, 14)\n updateEachBlock(block3pm, 15)\n updateEachBlock(block4pm, 16)\n updateEachBlock(block5pm, 17)\n }", "title": "" }, { "docid": "4001045da05bf679ce44e17e889bb95a", "score": "0.56703615", "text": "function updateEachBlock(hourBlock, theHour) {\n\n if (theHour > currentHour) {\n hourBlock.removeClass(\"past\")\n hourBlock.removeClass(\"present\")\n hourBlock.addClass(\"future\")\n }\n else if (theHour < currentHour) {\n hourBlock.addClass(\"past\")\n hourBlock.removeClass(\"present\")\n hourBlock.removeClass(\"future\")\n }\n else {\n hourBlock.removeClass(\"past\")\n hourBlock.addClass(\"present\")\n hourBlock.removeClass(\"future\")\n }\n }", "title": "" }, { "docid": "7e44bd661941d05e739d663e7d9c31b5", "score": "0.5655572", "text": "function updateTime() {\n let date = new Date()\n let hour = date.getHours()\n let minutes = date.getMinutes()\n let seconds = date.getSeconds()\n\n if (hour === 0 && minutes === 0) getToday()\n\n if (hour < 10)\n hour = \"0\" + hour\n if (minutes < 10)\n minutes = \"0\" + minutes\n if (seconds < 10)\n seconds = \"0\" + seconds\n\n let time = hour + \":\" + minutes\n $(\"#hour\").html(time)\n $(\"#seconds\").html(seconds)\n awake(time)\n\n}", "title": "" }, { "docid": "edb36c57099e9bccce98991f33e7333d", "score": "0.5646551", "text": "_updateDriveTime(){\t\t\n\t\tthis.state.time += UPDATE_TIME / 1000 / 3600;\n\t}", "title": "" }, { "docid": "2c974d1b73cea85b671cf291fd38f1a0", "score": "0.5627589", "text": "updateTime(hour, minute){\n let timeOfDay = 'AM';\n if (minute >= 60){\n minute = 0;\n hour ++;\n }\n\n if (hour > 12){\n timeOfDay = 'PM';\n hour = hour - 12;\n }\n if( hour < 10 && minute < 10){\n this.time.textContent = `0${hour} : 0${minute} ${timeOfDay}`;\n } else if (hour < 10){\n this.time.textContent = `0${hour} : ${minute} ${timeOfDay}`;\n } else if (minute < 10){\n this.time.textContent = `${hour} : 0${minute} ${timeOfDay}`;\n } else {\n this.time.textContent = `${hour} : ${minute} ${timeOfDay}`;\n }\n minute ++;\n\n //To count 60 seconds before recurring\n setTimeout(() => {\n this.updateTime(hour, minute);\n }, 60000)\n\n }", "title": "" }, { "docid": "2c559d88f34dcbeb5301bf189278e38a", "score": "0.56241125", "text": "function updateTotalTime(timeentries) {\n\t\t\t\tvm.totalTime = time.getTotalTime(timeentries);\n\t\t\t}", "title": "" }, { "docid": "ddb44846d7fd7a6a990d01e2382ac525", "score": "0.56230223", "text": "updateMe(e){\n\n\t\t\t\t//Convert ms format to readable format\n\t\t\t\t///https://stackoverflow.com/questions/18623783/get-the-time-difference-between-two-datetimes\n\t\t\t\tfunction convertToReadableFormat(start, end){\n\t\t\t\t\t\tvar ms = moment(end).diff(moment(start));\n\t\t\t\t\t\tvar d = moment.duration(ms);\n\t\t\t\t\t\treturn Math.floor(d.asHours()) + moment.utc(ms).format(\":mm:ss\");\n\t\t\t\t}\n\n\t\t\t\t//Check whether the data is outdated. Conditions are\n\t\t\t\t//lastTick is not set\n\t\t\t\t//timestamp of the message is earlier than the timestamp of the first update (show history)\n\t\t\t\t//timestamp of the message is after the timestamp of the end of the first pass\n\t\t\t\tif(this.lastPassEnded == null || e.detail.timestamp < this.lastUpdate || e.detail.timestamp > this.lastPassEnded){\n\t\t\t\t\t\tthis.lastPassEnded = null;\n\t\t\t\t\t\t//Update each trackedObject\n\t\t\t\t\t\tthis.trackedObjects.forEach(function(obj){\n\t\t\t\t\t\t\t\t\t//Find passes\n\t\t\t\t\t\t\t\t\tthis.AOS[obj.name] = obj.getNextAOS(this.NNextPasses, this.observer, e.detail.timestamp);\n\n\t\t\t\t\t\t\t\t\t//Update values\n\t\t\t\t\t\t\t\t\tfor(let i=0; i<this.NNextPasses; ++i){\n\t\t\t\t\t\t\t\t\t\t\tthis.rows[obj.name][\"data\"][i][\"AOS\"].innerHTML = moment(this.AOS[obj.name][i].start).format(\"HH:MM:SS\");\n\t\t\t\t\t\t\t\t\t\t\tthis.rows[obj.name][\"data\"][i][\"LOS\"].innerHTML = moment(this.AOS[obj.name][i].end).format(\"HH:MM:SS\");\n\t\t\t\t\t\t\t\t\t\t\tthis.rows[obj.name][\"data\"][i][\"duration\"].innerHTML = convertToReadableFormat(this.AOS[obj.name][i].start, this.AOS[obj.name][i].end);\n\t\t\t\t\t\t\t\t\t\t\tthis.rows[obj.name][\"data\"][i][\"Peak\"].innerHTML = this.AOS[obj.name][i].peak.toFixed(1)+String.fromCharCode(176);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif(this.lastPassEnded < this.AOS[obj.name][0].end || this.lastPassEnded==null){\n\t\t\t\t\t\t\t\t\t\t\tthis.lastPassEnded = this.AOS[obj.name][0].end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}.bind(this));\n\t\t\t\t\t\tthis.lastUpdate = e.detail.timestamp;\n\t\t\t\t}\n\n\t\t\t\t//Update values shown in the table\n\t\t\t\t//These values need to be update every \"tick\" because it shows ETA to\n\t\t\t\t//of the next pass\n\t\t\t\tthis.trackedObjects.forEach(function(obj){\n\t\t\t\t\t\tfor(let i=0; i<this.NNextPasses; ++i){\n\t\t\t\t\t\t\t\tthis.rows[obj.name][\"data\"][i][\"AOS in\"].innerHTML = convertToReadableFormat(e.detail.timestamp,this.AOS[obj.name][i].start)+String.fromCharCode(176);\n\t\t\t\t\t\t}\n\t\t\t\t}.bind(this));\n\n\t\t}", "title": "" }, { "docid": "abcc9cf2fc2836d4aab079ea685ec787", "score": "0.5619881", "text": "function updateTime() {\r\n clearThis(40, 180, 280, 100);\r\n var t = createTime();//Just a temp string so i can test the time.\r\n //This keeps the time central when it has more or less digits, i.e 9:00am and 10:00am.\r\n if (t.charAt(1) === ':') {\r\n writeSomethingColour(t, 55, 250, 44, '#FFFFFF');//1 hour digit\r\n } else {\r\n writeSomethingColour(t, 40, 250, 44, '#FFFFFF');//2 hour digits\r\n }\r\n}", "title": "" }, { "docid": "d52fd425ac83e82c0723fd126678308c", "score": "0.5619254", "text": "function hourUpdater(){\n var currentHour = moment().hours();\n // used the moment.js data library in conjunction with the hours function\n $(\".time-block\").each(function(){\n var blockHour = parseInt($(this).attr(\"id\").split(\" \")[0]);\n // The parseInt() function parses a string and returns an integer.\n\n // create an if/else comparison to execute the css colors for past, present, and future\n // \n if (blockHour < currentHour){\n $(this).addClass(\"past\");\n } else if (blockHour === currentHour){\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n } else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).removeClass(\"future\");\n\n\n } \n });\n\n}", "title": "" }, { "docid": "aa44398d51e41a5fdd228d3fd73e3e86", "score": "0.56182444", "text": "updateTime(x)\n {\n this.timePeriod = x;\n this.updateCosts();\n }", "title": "" }, { "docid": "75850e4b49e70a5668f98e6b776da4a4", "score": "0.55947113", "text": "function loopTime() {\n currentTime = moment().get('hour');\n setInterval(() => {\n loopTime()\n }, 20000);\n \n\n timeColor = hour.Time\n hourMoment = moment().get('hour');\n if (timeColor === currentTime) {\n hourEL.classList.add(\"time-block-present\");\n }\n if (timeColor > currentTime) {\n hourEL.classList.add(\"time-block-future\");\n }\n }", "title": "" }, { "docid": "dd9c4c0b378aa7cb79e854b33b98112f", "score": "0.55777663", "text": "function updateClock(releaseUrl) {\n const t = getTimeRemaining(endtime);\n\n // let inputTimezoneValue = 0;\n\n daysSpan.innerHTML = t.days;\n hoursSpan.innerHTML = (\"0\" + (t.hours + inputTimezoneValue)).slice(-2);\n minutesSpan.innerHTML = (\"0\" + t.minutes).slice(-2);\n secondsSpan.innerHTML = (\"0\" + t.seconds).slice(-2);\n console.log(inputTimezoneValue);\n\n if (t.total <= 0) {\n location.assign(releaseUrl);\n }\n }", "title": "" }, { "docid": "9a8ea3e3bbe4d0ffd712e1dced5a3f4a", "score": "0.5576796", "text": "function updateTimeBlocks() {\n for (var i = 1; i <= 24; i++) {\n //default remove all\n $(`#input-${i}`).removeClass(\"past present future\");\n\n if (i < currentHour) {\n $(`#input-${i}`).addClass(\"past\");\n }\n\n $(`#input-${currentHour}`).addClass(\"present\");\n\n if (i > currentHour) {\n $(`#input-${i}`).addClass(\"future\");\n }\n }\n}", "title": "" }, { "docid": "05284d75025e55acce5f5ca0a563bac5", "score": "0.5575545", "text": "function updateColors() {\n var currentTime = moment().format(\"HH\");\n console.log(\"currentTime: \", currentTime);\n // console.log(localStorage.getItem);\n var hour = $('.textcolor');\n for (var i = 8; i < 17; i++) {\n if (i < currentTime) {\n hour.addClass(\"past\");\n } else if (i === currentTime) {\n hour.addClass(\"present\");\n } else {\n hour.addClass(\"future\");\n }\n }\n}", "title": "" }, { "docid": "4b2e119617762ebc406b4175410761cd", "score": "0.5570121", "text": "function main(){\n\t\tnow = timestamp();\n\t\tdt = now - last;\n\n\t\tupdate(dt);\n\t\tlast = now;\n\t}", "title": "" }, { "docid": "8edb17d1aae2e00d56b8e6083c2d6623", "score": "0.55513966", "text": "function hourTracker() {\n \n // using moment.js to determine the current hour\n var now = moment().hour(); \n\n // loop over time blocks\n $(\".time-blocks\").each(function () {\n var blockTime = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n console.log( blockTime, now)\n\n //check the current hour time, and add class to past, present, future accordingly\n if (blockTime < now) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n }\n else if (blockTime === now) {\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": "9484c25ffb52afd79099284d844845a4", "score": "0.5544388", "text": "function updateTime(){\n\tvar currentTime = new Date()\n\n\tvar hour = pad( currentTime.getHours(), 2);\n\tvar minutes = pad( currentTime.getMinutes(), 2);\n\n\tvar hour_1 = hour.substr(0,1);\n\tvar hour_2 = hour.substr(1,2);\n\n\tvar minute_1 = minutes.substr(0,1);\n\tvar minute_2 = minutes.substr(1,2);\n\n\tcolorLeds(hour_1, 0);\n\tcolorLeds(hour_2, 1);\n\tcolorLeds(minute_1, 2);\n\tcolorLeds(minute_2, 3);\n}", "title": "" }, { "docid": "77411d9d94c8ad601869ca91378db30b", "score": "0.5533825", "text": "function updateTime() {\n var date = new Date()\n\n if (lastDate && date.getMinutes() == lastDate.getMinutes()) {\n return\n }\n\n // see groupsForTimeElement(element) for details about the offset value\n var components = [\n { value: Math.floor(date.getHours() / 10), offset: 0 },\n { value: date.getHours() % 10, offset: 3 },\n { value: ':', offset: 13 },\n { value: Math.floor(date.getMinutes() / 10), offset: 14 },\n { value: date.getMinutes() % 10, offset: 20 }\n ]\n\n for (var i = components.length - 1; i >= 0; i--) {\n var value = (isNaN(components[i].value) ? 0 : components[i].value) + components[i].offset\n var index = value + groupRanges.time.start\n renderer.addImpulse(new Impulse(), index)\n }\n\n lastDate = date\n }", "title": "" }, { "docid": "78d0ed6215eabd6e7ed36af1f4dcc6f1", "score": "0.55267966", "text": "function updateTimeBlock() {\n\n for (i = 9; i <= 17; i++) {\n\n setColorStatus(i);\n\n if ($(\"#hour-\" + i).hasClass(\"past\")) {\n $(\"#hour-\" + i).removeClass(\"past\");\n $(\"#hour-\" + i).addClass(colorStatus);\n } else if ($(\"#hour-\" + i).hasClass(\"present\")) {\n $(\"#hour-\" + i).removeClass(\"present\");\n $(\"#hour-\" + i).addClass(colorStatus);\n } else if ($(\"#hour-\" + i).hasClass(\"future\")) {\n $(\"#hour-\" + i).removeClass(\"future\");\n $(\"#hour-\" + i).addClass(colorStatus);\n\n }\n }\n}", "title": "" }, { "docid": "38c6dfc79062303d552ac745be57b77c", "score": "0.5519319", "text": "function incrementTime() {\n sTenths += 1\n}", "title": "" }, { "docid": "3b729985544677c67c804a926a6eedc0", "score": "0.55186605", "text": "function incTimes() {\n\t\n\tvar privateBrowsing = require(\"private-browsing\");\n var now = new Date();\n var month = now.getMonth() + 1;\n var day = now.getDate();\n var year = now.getFullYear();\n var date = day.toString() + \".\"\n\t+ month.toString() + \".\" \n\t+ year;\n\n var domain = getDomainName(currentTab);\n if(domain && privateBrowsing.isActive == false) {\n\tif(!store[date]) {\n\t store[date] = {}\n\t}\n\tif(!store[date][domain]) {\n\t store[date][domain] = 0;\n\t}\n\t\n\tstore[date][domain]++;\n }\n\n}", "title": "" }, { "docid": "33747d2811ef16e4432553f465b3d44c", "score": "0.5512713", "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": "16dec85df4b95a4c7a36f6ef78edda49", "score": "0.5507971", "text": "update()\n {\n this.render();\n this.changeLevel();\n this.timeInvincible = millis() - this.startEatableMillis;\n }", "title": "" }, { "docid": "7944a6d658f95956613d157638f259c0", "score": "0.5498608", "text": "function updateHour(hour) {\n\n if (hour > 12) {\n return hour - 12;\n }\n else if(hour == 0) {\n return 12;\n }\n}", "title": "" }, { "docid": "1f219e188af690fef514314bc97b7719", "score": "0.5496725", "text": "function hourUpdate() {\n var currentDay = moment().hours();\n\n//Sets hour blocks equal to an integer\n var hour9 = $(\".description9am\");\n hour9 = 9;\n var hour10 = $(\".description10am\");\n hour10 = 10;\n var hour11 = $(\".description11am\");\n hour11 = 11;\n var hour12 = $(\".description12pm\");\n hour12 = 12;\n var hour13 = $(\".description1pm\");\n hour13 = 13;\n var hour14 = $(\".description2pm\");\n hour14 = 14;\n var hour15 = $(\".description3pm\");\n hour15 = 15;\n var hour16 = $(\".description4pm\");\n hour16 = 16;\n var hour17 = $(\".description5pm\");\n hour17 = 17;\n \n//If, else statements for the past, present, future\n if (hour9 < currentDay) {\n $(\".description9am\").addClass(\"past\");\n } else if (hour9 > currentDay) {\n $(\".description9am\").addClass(\"future\");\n } else {\n $(\".description9am\").addClass(\"present\");\n }\n\n if (hour10 < currentDay) {\n $(\".description10am\").addClass(\"past\");\n } else if (hour10 > currentDay) {\n $(\".description10am\").addClass(\"future\");\n } else {\n $(\".description10am\").addClass(\"present\");\n }\n\n if (hour11 < currentDay) {\n $(\".description11am\").addClass(\"past\");\n } else if (hour11 > currentDay) {\n $(\".description11am\").addClass(\"future\");\n } else {\n $(\".description11am\").addClass(\"present\");\n }\n \n if (hour12 < currentDay) {\n $(\".description12pm\").addClass(\"past\");\n } else if (hour12 > currentDay) {\n $(\".description12pm\").addClass(\"future\");\n } else {\n $(\".description12pm\").addClass(\"present\");\n }\n\n if (hour13 < currentDay) {\n $(\".description1pm\").addClass(\"past\");\n } else if (hour13 > currentDay) {\n $(\".description1pm\").addClass(\"future\");\n } else {\n $(\".description1pm\").addClass(\"present\");\n }\n\n if (hour14 < currentDay) {\n $(\".description2pm\").addClass(\"past\");\n } else if (hour14 > currentDay) {\n $(\".description2pm\").addClass(\"future\");\n } else {\n $(\".description2pm\").addClass(\"present\");\n }\n\n if (hour15 < currentDay) {\n $(\".description3pm\").addClass(\"past\");\n } else if (hour15 > currentDay) {\n $(\".description3pm\").addClass(\"future\");\n } else {\n $(\".description3pm\").addClass(\"present\");\n }\n\n if (hour16 < currentDay) {\n $(\".description4pm\").addClass(\"past\");\n } else if (hour16 > currentDay) {\n $(\".description4pm\").addClass(\"future\");\n } else {\n $(\".description4pm\").addClass(\"present\");\n }\n\n if (hour17 < currentDay) {\n $(\".description5pm\").addClass(\"past\");\n } else if (hour17 > currentDay) {\n $(\".description5pm\").addClass(\"future\");\n } else {\n $(\".description5pm\").addClass(\"present\");\n }\n}", "title": "" }, { "docid": "836254463ab5ebfc1884834d5c5a8cc5", "score": "0.5496615", "text": "function updateTimeChart(eligibleEntries) {\n\n\t// Update the time chart\n\tvar yearStats = {};\n\t$.each(eligibleEntries, function(i,d){\n\t\tif (!yearStats[d.year])\n\t\t\tyearStats[d.year] = 0;\n\n\t\tyearStats[d.year] += 1;\n\t});\n\n\t$.each(timeChartData, function(i, d){\n\t\tif (d.gap)\n\t\t\treturn;\n\n\t\td.current = yearStats[d.year] || 0;\n\t});\n\n\ttimeChartSvg.selectAll(\"g.time-chart-entry.not-gap\")\n\t.each(function(d, i){\n\t\tif (d.gap)\n\t\t\treturn;\n\n\t\tvar group = d3.select(this);\n\n\t\tgroup.select(\".time-chart-current\")\n\t\t\t.transition()\n\t\t\t\t.attr(\"y\", timeChartHeight - timeChartYScale(d.current))\n\t\t\t\t.attr(\"height\", timeChartYScale(d.current));\n\n\t\tgroup.attr(\"title\", getTimeChartEntryDescription(d));\n\t\t// Force Bootstrap tooltip update\n\t\tgroup.attr(\"data-original-title\", getTimeChartEntryDescription(d));\n\t});\n}", "title": "" }, { "docid": "b40265518c104c852747ff3124bb77bc", "score": "0.54946613", "text": "function colorUpdator() {\n var currentHour = moment().hours();\n console.log(currentHour);\n $(\".time-block\").each( function() {\n var blockHour = parseInt($(this).attr(\"id\"));\n if (blockHour < currentHour) {\n $(this).addClass(\"past\")\n }\n else if (blockHour === currentHour) {\n $(this).addClass(\"present\")\n }\n else {\n $(this).addClass(\"future\")\n }\n })\n }", "title": "" }, { "docid": "998f31d60bbc972e34bd43fe40ee605c", "score": "0.54936975", "text": "function update(){\n\t\tvar now = new Date().getTime(),\n\t\t\tdt= now - lastupdatetime;\n\n\t\tcurrentTimer += dt;\n\n\t\tvar time = new Date(currentTimer);\n\n\t\tmins.innerHTML=pad(time.getMinutes());\n\t\tsecs.innerHTML=pad(time.getSeconds());\n\t\tcents.innerHTML=pad(Math.floor(time.getMilliseconds()/ 10));\n\n\t\tlastupdatetime=now;\n\t}", "title": "" }, { "docid": "65b76945863151beb36360bfbccb199f", "score": "0.54912865", "text": "function main() { \n\n\n _init();\n // XXX create slope for each day by calling init_hourly again and again\n init_hourly();\n console.log(memo);\n console.log(hourly_avg);\n /*\n console.log( 'GOT domains? ' + domain_list.length );\n console.log( 'GOT agents? ' + agent_list.length );\n console.log(hourly_avg.length);\n console.log(hourly_avg);\n console.log(memo);\n */\n\n var tick = m.t_init;\n\n while(tick < m.t_end ) {\n do_hour(tick);\n tick+= 3600;\n }\n\n meta.actual_pv_day = meta.events / memo.days;\n\n\n console.log(meta);\n\n}", "title": "" }, { "docid": "da095ad8f75778219ba1fde06f862f05", "score": "0.54892105", "text": "function midnightUpdate() {\n\tcurrentWeekDay = new Date().getDay()\n\tevaluateAllTabs()\n}", "title": "" }, { "docid": "93b77210db54c3ff06008e4e0ac4b8a3", "score": "0.5477139", "text": "function update() {\t\n nowTime = new Date().getTime();\n deltaTime = (nowTime - zeroTime) / 1000.0;\n\n\twhile (deltaTime > (t_exp + (period/2.))) {\n\t\tt_exp += period\n\t}\n phi = (((deltaTime - t_exp) / period) + 1) % 1.;\n\n\tif (note_counter > 0) {\n\t\tupdate_large(phi);\n\t\tnote_counter = 0;\n\t}\n\t\t\n\toutlet(1, phi);\n\toutlet(0, period);\n}", "title": "" }, { "docid": "aaf10a5e7b7fe6065324e40471d56e06", "score": "0.54746526", "text": "hourCapeTown() {\n this.cape_hour = document.querySelector('.cape-hour .hour')\n this.d = new Date();\n this.utc = this.d.getTime() + (this.d.getTimezoneOffset() * 60000);\n this.nd = new Date(this.utc + (3600000 * (2)));\n\n $(this.cape_hour).text(this.nd.toLocaleTimeString([], {\n hourCycle: 'h23',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n }))\n }", "title": "" }, { "docid": "276a3ed6a3d4fa51c89cb61c205e7161", "score": "0.54712", "text": "async function processUpdateTime() {\n const nowTime = Date.now();\n let today = new Date(); //이거 왜 한국시간이 아닌것 ㅡㅡ\n\t\n for (var id in serviceRegisteredUser) {\n var user = serviceRegisteredUser[id];\n var nextUpdateTime = user.NextUpdateTime;\n\n //time not requested by user\n if (\n (user.startTime < user.endTime &&\n ((today.getHours() + 9) % 24 < user.startTime ||\n (today.getHours() + 9) % 24 >= user.endTime))\n\t\t\t||\n\t\t\t(user.startTime > user.endTime &&\n (today.getHours() + 9) % 24 >= user.endTime &&\n (today.getHours() + 9) % 24 < user.startTime)\n ){\n\t\t\t//거북이 퇴근 알림\n\t\t\tif (\n\t\t\t\t(today.getHours() + 9) % 24 >= user.endTime &&\n\t\t\t\tuser.working == 1 &&\n\t\t\t\tuser.startTime != user.endTime\n\t\t\t) {\n\t\t\t\tuser.working = 0;\n\t\t\t\t//open conversation\n\t\t\t\tconst conversation = await libKakaoWork.openConversations({ userId: id });\n\t\t\t\tvar messageBlock = customModals.workEndAlarmModal.blocks;\n\t\t\t\tawait libKakaoWork.sendMessage({\n\t\t\t\t\tconversationId: conversation.id,\n\t\t\t\t\ttext: '거북씨 퇴근 보고',\n\t\t\t\t\tblocks: messageBlock,\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n //거북이 출근 알림\n if ((today.getHours() + 9) % 24 >= user.startTime && user.working == 0) {\n user.working = 1;\n\t\t\t\n //open conversation\n const conversation = await libKakaoWork.openConversations({ userId: id });\n var messageBlock = customModals.workStartAlarmModal.blocks;\n await libKakaoWork.sendMessage({\n conversationId: conversation.id,\n text: '거북씨 출근 보고',\n blocks: messageBlock,\n });\n }\n \n\n if (nowTime >= nextUpdateTime) {\n //update next time\n await updateNextTime(user);\n\n //open conversation\n const conversation = await libKakaoWork.openConversations({ userId: id });\n\n //send message (25% -> url, 75% -> normal)\n if (randomInt(1, 100) <= 25) {\n var urlBlocks = customModals.messageURLServiceModal.blocks;\n\t\t\t\tvar index = randomInt(1, stretchingURLList.length) - 1;\n\t\t\t\t\n urlBlocks[1].text = stretchingURLList[index];\n\t\t\t\turlBlocks[2].url = stretchingThumbnailList[index];\n\n await libKakaoWork.sendMessage({\n conversationId: conversation.id,\n text: '스트레칭 타임!',\n blocks: urlBlocks,\n });\n } else {\n\t\t\t\tvar messageBlock = customModals.messageServiceModal.blocks;\n\t\t\t\tvar messageList = messageServiceModalMap[user.level];\n\t\t\t\t\n\t\t\t\tmessageBlock[0].text = messageList[randomInt(1, messageList.length) - 1];\n\t\t\t\t\n await libKakaoWork.sendMessage({\n conversationId: conversation.id,\n text: '목펴랏!',\n blocks: messageBlock,\n });\n }\n }\n }\n}", "title": "" }, { "docid": "ecaf011ea0e8485a99ddefe973a36ef1", "score": "0.54704064", "text": "function updateBackgrounds(hour, previousHour, bgrounds) {\n\t\t\t\t\t\tif (!utilities.isUndefinedOrNull(hour)) {\n\t\t\t\t\t\t\t// Translate all of the things.\n\t\t\t\t\t\t\t// Current location is left, right or center\n\t\t\t\t\t\t\tangular.forEach(bgrounds, function(background, currentLocation) {\n\t\t\t\t\t\t\t\tvar width = background.imageWidth;\n\t\t\t\t\t\t\t\tvar widthPerHour = width / 24;\n\n\t\t\t\t\t\t\t\t// Initial offset to line it up correctly.\n\t\t\t\t\t\t\t\tvar xOffset = -(hour) * widthPerHour;\n\n\t\t\t\t\t\t\t\tbackground\n\t\t\t\t\t\t\t\t\t.transition(250)\n\t\t\t\t\t\t\t\t\t.ease('linear')\n\t\t\t\t\t\t\t\t\t.attr(\"transform\", \"translate(\" + xOffset + \",0)\");\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "title": "" }, { "docid": "f2e4b39c899bf38ced79e15ec7728900", "score": "0.5461472", "text": "function updateHours() {\r\n var totalHours = document.getElementById(\"total-hours\");\r\n totalHours.textContent = \"Total Hours: \" + (selectedCells * cellMinutes / 60);\r\n}", "title": "" }, { "docid": "d423375aa9b739f501dffe18070cdd7d", "score": "0.54602724", "text": "function updateTime(){\r\n \r\n seconds++;\r\n\r\n if (seconds === 59) {\r\n seconds = 0;\r\n minutes++;\r\n\r\n if (minutes === 59) {\r\n minutes = 0;\r\n hours++;\r\n }\r\n }\r\n\r\n if(seconds < 10){\r\n displaySeconds = \"0\" + seconds.toLocaleString();\r\n }else{\r\n displaySeconds = seconds;\r\n }\r\n\r\n if(minutes < 10){\r\n displayMinutes = \"0\" + minutes.toLocaleString();\r\n }else{\r\n displayMinutes = minutes;\r\n }\r\n\r\n if(hours < 10){\r\n displayHours = \"0\" + hours.toLocaleString();\r\n }else{\r\n displayHours = hours;\r\n }\r\n\r\n\r\n document.querySelector(\"#display\").innerHTML = displayHours + \":\" + displayMinutes + \":\" + displaySeconds;\r\n \r\n}", "title": "" }, { "docid": "a6d00843ebc513637a8da33769165560", "score": "0.54602313", "text": "function updateClock() {\n let today = new Date();\n let hours = today.getHours();\n let mins = util.zeroPad(today.getMinutes());\n\n timeLabel.text = `${hours}:${mins}`;\n}", "title": "" }, { "docid": "4e516e88b7a7f3f80a7e7e291b141b5a", "score": "0.5457271", "text": "function updateTimes() {\n $(\".trainEntry\").each(function () {\n var dbStartTime = $(this).children(\".nextTrainTime\").attr(\"data-start\");\n var localfreq = Number($(this).children(\".freq\").text());\n var minutesSinceFirstRun = moment().diff(moment.utc(dbStartTime, \"HH:mm\"), \"minutes\");\n var minutesTilNextTrain = localfreq - minutesSinceFirstRun % localfreq;\n var nextTrain = moment().add(minutesTilNextTrain, \"minutes\").format(\"hh:mm a ZZ\");\n console.log(dbStartTime, localfreq, minutesSinceFirstRun, minutesTilNextTrain, nextTrain);\n $(this).children(\".nextTrainTime\").text(nextTrain);\n $(this).children(\".minTilNextTrain\").text(minutesTilNextTrain);\n });\n }", "title": "" }, { "docid": "2c2ccefbfd49936512ddad1648af4222", "score": "0.5442376", "text": "function timeUpdater() {\n dataRef.ref().child('trains').once('value', function (snapshot) {\n snapshot.forEach(function (childSnapshot) {\n fbTime = moment().format('X');\n dataRef.ref('trains/' + childSnapshot.key).update({\n currentTime: fbTime,\n })\n })\n });\n }", "title": "" }, { "docid": "4641b9cdc198b900ba6bfdd30c368c11", "score": "0.5441846", "text": "function do_TimeManager_Update()\r\n{\r\n\tg_TimeManager.Update();\r\n}", "title": "" }, { "docid": "b17fe78cd4e29bc10d9407e237e79540", "score": "0.54404193", "text": "function workFestivals() {\n ankhs += 100 * festivals;\n update();\n}", "title": "" }, { "docid": "d3457038894ddb47cb9d44b879887a83", "score": "0.5437563", "text": "function update() {\n // Stores the dayType\n var type = dayType();\n // Debug ***\n // console.log(type);\n // Checks for special days\n if (type === 1) {\n specialSchedule();\n } else if (type === 2) {\n noClassSat();\n } else if (type === 3) {\n noClasses();\n } else if (type === 4) {\n holiday();\n } else if (type === 5) {\n schoolBreak();\n } else if (type === 0) {\n // console.log(\" *** Is normal day\");\n // Gets today's schedule\n var currentSchedule = getSchedule();\n // console.log(\" *** currentSchedule \" + currentSchedule.length);\n\n // Checks which Period it currently is\n for (i = 0; i < currentSchedule.length; i++) {\n // console.log(\" *** for i \" + i);\n // console.log(\" *** parseRaw \" + parseRaw());\n\n if (parseRaw() < currentSchedule[0].startRaw) {\n beforeSchool(currentSchedule[0].title, currentSchedule[0].startRaw - parseRaw());\n }\n\n if (currentSchedule[i].startRaw < parseRaw() && parseRaw() < currentSchedule[i].endRaw) {\n // console.log(\" *** currentSchedule[i].startRaw \" + currentSchedule[i].startRaw);\n if (currentSchedule[i].title === \"Passing Period\") {\n normalDay(currentSchedule[i].title, currentSchedule[i].endRaw - parseRaw(), currentSchedule[i + 1].title, currentSchedule[i + 1].startRaw - parseRaw());\n } else {\n normalDay(currentSchedule[i].title, currentSchedule[i].endRaw - parseRaw(), currentSchedule[i + 2].title, currentSchedule[i + 2].startRaw - parseRaw());\n }\n }\n if (parseRaw() > currentSchedule[currentSchedule.length - 1].endRaw) {\n showTime = true;\n document.getElementById(\"class-info\").innerHTML = \"\";\n document.getElementById(\"schedule-info\").innerHTML = descText + \"<b> ⋅ Have a nice day!</b>\";\n }\n }\n } else {\n }\n if (showTime) {\n document.getElementById(\"hrs\").style.display = \"block\";\n rawTime = parseRaw();\n document.documentElement.style.setProperty('--timer-hours', \"'\" + toHrs(rawTime).toLocaleString('en-US', {\n minimumIntegerDigits: 2,\n useGrouping: false\n }) + \"'\");\n document.documentElement.style.setProperty('--timer-minutes', \"'\" + toMins(rawTime).toLocaleString('en-US', {\n minimumIntegerDigits: 2,\n useGrouping: false\n }) + \"'\");\n document.documentElement.style.setProperty('--timer-seconds', \"'\" + toSecs(rawTime).toLocaleString('en-US', {\n minimumIntegerDigits: 2,\n useGrouping: false\n }) + \"'\");\n }\n\n // Code to change the Document Title, disabled for now.\n // document.title = \"Hotchkiss Clock ⋅ \" + toHrs(rawTime).toLocaleString('en-US', {\n // minimumIntegerDigits: 2,\n // useGrouping: false\n // }) + \":\" + toMins(rawTime).toLocaleString('en-US', {\n // minimumIntegerDigits: 2,\n // useGrouping: false\n // }) + \":\" + toSecs(rawTime).toLocaleString('en-US', {minimumIntegerDigits: 2, useGrouping: false});\n}", "title": "" }, { "docid": "ceb3f1989f2b192162db9b9a512f4ffa", "score": "0.5430424", "text": "function updateClock() {\n const t = getRemainingTime(endtime);\n days.innerHTML = addZero(t.days);\n hours.innerHTML = addZero(t.hours);\n minutes.innerHTML = addZero(t.minutes);\n seconds.innerHTML = addZero(t.seconds);\n //calls getTimeRemaining then sets time by innerHTML\n\n if (t.total <= 0) {\n clearInterval(Interval);\n }\n }", "title": "" }, { "docid": "c21b1573c1e970ddaba720677850561d", "score": "0.5429048", "text": "async function prayerTime1DayCity(agent) {\n // get city and country from user\n let lowerCity = agent.parameters.city;\n lowerCity = `${lowerCity['street-address']}${lowerCity.city} ${lowerCity.island}${lowerCity['subadmin-area']}${lowerCity['admin-area']}${lowerCity['business-name']}`;\n let city = lowerCity.charAt(0).toUpperCase() + lowerCity.substring(1); // make first letter uppercase for aesthetics\n city = latinize(lowerCity);\n if (lowerCity === ' ') { return agent.add('Sorry, I couldn\\'t find times for this location. Please check spelling or try another location'); }\n const { country } = agent.parameters; // dialogflow automatically uppercases this\n\n let urlTimes = `http://api.aladhan.com/v1/timingsByCity?city=${city}&country=${country}`;\n // &method=8&tune=1,2,3,4,5,6,7,8,9&midnightMode=1&school=1&latitudeAdjustmentMethod=1\n if (psid != null) {\n const snapshot = await admin.database().ref(`users/${psid}`).once('value');\n // if the users details are already in the db\n if (snapshot.exists()) {\n urlTimes += `&method=${snapshot.child('method').val()}`;\n urlTimes += `&tune=${snapshot.child('tuneImsak').val()},${\n snapshot.child('tuneFajr').val()},${\n snapshot.child('tuneSunrise').val()},${\n snapshot.child('tuneDhuhr').val()},${\n snapshot.child('tuneAsr').val()},${\n snapshot.child('tuneMaghrib').val()},0,${ // for sunset\n snapshot.child('tuneIsha').val()},${\n snapshot.child('tuneMidnight').val()}`;\n urlTimes += `&midnightMode=${snapshot.child('midnightMode').val()}`;\n urlTimes += `&school=${snapshot.child('school').val()}`;\n const latMethod = snapshot.child('latitude').val();\n if (latMethod != 0) urlTimes += `&latitideAdjustmentMethod=${snapshot.child('latitude').val()}`;\n agent.add(`Today's prayer times based on your settings`);\n } else {\n agent.add(`Today's prayer times using default settings`);\n axios.get(`https://graph.facebook.com/${psid}?fields=first_name,last_name&access_token=${keys.facebookapi}`)\n .then((result) => {\n firstName = result.data.first_name;\n lastName = result.data.last_name;\n // add details to firebase\n admin.database().ref(`users/${psid}`).set({\n firstName,\n lastName,\n tuneImsak: 0,\n tuneFajr: 0,\n tuneSunrise: 0,\n tuneDhuhr: 0,\n tuneAsr: 0,\n tuneMaghrib: 0,\n tuneIsha: 0,\n tuneMidnight: 0,\n method: 3,\n school: 0,\n midnightMode: 0,\n latitude: 0,\n favouriteCity: 'none',\n favouriteCountry: 'none',\n }); // end db add details\n }); // end axios get\n urlTimes += '&method=3';\n }\n } else {\n agent.add(`Today's prayer times using default settings:`);\n urlTimes += '&method=3';\n }\n console.log(urlTimes);\n // agent.add(`*This bot is currently undergoing testing. Check back soon for its release*`);\n // return; // comment out return axios below to stop api calls to prayer api during testing\n try {\n // use axios to send api get request for todays prayer times\n let result = await axios.get(urlTimes); \n const { timings } = result.data.data;\n let { meta } = await result.data.data; // get coordinates\n const prayertimes = `Imsak: ${timings.Imsak}\\nFajr: ${timings.Fajr}\\nSunrise: ${timings.Sunrise\n }\\nDhuhr: ${timings.Dhuhr}\\nAsr: ${timings.Asr}\\nMaghrib: ${timings.Maghrib\n }\\nIsha: ${timings.Isha}\\nMidnight: ${timings.Midnight}`;\n // use coordinates to get request location using google geocoding api\n var locString = `https://maps.googleapis.com/maps/api/geocode/json?latlng=${meta.latitude},${meta.longitude}&key=${keys.mapsapi}`;\n console.log(locString);\n let result1 = await axios.get(locString);\n var address = result1.data.results[0][\"address_components\"];\n var suburb, state, postcode, countrycode;\n for (var i = 0; i < address.length; i++) {\n if (address[i].types.indexOf(\"locality\") > -1) // indexOf returns -1 if no result found\n suburb = address[i].short_name;\n else if (address[i].types.indexOf(\"administrative_area_level_1\") > -1)\n state = address[i].short_name;\n else if (address[i].types.indexOf(\"postal_code\") > -1)\n postcode = address[i].short_name;\n else if (address[i].types.indexOf(\"country\") > -1)\n countrycode = address[i].long_name;\n }\n agent.add(`For ${suburb} ${state} ${postcode}, ${countrycode}`);\n // agent.add(`For ${result1.data.results[0][\"formatted_address\"]}`); // For full address\n agent.add(prayertimes);\n }\n catch(error) {\n if (error.response) {\n // The request was made and the server responded with a status code that falls out of the range of 2xx\n console.log(`${city}, ${country}`);\n console.error(error.response.data);\n agent.add('Sorry, I couldn\\'t find times for this location. Please check spelling or try another location.');\n } else if (error.request) {\n // The request was made but no response was received\n console.error(error.request);\n agent.add('Sorry, the service is temporarily down. Please try again later.');\n } else {\n // Something happened in setting up the request that triggered an Error\n console.error('Error', error.message);\n agent.add('Sorry, the service is temporarily down. Please try again later.');\n }\n console.log(error.config);\n }\n return;\n }", "title": "" }, { "docid": "e13a9b8dc8bf1e2652196d791e220fdf", "score": "0.54186773", "text": "function updateStats(timeElapsed) {\n\t\ttotalTimePlayed += timeElapsed;\n\t\ttimers.forEach(item => updateTimer(item, timeElapsed));\n\t\ttimers.forEach(item => updateValue(item));\n\t\ttimers.forEach(item => checkUnlocks(item));\n\t}", "title": "" }, { "docid": "07d2726b2bd7f26a63d8d46e3c346b1e", "score": "0.54182464", "text": "function idleMatchUpdateLoop() {\n console.log(new Date() + ' There are ' + Object.keys(idle_matches).length + ' idle matches');\n for (var match in idle_matches) {\n idle_matches[match].updateIdle();\n }\n\n setTimeout(idleMatchUpdateLoop, idleUpdateInterval);\n}", "title": "" }, { "docid": "62d10a43936cc5885bb2032032efb902", "score": "0.5414897", "text": "function activeMatchUpdateLoop() {\n console.log(new Date() + ' There are ' + Object.keys(active_matches).length + ' active matches');\n for (var match in active_matches) {\n active_matches[match].updateActive();\n }\n\n setTimeout(activeMatchUpdateLoop, idleUpdateInterval);\n}", "title": "" }, { "docid": "475a304c3a9a333c74deba28c5598a2b", "score": "0.54077584", "text": "function fillAllCookiesPH() {\n for (let i = 0; i < SalmonCookiesLLC.salmonLLCarray.length; i++) {\n const currentLocation = SalmonCookiesLLC.salmonLLCarray[i];\n currentLocation.getCookiesPerHour();\n }\n}", "title": "" }, { "docid": "badb9ef1954fd38587ee77499dd8032e", "score": "0.54039013", "text": "function updateTimeOnSite(timeDiffObj) {\ndaysOd.update(timeDiffObj['d']);\nhoursOd.update(timeDiffObj['h']-3);\nminutesOd.update(timeDiffObj['m']);\nsecondsOd.update(timeDiffObj['s']);\n}", "title": "" }, { "docid": "e0c0f196baa137f7c1a452163fc15618", "score": "0.5401479", "text": "function hourUpdater() {\n var currentHour = moment().hours();\n $(\".time-block\").each(function() {\n var rowHour = parseInt($(this).attr(\"id\"));\n console.log(rowHour);\n\n if (rowHour < currentHour){\n $(this).addClass(\"past\");\n } else if (rowHour === currentHour) {\n $(this).removeClass(\"past\")\n $(this).addClass(\"present\");\n } else {\n $(this).removeClass(\"past\")\n $(this).removeClass(\"present\")\n $(this).addClass(\"past\");\n }\n })\n}", "title": "" }, { "docid": "ae5d35417fac74f5e05b206886d1bd55", "score": "0.5396973", "text": "update() {\n this.updateLit();\n // this.updateOraclesAndAssets();\n // this.updateCoinRates();\n }", "title": "" }, { "docid": "e190f8cef6969585bb9523a92a8c2d5d", "score": "0.53955644", "text": "function hourTracker() {\n //Time now\n var currentHour = moment().hour();\n\n $(\".time-block\").each(function() {\n //the times on the page\n var pageHour = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n //if the current time pass the times on the page then, the past time blocks will become gray \n if (pageHour < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n }\n //if the current time and the block time are them same then, the time block will become red \n else if (pageHour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).addClass(\"present\");\n }\n //if the current time has not yet pass the future time then. the time blocks for the future time will be green\n else {\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n $(this).removeClass(\"present\");\n }\n })\n }", "title": "" }, { "docid": "dec747ad1bd83a7e35f26e14ffe7c419", "score": "0.53946877", "text": "function catchUp(){\n // current date minus saved \"last seen\" date\n gameVars['lastSeen'] = new Date(gameVars['lastSeen']);\n var now = new Date();\n var deltaT = (now - gameVars['lastSeen'])/1000;\n console.log(`${formatTime(deltaT)} since last seen.`);\n\n // time added to each owned business\n gameVars['ownedBusinesses'].forEach((individualBusiness) => {\n individualBusiness.catchUp(deltaT);\n });\n\n // time added to savedTime\n gameVars['savedTime'] += deltaT;\n gameVars['lastSeen'] = new Date();\n}", "title": "" }, { "docid": "92f56133c0fcfcfae7380caf6a8ad4b1", "score": "0.5386005", "text": "function trackingHours () {\n \n \n \n //find the current number of hours? I couldn't find anything on the moment documentation but referenced my tutor\n var currentTime = moment().hour();\n\n \n \n \n //function for the-time block class \n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n \n \n // console logging the variables\n console.log( blockHour, currentTime)\n //else if statement adjusting the styling of the time blocks based on the time of the day\n if (blockHour < currentTime) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n }\n else if (blockHour === 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": "67266ae3cad14431fd9b78b5acdbb140", "score": "0.5383917", "text": "function updateTime(day){\r\n\t//var bg = chrome.extension.getBackgroundPage();\r\n\t//var forshow = bg.UpdateDeltaT(day);\r\n\tvar arrForshow = [\"\",\"\",\"\",\"\"];\r\n\tarrForshow = UpdateDeltaT(day);\r\n\tdocument.getElementById(\"GrowingDay\").innerHTML = arrForshow[0];\r\n\tdocument.getElementById(\"GrowingHour\").innerHTML = arrForshow[1];\r\n\tdocument.getElementById(\"GrowingMin\").innerHTML = arrForshow[2];\r\n\tdocument.getElementById(\"GrowingSec\").innerHTML = arrForshow[3];\r\n}", "title": "" }, { "docid": "dd0144d29ff6323df78c47c0f9eeb1f7", "score": "0.5379778", "text": "function setCurrentHourIndicator() {\n var currentHour = hours[now.hour()],\n currentHourLabel = trs[now.hour()+1].children[0];\n if (today.date() == new DateTime().date()) {\n currentHour.classList.add('currentHourCell');\n currentHourLabel.classList.add('currentHourLabel');\n } else {\n currentHour.classList.remove('currentHourCell');\n currentHourLabel.classList.remove('currentHourLabel');\n }\n}", "title": "" }, { "docid": "6492e84b9bffe4e35fc6febc4bf5f537", "score": "0.5378946", "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": "1547c640bbbe3b2453f207d4728ce06c", "score": "0.5375215", "text": "onHourChange(value) {\n const {minutes, meridiem} = this.state\n\t\tthis.setState({hours: value})\n\t\tthis.props.onChange(this.props.name, this.convertTo24HourClock(value, minutes, meridiem));\n\t}", "title": "" }, { "docid": "c0c5cf41dd24aea8e4555373324c5404", "score": "0.53663284", "text": "updateClockHand() {\n const dtNow=getNowForTimezone(this.tz);\n\n this.canvas.nextSibling.innerHTML=dtNow.toLocaleDateString()+\"<br>\"+dtNow.toLocaleTimeString([], {hour:'2-digit', minute:'2-digit', second:'2-digit'});\n\n this._drawClock();\n var hours = dtNow.getHours();\n var minutes = dtNow.getMinutes();\n var seconds = dtNow.getSeconds();\n \n this._drawClockHand(seconds, (this.center-20), 1, \"red\");\n this._drawClockHand(minutes, (this.center-35), 3, \"#606060\");\n this._drawClockHand(hours*5, (this.center-60), 5, \"grey\");\n }", "title": "" }, { "docid": "905d1eb8491448787215637b8434a460", "score": "0.53657544", "text": "function updateClock() {\n\n var t = getTimeRemaining(endtime);\n\n daysSpan.innerHTML = t.days;\n hoursSpan.innerHTML = ('0' + t.hours).slice(-2);\n minutesSpan.innerHTML = ('0' + t.minutes).slice(-2);\n secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);\n \n //if the endtime is reached \n if (t.total <= 0) {\n clearInterval(timeinterval);\n }\n\n }", "title": "" }, { "docid": "ab61c5ef16dda99c1f3f3643e7965e15", "score": "0.5363442", "text": "function updateClock() {\n // do zmiennej t zapisujemy wyliczenie w formie objektu z funkcji getTimeRemaining oraz w srodek wstawimy argument endtime w ktorym bedzie nasz deadline z ktorego beda robione wyliczenia przez funkcje\n const t = getTimeRemaining(endtime);\n \n // innerHTML usuwa poprzednie znaczenie w kodzie html i wstawia kolejne ktore my zadamy dynamicznie\n // t.days oraz inni zmienni - so to objekty ktore dostalismy z funkcji getTimeRemaining i teraz dostajemy z objektu dane, czyli odlowanie do objektu.kropka i nazwa klucza w objekcie z ktorej chcemy uzyskac dane\n days.innerHTML = getZero(t.days); // znaczenia wstawiamy ale najpierw sprawdzamy przez funkcje getZero czy nie trzeba dopisac zera przed liczba od 1 do 9\n hours.innerHTML = getZero(t.hours);\n minutes.innerHTML = getZero(t.minutes);\n seconds.innerHTML = getZero(t.seconds);\n\n // jesli ilosc milisekund dojdzie do zera lub bedzie juz ujemne bo minie data po za ustawiona, to wtedy wyczyscimy licznik na 0\n if (t.total <= 0) { // t jest objektem, a total jednym z jego elemntow gdzie zapisuja sie cala ilosc milisekund ktora zostala do konca ustawionej daty w deadline\n clearInterval(timeInterval);\n }\n }", "title": "" }, { "docid": "1e703f5e67874f9549b1122f440db56e", "score": "0.5363353", "text": "async __startPeriodic () {\n\t\tconst sharedLogger = this.__dep(`sharedLogger`);\n\t\tconst scheduler = this.__dep(`scheduler`);\n\t\tconst hippocamp = this.__dep(`hippocamp`);\n\n\t\thippocamp.on(`refreshed-user-profile`, this.__updatedTimezoneListener(scheduler, sharedLogger));\n\n\t}", "title": "" }, { "docid": "195acf5a375529064ddca9544eaf4862", "score": "0.5361199", "text": "function updateAssignmentHours(applicant, assignment, hours) {\n appState.setFetchingAssignmentsList(true);\n\n return putHelper(\n '/applicants/' + applicant + '/assignments/' + assignment,\n { hours: hours },\n getAssignments\n )\n .then(assignments => {\n appState.setAssignmentsList(assignments);\n appState.setFetchingAssignmentsList(false, true);\n })\n .catch(() => appState.setFetchingAssignmentsList(false));\n}", "title": "" }, { "docid": "6cf31a6e90f21ebd54b5f845ade948c1", "score": "0.5348937", "text": "function updateColor(){\n $(\"#currentDay\").text(moment().format('MMMM Do YYYY, h:mm:ss a'));\n var current = moment().hours() // hour of the current in 24 hours format\n\n $(\".input-area\").each(function(){\n var hour = parseInt($(this).siblings(\".saveBtn\").attr(\"id\"))\n console.log(\"hour update\", hour)\n\n if (hour < current){\n $(this).addClass(\"past\")\n }\n else if (hour === current){\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 })\n\n}", "title": "" }, { "docid": "654144a0680a88fd1eb07bad7803f64e", "score": "0.53477603", "text": "function realTimeUpdate() {\n realTime = new Date();\n\n console.log(getDomainIndex(currDomain));\n console.log(timers[getDomainIndex(currDomain)]);\n /*if errorCheck(currDomain) {\n startTime = new Date();\n return;\n }*/\n errorCheck(currDomain);\n\n timers[getDomainIndex(currDomain)] += realTime - startTime;\n startTime = new Date();\n }", "title": "" }, { "docid": "3c30f27279c5bfa974d2e298581b2e50", "score": "0.5346686", "text": "function update() { \r\n if (this.timeRunning){\r\n time += timePast();\r\n }\r\n let displayTime = formatTime(time);\r\n \r\n element.textContent = displayTime\r\n // console.log(displayTime);\r\n }", "title": "" }, { "docid": "75359506ec65688072ed380b43b4213a", "score": "0.5336636", "text": "function updateClock() {\n\t\t var t = getTimeRemaining(endtime);\n\n\t\t daysSpan.innerHTML = t.days;\n\t\t hoursSpan.innerHTML = ('0' + t.hours).slice(-2);\n\t\t minutesSpan.innerHTML = ('0' + t.minutes).slice(-2);\n\t\t //secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);\n\n\t\t if (t.total <= 0) {\n\t\t clearInterval(timeinterval);\n\t\t }\n\t\t }", "title": "" }, { "docid": "dd45a34aa6bf1a339b7a95bbcee959a6", "score": "0.5333336", "text": "function upTime()\n{\n\trequest(myUptimeURL,\n\tfunction(error, response, data) {\n body.data = data;\n body.emit('update');\n\t});\n}", "title": "" }, { "docid": "56b3eb47db33045cb9268c6e5fd77b74", "score": "0.53287077", "text": "update() {\n }", "title": "" }, { "docid": "f8bb0157f071f081503d15f6a6ef099b", "score": "0.53275317", "text": "function updateTime() {\n \tvar time = new Date();\n \ttimes = {\n \t\tH: ((time.getHours() + 24) % 12 || 12) + \"\",\n \t\tM: (time.getMinutes() + \"\"),\n \t\tS: (time.getSeconds() + \"\")\n \t};\n\n \t//update text\n \tObject.keys(times).forEach(k =>\n \t\telements[k].innerHTML = (String(times[k]).length > 1) ? times[k] : times[k] = \"0\" + times[k] //pad with 0s if needed\n \t);\n\n \tsetTimeout(updateTime, 1000);\n }", "title": "" }, { "docid": "bda2d4d6e7b8faf0dbf5813ea6d6597e", "score": "0.53255653", "text": "function AnzeigeAktualisieren()\r\n\t\t\t{\r\n\t\t\t\tvar Flugzeit = parseInt(unsafeWindow.duration());\r\n\t\t\t\t\r\n\t\t\t\t// Zeiten aktualisieren\r\n\t\t\t\tvar AktZeit = GetAktZeit(); // aktuelle Zeit\r\n\t\t\t\tAnkunft = new Date(AktZeit.getTime() + (Flugzeit * 1000)); // Ankunft: Aktuelle Uhrzeit+Flugzeit (*1000 weil es Millisekunden sind)\r\n\t\t\t\tRueck = new Date(AktZeit.getTime() + (Flugzeit * 2000)); // Rueckkehr: Aktuelle Uhrzeit + 2*Flugzeit (*2000 weil es Millisekunden sind)\r\n\t\t\t\tdocument.getElementById('ankunft_ziel').firstChild.nodeValue = ZeitFormatieren(Ankunft); // Ankunfszeit formatieren und anzeigen\r\n\t\t\t\tdocument.getElementById('ankunft_ursprung').firstChild.nodeValue = ZeitFormatieren(Rueck); // Rueckkehrzeit formatieren und anzeigen\r\n\t\t\t}", "title": "" }, { "docid": "4386ce8a5ef1ef36bf27211b56fa7719", "score": "0.53131807", "text": "function autoEat(){\n\t\tsetInterval(function (){ \n\t\tif (hunger > 0 && ore >0){\n\t\t\thunger = +(hunger - hungerRate()).toFixed(2);\n\t\t\tfeedClick++;\n\t\t\tore--;\n\t\t\tbirthday--;\n\t\t\tif (mining){\n\t\t\t\tstaminaTotal++;\n\t\t\t}\n\t\t\t$(\"#stamina\").html(staminaTotal);\n\t\t\t$(\"#birthday\").html(birthday);\n\t\t\t$(\"#hunger\").html(hunger);\n\t\t\t$(\"#ore\").html(ore);\n\t\t};\n\t}, 1000);\n\n\t}", "title": "" }, { "docid": "ff3f303095a0cda80d104c6dba146e9f", "score": "0.53116965", "text": "function updateRepeatedly() {\n updateOnce();\n setTimeout(updateRepeatedly, seconds(30));\n }", "title": "" } ]
30ecd48e804e608ac431f7a1cf4f1ab8
Converts a base64 encoded string into Uint8Array.
[ { "docid": "306862248671ebff3b74ace7bba43d4a", "score": "0.7876891", "text": "function base64ToArray(input) {\n return Uint8Array.from(atob(input), c => c.charCodeAt(0))\n}", "title": "" } ]
[ { "docid": "5fff34ad4a0d0f27d0d2a41fe999d46d", "score": "0.87523264", "text": "function urlBase64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - base64String.length % 4) % 4);\n const base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n }", "title": "" }, { "docid": "4e2953c1b7dfa2f664df878b228e5e2a", "score": "0.874847", "text": "function urlBase64ToUint8Array(base64String) {\n const padding = \"=\".repeat((4 - base64String.length % 4) % 4),\n base64 = (base64String + padding).replace(/\\-/g, \"+\").replace(/_/g, \"/\"),\n rawData = window.atob(base64),\n outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) outputArray[i] = rawData.charCodeAt(i);\n\n return outputArray;\n }", "title": "" }, { "docid": "5995bd32294c9942a954e84acfdba7d8", "score": "0.86815554", "text": "function urlBase64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/\\-/g, '+').replace(/_/g, '/'); // eslint-disable-line\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; i += 1) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "title": "" }, { "docid": "ebbf7a92736f17a43a2eeb8d060af111", "score": "0.8647064", "text": "function urlBase64ToUint8Array(base64String) {\n const padding = \"=\".repeat((4 - base64String.length % 4) % 4);\n const base64 = (base64String + padding)\n .replace(/\\-/g, \"+\")\n .replace(/_/g, \"/\");\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "title": "" }, { "docid": "4591576384304ac2aefa8df3ba62614f", "score": "0.8645349", "text": "function urlBase64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - base64String.length % 4) % 4);\n const base64 = (base64String + padding)\n .replace(/-/g, '+')\n .replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "title": "" }, { "docid": "786fd8e579af4154006582f8f6af83e0", "score": "0.86405617", "text": "function urlB64ToUint8Array (base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4)\n const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/')\n const rawData = atob(base64)\n const outputArray = new Uint8Array(rawData.length)\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i)\n }\n return outputArray\n}", "title": "" }, { "docid": "9ceb69cb8bf9f15f554be31f84242eac", "score": "0.863388", "text": "function urlBase64ToUint8Array(base64String) {\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\n var base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n var rawData = window.atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n\n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n\n return outputArray;\n}", "title": "" }, { "docid": "dda5510e446b62191f7a681aded66fa3", "score": "0.8568741", "text": "function urlB64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/\\-/g, '+').replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "title": "" }, { "docid": "3da7cd620d397e5ca0fbc3dc8a566f09", "score": "0.853701", "text": "function urlB64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - base64String.length % 4) % 4);\n const base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n \n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n \n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n }", "title": "" }, { "docid": "8fe9e8e228a291ff91c9ae5c4e7faed0", "score": "0.85351914", "text": "function urlB64ToUint8Array(base64String) {\n\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/\\-/g, '+').replace(/_/g, '/');\n const rawData = atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n\n outputArray[i] = rawData.charCodeAt(i);\n }\n\n return outputArray;\n}", "title": "" }, { "docid": "248807de4e5d6d5e4f7eef438f73969c", "score": "0.79851943", "text": "function fromBase64(input) {\n const buffer = util_buffer_from_1.fromString(input, \"base64\");\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n}", "title": "" }, { "docid": "248807de4e5d6d5e4f7eef438f73969c", "score": "0.79851943", "text": "function fromBase64(input) {\n const buffer = util_buffer_from_1.fromString(input, \"base64\");\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n}", "title": "" }, { "docid": "953a6ed05b637625bad506f8218af428", "score": "0.78690857", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf = Buffer.from(s, 'base64');\n return new Uint8Array(buf['buffer'], buf['byteOffset'], buf['byteLength']);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "66b227116bfaf5886e108430ee0a3030", "score": "0.7865375", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE == 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf = Buffer.from(s, 'base64');\n return new Uint8Array(buf['buffer'], buf['byteOffset'], buf['byteLength']);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "2cb703844ff2867affda69ef95570386", "score": "0.78449696", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "2cb703844ff2867affda69ef95570386", "score": "0.78449696", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "2cb703844ff2867affda69ef95570386", "score": "0.78449696", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "2cb703844ff2867affda69ef95570386", "score": "0.78449696", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "2cb703844ff2867affda69ef95570386", "score": "0.78449696", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "2cb703844ff2867affda69ef95570386", "score": "0.78449696", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "2cb703844ff2867affda69ef95570386", "score": "0.78449696", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "2cb703844ff2867affda69ef95570386", "score": "0.78449696", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "2cb703844ff2867affda69ef95570386", "score": "0.78449696", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "2cb703844ff2867affda69ef95570386", "score": "0.78449696", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "ce270c866330dfaf0f5246584a50a5ff", "score": "0.7778823", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n // TODO: Update Node.js externs, Closure does not recognize the following Buffer.from()\n /**@suppress{checkTypes}*/\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf['buffer'], buf['byteOffset'], buf['byteLength']);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "ce270c866330dfaf0f5246584a50a5ff", "score": "0.7778823", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n // TODO: Update Node.js externs, Closure does not recognize the following Buffer.from()\n /**@suppress{checkTypes}*/\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf['buffer'], buf['byteOffset'], buf['byteLength']);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "ce270c866330dfaf0f5246584a50a5ff", "score": "0.7778823", "text": "function intArrayFromBase64(s) {\n if (typeof ENVIRONMENT_IS_NODE === 'boolean' && ENVIRONMENT_IS_NODE) {\n var buf;\n try {\n // TODO: Update Node.js externs, Closure does not recognize the following Buffer.from()\n /**@suppress{checkTypes}*/\n buf = Buffer.from(s, 'base64');\n } catch (_) {\n buf = new Buffer(s, 'base64');\n }\n return new Uint8Array(buf['buffer'], buf['byteOffset'], buf['byteLength']);\n }\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "009e7f5e92a378c614e0d13730dfccf4", "score": "0.7605602", "text": "function getArrayBufferFromBase64String(base64String) {\n const binaryString = window.atob(base64String);\n const byteArray = new Uint8Array(binaryString.length);\n for (let i = 0; i < byteArray.length; ++i) {\n byteArray[i] = binaryString.charCodeAt(i);\n }\n return byteArray.buffer;\n }", "title": "" }, { "docid": "a8993f3a84bb518322e45882739363b2", "score": "0.7575332", "text": "function intArrayFromBase64(s) {\n\n try {\n var decoded = decodeBase64(s);\n var bytes = new Uint8Array(decoded.length);\n for (var i = 0 ; i < decoded.length ; ++i) {\n bytes[i] = decoded.charCodeAt(i);\n }\n return bytes;\n } catch (_) {\n throw new Error('Converting base64 string to bytes failed.');\n }\n}", "title": "" }, { "docid": "63028c3df5df2991ca1e417e074d9d97", "score": "0.7532949", "text": "function base64ToArrayBuffer(base64String) {\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\n var base64 = (base64String + padding).replace(/\\-/g, '+').replace(/_/g, '/');\n var rawData = atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n\n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n\n return outputArray;\n}", "title": "" }, { "docid": "20970d317e265deea878d80dfd01c4c8", "score": "0.749604", "text": "function base64ToArrayBuffer(base64String) {\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\n var base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n var rawData = atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "title": "" }, { "docid": "20970d317e265deea878d80dfd01c4c8", "score": "0.749604", "text": "function base64ToArrayBuffer(base64String) {\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\n var base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n var rawData = atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "title": "" }, { "docid": "8f3688c2243ca154c9cc67d2ad1db552", "score": "0.7486272", "text": "function base64ToArrayBuffer(base64) {\n var binaryString = window.atob(base64);\n var binaryLen = binaryString.length;\n var bytes = new Uint8Array(binaryLen);\n for (var i = 0; i < binaryLen; i++) {\n var ascii = binaryString.charCodeAt(i);\n bytes[i] = ascii;\n }\n return bytes;\n }", "title": "" }, { "docid": "46c6f21a89279e83d3850bae608cc6e4", "score": "0.7476911", "text": "function base64ToArrayBuffer(base64String) {\r\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\r\n var base64 = (base64String + padding)\r\n .replace(/\\-/g, '+')\r\n .replace(/_/g, '/');\r\n var rawData = atob(base64);\r\n var outputArray = new Uint8Array(rawData.length);\r\n for (var i = 0; i < rawData.length; ++i) {\r\n outputArray[i] = rawData.charCodeAt(i);\r\n }\r\n return outputArray;\r\n}", "title": "" }, { "docid": "46c6f21a89279e83d3850bae608cc6e4", "score": "0.7476911", "text": "function base64ToArrayBuffer(base64String) {\r\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\r\n var base64 = (base64String + padding)\r\n .replace(/\\-/g, '+')\r\n .replace(/_/g, '/');\r\n var rawData = atob(base64);\r\n var outputArray = new Uint8Array(rawData.length);\r\n for (var i = 0; i < rawData.length; ++i) {\r\n outputArray[i] = rawData.charCodeAt(i);\r\n }\r\n return outputArray;\r\n}", "title": "" }, { "docid": "46c6f21a89279e83d3850bae608cc6e4", "score": "0.7476911", "text": "function base64ToArrayBuffer(base64String) {\r\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\r\n var base64 = (base64String + padding)\r\n .replace(/\\-/g, '+')\r\n .replace(/_/g, '/');\r\n var rawData = atob(base64);\r\n var outputArray = new Uint8Array(rawData.length);\r\n for (var i = 0; i < rawData.length; ++i) {\r\n outputArray[i] = rawData.charCodeAt(i);\r\n }\r\n return outputArray;\r\n}", "title": "" }, { "docid": "697e18bbf5cea6884677f5acf1df5793", "score": "0.74639106", "text": "function base64ToArrayBuffer(base64String) {\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\n var base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n var rawData = window.atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "title": "" }, { "docid": "9aea2c8fa586a8dd8d84dbb8dc441c43", "score": "0.745001", "text": "function base64ToArrayBuffer(base64String) {\r\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\r\n var base64 = (base64String + padding)\r\n .replace(/\\-/g, '+')\r\n .replace(/_/g, '/');\r\n var rawData = window.atob(base64);\r\n var outputArray = new Uint8Array(rawData.length);\r\n for (var i = 0; i < rawData.length; ++i) {\r\n outputArray[i] = rawData.charCodeAt(i);\r\n }\r\n return outputArray;\r\n}", "title": "" }, { "docid": "d0e765b57336b9f3695c101bb2ca51c2", "score": "0.74300754", "text": "static base64toArrayBuffer(base64String) {\n const binaryString = atob(base64String);\n const nBytes = binaryString.length;\n const arr = new Uint8Array(nBytes); // Contained data is not const.\n for (let i = 0; i < nBytes; i += 1) {\n arr[i] = binaryString.charCodeAt(i);\n }\n return arr.buffer;\n }", "title": "" }, { "docid": "985c2234b05b32b700f518d3439d4cea", "score": "0.72840095", "text": "function stringToUint8Array(input) {\n var len = input.length;\n var res = new Uint8Array(len);\n for (var i = 0; i < len; ++i)\n res[i] = input.charCodeAt(i) & 0xff;\n return res;\n }", "title": "" }, { "docid": "f1572d1b21717e28fb8854e6961d023d", "score": "0.71743876", "text": "function base64StringToArrayBuffer(str) {\n if (useNodeBuffer) {\n var buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n var s = atob(str);\n var buffer = new Uint8Array(s.length);\n for (var i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}", "title": "" }, { "docid": "4740e7582fb25046b1090ed1e5cc2678", "score": "0.71638083", "text": "function stringToUint8Array (str) {\n const array = new Uint8Array(str.length)\n for (let i = 0; i < array.length; i++) {\n array[i] = str.charCodeAt(i)\n }\n return array\n}", "title": "" }, { "docid": "774e00fa20f8e045dd130b28520678cc", "score": "0.71546036", "text": "base64ToArrayBuffer(base64) {\n const binary_string = window.atob(base64);\n const len = binary_string.length;\n let bytes = new Uint8Array(len);\n for (let i = 0; i < len; i++) {\n bytes[i] = binary_string.charCodeAt(i);\n }\n return bytes.buffer;\n }", "title": "" }, { "docid": "84f0f28c5f9602856d1c38895c6e6bcd", "score": "0.7150947", "text": "function stringToUint8Array(str) {\n return Uint8Array.from(buffer_1.Buffer.from(str));\n}", "title": "" }, { "docid": "56efb30cbd09db8bb99a581ee5accf87", "score": "0.71436524", "text": "base64ToArrayBuffer(base64) {\n var binary_string = window.atob(base64);\n var len = binary_string.length;\n var bytes = new Uint8Array(len);\n for (var i = 0; i < len; i++) {\n bytes[i] = binary_string.charCodeAt(i);\n }\n return bytes.buffer;\n }", "title": "" }, { "docid": "8223938bfd69498c5ba881fc89d99dd9", "score": "0.714061", "text": "function gbConvert_Base64_En_ArrayBuffer(base64) {\n try{\n var binaryString = window.atob(base64);\n var binaryLen = binaryString.length;\n var bytes = new Uint8Array(binaryLen);\n\n // -- Parcourir et lister -- //\n for (var i = 0; i < binaryLen; i++) {\n var ascii = binaryString.charCodeAt(i);\n bytes[i] = ascii;\n }\n\n // -- Renvoyer les bytes -- //\n return bytes;\n } catch (ex) {\n // -- Log -- //\n gbConsole('Méthode: iConvert_Base64_En_ArrayBuffer, Exception: ' + ex.message);\n }\n\n // -- Retourner Null en cas d'echec de convertion -- //\n return null;\n}", "title": "" }, { "docid": "859d3a41fb7948aa6a5357cc9b1dc1f2", "score": "0.7140211", "text": "function base64StringToArrayBuffer(str) {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n }", "title": "" }, { "docid": "a07f3edc1be87070b6a18ef98975918a", "score": "0.7115581", "text": "function stringToUint8Array(str) {\n const length = str.length;\n const array = new Uint8Array(new ArrayBuffer(length));\n for(let i = 0; i < length; i++) {\n array[i] = str.charCodeAt(i);\n }\n return array;\n}", "title": "" }, { "docid": "9f8a5f9b774064b3b8136e9ded92858a", "score": "0.71127385", "text": "function base64StringToArrayBuffer(str) {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n\n return buffer.buffer;\n}", "title": "" }, { "docid": "7d75f7baf0a384ac2db947b39e478155", "score": "0.7104374", "text": "function _base64ToArrayBuffer(base64) {\n var binary_string = window.atob(base64);\n var len = binary_string.length;\n\n var bytes = new Uint8Array(len);\n for (var i = 0; i < len; i++) {\n bytes[i] = binary_string.charCodeAt(i);\n }\n return bytes.buffer;\n }", "title": "" }, { "docid": "b212dcfc0df1fa331af7802fa10d7453", "score": "0.71023005", "text": "function byteArray(base64) {\n var raw = atob(base64);\n var len = raw.length;\n var arr = new Uint8Array(new ArrayBuffer(len));\n for (var i = 0; i < len; i++) {\n arr[i] = raw.charCodeAt(i);\n }\n return arr;\n}", "title": "" }, { "docid": "f78291b986ecc47825ed7c3e235d8946", "score": "0.70936775", "text": "function base64StringToArrayBuffer(str) {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}", "title": "" }, { "docid": "75cd1668e7018d64cca8ce91d6249e0f", "score": "0.70472664", "text": "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "title": "" }, { "docid": "218e4697a90e30c625eb9377ffda8c31", "score": "0.7045404", "text": "function fromBase64(input) {\n let totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n const out = new ArrayBuffer(totalByteLength);\n const dataView = new DataView(out);\n for (let i = 0; i < input.length; i += 4) {\n let bits = 0;\n let bitLength = 0;\n for (let j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n const chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n const byteLength = Math.floor(bitLength / bitsPerByte);\n for (let k = 0; k < byteLength; k++) {\n const offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "title": "" }, { "docid": "4264befff152aec14a7d2a9308e16d1c", "score": "0.7036933", "text": "function StringToUint8Array(str) {\n const arr = new Uint8Array(str.length + 1);\n for (let i = 0; i < str.length; ++i) {\n arr[i] = str.charCodeAt(i);\n }\n arr[str.length] = 0;\n return arr;\n}", "title": "" }, { "docid": "17684b7c7da013ae1b18bedc3b94668c", "score": "0.7018486", "text": "function _base64ToArrayBuffer(base64) {\n var binaryString = window.atob(base64);\n var len = binaryString.length;\n var bytes = new Uint8Array(len);\n for (var i = 0; i < len; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes.buffer;\n}", "title": "" }, { "docid": "f877697eacd1d8c887399a804fd72250", "score": "0.6936846", "text": "function base64ToUint8(base64,isJPEG){\n\tvar start = (isJPEG ? 23 : 22);\n\tvar stringData = atob(base64.substring(start));\n\tvar len = stringData.length;\n\tvar data = new Uint8Array(len);\n\tfor(var i=0; i<len; i++)\n\t\tdata[i]=stringData.charCodeAt(i);\n\tconsole.log('extract encode date done');\n\treturn data;\n}", "title": "" }, { "docid": "63de842667f12a74f93160fdd686649a", "score": "0.68744934", "text": "function stringToUint8Array(str) {\n return new Uint8Array( str.split('').map((char)=>char.codePointAt(0)) );\n}", "title": "" }, { "docid": "7f32b41189733c93128c4b742e385422", "score": "0.68743587", "text": "function stringToUint8Array(str) {\n /* istanbul ignore next */\n if (typeof str !== \"string\") {\n throw new Error(\"Expected parameter str to be type string, was type \" + typeof str);\n }\n return Uint8Array.from(Buffer.from(str));\n}", "title": "" }, { "docid": "44c74c71e1c3297d549ed935a788271f", "score": "0.6869832", "text": "function stringToUint8Array(str) {\n /* istanbul ignore next */\n if (typeof str !== \"string\") {\n throw new Error(\"Expected parameter str to be type string, was type \" + typeof str);\n }\n return Uint8Array.from(buffer_1.Buffer.from(str));\n}", "title": "" }, { "docid": "c7e47a655c33107c46e52ec3b280958c", "score": "0.67825484", "text": "function base64ToByteArray (base64URL) {\n\t\tvar result = [];\n\t\tvar prev;\n\n\t\tvar srcURL = base64URL.replace('data:image/jpeg;base64,', '');\n\n\t\tfor (var i = 0, len = srcURL.length; i < len; i++) {\n\t\t\tsrcURL[i];\n\t\t\tvar currentChar = reversedBase64Map[srcURL[i]];\n\t\t\tvar digitNum = i % 4;\n\n\t\t\tswitch (digitNum) {\n\t\t\t\t// case 0: first digit - do nothing, not enough info to work with\n\t\t\t\tcase 1: // second digit\n\t\t\t\t\tresult.push((prev << 2) | (currentChar >> 4));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2: // third digit\n\t\t\t\t\tresult.push(((prev & 0x0f) << 4) | (currentChar >> 2));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3: // fourth digit\n\t\t\t\t\tresult.push(((prev & 3) << 6) | currentChar);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tprev = currentChar;\n\t\t}\n\n\t\treturn result;\n\t}", "title": "" }, { "docid": "d6c91647276276450fe14ca7e1ffd95a", "score": "0.67782015", "text": "function base64Decode(str) {\n let bytes = toByteArray(str);\n return bytes;\n}", "title": "" }, { "docid": "3b432f90505fdbe33474f1b41775408c", "score": "0.6698307", "text": "async function _64ToUtf8(string) {\n var buff = Buffer.from(string, 'base64');\n return buff.toString(\"utf8\");\n }", "title": "" }, { "docid": "9eda070fe3deeb35f0ccfe945143b904", "score": "0.6662258", "text": "static decode(base64) {\n let tmp;\n const lens = Base64.getLengths(base64);\n const validLen = lens[0];\n const placeHoldersLen = lens[1];\n const arr = new Uint8Array(Base64.calcByteLength(validLen, placeHoldersLen));\n let curByte = 0;\n // if there are placeholders, only get up to the last complete 4 chars\n const len = placeHoldersLen > 0 ? validLen - 4 : validLen;\n let i;\n for (i = 0; i < len; i += 4) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 18) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] << 12) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 2)] << 6) |\n Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 3)];\n arr[curByte++] = (tmp >> 16) & 0xFF;\n arr[curByte++] = (tmp >> 8) & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n if (placeHoldersLen === 2) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 2) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] >> 4);\n arr[curByte++] = tmp & 0xFF;\n }\n if (placeHoldersLen === 1) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 10) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] << 4) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 2)] >> 2);\n arr[curByte++] = (tmp >> 8) & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n return arr;\n }", "title": "" }, { "docid": "be1ea3ef94f8b5979dc824de11d04565", "score": "0.66408575", "text": "function utf8ArrayBufFromStr(str)\n {\n var strUtf8 = unescape(encodeURIComponent(str));\n var arrayBuf = new Uint8Array(strUtf8.length);\n for (var i = 0; i < strUtf8.length; i++) {\n arrayBuf[i] = strUtf8.charCodeAt(i);\n }\n return arrayBuf;\n }", "title": "" }, { "docid": "9c1b89a99bc008050a6a27998db14cd3", "score": "0.6617775", "text": "function base64Decode(base64str) {\n return new Buffer.from(base64str, 'base64');\n}", "title": "" }, { "docid": "222f1b8ab6d67c8f5ff87ec9a9398af6", "score": "0.6616443", "text": "static decode(base64) {\n let tmp;\n const lens = Base64.getLengths(base64);\n const validLen = lens[0];\n const placeHoldersLen = lens[1];\n const arr = new Uint8Array(Base64.calcByteLength(validLen, placeHoldersLen));\n let curByte = 0;\n // if there are placeholders, only get up to the last complete 4 chars\n const len = placeHoldersLen > 0 ? validLen - 4 : validLen;\n let i;\n for (i = 0; i < len; i += 4) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 18) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] << 12) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 2)] << 6) |\n Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 3)];\n arr[curByte++] = (tmp >> 16) & 0xFF;\n arr[curByte++] = (tmp >> 8) & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n if (placeHoldersLen === 2) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 2) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] >> 4);\n arr[curByte++] = tmp & 0xFF;\n }\n if (placeHoldersLen === 1) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 10) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] << 4) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 2)] >> 2);\n arr[curByte++] = (tmp >> 8) & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n return arr;\n }", "title": "" }, { "docid": "b8091f44db3c7426ce3efa352103c4b8", "score": "0.66110617", "text": "fromString(string) {\n \"use strict\";\n\n // do not walk char by char to calculate size, it's slow\n // use a conservative estimate first, expand later if needed\n let size = string.length * 2;\n\n let bytes = new Uint8Array(size);\n let byteOffset = 0;\n for(let i = 0, j = string.length; i < j; i++) {\n\n let charCode = string.codePointAt(i);\n let nbytes = utf8._bytesForChar(charCode);\n if (nbytes==4) i+=1;\n if (nbytes + byteOffset >size) { //\n size = string.length * 4; // max possible size\n let newBytes = new Uint8Array(size);\n newBytes.set(bytes);\n bytes = newBytes;\n }\n\n if(1 == nbytes) {\n bytes[byteOffset++] = charCode;\n } else {\n // Computing the first byte\n let pad = (15 >> (4-nbytes)) << (8-nbytes);\n bytes[byteOffset++] = pad + (charCode >>> ((--nbytes) * 6));\n // Computing next bytes\n for (; nbytes > 0;) {\n bytes[byteOffset++] = ((charCode >>> ((--nbytes) * 6)) & 0x3F) | 0x80;\n }\n }\n }\n bytes = bytes.subarray(0, byteOffset);\n return bytes;\n }", "title": "" }, { "docid": "052574bff37eecca226c3779f7459aff", "score": "0.6590882", "text": "function utf8StringToArray(str) {\n\t\tvar n = str.length,\n\t\t\tidx = 0,\n\t\t\tbytes = [],\n\t\t\ti,\n\t\t\tj,\n\t\t\tc;\n\t\t\n\t\tfor (i = 0; i < n; i = i + 1) {\n\t\t\tc = str.charCodeAt(i);\n\t\t\tif (c <= 0x7F) {\n\t\t\t\tbytes[idx] = c;\n\t\t\t\tidx = idx + 1;\n\t\t\t} else if (c <= 0x7FF) {\n\t\t\t\tbytes[idx] = 0xC0 | (c >>> 6);\n\t\t\t\tidx = idx + 1;\n\t\t\t\tbytes[idx] = 0x80 | (c & 0x3F);\n\t\t\t\tidx = idx + 1;\n\t\t\t} else if (c <= 0xFFFF) {\n\t\t\t\tbytes[idx] = 0xE0 | (c >>> 12);\n\t\t\t\tidx = idx + 1;\n\t\t\t\tbytes[idx] = 0x80 | ((c >>> 6) & 0x3F);\n\t\t\t\tidx = idx + 1;\n\t\t\t\tbytes[idx] = 0x80 | (c & 0x3F);\n\t\t\t\tidx = idx + 1;\n\t\t\t} else {\n\t\t\t\tbytes[idx] = 0xF0 | (c >>> 18);\n\t\t\t\tidx = idx + 1;\n\t\t\t\tbytes[idx] = 0x80 | ((c >>> 12) & 0x3F);\n\t\t\t\tidx = idx + 1;\n\t\t\t\tbytes[idx] = 0x80 | ((c >>> 6) & 0x3F);\n\t\t\t\tidx = idx + 1;\n\t\t\t\tbytes[idx] = 0x80 | (c & 0x3F);\n\t\t\t\tidx = idx + 1;\n\t\t\t}\n\t\t}\n\t\treturn bytes;\n\t}", "title": "" }, { "docid": "c828a7675ef6ccc9d66d3c711414df58", "score": "0.6567548", "text": "toUint8Array() {\n return this._byteString.toUint8Array();\n }", "title": "" }, { "docid": "c828a7675ef6ccc9d66d3c711414df58", "score": "0.6567548", "text": "toUint8Array() {\n return this._byteString.toUint8Array();\n }", "title": "" }, { "docid": "d664218674c310c4897a5dd2e7cdf945", "score": "0.65488565", "text": "function base64Decode(b64) { // @param Base64String/URLSafe64String:\r\n // @return ByteArray:\r\n if (typeof b64 !== \"string\" || !b64.length) {\r\n return []; // empty\r\n }\r\n\r\n // URLBase64Charcter(\"-\", \"_\") convert to (\"+\", \"/\")\r\n b64 = b64.replace(_URLSAFE64_CHAR, toBase64Char);\r\n\r\n if (_BASE64_BAD_DATA.test(b64)) {\r\n return []; // bad data\r\n }\r\n\r\n var rv = [], pad = 0, hash = _b64hash, c = 0, i = 0, iz;\r\n\r\n switch (b64.length % 4) { // pad length( \"=\" or \"==\" or \"\" )\r\n case 2: b64 += \"=\"; ++pad;\r\n case 3: b64 += \"=\"; ++pad;\r\n }\r\n\r\n iz = b64.length;\r\n while (i < iz) { // 00000000|00000000|00000000\r\n c = (hash[b64.charAt(i++)] << 18) // 111111 | |\r\n | (hash[b64.charAt(i++)] << 12) // 11|1111 |\r\n | (hash[b64.charAt(i++)] << 6) // | 1111|11\r\n | hash[b64.charAt(i++)] // | | 111111\r\n rv.push((c >>> 16) & 0xff, (c >>> 8) & 0xff, c & 0xff);\r\n }\r\n rv.length -= [0,1,2][pad]; // cut tail\r\n return rv;\r\n}", "title": "" }, { "docid": "959432c179a522b7a3688e94354a4c39", "score": "0.6548327", "text": "function str2byteArr(str) {\n return str.split('').map(function(c){return c.charCodeAt(0) & 0xff});\n}", "title": "" }, { "docid": "cd6881548cab31ea4c141c2a226bbd89", "score": "0.6521066", "text": "function decodeBase64(string) {\n return Buffer.from(string, 'base64').toString('ascii')\n}", "title": "" }, { "docid": "876cd8c59dcc59d47eb91e6cf3f66681", "score": "0.6487328", "text": "base64_decode(base64str) {\n return Buffer.from(base64str, 'base64')\n }", "title": "" }, { "docid": "0aef59317478582c19a0bb1003a5ec2a", "score": "0.64813477", "text": "function base64ToBuffer(base64Str) {\n var binary = window.atob(base64Str);\n var len = binary.length;\n var bytes = new Uint8Array(len);\n for(var i = 0; i < len; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n\n return new Buffer(bytes.buffer);\n }", "title": "" }, { "docid": "7ee3dd01db9238934757fc94eb2dad07", "score": "0.6480902", "text": "function stringToUtf8ByteArray (str) {\n str = str.replace(/\\r\\n/g, '\\n');\n var out = [], p = 0;\n for (var i = 0; i < str.length; i++) {\n var c = str.charCodeAt(i);\n if (c < 128) {\n out[p++] = c;\n } else if (c < 2048) {\n out[p++] = (c >> 6) | 192;\n out[p++] = (c & 63) | 128;\n } else {\n out[p++] = (c >> 12) | 224;\n out[p++] = ((c >> 6) & 63) | 128;\n out[p++] = (c & 63) | 128;\n }\n }\n return out;\n}", "title": "" }, { "docid": "a4d2280a8ae226dc9e27935b1576fb57", "score": "0.6475205", "text": "function base64ToBuffer(base64Str) {\n var binary = window.atob(base64Str);\n var len = binary.length;\n var bytes = new window.Uint8Array(len);\n for(var i = 0; i < len; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n\n return new Buffer(bytes.buffer);\n }", "title": "" }, { "docid": "92f62cf67bcb96ea1d0bedeeac352bcb", "score": "0.64746255", "text": "static base64toUint16(base64String) {\n const buffer = this.base64toArrayBuffer(base64String);\n return new Uint16Array(buffer);\n }", "title": "" }, { "docid": "15c384f232c7fd1cbdd9516bcdca70d1", "score": "0.6413686", "text": "function binaryStringToArraybuffer( binary_string ){\n\tvar len = binary_string.length;\n\tvar bytes = new Uint8Array( len );\n\tfor ( var i = 0 ; i < len ; i++ ) {\n\t\tbytes[i] = binary_string.charCodeAt( i );\n\t}\n\treturn bytes;\n}", "title": "" }, { "docid": "7cb70ec77e5d39f8de0745e9824be9d0", "score": "0.64081424", "text": "function stringToByteArray(str) {\n const byteArray = [];\n\n // eslint-disable-next-line functional/no-loop-statements, functional/no-let, no-plusplus\n for (let i = 0; i < str.length; i++) {\n // eslint-disable-next-line functional/no-conditional-statements\n if (str.charCodeAt(i) <= 0x7F) {\n // eslint-disable-next-line functional/immutable-data\n byteArray.push(str.charCodeAt(i));\n // eslint-disable-next-line functional/no-conditional-statements\n } else {\n const h = encodeURIComponent(str.charAt(i)).substr(1).split('%');\n // eslint-disable-next-line functional/no-loop-statements, functional/no-let, no-plusplus\n for (let j = 0; j < h.length; j++) {\n // eslint-disable-next-line functional/immutable-data\n byteArray.push(parseInt(h[j], 16));\n }\n }\n }\n\n return byteArray;\n}", "title": "" }, { "docid": "d019954a68e09602c47b7692304cbe71", "score": "0.6406584", "text": "decodeStringToByteArray(input, webSafe) {\r\n this.init_();\r\n const charToByteMap = webSafe\r\n ? this.charToByteMapWebSafe_\r\n : this.charToByteMap_;\r\n const output = [];\r\n for (let i = 0; i < input.length;) {\r\n const byte1 = charToByteMap[input.charAt(i++)];\r\n const haveByte2 = i < input.length;\r\n const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\r\n ++i;\r\n const haveByte3 = i < input.length;\r\n const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\r\n ++i;\r\n const haveByte4 = i < input.length;\r\n const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\r\n ++i;\r\n if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\r\n throw new DecodeBase64StringError();\r\n }\r\n const outByte1 = (byte1 << 2) | (byte2 >> 4);\r\n output.push(outByte1);\r\n if (byte3 !== 64) {\r\n const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\r\n output.push(outByte2);\r\n if (byte4 !== 64) {\r\n const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\r\n output.push(outByte3);\r\n }\r\n }\r\n }\r\n return output;\r\n }", "title": "" }, { "docid": "0fe46d96ea13f30f10b2b79c626ebb3b", "score": "0.6405203", "text": "function fromBase64String(inputStr) {\n return Buffer.from(inputStr, 'base64');\n }", "title": "" }, { "docid": "4d18c1fd4044d0b7070475d722c1a2d8", "score": "0.63961256", "text": "function base64EncodingUTF8(str) {\n var encoded = new TextEncoderLite('utf-8').encode(str); \n var b64Encoded = base64js.fromByteArray(encoded);\n return b64Encoded;\n}", "title": "" }, { "docid": "1c82fa8e46aa89eb13ccaf8a1515a0c4", "score": "0.63618964", "text": "function hexToUint8Array(str) {\n if (!isHexString(str)) {\n throw new Error(\"Input string '\" + str + \"' is not a valid hex-encoded string\");\n }\n var matches = str.match(/.{1,2}/g);\n if (matches === null) {\n throw new Error(\"Input string '\" + str + \"' is not a valid hex-encoded string\");\n }\n return new Uint8Array(matches.map(function (byte) { return parseInt(byte, 16); }));\n}", "title": "" }, { "docid": "1c82fa8e46aa89eb13ccaf8a1515a0c4", "score": "0.63618964", "text": "function hexToUint8Array(str) {\n if (!isHexString(str)) {\n throw new Error(\"Input string '\" + str + \"' is not a valid hex-encoded string\");\n }\n var matches = str.match(/.{1,2}/g);\n if (matches === null) {\n throw new Error(\"Input string '\" + str + \"' is not a valid hex-encoded string\");\n }\n return new Uint8Array(matches.map(function (byte) { return parseInt(byte, 16); }));\n}", "title": "" }, { "docid": "572868d61380cbdd4f7321ae96ce6720", "score": "0.6351893", "text": "async function _64ToB(string) {\n var buff = Buffer.from(string, 'base64');\n return buff.buffer;\n }", "title": "" }, { "docid": "e8759402e832404489161681447091c7", "score": "0.6341008", "text": "function hexToUint8Array(str) {\n return new Uint8Array(str.match(/.{1,2}/g).map(function (byte) { return parseInt(byte, 16); }));\n}", "title": "" }, { "docid": "2ea592f82cded18e5c46dd63c8542bc7", "score": "0.6333359", "text": "static base64ToBytes(base64) {\n return Base64.decode(base64);\n }", "title": "" }, { "docid": "5cecb8b89c4f36ae8082e3fcae3ee3bb", "score": "0.63158005", "text": "function unicodeStringToTypedArray(s) {\n var escstr = encodeURIComponent(s);\n var binstr = escstr.replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode('0x' + p1);\n });\n var ua = new Uint8Array(binstr.length);\n Array.prototype.forEach.call(binstr, function (ch, i) {\n ua[i] = ch.charCodeAt(0);\n });\n return ua;\n}", "title": "" }, { "docid": "e0ffe830a46da3909126c9d025743b2b", "score": "0.63085926", "text": "function uint8ToBase64(buffer) {\n\tlet binary = '';\n\tlet len = buffer.byteLength;\n\tfor (let i=0; i < len; i++) {\n\t\tbinary += String.fromCharCode(buffer[i]);\n\t}\n\treturn window.btoa( binary );\n}", "title": "" }, { "docid": "fe8d3d58e381e81fa0f339aa2c841f73", "score": "0.62650263", "text": "function base64ToArrayByte(sBase64, nBlocksSize) { \n\n var\n sB64Enc = sBase64.replace(/[^A-Za-z0-9\\+\\/]/g, \"\"), nInLen = sB64Enc.length,\n nOutLen = nBlocksSize ? Math.ceil((nInLen * 3 + 1 >> 2) / nBlocksSize) * nBlocksSize : nInLen * 3 + 1 >> 2, taBytes = new Uint8Array(nOutLen);\n\n for (var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) {\n nMod4 = nInIdx & 3;\n nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 6 * (3 - nMod4);\n if (nMod4 === 3 || nInLen - nInIdx === 1) {\n for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {\n taBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;\n }\n nUint24 = 0;\n\n }\n }\n\n return taBytes;\n\n}", "title": "" }, { "docid": "6229d78cf51ce11fcd4e6071f3b5422e", "score": "0.6264649", "text": "function decodeBase64(string, encoding = 'utf-8') {\n return Buffer.from(string, 'base64').toString(encoding);\n}", "title": "" }, { "docid": "590d8cc1dd762072e19d765809aad19e", "score": "0.62644094", "text": "function string_to_arrayBuffer_of_utf8_uint8(\n a_data)\n{\n var arr = string_to_string_of_uint8_utf8(a_data);\n var ret = string_of_uint8_to_arrayBuffer_of_uint8(arr);\n\n return ret;\n}", "title": "" }, { "docid": "45b31e686844a20e9868627731e91573", "score": "0.6240865", "text": "function base64_decode(data) {\r\n // discuss at: http://phpjs.org/functions/base64_decode/\r\n // original by: Tyler Akins (http://rumkin.com)\r\n // improved by: Thunder.m\r\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // input by: Aman Gupta\r\n // input by: Brett Zamir (http://brett-zamir.me)\r\n // bugfixed by: Onno Marsman\r\n // bugfixed by: Pellentesque Malesuada\r\n // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');\r\n // returns 1: 'Kevin van Zonneveld'\r\n // example 2: base64_decode('YQ===');\r\n // returns 2: 'a'\r\n\r\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\r\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\r\n ac = 0,\r\n dec = '',\r\n tmp_arr = [];\r\n\r\n if (!data) {\r\n return data;\r\n }\r\n\r\n data += '';\r\n\r\n do { // unpack four hexets into three octets using index points in b64\r\n h1 = b64.indexOf(data.charAt(i++));\r\n h2 = b64.indexOf(data.charAt(i++));\r\n h3 = b64.indexOf(data.charAt(i++));\r\n h4 = b64.indexOf(data.charAt(i++));\r\n\r\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\r\n\r\n o1 = bits >> 16 & 0xff;\r\n o2 = bits >> 8 & 0xff;\r\n o3 = bits & 0xff;\r\n\r\n if (h3 == 64) {\r\n tmp_arr[ac++] = String.fromCharCode(o1);\r\n } else if (h4 == 64) {\r\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\r\n } else {\r\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\r\n }\r\n } while (i < data.length);\r\n\r\n dec = tmp_arr.join('');\r\n\r\n return dec.replace(/\\0+$/, '');\r\n}", "title": "" }, { "docid": "ea4735391191ee4ae8cdb904a09f8d09", "score": "0.6230392", "text": "toBase64(uint8Array) {\n return tweetnaclUtil.encodeBase64(uint8Array);\n }", "title": "" }, { "docid": "fd00d13d27aaa331dae0abb58b38e4a0", "score": "0.61880517", "text": "decode(str){\n Base64.init()\n var end = str.length\n while(end>=0 && str.charAt(end-1)=='=') end--\n if(end<2) throw '·Invalid Base64 string at· ' + end\n var m = (end%4)\n if(m==1) throw '·Invalid Base64 string at· ' + (end-1)\n if(m>1) m--\n var n = 3*Math.floor(end/4) + m\n var blob = new Uint8Array(n)\n var control =[[2,4,1],[4,2,1],[6,0,2]]\n var left, right\n var k=0\n var c=0\n for(var i=0; i<n; i++){\n left = Base64.a2i[str.charAt(k)]\n right = Base64.a2i[str.charAt(k+1)]\n if(left===undefined || right===undefined) throw '·Invalid Base64 string at· ' + k\n blob[i] = (left << control[c][0]) |( right >> control[c][1])\n k+=control[c][2]\n c = (c+1)%3\n } \n return blob\n }", "title": "" }, { "docid": "29b067c5c6198056a95c028fb176716f", "score": "0.6181282", "text": "function decodeString(value) {\n var byteString = atob(value);\n var arr = new Uint8Array(byteString.length);\n for (var i = 0; i < byteString.length; i++) {\n arr[i] = byteString.charCodeAt(i);\n }\n return arr;\n}", "title": "" }, { "docid": "ab3e8254ba6fc2812de50594bea25e68", "score": "0.61330265", "text": "function decode(encoded) {\n const binary =\n typeof atob === \"function\"\n ? atob(encoded)\n : new Buffer(encoded, \"base64\").toString(\"binary\");\n\n return Uint8Array.from(binary, (c) => c.charCodeAt(0)).buffer;\n }", "title": "" }, { "docid": "8dff48053191ace97be5705f513cb5bd", "score": "0.61272985", "text": "convertDataURIToBinary (dataURI) {\n const BASE64_MARKER = ';base64,';\n const base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;\n const base64 = dataURI.substring(base64Index);\n const raw = window.atob(base64);\n const rawLength = raw.length;\n const array = new Uint8Array(new ArrayBuffer(rawLength));\n\n for (let i = 0; i < rawLength; i++) {\n array[i] = raw.charCodeAt(i);\n }\n return array;\n }", "title": "" } ]
fab5711ab7c256eca685e4b61e9832d6
Handles before the slider middle are stacked later = higher, Handles after the middle later is lower [[7] [8] .......... | .......... [5] [4]
[ { "docid": "0716756b1a3bcd3bbe468a17cb25e4d1", "score": "0.0", "text": "function setZindex ( ) {\n\n\t\tscope_HandleNumbers.forEach(function(handleNumber){\n\t\t\tvar dir = (scope_Locations[handleNumber] > 50 ? -1 : 1);\n\t\t\tvar zIndex = 3 + (scope_Handles.length + (dir * handleNumber));\n\t\t\tscope_Handles[handleNumber].style.zIndex = zIndex;\n\t\t});\n\t}", "title": "" } ]
[ { "docid": "91d336948db480320ab3b89b2b67324f", "score": "0.6542515", "text": "_backDivTrackDuring(e) {\n var sliderMin = this.shadowRoot.querySelector(\"#sliderMin\");\n var sliderMax = this.shadowRoot.querySelector(\"#sliderMax\");\n\n this._x1_Min = this._x0_Min + e.detail.dx;\n var immediateValueMin = sliderMin._calcStep(this._getRatioPos(sliderMin, this._x1_Min/this._xWidth));\n\n this._x1_Max = this._x0_Max + e.detail.dx;\n var immediateValueMax = sliderMax._calcStep(this._getRatioPos(sliderMax, this._x1_Max/this._xWidth));\n\n if(immediateValueMin >= this.min && immediateValueMax <= this.max) {\n this._setValuesWithCurrentDiff(immediateValueMin, immediateValueMax, false);\n }\n\n return;\n }", "title": "" }, { "docid": "8c0011c83ff401e104106e6256d3a011", "score": "0.6400508", "text": "_backDivDown(event) {\n // show pins if defined\n this._sliderMinDown();\n this._sliderMaxDown();\n\n // get the initial positions of knobs before dragging starts\n this._xWidth = this.shadowRoot.querySelector(\"#sliderMin\").getEle('#sliderBar').offsetWidth;\n this._x0_Min = (this.shadowRoot.querySelector(\"#sliderMin\").ratio / 100.) * this._xWidth;\n this._x0_Max = (this.shadowRoot.querySelector(\"#sliderMax\").ratio / 100.) * this._xWidth;\n\n return;\n }", "title": "" }, { "docid": "3155d02c0cd62cc45e55059a4f5ccb28", "score": "0.6220604", "text": "function liPrev() {\n if (ulPos <= 0) {\n ulPos = windowWidth * (ulArray.length - 1);\n ulTransform(ulSlider, ulPos);\n } else {\n ulPos -= windowWidth;\n ulTransform(ulSlider, ulPos);\n }\n }", "title": "" }, { "docid": "f003e42eae14cc149eaf9c3fabda28c3", "score": "0.61102265", "text": "function moveHandle(newValue) {\n\t var currentValue = toType(value) == \"array\" && value.length == 2 ? value[active - 1] : value,\n\t oldPos = formatPercent(scale(stepValue(currentValue))),\n\t newPos = formatPercent(scale(stepValue(newValue))),\n\t position = orientation === \"horizontal\" ? \"left\" : \"bottom\";\n\t if (oldPos !== newPos) {\n\n\t if (toType(value) == \"array\" && value.length == 2) {\n\t value[active - 1] = newValue;\n\t if (d3.event) {\n\t dispatch.slide(d3.event, value);\n\t };\n\t } else {\n\t if (d3.event) {\n\t dispatch.slide(d3.event.sourceEvent || d3.event, value = newValue);\n\t };\n\t }\n\n\t if (value[0] >= value[1]) return;\n\t if (active === 1) {\n\t if (toType(value) == \"array\" && value.length == 2) {\n\t position === \"left\" ? divRange.style(\"left\", newPos) : divRange.style(\"bottom\", newPos);\n\t }\n\n\t if (animate) {\n\t handle1.transition().styleTween(position, function () {\n\t return d3.interpolate(oldPos, newPos);\n\t }).duration(typeof animate === \"number\" ? animate : 250);\n\t } else {\n\t handle1.style(position, newPos);\n\t }\n\t } else {\n\n\t var width = 100 - parseFloat(newPos);\n\t var top = 100 - parseFloat(newPos);\n\n\t position === \"left\" ? divRange.style(\"right\", width + \"%\") : divRange.style(\"top\", top + \"%\");\n\n\t if (animate) {\n\t handle2.transition().styleTween(position, function () {\n\t return d3.interpolate(oldPos, newPos);\n\t }).duration(typeof animate === \"number\" ? animate : 250);\n\t } else {\n\t handle2.style(position, newPos);\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "5ae5d0636717f375bc4a528b67be6ab3", "score": "0.6070839", "text": "function moveHandle(newValue) {\n var currentValue = toType(value) == \"array\" && value.length == 2 ? value[active - 1]: value,\n oldPos = formatPercent(scale(stepValue(currentValue))),\n newPos = formatPercent(scale(stepValue(newValue))),\n position = (orientation === \"horizontal\") ? \"left\" : \"bottom\";\n if (oldPos !== newPos) {\n\n if (toType(value) == \"array\" && value.length == 2) {\n value[ active - 1 ] = newValue;\n if (d3.event) {\n dispatch.slide(d3.event, value );\n };\n } else {\n if (d3.event) {\n dispatch.slide(d3.event.sourceEvent || d3.event, value = newValue);\n };\n }\n\n if ( value[ 0 ] >= value[ 1 ] ) return;\n if ( active === 1 ) {\n if (toType(value) == \"array\" && value.length == 2) {\n (position === \"left\") ? divRange.style(\"left\", newPos) : divRange.style(\"bottom\", newPos);\n }\n\n if (animate) {\n handle1.transition()\n .styleTween(position, function() { return d3.interpolate(oldPos, newPos); })\n .duration((typeof animate === \"number\") ? animate : 250);\n } else {\n handle1.style(position, newPos);\n }\n } else {\n \n var width = 100 - parseFloat(newPos);\n var top = 100 - parseFloat(newPos);\n\n (position === \"left\") ? divRange.style(\"right\", width + \"%\") : divRange.style(\"top\", top + \"%\");\n \n if (animate) {\n handle2.transition()\n .styleTween(position, function() { return d3.interpolate(oldPos, newPos); })\n .duration((typeof animate === \"number\") ? animate : 250);\n } else {\n handle2.style(position, newPos);\n }\n }\n }\n }", "title": "" }, { "docid": "89e9e73190db5fc3e607e9e2c3de5971", "score": "0.60149413", "text": "function slide(){\n // indicador left inicia none; \n indicatorsLeft.hide();\n // slide do tamanho de todos os itens * o tamanho deles\n slider.outerWidth(total);\n // section do tamanho da janela\n parent.outerWidth(windowSize);\n // confirma \n items.outerWidth(sizeSlider);\n\n indicatorsLeft.click(function(event) {\n // right + sizeSlider\n slider.css('left', getLeft() + sizeSlider);\n indicatorsRight.show();\n if (getLeft() >= -(sizeSlider)){ indicatorsLeft.hide(); }\n });\n indicatorsRight.click(function(event) {\n // left - sizeSlider\n slider.css('left', getLeft() - sizeSlider);\n indicatorsLeft.show();\n if (getLeft() <= -((interval * sizeSlider)-sizeSlider)){ indicatorsRight.hide(); }\n });\n // interval de -672 ~ 0 \n function getLeft(){\n let sliderLeft = parseInt(slider.css('left'),10);\n return sliderLeft;\n }\n}", "title": "" }, { "docid": "e4d4b346125ec081e3b3bb4f08c1ea11", "score": "0.5969771", "text": "function mSlidePrev() {\n jQuery(\".multi-section-slider .slider-nav\").find(\".prev\").click(function () {\n mViewItem = jQuery(this).parents(\".multi-section-slider\").attr(\"data-items\");\n mActiveIndex = jQuery(this).parents(\".multi-section-slider\").find(\".slider-nav\").find(\"span.active\").index();\n mParentWidth = jQuery(this).parents(\".multi-section-slider\").width();\n mItemLength = jQuery(this).parents(\".multi-section-slider\").find(\".item\").size();\n mItemWidth = mParentWidth / mViewItem;\n mItemsWidth = mItemWidth * mItemLength;\n mInitItem = mActiveIndex;\n mInitItem--;\n mLeftValue = mInitItem * mParentWidth;\n jQuery(this).parents(\".multi-section-slider\").find(\".slider\").stop(true, true).animate({\"margin-left\": \"-\" + mLeftValue + \"px\"}, 600);\n jQuery(this).parents(\".multi-section-slider\").find(\".slider-nav .we-navs span\").not(\".slider-nav .we-navs span:eq(\" + mInitItem + \")\").removeClass(\"active\");\n jQuery(this).parents(\".multi-section-slider\").find(\".slider-nav .we-navs span:eq(\" + mInitItem + \")\").addClass(\"active\");\n });\n}", "title": "" }, { "docid": "c05b6cbf03dabe5b14e1969ddefde437", "score": "0.5941071", "text": "function moveToPrevious(slider){\n\tslider.children().first().hide();\n\tslider.children().first().before(slider.children().last());\n\tslider.children().first().fadeIn();\n}", "title": "" }, { "docid": "8ac54e49391719726545a383551e5de6", "score": "0.5911221", "text": "_sliderMinDown() {\n this.shadowRoot.querySelector(\"#sliderMax\")._expandKnob();\n\n return;\n }", "title": "" }, { "docid": "dec57fd3d61c2eafc0892726877478b0", "score": "0.5904644", "text": "function sliderChange(e) {\n clearTimeout(e.intervalSlideChange)\n e.prev = e.sliderContainer.getElementsByClassName('current-slide')[0]\n\n // calculate slide index\n if (e.settings.slideIndex < 0) {\n e.settings.slideIndex = e.num - 1\n if (e.num) {\n e.indicators[0].parentElement.classList.add('transition-last')\n setTimeout(function () {\n e.indicators[0].parentElement.classList.remove('transition-last')\n }, 1000)\n }\n } else if (e.settings.slideIndex > e.num - 1) {\n e.settings.slideIndex = 0\n if (e.num) {\n e.indicators[0].parentElement.classList.add('transition-first')\n setTimeout(function () {\n e.indicators[0].parentElement.classList.remove('transition-first')\n }, 1000)\n }\n }\n\n // set classes based on slide index\n if (e.num > 1) {\n // remove current styles\n e.sliderContainer.classList.remove('forwards', 'backwards')\n for (let i = 0; i < e.num; i++) {\n e.slides.children[i].classList.remove('current-slide', 'prev-slide', 'next-slide')\n if (e.num) {\n e.indicators[i].classList.remove('current-indicator')\n }\n }\n // add direction class\n if (e.settings.prevIndex < e.settings.slideIndex) {\n e.sliderContainer.classList.add('forwards')\n } else {\n e.sliderContainer.classList.add('backwards')\n }\n\n // add previous slide\n e.prev.classList.add('prev-slide')\n\n if (e.settings.slideIndex === e.num - 1) {\n e.slides.children[0].classList.add('next-slide')\n } else {\n if (e.slides.children[e.settings.slideIndex + 1]) {\n e.slides.children[e.settings.slideIndex + 1].classList.add('next-slide')\n }\n }\n\n e.slides.children[e.settings.slideIndex].classList.add('current-slide')\n if (e.num) {\n e.indicators[e.settings.slideIndex].classList.add('current-indicator')\n }\n if (e.settings.slideTransition === \"pan\") {\n e.sliderContainer.children[1].style.transform = 'translateX(-' + e.settings.slideIndex / e.num * 100 + '%)'\n }\n\n // add and remove animating class to slider container\n e.sliderContainer.classList.add('animating')\n e.intervalPrevAnim = setTimeout(function () {\n e.sliderContainer.classList.remove('animating')\n }, e.settings.animationDuration * 1000)\n autoSlide(e)\n }\n }", "title": "" }, { "docid": "216863f03d623458e8daca674fa75294", "score": "0.5888918", "text": "function prev()\n{\n if(indexNo < 0)\n {\n indexNo = 2;\n }\n else\n {\n indexNo--;\n }\n\n // Calling the changeSlide function\n change(indexNo);\n // Calling the updateIndicator function\n update(indexNo);\n}", "title": "" }, { "docid": "7675d662e5386a3c08a37ffc9d77d154", "score": "0.58757967", "text": "function mSlideNext() {\n jQuery(\".multi-section-slider .slider-nav\").find(\".next\").click(function () {\n mViewItem = jQuery(this).parents(\".multi-section-slider\").attr(\"data-items\");\n mActiveIndex = jQuery(this).parents(\".multi-section-slider\").find(\".slider-nav\").find(\"span.active\").index();\n mParentWidth = jQuery(this).parents(\".multi-section-slider\").width();\n mItemLength = jQuery(this).parents(\".multi-section-slider\").find(\".item\").size();\n mItemWidth = mParentWidth / mViewItem;\n mItemsWidth = mItemWidth * mItemLength;\n mInitItem = mActiveIndex;\n mInitItem++;\n mLeftValue = mInitItem * mParentWidth;\n if ((mLeftValue + mParentWidth) > mItemsWidth) {\n mLeftValue = mItemsWidth - mParentWidth;\n }\n jQuery(this).parents(\".multi-section-slider\").find(\".slider\").stop(true, true).animate({\"margin-left\": \"-\" + mLeftValue + \"px\"}, 600);\n jQuery(this).parents(\".multi-section-slider\").find(\".slider-nav .we-navs span\").not(\".slider-nav .we-navs span:eq(\" + mInitItem + \")\").removeClass(\"active\");\n jQuery(this).parents(\".multi-section-slider\").find(\".slider-nav .we-navs span:eq(\" + mInitItem + \")\").addClass(\"active\");\n });\n}", "title": "" }, { "docid": "f78ef26d6e3e7497900b973ffad81ecd", "score": "0.58527905", "text": "function customSlider(sliderContainer, heightBasis) {\n var slideIndex = 1;\n\n showSlide(slideIndex);\n\n var interval = setInterval(function () { showSlide(slideIndex++, 0); }, 3000);\n\n // console.log(sliderContainer);\n\n var imageHeight = $(heightBasis).height();\n // console.log('Image Height ' + imageHeight);\n $(sliderContainer).css({ 'height': imageHeight });\n\n $(window).on('resize', function () {\n imageHeight = $(heightBasis).height();\n $(sliderContainer).css({ 'height': imageHeight });\n\n if ($(window).outerWidth() < 768) {\n startInterval();\n } else {\n stopInterval();\n }\n });\n\n function startInterval() {\n clearInterval(interval);\n interval = setInterval(function () { showSlide(slideIndex++); }, 3000);\n // console.log(\"start\");\n }\n\n function stopInterval() {\n clearInterval(interval);\n // console.log(\"stop\");\n }\n\n $(sliderContainer + ' .slider-switch span').on('click', function () {\n let slide = Number($(this).attr('data-target'));\n showSlide(slideIndex += slide, 1);\n startInterval();\n });\n\n $(sliderContainer + ' .slider-dots .slider-dot').on('click', function () {\n let dot = Number($(this).attr('data-target'));\n showSlide(slideIndex = dot, 1);\n startInterval();\n });\n\n function showSlide(n, type) {\n var i;\n var image = $(heightBasis);\n var dots = $(sliderContainer + \" .slider-dot\");\n var dots2 = $(sliderContainer + \" .slider-dots-wrapper .slider-dot\");\n if (type === 0) {\n n++;\n } else {\n n = slideIndex;\n }\n if (n > image.length) { slideIndex = 1; }\n if (n < 1) { slideIndex = image.length; }\n for (i = 0; i < image.length; i++) {\n $(image[i]).removeClass('fadeIn').addClass('fadeOut');\n }\n for (i = 0; i < dots.length; i++) {\n $(dots[i]).removeClass('active-dot');\n $(dots2[i]).removeClass('active-dot');\n }\n // console.log(\"n=\" + n, \"slideIndex=\" + slideIndex);\n $(image[slideIndex - 1]).removeClass('fadeOut hide').addClass('fadeIn');\n $(dots[slideIndex - 1]).addClass('active-dot');\n $(dots2[slideIndex - 1]).addClass('active-dot');\n }\n }", "title": "" }, { "docid": "88b640d08ec8800e20e394afac22058a", "score": "0.58408654", "text": "sliderMove(deltaPx) {\n // zmienna newpos wylicza procentowa pozycje suwaka na sliderze\n let sliderStartPositionPct = (this.elementPositionPx / this.sliderWidthPx) * 100;\n this.sliderNextPositionPct = (this.elementNextPositionPx / this.sliderWidthPx) * 100;\n let deltaPct = (deltaPx / this.sliderWidthPx) * 100;\n this.newPositionPct = sliderStartPositionPct - deltaPct;\n this.zipperWidthPct = (this.zipperWidthPx / this.sliderWidthPx) * 100;\n // this.sliderElementWidth\n // zmienna delt wylicza procentowa zmiane pozycji suwaka\n this.mouseDownElement.style.left = this.checkCollision() + '%';\n\n if (this.mouseDownElement == this.from)\n this.currentFromPositionPct = this.newPositionPct;\n if (this.mouseDownElement == this.to)\n this.currentToPositionPct = this.newPositionPct;\n }", "title": "" }, { "docid": "b012526c12eb01966a60365e20637c2d", "score": "0.58390856", "text": "function handleResize() {\n // 1. update height of step elements\n var secondstepH = Math.floor(window.innerWidth * 0.7);\n secondstep.style('height', secondstepH + 'px');\n\n var secondfigureHeight = window.innerWidth*(827/700)\n var secondfigureMarginTop = (window.innerHeight - secondfigureHeight) /2\n\nvar secondfigureHeight2 = 700*(827/700)\n var secondfigureMarginTop2 = (window.innerHeight)/5\n secondfigure\n .style('height', secondfigureHeight + 'px')\n .style('top', secondfigureMarginTop + 'px');\n\n\n\n\nif (window.innerWidth >700) { secondfigure\n .style('height', secondfigureHeight2 + 'px')\n .style('top', secondfigureMarginTop2 + 'px');\n} else {\n secondfigure\n .style('height', secondfigureHeight + 'px')\n .style('top', secondfigureMarginTop + 'px');\n}\n\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n }", "title": "" }, { "docid": "4da79b53ee4000d33fe4ffd78912ea7d", "score": "0.5836656", "text": "function customSlider(Xstart, Ystart, Xend, Yend, min, max, initial) {\n\n //these values need to be updated whenever window is resized\n this.Xstart = Xstart;\n this.Ystart = Ystart;\n this.Xend = Xend;\n this.Yend = Yend;\n this.min = min;\n this.max = max;\n this.initial = initial;\n\n //default values \n\n this.circleR = windowHeight / 50;\n this.circleFillH = 100;\n this.circleFillS = 0;\n this.circleFillB = 100;\n this.lineStrokeWidth = 1;\n this.lineStrokeH = 100;\n this.lineStrokeS = 100;\n this.lineStrokeB = 0;\n this.output = initial;\n this.outputinteger = this.output * this.max;\n \n //inverse indicates if logic is left to right or right to left\n this.inverse = false;\n this.clicked = false;\n \n //initialposition sets initial slider position based on initial decimal argument\n \n this.initialposition = function () {\n \n //if X of start and end are equal, that is a vertical slider\n if (this.Xstart == this.Xend) {\n \n this.circleX = this.Xstart;\n this.circleY = (this.Yend - this.Ystart) * (this.initial) + this.Ystart;\n \n } else {\n \n this.circleX = (this.Xend - this.Xstart) * (this.initial) + this.Xstart;\n this.circleY = (this.Yend - this.Ystart) * (this.initial) + this.Ystart;\n }\n }\n \n \n //Calculate slope (m) as delta Y / delta X\n\n this.linecalc = function() {\n \n //first calculate slope\n if (this.inverse == false) {\n this.slope = (this.Yend - this.Ystart) / (this.Xend - this.Xstart)\n } else {\n this.slope = (this.Ystart - this.Yend) / (this.Xstart - this.Xend)\n }\n \n //Solve for y intercept B\n //b = y - mx\n\n this.b = this.Ystart - this.slope * this.Xstart;\n }\n \n this.update = function() {\n\n }\n\n this.clickdetect = function() {\n\n if (clicked == true && mouseX > (this.circleX - this.circleR) && mouseX < (this.circleX + this.circleR) && mouseY > (this.circleY - this.circleR) && mouseY < (this.circleY + this.circleR)) {\n this.clicked = true;\n } else if (clicked == false) {\n this.clicked = false;\n }\n\n }\n this.display = function() {\n\n if (this.clicked == true) {\n\n //the line is expressed by y = mx+b\n //unless the X coordinate is equal for both points\n //m (slope) = delta Y / delta X\n\n if (this.Xstart < this.Xend) {\n\n if (mouseX > this.Xstart && mouseX < this.Xend) {\n this.circleX = mouseX;\n this.circleY = this.slope * mouseX + this.b;\n } else if (mouseX < this.Xstart) {\n this.circleX = this.Xstart;\n this.circleY = this.Ystart;\n } else if (mouseX > this.Xend) {\n this.circleX = this.Xend;\n this.circleY = this.Yend;\n }\n\n this.output = ((this.circleX - this.Xstart) / (this.Xend - this.Xstart));\n\n } else if (this.Xstart > this.Xend) {\n \n if (mouseX < this.Xstart && mouseX > this.Xend) {\n this.circleX = mouseX;\n this.circleY = this.slope * mouseX + this.b;\n } else if (mouseX > this.Xstart) {\n this.circleX = this.Xstart;\n this.circleY = this.Ystart;\n } else if (mouseX < this.Xend) {\n this.circleX = this.Xend;\n this.circleY = this.Yend;\n }\n \n this.output = ((this.circleX - this.Xstart) / (this.Xend - this.Xstart));\n \n }\n \n \n \n else if (this.Xstart == this.Xend && this.inverse == false) {\n\n if (mouseY > this.Ystart && mouseY < this.Yend) {\n this.circleX = this.Xstart;\n this.circleY = mouseY;\n\n } else if (mouseY < this.Ystart) {\n this.circleX = this.Xstart;\n this.circleY = this.Ystart;\n } else if (mouseY > this.Yend) {\n this.circleX = this.Xstart;\n this.circleY = this.Yend;\n }\n \n \n this.output = ((this.circleY - this.Ystart) / (this.Yend - this.Ystart));\n \n } else {\n \n if (mouseY < this.Ystart && mouseY > this.Yend) {\n this.circleX = this.Xstart;\n this.circleY = mouseY;\n\n } else if (mouseY > this.Ystart) {\n this.circleX = this.Xstart;\n this.circleY = this.Ystart;\n } else if (mouseY < this.Yend) {\n this.circleX = this.Xstart;\n this.circleY = this.Yend;\n }\n \n this.output = ((this.circleY - this.Ystart) / (this.Yend - this.Ystart));\n }\n this.outputinteger = this.max * this.output;\n }\n push();\n stroke(this.lineStrokeH, this.lineStrokeS, this.lineStrokeB);\n strokeWeight(this.lineStrokeWidth);\n fill(this.circleFillH, this.circleFillS, this.circleFillB);\n line(this.Xstart, this.Ystart, this.Xend, this.Yend);\n strokeWeight(1);\n ellipse(this.circleX, this.circleY, this.circleR * 2, this.circleR * 2);\n pop();\n \n }\n}", "title": "" }, { "docid": "ce6e2644a93bc8ff5b4a582ed39bd213", "score": "0.5833833", "text": "_backDivUp() {\n // hide pins if defined\n this._sliderMinUp();\n this._sliderMaxUp();\n\n return;\n }", "title": "" }, { "docid": "699adce008bca7aecee72ad3b6728278", "score": "0.57891685", "text": "function inSliderOrder ( values ) {\r\n\r\n\t\t// If only one handle is used, return a single value.\r\n\t\tif ( values.length === 1 ){\r\n\t\t\treturn values[0];\r\n\t\t}\r\n\r\n\t\tif ( options.dir ) {\r\n\t\t\treturn values.reverse();\r\n\t\t}\r\n\r\n\t\treturn values;\r\n\t}", "title": "" }, { "docid": "641940baffe4444826573b4b0a79267c", "score": "0.57637006", "text": "_updateBars (sliderNum, value) {\n const body = this.modules.renderer.body;\n\n if (!body.bars) {\n return;\n }\n\n const leftBar = body.bars[sliderNum - 1];\n const rightBar = body.bars[sliderNum];\n\n if (leftBar) {\n leftBar.style.right = `${(1 - value) * 100}%`;\n }\n\n if (rightBar) {\n rightBar.style.left = `${value * 100}%`;\n }\n }", "title": "" }, { "docid": "62567636d6c99570512e8aae90067bf1", "score": "0.57470375", "text": "function inSliderOrder ( values ) {\n\n\t\t\t// If only one handle is used, return a single value.\n\t\t\tif ( values.length === 1 ){\n\t\t\t\treturn values[0];\n\t\t\t}\n\n\t\t\tif ( options.dir ) {\n\t\t\t\treturn values.reverse();\n\t\t\t}\n\n\t\t\treturn values;\n\t\t}", "title": "" }, { "docid": "cae1c78ad1df3b696f76f618cd53b6af", "score": "0.5744882", "text": "function resetSliderHandlers() {\n var scf = new SliderCallbackFactory();\n var slider = $('#slider1');\n var sliderRight = [].slice.call(slider[0].getElementsByClassName(\"wg-right\"));\n // only the right div was replaced - only redo right div\n sliderRight.forEach(function (wgRight) {\n wgRight.onclick = scf.next(slider);\n });\n }", "title": "" }, { "docid": "b518f9355319dd1c9592a9220a919003", "score": "0.5718655", "text": "function inSliderOrder ( values ) {\n\n\t\t// If only one handle is used, return a single value.\n\t\tif ( values.length === 1 ){\n\t\t\treturn values[0];\n\t\t}\n\n\t\tif ( options.dir ) {\n\t\t\treturn values.reverse();\n\t\t}\n\n\t\treturn values;\n\t}", "title": "" }, { "docid": "b518f9355319dd1c9592a9220a919003", "score": "0.5718655", "text": "function inSliderOrder ( values ) {\n\n\t\t// If only one handle is used, return a single value.\n\t\tif ( values.length === 1 ){\n\t\t\treturn values[0];\n\t\t}\n\n\t\tif ( options.dir ) {\n\t\t\treturn values.reverse();\n\t\t}\n\n\t\treturn values;\n\t}", "title": "" }, { "docid": "b518f9355319dd1c9592a9220a919003", "score": "0.5718655", "text": "function inSliderOrder ( values ) {\n\n\t\t// If only one handle is used, return a single value.\n\t\tif ( values.length === 1 ){\n\t\t\treturn values[0];\n\t\t}\n\n\t\tif ( options.dir ) {\n\t\t\treturn values.reverse();\n\t\t}\n\n\t\treturn values;\n\t}", "title": "" }, { "docid": "b518f9355319dd1c9592a9220a919003", "score": "0.5718655", "text": "function inSliderOrder ( values ) {\n\n\t\t// If only one handle is used, return a single value.\n\t\tif ( values.length === 1 ){\n\t\t\treturn values[0];\n\t\t}\n\n\t\tif ( options.dir ) {\n\t\t\treturn values.reverse();\n\t\t}\n\n\t\treturn values;\n\t}", "title": "" }, { "docid": "c31c7b925c612c3d61cf5f39cd83ee83", "score": "0.5715846", "text": "function next() {\r\n hide();\r\n slider.children[current++].style.display = 'block' ;\r\n // Checks if the end is reached or not\r\n if (current >= slider.children.length) {\r\n current = 0;\r\n }\r\n}", "title": "" }, { "docid": "db980de2edc650319c484477d0e57b83", "score": "0.57091916", "text": "_swap() {\n if (this.carouselService.settings.items !== 1) {\n return;\n }\n // if (!$.support.animation || !$.support.transition) {\n // \treturn;\n // }\n this.carouselService.speed(0);\n let left;\n const previous = this.carouselService.slidesData[this.previous], next = this.carouselService.slidesData[this.next], incoming = this.carouselService.settings.animateIn, outgoing = this.carouselService.settings.animateOut;\n if (this.carouselService.current() === this.previous) {\n return;\n }\n if (outgoing) {\n left = +this.carouselService.coordinates(this.previous) - +this.carouselService.coordinates(this.next);\n this.carouselService.slidesData.forEach(slide => {\n if (slide.id === previous.id) {\n slide.left = `${left}px`;\n slide.isAnimated = true;\n slide.isDefAnimatedOut = true;\n slide.isCustomAnimatedOut = true;\n }\n });\n }\n if (incoming) {\n this.carouselService.slidesData.forEach(slide => {\n if (slide.id === next.id) {\n slide.isAnimated = true;\n slide.isDefAnimatedIn = true;\n slide.isCustomAnimatedIn = true;\n }\n });\n }\n }", "title": "" }, { "docid": "0eb707e65d1c5c81f7650b02ad3dd22c", "score": "0.5694016", "text": "handleSliderEvent(event) {\r\n if (this.state.sortingStatus !== \"ready\") return;\r\n\r\n event.persist();\r\n const numOfElements = event.target.value;\r\n const sortingElements = this.generateRandomArray(numOfElements, MAX_VALUE);\r\n\r\n // set trackerIndex sorting bar\r\n this.removeSortTrackerCSS();\r\n\r\n this.setState({\r\n numOfElements: numOfElements,\r\n sortingElements: sortingElements\r\n });\r\n }", "title": "" }, { "docid": "80d1986e270f042c0dd58b2dfb764ba0", "score": "0.56679666", "text": "function prevSlide()\n{\n //obtenemos los elementos en un array especificando la clase\n var itemsSlider = document.getElementsByClassName('slider-item')\n //se declaran e inicializan variables \n //guarda el elemento que tiene la clase active \n var activeItem = itemsSlider[0]\n //guarda el siguiente elemento que se va a activar \n var nextItem = itemsSlider[1]\n //guarda el numero de elementos que tiene itemSlider\n var lengthItemsSlider = itemsSlider.length\n\n // si solo existe un elemento arrojara un error\n if(lengthItemsSlider < 2) {\n console.error('El slider debe tener al menos 2 imágenes para un correcto funcionamiento')\n }\n //ciclo a la inversa: \n //se inicia el numero de elementos del arrego menos uno\n //si el indicador es mayor o igual a 0 \n //se resta uno al indicador\n for(var index = lengthItemsSlider - 1; index >= 0; index--) {\n \n //variable local: guarda el item que se esta revisando \n var currentItem = itemsSlider[index]\n\n //si el elemento contiene la clase active\n if(currentItem.classList.contains('active')) {\n \n //se guarda elemento\n activeItem = currentItem\n\n //y si es el primer item\n if(index == 0 ) {\n //el siguente item va ser el ULTIMO elemento del arreglo\n nextItem = itemsSlider[lengthItemsSlider - 1]\n }\n //si no el siguiente item sera el anterior \n else {\n nextItem = itemsSlider[index - 1]\n }\n }\n }\n //al item actual se le quita la clase active\n activeItem.classList.remove('active')\n // al siguiente item se le anade la clase active\n nextItem.classList.add('active')\n\n\n\n}", "title": "" }, { "docid": "20bbd7a1e686264bc809b741b82fa078", "score": "0.5665819", "text": "function liNext() {\n if (ulPos < windowWidth * (ulArray.length -1)) {\n ulPos += windowWidth;\n ulTransform(ulSlider, ulPos);\n } else {\n ulPos = 0;\n ulTransform(ulSlider, ulPos);\n }\n }", "title": "" }, { "docid": "de394462f8816ef851daa46c603d758e", "score": "0.5662992", "text": "function movePrev(){\n\t\t\tvar newPosition = getNewSliderPosition(false, slideStep);\n\t\t\tmoveSlider(newPosition);\n\t\t}", "title": "" }, { "docid": "48aaf6edb0ff36e964b11d9153bd228b", "score": "0.5662258", "text": "function Slider (obj_name, min_edge, max_edge, touchable) {\n this.name = obj_name;\n this.min_edge = min_edge;\n this.max_edge = max_edge;\n this.touchable = (touchable) ? touchable : false;\n this.visible = true;\n this.current_seq = 0; \n this.sequence_order = [\"track\", \"scrubber\"];\n this.track = {\n xorigin : 0,\n yorigin : 0,\n xdistance : 0,\n ydistance : 0,\n xinc : 0,\n yinc : 0,\n starting_frame : 0,\n iterations : 1,\n current_iteration : 0,\n current_cel : 0,\n cels : []\n };\n this.scrubber = {\n selected : false,\n xorigin : 0,\n yorigin : 0,\n xdistance : 0,\n ydistance : 0,\n xinc : 0,\n yinc : 0,\n starting_frame : 0,\n iterations : 1,\n current_iteration : 0,\n current_cel : 0,\n cels : []\n };\n this.me = this;\n this.constructor = Slider;\n}", "title": "" }, { "docid": "7ae83a9b45fc754192605c92c7c4db16", "score": "0.5645343", "text": "function onPrevSlide ()\n{\n // 1. Retirer la classe active sur l'image affichée\n // let activeSlide = document.querySelector('.slider-figure.active');\n // activeSlide.classList.remove('active'); // permet de supprimer la classe \"active\"\n \n // 2. Ajouter la classe active sur l'image que l'on veut afficher (la slide suivante)\n slide--;\n console.log(slide);\n \n // Si jamais on dépasse le premier élément du tableau on revient au dernier (taille du tableau -1)\n if (slide < 0) {\n slide = slides.length - 1;\n }\n \n // On récupère la slide précédente \n // let prevSlide = slides[slide];\n \n // Ajout de la classe active sur la slide suivante\n // prevSlide.classList.add('active');\n \n // Appelle de notre fonction qui regroupe les même données des deux fonctions\n updateSlide();\n\n}", "title": "" }, { "docid": "d6e3a8e7232bc9da4746f0f1f5fbba7f", "score": "0.5644994", "text": "function slider(data){\n let getFullScreenElement = document.querySelector('.fullscreen');\n let fullscreenIndex;\n imagesWrapperArray.map((element, index)=>{\n if(element == getFullScreenElement){\n fullscreenIndex = index;\n }\n }); \n imagesWrapperArray[fullscreenIndex].classList.remove('fullscreen');\n imagesWrapperArray[fullscreenIndex].style.display = 'none';\n data === 'next' ? nextPrevToggle('next', fullscreenIndex) : nextPrevToggle('prev', fullscreenIndex);\n}", "title": "" }, { "docid": "a7969f1356f6b34919486078d1555336", "score": "0.5643193", "text": "function slideBar(e) {\r\n \r\n setTimeout(function () {\r\n var newWidth = parseInt($(handle).css('left'));\r\n // set width of before img div \r\n before.width(newWidth);\r\n }, 30);\r\n\r\n e.stopPropagation();\r\n }", "title": "" }, { "docid": "46d6d53ad62ce992fe3c7d6fdd999241", "score": "0.56391394", "text": "function slider(){\n // function qui va definir une action\n\n for(var i = 0; i < images.length ; i++){\n //cela est ma boucle qui va definir mon cycle de passage*\n\n images[i].style.display = \"none\";\n\n }\n //*\n\n base++;\n //cela ajoute 1 de plus a chaque tours\n\n if ( base > images.length){\n //condition pour que le slider revienne au depart\n base = 1;\n }\n\n images[base -1].style.display = \"block\";\n //afffiche les images au lieu de les cachés\n// cacher les images\n}", "title": "" }, { "docid": "9584ebe94504aff394c28f40a841e0a4", "score": "0.56169945", "text": "function sider_back_or_forth ( pressed){\r\n //stop timer first\r\n clearInterval(slider_timer);\r\n\r\n if(pressed == 'back'){\r\n //subtract from current onject position\r\n current_slide = current_slide - 1;\r\n\r\n //check if is not less than 0\r\n if(current_slide < 0){ //make it length of slider list/array\r\n current_slide = slider_text_content.length -1;\r\n }\r\n // apply slider data at that position\r\n slider_data_apply(slider_text_content[current_slide].intro, slider_text_content[current_slide].header, slider_text_content[current_slide].body, slider_text_content[current_slide].image); \r\n return;\r\n }\r\n\r\n // if back was not pressed\r\n //increment slider for next item\r\n current_slide = current_slide + 1;\r\n\r\n //check if slider length is not more than what array contains//if make it zero\r\n if(current_slide > slider_text_content.length - 1 ){\r\n current_slide = 0;\r\n }\r\n\r\n document.getElementById('header_container').style.animation='fadeOut 6s';\r\n\r\n //animate background //fade out\r\n fade_animation(\"out\")\r\n\r\n\r\n // call function every x seconds\r\n slider_data_apply( slider_text_content[current_slide].intro, slider_text_content[current_slide].header, slider_text_content[current_slide].body, slider_text_content[current_slide].image); \r\n\r\n \r\n\r\n}", "title": "" }, { "docid": "37b72ca2a694d1bafd124271bf7c9128", "score": "0.56047785", "text": "function adjustTracks(slider) {\r\n\t\t\tvar vocab = getVocab(slider);\r\n\t\t\t// size the active / inactive part of the slider\r\n\t\t\t// trackToChange is _trackOnElm or _trackOffElm, length is width or height\r\n\t\t\tslider[vocab.trackToChange][0].style[vocab.length] = parseInt(slider._handleElm[0].style[vocab.pos]) + (slider._handleSize / 2) + \"px\";\r\n\t\t}", "title": "" }, { "docid": "13303e20dba582eccafd9cdd63a4200a", "score": "0.56023735", "text": "handleSlidePrevTransitionStart(){ \n categorizer.log(\"slidePrevTransitionStart\"); \n categorizer.handleSwipe(PhotoCategorizer.DIRECTION_RIGHT);\n }", "title": "" }, { "docid": "6e47ee5065229dc52ed76f7f557b5537", "score": "0.56003886", "text": "function moveToNext(slider){\n\tslider.children().last().after(slider.children().first());\n\tslider.children().last().hide();\n\tslider.children().first().fadeIn();\n}", "title": "" }, { "docid": "99c40e07cdcdf4e140c2fa42b904e65e", "score": "0.5599804", "text": "function placeSlider(){\n\t\t\n\t\t var sliderTop = 0;\n\t\t var sliderLeft = 0;\n\t\t var galleryHeight = g_gallery.getHeight();\n\t\t var sliderHeight = galleryHeight;\n\t\t \n\t\t if(g_objStripPanel && isPanelHidden() == false){\n\t\t\t var panelSize = g_objStripPanel.getSize();\n\t\t\t sliderHeight = galleryHeight - panelSize.height;\n\t\t }\n\t\t \n\t\t var sliderWidth = g_gallery.getWidth();\n\t\t \n\t\t //set parent container the panel\n\t\t g_objSlider.setSize(sliderWidth, sliderHeight);\n\t\t g_objSlider.setPosition(sliderLeft, sliderTop);\t\t\n\t}", "title": "" }, { "docid": "99c40e07cdcdf4e140c2fa42b904e65e", "score": "0.5599804", "text": "function placeSlider(){\n\t\t\n\t\t var sliderTop = 0;\n\t\t var sliderLeft = 0;\n\t\t var galleryHeight = g_gallery.getHeight();\n\t\t var sliderHeight = galleryHeight;\n\t\t \n\t\t if(g_objStripPanel && isPanelHidden() == false){\n\t\t\t var panelSize = g_objStripPanel.getSize();\n\t\t\t sliderHeight = galleryHeight - panelSize.height;\n\t\t }\n\t\t \n\t\t var sliderWidth = g_gallery.getWidth();\n\t\t \n\t\t //set parent container the panel\n\t\t g_objSlider.setSize(sliderWidth, sliderHeight);\n\t\t g_objSlider.setPosition(sliderLeft, sliderTop);\t\t\n\t}", "title": "" }, { "docid": "e5fc884cacd7063594356d4a657e208f", "score": "0.5595092", "text": "function adjustDivs() { \n output.textContent = slider.value;\n grid.style.gridTemplateColumns = `repeat(${slider.value}, 1fr)`;\n grid.style.gridTemplateRows = `repeat(${slider.value}, 1fr)`;\n \n let sliderSquare = Math.pow(slider.value, 2);\n let add = sliderSquare - grid.childElementCount;\n let sub = grid.childElementCount - sliderSquare;\n \n switch (true) {\n case grid.childElementCount < sliderSquare:\n gridItemAdder(add)\n break;\n case grid.childElementCount > slider.valueAsNumber:\n gridItemRemover(sub)\n default:\n break;\n }\n}", "title": "" }, { "docid": "3214e753020ef6cf1faf2274eea48666", "score": "0.55886006", "text": "function navigation() {\n jQuery(document).on(\"click\", \".we-slider span, .we-slider .prev, .we-slider .next\", function () {\n activeIndex = jQuery(this).parents(\".we-slider\").find(\".slider-nav\").find(\"span.active\").index();\n prevbtn = jQuery(this).parents(\".we-slider\").find(\".slider-nav\").find(\".prev\");\n nextbtn = jQuery(this).parents(\".we-slider\").find(\".slider-nav\").find(\".next\");\n itemLength = jQuery(this).parents(\".we-slider\").find(\".slider .item\").size();\n if (activeIndex === 0) {\n prevbtn.animate({\"opacity\": \"0\"}, 150);\n nextbtn.animate({\"opacity\": \"1\"}, 100);\n nextbtn.css({\"display\": \"block\"});\n setTimeout(function () {\n prevbtn.css({\"display\": \"none\"});\n }, 150);\n } else if (activeIndex >= (itemLength - 1)) {\n prevbtn.animate({\"opacity\": \"1\"}, 100);\n nextbtn.animate({\"opacity\": \"0\"}, 150);\n prevbtn.css({\"display\": \"block\"});\n setTimeout(function () {\n nextbtn.css({\"display\": \"none\"});\n }, 150);\n } else if (activeIndex === 0 && itemLength == 1) {\n prevbtn.css({\"display\": \"none\"});\n nextbtn.css({\"display\": \"none\"});\n } else {\n prevbtn.animate({\"opacity\": \"1\"}, 100);\n nextbtn.animate({\"opacity\": \"1\"}, 100);\n nextbtn.css({\"display\": \"block\"});\n prevbtn.css({\"display\": \"block\"});\n\n }\n });\n}", "title": "" }, { "docid": "4dc24264a4815d8d2c73dabe9cc5cdce", "score": "0.55717736", "text": "function sliderDrag(oldx, newx) {\n \n\n if (newx - oldx > 10) {\n oldX = newX;\n slide(\"left\");\n } else if(oldx - newx > 10) {\n oldX = newX;\n slide(\"right\");\n }\n \n }", "title": "" }, { "docid": "f0d4c9cfb05bab7645573ac2156d882a", "score": "0.557173", "text": "function arrangeBoxes() {\n $('.box').each( function(i, item) {\n var position = $('#slider').position().left + $('#slider-container').width()/2 + 20 + i * ( $(item).width() + 10 );\n // var position = $('#slider').position().left + i * ( $(item).width() + 10 );\n $(item).css('left', position + 'px');\n \n var img = $(item).children().children();\n var img_height = $(img).height();\n var item_height = $(item).height(); \n var new_height = parseInt( (item_height - img_height) / 2 ) + 'px';\n $(img).css('margin-top', new_height);\n });\n ////////////\n setInterval('shiftLeft()', 2000);\n}", "title": "" }, { "docid": "421305d5b38fe8a808952cc8bf739c8b", "score": "0.55686885", "text": "function mSlideNav() {\n\n jQuery(document).on(\"click\", \".multi-section-slider .slider-nav span\", function () {\n mViewItem = jQuery(this).parents(\".multi-section-slider\").attr(\"data-items\");\n mActiveIndex = jQuery(this).index();\n mParentWidth = jQuery(this).parents(\".multi-section-slider\").width();\n mItemLength = jQuery(this).parents(\".multi-section-slider\").find(\".item\").size();\n mItemWidth = mParentWidth / mViewItem;\n mItemsWidth = mItemWidth * mItemLength;\n mLeftValue = mActiveIndex * mParentWidth;\n if ((mLeftValue + mParentWidth) > mItemsWidth) {\n mLeftValue = mItemsWidth - mParentWidth;\n }\n jQuery(this).parents(\".multi-section-slider\").find(\".slider\").stop(true, true).animate({\"margin-left\": \"-\" + mLeftValue + \"px\"}, 600);\n jQuery(this).addClass(\"active\");\n jQuery(this).parents(\".multi-section-slider\").find(\".slider-nav\").find(\"span\").not(jQuery(this)).removeClass(\"active\");\n });\n}", "title": "" }, { "docid": "eddb5ad8d5d620eca118582af57ca37d", "score": "0.55673987", "text": "function ClickHandler4Back() {\r\n FromSlide2ToSlide1();\r\n }", "title": "" }, { "docid": "ef33e6cf9820b3cb5dde1aa07f955560", "score": "0.5548961", "text": "_handleResize() {\n\t\tif (!this.showTickmarks) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Mark resizing to avoid unneccessary calls to that function after rendering\n\t\tthis.notResized = false;\n\n\t\t// Convert the string represented calculation expression to a normal one\n\t\t// Check the distance in pixels exist between every tickmark\n\t\tconst spaceBetweenTickmarks = this._spaceBetweenTickmarks();\n\n\t\t// If the pixels between the tickmarks are less than 8 only the first and the last one should be visible\n\t\t// In such case the labels must correspond to the tickmarks, only the first and the last one should exist.\n\t\tif (spaceBetweenTickmarks < SliderBase.MIN_SPACE_BETWEEN_TICKMARKS) {\n\t\t\tthis._hiddenTickmarks = true;\n\t\t\tthis._labelsOverlapping = true;\n\t\t} else {\n\t\t\tthis._hiddenTickmarks = false;\n\t\t}\n\n\t\tif (this.labelInterval <= 0 || this._hiddenTickmarks) {\n\t\t\treturn;\n\t\t}\n\n\n\t\t// Check if there are any overlapping labels.\n\t\t// If so - only the first and the last one should be visible\n\t\tconst labelItems = this.shadowRoot.querySelectorAll(\".ui5-slider-labels li\");\n\t\tthis._labelsOverlapping = [...labelItems].some(label => label.scrollWidth > label.clientWidth);\n\t}", "title": "" }, { "docid": "170f5bdeb65642a0d3a3610186a6d5f8", "score": "0.55447847", "text": "function prev() {\n jQuery(\".we-slider .slider-nav\").find(\".prev\").click(function () {\n activeIndex = jQuery(this).parents(\".we-slider\").find(\".slider-nav\").find(\"span.active\").index();\n parentWidth = jQuery(this).parents(\".we-slider\").width();\n slider = jQuery(this).parents(\".we-slider\").find(\".slider\");\n initItem = activeIndex;\n initItem--;\n leftValue = parentWidth * initItem;\n slider.stop(true, true).animate({\"margin-left\": \"-\" + leftValue + \"px\"}, 600);\n jQuery(this).parents(\".we-slider\").find(\".slider-nav .we-navs span:eq(\" + initItem + \")\").addClass(\"active\");\n jQuery(this).parents(\".we-slider\").find(\".slider-nav .we-navs span\").not(\".slider-nav .we-navs span:eq(\" + initItem + \")\").removeClass(\"active\");\n });\n}", "title": "" }, { "docid": "c508cbab1d2a9dd92e8ff3b9f17dab72", "score": "0.55447483", "text": "function sliders(val, id) {\n\n let currentSlider = id.charAt(id.length - 1)\n\n// if the slider ends in 1 than it changes the background 1 colors and color codes\n if (currentSlider === '1') {\n if (id === 'rSliderB1'){\n colorRB1 = val\n let getHexOne = val / 16\n let firstHex = Math.floor(getHexOne)\n let secondHex = (getHexOne - Math.floor(getHexOne))*16\n hexRB1 = ('' + hexDictionary[firstHex] + hexDictionary[secondHex])\n } else if (id === 'gSliderB1'){\n colorGB1 = val\n let getHexOne = val / 16\n let firstHex = Math.floor(getHexOne)\n let secondHex = (getHexOne - Math.floor(getHexOne))*16\n hexGB1 = ('' + hexDictionary[firstHex] + hexDictionary[secondHex])\n } else if (id === 'bSliderB1'){\n colorBB1 = val\n let getHexOne = val / 16\n let firstHex = Math.floor(getHexOne)\n let secondHex = (getHexOne - Math.floor(getHexOne))*16\n hexBB1 = ('' + hexDictionary[firstHex] + hexDictionary[secondHex])\n }\n\n if(colorAB1 > .999){\n hValB1.innerHTML = `#${hexRB1}${hexGB1}${hexBB1}`\n rgbValueB1.innerHTML = `rgb(${colorRB1}, ${colorGB1}, ${colorBB1})`\n } else {\n hValB1.innerHTML = `#${hexRB1}${hexGB1}${hexBB1}${hexA1B1}${hexA2B1}`\n rgbValueB1.innerHTML = `rgba(${colorRB1}, ${colorGB1}, ${colorBB1}, ${colorAB1})`\n }\n\n// if the slider set ends in 2 changes the background 2 colors and color codes\n } else if (currentSlider === '2') {\n if (id === 'rSliderB2'){\n colorRB2 = val\n let getHexOne = val / 16\n let firstHex = Math.floor(getHexOne)\n let secondHex = (getHexOne - Math.floor(getHexOne))*16\n hexRB2 = ('' + hexDictionary[firstHex] + hexDictionary[secondHex])\n } else if (id === 'gSliderB2'){\n colorGB2 = val\n let getHexOne = val / 16\n let firstHex = Math.floor(getHexOne)\n let secondHex = (getHexOne - Math.floor(getHexOne))*16\n hexGB2 = ('' + hexDictionary[firstHex] + hexDictionary[secondHex])\n } else if (id === 'bSliderB2'){\n colorBB2 = val\n let getHexOne = val / 16\n let firstHex = Math.floor(getHexOne)\n let secondHex = (getHexOne - Math.floor(getHexOne))*16\n hexBB2 = ('' + hexDictionary[firstHex] + hexDictionary[secondHex])\n }\n\n if(colorAB2 > .999){\n hValB2.innerHTML = `#${hexRB2}${hexGB2}${hexBB2}`\n rgbValueB2.innerHTML = `rgb(${colorRB2}, ${colorGB2}, ${colorBB2})`\n } else {\n hValB2.innerHTML = `#${hexRB2}${hexGB2}${hexBB2}${hexA1B2}${hexA2B2}`\n rgbValueB2.innerHTML = `rgba(${colorRB2}, ${colorGB2}, ${colorBB2}, ${colorAB2})`\n }\n\n// changes the foreground color and color codes\n } else {\n if (id === 'rSlider'){\n colorR = val\n let getHexOne = val / 16\n let firstHex = Math.floor(getHexOne)\n let secondHex = (getHexOne - Math.floor(getHexOne))*16\n hexR = ('' + hexDictionary[firstHex] + hexDictionary[secondHex])\n } else if (id === 'gSlider'){\n colorG = val\n let getHexOne = val / 16\n let firstHex = Math.floor(getHexOne)\n let secondHex = (getHexOne - Math.floor(getHexOne))*16\n hexG = ('' + hexDictionary[firstHex] + hexDictionary[secondHex])\n } else if (id === 'bSlider'){\n colorB = val\n let getHexOne = val / 16\n let firstHex = Math.floor(getHexOne)\n let secondHex = (getHexOne - Math.floor(getHexOne))*16\n hexB = ('' + hexDictionary[firstHex] + hexDictionary[secondHex])\n }\n\n if(colorA > .999){\n hVal.innerHTML = `HEX: #${hexR}${hexG}${hexB}`\n rgbValue.innerHTML = `rgb(${colorR}, ${colorG}, ${colorB})`\n } else {\n hVal.innerHTML = `HEX: #${hexR}${hexG}${hexB}${hexA1}${hexA2}`\n rgbValue.innerHTML = `rgba(${colorR}, ${colorG}, ${colorB}, ${colorA})`\n }\n\n }\n\n displayColor.style.backgroundColor = `rgba(${colorR}, ${colorG}, ${colorB}, ${colorA})`\n backgroundOne.style.backgroundColor = `rgba(${colorRB1}, ${colorGB1}, ${colorBB1}, ${colorAB1})`\n backgroundTwo.style.backgroundColor = `rgba(${colorRB2}, ${colorGB2}, ${colorBB2}, ${colorAB2})`\n\n}", "title": "" }, { "docid": "a3041c255ed75729e897e3d11d4c3aae", "score": "0.55410147", "text": "updateSlider() {\n // just in case\n this.detached();\n\n let imgInf = this.image_config.image_info;\n\n // no slider for a 0 length dimension\n if (imgInf.dimensions['max_' + this.dim] <= 1) return;\n\n // create jquery slider\n $(this.elSelector).slider({\n orientation: this.dim === 'z' ? \"vertical\" : \"horizontal\",\n min: 0,\n max: imgInf.dimensions['max_' + this.dim] - 1 ,\n step: 0.01, value: imgInf.dimensions[this.dim],\n slide: (event, ui) => {\n if (this.player_info.handle !== null) return false;\n if (typeof event.keyCode === 'number') {\n let upKey =\n (event.keyCode === 38 || event.keyCode === 39);\n let downKey =\n (event.keyCode === 37 || event.keyCode === 40);\n let newVal = ui.value;\n if (upKey) newVal = Math.ceil(newVal);\n else if (downKey) newVal = Math.floor(newVal);\n $(this.elSelector).slider('value', newVal);\n return false;\n }\n let sliderValueSpan = $(this.elSelector + ' .slider-value');\n let newDimVal = Math.round(ui.value);\n let sliderTip =\n this.dim.toUpperCase() + \":\" + (newDimVal+1);\n if (this.dim === 't' && imgInf.image_delta_t.length > 0 &&\n newDimVal < imgInf.image_delta_t.length)\n sliderTip += \" [\" + imgInf.image_delta_t[newDimVal] + \"]\";\n sliderValueSpan.text(sliderTip);\n let percent = (ui.value / (imgInf.dimensions['max_' + this.dim] - 1)) * 100;\n if (this.dim === 'z') {\n sliderValueSpan.css({bottom: percent + \"%\"})\n } else {\n sliderValueSpan.css({left: percent + \"%\"})\n }\n sliderValueSpan.show();\n },\n stop: (event, ui) => {\n let sliderValueSpan = $(this.elSelector + ' .slider-value');\n sliderValueSpan.text(\"\");\n sliderValueSpan.hide();\n $(this.elSelector).slider('value', Math.round(ui.value));\n },\n change: (event, ui) => this.onChange(ui.value,\n event.originalEvent ? true : false)\n });\n $(this.element).show();\n }", "title": "" }, { "docid": "74c0910d7f74a53c0c8c12f62a7be81d", "score": "0.55390185", "text": "function setup(){\n createCanvas(windowWidth,windowHeight)\n background(220);\n\n//add during codealong\n//adjust to take the length of array\n imgPicker = createSlider(0,(listOfImg.length)-1,1)\n imgPicker.position(width/2,220)\n//end code along additions\n}", "title": "" }, { "docid": "7e261e886367351616ebcfcadfa3a1ba", "score": "0.55327314", "text": "initSliderPos() {\n const self = this\n const options = self.options\n // reset done\n for (const slide of self.targets) {\n Xt.dataStorage.remove(slide, `${self.ns}GroupPosDone`)\n }\n // @FIX performances\n const draggerWidth = self.detail.draggerWidth\n for (const slide of self.targets) {\n Xt.dataStorage.set(slide, `${self.ns}SlideHeight`, slide.children[0].offsetHeight)\n }\n // slides pos\n let slidesWidth = 0\n for (const slide of self.targets) {\n // once per group\n if (!Xt.dataStorage.get(slide, `${self.ns}GroupPosDone`)) {\n // vars\n const targets = self.getTargets(slide)\n let slideLeft = Infinity\n let slideWidth = 0\n let slideHeight = 0\n let slideHeightTemp = 0\n // vars\n for (const target of targets) {\n // @FIX performances\n const tl = Xt.dataStorage.get(target, `${self.ns}SlideLeft`)\n const sl = Xt.dataStorage.get(slide, `${self.ns}SlideLeft`)\n slideLeft = tl < slideLeft ? sl : slideLeft\n slideWidth += Xt.dataStorage.get(target, `${self.ns}SlideWidth`)\n slideHeightTemp = Xt.dataStorage.get(target, `${self.ns}SlideHeight`)\n slidesWidth += slideWidth\n slideHeight = slideHeightTemp > slideHeight ? slideHeightTemp : slideHeight\n }\n for (const target of targets) {\n Xt.dataStorage.set(target, `${self.ns}GroupPosDone`, true)\n Xt.dataStorage.set(target, `${self.ns}GroupHeight`, slideHeight)\n }\n // pos with alignment\n let pos\n if (!self.object.classList.contains('xt-overflow-auto')) {\n // @FIX disable slider if not overflowing\n if (options.align === 'center') {\n pos = draggerWidth / 2 - slideLeft - slideWidth / 2\n } else if (options.align === 'left') {\n pos = -slideLeft\n } else if (options.align === 'right') {\n pos = draggerWidth - slideLeft - slideWidth\n }\n }\n // save pos\n for (const target of targets) {\n Xt.dataStorage.set(target, `${self.ns}GroupPos`, pos)\n }\n }\n }\n // @FIX xt-wrap clone offsetWidth on resize\n for (const target of self.targets) {\n target.children[0].style.width = ''\n }\n // min max pos with contain\n if (options.contain && slidesWidth > draggerWidth) {\n // only if slides overflow dragger\n const slideFirst = self.targets[0]\n const slideFirstLeft = Xt.dataStorage.get(slideFirst, `${self.ns}SlideLeft`)\n const slideLast = self.targets[self.targets.length - 1]\n const slideLastLeft = Xt.dataStorage.get(slideLast, `${self.ns}SlideLeft`)\n const slideLastWidth = Xt.dataStorage.get(slideLast, `${self.ns}SlideWidth`)\n const min = -slideFirstLeft\n const max = -slideLastLeft + draggerWidth - slideLastWidth\n for (const group of self.group) {\n for (const target of group) {\n let pos = Xt.dataStorage.get(target, `${self.ns}GroupPos`)\n pos = pos > min ? min : pos\n pos = pos < max ? max : pos\n Xt.dataStorage.set(target, `${self.ns}GroupPos`, pos)\n }\n }\n }\n // @FIX position values negative margins\n for (const target of self.targets) {\n let pos = Xt.dataStorage.get(target, `${self.ns}GroupPos`)\n pos += self.detail.fixNegativeMargin\n Xt.dataStorage.set(target, `${self.ns}GroupPos`, pos)\n }\n // set wheel min and max\n if (options.wheel && options.wheel.selector) {\n const arr = self.targets.filter(x => !x.classList.contains('xt-wrap'))\n const first = arr[0]\n const last = arr[arr.length - 1]\n self.detail.wheelMin = -Xt.dataStorage.get(first, `${self.ns}GroupPos`)\n self.detail.wheelMax = -Xt.dataStorage.get(last, `${self.ns}GroupPos`)\n }\n }", "title": "" }, { "docid": "7cbc489d24d5b23b36fca7c662926d0e", "score": "0.5529694", "text": "function Backward(){\nvar v = document.querySelector(\"#slider\");\nvar slide = slider.value;\nvar now = parseInt(slide);\nv.setAttribute(\"value\",now-1);\nDrawMarker();\nvar q = document.querySelector(\"#infor\");\nq.setAttribute(\"style\",\"display: block\");\nvar z = document.querySelector(\"#infor2\");\nz.setAttribute(\"style\",\"display: block\");\n}", "title": "" }, { "docid": "b3153701ddb363868b0b531a212f9c1b", "score": "0.55275977", "text": "function moveSlider(e) {\n \n e.preventDefault();\n \n if (top + e.clientY - y < 1) {\n self.slider.css({\n 'top': 0\n });\n self.scrollcontent.css({\n 'margin-top': 0\n });\n return false;\n } else if (top + e.clientY - y > self.params.stopScroll - 1) {\n self.slider.css({\n 'top': self.params.stopScroll\n });\n self.scrollcontent.css({\n 'margin-top': self.params.scrollcontent_stop + 'px'\n });\n return false;\n } else {\n self.slider.css({\n 'top': (top + e.clientY - y) + 'px'\n });\n self.scrollcontent.css({\n 'margin-top': self.params.multiple * (-1 * (top + e.clientY - y)) + 'px'\n });\n }\n }", "title": "" }, { "docid": "9b0fcbab253f57d4374c0397e2c8990e", "score": "0.5526074", "text": "function hvrend(slider, clickLock, picCont, contName){\n slider.style.webkitTransform = ''; slider.style.msTransform = ''; slider.style.transform = '';\n if (!clickLock){ picCont.style.right = ''; picCont.style.left = ''; contName.style.right = ''; contName.style.left = ''; }\n }", "title": "" }, { "docid": "96dbe44e7c2282e45f414f2cc49e5885", "score": "0.5525521", "text": "function mInit() {\n jQuery(\".multi-section-slider\").each(function () {\n mViewItem = jQuery(this).attr(\"data-items\");\n mParentWidth = jQuery(this).width();\n mItem = jQuery(this).find(\".item\");\n mItemLength = jQuery(this).find(\".item\").size();\n mItem.css(\"width\", (mParentWidth / mViewItem) + \"px\");\n mSlider = jQuery(this).find(\".slider\");\n mNextbtn = jQuery(this).find(\".slider-nav .next\");\n mPrevbtn = jQuery(this).find(\".slider-nav .prev\");\n mTotalNav = Math.ceil(mItemLength / mViewItem);\n jQuery(this).find(\".slider-nav .we-navs\").empty();\n for (i = 0; i < mTotalNav; i++) {\n jQuery(this).find(\".slider-nav .we-navs\").append(\"<span class=''></span>\");\n }\n mSlider.css(\"margin-left\", \"0px\");\n jQuery(this).find(\".slider-nav .we-navs span\").not(\".slider-nav .we-navs .span:eq(0)\").removeClass(\"active\");\n jQuery(this).find(\".slider-nav .we-navs span:eq(0)\").addClass(\"active\");\n mPrevbtn.css({\"display\": \"none\", \"opacity\": \"0\"});\n mNextbtn.css(\"display\", \"block\");\n });\n}", "title": "" }, { "docid": "b3e932aa5c9e33f547dc7a096dc23d8a", "score": "0.55207515", "text": "function updatePosition(e) {\n let windowHeight = window.innerHeight\n if (isScrolledIntoView(e.sliderContainer, true, 0)) {\n let offset = (e.sliderContainer.getBoundingClientRect().top / windowHeight) * (e.sliderHeight * 0.3)\n for (let i = 0; i < e.num; i++) {\n e.slides.children[i].children[0].style.transform = 'translate3d(0px, 0px, 0px) scale(1.3) translateY( ' + (-offset) + 'px )'\n }\n }\n }", "title": "" }, { "docid": "319937d6763a841488f5f7c52b903b8a", "score": "0.55151325", "text": "function mCheckNav() {\n jQuery(document).on(\"click\", \".multi-section-slider span, .multi-section-slider .prev, .multi-section-slider .next\", function () {\n mViewItem = jQuery(this).parents(\".multi-section-slider\").attr(\"data-items\");\n mActiveIndex = jQuery(this).parents(\".multi-section-slider\").find(\".slider-nav\").find(\"span.active\").index();\n mPrevbtn = jQuery(this).parents(\".multi-section-slider\").find(\".slider-nav\").find(\".prev\");\n mNextbtn = jQuery(this).parents(\".multi-section-slider\").find(\".slider-nav\").find(\".next\");\n mItemLength = jQuery(this).parents(\".multi-section-slider\").find(\".item\").size();\n mTotalNav = Math.ceil(mItemLength / mViewItem);\n mItemLength = mTotalNav;\n if (mActiveIndex === 0) {\n mPrevbtn.animate({\"opacity\": \"0\"}, 150);\n mNextbtn.animate({\"opacity\": \"1\"}, 100);\n mNextbtn.css({\"display\": \"block\"});\n setTimeout(function () {\n mPrevbtn.css({\"display\": \"none\"});\n }, 150);\n } else if (mActiveIndex >= (mItemLength - 1)) {\n mPrevbtn.animate({\"opacity\": \"1\"}, 100);\n mNextbtn.animate({\"opacity\": \"0\"}, 150);\n mPrevbtn.css({\"display\": \"block\"});\n setTimeout(function () {\n mNextbtn.css({\"display\": \"none\"});\n }, 150);\n } else {\n mPrevbtn.animate({\"opacity\": \"1\"}, 100);\n mNextbtn.animate({\"opacity\": \"1\"}, 100);\n mNextbtn.css({\"display\": \"block\"});\n mPrevbtn.css({\"display\": \"block\"});\n\n }\n });\n}", "title": "" }, { "docid": "9147bb845a02d4fb23ee6e2875150fcb", "score": "0.5514716", "text": "function fAnimateSlider (elem, eTop, eLeft) {\n tMx.to (elem, animTym, {css: {y: eTop, x: eLeft}, ease: easePower});\n tMx.to (elem, animTym, {backgroundSize: \"+=25% +=25%\", ease: easePower});\n }", "title": "" }, { "docid": "4f48fde8686f77785423626842fd81df", "score": "0.550131", "text": "function adjustThumbPosition( x ) { // 15885\n var exactVal = percentToValue( positionToPercent( x )); // 15886\n var closestVal = minMaxValidator( stepValidator(exactVal) ); // 15887\n setSliderPercent( positionToPercent(x) ); // 15888\n thumbText.text( closestVal ); // 15889\n } // 15890", "title": "" }, { "docid": "ba1b4cbbf95343d9c8f160f235d6fbfd", "score": "0.5496733", "text": "sliderState(val){\n this.state.filterToggle && val != this.state.filterSlider ?\n (this.props.resetFilter(),\n this.setState({\n filterSlider: val,\n filterToggle: true\n })): this.state.filterToggle && val === this.state.filterSlider ?\n (console.log('middle'),\n this.setState({\n filterSlider: val,\n filterToggle: false\n })) :\n this.setState({\n filterSlider: val,\n filterToggle: true\n })\n }", "title": "" }, { "docid": "19c38aaf1192dfc28b47349282400cf2", "score": "0.5490973", "text": "function mainSlider() {\r\n var BasicSlider = $('.banner-area');\r\n var BasicSlider2 = $('.banner-area-2');\r\n var BasicSlider3 = $('.banner-area-3');\r\n\r\n BasicSlider.on('init', function (e, slick) {\r\n var $firstAnimatingElements = $('.banner-item:first-child').find('[data-animation]');\r\n doAnimations($firstAnimatingElements);\r\n });\r\n BasicSlider2.on('init', function (e, slick) {\r\n var $firstAnimatingElements = $('.banner-item:first-child').find('[data-animation]');\r\n doAnimations($firstAnimatingElements);\r\n });\r\n BasicSlider3.on('init', function (e, slick) {\r\n var $firstAnimatingElements = $('.banner-item:first-child').find('[data-animation]');\r\n doAnimations($firstAnimatingElements);\r\n });\r\n BasicSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) {\r\n var $animatingElements = $('.banner-item[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\r\n doAnimations($animatingElements);\r\n });\r\n BasicSlider2.on('beforeChange', function (e, slick, currentSlide, nextSlide) {\r\n var $animatingElements = $('.banner-item[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\r\n doAnimations($animatingElements);\r\n });\r\n BasicSlider3.on('beforeChange', function (e, slick, currentSlide, nextSlide) {\r\n var $animatingElements = $('.banner-item[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\r\n doAnimations($animatingElements);\r\n });\r\n\r\n BasicSlider.slick({\r\n autoplay: false,\r\n autoplaySpeed: 10000,\r\n dots: false,\r\n fade: true,\r\n arrows: true,\r\n prevArrow: '<span class=\"prev\"><i class=\"fas fa-angle-left\"></i></span>',\r\n nextArrow: '<span class=\"next\"><i class=\"fas fa-angle-right\"></i></span>',\r\n responsive: [\r\n {\r\n breakpoint: 1100,\r\n settings: {\r\n dots: false,\r\n arrows: false\r\n }\r\n },\r\n {\r\n breakpoint: 767,\r\n settings: {\r\n dots: false,\r\n arrows: false\r\n }\r\n }\r\n ]\r\n });\r\n \r\n BasicSlider2.slick({\r\n autoplay: false,\r\n autoplaySpeed: 10000,\r\n dots: true,\r\n fade: true,\r\n arrows: false,\r\n responsive: [\r\n {\r\n breakpoint: 1100,\r\n settings: {\r\n dots: false,\r\n arrows: false\r\n }\r\n },\r\n {\r\n breakpoint: 767,\r\n settings: {\r\n dots: false,\r\n arrows: false\r\n }\r\n }\r\n ]\r\n });\r\n \r\n BasicSlider3.slick({\r\n autoplay: false,\r\n autoplaySpeed: 10000,\r\n dots: false,\r\n fade: true,\r\n arrows: true,\r\n prevArrow: '<span class=\"prev\"><i class=\"fas fa-angle-left\"></i></span>',\r\n nextArrow: '<span class=\"next\"><i class=\"fas fa-angle-right\"></i></span>',\r\n responsive: [\r\n {\r\n breakpoint: 1100,\r\n settings: {\r\n dots: false,\r\n arrows: false\r\n }\r\n },\r\n {\r\n breakpoint: 767,\r\n settings: {\r\n dots: false,\r\n arrows: false\r\n }\r\n }\r\n ]\r\n });\r\n\r\n function doAnimations(elements) {\r\n var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\r\n elements.each(function () {\r\n var $this = $(this);\r\n var $animationDelay = $this.data('delay');\r\n var $animationType = 'animated ' + $this.data('animation');\r\n $this.css({\r\n 'animation-delay': $animationDelay,\r\n '-webkit-animation-delay': $animationDelay\r\n });\r\n $this.addClass($animationType).one(animationEndEvents, function () {\r\n $this.removeClass($animationType);\r\n });\r\n });\r\n }\r\n }", "title": "" }, { "docid": "583bc1d2447f947fbe03ea38f8ee2701", "score": "0.5488275", "text": "function prev() {\n newSlide = sliderInt - 1;\n showSlide(newSlide);\n}", "title": "" }, { "docid": "3001a0dd2775dd1a43f3b74331b7eac9", "score": "0.5484463", "text": "function updateSlider(curValue, y, yLast) {\n console.log(curValue)\n if(curValue <= targetValue + 5 && curValue >= 0){\n handle.attr(\"cy\", curValue);\n label\n .attr(\"y\", curValue)\n .text(formatDate(y.invert(curValue)));\n handleLast.attr(\"cy\",curValue);\n labelLast\n .attr(\"y\",curValue)\n .text(formatDate(yLast.invert(curValue)));\n }\n }", "title": "" }, { "docid": "f7083eb1b9bee311ff926c93babea897", "score": "0.54842913", "text": "function slideLeft() {\n reset();\n sliderImages[current - 1].style.display = \"block\";\n current--;\n}", "title": "" }, { "docid": "a4fcc2e8627f8604271a762781b1413b", "score": "0.54834574", "text": "function checkEdge() {\n var windowsLeftEdge = $('#slider').position().left;\n var newPosition = getNewPosition();\n \n $('.box').each( function(i, box ) {\n // var box = $('.box:first');\n var boxRightEdge = $(box).position().left + $(box).width(); \n if ( parseFloat(boxRightEdge) < parseFloat(windowsLeftEdge) ) { \n $(box).css('left', newPosition);\n $(box).remove().appendTo('#slider');\n }\n });\n \n}", "title": "" }, { "docid": "fcf1d95596deefde208dc9d511c27a11", "score": "0.5480537", "text": "function init(items){\n $mainContainer.each(function(){\n var slider=this;\n var itemsToSlide = items || $(slider).find('.content').children(\"*:not(script)\");\n var itemContainer = $(slider).find('.content');\n var $interval=null;\n var $goBackButton=$(this).find('.goBack');\n var $goForwardButton=$(this).find('.goForward');\n var leftPos=0;\n var firstItem=0;\n $goForwardButton.fadeOut(200).isHidden=true;\n\n /*===============Set width=========================*/\n //Here we set the width of the container of the gallery\n var generalMargin = parseFloat(itemsToSlide.css('margin-left'))+parseFloat(itemsToSlide.css('margin-right'))\n var totalWidth = 6*itemsToSlide.length;\n itemsToSlide.each(function(index,item){\n totalWidth+=$(item).width()\n }\n );\n itemContainer.width(totalWidth+'px');\n\n /*=================================================*/\n\n if(defaults.interaction=='hover'){\n $goBackButton.fadeOut(0);\n $goForwardButton.fadeOut(0);\n $(slider).on('mouseover',function(event){\n var $mousePosX=event.pageX - this.offsetLeft;\n if($mousePosX<=$(this).width()/2){\n clearInterval($interval);\n var diffBetweenBoxes=itemContainer.width()-$(slider).width();\n leftPos=parseInt(itemContainer.css('left'));\n if(Math.abs(leftPos)<=diffBetweenBoxes)\n $interval=setInterval(\n function(){\n if(Math.abs(leftPos)<=diffBetweenBoxes){\n itemContainer.css({'left':(leftPos-20)+'px'})\n }\n leftPos=parseFloat(itemContainer.css('left'));\n },75);\n }\n else{\n clearInterval($interval);\n leftPos=parseFloat(itemContainer.css('left'));\n if(leftPos<=0)$interval=setInterval(\n function(){\n if(leftPos<=0){\n itemContainer.css({'left':(leftPos+20)+'px'})\n }\n leftPos=parseFloat(itemContainer.css('left'));\n },75);\n }\n }).on('mouseout',function(){\n clearInterval($interval);\n });\n }\n else{\n $goForwardButton.fadeOut(200).isHidden=true;\n\n $goForwardButton.on('click',function(){\n event.preventDefault();\n firstItem--;\n itemContainer.css({'left':parseFloat(itemContainer.css('left'))+$(itemsToSlide[firstItem]).width()+6+'px'});\n\n if(firstItem==0)$goForwardButton.fadeOut(200).isHidden=true;\n if($goBackButton.isHidden)$goBackButton.fadeIn(600).isHidden=false;\n\n });\n $goBackButton.on('click',function(event){\n event.preventDefault();\n var totalItems=itemsToSlide.length-1;\n itemContainer.css({'left':parseFloat(itemContainer.css('left'))-$(itemsToSlide[firstItem]).width()-6+'px'});\n firstItem++;\n if(firstItem==totalItems)$goBackButton.fadeOut(200).isHidden=true;\n if($goForwardButton.isHidden)$goForwardButton.fadeIn(600).isHidden=false;\n });\n if(itemsToSlide.length<=1)\n $goBackButton.fadeOut(200).isHidden=true;\n\n\n }\n })\n\n }", "title": "" }, { "docid": "96e110c4550986a64f210bd05a9485e4", "score": "0.5480375", "text": "function moveLimit() {\r\n sliderX.max = (width-11*rad).toString();\r\n sliderY.max = (height-5*rad).toString();\r\n}", "title": "" }, { "docid": "e0005b79392492e8612aa8358b8ddb3e", "score": "0.5471617", "text": "function prev(){\n\tnewSlide=sliderInt - 1;\n\tshowSlide(newSlide);\n}", "title": "" }, { "docid": "c8188b1ab967ee3b04ee6d5538162d3a", "score": "0.5471403", "text": "function prev () {\n slide(false)\n }", "title": "" }, { "docid": "ef2960de3bc69a8dc6528d5b58c49df4", "score": "0.5471253", "text": "function getSlideThirdBack(){\n\t/*hide fourth slider*/\n\t$('.slider_fourth .personal_descr').css({\n\t\t'height': '400px',\n\t\t'padding-top': '60px',\n\t\t'opacity': '0.6',\n\t\t'box-shadow': 'none'\n\t});\n\t$('.slider_fourth .personal_descr h3').css({\n\t\t'margin-top': '75px',\n\t\t'font-size': '22px'\n\t});\n\t$('.slider_fourth .personal_descr h4').css({\n\t\t'margin-top': '2px',\n\t\t'font-size': '18px'\n\t});\n\t$('.slider_fourth .personal_descr p').css({\n\t\t'font-size': '14px'\n\t});\n\t$('.slider_fourth').animate({\n\t\t'top': '50px',\n\t\t'left': '95%',\n\t\t'margin-left': '0'\n\t\t}, 500, function(){\n\t\t\t$(this).css({\n\t\t\t\t'top': '50px',\n\t\t\t\t'left': '95%',\n\t\t\t\t'margin-left': '0',\n\t\t\t\t'cursor': 'pointer'\n\t\t\t})\n\t\t\t$(this).attr('onclick', 'getSlideFourth();');\n\t});\n\t$('.slider_left').attr('onclick', 'getSlideSecondBack()');\n\n\t/* Show back second slider */\n\t$('.slider_third').animate({\n\t\t'top': '0',\n\t\t'left': '50%',\n\t\t'margin-left': '-450px'\n\t\t}, 500, function(){\n\t\t\t$(this).css({\n\t\t\t\t'top': '0',\n\t\t\t\t'left': '50%',\n\t\t\t\t'margin-left': '-450px',\n\t\t\t\t'cursor': 'initial'\n\t\t\t})\n\t\t\t$(this).removeAttr('onclick', null)\n\t});\n\n\t$('.slider_third .personal_descr').css({\n\t\t'height': '500px',\n\t\t'padding-top': '105px',\n\t\t'opacity': '1',\n\t\t'box-shadow': '3px 3px 15px #030303'\n\t});\n\n\t$('.slider_third .personal_descr h3').css({\n\t\t'margin-top': '75px;',\n\t\t'font-size': '24px'\n\t});\n\n\t$('.slider_third .personal_descr h4').css({\n\t\t'margin-top': '25px',\n\t\t'font-size': '18px'\n\t});\n\n\t$('.slider_third .personal_descr p').css({\n\t\t'font-size': '16px'\n\t});\n\t/*Move first slider*/\n\t$('.slider_second').css('left', '-53%');\n\t$('.slider_fourth').css('left', '95%');\n\n\t/*show right button*/\n\t$('.slider_right').css('visibility', 'visible');\n}", "title": "" }, { "docid": "8e3656b6faf946357720968e879c5b14", "score": "0.5469382", "text": "function slider() {\n var items = document.querySelectorAll('.grid__item');\n var navLeft = document.querySelector('.slider-left');\n var navRight = document.querySelector('.slider-right');\n var index = 0;\n \n // Slider left navigation\n\n function goPrew() {\n\n for (var i = 0; i < items.length; i++) {\n items[i].className = 'grid__item preview hide';\n }\n\n index --;\n\n if(index < 0) {\n index = items.length-1;\n }\n\n items[index].className = 'grid__item preview show';\n\n }\n\n if (document.addEventListener) {\n navLeft.addEventListener('click', goPrew);\n } else if (document.attachEvent) {\n navLeft.attachEvent('onclick', goPrew);\n }\n\n // Slider right navigation\n\n function goNext() {\n\n for (var i = 0; i < items.length; i++) {\n items[i].className = 'grid__item preview hide';\n }\n\n index ++;\n\n if(index >= items.length) {\n index = 0;\n }\n\n items[index].className = 'grid__item preview show';\n\n }\n\n if (document.addEventListener) {\n navRight.addEventListener('click', goNext);\n } else if (document.attachEvent) {\n navRight.attachEvent('onclick', goNext);\n }\n }", "title": "" }, { "docid": "7d40e559c4725e94e90c54d29ca973e0", "score": "0.54655236", "text": "function nav_overview_right(){\n\n\tif(focusx+1<=maxx){\n\t\tfor(var i=0;focusx+1+i<=maxx;i++){\n\t\t\tvar tx = focusx+1+i;\n\t\t\tif(nav_array_overview[tx][focusy][\"id\"]!=undefined && nav_array_overview[tx][focusy][\"id\"]!=element){\n\t\t\t\tprevElement=element;\n\t\t\t\telement = nav_array_overview[tx][focusy][\"id\"];\t\n\t\t\t\tfocusx=tx;\n\t\t\t\t$(prevElement).parent().removeClass(\"sticker-glow\");\n\t\t\t\t$(element).parent().addClass(\"sticker-glow\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} \n}", "title": "" }, { "docid": "754fc5b6165cb6e42480d4d0b8960a88", "score": "0.5465402", "text": "function projectsSlider(i) {\n let sliderRightArr = document.querySelectorAll('.slider_right_arr')[i],\n firstPic = document.querySelectorAll('.image_one')[i],\n secondPic = document.querySelectorAll('.image_two')[i],\n thirdPic = document.querySelectorAll('.image_three')[i],\n picOneOrder = 1,\n picTwoOrder = 2,\n picThreeOrder = 3;\n sliderRightArr.addEventListener('click', function() {\n\n if (picOneOrder < 3) {\n picOneOrder++;\n } else {\n picOneOrder = 1;\n }\n \n switch(picOneOrder) {\n case 1:\n firstPic.style.order = \"1\";\n break;\n case 2:\n firstPic.style.order = \"2\";\n break;\n case 3: \n firstPic.style.order = \"3\";\n break;\n\n default:\n firstPic.style.order = \"1\";\n \n }\n\n if (picTwoOrder < 3) {\n picTwoOrder++;\n } else {\n picTwoOrder = 1;\n }\n \n switch(picTwoOrder) {\n case 1:\n secondPic.style.order = \"1\";\n break;\n case 2:\n secondPic.style.order = \"2\";\n break;\n case 3: \n secondPic.style.order = \"3\";\n break;\n\n default:\n secondPic.style.order = \"1\";\n \n }\n\n if (picThreeOrder < 3) {\n picThreeOrder++;\n } else {\n picThreeOrder = 1;\n }\n \n switch(picThreeOrder) {\n case 1:\n thirdPic.style.order = \"1\";\n break;\n case 2:\n thirdPic.style.order = \"2\";\n break;\n case 3: \n thirdPic.style.order = \"3\";\n break;\n\n default:\n thirdPic.style.order = \"1\";\n \n }\n });\n}", "title": "" }, { "docid": "f33bfe2893be06df44298ab48af07db7", "score": "0.5462119", "text": "function switchSlideNext(slide, next) {\r\n /* Positionnement du slide suivant */\r\n var p = centralSlideProperties(next);\r\n \r\n /* Variables de configuration */\r\n var l = $(co).find(\"slides > width > left\").text();\r\n var s = $(co).find(\"slides > transition > speed\").text();\r\n var e = $(co).find(\"slides > transition > ease > next\").text();\r\n \r\n /* Variables utiles */\r\n var lcore = $(slide).children(\"div.core\");\r\n var icore = $(next).children(\"div.core\");\r\n var mlcore = $(lcore).outerWidth(true) - $(lcore).width();\r\n var fostart = parseInt($(lcore).css(\"margin-left\")) + $(lcore).outerWidth(false);\r\n var fostop = parseInt(l) + mlcore;\r\n \r\n /* Variables standard */\r\n var x = 0, y, z = 1;\r\n \r\n /* Mise à jour du slide en cours */\r\n $(slide).toggleClass(\"selected\");\r\n \r\n /* Modification du contenu pour apparition */\r\n $(icore).css({\r\n \r\n });\r\n \r\n /* Animation du slide suivant */\r\n $(next).animate({\r\n \"width\" : p.width - 1\r\n }, {\r\n \"duration\" : parseInt(s),\r\n \"easing\" : e,\r\n \"step\" : function(now) {\r\n /* Taille du contenu sortant */\r\n x = p.width - now;\r\n y = parseInt(l) + x;\r\n $(slide).css(\"width\", Math.ceil(y) + \"px\");\r\n \r\n /* Animation du contenu sortant */\r\n if(x < fostart && z != 0) {\r\n z = (x - fostop) / fostart; \r\n if (z < 0) {\r\n z = 0;\r\n }\r\n }\r\n $(lcore).css({\r\n \"max-width\" : (p.width - mlcore - now) + \"px\",\r\n \"opacity\" : z\r\n });\r\n \r\n /* Animation du contenu entrant */\r\n $(icore).css({\r\n \"opacity\" : 1 - z\r\n });\r\n },\r\n \"complete\" : function() {\r\n /* Mise à jour du slide suivant */\r\n $(next).css({\r\n \"left\" : p.left + \"px\",\r\n \"right\" : \"auto\"\r\n });\r\n \r\n /* Mise à jour du slide en cours */\r\n $(slide).css({\r\n \"width\" : l + \"px\"\r\n });\r\n $(slide).children(\"div.core\").remove();\r\n \r\n /* Changement de classe */\r\n $(next).addClass(\"selected\");\r\n }\r\n })\r\n}", "title": "" }, { "docid": "32108e0464897afbe8034a1914c0dd44", "score": "0.54536647", "text": "handleSizeChange(e, val){\n const arrayBars = document.getElementsByClassName('sortvisualizer__ArrayBar');\n for(let i=0; i<this.state.array.length;i++){\n const barOneStyle = arrayBars[i].style;\n barOneStyle.backgroundColor = \"darkslateblue\";\n }\n switch(val){\n case 0:\n this.resetArray(320);\n this.setState({barSize: 1});\n break;\n case 1:\n this.resetArray(190);\n this.setState({barSize: 3});\n break;\n case 2:\n this.resetArray(136);\n this.setState({barSize: 5});\n break; \n case 3:\n this.resetArray(80);\n this.setState({barSize: 10});\n break;\n case 4:\n this.resetArray(40);\n this.setState({barSize: 20});\n break;\n case 5:\n this.resetArray(20);\n this.setState({barSize: 40});\n break;\n default:; \n }\n this.setState({sliderValue: val});\n }", "title": "" }, { "docid": "488995eb4162210584417323f5213a69", "score": "0.5448251", "text": "function onSlider(val) { //function receives the value on the slider\n\t\t\tif (val == 1) {\n\t\t\t\tphaseA1.addTo(map);\n\t\t\t\tphaseA2.remove();\n\t\t\t\tphaseA3.remove();\n\t\t\t};\n\t\t\t\n\t\t\tif (val == 2) {\n\t\t\t\tphaseA2.addTo(map);\n\t\t\t\tphaseA1.remove();\n\t\t\t\tphaseA3.remove();\n\t\t\t}; \n\t\t\tif (val == 3) {\n\t\t\t\tphaseA3.addTo(map);\n\t\t\t\tphaseA1.remove();\n\t\t\t\tphaseA2.remove();\n\t\t\t}; \n\t}", "title": "" }, { "docid": "fae57406b00c71f33d9a91f4388b5a06", "score": "0.5437809", "text": "function checkSlider(e) {\n // calculate when we need to show the box\n // console.log((window.scrollY + window.innerHeight))\n // console.log(sliderBox.height / 2)\n\n // half shown through box\n const slideInAt = (window.scrollY + window.innerHeight) - 100;\n console.log(slideInAt)\n // console.log(\"offset\", sliderBox.offsetTop)\n const isHalfShown = slideInAt > sliderBox.offsetTop;\n\n if (isHalfShown) {\n sliderBox.classList.add('active')\n }\n else {\n sliderBox.classList.remove('active')\n }\n}", "title": "" }, { "docid": "08ff692d63835d93bfbcf787d80904db", "score": "0.54353637", "text": "function prev()\n{\n\tslideIndex--;\n\tslideShow(); \n}", "title": "" }, { "docid": "aa42aed3e3d952a69fa4727e9f1315bf", "score": "0.54339594", "text": "handleDrag() {\n if (this.touchShiftValue > this.dragTriggerPoint) {\n this.index++; \n this.changeSlide();\n } else if (this.touchShiftValue < -this.dragTriggerPoint) {\n this.index--; \n this.changeSlide();\n } else {\n return;\n }\n }", "title": "" }, { "docid": "c1e2af5140d3d34532a508166d28c96a", "score": "0.54260474", "text": "appendAndCreateOpSlider(min, max, initV, unit, parent, propName) {\n // console.log(propName)\n let className = propName == \"condValue\" ? \"block\" : \"flex\"\n let sliderContainer = this.appendAndCreateContainer(className+\" option\", parent)\n let slider = this.p.createSlider(min, max, initV, 1)\n slider.elt.className = \"slider\"\n\n let valUnit = unit==\"cm\" ? `${slider.value()} cm` : `Köplats ${slider.value()}` \n \n\n let value = this.p.createDiv(valUnit)\n value.elt.className = \"sliderValue\"\n\n slider.elt.oninput = ()=>{\n\n //case for cut\n if(this.mech.portIn && propName==\"measure\") {\n let side = document.querySelector(\"#sideC .selected\").value\n slider.elt.max = this.mech.portIn.matList.map(m=>m.parts[side]).sort((a,b)=>b-a)[0] - 1\n value.elt.innerHTML = `${slider.value()} cm`\n } \n\n //case for sort\n if(this.mech.portIn && propName==\"condValue\") {\n let prop = document.querySelector(\"#propC .selected\").value\n if(prop==\"sRqueue\") {\n slider.elt.max = this.mech.portIn.matList.length \n value.elt.innerHTML = `Köplats ${slider.value()}`\n } else {\n this.mech.portIn.matList.map(m=>m.parts[prop]).sort((a,b)=>b-a)[0]\n value.elt.innerHTML = `${slider.value()} cm`\n }\n\n\n }\n }\n\n slider.elt.onchange = ()=>{\n //selects item\n //check if siblings are selected\n this.removeSelectedClass(parent)\n value.elt.classList.add(\"selected\")\n \n this.mech.parameters[propName] = slider.value()\n if(this.mech.parametersChanged()) {\n this.mech.resetOperation()\n } \n }\n\n value.elt.onclick = ()=>{\n //selects item\n //check if siblings are selected\n this.removeSelectedClass(parent)\n value.elt.classList.add(\"selected\")\n\n if(this.mech.parametersChanged()) {\n this.mech.resetOperation()\n } \n }\n\n\n\n\n sliderContainer.elt.appendChild(value.elt)\n sliderContainer.elt.appendChild(slider.elt)\n return sliderContainer\n }", "title": "" }, { "docid": "95dd5273749a0db64cc38b5426a9aa44", "score": "0.54190576", "text": "function forward() {\n var activeImage = $('.active');\n var activeCounter = $('.active-counter'); // scorrimento immagini\n\n activeImage.toggleClass('active');\n activeImage.next('img').toggleClass('active');\n\n if (activeImage.hasClass('last')) {\n imgFirst.toggleClass('active');\n } // scorrimento contatore\n\n\n activeCounter.toggleClass('active-counter');\n activeCounter.next('li').toggleClass('active-counter');\n\n if (activeCounter.hasClass('last-counter')) {\n counterFirst.toggleClass('active-counter');\n }\n } // Scorrimento slider indietro", "title": "" }, { "docid": "8bcc78be71ead093fb75a6cd76548c86", "score": "0.54162705", "text": "function e(e){switch(e){case\"above-along\":case\"below-along\":case\"center-along\":return 1;default:return 0}}", "title": "" }, { "docid": "abe978df783fa52abb82b857b96fbda0", "score": "0.541605", "text": "function htmSlider(){\n \n var slideWrap = jQuery('.sld-wrap');\n var nextLink = jQuery('.next-sld');\n var prevLink = jQuery('.prev-sld');\n var playLink = jQuery('.auto');\n var is_animate = false;\n var slideWidth = jQuery('.sld-item').outerWidth();\n var scrollSlider = slideWrap.position().left - slideWidth;\n \n nextLink.click(function(){\n if(!slideWrap.is(':animated')) {\n slideWrap.animate({left: scrollSlider}, 500, function(){\n slideWrap\n .find('.sld-item:first')\n .appendTo(slideWrap)\n .parent()\n .css({'left': 0});\n });\n }\n });\n\n \n prevLink.click(function(){\n if(!slideWrap.is(':animated')) {\n slideWrap\n .css({'left': scrollSlider})\n .find('.sld-item:last')\n .prependTo(slideWrap)\n .parent()\n .animate({left: 0}, 500);\n }\n });\n\n }", "title": "" }, { "docid": "54f0c55ac52f9a3f45e55a6ab05402d7", "score": "0.5413736", "text": "function next() {\n jQuery(\".we-slider .slider-nav\").find(\".next\").click(function () {\n activeIndex = jQuery(this).parents(\".we-slider\").find(\".slider-nav\").find(\"span.active\").index();\n parentWidth = jQuery(this).parents(\".we-slider\").width();\n slider = jQuery(this).parents(\".we-slider\").find(\".slider\");\n initItem = activeIndex;\n initItem++;\n leftValue = parentWidth * initItem;\n slider.stop(true, true).animate({\"margin-left\": \"-\" + leftValue + \"px\"}, 600);\n jQuery(this).parents(\".we-slider\").find(\".slider-nav .we-navs span\").not(\".slider-nav .we-navs span:eq(\" + initItem + \")\").removeClass(\"active\");\n jQuery(this).parents(\".we-slider\").find(\".slider-nav .we-navs span:eq(\" + initItem + \")\").addClass(\"active\");\n });\n}", "title": "" }, { "docid": "f404fb68149fab1763460f962e7e1d2d", "score": "0.54095215", "text": "function initialize() {\n totalItems = $(\"li\", $this.selector).length;\n itemsCnt = $($this.selector);\n // doy estilo al contenedor y a los items\n $this.addClass(\"ghSlider\");\n $this.css(\"width\", o.width + \"px\");\n $this.css(\"height\", o.height + \"px\");\n $(\"li\", $this.selector).each(function (indx, item) {\n $(item).css(\"width\", o.width + \"px\")\n .css(\"height\", o.height + \"px\");\n });\n itemsCnt.css(\"width\", o.width * totalItems + \"px\");\n // agrego flechas y les doy estilo\n if (o.arrows) {\n var prev = $(\"<a class='prev'>&#139;</a>\")\n .css(\"height\", o.height + \"px\")\n .css(\"line-height\", o.height + \"px\");\n $this.before(prev);\n var next = $(\"<a class='next'>&#155;</a>\")\n .css(\"height\", o.height + \"px\")\n .css(\"line-height\", o.height + \"px\");\n $this.after(next);\n }\n\n // añado evento a flechas\n\n $(document).on(\"click\", \".prev\", function () {\n if (!arrowsLocked) { // esperamos a que termine la animacion antes de dejar apretar otra vez\n if ($(itemsCnt).css(\"margin-left\").split(\"px\")[0] < 0) { // que no se exceda de los limites \n arrowsLocked = true; // bloqueamos el movimiento\n $(itemsCnt).animate({ \"margin-left\": \"+=\" + o.width }, \"slow\", function () {\n arrowsLocked = false; // permito mover otra vez\n });\n }\n }\n });\n\n $(document).on(\"click\", \".next\", function () {\n if (!arrowsLocked) { // esperamos a que termine la animacion antes de dejar apretar otra vez\n if ($(itemsCnt).css(\"margin-left\").split(\"px\")[0] + o.width < (o.width * totalItems)) { // que no se exceda de los limites \n arrowsLocked = true; // bloqueamos el movimiento\n $(itemsCnt).animate({ \"margin-left\": \"-=\" + o.width }, \"slow\", function () {\n arrowsLocked = false; // permito mover otra vez\n });\n }\n }\n });\n\n if (o.autoSlide) {\n // slide\n sliderTimeout = setInterval(function () {\n if (!arrowsLocked) {\n arrowsLocked = true; // bloqueamos el movimiento por flechas\n if (o.imagesShowed < totalItems - 1) {\n o.imagesShowed++;\n $(itemsCnt).animate({ \"margin-left\": \"-=\" + o.width }, \"slow\", function () {\n arrowsLocked = false; // permito mover otra vez\n });\n } else {\n o.imagesShowed = 0;\n // vuelvo a empezar\n $(itemsCnt).animate({ \"margin-left\": \"+=\" + o.width * (totalItems - 1) }, \"fast\", function () {\n arrowsLocked = false; // permito mover otra vez\n });\n }\n }\n }, o.secsToSlide * 1000);\n }\n }", "title": "" }, { "docid": "fc6987121ffc13f07f5aafb1232ee466", "score": "0.5406364", "text": "measureSlider() {\n this.sliderWidthPx = this.slider.getBoundingClientRect().width; // szerokosc slidera w danym momencie\n this.zipperWidthPx = this.from.getBoundingClientRect().width;\n this.sliderUnitPx = this.sliderWidthPx / (this.maxValue - this.minValue);\n\n }", "title": "" }, { "docid": "067354aea0cc215ccca9a17f0f45fe1d", "score": "0.54025674", "text": "function onSwipeTop() {\n return backToMiddle();\n removeNoTransition();\n transformUi(0, -1000, 0, currentElementObj);\n if(useOverlays){\n transformUi(0, -1000, 0, leftObj); //Move leftOverlay\n transformUi(0, -1000, 0, rightObj); //Move rightOverlay\n resetOverlays();\n }\n\n currentPosition = currentPosition + 1;\n updateUi();\n currentElement();\n changeBackground();\n changeStages();\n setActiveHidden();\n }", "title": "" }, { "docid": "7cf8713da02f5f15a7b97249b616361d", "score": "0.5399753", "text": "function init() {\n // check whether slider is needed\n createProgessBar();\n changeButtonPosition();\n\n gsap.set(\".project\", {\n x: \"-100%\"\n }); // images start off screen\n gsap.set(\".project\", {\n autoAlpha: 1\n }); // images all set to full opacity\n\n let currentStep = 0; //first image\n const totalSlides = document.querySelectorAll(\".project\").length; //total divs in slider\n\n const wrapper = gsap.utils.wrap(0, totalSlides); // slider will wrap back to 0 when total slides is reached\n\n createfirstTimeline(currentStep); //calls first slide in\n\n function createfirstTimeline(index) {\n leftImage = index - 1 < 0 ? totalSlides - 1 : index - 1; // if user presses back it will show last image\n // Handles only one slide\n if (totalSlides === 1) {\n const image = document.querySelector(\"div.project0\");\n gsap.timeline().fromTo(\n image, {\n x: \"0%\", //starting position - entering from righthand side\n }, {\n duration: 1.3,\n x: 0, //ending position - moving into the center\n zIndex: 10,\n }\n );\n } else {\n // If multiple divs in slider\n const imageInnerRight = document.querySelector(\"div.project\" + index);\n const imageFurthestRight = document.querySelector(\n \"div.project\" + (index + 1)\n );\n const imageInnerLeft = document.querySelector(\"div.project\" + leftImage);\n const timelineIn = gsap.timeline({\n id: \"timelineIn\"\n }); //creating gsap timeline\n timelineIn.fromTo(\n imageInnerRight, {\n x: \"0%\", //starting position - entering from righthand side\n }, {\n duration: 0,\n x: 0, //ending position - moving into the center\n zIndex: 10,\n }\n ),\n timelineIn.fromTo(\n imageInnerLeft, {\n x: \"-700\", //starting position - entering from the lefthand side\n }, {\n duration: 1.0,\n x: -700, //ending position - moving into the far left position (partially off lefthand side)\n },\n 0.7 // this sets a 0.7 second delay in tween starting\n ),\n timelineIn.fromTo(\n imageFurthestRight, {\n // autoAlpha: 0, //autoAlpha animates opacity - in this case from 0 to 1\n x: \"700\", //starting position (set above)\n }, {\n duration: 1.0,\n x: 700, //ending position - moving into the far right position (partially off right side)\n },\n 0.7 // this sets a 0.7 second delay in tween starting\n );\n return timelineIn;\n }\n }\n\n // createTimelineIn is called when button next or prev is clicked\n function createTimelineIn(direction, index, current) {\n const goPrev = direction === \"prev\";\n let imageFurthestLeft,\n imageInnerLeft,\n imageFurthestRight,\n imageInnerRight,\n position;\n\n // animating progress bar\n progressBar = document.querySelector(\".gallery-list__progress-bar\"); //to target in order to change position of progressbar indicator\n const progressIndicatorWidth = progressBar.clientWidth; //width of progressbar indicator set earlier\n progressBarWidth = document.querySelector(\".gallery-list__progress-track\")\n .clientWidth; //working out width of whole progress bar (based on 100% width of page)\n\n if (current === 0 && direction === \"prev\") {\n position = progressBarWidth - progressIndicatorWidth;\n } else if (current === totalSlides - 1 && direction === \"next\") {\n position = 0;\n } else if (direction === \"prev\") {\n position =\n `-=` + (progressBarWidth - progressIndicatorWidth) / (totalSlides - 1);\n } else {\n position =\n `+=` + (progressBarWidth - progressIndicatorWidth) / (totalSlides - 1);\n }\n if (!goPrev) {\n //working out which images to target in order to change their position in the timeline below\n toExit = current - 1 < 0 ? totalSlides - 1 : current - 1;\n toEnter = index + 1 > totalSlides - 1 ? 0 : index + 1;\n imageFurthestLeft = document.querySelector(\"div.project\" + toExit);\n imageInnerRight = document.querySelector(\"div.project\" + index);\n imageFurthestRight = document.querySelector(\"div.project\" + toEnter);\n imageInnerLeft = document.querySelector(\"div.project\" + current);\n } else {\n //working out which images to target in order to change their position in the timeline below\n toEnter = index - 1 < 0 ? totalSlides - 1 : index - 1;\n toExit = current + 1 > totalSlides - 1 ? 0 : current + 1;\n imageFurthestLeft = document.querySelector(\"div.project\" + toEnter);\n imageFurthestRight = document.querySelector(\"div.project\" + toExit);\n imageInnerRight = document.querySelector(\"div.project\" + current);\n imageInnerLeft = document.querySelector(\"div.project\" + index);\n }\n const timelineIn = gsap.timeline({\n id: \"timelineIn\"\n });\n timelineIn.fromTo(\n imageFurthestRight, {\n x: 1400,\n }, {\n runBackwards: goPrev ? true : false, //if user pressed back (goPrev is true) then runBackwards will reverse the start and end x position\n duration: 0.7,\n x: 700,\n }\n ),\n timelineIn.fromTo(\n imageInnerRight, {\n x: 700,\n }, {\n runBackwards: goPrev ? true : false,\n duration: 0.7,\n x: 0,\n zIndex: 10,\n },\n 0\n ),\n timelineIn.fromTo(\n imageInnerLeft, {\n x: 0,\n }, {\n runBackwards: goPrev ? true : false,\n duration: 0.7,\n x: -700,\n },\n 0\n ),\n timelineIn.fromTo(\n imageFurthestLeft, {\n x: -700,\n }, {\n runBackwards: goPrev ? true : false,\n duration: 0.7,\n x: -1400,\n },\n 0\n ),\n timelineIn.to(\n progressBar, {\n duration: 0.7,\n x: position,\n },\n 0\n );\n return timelineIn;\n }\n\n function updateCurrentStep(goToIndex) {\n currentStep = goToIndex;\n }\n\n function transition(direction, toIndex) {\n const timelineTransition = gsap.timeline({\n onStart: function () {\n console.log({\n fromIndex: currentStep\n }, {\n toIndex\n });\n updateCurrentStep(toIndex);\n },\n });\n const tlIn = createTimelineIn(direction, toIndex, currentStep);\n timelineTransition.add(tlIn); //calls function above createTimelineIn\n return timelineTransition;\n }\n\n function isTweening() {\n return gsap.isTweening(\".project\"); //prevents user being able to click twice on arrows and flick through many images before the transition is finished\n }\n\n document.querySelector(\"button.next\").addEventListener(\"click\", function (e) {\n e.preventDefault();\n const nextStep = wrapper(currentStep + 1);\n !isTweening() && transition(\"next\", nextStep);\n });\n\n document.querySelector(\"button.prev\").addEventListener(\"click\", function (e) {\n e.preventDefault();\n const prevStep = wrapper(currentStep - 1);\n !isTweening() && transition(\"prev\", prevStep);\n });\n\n // touch events\n let ts;\n $(\".project img\").on({\n touchstart: function (e) {\n ts = e.originalEvent.touches[0].clientX;\n },\n });\n\n $(\".project img\").on({\n touchmove: function (e) {\n var te = e.originalEvent.changedTouches[0].clientX;\n if (ts > te && totalSlides > 3) {\n const nextStep = wrapper(currentStep + 1);\n !isTweening() && transition(\"next\", nextStep);\n } else {\n const prevStep = wrapper(currentStep - 1);\n !isTweening() && transition(\"prev\", prevStep);\n }\n },\n });\n}", "title": "" }, { "docid": "673269bf13821cfd7db2d5da90ebd867", "score": "0.5399359", "text": "function slider() {\n var currentItem = 0,\n i,\n sliderArea = document.querySelector('[data-js=\"js-slider\"]'),\n carouselItems = sliderArea.querySelectorAll('.carousel-slider-item'),\n carouselItemWidth = Math.ceil(100 / carouselItems.length),\n totalWidth = carouselItems.length * 100;\n\n\n sliderArea.style.width = totalWidth + '%';\n\n for (i = 0; i <= carouselItems.length - 1; i++) {\n carouselItems[i].style.width = carouselItemWidth + '%';\n }\n\n function slideToRight(selectedItem) {\n var i = carouselItemWidth,\n time = 50;\n var sliding = setInterval(function () {\n if (i <= totalWidth) {\n carouselItems[selectedItem].style.marginLeft = \"-\" + i + \"%\";\n i--;\n } else {\n clearInterval(sliding);\n }\n }, time);\n }\n\n /*reset all image position*/\n function reset() {\n for (i = 0; i <= carouselItems.length - 1; i++) {\n slideToRight(i);\n }\n currentItem = 0;\n }\n\n function slideToLeft(selectedItem) {\n var i = 0,\n time = 50;\n\n var sliding = setInterval(function () {\n if (i <= carouselItemWidth) {\n carouselItems[selectedItem].style.marginLeft = \"-\" + i + \"%\";\n i++;\n } else {\n clearInterval(sliding);\n }\n }, time);\n }\n\n var slideInterval = setInterval(function () {\n if (currentItem <= carouselItems.length - 4) {\n slideToLeft(currentItem);\n currentItem++;\n\n } else {\n reset();\n }\n }, 2000);\n\n document.getElementById(\"slider\").addEventListener(\"mouseover\", function () {\n clearInterval(slideInterval);\n });\n document.getElementById(\"slider\").addEventListener(\"mouseout\", function () {\n slideInterval = setInterval(function () {\n if (currentItem <= carouselItems.length - 4) {\n slideToLeft(currentItem);\n currentItem++;\n\n } else {\n reset();\n }\n }, 4000);\n });\n} // end", "title": "" }, { "docid": "4feedf3239658bf9568436dd9a8c9946", "score": "0.5397877", "text": "render(){\n return(\n <section className=\"slider\">\n <div onClick={this.slideLeft} className=\"slider-btn siema-btn__left\">\n <img className=\"left-icon\" src={prevIcon} alt=\"\"/>\n </div>\n <div onClick={this.slideRight} className=\"slider-btn siema-btn__right\">\n <img className=\"right-icon\" src={nextIcon} alt=\"\"/>\n </div>\n <div className=\"siema\">\n \n <div className=\"siema-item\"><img className=\"siema-image\" src={firstImage}/></div>\n <div className=\"siema-item\"><img className=\"siema-image\" src={secondImage}/></div>\n <div className=\"siema-item\"><img className=\"siema-image\" src={thirdImage}/></div>\n <div className=\"siema-item\"><img className=\"siema-image\" src={fourthImage}/></div>\n <div className=\"siema-item\"><img className=\"siema-image\" src={fifthImage}/></div>\n <div className=\"siema-item\"><img className=\"siema-image\" src={sixthImage}/></div>\n <div className=\"siema-item\"><img className=\"siema-image\" src={seventhImage}/></div>\n <div className=\"siema-item\"><img className=\"siema-image\" src={eighthImage}/></div>\n <div className=\"siema-item\"><img className=\"siema-image\" src={ninethImage}/></div>\n <div className=\"siema-item\"><img className=\"siema-image\" src={tenthImage}/></div>\n \n\n \n </div>\n </section>\n )\n }", "title": "" }, { "docid": "38e0d8e03df4fd324280522b745490ad", "score": "0.5395627", "text": "function createLegendSlider() {\n // scrollpane parts\n var scrollPane = jQuery(\".scroll-pane\");\n var scrollContent = jQuery(\".scroll-content\");\n\n // Make sure that content width is always at least the outer width of the pane.\n // Then, floating works properly when window is resized and dimensions change.\n if (scrollContent.width() < scrollPane.outerWidth(true)) {\n scrollContent.width(scrollPane.outerWidth(true));\n }\n\n // build slider\n var scrollbar = jQuery(\".scroll-bar\").slider({\n slide : function(event, ui) {\n if (scrollContent.width() > scrollPane.width()) {\n scrollContent.css(\"margin-left\", Math.round(ui.value / 100 * (scrollPane.width() - scrollContent.width())) + \"px\");\n\n } else {\n scrollContent.css(\"margin-left\", 0);\n }\n }\n });\n\n // append icon to handle\n var handleHelper = scrollbar.find(\".ui-slider-handle\").mousedown(function() {\n scrollbar.width(handleHelper.width());\n }).mouseup(function() {\n scrollbar.width(\"100%\");\n }).append(\"<span class='ui-icon ui-icon-grip-dotted-vertical'></span>\").wrap(\"<div class='ui-handle-helper-parent'></div>\").parent();\n\n // change overflow to hidden now that slider handles the scrolling\n scrollPane.css(\"overflow\", \"hidden\");\n\n // Reset slider value based on scroll content position.\n var resetValue = function() {\n var remainder = scrollPane.width() - scrollContent.width();\n if (remainder > 0) {\n remainder = 0;\n }\n var leftVal = scrollContent.css(\"margin-left\") === \"auto\" ? 0 : parseInt(scrollContent.css(\"margin-left\"), 10);\n var percentage = !remainder ? 0 : Math.round(leftVal / remainder * 100);\n scrollbar.slider(\"value\", percentage);\n };\n\n // If the slider is 100% and window gets larger, reveal content.\n // Also, scale content if window is resized in any case.\n var reflowContent = function() {\n if (scrollContent.width() > scrollPane.width()) {\n var showing = scrollContent.width() + parseInt(scrollContent.css(\"margin-left\"), 10);\n var gap = scrollPane.width() - showing;\n if (gap > 0) {\n scrollContent.css(\"margin-left\", (parseInt(scrollContent.css(\"margin-left\"), 10) + gap) + \"px\");\n }\n\n } else {\n scrollContent.css(\"margin-left\", 0);\n }\n };\n\n // Size scrollbar and handle proportionally to scroll distance.\n var sizeScrollbar = function() {\n var remainder = scrollContent.width() - scrollPane.width();\n if (remainder < 0) {\n remainder = 0;\n }\n var proportion = remainder / scrollContent.width();\n var handleSize = scrollPane.width() - (proportion * scrollPane.width());\n scrollbar.find(\".ui-slider-handle\").css({\n width : Math.floor(handleSize),\n \"margin-left\" : -Math.floor(handleSize / 2)\n });\n handleHelper.width(Math.floor(scrollbar.width() - handleSize));\n };\n\n // Define new resize function because new slider is initialized.\n // Member variable is used to avoid multiple resizes if slider is recreated.\n _legendResize = function() {\n // Do not try to resize if legend elements do not exist.\n if (!jQuery(\"#\" + _options.legendDivId).hasClass(\"animatorLegendNoLegend\")) {\n // Change handle position on window resize.\n resetValue();\n reflowContent();\n sizeScrollbar();\n }\n };\n\n // Init scrollbar size.\n // Safari wants a timeout.\n var sizeScrollbarTimeout = setTimeout(function() {\n sizeScrollbar();\n _resetClearTimeouts.splice(_resetClearTimeouts.indexOf(sizeScrollbarTimeout), 1);\n sizeScrollbarTimeout = undefined;\n }, 10);\n _resetClearTimeouts.push(sizeScrollbarTimeout);\n }", "title": "" }, { "docid": "785bea5ff619deac9950704dc020ad0c", "score": "0.5394977", "text": "function rightMoove() {\n if (document.getElementsByClassName('active')[0] == imagesArray[0]) {\n imagesArray[imagesArray.length - 1].classList.remove('previous');\n } else {\n document.getElementsByClassName('active')[0].previousElementSibling.classList.remove('previous');\n }\n document.getElementsByClassName('active')[0].classList.add('previous');\n document.getElementsByClassName('active')[0].classList.remove('active');\n document.getElementsByClassName('next')[0].classList.add('active');\n document.getElementsByClassName('active')[0].classList.remove('next');\n if (document.getElementsByClassName('active')[0] == imagesArray[imagesArray.length - 1]) {\n imagesArray[0].classList.add('next');\n } else {\n document.getElementsByClassName('active')[0].nextElementSibling.classList.add('next');\n }\n}", "title": "" }, { "docid": "d6c8dc55834eb146f497fa0d70330255", "score": "0.5390274", "text": "function SlideImage() {\n if (currentPosition === count-3){\n direction = -1;\n }else if(currentPosition === 0){\n direction = 1;\n }\n currentPosition+= direction;\n $(\".sliderWrapper\").animate({\"marginLeft\":\n sliderWidth * (-currentPosition)});\n }", "title": "" }, { "docid": "a9fbbdf939e71ddc6650e92c5c91a98f", "score": "0.53896946", "text": "function afterslide(){\n $('.slider-tag').css('visibility', 'visible').addClass('animated fadeIn');\n $('ul.top_slider .btn1').css('visibility', 'visible').addClass('animated fadeInLeft');\n $('ul.top_slider .btn2').css('visibility', 'visible').addClass('animated fadeInRight');\n }", "title": "" }, { "docid": "5ae3f36931d15b8caecfafab0cfec152", "score": "0.5389187", "text": "function prevSlide() {\n index--;\n countmove();\n if (index < 0) {\n cont.style.transform = 'translateX(' + ((arr.length * -move) + move) + 'px)';\n index = arr.length - 1;\n }\n }", "title": "" }, { "docid": "f80036bf2a207ea86cf882af7a60ac6d", "score": "0.5387454", "text": "function nextPrevHandler() {\n\t\t// Grab the elements\n\t\tvar element = document.querySelector(\".featured-image\");\n\t\tvar nextPrev = document.querySelector(\".previous-next\");\n\t\t// If element is off the top of the viewport\n\t\tif (element && element.getBoundingClientRect().bottom < 0) {\n\t\t\tnextPrev.classList.add(\"visible\");\n\t\t} else {\n\t\t\tnextPrev.classList.remove(\"visible\");\n\t\t}\n\t}", "title": "" }, { "docid": "d0012bdc96a22d0c43380a49d1fc1042", "score": "0.5380069", "text": "function prev_next(n) {\n showImage(slideCurrent += n);\n}", "title": "" }, { "docid": "139fa6c270664f46ba49550fada55fcc", "score": "0.5377562", "text": "function handleResize() {\n// 1. update height of step elements\nvar stepH = Math.floor(window.innerHeight * 0.75);\nstep.style(\"height\", stepH + \"px\");\n\nvar figureHeight = window.innerHeight / 2;\nvar figureMarginTop = (window.innerHeight - figureHeight) / 2;\n\nfigure\n .style(\"height\", figureHeight + \"px\")\n .style(\"top\", figureMarginTop + \"px\");\n\n// 3. tell scrollama to update new element dimensions\nscroller.resize();\n}", "title": "" } ]
d2fe51c717f3c3b8c2f609602d285cc1
Get inputs for node console using prompt / Web socket connection clientId To specify socket connection based on ID nodeClient No. of client connection sec Interval for sending data to all clients
[ { "docid": "4199350966b30124b3dcb011ac9d0147", "score": "0.5889801", "text": "function webSocketCon(clientId, nodeClient, sec) {\n\tconst connection = new WebSocket(url); //Connect client to server socket\n\tconst mSec = sec * 1000; //conversion to milliseconds\n\n\tconnection.onopen = () => {\n\t\tlet interval = setInterval(() => {\n\t\t\tlet data = 'Message From Client ' + clientId;\n\t\t\tconnection.send(data);\n\t\t}, mSec);\n\t}\n\n\tconnection.onerror = (error) => {\n\t\tconsole.log(`WebSocket error: ${error}`);\n\t}\n\n\tconnection.onmessage = (e) => {\n\t\tconsole.log(e.data);\n\t}\n\n\tif(nodeClient > 1) {\n\t\tlet cId = clientId + 1;\n\t\tlet nClient = nodeClient - 1;\n\t\twebSocketCon(cId,nClient,sec);\n\t}\n}", "title": "" } ]
[ { "docid": "28003001fa90762605c9917bf534e9e1", "score": "0.6020204", "text": "function connect(socket, data){\n //generate clientId http://udidu.blogspot.co.il/2012/11/chat-evolution-nodejs-and-socketio.html\n data.clientId = generateId();\n chatClients[socket.id] = data;\n socket.emit('ready', { clientId: data.clientId });\n\n}", "title": "" }, { "docid": "a9c36f62ebcb72e53055bdf47339f1ea", "score": "0.59405965", "text": "function connect(client){\n //client.username = alert('What is your username?');\n\n\n\n client.setEncoding('utf-8');\n\n client.write('Please type in the word username\\nfollowed by your your choice of username like so\\nusername: your username');\n\n client.on('data',function(data){\n if(data.search(/username:/i) >= 0){\n var splitData = data.split(' ');\n\n if(splitData[1].toLowerCase()=== 'admin\\n'){\n console.log('******** ADMIN REGISTRATION DENIED ********');\n client.write(\"******** CAN'T USE THAT USERNAME!!! ********\");\n }\n else {\n for(var l = 0; l < clientManager.length ; l++){\n if(clientManager[l].username===splitData[1]){\n console.log('******** NAME REGISTRATION DENIED - ALREADY TAKEN ********');\n return client.write('******** NAME ALREADY TAKEN ********');\n }\n else {\n client.username = splitData[1];\n console.log(client.username);\n return client.write('Welcome to the Server '+client.username);\n }\n }\n }\n }\n });\n\n clientManager.push(client);\n\n console.log(\"CONNECTED: \"+ address.address +\":\"+ client.remotePort);\n\n client.on('data',function(data){\n if(client.username !== undefined){\n console.log('SERVER BCAST FROM '+ client.username+\": \"+data.toString());\n } else {\n console.log('SERVER BCAST FROM '+ address.address +\":\"+client.remotePort+\": \"+data.toString());\n }\n for(var j=0 ; j< clientManager.length ; j++){\n if(client!==clientManager[j]){\n if(client.username !== undefined){\n clientManager[j].write(client.username+\"==> \"+ data.toString());\n } else{\n clientManager[j].write(address.address+':'+client.remotePort+\"==> \"+ data.toString());\n }\n }\n }\n });\n\n client.on('end', function(){\n console.log('CLOSED: '+address.address+\":\"+client.remotePort);\n for(var i = 0;i<clientManager.length;i++){\n console.log(client.remotePort);\n if(clientManager[i]===client){\n clientManager.splice(i,1);\n console.log('this is the amount '+ clientManager.length);\n }\n }\n });\n}", "title": "" }, { "docid": "cac2816ec379b50ad28e225f23ae0fc0", "score": "0.5919641", "text": "clientInit(){\n this.socket.emit(\"client:init\");\n }", "title": "" }, { "docid": "107ec0552db6f342544368746e0cdca6", "score": "0.5869007", "text": "function connect() {\r\n\t\tif (\"WebSocket\" in window) {\r\n\t\t\tclient = new WebSocket(\"ws://172.28.7.28:5555\");\r\n\t\t\tclient.onopen = function(event) {};\r\n\t\t\tclient.onmessage = function(data) {\r\n\t\t\t\tvar receive = data.data.toString();\r\n\t\t\t\tdocument.getElementById(\"doc\").value = receive;\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "e49c2ec32fa1dfdcc8068b6909fb7ec1", "score": "0.58271456", "text": "printClients(room) {\n this.chatIO.in(room).clients((error, clients) => {\n if (error) throw error;\n console.log(clients);\n });\n }", "title": "" }, { "docid": "015dcfc837f658ef7871eb384aec3563", "score": "0.57990146", "text": "function updateIO() {\n var rstrntID = document.getElementById(\"rstrnt_id\").value\n socket.emit('send review', rstrntID);\n}", "title": "" }, { "docid": "11315bb0e5c81e715dc833d2a274c72e", "score": "0.5734304", "text": "function SocketConsole() {\n\n\t// ------------------------- THE WEBSOCKET\n\n\tvar sckt = new WebSocketLayer(); // homeboy\n\tthis.socket = sckt; // external ref\n\n\t// ------------------------ USER INPUT\n\n\tdocument.getElementById('commandIn').addEventListener('keydown', keyPressed); // referencing HTML element we wrote w/ this ID\n\n\tfunction keyPressed(event){\n\t\tif(event.keyCode == 13){\n\t\t\tevent.preventDefault();\n\t\t\tcommandLineInput();\n\t\t}\n\t}\n\n\tfunction commandLineInput(){\n\t\tvar input = document.getElementById(\"commandIn\").value;\n\t\trecentLines.add(\"USER: \"+ input);\n\t\tdocument.getElementById(\"commandIn\").value = \"\"; // clear input\n\n\t\tif(sckt.isOpen){\n\t\t\tsckt.send(input);\n\t\t} else {\n\t\t\tconsole.log(\"Socket is closed\");\n\t\t}\n\n\t\tif(input == \"open port\"){\n\t\t\tconsole.log(\"Opening socket...\");\n\t\t\tsckt.open();\n\t\t}\n\n\t\tif(input == \"close port\"){\n\t\t\tsckt.close();\n\t\t}\n\t}\n\n\t// ------------------------- RECENT LINE DISPLAY\n\n\tvar recentLines = { // lines display obj\n\t\tlines: new Array(),\n\t\tdomLines: document.getElementById(\"cli\"),\n\n\t\tadd: function(newLine){\n\t\t\tif(this.lines.push(newLine) > 15){\n\t\t\t\tthis.lines.splice(0, 1);\n\t\t\t}\n\t\t\tthis.domLines.innerHTML = \"\"; // clear it\n\t\t\tfor(i = 0; i < this.lines.length; i ++){\n\t\t\t\tthis.domLines.innerHTML += this.lines[i] + \"</br>\"; // re-write\n\t\t\t}\n\t\t}\n\t}\n\n\t// ----------------------- DAS BUFFER\n\n\tthis.newLineIn = function(data){\n\t\trecentLines.add(\"ROBO: \" + data);\n\t\t// -> STARTING HERE\n\t}\n\n}", "title": "" }, { "docid": "7268253f9a786b7e67a75f6b90ff878e", "score": "0.57110536", "text": "connect(config, charName) {\n\n let charConfig = config[charName];\n let port = charConfig.port;\n let host = charConfig.host;\n\n const telnetInput = this.telnetInput = new TelnetInput();\n const telnetOutput = this.telnetOutput = new TelnetOutput();\n\n this.ipc = ipc(charName);\n this.socket = net.createConnection(port, host)\n .setKeepAlive(true)\n .setNoDelay(true);\n\n this.socket.pipe(telnetInput);\n telnetOutput.pipe(this.socket);\n\n this.socket.on('close', () => {\n this.socket.unpipe(telnetInput);\n telnetOutput.unpipe(this.socket);\n this.readlineServer.close();\n this.readlineClient.close();\n });\n\n this.readlineClient = new ReadlineInterface(\n process.stdin,\n process.stdout // need that for history and special keys to work\n );\n\n telnetInput.on('data', data => this.emit('dataServer', data));\n\n /*\n // add \\n to prompt unless it exists already or a battleprompt\n const promptNewLineStream = through2(function(chunk, enc, callback) {\n chunk = chunk.toString('utf-8');\n chunk = chunk.replace(/([\\n\\r]|^)<.*?>(?!\\n)(?! \\[)/g, '$&\\n');\n // console.log(\"CHUNK\", JSON.stringify(chunk));\n callback(null, chunk);\n });\n telnetInput.pipe(promptNewLineStream);\n\n */\n\n fse.ensureDirSync('./logs/' + charName);\n\n telnetInput.pipe(through2(function(chunk, enc, callback) {\n chunk = chunk.toString('utf-8');\n chunk = chunk.replace(/\\r/g, '');\n callback(null, chunk);\n })).pipe(fse.createWriteStream('./logs/' + charName + '/' + Date.now() + '.log'));\n\n telnetInput.pipe(through2((chunk, enc, callback) => {\n // remove ending newline from the prompt to show more nicely\n chunk = chunk.toString('utf-8');\n chunk = chunk.replace(/((?:[\\n\\r]|^)<.*?>)\\n\\r?/g, '$1 ');\n // chunk = this.ignoreFilter(chunk);\n if (chunk) {\n callback(null, chunk);\n } else {\n callback(null);\n }\n })).pipe(process.stdout);\n\n this.readlineServer = readline.createInterface({\n input: telnetInput\n });\n\n this.readlineServer.resume();\n\n\n // wait until the prompt and login\n this.readlineServer.on('line', function login(line) {\n if (line.includes('SOLACE II, The Awakening')) {\n this.write(charName);\n this.write(charConfig.password);\n this.write('Y\\n'); // reconnect if needed\n this.readlineServer.removeListener('line', login);\n }\n\n if (line == 'The realm will await your return.') {\n process.exit();\n }\n\n if (line == '[Hit Return to continue]') {\n this.write('\\r\\n');\n }\n }.bind(this));\n\n this.readlineServer.on('line', line => {\n\n if (this.readlineServerDisabled) return;\n\n line = stripAnsi(line.trim());\n\n // console.log(\"LINE\", JSON.stringify(line));\n\n if (this.processServerPrompt(line)) return;\n\n // otherwise\n this.emit('readlineServer', line);\n\n debug(\"<--\", line);\n });\n\n\n this.readlineClient.on('line', line => {\n line = line.trim();\n let result = {};\n\n debug(\"-->\", line);\n\n this.processClientInput(line);\n\n this.readlineClient.prompt(true);\n });\n\n if (charConfig.loadHandlers) {\n for (let handler of charConfig.loadHandlers) {\n this.loadHandler(handler);\n }\n }\n }", "title": "" }, { "docid": "16e486192e2918975aae5a8503ae66bb", "score": "0.562968", "text": "function HandleClientData(data, socketId)\n{\n console.log('Received client message ', data);\n let jsonData = JSON.parse(data);\n\n if (jsonData.msgId === 100) {\n clientSockets.push({'id': socketId, 'uuid': data.uuid});\n }\n else if (jsonData.msgId === 101)\n {\n if (!_.isNil(captureNodeSocketId)) {\n io.to(captureNodeSocketId).emit('CaptureNodeConfigRequest', '');\n }\n else\n {\n console.log('CaptureNode not connected');\n }\n }\n else\n {\n if (!_.isNil(captureNodeSocketId)) {\n console.log('server: sending WebRTCSignallingMessage ', jsonData.data);\n io.to(captureNodeSocketId).emit('WebRTCSignallingMessage', jsonData.data);\n }\n else\n {\n console.log('CaptureNode not connected');\n }\n }\n}", "title": "" }, { "docid": "fcf50d00274a6b1152ebed82de718e09", "score": "0.5597639", "text": "function xClient(socket) {\n var clientId; // identificador de node\n var leaderId;\n var room;\n\n this.setup = function() { // inicialitzar els listeners \n\n socket.on('responseRooms', function(rooms) {\n console.log('responseRooms');\n // injectar-ho a la vista\n console.log(rooms);\n });\n\n socket.on('responseClients', function(clients) {\n console.log('responseClients');\n console.log(clients);\n for (index in clients) {\n console.log(clients[index]);\n }\n });\n\n socket.on('responseJoinRoom', function(socketID, leaderID) {\n console.log('responseJoinRoom');\n console.log(socketID + \":\" + leaderID);\n clientId = socketID;\n leaderId = leaderID;\n });\n\n socket.on('responseRoomLeader', function(leader, room) {\n console.log('responseRoomLeader');\n console.log(\"room: \" + room + \" leader is\" + leader);\n });\n\n socket.on('message', function(key, value) {\n console.log('message');\n if ((key === undefined || value === undefined)) {\n console.log(\"simple: \" + key);\n } else {\n console.log(key + \":\" + value);\n switch (key) {\n case \"leaderJoin\":\n console.warn(\"new Leader: \" + value);\n leaderId = value;\n break;\n case \"leaderQuit\":\n console.warn(\"set request: \" + value);\n socket.emit('setup', room);\n break;\n case \"idResponse\":\n console.info(\"get client id: \" + value);\n clientId = value;\n break;\n case \"leaderResponse\":\n console.info(\"get leader id: \" + value);\n leaderId = value;\n break;\n default:\n console.warn(\"missing key\");\n break;\n }\n }\n });\n };\n\n this.connect = function(roomName) {\n this.setup();\n socket.emit('join', roomName);\n socket.emit('idRequest');\n socket.emit('leaderRequest');\n room = roomName;\n };\n\n this.reconnect = function() {\n socket.emit('setup');\n };\n\n this.getClientInfo = function() {\n console.log({client_id: clientId, leader_id: leaderId, room: room});\n return {client_id: clientId, leader_id: leaderId, room: room};\n };\n\n this.id = function() {\n return clientId;\n };\n\n this.bootId = function() {\n return leaderId;\n };\n\n }", "title": "" }, { "docid": "972b4e3d6686bfdc5ff0ac1e6f491a05", "score": "0.5584715", "text": "function nuevoCliente(event) {\n const nombre = document.getElementById('nombre').value; \n const apellido = document.getElementById('apellido').value; \n const edad = document.getElementById('edad').value; \n const id = document.getElementById('id').value;\n const objeto= {nombre: nombre, apellido: apellido,edad: edad, id: id}\n socket.emit('clientenuevo', objeto);\n\n}", "title": "" }, { "docid": "4d8896be1a3caf3ad767f0ddeeb17ed7", "score": "0.55810505", "text": "function sendMessagetToAllGui(payload) {\n socketServer.emit(\"message\", payload);\n // var connectedClients = server.getConnectedClients();\n // if (connectedClients.size == 0) {\n // console.log(\n // \"[raspi-controller-manager]: No GUI Client is connected to PI Server\"\n // );\n // return;\n // } else {\n // socketServer.emit(\"message\", payload);\n // //guiSocket.emit(\"message \" , payload);\n // }\n}", "title": "" }, { "docid": "c5b6155b9fb0bb610cb2d87ddc40624b", "score": "0.5573933", "text": "async function connect$1() {\n const roomName = controls$1.roomName.value;\n const userName = controls$1.userName.value;\n // Validate the user input values...\n let message = \"\";\n if (roomName.length === 0) {\n message += \"\\n Room name is required\";\n }\n if (userName.length === 0) {\n message += \"\\n User name is required\";\n }\n if (message.length > 0) {\n message = \"Required fields missing:\" + message;\n alert(message);\n return;\n }\n controls$1.roomName.disabled = true;\n controls$1.userName.disabled = true;\n controls$1.connect.disabled = true;\n // and start the connection.\n await client.join(roomName);\n await client.identify(userName);\n }", "title": "" }, { "docid": "288f9d6a9a885f8d5210449d62227e79", "score": "0.5564131", "text": "function startConnect() {\n \n // Generate a random client ID\n clientID = \"esp02\";\n //clientID = \"clientID-\" + parseInt(Math.random() * 100);\n\n // Fetch the hostname/IP address and port number from the form\n host = document.getElementById(\"host\").value;\n port = document.getElementById(\"port\").value;\n\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Connecting to: ' + host + ' on port: ' + port + '</span><br/>';\n document.getElementById(\"messages\").innerHTML += '<span>Using the following client value: ' + clientID + '</span><br/>';\n\n // Initialize new Paho client connection\n client = new Paho.MQTT.Client(host, Number(port), clientID);\n\n // Set callback handlers\n client.onConnectionLost = onConnectionLost;\n client.onMessageArrived = onMessageArrived;\n\n // Connect the client, if successful, call onConnect function\n client.connect({ \n onSuccess: onConnect,\n });\n}", "title": "" }, { "docid": "c33ee3bfe7da7ec900aeedc59e9bcdcf", "score": "0.55226815", "text": "function connect(){\n //set up script variables\n activeCmd.id = activeCmd.id+1; //sum up 1 to the local variable idCount\n activeCmd.type = \"connect\"; //set the active Command Type (activeCmd.type) to connect\n //build up request object\n let message = JSON.stringify({\n \"jsonrpc\": \"2.0\",\n \"id\": activeCmd.id,\n \"method\": \"connectSensor\",\n \"params\": {}\n }, undefined, 4)\n\n //fire methods and websocket\n writeToScreen('SENT: ');\n writeToScreen(message);\n websocket.send(message);\n}", "title": "" }, { "docid": "65be3ba4bcf7b72842714b17f041331a", "score": "0.5501774", "text": "function fillBookCliente(document){ \n var first_select = document.getElementById('Clientes').value;\n \n console.log('Client select -> '+first_select);\n window.clientMessage=first_select; \n }", "title": "" }, { "docid": "59e2e41b8663465aa40a2ef860322488", "score": "0.5484198", "text": "constructor() {\n super();\n let id = new Date().getTime();\n this.state = {\n endpoint: 'http://bentomanor.duckdns.org:3003/'\n };\n if(!socket.listen){\n let webSocket = socketIOClient(this.state.endpoint);\n socket.submitAnswer = function(answer, elapse){\n webSocket.emit(\"submit_answer\", {user:id, answer:answer, elapse:elapse});\n }\n socket.connect = function(user){\n user.id = id;\n webSocket.emit(\"addUser\", user);\n }\n socket.disconnect = function(user){\n user.id = id;\n webSocket.emit(\"disconnect\", user);\n }\n socket.nextQuestion = function(question){\n webSocket.emit(\"get_question\", question);\n }\n socket.listen = function(channel, func){\n webSocket.on(channel, func);\n }\n socket.close = function(channel, func){\n webSocket.off(channel, func);\n }\n }\n \n \n }", "title": "" }, { "docid": "39b36ea06207b2907a2cda74bff6027e", "score": "0.54699975", "text": "function connectNode (subscriptions, host, clientId) {\n\t\t// Create client\n\t\tvar url = \"tcp://\" + host + \":1883\";\n\t\tvar client = mqtt_lib.connect(url, {clientId : clientId});\n\t\t// Register incoming message callback\n\t\tclient.on('message', function(channel, message) {\n\t\t\t// Executes the appropriate channel callback\n\t\t\tvar cbs = findCallbacks(subscriptions, channel);\n\t\t\tif (cbs!==undefined) {\n\t\t\t\t\tif (Object.keys(subscriptions).indexOf(channel)!==-1)\n cbs.forEach(function(cb) {\n cb(message);\n });\n else\n cbs.forEach(function(cb) {\n cb(message, channel);\n });\n\n\t\t\t}\n\t\t});\n return client;\n\t}", "title": "" }, { "docid": "81b1feb0e1a0e5a9d3974726cf682ca7", "score": "0.5464668", "text": "function onConnect() {\n //Once a connection has been established, make a subscription and send a message\n console.log(\"onConnect\");\n client.subscribe(\"DHT001\");\n // client.subscribe(\"humSensor\");\n client.subscribe(\"airQualitySensor\");\n client.subscribe(\"node1\");\n alert(\"Connected.\");\n}", "title": "" }, { "docid": "1bf325c61d4366a7c0c73c1430f187b2", "score": "0.5458296", "text": "function clientNewDataListener(socket) {\n socket.on(\"new-data-on-client\", function(data) {\n console.log(data);\n });\n}", "title": "" }, { "docid": "8a92f8a9ebdc23d35701fa23295880f6", "score": "0.54572", "text": "function fire(){\n var index=document.getElementById(\"currentCommand\").value;\n console.log(index);\n index=parseInt(index);\n var data=JSON.stringify(itemlist[index].data);\n print(data);\n //socketCommunication(ev3address,data,itemlist[index]);\n console.log(itemlist[index].address);\n socketCommunication(itemlist[index].address,data,itemlist[index]);\n\n}", "title": "" }, { "docid": "f1bc1049acbe7c7c250cc62a98319255", "score": "0.54561037", "text": "connect() {\n this._conn.on('ready', () => {\n console.log('Client :: ready');\n this._isConnected = true;\n this.emit('ready');\n }).on('keyboard-interactive', (name, instructions, instructionsLang, prompts, finish) => {\n console.log('Client :: keyboard-interactive');\n finish([this._config.password]);\n }).on('error', (err) => {\n console.log('Client :: error');\n if (err) {\n let message = `${err.name}: ${err.message} (level: ${err.level}).`;\n this.emit('error', new Error(message));\n } else {\n this.emit('error', new Error('Connection error with the server.'));\n }\n }).on('close', hadError => {\n this._isConnected = false;\n if (hadError) {\n console.log('Client :: Close due to an error');\n this.emit('error', new Error('SSH Connection close due to an unexpected error.'));\n } else {\n console.log('Client :: Close');\n }\n }).on('end', () => {\n this._isConnected = false;\n console.log('Client :: End');\n this.emit('end');\n })\n .connect(this._config);\n }", "title": "" }, { "docid": "3965b1560e85cba60d09b27f02f78d3b", "score": "0.5450549", "text": "function initChatSingle() {\n mySocket.emit('init chat single',{userId: user.user_id,partnerId: $scope.center.id},function(data){});\n }", "title": "" }, { "docid": "fa7ef9d099c31da18a445143468f697a", "score": "0.5443583", "text": "function gotSocket() {\n var r = window.radioclient;\n\n document.getElementsByClassName('Controls')[0].id = 'ControlsVisible';\n r.transmitting = true; // Just so that receive will start.\n notice('Connected.');\n receive();\n}", "title": "" }, { "docid": "1cc632e8e81c02e2feee0ff5f5f57038", "score": "0.54405093", "text": "function socketFunctionsClient() {\n var socket = io({reconnection: false, forceNew: true});\n\n socket.on('connect', function() {\n console.log('connected');\n });\n\n // update otherUser's socketID, when they come online\n socket.on('socketID', function (userData) {\n console.log('another user joined!', userData.userID, ',', userData.socketID);\n for(var i=0; i<otherUsers.length; i=i+1) {\n if (otherUsers[i].userID == userData.userID) {\n otherUsers[i].socketID = userData.socketID;\n }\n if (currentOtherUserIndex == i) {\n renderUserSlab();\n }\n }\n });\n\n socket.on('chat', function (chatMessageReceived) {\n console.log('new message', chatMessageReceived);\n renderMessage(chatMessageReceived);\n });\n\n function sendChatMessage() {\n var $chatmessage = $('#chatmessage');\n var $chatterBoxChatter = $('#chatterBoxChatter');\n var message = {};\n message.from = selfUser[0].userID;\n message.to = otherUsers[currentOtherUserIndex].userID;\n message.content = $chatmessage.val();\n message.targetSocketID = otherUsers[currentOtherUserIndex].socketID;\n message.date = customDate();\n messages.push(message);\n var pushedMessageIndex = messages.length - 1;\n var $appendedElement = renderMessage(message);\n\n socket.emit('chat', message, function (err, cbMessage) {\n if (cbMessage) {\n var element_deliveryStatus = '<div class=\"deliveryStatus\">' + cbMessage.delivery_status + '</div>';\n $appendedElement.find('.speakContent').after(element_deliveryStatus);\n $chatterBoxChatter.scrollTop($chatterBoxChatter[0].scrollHeight);\n messages[pushedMessageIndex].delivery_status = cbMessage.delivery_status;\n }\n });\n $chatmessage.val('');\n $chatterBoxChatter.scrollTop($chatterBoxChatter[0].scrollHeight);\n }\n\n $('#chatbutton').click(function(e) {\n e.preventDefault();\n sendChatMessage();\n });\n \n $('#chatmessage').keypress(function(e) {\n if(e.which == 13) {\n e.preventDefault();\n sendChatMessage();\n }\n });\n }", "title": "" }, { "docid": "57385c07ed90213b8e6f7348c2fc7ae6", "score": "0.5429319", "text": "function start_chat(id) {\n //let userlistTag = document.getElementById('userlistTag');\n username = buttonUsername.get(parseInt(id));\n console.log(\"Start Chating: \" + username + \" and id \" + id)\n\n console.log(username);\n socket.send(JSON.stringify({ 'start_chating': username }));\n\n}", "title": "" }, { "docid": "f03dbe7df5463bc1b75deed7d385f7ba", "score": "0.5414081", "text": "function data(){\n\n\n\t\nonline_device_counter=0;\nonline_idle_device_counter=0;\noffline_device_counter=0;\nmessage_received_flag = false;\n\n\n// var request_array=[\"1\",\"heart_beat\"];\n// console.log(request_array);\n//request_array.toString();\t\n//console.log(request_array);\nvar message = new Paho.MQTT.Message(\"[1,heart_beat]\");\nmessage.destinationName = req_data;\nmessage.qos = 2;\nmessage.retained = false;\n\nclient.send(message);\nconsole.info('sending: ', message);\n\n\nsetTimeout(update_device_count, 5000);\n\n}", "title": "" }, { "docid": "faf04415fdaed8640efd2798b6cff79b", "score": "0.54065406", "text": "clientInitPosition(){\n this.socket.emit(\"client:initPosition\");\n }", "title": "" }, { "docid": "4a6d84191eb42c68a5d91c26dfc63f26", "score": "0.53898895", "text": "function registerSocketListener() {\n socketio.on(\"connection\", function(socket) {\n socket.on(\"fromClient\", function(data) {\n console.log(data);\n chatbot.textQuery(data.client, data.sessionId).then(function(res) {\n console.log(\"Sample is done.\");\n console.log(res);\n socket.emit(\"fromServer\", {\n server: res.response,\n sessionId: res.sessionId,\n uiMetaData: data.uiMetaData\n });\n if (res.jobSearchParams !== null) {\n socket.emit(\"jobSearch\", res.jobSearchParams);\n }\n });\n });\n\n socket.on(\"clientEvent\", function(data) {\n console.log(data);\n chatbot\n .eventQuery(data.client, data.sessionId, data.params)\n .then(function(res) {\n console.log(\"Sample is done.\");\n console.log(res);\n socket.emit(\"fromServer\", {\n server: res.response,\n sessionId: res.sessionId,\n uiMetaData: data.uiMetaData\n });\n });\n });\n });\n}", "title": "" }, { "docid": "e6b36ab56cc80609c220f1cbf232f458", "score": "0.5384731", "text": "function enterLobby() {\n myusername = $('#input_username').val();\n socket.emit('check username', myusername);\n}", "title": "" }, { "docid": "9e3632ab4b9d72b645fd949a37770e92", "score": "0.5379689", "text": "function getAllSessions (socket) {\n socket.emit(\"sessionsClientsSockets\");\n}", "title": "" }, { "docid": "2505b4bfb2fd624ce8c96ca6e9576dbc", "score": "0.5378687", "text": "function connect(socket, data){\n //generate clientId\n data.clientId = generateId();\n\n // save the client to the hash object for\n // quick access, we can save this data on\n // the socket with 'socket.set(key, value)'\n // but the only way to pull it back will be\n // async\n chatClients[socket.id] = data;\n\n // now the client objtec is ready, update\n // the client\n socket.emit('ready', { clientId: data.clientId });\n\n // auto subscribe the client to the 'lobby'\n subscribe(socket, { room: 'lobby' });\n\n // sends a list of all active rooms in the\n // server\n socket.emit('roomslist', { rooms: getRooms() });\n }", "title": "" }, { "docid": "805bc585f1aa55c4a3cfdd6c90d8ec4f", "score": "0.5365956", "text": "start() {\n // listen to when a client connects\n this.on('connection', (socket) => {\n const userClient = this.clients[socket.id];\n console.log(`[SocketServer] Connected \"${socket.userData.userId}\"`);\n\n // user events\n handleUserEvents(socket);\n\n /**\n * Client gets disconnected from server\n */\n socket.on('disconnect', () => {\n console.log(`[SocketServer] Disconnected \"${socket.userData.userId}\"`);\n this.removeClient(socket.id);\n this.emit('usersUpdate', this.getAllUserData());\n });\n });\n }", "title": "" }, { "docid": "e986d9143369746ce61b1a9d57c334ee", "score": "0.53587925", "text": "clientPlayerList(){\n this.socket.emit(\"client:playerList\");\n }", "title": "" }, { "docid": "665c7b34b6da51b108046c2820c37c14", "score": "0.53571475", "text": "function connect() {\r\n var serverUrl;\r\n var scheme = \"ws\";\r\n\r\n // If this is an HTTPS connection, we have to use a secure WebSocket\r\n // connection too, so add another \"s\" to the scheme.\r\n\r\n if (document.location.protocol === \"https:\") {\r\n scheme += \"s\";\r\n }\r\n \r\n // Build the URL of the WebSocket server. For Glitch, it's the same\r\n // as the web server. In other instances, you may need to add\r\n // \":<port number>\".\r\n \r\n serverUrl = \"wss\" + \"://\" + myHostname;\r\n\r\n log(`Connecting to server: ${serverUrl}`);\r\n connection = new WebSocket(serverUrl, \"json\");\r\n\r\n \r\n connection.onclose = function(evt) {\r\nconsole.log(evt);\r\n console.log(\"closed & reopening\");\r\nif (served == 0){\r\n reconnect()}\r\n };\r\n\r\n connection.onerror = function(evt) {\r\n console.dir(evt);\r\n }\r\n\r\n connection.onmessage = function(evt) {\r\n var chatBox = document.querySelector(\".chatbox\");\r\n var text = \"\";\r\n var msg = JSON.parse(evt.data);\r\n log(\"Message received: \");\r\n console.dir(msg);\r\n var time = new Date(msg.date);\r\n var timeStr = time.toLocaleTimeString();\r\n\r\n switch(msg.type) {\r\n case \"id\":\r\n clientID = msg.id;\r\n setUsername();\r\n\r\n break;\r\n\r\n case \"username\":\r\n text = \"<b>User <em>\" + msg.name + \"</em> signed in at \" + timeStr + \"</b><br>\";\r\n break;\r\n\r\n case \"SUCCESS\":\r\nif (requeston==1){ \r\ntryAgain();}\r\n break;\r\n\r\n case \"message\":\r\nif (msg.text==\"request\") {serveanddance(msg.name, Date.now())\r\n text = \"served \" + msg.name + \" at \" + timeStr + \"<br>\"}\r\nelse {\r\n text = \"(\" + timeStr + \") <b>\" + msg.name + \"</b>: \" + msg.text + \"<br>\";\r\nif (requeston==1){ \r\ndocument.write(\"<iframe src=\" + msg.text + \" width='100%' height='100%' frameBorder='0'>BROWSER NOT SUPPORTED</iframe>\");\r\nrequeston = 0;\r\nserved = 1;}}\r\n break;\r\n\r\n case \"rejectusername\":\r\n myUsername = msg.name;\r\n text = \"<b>Your username has been set to <em>\" + myUsername +\r\n \"</em> because the name you chose is in use.</b><br>\";\r\n break;\r\n\r\n case \"userlist\": // Received an updated user list\r\n handleUserlistMsg(msg);\r\n break;\r\n\r\n // Signaling messages: these messages are used to trade WebRTC\r\n // signaling information during negotiations leading up to a video\r\n // call.\r\n\r\n case \"video-offer\": // Invitation and offer to chat\r\n handleVideoOfferMsg(msg);\r\n break;\r\n\r\n case \"video-answer\": // Callee has answered our offer\r\n handleVideoAnswerMsg(msg);\r\n break;\r\n\r\n case \"new-ice-candidate\": // A new ICE candidate has been received\r\n handleNewICECandidateMsg(msg);\r\n break;\r\n\r\n case \"hang-up\": // The other peer has hung up the call\r\n handleHangUpMsg(msg);\r\n break;\r\n\r\n // Unknown message; output to console for debugging.\r\n\r\n default:\r\n log_error(\"Unknown message received:\");\r\n log_error(msg);\r\n }\r\n\r\n // If there's text to insert into the chat buffer, do so now, then\r\n // scroll the chat panel so that the new text is visible.\r\n\r\n if (text.length) {\r\n chatBox.innerHTML += text;\r\n chatBox.scrollTop = chatBox.scrollHeight - chatBox.clientHeight;\r\n }\r\n };\r\n}", "title": "" }, { "docid": "e0b9ac24e94e2155b0717b7a0f959958", "score": "0.5352533", "text": "async _connect() {\n this.client.connect();\n\n this.client.on('action', (channel, userstate, message, self) => {\n // Ignore self\n if(userstate.username == this.username) return;\n\n let data = {\n channel,\n userstate,\n message,\n self\n };\n this.emit('ActionMessage', data);\n });\n\n this.client.on('chat', (channel, userstate, message, self) => {\n // Ignore self\n if(userstate.username == this.username) return;\n\n let data = {\n channel,\n userstate,\n message,\n self\n };\n\n // CoopRequest start can only be initiated by the bot owner\n if (message.startsWith('!startcoop') && '#' + userstate.username == this.channels[0]) {\n this.emit('CoopRequest', data);\n return;\n }\n\n // CoopRequest end can be initiated by both channel owners\n if (message.startsWith('!endcoop') && '#' + userstate.username == this.channels[0]) {\n this.emit('CoopRequest', data);\n return;\n } else if (message.startsWith('!endcoop') && '#' + userstate.username == this.channels[1]) {\n this.emit('CoopRequest', data);\n return;\n }\n\n this.emit('ChatMessage', data);\n });\n\n this.client.on('clearchat', () => {\n this.emit('ClearChat');\n });\n }", "title": "" }, { "docid": "07316330d7d3f75470f824a167a067bf", "score": "0.53369987", "text": "function socketExample() {\n var socket = new WebSocket('ws://34.208.224.102:3000/');\n socket.onopen = function() {\n clientTime1 = new Date().valueOf();\n socket.send(clientTime1);\n };\n\n //when message is received from server figure out the estimate lag and clock difference\n socket.onmessage = function(message) {\n var clientTime2 = new Date().valueOf();\n var serverTime = message.data;\n var lag = (clientTime2 - clientTime1)/2;\n var clockDiff = Math.abs((clientTime2 - serverTime) - lag);\n document.getElementById('response').innerHTML = \"Initial Client Time: \" + clientTime1 + \"\\nServer Time: \" + serverTime +\"\\nSecond Client Time: \" + clientTime2 + \"\\nEstimated Lag: \" + lag + \"\\nClock Diff: \" + clockDiff;\n };\n }", "title": "" }, { "docid": "b11409a51813d6deaf3fd8b6fe84e8e2", "score": "0.5330997", "text": "function readMission(socketx) {\n socketx.emit('getMission',\"{\\\"mission\\\": \\\"1\\\",\\\"device\\\": \\\"website\\\"}\");\n}", "title": "" }, { "docid": "5eddfc899e7150e20857d319b319376c", "score": "0.53291667", "text": "function chooseLeica(){\n console.log('ich bin hier bei choose leica')\n //set up script variables\n activeCmd.id = activeCmd.id+1; //sum up 1 to the local variable idCount\n activeCmd.type = \"chooseLeica\"; //set the active Command Type (activeCmd.type)\n const message = JSON.stringify({\n \"jsonrpc\": \"2.0\",\n \"id\": activeCmd.id,\n \"method\": \"getSensor\",\n \"params\": {\n \"name\": \"LeicaLaserTracker\",\n \"parameter\": {\n \"sensorParameter\": [{\n \"name\": \"connection\",\n \"properties\": {\n \"ip\": \"192.168.0.1\",\n \"port\": 700\n }\n }, {\n \"name\": \"probe\",\n \"properties\": {\n \"activeProbe\": \"RRR15\",\n \"probes\": [\"RRR15\",\n \"RRR05\",\n \"RRR0875\",\n \"glass prism\"\n ]\n }\n }, {\n \"name\": \"measureMode\",\n \"properties\": {\n \"activeMeasureMode\": \"fast\",\n \"MeasureModes\": [\"fast\",\n \"standard\",\n \"precise\",\n \"stationary\"\n ]\n }\n }]\n }\n }\n })\n writeToScreen('SENT: ');\n writeToScreen(message);\n websocket.send(message);\n}", "title": "" }, { "docid": "0f4c7ef99d39a0311298d4ab886f42a5", "score": "0.53250766", "text": "function updateTSClient(socket, tsSGID, tsCLDBID, lines, callback) {\n queryConnect.queryConnect(socket, ts3Query, ts3QueryDetails, function(ts3) {\n socket.ts3 = ts3;\n var newLine = \" \"\n queryDescriptionChange(socket.ts3, tsCLDBID, {\n client_description: lines[0] + newLine+\n lines[1] + newLine+newLine\n }, function() {\n ts3.logout();\n callback();\n });\n });\n }", "title": "" }, { "docid": "af3ebde75f13d9f9bc2bad34ac88271c", "score": "0.53166664", "text": "function serveanddance(name,time){\r\nvar ttt = document.getElementById(\"output\").innerHTML;\r\nvar msg = {\r\n text: ttt,\r\n target: name,\r\n type: \"message\",\r\n id: clientID, \r\n date: time\r\n };\r\n sendToServer(msg);\r\n}", "title": "" }, { "docid": "d852ff6a7b12ddd6a84a75a1f24cc780", "score": "0.5315016", "text": "function newConnection (client) { //insert here all functions for a connection\n\tvar newConfig = {};\n\tconsole.log(\"new client connected: \" +client.id);\n\t\n\tclient.on(\"config\", function (data) { \n\t\tthis.newConfig = data;\n\t\tconsole.log(JSON.stringify(this.newConfig, null, 2));\n\t});\n\t\n\tclients.push(client);\n\t\n\t\n\t\n\t\n\t\n\t// var messageObj = {\n\t\t // \"countBikes\": 3,\n\t\t // \"temperature\": 2,\n\t\t // \"humidity\": 3,\n\t\t // \"avgSpeed\": 4\n\t // };\n\t// writeData(messageObj);\n\t// client.emit(\"data\",messageObj);\n\n}", "title": "" }, { "docid": "feaa24b3b1d23029f7ec3483a515b445", "score": "0.53085285", "text": "function sendValues (socket)\n{\n socket.emit(\"clientReadValues\",\n { // json notation between curly braces\n \"desiredValue\": desiredValue,\n \"actualValue\": actualValue\n });\n}", "title": "" }, { "docid": "4151ae90cba03d6f23f060bcc0d2bc19", "score": "0.5293026", "text": "connect() {\n this.socket.connect();\n this.socket.on(task.ACCEPT_DATA, (data) => {\n console.log(data);\n });\n this.socket.on(task.ACCEPT_NEW_MESSAGE, (message) => {\n console.log(message);\n });\n this.socket.emit(task.INIT);\n this.socket.emit(task.STATE_UPDATE, {\n state: 'green',\n });\n this.socket.emit(task.GET_DATA);\n }", "title": "" }, { "docid": "5a6a64827e74d5c2ea7c2974f9bf1f8d", "score": "0.5285479", "text": "function onConnect() {\r\n // Fetch the MQTT topic from the form\r\n topic = \"testUnitMachine1\";//document.getElementById(\"topic\").value;\r\n\r\n // Subscribe to the requested topic\r\n client.subscribe(topic);\r\n}", "title": "" }, { "docid": "93e6b41a26e01b96db23bdd448421d3b", "score": "0.5275428", "text": "function ClientCreateRoom(username){\n socket.emit('client-create-room',username);\n\n \n}", "title": "" }, { "docid": "35e98cf5bb4d54ce16d3845fe9995f6f", "score": "0.5267879", "text": "function getClient() {\n if (client == null) { \n updateClientStatus(null);\n client = MQTT.connect(server);\n client.on('connect', function() {\n updateClientStatus(true);\n });\n client.on('message', function(topic, payload) {\n payload = JSON.parse(payload);\n var key = topic + \":\" + payload.cmd;\n if (key in transactions) {\n var node = transactions[key];\n node.status({});\n node.send({payload: payload});\n delete transactions[key];\n }\n });\n client.on('close', function() {\n updateClientStatus(false);\n client = null;\n });\n }\n return client;\n }", "title": "" }, { "docid": "50fad549accbe3739148e6fab100ef2b", "score": "0.5263227", "text": "function runSocket() {\n socket.on('update', function(data) { //receiving updated data from server site app.js\n console.log(data);\n showData(data);\n });\n}", "title": "" }, { "docid": "d94dc1d4009d3755e57eab64fa5d5d19", "score": "0.52597237", "text": "function msg_interval() {\n\n // message to send to all client sockets\n const msg = {\n plrs: {}, // players currently in the game\n }\n\n // before sending msg to players, compile each player's specs\n for (const client_socket_id in client_sockets) {\n const client_socket = client_sockets[client_socket_id]\n\n msg.plrs[client_socket_id] = {\n // (string) the client's current name\n name: client_socket.name,\n // (int) the client's current score\n score: client_socket.score,\n // (int) the client's current high_score\n high_score: client_socket.high_score,\n // (0 < float < 1) the client's current vertical location\n plr_y: client_socket.plr_y,\n // (boolean) whether the client is dead\n dead: client_socket.dead,\n }\n }\n\n // send msg to each client socket\n for (const client_socket_id in client_sockets) {\n const client_socket = client_sockets[client_socket_id]\n client_socket.emit('update', msg)\n }\n\n }", "title": "" }, { "docid": "983707bdbf4a4cc8e1b54e332c1a04c1", "score": "0.5259387", "text": "function startChat() {\n let channel = client.join({userName: username, message: \"joined this channel\"});\n\n client.list({}, (error, data) => {\n console.log(data)\n });\n channel.on(\"data\", onData);\n\n readLine.on(\"line\", function (text) {\n client.send({userName: username, message: text}, (error, response) => {\n console.log(response);\n });\n });\n}", "title": "" }, { "docid": "e0067ee1aa06806215e33b098773c7a0", "score": "0.5253471", "text": "function onConnect() {\n // Fetch the MQTT topic from the form\n topic = \"/data\";\n\n // Print output for the user in the messages div\n // div.innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n}", "title": "" }, { "docid": "360ca40d28a9a2b86b7f8e1d1475e8ce", "score": "0.5251016", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"MSG/1/#\");\n client.subscribe(\"MSG/2/#\");\n}", "title": "" }, { "docid": "01fd8da907ff1be656a7cf65c12d7b30", "score": "0.5247176", "text": "function command(cmd) {\n //split 'cmd' arg into a set of: command word, then any following arguments\n let splitCmd = cmd.split(' ');\n let args = splitCmd.length > 1 ? splitCmd.splice(1) : undefined;\n splitCmd = args === undefined ? splitCmd[0] : splitCmd.splice(0, 1)[0];\n splitCmd = splitCmd.toLowerCase();\n\n switch(splitCmd) {\n case 'clear':\n document.getElementById('oldLines').innerHTML = '';\n break;\n case 'connect':\n if (socket) {\n addLine('Already connected.');\n } else if (args) {\n openSocket(args);\n } else {\n addLine('Please provide an address.');\n }\n break;\n case 'disconnect':\n if (socket) {\n closeSocket();\n } else {\n addLine('Not connected to a websocket.');\n }\n break;\n //remove this later, testing only\n case 'addline':\n if(args) {\n let newLine = args.join(' ');\n addLine(newLine);\n }\n break;\n case 'help':\n addLine('<p class = \\'lineMain\\'>clear:</p> Clears the terminal.', false);\n addLine('<p class = \\'lineMain\\'>connect:</p> Attempts to connect to the provided websocket address. eg. \\'connect ws:localhost\\'. Port optional.', false);\n addLine('<p class = \\'lineMain\\'>disconnect:</p> Disconnects from an open websocket.', false);\n addLine('<p class = \\'lineMain\\'>addline:</p> Testing only. Prints text to the terminal.', false);\n break;\n default:\n if (!socket) {\n addLine('Not connected to a Websocket. Use the command \\'connect\\'');\n }else if (socket.readyState === 1) {\n socket.send(cmd);\n } else {\n addLine('Error connecting to the Websocket. \\nPlease try again later.');\n }\n }\n\n}", "title": "" }, { "docid": "9415d80da9cce280c168e76b8297f9ff", "score": "0.5236914", "text": "function connections()\n{\n\t// var socket = io.connect('http://localhost:3001',\n\tvar socket = io.connect('http://setiquest.info',\n\t\t\t{\n\t\t\t\t'reconnect': true,\n\t 'reconnection delay': 5000,\n\t 'max reconnection attempts': 10\n\t\t\t});\n\n\t/*\n\tsocket.on('connect',function(connectedSocket) {\n\t\t//console.log(\"Connected to server\");\n\t\t$('#connected_users')[0].textContent = \"Connected to server\";\n\n\t\t//Clear the obs comment area\n\t\tvar txt = $(\"#observer_comments_text_area\");\n\t\tif(txt != undefined || txt != null) {\n\t\t\ttxt.val(\"\");\n\t\t}\n\n\t\t//After a random number of milliseconds, to avoind blasting the server with too many\n\t\t//requests after a server app restart.\n\t\tvar timeoutms = randomIntFromInterval(1000,6000);\n\t\tsetTimeout(function () {\n\t\t\tsocket.emit(\"subscribe\", \"new_obscal_event\");\n\t\t}, timeoutms);\n\t});\n\n\tsocket.on('disconnect',function(connectedSocket) {\n\t\t//console.log(\"Connected to server\");\n\t\t$('#connected_users')[0].textContent = \"Trying to reconnect...\";\n\t\tnumConnectedUsers = -1;\n\t});\n\n\n\tsocket.on('message', function(msg){\n\t\tif(msg == null) return;\n\n\t\tvar msgType = msg.split(\",\")[0];\n\n\t\tif(msgType === DATA_TYPE_ACTIVITY && firstMessage == true) {\n\t\t\tfirstMessage = false;\n\t\t\t$(\"#splash\").css(\"visibility\", \"hidden\");\n\t\t}\n\n\t\tdoCalendar();\n\n\t});\n\t*/\n}", "title": "" }, { "docid": "8b6ce03bbe4990c1816df5886e0e3a3c", "score": "0.5222712", "text": "function sendLine(){\n var line = readline.question(\"\\nDigite su mensaje:\\n\");\n if(line == \"0\"){\n client.end();\n }else{\n client.write(line);\n }\n}", "title": "" }, { "docid": "1205d88655bddc00afd82f304543e39f", "score": "0.5221286", "text": "function setUsernameAndStart() { // to sending username and id to server\n myUsername = document.getElementById('username-input').value; // geting username from page\n let n1 = myUsername.length, n2 = 0;\n for (let i = 0; i < n1; i++) { if (myUsername[i] == ' ') n2++ }\n if (n1 == n2) {\n alert(\"Enter valid Username !!\")\n return;\n }\n document.getElementById('username-div').style.display = 'none'; // hiding the username div\n document.getElementById('onMeeting-div').style.display = 'inline-block '; // unhiding the onMeeting div\n let slink= window.location.href ; let cnt = 0 ;\n for(let i= slink.length-1 ; i>-1 ; i--){\n if(slink[i] == '/' ) cnt ++ ;\n if(cnt==2){\n slink = slink .substring(0,i) + '/meet/' ;\n break ;\n }\n } \n document.getElementById('meetingLink-display-input').value = slink + meetingId;\n document.getElementById('meetingId-display-input').value = meetingId;\n\n socket.emit('join-meeting',meetingId,'xxxxx-chatroom-xxxx',myUsername)\n}", "title": "" }, { "docid": "4e116d72219e47557a5d471dfdd8ce19", "score": "0.52152276", "text": "clientRepeatWord(whoSaidIt){\n this.socket.emit(\"client:repeatWord\", whoSaidIt);\n }", "title": "" }, { "docid": "580b648a33df4c028286f891761e0248", "score": "0.520535", "text": "clientChangeLevel(level){\n this.socket.emit(\"client:changeLevel\",level);\n }", "title": "" }, { "docid": "6eeb27c31bd74dcca9e248ed131d6c8b", "score": "0.52050453", "text": "function sendTheMessage() {\n\n\n // Send Data to the server to draw it on other screen\n dataServer.publish(\n {\n channel: channelName,\n message:\n {\n messageText: inputBox.value() //get the value from the text box and send it as part of the message\n }\n });\n\n}", "title": "" }, { "docid": "3ad9a851799f5fcfec4804e28618dba3", "score": "0.520461", "text": "function onConnect() {\n // Fetch the MQTT topic from the form\n topic = document.getElementById(\"topic\").value;\n\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n\t\n\tclient.subscribe(\"device/scan\");\t\n\trescan();\n}", "title": "" }, { "docid": "a176db665862f5f3ff109a07c88e392b", "score": "0.5200513", "text": "function sendPromptRequest(prompt_num) {\n socket.emit('get_prompt', {\n prompt_num: prompt_num,//i think this is question number(i.e. 1 or 2) requesquated.\n user_name: localStorage.user_name,\n game_name: localStorage.game_name\n });\n }", "title": "" }, { "docid": "92f1dcd2ab039f941b62839df87a7ce0", "score": "0.52000964", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"watch1/ack\");\n setInterval(function(){\n \t tizen.systeminfo.getPropertyValue('BATTERY',function(battery){\n// \t\t console.log(properties);\n \t\t tizen.systeminfo.getPropertyValue('CPU',function(cpu){\n \t\t\t init = new Date();\n \t\t\t time = new Date().getTime();\n \t\t\t m_battery = Object.assign(battery);\n \t\t\t m_cpu = Object.assign(cpu);\n \t\t\t var message = new Paho.MQTT.Message(JSON.stringify({\n \t\t\t\t hrm:heartRateData,\n \t\t\t\t time:time,\n \t\t\t\t battery:battery,\n \t\t\t\t cpuLoad:cpu,\n \t\t\t\t totalMemory:tizen.systeminfo.getTotalMemory(),\n \t\t\t\t av_Mem:tizen.systeminfo.getAvailableMemory()\n \t\t\t\t }));\n message.destinationName = \"watch1/watchdata\";\n client.send(message);\n console.log('Message sent');\n \t\t });\n \t\t \n \t }); \t \n \t \n \t \n },FREQUENCY); \n \n }", "title": "" }, { "docid": "e293043340014bf754ef83c691852f53", "score": "0.5195997", "text": "function Send_Mqtt_Cmd(){\n socket.emit('command', JSON.stringify(switches_status));\n }", "title": "" }, { "docid": "5c86931c25289e9958a51d24a6d17070", "score": "0.51959336", "text": "function emitGetListofSims() {\n socket.emit('get list of sims', 'i want a list of sims');\n}", "title": "" }, { "docid": "a43b851e7b7f8d642f584aeca53ef6e5", "score": "0.51941216", "text": "function executeConsoleInput() {\n\tvar txt = document.getElementById('consoleTextField').value;\n\trserver.execute(txt);\n}", "title": "" }, { "docid": "5ec8bc5555f8f08c4442d64002f17d61", "score": "0.5192805", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(SUB_TOPIC);\n client.send(MESSAGES.BIRTH);\n document.getElementById(\"clientStatus\").innerText = \"connected\";\n document.getElementById(\"connectionDetails\").classList.remove(\"border-danger\");\n document.getElementById(\"connectionDetails\").classList.add(\"border-success\");\n document.getElementById(\"content\").style.display = \"block\";\n}", "title": "" }, { "docid": "a98e5c341f0941cbc01b42c62835c595", "score": "0.51842797", "text": "function listen() {\n port = 8889;\n\t//const socket = new WebSocket(\"ws://127.0.0.1:8889\");\n\tconst socket = io(\"localhost:8889\"); \n\t//socket.on(\"connect\", () => {\n // either with send()\n //socket.send(\"Hello!\");\n //socket.listen(port, () => {\n //console.log(`Socket.IO server running at http://localhost:${port}/`);\n//});\n // or with emit() and custom event names\n //socket.emit(\"salutations\", \"Hello!\", { \"mr\": \"john\" }, Uint8Array.from([1, 2, 3, 4]));\n//});\n\t//socket.on(\"message\", data => { console.log(data);});\n\t//socket.on(\"message\", data => { console.log(data);});\n socket.addEventListener('message', function (event) { console.log('Message from server ', event.data); }); //non funziona su client browser, sembra :c\n// handle the event sent with socket.emit()\n//socket.on(\"greetings\", (elem1, elem2, elem3) => {\n //console.log(elem1, elem2, elem3);\n//});\n}", "title": "" }, { "docid": "1c0a54f35ca66c39c2650635a6e1897f", "score": "0.51814836", "text": "function getConn(connName){\n\n var option = {\n host:'192.168.43.38',\n port: 9990\n }\n global.json_data = {data: ''};\n\n global.session = {auth: null};\n // Create TCP client.\n\n global.all_universities = {data: null};\n\n // var executed = false;\n global.client = net.createConnection(option, function () {\n console.log('Connection local address : ' + client.localAddress + \":\" + client.localPort);\n console.log('Connection remote address : ' + client.remoteAddress + \":\" + client.remotePort);\n }); \n\n \n // client.setTimeout(100000);\n client.setEncoding('utf8');\n\n // When receive server send back data.\n client.on('data', function (data) {\n json_data.data += data;\n // console.log(json_data);\n console.log(client.localAddress + \":\" + client.localPort + ' Server return data : ' + data);\n });\n\n // When connection disconnected.\n client.on('end',function () {\n console.log('Client socket disconnect. ');\n });\n\n client.on('timeout', function () {\n console.log('Client connection timeout. ');\n });\n\n client.on('error', function (err) {\n console.error(JSON.stringify(err));\n });\n\n return client;\n}", "title": "" }, { "docid": "436199be11492541fda49ba6b2592b44", "score": "0.51811934", "text": "function message_handle(message,source){\n var type=message.substring(0,4);\n var message=message.substr(4);\n console.log(message);\n\n //console.log(type);\n if(runStatus==\"normal\"){\n //console.log('run normally');\n if(type=='STRN'){\n alert(message);\n }\n if(type=='JSON'){\n message=JSON.parse(message);\n $(\"#test_result\").html(message.message);\n var key=Object.keys(message);\n console.log(key);\n if(key.indexOf(\"accesscode\")!=-1){\n ev3AccessCode=message.accesscode;\n var parent=document.getElementById('dropdown-menu');\n for(var i=0;i<parent.childNodes.length;i++){\n if (parent.childNodes[i].innerHTML==targetIP){\n parent.childNodes[i].style.backgroundColor='green';\n }\n }\n console.log(ev3AccessCode);\n }\n if(key.indexOf(\"releasecode\")!=-1){\n var dataHTTP={'target':targetIP,'targetport':ev3MainPort,'action':'release'};\n var dataHTTP=JSON.stringify(dataHTTP);\n http_post('index.html',dataHTTP,changeStatus);\n // var parent=document.getElementById('dropdown-menu');\n // for(var i=0;i<parent.childNodes.length;i++){\n // if (parent.childNodes[i].innerHTML==targetIP){\n // parent.childNodes[i].style.backgroundColor='transparent';\n // }\n // }\n // targetIP='';\n // targetPort=0;\n // ev3address='';\n }\n if(message.nextfire==\"yes\"){\n if(source.Type==\"sensor\"){\n source.childNodes[2].value=message.value;\n }\n var i=changetrigger();\n //console.log(i);\n if(i<itemlist.length){\n var data=JSON.stringify(itemlist[i].data);\n socketCommunication(itemlist[i].address,data,itemlist[i]);\n console.log(data);\n }\n else if(i==itemlist.length && loop==0){\n Stop();\n }\n else if(i==itemlist.length && loop==1){\n //document.getElementById(\"currentCommand\").innerHTML='0';\n $(\"#currentCommand\").html('0');\n fire();\n }\n }\n else if(message.nextfire=='no'){\n if(message.thisfire=='yes'){\n var i=parseInt(document.getElementById(\"currentCommand\").innerHTML);\n var data=JSON.stringify(itemlist[i].data);\n socketCommunication(ev3address,data,itemlist[i]);\n console.log(data);\n //$(itemlist[i].childNodes[1]).fadeOut(200).fadeIn(200);\n if(source.Type==\"sensor\"){\n source.childNodes[2].value=message.value;\n $(\"#test_result\").html('waiting for triggering sensor');\n //$(\"#test_result\").fadeOut(500).fadeIn(500);\n }\n }\n else{\n //console.log(message.message)\n }\n }\n }\n }\n else if(runStatus==\"interruped\"){\n $(\"#test_result\").html('interruped by user');\n }\n}", "title": "" }, { "docid": "2847c5358513d6d88b775a36759f8005", "score": "0.517914", "text": "function getName() {\n // get timestamp for room ID\n let now = new Date();\n // catch inside text in the name (and room ID) entry\n let prepper = document.getElementById('prep');\n let namevalue = usernm.value;\n if (prev.value === '') {\n roomid = now.valueOf();\n } else {\n // roomid = 404;\n if (typeof prev.value === 'number') { // not happening, as it's a 'string'\n roomid = prev.value;\n } else {\n roomid = parseInt(prev.value); // or maybe keep it as string\n }\n }\n userid = roomid; // temporary; should be DIFFERENT for non-room-openers\n domain += desturl.value;\n port += destport.value;\n url = domain + \":\" + port;\n console.log(\"server is on\", scheme + url);\n // clear input (might be unnecessary)\n usernm.value = \"\";\n prev.value = \"\";\n desturl.value = \"\";\n destport.value = \"\";\n // record name and room ID on screen\n document.getElementById('yourname').textContent = namevalue;\n document.getElementById('roomid').textContent = roomid;\n // create styling for user ID in chatbox (note: this is different per user)\n cbstyle.innerHTML += `<style>.usr${userid} {color: gold;} .usr-1 {color: #A00000}</style>`;\n // show app screen\n let appscreen = document.getElementById('app');\n if (appscreen.style.display === 'none') {\n appscreen.style.display = '';\n prepper.style.display = 'none';\n } else {\n // appscreen.style.display = 'none';\n }\n // websocket additional code\n ws = new WebSocket('ws://' + url);\n ws.addEventListener('open', () => {\n const firstmessage = packWSmsg('firstMessage', -1, 'Admin', actime(now), 'Opening chatroom...');\n ws.send(firstmessage); // send a message to the WebSocket server\n });\n ws.addEventListener('message', event => {\n console.log('received message:', event.data);\n document.getElementById('chatbox').innerHTML = event.data;\n scrollDownChatbox();\n });\n}", "title": "" }, { "docid": "c08c157c92be87395f73f7cf83e931f4", "score": "0.5170662", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n document.getElementById(\"status\").innerHTML = \"Subscribing...\";\n client.subscribe(\"penthouse/temp\");\n}", "title": "" }, { "docid": "193c0a230503207c7cffd0497cb5a138", "score": "0.5167824", "text": "function menu_connection(KaTZPit_data){\n\t\t\n\t// Affichage de l'Ip et du Port\n\tdocument.getElementById('IP_Host').innerHTML = serverws.ip\n\tdocument.getElementById('IP_Port').innerHTML = serverws.port\n\t\n}", "title": "" }, { "docid": "79542c0d5d449f1f93c1945674e74107", "score": "0.5157025", "text": "function onConnect() {\n // Fetch the MQTT topic from the form\n topic = document.getElementById(\"topic\").value;\n\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n\n\n //client.subscribe(topic);\n //message = new Paho.MQTT.Message(\"EAE\");\n //message.destinationName = topic;\n //client.send(message);\n\n\n}", "title": "" }, { "docid": "789dace74e907df9cea06495bef44e12", "score": "0.51564366", "text": "function sendCurrentUsers(socket){\n \n var info = clientInfo[socket.id];\n var users = [];\n \n if(typeof info === 'undefined') {\n \n return; \n }\n \n // it takes an object and returns and it returns all the attributes of that object\n Object.keys(clientInfo).forEach(function(socketId){\n \n var userInfo = clientInfo[socketId];\n \n \n if(info.room === userInfo.room){\n users.push(userInfo.name); \n \n }\n });\n \n socket.emit('message',{\n name:'System',\n text: 'Current users:' + users.join(' , '),\n timestamp: moment.valueOf()\n \n });\n }", "title": "" }, { "docid": "25076476099e0f65676ee0f6396a9adf", "score": "0.5154607", "text": "function Connect() \n {\n let keepAliveWebsocketTimer = null;\n // Create the connection in case of a non-virtual mode\n if(SettingsParameter.Mode != \"a\")\n {\n // Establish websocket connection\n WebSocketClient = new WebSocket(SettingsParameter.DataSocketURL);\n\n // Handler for received messages\n WebSocketClient.onmessage = function (Event) \n {\n //debug(Event.data);\n var Message = Event.data;\n HandleReceivedMessage(Message);\n };\n \n // Handler called when the websocket connection is closed\n WebSocketClient.onclose = function () \n {\n // websocket is closed.\n debug(\"Command connection closed...\");\n debug(\"Warning: Disconnected from websocket server! Your session has ended.\");\n alert(\"Warning: Disconnected from websocket server! Your session has ended. Your browser window will be closed\");\n \n // tell ECP that the connection is closed\n var InitializeMessage = new ServerInterfaceInfoMessage();\n InitializeMessage.setInfoType(EnumServerInterfaceInfo.Disconnect);\n EventHandler.fireServerInterfaceInfoEvent(InitializeMessage);\n //window.close();\n\n clearInterval(keepAliveWebsocketTimer);\n };\n \n // Handler called when the websocket connection is established\n WebSocketClient.onopen = function ()\n {\n setTimeout(()=>{\n $(\"#ExperimentConnectingModal\").modal(\"hide\");\n },1000);\n\n debug(\"Login\");\n Login();\n\n keepAliveWebsocketTimer = setInterval(Login,1000 * 30);\n\n // Tell ECP that the connection is established\n var InitializeMessage = new ServerInterfaceInfoMessage();\n InitializeMessage.setInfoType(EnumServerInterfaceInfo.Connect);\n EventHandler.fireServerInterfaceInfoEvent(InitializeMessage);\n };\n }\n else\n {\n // Virtual mode - only temporary\n var InitializeMessage = new ServerInterfaceInfoMessage();\n InitializeMessage.setInfoType(EnumServerInterfaceInfo.Connect);\n EventHandler.fireServerInterfaceInfoEvent(InitializeMessage);\n }\n }", "title": "" }, { "docid": "e0e61a2c073ad356ad8f256e779309b3", "score": "0.51446223", "text": "function startLogin() {\n\n // Generate a random client ID\n clientID = \"clientID-\" + parseInt(Math.random() * 100);\n\n host = \"broker.mqttdashboard.com\";\n port = \"8000\";\n\n console.log(host)\n\n localStorage[\"host\"] = host;\n localStorage[\"port\"] = port;\n localStorage[\"clientID\"] = clientID;\n\n // Initialize new Paho client connection\n client = new Paho.MQTT.Client(host, Number(port), \"/mqtt\", clientID);\n\n console.log(client.clientId);\n\n // Set callback handlers\n client.onConnectionLost = onConnectionLost;\n client.onMessageArrived = onMessageArrived;\n\n\n // Connect the client, if successful, call onConnect function\n client.connect({\n onSuccess: onLogIn,\n //userName : document.getElementById(\"username\").value,\n //password : document.getElementById(\"password\").value\n });\n\n}", "title": "" }, { "docid": "d0bf81a8ffba4e33cd5f12d5d4d6d9e2", "score": "0.5138743", "text": "function getParameters() {\n servername = document.getElementById(\"mqttParameters\").servername.value;\n serverport = document.getElementById(\"mqttParameters\").serverport.value;\n clientid = document.getElementById(\"mqttParameters\").clientid.value;\n subtopics = document.getElementById(\"mqttParameters\").subtopics.value;\n}", "title": "" }, { "docid": "749ac879c493e8078313ea49c563e0f0", "score": "0.5137728", "text": "sendInputReply(content) {\n const msg = KernelMessage.createMessage({\n msgType: 'input_reply',\n channel: 'stdin',\n username: this._username,\n session: this._clientId,\n content\n });\n this._sendMessage(msg);\n this._anyMessage.emit({ msg, direction: 'send' });\n }", "title": "" }, { "docid": "fba95a4cf412f36ee7ee3ca43bcd2658", "score": "0.5132417", "text": "function getConnectedClient() {\n //console.log('Attempting to create TCP client and connect to server..');\n const client = new net.Socket();\n messageProtocol = global.settings.messageProtocol;\n\n client.connect({\n port: global.settings.port,\n host: global.settings.host,\n });\n\n client.on('connect', function() {\n console.log(`Client: connection established with server!`);\n\n if (messageProtocol === messageProtocols.old) {\n sendData(client, {\n surge: 0.0,\n sway: 0.0,\n heave: 0.0,\n roll: 0.0,\n pitch: 0.0,\n yaw: 0.0,\n autodepth: false,\n autoheading: false,\n });\n } else {\n sendIMCData(client);\n }\n });\n\n // Handles receiving data\n client.on('data', function(buf) {\n try {\n if (messageProtocol === messageProtocols.old) {\n let data = decodeData(buf);\n global.fromROV = data;\n sendData(client, global.toROV);\n } else if (messageProtocol === messageProtocols.IMC) {\n const fromROVIMC = decodeImcData(buf);\n global.fromROVIMC = fromROVIMC;\n const toROVIMC = sendIMCData(client);\n global.toROVIMC = toROVIMC;\n }\n } catch (error) {\n console.log('Unable to decode message:');\n console.log(\n `Buffer: ${buf\n .toString('hex')\n .match(/../g)\n .join(' ')}`,\n );\n console.log(`Buffer length: ${buf.length}`);\n\n console.log(error.message);\n }\n });\n\n // Tries to connect again if server is not opened yet\n client.on('error', function(err) {\n const { code } = err;\n if (code === 'ECONNREFUSED') {\n if (connectionAttempts < limitAttempts) {\n connectionAttempts += 1;\n console.log('Connection attempt failed. Trying again in 500ms..');\n setTimeout(getConnectedClient, 500);\n } else {\n console.log(\n `Giving up after ${connectionAttempts + 1} connection attempts. `,\n );\n connectionAttempts = 0;\n }\n client.destroy();\n }\n });\n return client;\n}", "title": "" }, { "docid": "ffb2ffffcbbfe571bd76c7cfb850edc5", "score": "0.5132094", "text": "function initClient(thisSocket) {\n\n // create a new 'performance'\n var thisPerformance = {};\n\n\n // add the socket to the performance\n thisPerformance.socket = thisSocket;\n\n // add socket handlers\n addSocketHandlers(thisSocket);\n\n // open performance-script\n thisPerformance.script = function (script) {\n\n // save a copy to this performance\n return script;\n\n }(performanceScript);\n \n // add to performances using socket.id as the key?\n performances[thisSocket.id] = thisPerformance;\n console.log('New connection:' + thisSocket.id);\n\n // send script to client \n thisSocket.emit('script', thisPerformance.script);\n\n}", "title": "" }, { "docid": "d4fde98ec0324393519f39e878564a13", "score": "0.51307577", "text": "function introduction(socket, who){\n\n\tif(who == 'player'){\n\n \t\tsocket.emit('introduction', 'player');\n\n \t\tconsole.log('Hi Player, you are connected to the server');\n\n \t} else if (who == 'conductor'){\n\n \t\tsocket.emit('introduction', 'conductor');\n\n \t\tconsole.log('Hi Conductor, you are connected to the server');\n\n \t} else {\n\n \t\tconsole.log('Error, user type not defined you are not connected to the server');\n\n \t}\n\n}", "title": "" }, { "docid": "e553a3b6f5f7237f0f5f757c1ac6ac09", "score": "0.51291263", "text": "function onConnect() {\n console.log('client is connected');\n client.subscribe(\"MPU9250/namiki-digital\");\n\n}", "title": "" }, { "docid": "5afb7c8d7458469b6afce0023fa2853a", "score": "0.5128823", "text": "function startClient() {\n\t/**\n\t * Open connection to OI server\n\t */\n\toisc.client = net.createConnection({port: oisc.config.port, host: oisc.config.host}, function() {\n\t\tconsole.log(red + 'CLIENT: ' + reset + blue + 'Connected to ' + oisc.config.host + ':' + oisc.config.port + reset);\n\t});\n\n\t/**\n\t * Receive data from OI server\n\t */\n\toisc.client.on('data', function(data) {\n\t\tconsole.log(red + 'CLIENT RECEIVED: ' + reset + blue + data + reset);\n\t\toisc.server.write(data);\n\t\tparser_inbound.parsePacket(data, function(send, receiver, packet) {\n\n\t\t});\n\t});\n\n\t/**\n\t * Error on OISC client\n\t */\n\toisc.client.on('error', function(error) {\n\t\tconsole.log('OISC Client Error: ' + error.stack);\n\t});\n\n\t/**\n\t * OI Server disconnect\n\t */\n\toisc.client.on('end', function() {\n\t\tconsole.log(red + 'CLIENT CONNECTION ENDED' + reset);\n\t});\n}", "title": "" }, { "docid": "0e1af29badbf8d5fcdd89bd19bbd6b4d", "score": "0.512677", "text": "function subscribeToPlayerInputChanges(room, cb) {\n try{\n socket.on(\"player-input-\"+room, callBack => cb());\n socket.emit('subscribeToPlayerInputChanges', room);\n }\n catch (err)\n {\n alert(err);\n }\n \n }", "title": "" }, { "docid": "5f0f7e6cba8fa807e943ee71950788a8", "score": "0.5125263", "text": "_onClientCommand(client, payload)\n {\n this.emit('command', {...payload, client});\n }", "title": "" }, { "docid": "027bb9b667cc00b12c6bd180bd381d55", "score": "0.5124522", "text": "sendText() {\n\n\t\t//obtention du texte\n\t\tvar data = document.getElementById(\"textBoxInput\").value;\n\t\tconst socketMessage = new Message(\"onMessage\", currentChannelId, data, \"MAXIME\", Date.now());\n\t\tconsole.log(\"Message sent to socket : \\n\" + JSON.stringify(socketMessage));\n\t\tthis.connectHandlerObservable.webSocket.send(JSON.stringify(socketMessage));\n\n\t\t//reset du texte box\n\t\tdocument.getElementById(\"textBoxInput\").value = \"\";\n\n\t}", "title": "" }, { "docid": "1ec50581bb7990f4571d1a92cec63265", "score": "0.5123619", "text": "function startOutServer(clients){\r\n\tconsole.log('Inside the out server');\r\n\tvar firstTimestamp = 0;\r\n\tvar interval = setInterval(function(){\r\n\t\tgetFirstTimestamp(function(err, timestamp){\t\r\n\t\t\tif (err || timestamp <=0){\r\n\t\t\t\tl.info('Trying to get the timestamp of the first record.');\r\n\t\t\t} else {\r\n\t\t\t\tfirstTimestamp = timestamp;\r\n\t\t\t\tl.info('Got firstTimestamp: '+firstTimestamp);\r\n\t\t\t\tclients.forEach(function(client){\r\n\t\t\t\t\tif (client.currentTimestamp < firstTimestamp){\r\n\t\t\t\t\t\tclient.currentTimestamp = firstTimestamp;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tclearInterval(interval);\r\n\t\t\t}\r\n\t\t});\r\n\t},rate_reconnect);\r\n\r\n\tvar outserver = require('./outserver');\r\n\toutserver.init(30114, function(state){\r\n\t\tlet clientId = state.connectionId;\r\n\t\tlet data = state.payload;\r\n\t\tlet connection = state.connection;\r\n\t\tclients[clientId] = clients[clientId] || {};\r\n\t\tlet client = clients[clientId];\r\n\t\tlet currentTimestamp = client.currentTimestamp;\r\n\t\t\r\n\t\tl.info('Got client\\'s timestamp: '+currentTimestamp);\r\n\t\t\r\n\t\tswitch(state.statusText){\t\t\t\r\n\t\t\tcase 'error':\r\n\t\t\t\tl.error(data);\r\n\t\t\t\tclient.currentTimestamp = firstTimestamp;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'message': \r\n\t\t\t\tif (halt == 0) {\r\n\t\t\t\t\theapCheck();\r\n\t\t\t\t\tif (currentTimestamp == 0){\r\n\t\t\t\t\t\tl.info('Client\\'s timestamp is 0 or null.');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tlet from = parseInt(currentTimestamp);\r\n\t\t\t\t\t\tlet to = parseInt(currentTimestamp)+parseInt(data.step);\r\n\t\t\t\t\t\tl.info('Getting all data between '+from+' and '+to+' timestamp.');\r\n\t\t\t\t\t\tpool.query('select * from '+mariadb.db+'.messages where timestamp >= '+from+' and timestamp <'+to, (err,rows) => {\t\r\n\t\t\t\t\t\tif (err) {\r\n\t\t\t\t\t\t\tconsole.log(err);\r\n\t\t\t\t\t\t\tl.error(err.message);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tl.info('Sending data to client');\r\n\t\t\t\t\t\t\toutserver.send(rows,connection,l);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tl.info('To is '+to);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tclient.currentTimestamp=to;\r\n\t\t\t\t\t} catch(e){\r\n\t\t\t\t\t\tl.error(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'terminated':\r\n\t\t\t\tclient.currentTimestamp = firstTimestamp;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'connected': \r\n\t\t\t\tclients[clientId] = {'connectionState':state,'currentTimestamp':firstTimestamp};\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t},l);\r\n}", "title": "" }, { "docid": "e59aff78671551eb6cb23644614bb486", "score": "0.51218915", "text": "function onConnect() {\n client.subscribe(TOPICS.COMMANDSWEB);\n client.subscribe(\"value1\");\n client.subscribe(\"value2\");\n client.subscribe(\"status\");\n //ALIVE COMAND- WITH KEY\n message = new Paho.MQTT.Message(COMMANDS.ALIVE_ESP);\n message.destinationName = TOPICS.COMMANDS;\n client.send(message);\n //SYNC COMAND\n message = new Paho.MQTT.Message(\"sync\");\n message.destinationName = TOPICS.COMMANDS;\n client.send(message);\n\n}", "title": "" }, { "docid": "0050e10eb902671604c28e805e0b4581", "score": "0.51205385", "text": "clientMovePlayer(name, hintNr){\n //debugger;\n this.socket.emit(\"client:movePlayer\", {name:name, hintNr:hintNr});\n }", "title": "" }, { "docid": "564908a8ec6f0a89591ac5a9ea95a7c2", "score": "0.5117404", "text": "function sendCurrentUsers(socket){\n var userDataRequested = clientInfo[socket.id];\n var users =[];\n if(typeof userDataRequested==='undefined'){\n return;\n }\n Object.keys(clientInfo).forEach(function (socketId) {\n var userDataFound=clientInfo[socketId];\n if(userDataRequested.roomname===userDataFound.roomname){\n users.push(userDataFound.username)\n }\n\n })\n socket.emit('messageFromServer',{\n username:'Chatmaster',\n text: 'Current users: ' + users.join(', ')\n })\n}", "title": "" }, { "docid": "90a685156db01a1dbbbd0dc112138924", "score": "0.51159483", "text": "function client(){\n\tconst net = require('net');\n\tconst server = net.createServer((c) => {\n\t // 'connection' listener.\n\t console.log('client connected');\n\t c.on('end', () => {\n\t console.log('client disconnected');\n\t });\n\t c.write('hello\\r\\n');\n\t c.pipe(c);\n\t //console.log(c);\n\t});\n\tserver.on('error', (err) => {\n\t throw err;\n\t});\n\tserver.listen(8124, ()=> {\n\t console.log('server bound' , server.address());\n\t});\n\n\n}", "title": "" }, { "docid": "42f90cd8bc0af04aab3094d88843c985", "score": "0.51157314", "text": "function connectToServerAndHandlingEvent() {\n\t// connection = new WebSocket('wss://webrtctest.poczta.onet.pl/ws/');\n\tconnection = new WebSocket('ws://localhost:7070');\n\t//Connection open event handler\n\tconnection.onopen = function () {\n\t\tif (loginStatus && connectionOff) {\n\t\t\tconsole.log(\"asking for reconect for: \",nickname);\n\t\t\tsend({\n\t\t\t\ttype: \"reconnect\",\n\t\t\t\tname: nickname,\n\t\t\t\totherName: connectedUser\n\t\t\t});\n\t\t}\n\t\t// /*_____________________________________________________*\n\t\t// \t* * Event Handler to receive messages from server * *\n\t\t// *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/\n\t\tconnection.onmessage = function (message) {\n\t\t\t//console.log('Client - received socket message: ' + message.data.toString());\n\n\t\t\tif (message.data === '__ping__') {\n\t\t\t\tconsole.log(\"ping\");\n\t\t\t\tws.send(JSON.stringify({ keepAlive: name }));\n\t\t\t} else {\n\t\t\t\tlet data;\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse(message.data);\n\t\t\t\t} catch{\n\t\t\t\t\tconsole.log(\"filed to parse msg froms erver \");\n\t\t\t\t}\n\n\t\t\t\tswitch (data.type) {\n\t\t\t\t\tcase \"login\": \t\t\t\t\t//done \n\t\t\t\t\t\tonLogin(data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"availableUsers\":\t\t\t\t//done \n\t\t\t\t\t\tonAvailableUsers(data.availableUsers);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"callRequest\":\t\t\t\t\t//done,\n\t\t\t\t\t\tonCallRequest(data.callType, data.name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"callAnswer\":\t\t\t\t\t//done,\n\t\t\t\t\t\tonCallAnswer(data.answer, data.name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"readyState\":\t\t\t\t\t// done,\n\t\t\t\t\t\tonReadyState(data.readyState);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"error\":\t\t\t\t\t\t//done.\n\t\t\t\t\t\tonError(data.error,data.errorGrade);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"offer\": \t\t\t\t\t\t//done,\n\t\t\t\t\t\tonRTCOffer(data.offer);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"answer\": \t\t\t\t\t\t//done,\n\t\t\t\t\t\tonRTCAnswer(data.answer);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"candidate\": \t\t\t\t\t//done,\n\t\t\t\t\t\tonRTCCandidate(data.candidate);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"hangUp\":\t\t\t\t\t\t//do zrobienia\n\t\t\t\t\t\tonHangUp(0);\n\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tconsole.log(\"unexpected message from server: \", data);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t}\n\tconnection.onerror = function (msg) {\n\t\tonError(`socket error: ${msg.toString()}`)\n\t}\n\n\t//on connection close \n\tconnection.onclose = function () {\n\t\tconnectionOff = true;\n\t\tif (loginStatus) {\n\t\t\tconnectToServerAndHandlingEvent();\n\t\t\t//connection.trigger(\"onopen_RECONNECT\")\n\t\t} else {\n\t\t\tconsole.log(\"disconnect from signal server\");\n\t\t}\n\t}\n\t// end of handler\n}", "title": "" }, { "docid": "36e71ad0048747a7d8da153ead0da3d8", "score": "0.51147413", "text": "function onConnect() {\n client.subscribe(\"intrusion\");\n}", "title": "" }, { "docid": "264d163b8f82f71394d63b788fb3bc58", "score": "0.51091474", "text": "function connectClick() {\n\n // check if we have websockets available\n if (\"WebSocket\" in window) {\n ip = document.getElementById('ipaddress').value;\n port = document.getElementById('portnumber').value;\n\n const socks = \"ws://\" + ip + \":\" + port + \"\";\n console.log(socks);\n addText(\"clientmessages\", \"Socket: \" + socks + \"\\n\");\n\n // Let us open a web socket\n ws = new WebSocket(socks);\n ws.onopen = onOpen;\n ws.onclose = onClose;\n ws.onmessage = onMessage;\n ws.onerror = onError;\n }\n else {\n // The browser doesn't support WebSocket\n alert(\"WebSocket NOT supported by your Browser!\");\n }\n }", "title": "" }, { "docid": "95b00a4f321bc7e52d17dcf439322fdc", "score": "0.5106847", "text": "function connectionID() {\n socket.emit(\"start-game\", socket.id);\n console.log(\"connected to \" + URI);\n}", "title": "" }, { "docid": "58cd87ec1351adf0183493905ee49dc0", "score": "0.5105914", "text": "onClientConnect(socket) {\n console.log('Client connected');\n // Register the message handlers\n Object.keys(this.messageHandlers).forEach((msgName) => {\n socket.on(msgName, data =>\n this.messageHandlers[msgName](data, socket, this.registerSocketWithBoard));\n });\n\n // Set up the handler for Redux actions for the socket\n Object.keys(this.SharedActionTypes).forEach(type =>\n socket.on(type, (payload) => {\n this.updateHandler(type, payload, socket);\n }));\n // Dot indicating where other people are looking\n socket.on('clientUpdate', data => this.broadcastClientUpdate(data, socket));\n\n socket.on('disconnect', () => this.onClientDisconnect(socket));\n }", "title": "" }, { "docid": "9d023c600a4ac9c0804229660da6e0f3", "score": "0.5102404", "text": "function clientList(user) {\n let names = [];\n console.log(sockets.length)\n sockets.forEach((s) => {\n if (s.name !== user.name) {\n names.push(s.name);\n }\n });\n user.write(`Current Users Online: ${names}`);\n writeToLog(`${user.name} ran clientList Function`)\n}", "title": "" }, { "docid": "14f35177591401c8bc02a0cd573f5539", "score": "0.5099492", "text": "function sendMessage(){\r\n event.preventDefault();\r\n let texte = document.getElementById(\"input\").value; //On récupère le message entrer par un client\r\n websocket.send(login+\" : \"+texte); // affiche le message dans le chat\r\n document.getElementById(\"input\").value = \"\"; //On efface le message dans le input\r\n \r\n}", "title": "" }, { "docid": "cbea0a7c10c1add224fda3bb17f0915a", "score": "0.50971067", "text": "function sendMessage() {\n let message = $(\".chat-input input\").val();\n\n // Send the message to the server.\n socket.emit(\"input_message\", message, (username, datetime) => {\n\n // Get the username and display the message.\n addMessageUi(username, message, datetime, true);\n cleanInput(\".chat-input input\");\n });\n}", "title": "" }, { "docid": "1a7314ce3e9840f0bb6c7d08a62c0410", "score": "0.5094049", "text": "function connect(googleUser){\r\n\tuserName = googleUser.getBasicProfile().getName();\r\n\tuserEmail = googleUser.getBasicProfile().getEmail();\r\n\t $('#user').append(\"<p>\" + userName + \"</p>\");\r\n\t $('#login').hide();\r\n\t $('#main').show();\r\n\t \r\n\t // Je nach Type der Message werden die jeweiligen Aktionen ausgeführt\r\nwebSocket = new WebSocket(server);\r\n\t //webSocket = new WebSocket(\"ws://localhost:8080/socket\");\r\n\r\nwebSocket.onmessage = (msg) => {\r\n\r\n\trequestJson = JSON.parse(msg.data);\r\n\tswitch (requestJson.type){\r\n\tcase \"refreshUserList\":\r\n\t$(\"#contacts\").empty();\r\n\t$.each(requestJson.users ,function(key, value) {\r\n\t\t $(\"#contacts\").append(\"<li class='list-group-item'>\" + value + \"</li>\") ;\r\n\t\t }\r\n\t\t) ;\r\n\tbreak;\r\n\tcase \"clickedOnDocument\":\r\n\t\t $(\"#test\").append(\"<li>\" + requestJson.docID + \"</li>\") ;\r\n\t\t \r\n\tbreak;\t\r\n\tcase \"newDocProposal\":\r\n\t\tif (typeof svg == \"svg is not defined\") {\r\n\t\t\tdrawDiagram(requestJson.docProposal);\r\n\t\t\t \r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(hoverStopDraw == false && FilterStopDraw == false){\r\n\t\t\t\t\t$(\"svg\").first().remove();\r\n\t\t\t\t\tdrawDiagram(requestJson.docProposal);\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t \r\n\tbreak;\r\n\tcase \"sessionStarted\":\r\n//\t\talert(\"SessionID: gestartet \"+ requestJson.sessionID);\r\n\t\tsessionID = requestJson.sessionID;\r\n\t\tstartSessionOfOtherUser(requestJson.sessionID);\r\n\tbreak;\t\r\n\tcase \"sessionEnded\":\r\n\t\tendSessionOfOtherUser();\r\n//\t\talert(\"session beendet\");\r\n\t\tbreak;\t\r\n\t}\r\n}\r\n\r\n\r\nwebSocket.onopen = () => webSocket.send(JSON.stringify({\r\n type: \"join\",\r\n\tusername: userName\r\n}));\r\n}", "title": "" } ]
ae624b107685f5cad754f1c0afd4c947
Returns true if response code is internal server error
[ { "docid": "45d467ae5ac26d1b6423104b317ca565", "score": "0.62629503", "text": "function defaultShouldHandleError(error) {\n const status = getStatusCodeFromResponse(error);\n return status >= 500;\n}", "title": "" } ]
[ { "docid": "57eccbafe3b568a076a8acf8c39d50d6", "score": "0.7216823", "text": "function error(info) {\n return (info.status >= 500);\n}", "title": "" }, { "docid": "f76502876039ef3799eda0930692dce8", "score": "0.6907079", "text": "static error() {\n const headers = new headers_1.GuardedHeaders(\"immutable\");\n const status = 521;\n const statusText = \"Web Server Is Down\";\n return new Response(null, { headers, status, statusText }, { type: \"error\" });\n }", "title": "" }, { "docid": "8bcf1f9dfb48e6e25e35b1b0e3bc44cd", "score": "0.6716612", "text": "checkStatus(response) {\n\t if (response.status >= 200 && response.status < 300) {\n\t return response\n\t } else {\n\t var error = new Error(response.statusText)\n\t error.response = response\n\t throw error\n\t }\n\t}", "title": "" }, { "docid": "7def7c07640fa6b87053a0d699ada704", "score": "0.67087424", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({ error: message });\n return false;\n}", "title": "" }, { "docid": "7b412879deacdf2ebaf73b33be3c0100", "score": "0.66980106", "text": "function shouldBeErrorAction(err) {\n\t\tvar UNRESOLVABLE_ERROR_CODES = [80015, 80017, 80030];\n\t\tif(err.code) {\n\t\t\tif(Auth.isTokenErr(err)) return false;\n\t\t\tif(Utils.arrIn(UNRESOLVABLE_ERROR_CODES, err.code)) return true;\n\t\t\treturn (err.code >= 40000 && err.code < 50000);\n\t\t} else {\n\t\t\t/* Likely a network or transport error of some kind. Certainly not fatal to the connection */\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "80ece3c23637ea5cc8065ae0516c2f2f", "score": "0.66735923", "text": "function checkStatus(res) {\n if (res.status >= 200 && res.status < 300) {\n return res;\n }\n var error = new Error(res.statusText);\n error.res = res;\n throw error;\n}", "title": "" }, { "docid": "4ac70985c0532c0dcd0f49079f3f4a78", "score": "0.6654018", "text": "function checkStatus(response) {\n\t if (response.status >= 200 && response.status < 300) {\n\t return response;\n\t }\n\t var error = new Error(response.statusText);\n\t error.response = response;\n\t throw error;\n\t}", "title": "" }, { "docid": "ac86922b1073a7f448808d6f90035215", "score": "0.6604407", "text": "function checkStatus(response) {\n if (response.status >= 200 && response.status < 300) {\n Debugger.log(\"checkStatus success\");\n return response;\n } else {\n Debugger.log(\"response.statusText = \" + JSON.stringify(response.statusText));\n var error = new Error(response.statusText);\n error.response = response;\n throw error;\n }\n}", "title": "" }, { "docid": "983f19f787303ef4699e776cd28ae955", "score": "0.65419656", "text": "checkStatus(response) {\n if (response.status >= 200 && response.status < 300) {\n return response\n } else {\n let error = new Error(response.statusText)\n error.response = response\n throw error\n }\n }", "title": "" }, { "docid": "1b36e379b6183ca7e670c482421d9ea9", "score": "0.6541369", "text": "function internalServerError(error, res, code) {\n\n let body = {\n\n message : error.message || \"Unknown error occured, please contact administrator\",\n errorno : error.errno,\n code : error.code\n }\n\n console.error(body);\n\n res.status(code || 500);\n res.send(body);\n}", "title": "" }, { "docid": "f3adca604eedff24d0fba0a7670027b6", "score": "0.65135163", "text": "_isError() {\n switch (this) {\n case Status.Success:\n case Status.Ok:\n return false;\n case Status.Unknown:\n case Status.ReceiptNotFound:\n case Status.RecordNotFound:\n return true;\n default:\n return true;\n }\n }", "title": "" }, { "docid": "fa098da75c0ab2a263386f0ce0532472", "score": "0.65100896", "text": "isSuccess_(resp) {\n return 200 <= resp.status && resp.status < 300;\n }", "title": "" }, { "docid": "037add9a69fcf99977ceb0040d2add75", "score": "0.65041435", "text": "function checkStatus(response) {\n var error = undefined;\n if (response.status >= 300) {\n error = new Error(response.statusText);\n error.response = response;\n throw error;\n } else {\n return response;\n }\n}", "title": "" }, { "docid": "177d59e1a1d3fc69005aa0db55f5dda2", "score": "0.65036935", "text": "function checkStatus(response) {\n\t\tif (response.status >= 200 && response.status < 300) {\n\t\t\treturn response;\n\t\t}\n\t\tvar error = new Error(response.statusText);\n\t\terror.response = response;\n\t\tthrow error;\n\t}", "title": "" }, { "docid": "88e41801f838dcb039400b67cf1aba87", "score": "0.6492987", "text": "function httpError(res, err, code) {\n res.setHeader(\"Content-Type\", \"text/plain\");\n res.statusCode = code || 500;\n if(typeof err === 'string') {\n res.end(err);\n } else if(typeof err === 'object' && err.message) {\n res.end(err.message);\n } else {\n res.end(\"Unknown error\");\n }\n}", "title": "" }, { "docid": "ecfc163bf25369c561c7f6dd2cd9bfe4", "score": "0.6450777", "text": "function checkStatus(response) {\n if (!response.ok) {\n const error = new Error(response.statusText);\n error.response = response;\n throw error;\n }\n return response;\n}", "title": "" }, { "docid": "2382fb5b521e66bf452272cb834ef0ed", "score": "0.6421992", "text": "ok() {\n return (this.#error.message === \"\" && this.statusCode >= 200 && this.statusCode < 300);\n }", "title": "" }, { "docid": "802b47a2c0eec8b0efdf558c5edd40a9", "score": "0.6404796", "text": "static get SERVER_ERROR() {\n return {\n statusCode: 500,\n message: 'Internal Server error!',\n };\n }", "title": "" }, { "docid": "a180c3dd40f664623bcf00dd1a6145cd", "score": "0.63960105", "text": "function httpErrRes(socket){\n socket.write(\"HTTP/1.1 500 Internal Server Error\\n\");\n socket.write(\"Content-Type: text/html\\n\");\n socket.write(\"Date: \" + Date.now() + \"\\n\");\n socket.write(\"Connection: keep-alive\\n\");\n socket.write(\"Content-Length: 200\\r\\n\\n\");\n socket.write(\"\\<html><head><title>500 internal error</title></head><body>\" +\n \"\\ <h1>Internal Error</h1> \" +\n \"\\<p>The server encountered an unexpected condition which prevented\" +\n \"\\ it from fulfilling the request.</p></body></html>\");\n}", "title": "" }, { "docid": "97bd71d634260b41089c896b48d3f9a2", "score": "0.6372705", "text": "function serverError(message, status) {\n res.status(status ? status : 500).json({error: message});\n }", "title": "" }, { "docid": "88300b104d74863f670ee6a0e27b3aca", "score": "0.63725823", "text": "handleResponseError(response) {\n throw new Error(\"HTTP error, status = \" + response.status);\n }", "title": "" }, { "docid": "c643f07f1986abbd67d64b962c1495f8", "score": "0.6363591", "text": "function error(status, err) {\n res.statusCode = status || 500;\n res.end(err.toString());\n }", "title": "" }, { "docid": "194d97a3d375130dc36323d3ae9a222a", "score": "0.6354211", "text": "function checkResponseStatus(response) {\n if (response.status < 200 || response.status > 399) {\n // there was an error when calling the upstream service, propagate that\n throw new HTTPError({\n status: response.status,\n type: 'api_error',\n title: 'upstream service error',\n detail: response.body\n });\n }\n}", "title": "" }, { "docid": "1f9f2a4ab46c24b2913a8653e6a6ae7a", "score": "0.6350816", "text": "function sp_handle_site_errors( test_response ){\n if ( !test_response.ok ){\n throw Error( test_response.statusText );\n }\n return test_response;\n}", "title": "" }, { "docid": "4da9bd21909923a00aac6871615e8a07", "score": "0.6338079", "text": "function checkStatus(res) {\n if (res.status >= 200 && res.status < 300) {\n return res\n }\n const error = new Error(res.statusText)\n error.res = res\n throw error\n}", "title": "" }, { "docid": "dc16dada3d2f288230fdfdb2d2fbe6b1", "score": "0.6332963", "text": "function checkStatus(response) {\n if (response.status >= 200 && response.status < 300) {\n return response;\n }\n const error = new Error(response.statusText);\n error.response = response;\n throw error;\n}", "title": "" }, { "docid": "6372094abc1642278fd11005e52cc2bf", "score": "0.63169324", "text": "function error (err) {\n res.statusCode = err.status || 500\n res.end(err.message)\n }", "title": "" }, { "docid": "5a25a6fb8387e00ac974735f0371c44e", "score": "0.63124835", "text": "checkStatus(response) {\n if (response.status >= 300 || response.status < 200) {\n const message = `fetch failed: ${response.status} for ${response.url}`;\n const error = new Error(message);\n error.response = response;\n throw error;\n }\n return response;\n }", "title": "" }, { "docid": "1581ae72dfa646226e7c5d9857ad19af", "score": "0.6307684", "text": "static InternalServerError(res, errorMessage, message) {\n res.statusCode = 500\n const response = {\n \"code\" : 500,\n \"errorMessage\" : errorMessage,\n \"message\" : message\n }\n return res.send(response);\n }", "title": "" }, { "docid": "b4cf20b921dfb297d6e4a788290c7fb3", "score": "0.62758726", "text": "function checkStatus(response) {\n if (response.status >= 200 && response.status < 300) {\n return response;\n }\n\n const error = new Error(response.statusText);\n error.response = response;\n throw error;\n}", "title": "" }, { "docid": "b1d195023932b1fcea22aa82921ce2f4", "score": "0.6250731", "text": "function __isDocumentOk(http) {\n\tvar stat = http.status || 0;\n\treturn ( (stat >= 200) && (stat < 300) ) || // allow any 2XX response code\n\t\t(stat == 304) || // get it out of the cache\n\t\t(stat == 1223) || // IE mangled the status code\n\t\t(!stat && (location.protocol == 'file:' || location.protocol == 'chrome:'));\n}", "title": "" }, { "docid": "2ffb7e562fa8a16a7d89c1ae70fc1d06", "score": "0.6247865", "text": "function check(response) {\n const { status, statusText } = response;\n console.log(statusText);\n if (status >= 200 && status < 300) return response;\n\n const error = new Error(statusText);\n error.response = response;\n return error;\n}", "title": "" }, { "docid": "190c622dc621e3be28491fadaeb9f5e3", "score": "0.622113", "text": "handleHTTPErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n }", "title": "" }, { "docid": "3e5624e66a665335e536ae0460414274", "score": "0.6216148", "text": "function errHandling(res) {\r\n if (!res.ok) {\r\n throw new Error('El problemo' + res.status)\r\n }\r\n }", "title": "" }, { "docid": "aacbc12301b647b6209076f2e288ef27", "score": "0.6214587", "text": "function res_400(res)\n{\nres.status(400)\n res.send();\n return;\n}", "title": "" }, { "docid": "d5ac0e51ceee31655f8008d28a5509f9", "score": "0.6207141", "text": "endWithErrorCode(r, code, errorText){\n\t\t// r.response.writeHead(500,{\n\t\t// \t\"Content-Type\":\"text/plain\",\n\t\t// \t\"Access-Control-Allow-Origin\":\"http://localhost\"//\"*\"\n\t\t// });\n\t\tr.response.statusCode = code;\n r.response.setHeader( \"Content-Type\", \"application/json\")\n\t\tr.response.write(JSON.stringify({message:errorText}));\n\t\tr.response.end();\t\n\t\t// Log result\n\t\tthis.logResult(r, errorText);\n\t}", "title": "" }, { "docid": "aae9d63eb7e13c9ae068f9dbd8d40a3e", "score": "0.6187905", "text": "function onFailure(err) {\n onTimelyResponse(spec.code);\n Object(__WEBPACK_IMPORTED_MODULE_11__utils_js__[\"logError\"])(\"Server call for \".concat(spec.code, \" failed: \").concat(err, \". Continuing without bids.\"));\n onResponse();\n }", "title": "" }, { "docid": "4443b975635bf345c25b174a65654520", "score": "0.6180938", "text": "get ok() {\n return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n }", "title": "" }, { "docid": "41accef6bd7641dad08d7ae66ea31a81", "score": "0.6170974", "text": "function connectionErrorCheck(error) {\n if (error) {\n console.log('Database connection error: ', error);\n res.sendStatus(500);\n }\n}", "title": "" }, { "docid": "af7ea6752416db6d343113728dfd0b48", "score": "0.61669445", "text": "function checkStatus(response) {\n console.log(\"server response status check. \");\n\t if (response.status >= 200 && response.status<300) {\n return response.text();\n\t } else {\n return Promise.reject(new Error(response.status+\":\"+response.statusText));\n\t }\n }", "title": "" }, { "docid": "e09cac60fbcb1a9b3903bfd2169493ed", "score": "0.61535114", "text": "function checkAxiosResponse(res, validURL) {\n if ((/([23][\\d]{2})|401/).test(res.status) === false) {\n console.error(\"Error: \" + validURL.href + \"does not have a valid response. Status: \" + res.status);\n errorCount++;\n }\n else {\n successResponseUrlCount++;\n }\n }", "title": "" }, { "docid": "81a7e25535cf77671ee7306d4c6111bc", "score": "0.6149668", "text": "function bailOut(err) {\n if (err instanceof httplease.errors.UnexpectedHttpResponseCodeError) {\n console.log(err.response.statusCode);\n console.log(err.response.headers);\n console.log(err.response.body);\n } else {\n console.log(err.message)\n }\n process.exit(1);\n}", "title": "" }, { "docid": "9aeebf6588b61d67e8d5d52d13000e32", "score": "0.6142924", "text": "function error(err) {\n res.statusCode = err.status || 500;\n res.end(err.message);\n }", "title": "" }, { "docid": "3fc43b7f25649c71b4fab6499ef6ef26", "score": "0.61327165", "text": "function err500 (err, res) {\n console.log('\\x1b[31merror w/ request\\x1b[0m', err)\n res.writeHead(500);\n res.end();\n}", "title": "" }, { "docid": "f5731123ea0f5f15d77dadf842f0d902", "score": "0.6115782", "text": "function checkStatus(response) {\n // If response not okay, throw an error\n if (!response.ok) {\n const error = new Error(response.statusText);\n error.response = response;\n throw error;\n }\n\n // Otherwise just return the response\n return response;\n}", "title": "" }, { "docid": "f5731123ea0f5f15d77dadf842f0d902", "score": "0.6115782", "text": "function checkStatus(response) {\n // If response not okay, throw an error\n if (!response.ok) {\n const error = new Error(response.statusText);\n error.response = response;\n throw error;\n }\n\n // Otherwise just return the response\n return response;\n}", "title": "" }, { "docid": "00b9232903af5d2f5c7d2b01adf85604", "score": "0.6108158", "text": "assertOk() {\n if (this.ok()) {\n return;\n }\n let { message, error } = this.#error;\n if (message === \"\") {\n message = `server response ${this.statusCode} ${this.statusMessage}`;\n }\n assert$1(false, message, \"SERVER_ERROR\", {\n request: (this.request || \"unknown request\"), response: this, error\n });\n }", "title": "" }, { "docid": "2e61b1b8333fcbd3627dc22fe1d8e463", "score": "0.6107461", "text": "function isError(response) {\n // TODO: for some reason the binding returns GraphQLErrors differently\n // Hide this in the future\n if (response instanceof graphql_1.GraphQLError) {\n return true;\n }\n var extensions = response.extensions;\n return extensions && extensions.code !== undefined;\n}", "title": "" }, { "docid": "05bee6d6d45f628724c80b34c8f3703a", "score": "0.6103467", "text": "function catch_failed_requests(err) {\n if(err.response !== undefined) {\n throw new Error(`Server returned error response ${err.response.status}: ${err.response.text}`);\n } else {\n throw err;\n }\n}", "title": "" }, { "docid": "b482d9f4f824947c2fe196cce21d1566", "score": "0.6101277", "text": "function handleErr(err,req,res){\n\tconsole.log(Date.now());\n\tconsole.log(err);\n\tif (err == 'permission limit') {\n\t\tres.statusCode = 403;\n\t\tres.send({\n\t\t\tcode: 3,\n\t\t\tmsg: '用户权限不够'\n\t\t});\n\t\treturn true;\n\t}else if(err){\n\t\tres.statusCode = 500;\n\t\tres.send({\n\t\t\tcode: 1,\n\t\t\tmsg: 'server err'\n\t\t});\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "22174385d5e76bcdfabe92fb48de8f62", "score": "0.6097843", "text": "function show500(err, req, res) {\n res.writeHead(500, {\"Content-Type\": \"text/html\"});\n res.end(\"500 - INTERNAL SERVER ERROR \\n\" + err);\n}", "title": "" }, { "docid": "b56e6213cad2772666e77db040c43752", "score": "0.60914963", "text": "get ok() {\n return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n }", "title": "" }, { "docid": "3fe54a26d8939eed486a7e367d9e3beb", "score": "0.6088778", "text": "function bailOut(err) {\n if (err instanceof httplease.errors.UnexpectedHttpResponseCodeError) {\n console.log(err.response.statusCode);\n console.log(err.response.headers);\n console.log(err.response.body);\n } else {\n console.log(err.message)\n }\n\n process.exit(1);\n}", "title": "" }, { "docid": "86d1476db28dac5419183233aa89cca3", "score": "0.6068156", "text": "function checkStatus (response) {\n const {status} = response\n if (status >= 200 && status < 300) {\n // everything is ok\n return response\n } else if (status >= 300 && status < 400) {\n // 300 Multiple Choices\n // 301 - Moved Permanently,\n // 302 - Found, Moved Temporarily\n // 304 - not modified\n // 307 - Temporary Redirect\n } else if (status === 400) {\n // probably is a validation error\n return response\n } else if (status === 403 || status === 401) {\n // 401 - Forbidden\n // 403 - Unauthorized\n // remove local token in this case\n resetLocalToken()\n } else if (status === 404) {\n // Not Found\n return response\n } else if (status >= 500) {\n // Server error\n return response\n }\n}", "title": "" }, { "docid": "3db14c98c4e12e5e62f56c1c8774b641", "score": "0.6064422", "text": "function generalError(error, response) {\n console.log(error);\n response.send(\"Internal error occured :(\");\n}", "title": "" }, { "docid": "e9fbbdee69948cdcc93bb3ba181f042e", "score": "0.60583746", "text": "function checkConnectionError(err, res) {\n if(err) {\n res.status(500).json({'Error' : 'connecting to database: ' } + err);\n }\n}", "title": "" }, { "docid": "64213abaded894d38adf5a5ca41c0512", "score": "0.60560477", "text": "function error(response, code) {\n response.writeHead(code, { \"Content-Type\": \"text/html\" });\n if(code === 404) {\n fs.readFile('./html/error404.html', function(error, html) {\n if (error) {\n log.error(error);\n }\n log.error(\"Bad request - no handler found\");\n response.write(html);\n response.end();\n });\n fs.close(html);\n }\n if(code === 416) {\n fs.readFile('./html/error416.html', function(error, html) {\n if (error) {\n log.error(error);\n }\n log.error(\"Bad request - invalid query\");\n response.write(html);\n response.end();\n });\n fs.close(html);\n }\n if(code === 500) {\n fs.readFile('./html/error500.html', function(error, html) {\n if (error) {\n log.error(error);\n }\n log.error(\"Server error\");\n response.write(html);\n response.end();\n });\n fs.close(html);\n }\n}", "title": "" }, { "docid": "496ec8392b77e9f9ed45301c86188b09", "score": "0.6051003", "text": "function handleError(res, err) {\n return res.status(500).send(err);\n }", "title": "" }, { "docid": "7aaf70783b565f6ef5cbbda8211e692e", "score": "0.60440373", "text": "function errorCheck(err, response, body) {\n if (err) { console.error(err); }\n}", "title": "" }, { "docid": "e3c81d807946484b029f323639d2d19b", "score": "0.6043257", "text": "function error(err) {\n\t\tres.status(500);\n\t\tres.end(err.message);\n\t}", "title": "" }, { "docid": "33cf64f15c3bbbfd4eba1f4250eaa206", "score": "0.6042495", "text": "function handleError(err, res){\n if (res) res.status(500).send('Sorry, there was an error');\n}", "title": "" }, { "docid": "144209998dbfa48c13af43651f4b3a67", "score": "0.6036157", "text": "function Error500(){\n return(\n res.StatusCode === 404 && <div>\n <img src={} alt=\"500\"/> \n <p>Aaaah, What did you think you are doing, don't do that again please</p>\n </div>\n );\n}", "title": "" }, { "docid": "7054298add2fca4c8b72b329cb7bd0bd", "score": "0.60322857", "text": "isErrorBag (e) {\n return e.response && e.response.status && e.response.status === 422\n }", "title": "" }, { "docid": "a2bb546a142b5697459954fb7ffec86a", "score": "0.6030919", "text": "isError() {\n return this.state == ServiceState.ERROR;\n }", "title": "" }, { "docid": "35fdd853411a0a4207a81e25c827956f", "score": "0.60271585", "text": "function checkStatus (response) {\n // loading\n if (response && (response.status === 200 || response.status === 304 || response.status === 400)) {\n return response\n }\n return {\n status: 404,\n msg: '网络异常'\n }\n}", "title": "" }, { "docid": "640d5f1db2297467d2afdbe1557c7bcd", "score": "0.6018557", "text": "function sendError(code, res) {\r\n let httpCode = getprop(\"config\").strictHTTP ? getprop(\"config\").errors[code].http : 200;\r\n return res.status(httpCode).json({\r\n err: true,\r\n code: code,\r\n errmsg: getprop(\"config\").errors[code].msg,\r\n });\r\n}", "title": "" }, { "docid": "bb417bcfc16182056b2aa326627a1f9a", "score": "0.60081154", "text": "function handleError(error, res) {\n // if (error.type = 'ObjectId') {\n // return res.status(400).json({\n // msg: 'Invalid tokem'\n // });\n // }\n if (error.code === 11000) {\n return res.status(400).json({\n msg: 'Email ,Already Taken!'\n });\n }\n console.error(error.message);\n res.status(500).send('Server Error');\n}", "title": "" }, { "docid": "4250d0bf9f3bb19b9652593e7a850e6b", "score": "0.6006111", "text": "function goog$net$HttpStatus$isSuccess(status) {\n switch(status) {\n case 200:\n case 201:\n case 202:\n case 204:\n case 206:\n case 304:\n case 1223:\n return !0;\n default:\n return !1;\n }\n}", "title": "" }, { "docid": "a71113c936afc219176369986ffb5dd9", "score": "0.60030377", "text": "async checkStatus(res){\n if (res.status < 200 || res.status > 299){\n const msg = await res.json()\n // Show rails error detail\n let errorMsg = msg.error.detail\n if(!errorMsg){ errorMsg = msg.error }\n throw {\n type: \"danger\",\n msg: errorMsg\n }\n }\n // console.log(res.status)\n }", "title": "" }, { "docid": "3047e6848fbe8e4e44f3cdf6e7095643", "score": "0.60016686", "text": "function stdErr(response) { return Left(response.error); }", "title": "" }, { "docid": "c22871dbf119f152c785b631e97a8d3b", "score": "0.59962136", "text": "function IsRequestSuccessful (httpRequest) {\n // IE: sometimes 1223 instead of 204\n var success = (httpRequest.status == 0 || \n (httpRequest.status >= 200 && httpRequest.status < 300) || \n httpRequest.status == 304 || httpRequest.status == 1223);\n \n return success;\n}", "title": "" }, { "docid": "0c0fddef9e3b08ac337f1482c8ba2065", "score": "0.59912086", "text": "_sendError(res, err) {\n // log method\n logger.log(3, '_sendError', `Sending ${err.code} error status: ${err.message}`);\n // return error status\n return res.status(err.code).send(err);\n }", "title": "" }, { "docid": "0fc4a71a4e4ec713ff5d9d739c76bf6e", "score": "0.59862196", "text": "function handleErrorResponse(xhr, textStatus, error) {\n // error handling\n if (xhr.status === 404) {\n throw new Error('This Ajax call has not been implemented.');\n } else if (xhr.status === 500) {\n throw new Error('This Ajax call threw an exception: ' + error);\n } else if (xhr.status === 0) {\n throw new Error('The WebCheckers server is down.');\n } else {\n throw new Error(`Unknown error (status=${xhr.status}) error: '${error}'`);\n }\n }", "title": "" }, { "docid": "b630ac3bdb6842658050263c30fd395b", "score": "0.5974902", "text": "function handleErrors(response) {\n if (!response.ok) throw new Error(response.status);\n return response;\n}", "title": "" }, { "docid": "9ec80a4b27f4e16bfa137f93f72668ed", "score": "0.5972276", "text": "function a500(res, err){\n\tres.writeHead(500, {\"Content-Type\": \"text/html\"});\n\tres.write(\"<h1 style='border-bottom: 1px solid #e0e0e0'>500</h1>\\n\");\n\tres.write(\"<p>Hmm, something went wrong here, my bad, nothing you can do about it (yeah, it's a 500 ;)</p>\\n\");\n\tres.write(\"<p>\" + err + \"</p>\\n\");\n\tres.end();\n}", "title": "" }, { "docid": "72668e3fd642c54262e0f52854b890ce", "score": "0.59698564", "text": "function handleError(res, reason, message, code) {\n\tconsole.log(\"ERROR: \" + reason);\n\tres.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "79aa3bfb017574455ad2546e22fda590", "score": "0.59675944", "text": "function callbackFailure(_error, _options, _req, res) {\n res.writeHead(500, { 'Content-Type': 'text/html' });\n res.end('<html><body><h1>Oops, Something Went Wrong! Please Try Again or Contact the App Owner</h1></body></html>');\n}", "title": "" }, { "docid": "79aa3bfb017574455ad2546e22fda590", "score": "0.59675944", "text": "function callbackFailure(_error, _options, _req, res) {\n res.writeHead(500, { 'Content-Type': 'text/html' });\n res.end('<html><body><h1>Oops, Something Went Wrong! Please Try Again or Contact the App Owner</h1></body></html>');\n}", "title": "" }, { "docid": "c427797bb400a27b45fd63bd955496f0", "score": "0.59669566", "text": "function handleError(response, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n response.status(code || 500).json({ \"error\": message });\n}", "title": "" }, { "docid": "6e6cd87a8e49dd61859831165c89f6fa", "score": "0.5962538", "text": "function handleError(response, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n response.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "0b38604fdf1282e17c8a81dd7ae15831", "score": "0.596251", "text": "function send500(res) {\n res.status(500).send('Internal server error');\n}", "title": "" }, { "docid": "9477ef356087eb9cf01b5b50711b4902", "score": "0.5949057", "text": "function notGetDataAndSend501(response) {\r\n response.endHead(501);\r\n response.end('Sorry, could not get data!');\r\n}", "title": "" }, { "docid": "d3c1166b2f982b8905ed1c5b1323c750", "score": "0.59467244", "text": "function HandleError(res, reason, message, code) {\n\tconsole.log('ERROR: ' + reason);\n\tres.status(code || 500).json({ 'error': message });\n}", "title": "" }, { "docid": "dc7d41f99dd461f6f431eaee4fe25671", "score": "0.5943916", "text": "get ok() {\n\t\treturn this[INTERNALS$2].status >= 200 && this[INTERNALS$2].status < 300;\n\t}", "title": "" }, { "docid": "6efb290a4506a4b5318937d0d13a1c31", "score": "0.5941816", "text": "onErrorBase(req, res, err) {\n\t\tthis.logger.error(err);\n\t\tres.setHeader(\"Content-Type\", \"application/json; charset=utf-8\");\n\t\tif (err && _.isObject(err.message)) {\n\t\t\tres.statusCode = err.message.code;\n\t\t\tres.end(JSON.stringify({code: err.message.code }));\n\t\t} else {\n\t\t\tres.statusCode = err.code;\n\t\t\tres.end(JSON.stringify({\n\t\t\t\tcode: err.code || 501,\n\t\t\t\tmessage: err.message || \"Global error, Please contact support team\"\n\t\t\t}));\n\t\t}\n\t}", "title": "" }, { "docid": "96839b55b74000364a7435c41ba5aef2", "score": "0.59416777", "text": "function errorHandler(error, request, response) {\n response.status(500).send({'Status': 500,responseText:'sorry something went wrong'});\n\n }", "title": "" }, { "docid": "dd3cba5ffb2a25ccda13a06efb13e1ed", "score": "0.5938483", "text": "function errorStatus(error){\n\t\t\tconsole.log(error);\n\t\t}", "title": "" }, { "docid": "23c3c0d090fa9c0dda179aa52a724ab3", "score": "0.59377193", "text": "function checkResult(err, result, res) {\n\tif (err)\n\t\treturn res.status(500).send();\n\tif (result)\n\t\tres.status(200).send();\n}", "title": "" }, { "docid": "800e7935d8646353053f8bd95664a6e6", "score": "0.5934089", "text": "isError() { return this.result.isError(); }", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" }, { "docid": "34dfc04e50884940dd4623d64e1ddb3a", "score": "0.59335995", "text": "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "title": "" } ]
8f8390ea04e80f82fad636f0845204c4
function DestoryCalendar() Purpose: Destory any already drawn calendar so a new one can be drawn
[ { "docid": "ce26acadc9a355ec6732c905d34a7991", "score": "0.7819416", "text": "function DestroyCalendar() {\n var cal = document.getElementById(\"dpCalendar\");\n if(cal != null) {\n cal.innerHTML = null;\n cal.style.display = \"none\";\n }\n return\n}", "title": "" } ]
[ { "docid": "153c7a4a60759675c90703336f8f0d06", "score": "0.74942666", "text": "function clearCalendar()\n{\n clearDays();\n let year = document.getElementById(\"calendarYear\")\n while(year.firstChild){\n year.removeChild(year.firstChild);\n }\n let month = document.getElementById(\"calendarMonth\");\n while(month.firstChild){\n month.removeChild(month.firstChild);\n }\n}", "title": "" }, { "docid": "3648da037815e20b4f25556505624502", "score": "0.7334647", "text": "function clearCalendar() {\n var main = document.getElementById('calendarmain');\n while (main.childNodes.length > 2) {\n main.removeChild(main.lastChild);\n }\n}", "title": "" }, { "docid": "9408fea40c5f04f445ef4a6c120e9778", "score": "0.71989906", "text": "destroy() {\n if (this.calendar) {\n // Remove event handlers\n $.ignore(this.calendar, {'mousedown': this._handlers.keepFocus})\n $.ignore(this._dom.next, {'click': this._handlers.next})\n $.ignore(this._dom.previous, {'click': this._handlers.previous})\n $.ignore(this._dom.dates, {'click': this._handlers.pick})\n\n // Remove the calendar from the parent\n this.parent.removeChild(this.calendar)\n this._dom.calendar = null\n }\n\n // Remove the calendar reference from the parent\n delete this._dom.parent._mhCalendar\n }", "title": "" }, { "docid": "6c8519d1e31729ac374410073c3be068", "score": "0.6801155", "text": "function resetCalendar(calendar,date1, date2){\n var events = calendar.getEvents(date1, date2);\n for(var i in events){\n events[i].deleteEvent();\n }\n}", "title": "" }, { "docid": "a7d4181eef529892d4e1ca9a663c78d5", "score": "0.61048055", "text": "removeAllEvents() {\n const events = this.element[0].querySelectorAll('.calendar-event');\n for (let i = 0; i < events.length; i++) {\n events[i].parentNode.removeChild(events[i]);\n }\n\n for (let i = 0; i < this.dayMap.length; i++) {\n this.dayMap[i].events = [];\n }\n }", "title": "" }, { "docid": "08a6470fdb0c997b5be80ddad68f5aca", "score": "0.6064014", "text": "function deleteCalendarFromInterface() {\r\n\t\r\n\tvar id = this.req.responseText;\r\n\t\t\r\n\tvar calendarDiv = document.getElementById(\"calendar_\" + id);\r\n\tvar calSet = calendarDiv.parentNode;\t\t\r\n\tcalSet.removeChild(calendarDiv);\r\n\t\r\n\t// hide processing icon\r\n\t\tvar processing = document.getElementById(\"calendar_stat_\"+ id).getElementsByTagName(\"span\");\r\n\t\tprocessing[0].style.display = \"none\";\r\n\t\r\n}", "title": "" }, { "docid": "b1496cd2f19c9a3273e2e66d74d104ad", "score": "0.60105014", "text": "function deleteCalenderOld() {\n\t\tif (calender__content.rows.length > 0 ) {\n\t\t\tfor (var i = calender__content.rows.length-1; i >= 1; i--) {\n\t\t\t\tcalender__content.deleteRow(i);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "1b2a540df39eb3261af44f3bc5be82a9", "score": "0.5994952", "text": "function clearCurrentDayPanel() {\n\n aeTodaysWeather[1].text(\"\");\n aeTodaysWeather[2].attr(\"style\", \"visibility:hidden;\")\n aeTodaysWeather[3].text(\"\");\n aeTodaysWeather[4].text(\"\");\n aeTodaysWeather[5].text(\"\");\n aeTodaysWeather[6].text(\"\");\n aeTodaysWeather[7].text(\"\");\n}", "title": "" }, { "docid": "c07f9310f2aa0318cacc6818a162646a", "score": "0.5993679", "text": "destroy() {\n\t\tthis._unbindInput()\n\t\tthis.config.root.removeChild(this.datepicker.container)\n\t\tdelete this.input[DATA_KEY]\n\t}", "title": "" }, { "docid": "281fbefbb76a59c24490980bbece526e", "score": "0.5973723", "text": "function clearScreen(){\t\n\tclearGlobal();\n\tupdateLabel(0);\n\tdocument.getElementById(\"calInpt\").value = 0;\n}", "title": "" }, { "docid": "9ccfe35e3e21f8397b1ca71ce2e03aba", "score": "0.5973248", "text": "function hideCalendar()\t{\r\n\tdocument.getElementById(\"cal\").style.display = \"none\";\r\n}", "title": "" }, { "docid": "405ba86188b4f1b7d427b70f361ad364", "score": "0.5951068", "text": "clearFields() {\n for(var i=1;i<=6;i++) {\n for(var j=0;j<7;j++) {\n var elem = document.getElementById(\"calendar_t\" + i + j);\n elem.innerHTML = \"\";\n elem.classList.remove(\"selected\");\n elem.classList.remove(\"today\");\n elem.classList.remove(\"scheduled\");\n }\n }\n }", "title": "" }, { "docid": "01d44926052e25ff7d4cb310396ce868", "score": "0.59385896", "text": "function unload() {\r\n maybeCloseTheCalendarApp();\r\n }", "title": "" }, { "docid": "c9f6b478ad8e33a587f24a5f0d050fd9", "score": "0.59300953", "text": "function hide_calendar() {\n\tvar cal = document.getElementById(\"calendar\");\n\n\tcal.style.display = \"none\";\n}", "title": "" }, { "docid": "78f2f74d389af7899a97087c523dd9bb", "score": "0.592359", "text": "destroy() {\n this.removeListeners();\n this.foodCollection = null;\n this.foodDiaryEntryCollection = null;\n this.personalInfoCollection = null;\n\n this.isLoading = null;\n\n this.currentDay = null;\n this.dayPickerMinValue = null;\n this.dayPickerMaxValue = null;\n }", "title": "" }, { "docid": "9ce1b1b13f4f005f1cf7c84066326ef4", "score": "0.5919324", "text": "function closeHandler(cal) {\r\n cal.hide(); // hide the calendar\r\n}", "title": "" }, { "docid": "f830bc95498563b3e121278cb0895a05", "score": "0.5885611", "text": "function clearDivs() {\n document.getElementById(\"dateContainer\").innerHTML = \" \";\n}", "title": "" }, { "docid": "959b5051b402c69b1ee8ad52380fc742", "score": "0.5857848", "text": "function closeHandler(cal) {\n cal.hide(); // hide the calendar\n}", "title": "" }, { "docid": "c513c3cfc37f66f3ce4f78d575a8ec83", "score": "0.5848513", "text": "function _clearCanvas() {\r\n \tif ( _dactx == null ) return;\r\n\t\t_dactx.clearRect(0, 0, _daCanvas.width, _daCanvas.height);\r\n\t\t_count = 0;\r\n }", "title": "" }, { "docid": "2ed2cba2f2d02757601353bd2c048b0d", "score": "0.58273214", "text": "function deleteCalendars(controller, name) {\n let { eid } = helpersForController(controller);\n\n let win = eid(\"messengerWindow\").getNode().ownerGlobal;\n let manager = win.cal.getCalendarManager();\n\n for (let calendar of manager.getCalendars()) {\n if (calendar.name == name) {\n manager.removeCalendar(calendar);\n }\n }\n}", "title": "" }, { "docid": "bbfcb5a89f177c6ad1271d397df40ee1", "score": "0.5791809", "text": "function clearDays(){\n let calendar=document.getElementById(\"daysField\");\n let days = calendar.childNodes;\n while(calendar.firstChild){\n calendar.removeChild(calendar.firstChild);\n }\n}", "title": "" }, { "docid": "9ec8a54b1d502e2aaf339db38fb00798", "score": "0.5773332", "text": "function deleteCalendar() {\n console.log(\"DEBUG: Deleting the Tic Talk calendar, where calId =\" + calId + \".\");\n try {\n gapi.client.calendar.calendars.delete({\"calendarId\": calId}).execute(); // Returns 204 on success\n console.log(\"DEBUG: Successfully deleted calendar where calId = \" + calId + \".\")\n }\n catch(err) {\n console.error(\"ERROR: Failed to delete the calendar because: \" + err)\n }\n calId = null;\n}", "title": "" }, { "docid": "e6ef3411c429e38f78c52eec30446f87", "score": "0.57718986", "text": "function _onDragEnd() {\n var xCalendars = document.querySelectorAll(\"brick-calendar\");\n for (var i = 0; i < xCalendars.length; i++) {\n var xCalendar = xCalendars[i];\n xCalendar.ns.dragType = null;\n xCalendar.ns.dragStartEl = null;\n xCalendar.ns.dragAllowTap = false;\n xCalendar.removeAttribute(\"active\");\n }\n\n var days = document.querySelectorAll(\"brick-calendar .day[active]\");\n for (var j = 0; j < days.length; j++) {\n days[j].removeAttribute(\"active\");\n }\n }", "title": "" }, { "docid": "eeb66078c00764e34784b1061f173feb", "score": "0.57598275", "text": "function CP_hideCalendar() {\r\n\tif (arguments.length > 0) { window.popupWindowObjects[arguments[0]].hidePopup(); }\r\n\telse { this.hidePopup(); }\r\n\t}", "title": "" }, { "docid": "0c16d165e9abeebf8f8e4916b49c9340", "score": "0.57460886", "text": "function finishCalendarUnifinder() {\n var ccalendar = getCompositeCalendar();\n ccalendar.removeObserver(unifinderObserver);\n\n var viewDeck = getViewDeck();\n if (viewDeck) {\n viewDeck.removeEventListener(\"dayselect\", unifinderDaySelect, false);\n viewDeck.removeEventListener(\"itemselect\", unifinderItemSelect, true);\n }\n}", "title": "" }, { "docid": "eef0d9fbe45abbb19354b62dfa344cd0", "score": "0.5733491", "text": "function clearCalendar() {\n clearBtn.on(\"click\", () => {\n storedTasks = [];\n localStorage.setItem(\"savedTasks\", JSON.stringify(storedTasks));\n displayTasks();\n })\n}", "title": "" }, { "docid": "94c9f4f2eaff553c5845046396268246", "score": "0.5718844", "text": "function destroy() {\n\t\t\tvar stackKey;\n\n\t\t\t// Remove the events\n\t\t\tremoveEvent(axis);\n\n\t\t\t// Destroy each stack total\n\t\t\tfor (stackKey in stacks) {\n\t\t\t\tdestroyObjectProperties(stacks[stackKey]);\n\n\t\t\t\tstacks[stackKey] = null;\n\t\t\t}\n\n\t\t\t// Destroy stack total group\n\t\t\tif (axis.stackTotalGroup) {\n\t\t\t\taxis.stackTotalGroup = axis.stackTotalGroup.destroy();\n\t\t\t}\n\n\t\t\t// Destroy collections\n\t\t\teach([ticks, minorTicks, alternateBands, plotLinesAndBands], function (coll) {\n\t\t\t\tdestroyObjectProperties(coll);\n\t\t\t});\n\n\t\t\t// Destroy local variables\n\t\t\teach([axisLine, axisGroup, gridGroup, axisTitle], function (obj) {\n\t\t\t\tif (obj) {\n\t\t\t\t\tobj.destroy();\n\t\t\t\t}\n\t\t\t});\n\t\t\taxisLine = axisGroup = gridGroup = axisTitle = null;\n\t\t}", "title": "" }, { "docid": "58a6d900383c3b223ccedc5dbc30a376", "score": "0.56869555", "text": "function clearDays () {\n\t$('div#day-wrapper > div').contents().filter(function() {\n\t\treturn this.nodeType == 3;\n\t}).remove();\n}", "title": "" }, { "docid": "b44c9d26bc9783b716d4cc08ce34c6e4", "score": "0.5678978", "text": "function clearClockContent() {\n\t\tvar groupElem = _clockContentGroup[0][0]; // We need to go two arrays in to get the DOM element due to D3's selection design.\n\n\t\twhile (groupElem.lastChild) {\n\t\t\tgroupElem.removeChild(groupElem.lastChild);\n\t\t}\n\t}", "title": "" }, { "docid": "3af1b706e5d4e73ed109dbd6c8fe9101", "score": "0.5647333", "text": "function closeHandler(cal) \r\n{\r\n\tcal.hide(); // hide the calendar\r\n\r\n\t// don't check mousedown on document anymore (used to be able to hide the\r\n\t// calendar when someone clicks outside it, see the showCalendar function).\r\n\tCalendar.removeEvent(document, \"mousedown\", checkCalendar);\r\n}", "title": "" }, { "docid": "26a6a26e1dc9a6566b32653abcbd0663", "score": "0.5604035", "text": "function translateToCalendar(TM_Reservation,TM_Reservation_Calendar,mode){\n if(mode==\"delete\"){\n console.log(\"Deleting\");\n TM_Reservation_Calendar.length=0;//delete anything that maybe in there\n }\n \n for( var i=0;i<TM_Reservation.length;i++){\n\t//have to do it this way as we need to add leading zeros to months/days no built in JS way to do it\t\t\n \tvar tempElement={title: \"\",startYear:\"\",startMonth:\"\",startDay:\"\",endYear:\"\",endMonth:\"\",endDay:\"\",start:\"\",end:\"\",color:\"\"}\n \tvar startHour;\n \tvar startMind;\n \tvar endHour;\n \tvar endMinute;\n \t//console.log(\"startHour: \"+TM_Reservation[i].startHour+\" startMin: \"+TM_Reservation[i].startMin+\" endHour: \"+TM_Reservation[i].endHour+\" endMin: \"+TM_Reservation[i].endMin);\n \ttempElement.title=TM_Reservation[i].name+\" Phone: \"+TM_Reservation[i].phone+\" ID: \"+TM_Reservation[i].ResID;\n \ttempElement.startYear=TM_Reservation[i].startYear;\n \t/**START DATE**/\n \tif(TM_Reservation[i].startMonth<=9){\n \t\ttempElement.startMonth=(\"0\"+TM_Reservation[i].startMonth);\n \t}else{\n \t\ttempElement.startMonth=TM_Reservation[i].startMonth;\n \t}\n \tif(TM_Reservation[i].startDay<=9){\n \t\ttempElement.startDay=(\"0\"+TM_Reservation[i].startDay);\n \t}else{\n \t\ttempElement.startDay=TM_Reservation[i].startDay;\n \t}\n \t/**END DATE**/\n \ttempElement.endYear=TM_Reservation[i].endYear;\n \tif(TM_Reservation[i].endMonth<=9){\n \t\ttempElement.endMonth=(\"0\"+TM_Reservation[i].endMonth);\n \t}else{\n \t\ttempElement.endMonth=TM_Reservation[i].endMonth;\n \t}\n \tif(TM_Reservation[i].endDay<=9){\n \t\ttempElement.endDay=(\"0\"+TM_Reservation[i].endDay);\n \t}else{\n \t\ttempElement.endDay=TM_Reservation[i].endDay;\n \t}\n \t/**TIME HANDLING HOUR/MINUTES**/\n \tif(TM_Reservation[i].startHour<=9){\n \t\tstartHour=\"0\"+TM_Reservation[i].startHour;\n \t}else{\n \t\tstartHour=TM_Reservation[i].startHour;\n \t}if(TM_Reservation[i].startMin<=9){\n \t\tstartMin=\"0\"+TM_Reservation[i].startMin;\n \t}else{\n \t\tstartMin=TM_Reservation[i].startMin;\n \t}\n \t//End Time\n \tif(TM_Reservation[i].endHour<=9){\n \t\tendHour=\"0\"+TM_Reservation[i].endHour;\n \t}else{\n \t\tendHour=TM_Reservation[i].endHour;\n \t}if(TM_Reservation[i].endMin<=9){\n \t\tendMin=\"0\"+TM_Reservation[i].endMin;\n \t}else{\n \t\tendMin=TM_Reservation[i].endMin;\n \t}\n \ttempElement.start=(tempElement.startYear+\"-\"+tempElement.startMonth+\"-\"+tempElement.startDay+\"T\"+startHour+\":\"+startMin+\":00\");\n \t//needed to add \"T23:59:00 so the whole day of the end day will show to calendar\"\n \ttempElement.end=(tempElement.endYear+\"-\"+tempElement.endMonth+\"-\"+tempElement.endDay+\"T\"+endHour+\":\"+endMin+\":00\");\n \tTM_Reservation_Calendar.push(tempElement);\n } \n}", "title": "" }, { "docid": "f2216adf121e7583edcbf7ecbfe519ea", "score": "0.5601735", "text": "function cleanView() {\n d3.select(\"#sun\").remove();\n d3.select(\"#planets\").remove();\n d3.select(\"#planet_info\").remove();\n}", "title": "" }, { "docid": "dd114e94d7d13c4a88fc0dc2009c07f7", "score": "0.5592835", "text": "function ds_py() {\r\n\t// Decrease the current year.\r\n\tds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.\r\n\tds_draw_calendar(ds_c_month, ds_c_year); // Redraw the calendar.\r\n}", "title": "" }, { "docid": "ed240178c53809bd66499009abef10a5", "score": "0.5591687", "text": "onCloseCalendar() {\n this.setState({\n calendarVisible: false,\n })\n }", "title": "" }, { "docid": "75192bd93eaee12e8775689ea4522851", "score": "0.5545887", "text": "function datepickerClear() {\n vm.thing.findings[0].date = null;\n }", "title": "" }, { "docid": "ab0519f3467c7bcf0d42ae3796fe08ed", "score": "0.5544762", "text": "removeSchedule(e) {\n if(!confirm(\"Are you sure you want to delete this schedule? \")) {\n return;\n }\n var row = e.target.parentNode;\n var table = document.getElementById(\"appoitmentTable\");\n\n for(var z=0;z<table.rows.length;z++) {\n if(row == table.rows[z]) {\n table.deleteRow(z);\n calendar.scheduledDates.splice(z-1, 1);\n break;\n }\n }\n\n calendar.clearFields();\n calendar.render(calendar);\n \n }", "title": "" }, { "docid": "cb4ce911be9b29bad62f5129ebc58a87", "score": "0.5511806", "text": "function destroy() {\n\t\t\t// Destroy the tracker group element\n\t\t\tif (chart.trackerGroup) {\n\t\t\t\tchart.trackerGroup = trackerGroup = chart.trackerGroup.destroy();\n\t\t\t}\n\n\t\t\tremoveEvent(container, 'mouseleave', hideTooltipOnMouseLeave);\n\t\t\tremoveEvent(doc, 'mousemove', hideTooltipOnMouseMove);\n\t\t\tcontainer.onclick = container.onmousedown = container.onmousemove = container.ontouchstart = container.ontouchend = container.ontouchmove = null;\n\t\t}", "title": "" }, { "docid": "2974da152767759dd55d840977000318", "score": "0.5511037", "text": "function MonthCalPopup_hideCalendar() {\n\tif (arguments.length > 0) { window.MonthCalWindowObjects[arguments[0]].hidePopup(); }\n\telse { this.hidePopup(); }\n\t}", "title": "" }, { "docid": "21cbb1bb924570f1b53f8deda31f29b1", "score": "0.55049527", "text": "function clearCanvases() {\n if (bReset) {\n clear();\n bReset = false;\n }\n}", "title": "" }, { "docid": "252233a778ebae473e9a4ea93a0a7e06", "score": "0.5462835", "text": "function cadClearScreen()\n{\n\tpage[scrn] = 0;\n\tbodies[scrn] = defaultb;\n\tfooters[scrn] = defaultf;\n\t\n\tupdateCad();\n}", "title": "" }, { "docid": "cd5dcfac54facbd449463bdc97df4f05", "score": "0.54617554", "text": "function clearIt() {\n // startLoc = undefined;\n // endLoc = undefined;\n intervalLocs = undefined;\n startMarker.setMap(null);\n directionsDisplay.set('directions', null);\n $.each(segmentMarkerMap, function (index, value) {\n value.setMap(null)\n });\n $.each(segmentPathMap, function (index, value) {\n value.setMap(null)\n });\n }", "title": "" }, { "docid": "743845700afe5c0782e4a2a5300d81d9", "score": "0.54550374", "text": "function datepickerClear() {\n vm.thing.finding.date = null;\n }", "title": "" }, { "docid": "743845700afe5c0782e4a2a5300d81d9", "score": "0.54550374", "text": "function datepickerClear() {\n vm.thing.finding.date = null;\n }", "title": "" }, { "docid": "932f50a0dd554e1a11b1f20bd4257176", "score": "0.5453272", "text": "function clear(){\n\n var cityState = document.querySelector('h2')\n cityState.innerHTML = '';\n\n var day1 = document.querySelector('.containerDay1');\n var day2 = document.querySelector('.containerDay2')\n var day3 = document.querySelector('.containerDay3')\n var day4 = document.querySelector('.containerDay4')\n var day5 = document.querySelector('.containerDay5')\n\n day1.innerHTML = '';\n day2.innerHTML = '';\n day3.innerHTML = '';\n day4.innerHTML = '';\n day5.innerHTML = '';\n}", "title": "" }, { "docid": "c7d9d1a7cbe1d1cec686da76d2487d64", "score": "0.54345435", "text": "function restartCalendar() {\n\ttableDay.style.display = \"none\";\n}", "title": "" }, { "docid": "a8a5ad1d5dc8a3f9fa73bcb2d284fd26", "score": "0.54219323", "text": "function clearCanvas()\r\n{\r\n canvas2D.clearRect(0, 0, canvas.width, canvas.height); \r\n}", "title": "" }, { "docid": "54ee33ad9adc2a5c2e94742a2970e3b6", "score": "0.5421474", "text": "function refreshCalendar(){\r\n\t\tdays = $(\"div.target[draggable=true]\");\r\n\t\t$.each(days, function(index, day) {\r\n\t\t\tday.style.position = \"absolute\";\r\n\t\t\tday.style.top = \"10px\";\r\n\t\t\tday.style.left = 100 + index*151 + \"px\";\r\n\t\t\tday.style.width = \"150px\";\r\n\t\t\tday.style.height = \"750px\";\r\n\t\t\tday.addEventListener('drop', dayHandleDrop, false);\r\n\t\t\tday.addEventListener('dragleave', dayHandleDragLeave, false);\r\n\t\t\tday.addEventListener('dragenter', dayHandleDragEnter, false);\r\n\t\t\tday.addEventListener('dragover', dayHandleDragOver, false);\r\n\t\t\tday.addEventListener('dragend', dayHandleDragEnd, false);\r\n\t\t\t$(day).html(\"<h2>\" + day.id + \"</h2>\");\r\n\t\t\tgetTicketsForDay(day);\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "dd2b549304db40050b931647eb7b4e89", "score": "0.5418198", "text": "function destroy() {\n\t\tvar i,\n\t\t\tparentNode = container && container.parentNode;\n\n\t\t// If the chart is destroyed already, do nothing.\n\t\t// This will happen if if a script invokes chart.destroy and\n\t\t// then it will be called again on win.unload\n\t\tif (chart === null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// fire the chart.destoy event\n\t\tfireEvent(chart, 'destroy');\n\n\t\t// remove events\n\t\tremoveEvent(chart);\n\n\t\t// ==== Destroy collections:\n\t\t// Destroy axes\n\t\ti = axes.length;\n\t\twhile (i--) {\n\t\t\taxes[i] = axes[i].destroy();\n\t\t}\n\n\t\t// Destroy each series\n\t\ti = series.length;\n\t\twhile (i--) {\n\t\t\tseries[i] = series[i].destroy();\n\t\t}\n\n\t\t// ==== Destroy chart properties:\n\t\teach(['title', 'subtitle', 'seriesGroup', 'clipRect', 'credits', 'tracker', 'scroller', 'rangeSelector'], function (name) {\n\t\t\tvar prop = chart[name];\n\n\t\t\tif (prop) {\n\t\t\t\tchart[name] = prop.destroy();\n\t\t\t}\n\t\t});\n\n\t\t// ==== Destroy local variables:\n\t\teach([chartBackground, plotBorder, plotBackground, legend, tooltip, renderer, tracker], function (obj) {\n\t\t\tif (obj && obj.destroy) {\n\t\t\t\tobj.destroy();\n\t\t\t}\n\t\t});\n\t\tchartBackground = plotBorder = plotBackground = legend = tooltip = renderer = tracker = null;\n\n\t\t// remove container and all SVG\n\t\tif (container) { // can break in IE when destroyed before finished loading\n\t\t\tcontainer.innerHTML = '';\n\t\t\tremoveEvent(container);\n\t\t\tif (parentNode) {\n\t\t\t\tdiscardElement(container);\n\t\t\t}\n\n\t\t\t// IE6 leak\n\t\t\tcontainer = null;\n\t\t}\n\n\t\t// memory and CPU leak\n\t\tclearInterval(tooltipInterval);\n\n\t\t// clean it all up\n\t\tfor (i in chart) {\n\t\t\tdelete chart[i];\n\t\t}\n\n\t\tchart = null;\n\t\toptions = null;\n\t}", "title": "" }, { "docid": "26e2c74e60bef29486a0c16bf17f3161", "score": "0.5413854", "text": "function clearOverLays(){\n setAllMap(null);\n}", "title": "" }, { "docid": "f1ba718a58d9cd393209ea67db576fd5", "score": "0.5396403", "text": "function clearChart() {\n\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\t}", "title": "" }, { "docid": "f363555c84cbc66ef75d31b626befa88", "score": "0.53785163", "text": "function clearCanvas()\n{\n canvas2D.clearRect(0, 0, canvas.width, canvas.height); \n}", "title": "" }, { "docid": "3cb91366ef17e224d622ad63c000dcbd", "score": "0.53764284", "text": "function publicDestroy() {\n stopAnimation();\n destroyed = TRUE;\n destroyT = t;\n\n if (option[11]/*responsive*/) {\n $(win).off(\"resize focus\", adjustResponsiveLayout);\n }\n\n if (controls) {\n controls.remove();\n }\n\n $(option[2]/*customlink*/).off(\"click\");\n\n if (continuousClones) {\n for (var i = 0; i < continuousClones.length; i++) {\n continuousClones[i].remove();\n }\n }\n\n adjustPositionTo(t);\n autoadjust(t, 0);\n }", "title": "" }, { "docid": "f1288d311ea14b0334e27469fd46f489", "score": "0.5372155", "text": "function clearDayPlan() {\n // clear array\n for (i = 0; i < dayPlan.length; i++) {\n dayPlan[i] = \"\";\n }\n setLocalStore();\n getLocalStore();\n}", "title": "" }, { "docid": "42673c829df00c1200788eb0acba8bce", "score": "0.53685135", "text": "clearCanvas() {\n const resetButton = document.getElementById('effacer');\n resetButton.addEventListener('click', () => {\n this.resetCanvas();\n this.buttonReservation.style.display = 'none';\n });\n this.mouseX = 0;\n this.mouseY = 0;\n this.lastPosition = {\n x: 0,\n y: 0\n };\n }", "title": "" }, { "docid": "eff9c04463a001df13073981bc2a2107", "score": "0.53570753", "text": "function destroy(){\r\n $(container).find(\".amp-datetimepicker input\").datetimepicker(\"remove\");\r\n }", "title": "" }, { "docid": "dd3842b2aa11cd4f0bbb2ee925043720", "score": "0.5340874", "text": "function clearAll() {\n\n // Remove Legend's children and its attribute\n var legend = document.getElementById('legend');\n while (legend.firstChild) {\n legend.removeChild(legend.firstChild);\n }\n\n // Remove possible Heatmap and s-t pattern(which contains clearMarkers)\n clearST();\n}", "title": "" }, { "docid": "4c8f07d4adc9132d6992f139108b2e69", "score": "0.5340028", "text": "function destroy() {\n\t\t\teach(crosshairs, function (crosshair) {\n\t\t\t\tif (crosshair) {\n\t\t\t\t\tcrosshair.destroy();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Destroy and clear local variables\n\t\t\tif (label) {\n\t\t\t\tlabel = label.destroy();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e6d7abb3b35ab74839da68b646a3b2ff", "score": "0.5334079", "text": "function disposeDemo() {\n // remove the event handlers to avoid memory leaks.\n window.removeEventListener(\"mousedown\", hidePopup);\n\n chartInteraction.removeEventListener(\"mousedown\", hidePopup);\n chartInteraction.removeEventListener(\"pointerdown\", hidePopup);\n\n menuElement.removeEventListener(\"contextmenu\", preventDefault);\n\n // remove the menu element that was created dynamically\n menuElement.parentNode.removeChild(menuElement);\n\n // only required for documentation page on zoomcharts.com\n disposeDemo = null;\n}", "title": "" }, { "docid": "6939b1707ad3ea486bd964bfd31bafa0", "score": "0.53329384", "text": "function clear()\r\n\t\t\t{\r\n\t\t\t\tctx.clearRect(0,0,canvas.width,canvas.height);\r\n\t\t\t\ttarget.children().filter('.pieLabel, .pieLabelBackground').remove();\r\n\t\t\t}", "title": "" }, { "docid": "5cc2917f98983a7eda002af177639192", "score": "0.5330309", "text": "function clearCanvas(){\n\t\t\t\t\n\t\t\t\tdocument.getElementById(\"canvas\").innerHTML = \"\";\n\t\t\t}", "title": "" }, { "docid": "05a55e6ffd2343113e60c848de68756b", "score": "0.53215617", "text": "function Clear() {\n paper.clear();\n Places = {};\n Trans = {};\n Arcs = [];\n }", "title": "" }, { "docid": "1c2a837bee17fe4486d3637b5757f73f", "score": "0.5311186", "text": "function remove_calendar_items(items)\n{\n\tfor (i in items)\n\t\tWidget.PIM.deleteCalendarItem(items[i].calendarItemId);\n}", "title": "" }, { "docid": "ffcc9d0458488f7cbdcf0e6031192b95", "score": "0.52991146", "text": "function clearEvents() {\n eventList.empty();\n}", "title": "" }, { "docid": "a3c2cb7fa4a08ea6d889871c591cfa6f", "score": "0.52922297", "text": "function clearSchedSeqArea($area) {\n\tdocument.getElementById($area).innerHTML = '';\n\tschedseqpos = '';\n}", "title": "" }, { "docid": "0552607bd6aa641a5fd4d13535eb4076", "score": "0.5291786", "text": "function clearDate() {\r\n\tdateBox.value = \"\"\r\n \trefresh()\r\n}", "title": "" }, { "docid": "745d2dcfeab1481344e273b0a1f3b721", "score": "0.52915823", "text": "function DrawCalendar(){\n\t/* initialize the external events\n\t-----------------------------------------------------------------*/\n\t$('#external-events div.external-event').each(function() {\n\t\t// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)\n\t\tvar eventObject = {\n\t\t\ttitle: $.trim($(this).text()) // use the element's text as the event title\n\t\t};\n\t\t// store the Event Object in the DOM element so we can get to it later\n\t\t$(this).data('eventObject', eventObject);\n\t\t// make the event draggable using jQuery UI\n\t\t$(this).draggable({\n\t\t\tzIndex: 999,\n\t\t\trevert: true, // will cause the event to go back to its\n\t\t\trevertDuration: 0 // original position after the drag\n\t\t});\n\t});\n\t/* initialize the calendar\n\t-----------------------------------------------------------------*/\n\tvar calendar = $('#calendar').fullCalendar({\n\t\tdayClick: function(date, allDay, jsEvent, view) {\n\t\t\tvar d = new Date(date)\n\t\t\talert('La date est: ' + date);\n\t },\n\t\tevents: [\n\t\t\t{\n\t\t\t\tid:'1',\n\t\t\t\ttitle: 'Event1',\n\t\t\t\tstart: '2014-06-01'\n\t\t\t},\n\t\t\t{\n\t\t\t\tid:'2',\n\t\t\t\ttitle: 'Event2',\n\t\t\t\tstart: '2014-06-05'\n\t\t\t}\n\t\t\t\n\t\t],\n\t\theader: {\n\t\t\tleft: 'prev,next today',\n\t\t\tcenter: 'title',\n\t\t\tright: 'month,agendaWeek,agendaDay'\n\t\t},\n\t\tbuttonText: {\n\t\t today: \"Aujourd'hui\",\n\t\t month: 'Mois',\n\t\t week: 'Semaine',\n\t\t day: 'Jour'\n\t\t }\n\t\t,\n\t\tallDayText: 'Heures',\n\t\tmonthNames: [\"Janvier\",\"Favrier\",\"Mars\",\"Avril\",\"Mai\",\"Juin\",\"Juillet\", \"Aout\", \"Septembre\", \"Octobre\", \"Novembre\", \"Decembre\" ], \n\t\tmonthNamesShort: ['Ene','Feb','Mar','Abr','Mai','Jun','Jul','Ago','Sep','Oct','Nov','Dic'],\n\t\tdayNames: [ 'Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],\n\t\tdayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],\n\t\tselectable: true,\n\t\tselectHelper: true,\n\t\tselect: function(start, end, allDay) {\n\t\t\t//alert(end);\n\t\t\tvar form = $('<form id=\"event_form\">'+\n\t\t\t\t'<div class=\"form-group has-success has-feedback\">'+\n\t\t\t\t'<label\">Libelle</label>'+\n\t\t\t\t'<div>'+\n\t\t\t\t'<input type=\"text\" id=\"newevent_name\" class=\"form-control\" placeholder=\"Name of event\">'+\n\t\t\t\t'</div>'+\n\t\t\t\t'<br><br><label>Description</label>'+\n\t\t\t\t'<div>'+\n\t\t\t\t'<textarea rows=\"3\" id=\"newevent_desc\" class=\"form-control\" placeholder=\"Description\"></textarea>'+\n\t\t\t\t'</div>'+\n\t\t\t\t'</div>'+\n\t\t\t\t'</form>');\n\t\t\tvar buttons = $('<button id=\"event_cancel\" type=\"cancel\" class=\"btn btn-default btn-label-left\">'+\n\t\t\t\t\t\t\t'<span><i class=\"fa fa-clock-o txt-danger\"></i></span>'+\n\t\t\t\t\t\t\t'Annuler'+\n\t\t\t\t\t\t\t'</button>'+\n\t\t\t\t\t\t\t'<button type=\"submit\" id=\"event_submit\" class=\"btn btn-primary btn-label-left pull-right\">'+\n\t\t\t\t\t\t\t'<span><i class=\"fa fa-clock-o\"></i></span>'+\n\t\t\t\t\t\t\t'Ajouter'+\n\t\t\t\t\t\t\t'</button>');\n\t\t\tOpenModalBox('Ajouter action', form, buttons);\n\t\t\t$('#event_cancel').on('click', function(){\n\t\t\t\tCloseModalBox();\n\t\t\t});\n\t\t\t$('#event_submit').on('click', function(){\n\t\t\t\talert($('#newevent_name').val());\n\t\t\t\tvar new_event_name = $('#newevent_name').val();\n\t\t\t\tif (new_event_name != ''){\n\t\t\t\t\tcalendar.fullCalendar('renderEvent',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: new_event_name,\n\t\t\t\t\t\t\tdescription: $('#newevent_desc').val(),\n\t\t\t\t\t\t\tstart: start,\n\t\t\t\t\t\t\tend: end,\n\t\t\t\t\t\t\tallDay: allDay\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttrue // make the event \"stick\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tCloseModalBox();\n\t\t\t});\n\t\t\tcalendar.fullCalendar('unselect');\n\t\t},\n\t\teditable: true,\n\t\tdroppable: true, // this allows things to be dropped onto the calendar !!!\n\t\tdrop: function(date, allDay) { // this function is called when something is dropped\n\t\t\t// retrieve the dropped element's stored Event Object\n\t\t\tvar originalEventObject = $(this).data('eventObject');\n\t\t\t// we need to copy it, so that multiple events don't have a reference to the same object\n\t\t\tvar copiedEventObject = $.extend({}, originalEventObject);\n\t\t\t// assign it the date that was reported\n\t\t\tcopiedEventObject.start = date;\n\t\t\tcopiedEventObject.allDay = allDay;\n\t\t\t// render the event on the calendar\n\t\t\t// the last `true` argument determines if the event \"sticks\" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)\n\t\t\t$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);\n\t\t\t// is the \"remove after drop\" checkbox checked?\n\t\t\tif ($('#drop-remove').is(':checked')) {\n\t\t\t\t// if so, remove the element from the \"Draggable Events\" list\n\t\t\t\t$(this).remove();\n\t\t\t}\n\t\t},\n\t\teventRender: function (event, element, icon) {\n\t\t\tif (event.description != \"\") {\n\t\t\t\telement.attr('title', event.description);\n\t\t\t}\n\t\t},\n\t\teventClick: function(calEvent, jsEvent, view) {\n\t\t\tvar form = $('<form id=\"event_form\">'+\n\t\t\t\t'<div class=\"form-group has-success has-feedback\">'+\n\t\t\t\t'<label\">libelle</label>'+\n\t\t\t\t'<div>'+\n\t\t\t\t'<input type=\"text\" id=\"newevent_name\" value=\"'+ calEvent.title +'\" class=\"form-control\" placeholder=\"Name of event\">'+\n\t\t\t\t'</div>'+\n\t\t\t\t'<br><br><label>Description</label>'+\n\t\t\t\t'<div>'+\n\t\t\t\t'<textarea rows=\"3\" id=\"newevent_desc\" class=\"form-control\" placeholder=\"Description\">'+ calEvent.description +'</textarea>'+\n\t\t\t\t'</div>'+\n\t\t\t\t'</div>'+\n\t\t\t\t'</form>');\n\t\t\tvar buttons = $('<button id=\"event_cancel\" type=\"cancel\" class=\"btn btn-default btn-label-left\">'+\n\t\t\t\t\t\t\t'<span><i class=\"fa fa-clock-o txt-danger\"></i></span>'+\n\t\t\t\t\t\t\t'Annuler'+\n\t\t\t\t\t\t\t'</button>'+\n\t\t\t\t\t\t\t'<button id=\"event_delete\" type=\"cancel\" class=\"btn btn-danger btn-label-left\">'+\n\t\t\t\t\t\t\t'<span><i class=\"fa fa-clock-o txt-danger\"></i></span>'+\n\t\t\t\t\t\t\t'Supprimer'+\n\t\t\t\t\t\t\t'</button>'+\n\t\t\t\t\t\t\t'<button type=\"submit\" id=\"event_change\" class=\"btn btn-primary btn-label-left pull-right\">'+\n\t\t\t\t\t\t\t'<span><i class=\"fa fa-clock-o\"></i></span>'+\n\t\t\t\t\t\t\t'Enregistrer'+\n\t\t\t\t\t\t\t'</button>');\n\t\t\tOpenModalBox('Changer action', form, buttons);\n\t\t\t$('#event_cancel').on('click', function(){\n\t\t\t\tCloseModalBox();\n\t\t\t});\n\t\t\t$('#event_delete').on('click', function(){\n\t\t\t\talert(\"delete: \"+calEvent._id);\n\t\t\t\tcalendar.fullCalendar('removeEvents' , function(ev){\n\t\t\t\t\treturn (ev._id == calEvent._id);\n\t\t\t\t});\n\t\t\t\tCloseModalBox();\n\t\t\t});\n\t\t\t$('#event_change').on('click', function(){\n\t\t\t\tcalEvent.title = $('#newevent_name').val();\n\t\t\t\tcalEvent.description = $('#newevent_desc').val();\n\t\t\t\tcalendar.fullCalendar('updateEvent', calEvent);\n\t\t\t\tCloseModalBox()\n\t\t\t});\n\t\t}\n\t\t});\n\t\t$('#new-event-add').on('click', function(event){\n\t\t\tevent.preventDefault();\n\t\t\tvar event_name = $('#new-event-title').val();\n\t\t\tvar event_description = $('#new-event-desc').val();\n\t\t\tif (event_name != ''){\n\t\t\tvar event_template = $('<div class=\"external-event\" data-description=\"'+event_description+'\">'+event_name+'</div>');\n\t\t\t$('#events-templates-header').after(event_template);\n\t\t\tvar eventObject = {\n\t\t\t\ttitle: event_name,\n\t\t\t\tdescription: event_description\n\t\t\t};\n\t\t\t// store the Event Object in the DOM element so we can get to it later\n\t\t\tevent_template.data('eventObject', eventObject);\n\t\t\tevent_template.draggable({\n\t\t\t\tzIndex: 999,\n\t\t\t\trevert: true,\n\t\t\t\trevertDuration: 0\n\t\t\t});\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "99d9ad7e1b1885792c7b75a54e0a6324", "score": "0.5285103", "text": "function clear()\n\t\t\t{\n\t\t\t\tctx.clearRect(0,0,canvas.width,canvas.height);\n\t\t\t\ttarget.children().filter('.pieLabel, .pieLabelBackground').remove();\n\t\t\t}", "title": "" }, { "docid": "614361cb9b816649d603b4028236dde7", "score": "0.5277848", "text": "function clearOverlays() {\n\tif (markersArray) {\n\t\tfor (i in markersArray) {\n\t\t\tmarkersArray[i].setMap(null);\n\t\t\tdestinazione_scelta = false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "14f7e6902c19cc7cc14dbb9db7c7ed25", "score": "0.527275", "text": "destroy () {\n this.canvas.destroy();\n this.selectTool.destroy();\n }", "title": "" }, { "docid": "c469ad7e61fc72606c0f25fd3a00b9fd", "score": "0.5271791", "text": "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "title": "" }, { "docid": "c469ad7e61fc72606c0f25fd3a00b9fd", "score": "0.5271791", "text": "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "title": "" }, { "docid": "c469ad7e61fc72606c0f25fd3a00b9fd", "score": "0.5271791", "text": "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "title": "" }, { "docid": "c469ad7e61fc72606c0f25fd3a00b9fd", "score": "0.5271791", "text": "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "title": "" }, { "docid": "c469ad7e61fc72606c0f25fd3a00b9fd", "score": "0.5271791", "text": "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "title": "" }, { "docid": "c469ad7e61fc72606c0f25fd3a00b9fd", "score": "0.5271791", "text": "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "title": "" }, { "docid": "c469ad7e61fc72606c0f25fd3a00b9fd", "score": "0.5271791", "text": "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "title": "" }, { "docid": "c469ad7e61fc72606c0f25fd3a00b9fd", "score": "0.5271791", "text": "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "title": "" }, { "docid": "c469ad7e61fc72606c0f25fd3a00b9fd", "score": "0.5271791", "text": "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "title": "" }, { "docid": "c469ad7e61fc72606c0f25fd3a00b9fd", "score": "0.5271791", "text": "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "title": "" }, { "docid": "1eb7737bcc2ef7ab209d0ee5777abae3", "score": "0.52684146", "text": "function clearAndEmptyCanvas() {\n drawio.ctx.clearRect(0, 0, drawio.canvas.width, drawio.canvas.height);\n drawio.selectedElement = null;\n drawio.shapes = [];\n}", "title": "" }, { "docid": "5f809cc1cfd21f417ddf785b78cfc8e3", "score": "0.52508", "text": "function clearOverlays() {\n\tif (markers) {\n\t\tfor (i in markers) {\n\t\t\tmarkers[i].setMap(null);\n\t\t}\n\t\tmarkers = [];\n\t\tinfos = [];\n\t}\n}", "title": "" }, { "docid": "9246d5b3fdeca006e9be9694e6986558", "score": "0.5243943", "text": "function clearGraphics() {\n\tdrawLayer.clear();\n}", "title": "" }, { "docid": "fc0b506a4df5ef793694388d11eecc10", "score": "0.5238523", "text": "function clearCanvas() {\n ctx.clearRect(0, 0, w, h);\n }", "title": "" }, { "docid": "4e1173c80456db6204a63c585bf16113", "score": "0.5237811", "text": "function clearST() {\n // Remove Circle\n for (var i = 0; i < circles.length; i++) {\n circles[i].setMap(null);\n //circlesBuffer[i].setMap(null);\n }\n\n // Empty paras\n circles_para = [];\n circles = [];\n //circlesBuffer = [];\n clearMarkers();\n}", "title": "" }, { "docid": "c1b5adcf6afbc565326ce41ed9d915dd", "score": "0.5233356", "text": "function clearMarkers(){\n if(markers){\n for (i in markers){\n markers[i].setMap(null)\n\n }\n markers = []\n windows = []\n }\n}", "title": "" }, { "docid": "dfc7787ce53d5128a28fd0969d596310", "score": "0.52256393", "text": "function desplazarSeccionCalendario(){\n\tif(!desplazarCalendario){\n\t\t//oculta la seccion de desplazamiento\n\t\t$j('#div_desplazarCalendario').hide();\n\t\t//esconde la seccion del calendario\n\t\t$j('#div_calendario').hide('clip',{},500, function(){\n\t\t\t//agranda las seccion hoyPos\n\t\t\tif(!desplazarDia){\n\t\t\t\t$j(\"#div_diaPosHoy\").animate({width: '98%',left: '1.5%'}, 500);\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('div_diaPosHoy').style.width = '98%';\n\t\t\t\tdocument.getElementById('div_diaPosHoy').style.left = '1.5%';\n\t\t\t}\n\t\t\t//agranda la seccion hoy\n\t\t\tif(!desplazarDiaS){\n\t\t\t\t$j(\"#div_diaHoy\").animate({width: '98%',left: '1.5%'}, 500);\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('div_diaHoy').style.width = '98%';\n\t\t\t\tdocument.getElementById('div_diaHoy').style.left = '1.5%';\n\t\t\t}\n\t\t\tdocument.getElementById('div_desplazarCalendario').style.width = '98%';\n\t\t\tdocument.getElementById('div_desplazarCalendario').style.left = '0.5%';\n\t\t\tdocument.getElementById('img_desplazarCalendario').setAttribute('src','images/flechaVerdeDer.gif');\n\t\t\t$j('#img_desplazarDiaTodos').hide();\n\t\t\t$j('#div_desplazarCalendario').show();\n\t\t\tdesplazarCalendario = true;\n\t\t});\n\t}else{\n\t\t//esconder la seccion de desplazamiento\n\t\t$j('#div_desplazarCalendario').hide();\n\t\t//restablece el tamanio original del dia seleccionado\n\t\tif(!desplazarDia){\n\t\t\t$j(\"#div_diaPosHoy\").animate({width: '49%', left: '50.5%'}, 500);\n\t\t}else{\n\t\t\tdocument.getElementById('div_diaPosHoy').style.width = '49%';\n\t\t\tdocument.getElementById('div_diaPosHoy').style.left = '50.5%';\n\t\t}\n\t\t//restablece el tamanio original del dia hoy\n\t\tif(!desplazarDiaS){\n\t\t\t$j(\"#div_diaHoy\").animate({width: '49%', left: '50.5%'}, 500);\n\t\t}else{\n\t\t\tdocument.getElementById('div_diaHoy').style.width = '49%';\n\t\t\tdocument.getElementById('div_diaHoy').style.left = '50.5%';\n\t\t}\n\t\tdocument.getElementById('div_desplazarCalendario').style.width = '49%';\n\t\t//muestra el calendario\n\t\t$j('#div_calendario').show('clip',{},500, function(){\n\t\t\t//muestra la seccion de desplazamiento\n\t\t\tdocument.getElementById('div_desplazarCalendario').style.left = '49.7%';\n\t\t\tdocument.getElementById('img_desplazarCalendario').setAttribute('src','images/flechaVerdeIzq.gif');\n\t\t\t$j('#img_desplazarDiaTodos').show();\n\t\t\t$j('#div_desplazarCalendario').show();\n\t\t\tdesplazarCalendario = false;\n\t\t});\n\t}\n}", "title": "" }, { "docid": "2ae3109a003973e5a07722d2b7aeb553", "score": "0.5224611", "text": "function clearCanvas() {\n\t\t\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\t\t\t}", "title": "" }, { "docid": "5753611776f2ae7bb1dc9ec1897c57a7", "score": "0.52238935", "text": "function clearCanvas(){\n bg.draw(drawContext, 0, 0);\n header.draw(drawContext, 0, 0);\n }", "title": "" }, { "docid": "928e79692e7e7b5566d8c923b7cb7471", "score": "0.52229464", "text": "function clearOverlays(infowindow) {\n if (markersArray) {\n for (i in markersArray) {\n markersArray[i].setMap(null);\n }\n markersArray.length = 0;\n }\n if(infowindow){\n infowindow.close();\n }\n}", "title": "" }, { "docid": "18a87e3fd605f60ed6f1184672c69d5f", "score": "0.52220064", "text": "function removeCircles() {\n if (circlesCreated){\n for (var i = 0; i<currentCircles.length; i++) {\n for (var j=0; j<currentCircles[i].length; j++) {\n google.maps.event.clearListeners(currentCircles[i][j], 'click');\n currentCircles[i][j].setMap(null);\n }\n };\n currentCircles = [];\n };\n }", "title": "" }, { "docid": "d1256390c387cdc9eb701660e7d3be53", "score": "0.52194023", "text": "function clearCharts() {\n var chartsCont = $(\"#totalAnnualSalesChart\");\n var chartsCont2 = $(\"#chartMonthlySales\");\n var chartsCont3 = $(\"#quarterSalesChart\");\n chartsCont.remove();\n chartsCont2.remove();\n chartsCont3.remove();\n var chartNew = document.createElement(\"canvas\");\n var chartNew2 = document.createElement(\"canvas\");\n var chartNew3 = document.createElement(\"canvas\");\n $(chartNew).attr(\"id\",\"chartMonthlySales\");\n $(chartNew2).attr(\"id\",\"totalAnnualSalesChart\");\n $(chartNew3).attr(\"id\",\"quarterSalesChart\");\n var cont = $(\".contNew\");\n var cont2 = $(\".contNew2\");\n var cont3 = $(\".contNew3\");\n cont.append(chartNew);\n cont2.append(chartNew2);\n cont3.append(chartNew3);\n}", "title": "" }, { "docid": "c078b8011cf5aec9fc59eec01e58128b", "score": "0.52185696", "text": "_clearView() {\n this._clearTimeMeasures();\n this._clearMomentEvents();\n this._clearLanes();\n this._unlistenEvents();\n }", "title": "" }, { "docid": "d4a87c277da4a568376c8e3c448dd740", "score": "0.52150005", "text": "clearOverview() {\n if (this._overviewCanvas) {\n this.removeChild(this._overviewCanvas);\n this._overviewCanvas = null;\n }\n }", "title": "" }, { "docid": "939215cb7f498e942d9d469217c36b1a", "score": "0.52114236", "text": "function makeCalendar(year, month) {\n // clear the old calendar\n while (heading.lastChild) {\n heading.removeChild(heading.lastChild);\n }\n\n while (dates.lastChild) {\n dates.removeChild(dates.lastChild);\n }\n\n // add a heading to the calendar\n var previousDiv = document.createElement(\"div\");\n var previousText = document.createTextNode(\"\\u276e\");\n previousDiv.appendChild(previousText);\n previousDiv.classList.add(\"side\");\n previousDiv.onclick = function() {\n month > 0 ? makeCalendar(year, month - 1) : makeCalendar(year - 1, 11);\n }\n\n var monthDiv = document.createElement(\"div\");\n var monthText = document.createTextNode(year + \" \" + months[month]);\n monthDiv.appendChild(monthText);\n monthDiv.classList.add(\"center\");\n\n var nextDiv = document.createElement(\"div\");\n var nextText = document.createTextNode(\"\\u276f\");\n nextDiv.appendChild(nextText);\n nextDiv.classList.add(\"side\");\n if (year === todayYear && month === todayMonth) {\n nextDiv.classList.add(\"future\")\n } else {\n nextDiv.onclick = function() {\n month < 11 ? makeCalendar(year, month + 1) : makeCalendar(year + 1, 0);\n }\n }\n\n heading.appendChild(previousDiv);\n heading.appendChild(monthDiv);\n heading.appendChild(nextDiv);\n\n // check if it is a leap year\n if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) daysInMonth[1] = 29;\n else daysInMonth[1] = 28;\n\n var firstDay = new Date(year, month);\n var day = firstDay.getDay();\n\n for (var i = 0; i < 7; i++) {\n addText(days[i]);\n }\n\n for (var i = 0; i < day; i++) {\n addText(\"\");\n }\n\n for (var i = 1; i <= daysInMonth[month]; i++) {\n addDate(year, month, i);\n }\n}", "title": "" }, { "docid": "72fb608116b39c06aa74340acdee8051", "score": "0.52113515", "text": "destroy() {\n this.container.removeChild(this.tintMap);\n this.container.removeChild(this.pointer);\n this.container.removeChild(this.highlight);\n this.container = null;\n }", "title": "" }, { "docid": "7342f59a805b4ebbbaca281393953133", "score": "0.52077514", "text": "function clearCanvas(){\r\n let canvas = document.getElementById(\"workAreCanvas\");\r\n let context = canvas.getContext(\"2d\");\r\n context.clearRect(0,0,context.canvas.width, context.canvas.height);\r\n }", "title": "" }, { "docid": "42761ffada4847ad3d3be1d3f0ee2a82", "score": "0.5189138", "text": "function holiday_edit_clear()\n{\n document.getElementById('holi_from_date_ed').value=\"\";\n document.getElementById('holi_to_date_ed').value=\"\";\n document.getElementById('comp_from_date_ed').value=\"\";\n document.getElementById('comp_to_date_ed').value=\"\";\n document.getElementById('Iscomp_holi_ed').value=\"\";\n document.getElementById('purp_ed').value=\"\";\n document.getElementById('holi_vw').value=\"\";\n}", "title": "" }, { "docid": "4f095bde96c4b81c78ae213f63b86ece", "score": "0.51870424", "text": "function clearNonScheduleData(sheet) {\n var nonScheduleCol = String.fromCharCode(columns[columns.length-1].charCodeAt() + 1);\n var nonScheduleRow = (ALL_SHIFTS.length+1) * MAX_TUTORS + STARTING_ROW;\n var lastCol = String.fromCharCode(sheet.getLastColumn() + 'A'.charCodeAt());\n // vertical coverage (right of the schedule)\n sheet.getRange(nonScheduleCol + 1 + \":\" + lastCol + sheet.getLastRow()).clearContent();\n // horizontal coverage (below the schedule)\n sheet.getRange('A' + nonScheduleRow + \":\" + nonScheduleCol + sheet.getLastRow()).clearContent();\n}", "title": "" }, { "docid": "258184b0f47534d57bd8ccaf39660b37", "score": "0.51829827", "text": "function clearCanvas() {\n ctx.clearRect(0, 0, w, h);\n }", "title": "" }, { "docid": "258184b0f47534d57bd8ccaf39660b37", "score": "0.51829827", "text": "function clearCanvas() {\n ctx.clearRect(0, 0, w, h);\n }", "title": "" } ]
a208f6060068041ce7667a845abbf7b5
To correct IE bug with fixed TRs that are positioned improperly when table moves on page
[ { "docid": "5e2249a47ab030fdfad1ed2e03f997ac", "score": "0.0", "text": "function flicker(id) { // to fix fixed TRs\n\treturn flicker_($(id));\n}", "title": "" } ]
[ { "docid": "21c0d9d4421a84319c9e6860ced5f418", "score": "0.63308674", "text": "function refreshFixedHeaderRows()\n{\n\tvar lHeaderRowNodesArray = document.getElementsByTagName(\"thead\");\n\tfor (var i=0; i<lHeaderRowNodesArray.length; i++)\n\t{\n\t\tvar lHeaderRowNode = lHeaderRowNodesArray.item(i);\n\t\tif (lHeaderRowNode.className == \"fixedHeader\")\n\t\t{\n\t\t\tlHeaderRowNode.style.position = \"absolute\";\n\t\t\tlHeaderRowNode.style.position = \"relative\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8ca42f592e94c7db9116d3a9214ef5d8", "score": "0.6223311", "text": "resetFixedPosition() {\n if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n let overlayRoot = this.clone.wtTable.holder.parentNode;\n let headerPosition = 0;\n let preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'horizontal')) {\n let box = this.wot.wtTable.hider.getBoundingClientRect();\n let left = Math.ceil(box.left);\n let right = Math.ceil(box.right);\n let finalLeft;\n let finalTop;\n\n finalTop = this.wot.wtTable.hider.style.top;\n finalTop = finalTop === '' ? 0 : finalTop;\n\n if (left < 0 && (right - overlayRoot.offsetWidth) > 0) {\n finalLeft = -left;\n } else {\n finalLeft = 0;\n }\n headerPosition = finalLeft;\n finalLeft = finalLeft + 'px';\n\n setOverlayPosition(overlayRoot, finalLeft, finalTop);\n\n } else {\n headerPosition = this.getScrollPosition();\n }\n this.adjustHeaderBordersPosition(headerPosition);\n\n this.adjustElementsSize();\n }", "title": "" }, { "docid": "cc38e97675c51081f1cf642ab85d9078", "score": "0.6176628", "text": "function tableFix(contentBody) {\n let dataHeader = contentBody.querySelector('div[id*=dgData_Header]');\n let dataContent = contentBody.querySelector('div[id*=dgData_Content]');\n if (!dataHeader || !dataContent) {\n log('Valid table not found, skipping...');\n return;\n }\n let dataFixedGrid = dataHeader.querySelector('table[id*=dgData_Header_Fixed_Grid]');\n let dataFixedContent = dataContent.querySelector('table[class=DgTable]');\n dataFixedContent.insertAdjacentHTML('afterbegin', dataFixedGrid.innerHTML);\n dataHeader.remove();\n let fixedContent = dataContent.querySelector('div[id*=dgData_Content_Freeze]');\n if (fixedContent) {\n fixedContent.remove()\n }\n dataContent.childNodes.forEach(node => {\n node.style.overflow = null;\n node.style.width = null;\n node.style.height = null;\n node.style.position = null;\n node.style.top = null;\n node.style.left = null;\n node.style.right = null;\n node.style.bottom = null;\n })\n let subjectHeaderCell = contentBody.ownerDocument.evaluate(`//table[@class=\"DgTable\"]//div[contains(.,\"科目\")]`, contentBody.ownerDocument).iterateNext();\n if (subjectHeaderCell) {\n let index = getParentRowIndex(subjectHeaderCell);\n let subjectColumns = dataContent.querySelectorAll(`td:nth-child(${index})`);\n subjectColumns.forEach(x => {\n x.style.position = 'sticky';\n x.style.left = 0;\n x.style.background = 'rgba(100,200,100,0.9)';\n x.style.zIndex = 100;\n })\n } else {\n log('Unable to locate the subject header cell, skipping column sticky.');\n }\n let tableRows = dataContent.querySelectorAll('tr');\n if (tableRows) {\n tableRows.forEach(x => {\n x.removeAttribute('onclick');\n x.addEventListener('click', function() {\n if (this.style.backgroundColor === 'rgb(221, 238, 242)') {\n this.style.backgroundColor = '#fff'\n } else {\n this.style.backgroundColor = \"rgb(221, 238, 242)\"\n }\n });\n });\n }\n if (contentBody.querySelector('form').name === 'A0432SPage') {\n let rows = dataContent.querySelectorAll('tbody > tr')\n for (let index = 1; index < rows.length; index++) {\n let parentRow = rows[index];\n let firstSemesterCell = contentBody.ownerDocument.evaluate(`//table[@class=\"DgTable\"]//div[contains(.,\"學年\")]`, contentBody.ownerDocument).iterateNext();\n let firstSemesterNth = getParentRowIndex(firstSemesterCell);\n let firstSemesterMatch = parentRow.querySelector(`td:nth-of-type(${firstSemesterNth})`);\n let secondSemesterCell = contentBody.ownerDocument.evaluate(`//table[@class=\"DgTable\"]//div[contains(.,\"入學學年\")]`, contentBody.ownerDocument).iterateNext();\n let secondSemesterNth = getParentRowIndex(secondSemesterCell);\n let secondSemesterMatch = parentRow.querySelector(`td:nth-of-type(${secondSemesterNth})`);\n if (firstSemesterMatch.innerText !== secondSemesterMatch.innerText) {\n parentRow.style.backgroundColor = '#ff6347';\n parentRow.title = \"此科目入學學年級目前學年制不同,請注意!\"\n }\n }\n }\n}", "title": "" }, { "docid": "9502e75bd38587ec790394058d0c4a33", "score": "0.61479425", "text": "function fixTableCaretPos() {\n\t\t\t\t\t\teditor.on('KeyDown SetContent VisualAid', function () {\n\t\t\t\t\t\t\tvar last;\n\n\t\t\t\t\t\t\t// Skip empty text nodes from the end\n\t\t\t\t\t\t\tfor (last = editor.getBody().lastChild; last; last = last.previousSibling) {\n\t\t\t\t\t\t\t\tif (last.nodeType == 3) {\n\t\t\t\t\t\t\t\t\tif (last.nodeValue.length > 0) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (last.nodeType == 1 && (last.tagName == 'BR' || !last.getAttribute('data-mce-bogus'))) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (last && last.nodeName == 'TABLE') {\n\t\t\t\t\t\t\t\tif (editor.settings.forced_root_block) {\n\t\t\t\t\t\t\t\t\teditor.dom.add(editor.getBody(), editor.settings.forced_root_block, editor.settings.forced_root_block_attrs, Env.ie && Env.ie < 10 ? '&nbsp;' : '<br data-mce-bogus=\"1\" />');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\teditor.dom.add(editor.getBody(), 'br', { 'data-mce-bogus': '1' });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\teditor.on('PreProcess', function (o) {\n\t\t\t\t\t\t\tvar last = o.node.lastChild;\n\n\t\t\t\t\t\t\tif (last && (last.nodeName == \"BR\" || last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\\xA0')) && last.previousSibling && last.previousSibling.nodeName == \"TABLE\") {\n\t\t\t\t\t\t\t\teditor.dom.remove(last);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "title": "" }, { "docid": "158f19609249835cee452969329429aa", "score": "0.606141", "text": "function positionTbl() {\n\tvar greenOptionBar = $('div.p_top_controls');\n\tvar greenOptionBarTop = Number(getComputedStyle(greenOptionBar[0]).top.replace('px', ''));\n\tvar greenOptionBarHeight = Number(getComputedStyle(greenOptionBar[0]).height.replace('px', ''));\n\tvar resultsTblTopMin = greenOptionBarHeight + greenOptionBarTop;\n\t$('table#results').css('top', resultsTblTopMin + 'px');\n\t$('table#results').css('paddingTop', '5%');\n}", "title": "" }, { "docid": "484f417b6fb23f05e7dc531bf7a3be77", "score": "0.57890785", "text": "function fixTableHeader(table) {\n\n // if already executed, re-calculate header width\n var newTable = $('#' + table.attr('id') + '-thead');\n if (newTable.length) {\n newTable.attr('style', 'width:' + (table.width() + 1) + 'px; margin-left:' + table.offset().left + 'px; top:' + themeConfigs.navbarHeight + 'px;');\n return;\n }\n\n // clone table\n newTable = table.clone();\n\n // remove tbody\n newTable.children('tbody').remove();\n\n // change id to avoid conflicts\n newTable.attr('id', newTable.attr('id') + '-thead')\n .addClass('table-header-fixed hidden');\n\n // insert before current table\n newTable.insertBefore(table);\n\n // events\n $(window).on('scroll', function () {\n\n if (isOnScreen(table))\n newTable.addClass('hidden').removeClass('table-header-fixed');\n else\n newTable.addClass('table-header-fixed').removeClass('hidden');\n\n });\n\n // init fix header\n if (isOnScreen(table))\n newTable.addClass('hidden').removeClass('table-header-fixed');\n else\n newTable.addClass('table-header-fixed').removeClass('hidden');\n\n var tableLeft = table.offset().left;\n var tableWidth = table.width() + 1;\n newTable.attr('style', 'width:' + tableWidth + 'px; margin-left:' + tableLeft + 'px; top:' + themeConfigs.navbarHeight + 'px;');\n\n setTimeout(function () {\n tableLeft = table.offset().left;\n tableWidth = table.width() + 1;\n newTable.attr('style', 'width:' + tableWidth + 'px; margin-left:' + tableLeft + 'px; top:' + themeConfigs.navbarHeight + 'px;');\n }, 0);\n\n $(window).on('resize', function () {\n tableLeft = table.offset().left;\n tableWidth = table.width() + 1;\n newTable.attr('style', 'width:' + tableWidth + 'px; margin-left:' + tableLeft + 'px; top:' + themeConfigs.navbarHeight + 'px;');\n });\n\n}", "title": "" }, { "docid": "8b37d5400a782b584410e6ccddec6c17", "score": "0.5750828", "text": "function internalUpdate() {\n\t\t\t\t\t\t\tvar tableNode = ev.currentTarget.parentNode.parentNode.parentNode;\n\t\t\t\t\t\t\ttableNode.parentNode.scrollLeft = tableNode.parentNode.scrollLeft - 30 + tableNode.getBoundingClientRect().left;\n\t\t\t\t\t\t}", "title": "" }, { "docid": "208d085b759722d1af66a15fc70a73a5", "score": "0.56796324", "text": "_reorderRows() {\n const body = this.$.items;\n const items = body.querySelectorAll('tr');\n if (!items.length) {\n return;\n }\n\n const adjustedVirtualStart = this._virtualStart + this._vidxOffset;\n\n // Which row to use as a target?\n const targetRow = this._rowWithFocusedElement || Array.from(items).filter(row => !row.hidden)[0];\n if (!targetRow) {\n // All rows are hidden, don't reorder\n return;\n }\n\n // Where the target row should be?\n const targetPhysicalIndex = targetRow.index - adjustedVirtualStart;\n\n // Reodrer the DOM elements to keep the target row at the target physical index\n const delta = Array.from(items).indexOf(targetRow) - targetPhysicalIndex;\n if (delta > 0) {\n for (let i = 0; i < delta; i++) {\n body.appendChild(items[i]);\n }\n } else if (delta < 0) {\n for (let i = items.length + delta; i < items.length; i++) {\n body.insertBefore(items[i], items[0]);\n }\n }\n }", "title": "" }, { "docid": "9309155867c638ee77f9638854083c43", "score": "0.564144", "text": "_reorderRows() {\n const body = this.$.items;\n const items = body.querySelectorAll('tr');\n\n if (!items.length) {\n return;\n }\n\n const adjustedVirtualStart = this._virtualStart + this._vidxOffset; // Which row to use as a target?\n\n const targetRow = this._rowWithFocusedElement || Array.from(items).filter(row => !row.hidden)[0];\n\n if (!targetRow) {\n // All rows are hidden, don't reorder\n return;\n } // Where the target row should be?\n\n\n const targetPhysicalIndex = targetRow.index - adjustedVirtualStart; // Reodrer the DOM elements to keep the target row at the target physical index\n\n const delta = Array.from(items).indexOf(targetRow) - targetPhysicalIndex;\n\n if (delta > 0) {\n for (let i = 0; i < delta; i++) {\n body.appendChild(items[i]);\n }\n } else if (delta < 0) {\n for (let i = items.length + delta; i < items.length; i++) {\n body.insertBefore(items[i], items[0]);\n }\n }\n }", "title": "" }, { "docid": "eb2f7bd26aaf7c24ad8990a737baf11b", "score": "0.5629387", "text": "function moveTable() {\n\n\ttable = document.getElementById(\"myTable\");\n\trows = table.rows;\n\t\n\tfor (i = 2; i < (rows.length - 1); i++) {\n\t\trows[i].parentNode.insertBefore(rows[i + 1], rows[i]);\n\t\tdocument.getElementsByTagName(\"tr\")[2].setAttribute(\"id\", \"active\");\n\t\tdocument.getElementsByTagName(\"tr\")[3].removeAttribute(\"id\");\n\t\tdocument.getElementsByTagName(\"tr\")[3].removeAttribute(\"style\");\n\t\tdocument.getElementsByTagName(\"tr\")[rows.length - 1].removeAttribute(\"style\");\n\t\tdocument.getElementsByTagName(\"tr\")[1].removeAttribute(\"style\");\n\t}\n}", "title": "" }, { "docid": "9c14fe1d2e8a68f2879fc9bc8c269581", "score": "0.55771846", "text": "syncOverlayOffset() {\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';\n\n } else {\n this.clone.wtTable.spreader.style.top = '';\n }\n }", "title": "" }, { "docid": "370ea6ec74cc3d0ca141d508e98f2900", "score": "0.55710524", "text": "function fixedTheadOfList(tableID)\n{\n if($(tableID).size() == 0) return false;\n if($(tableID).css('display') == 'none') return false;\n if($(tableID).find('thead').size() == 0) return false;\n\n fixTheadInit();\n $(window).scroll(fixThead);//Fix table head when scrolling.\n $('.side-handle').click(function(){setTimeout(fixTheadInit, 300);});//Fix table head if module tree is hidden or displayed.\n\n var tableWidth, theadOffset, fixedThead, $fixedThead;\n function fixThead()\n {\n theadOffset = $(tableID).find('thead').offset().top;\n $fixedThead = $(tableID).parent().find('.fixedTheadOfList');\n if($fixedThead.size() <= 0 &&theadOffset < $(window).scrollTop())\n {\n tableWidth = $(tableID).width();\n fixedThead = \"<table class='fixedTheadOfList'><thead>\" + $(tableID).find('thead').html() + '</thead></table>';\n $(tableID).before(fixedThead);\n $('.fixedTheadOfList').addClass($(tableID).attr('class')).width(tableWidth);\n }\n if($fixedThead.size() > 0 && theadOffset >= $(window).scrollTop()) $fixedThead.remove();\n }\n function fixTheadInit()\n {\n $fixedThead = $(tableID).parent().find('.fixedTheadOfList');\n if($fixedThead.size() > 0) $fixedThead.remove();\n fixThead();\n }\n}", "title": "" }, { "docid": "6d6e6a9bbe8e29ecbc96defa8a355708", "score": "0.5516142", "text": "function fixedTableHead(boxObj)\n{\n $(boxObj).scroll(function()\n {\n var hasFixed = $(this).find('.fixedHead').size() > 0;\n if(!hasFixed)\n {\n $(this).css('position', 'relative');\n if($(this).find('table').size() == 1)\n {\n var fixed = \"<table class='fixedHead' style='position:absolute;top:0px'><thead>\" + $(this).find('table thead').html() + '</thead></table>';\n $(this).prepend(fixed);\n var $fixTable = $(this).find('table.fixedHead');\n $fixTable.addClass($(this).find('table:last').attr('class'));\n var $dataTable = $(this).find('table:last thead th');\n $fixTable.find('thead th').each(function(i){$fixTable.find('thead th').eq(i).width($dataTable.eq(i).width());})\n }\n }\n $(this).find('table.fixedHead').css('top',$(this).scrollTop());\n });\n}", "title": "" }, { "docid": "c05f48d5264ea74a778c2d02aa61200c", "score": "0.55122846", "text": "function adjustPosRelativeTomainContent(pos) {\n//\t\tif(isIE) { /* if using display:table for mainCointent style then this line and the else part should be uncomented \n\t\tvar maincontent = getById(\"mainContent\");\n\t\tif (!maincontent)\n\t\t\treturn pos;\n\t\tpos.left = pos.left - maincontent.offsetLeft;\n\t\tpos.top = pos.top - maincontent.offsetTop;\n/*\t\t\n\t}\n\telse \n\t\tpos.left += getById(\"sidebar1\").offsetWidth;\n*/\t\n\treturn pos;\n}", "title": "" }, { "docid": "d9c712fd9adea679ba0e7994b790fd02", "score": "0.55116045", "text": "syncOverlayOffset() {\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.top = `${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;\n\n } else {\n this.clone.wtTable.spreader.style.top = '';\n }\n }", "title": "" }, { "docid": "72f8a7c1ca7065f0e5093e7854873dab", "score": "0.5485797", "text": "function A(e,t){return s(e,\"table\")&&s(11!==t.nodeType?t:t.firstChild,\"tr\")?ve(\">tbody\",e)[0]||e:e}", "title": "" }, { "docid": "42fdf8d344098cace1df82bc4bfbadcf", "score": "0.54778445", "text": "function fixVsRepeatPesqIndicador() {\n\n $timeout(function() {\n $('#modal-pesq-indicador .table-indicador').scrollTop(0);\n }, 200);\n\n }", "title": "" }, { "docid": "29f911a7f2c7095774af78cd6cb2ff46", "score": "0.5450768", "text": "function\nstickTableHeader()\n{\n if (view !== VIEWS.AREA_SYS && view !== VIEWS.OPT && view !== VIEWS.VERIF && view !== VIEWS.INCREMENTAL && view != VIEWS.FMAX_II) return;\n\n var reportBody = $(currentPane + \" #report-body\")[0];\n if (!reportBody) return;\n var areaTable = $(currentPane + \" #area-table-content\")[0];\n if (!areaTable) return;\n var panel = reportBody.getBoundingClientRect();\n var table = areaTable.getBoundingClientRect();\n var rowWidth = 0.0;\n var tableWidth = table.width;\n var systemRow;\n\n var tableHeader = $(currentPane + ' #table-header').filter(function () {\n if ($(this).is(\":visible\")) return true;\n return false;\n });\n\n systemRow = $(currentPane + ' #first-row')\n .filter(function () {\n if ($(this).is(\":visible\")) return true;\n return false;\n });\n\n tableHeader.css(\"position\", \"absolute\")\n .css(\"top\", (panel.top - table.top))\n .css(\"left\", 0);\n\n tableHeader.find('th').each(function (i) {\n var itemWidth = (systemRow.find('td').eq(i))[0].getBoundingClientRect().width;\n if (i === 0) {\n // This column contains the expand/collapse all button. Check if need to resize button\n if (itemWidth < $('#collapseAll').outerWidth() || itemWidth < 116) {\n $('#collapseAll').outerWidth(itemWidth);\n $('#expandAll').outerWidth(itemWidth);\n } else {\n $('#collapseAll').outerWidth(116);\n $('#expandAll').outerWidth(116);\n }\n }\n rowWidth += itemWidth;\n\n $(this).css('min-width', itemWidth);\n });\n\n // Set the Spacer row height equal to current tableHeader height\n systemRow.css(\"height\", tableHeader.outerHeight());\n\n // if we just hid the selected row, unselect it and clear details pane\n if (view.clickDown && view.clickDown.offsetParent === null) {\n unsetClick();\n }\n}", "title": "" }, { "docid": "f4956053143d201ecb18985dff5759ab", "score": "0.5433196", "text": "function controlTableWidth(obj) {\n var windowWidth = window.parent.innerWidth || window.parent.document.documentElement.clientWidth || window.parent.document.body.clientWidth;\n var tableWidth = windowWidth * 0.96 - 150;\n var fixedColWidth = obj.find('.order-hd').width();\n obj.find('.order-body').css('width',tableWidth - fixedColWidth);\n }", "title": "" }, { "docid": "19c697344b0aa6fb8c1f0fa14fb19e91", "score": "0.542077", "text": "function fixPosition ( $elem, cssOffset ) {\n var visualTop = window.visualViewport ? window.visualViewport.pageTop : Math.max( dde.scrollTop, body.scrollTop ),\n visualLeft = window.visualViewport ? window.visualViewport.pageLeft : Math.max( dde.scrollLeft, body.scrollLeft );\n\n $elem.css( {\n top: visualTop + cssOffset.top,\n left: visualLeft + cssOffset.left\n } );\n }", "title": "" }, { "docid": "7ca55b81ae2160ada89776d5ec026e89", "score": "0.5405975", "text": "function FixedHeaderScrollableTable() {\n\t\t\t\tvar screenHeight = $(window).height();\n\t\t\t\tif (screenHeight > 615) {\n\t\t\t\t\t\t$('.fixed-table-body').css('height','615px').css('overflow-y','visible');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar heightScrollableBody = screenHeight - $('.fixedHeader').height();\n\t\t\t\t\t$('.fixed-table').css('height',heightScrollableBody);\n\t\t\t\t\t$('.fixed-table-body').css('height',heightScrollableBody - $('.fixed-table-header').height() - 30).css('overflow-y','scroll').css('overflow-x','visible');\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "1c3bb97df73eab13ad1826c88806380d", "score": "0.53960645", "text": "function moveToThisTableRow(pTableCell) {\n // capture current scroll position for \"maintain position in tables\" feature \n setCurrentBrowserCoordinates();\n \n if (justDoIt == true) {\n\n if (pTableCell != null) {\n\n var tableRow = pTableCell.parentNode;\n \n if (tableRowHighlightable(tableRow) == true) {\n \n var iconCellContents = tableRow.getElementsByTagName(\"input\");\n \n for (var i=(iconCellContents.length-1); i>=0; i--)\n {\n \tif (iconCellContents.item(i).type == \"checkbox\")\n \t{\n \t\ticonCellContents.item(i).focus();\n \t\tbreak;\n \t}\n }\n \n // if current row highlighted...\n if (currentTable != null)\n {\n unhighlightTableRow(currentRow);\n }\n \n // determine current table and index resulting from focus change\n updateCurrentTableAndIndex(tableRow);\n \n // highlight (new) current table row\n highlightTableRow(tableRow);\n }\n }\n }\n}", "title": "" }, { "docid": "132507e532efaecec2391605966f6db4", "score": "0.53721106", "text": "function fixTable() {\r\n\t// get height of table body and table container\r\n\tvar tblBodyHeight = $(\"#tblBody\").height();\r\n\tvar divBodyHeight = $(\"#divBody\").height();\r\n\t// if the table body is longer than the table container\r\n\tif (tblBodyHeight > divBodyHeight) {\r\n\t\t// add y scroll bar\r\n\t\t$(\"#divBody\").css(\"overflow-y\", \"scroll\");\r\n\t\tif (isMobile()) {\r\n\t\t\t// Mobile version\r\n\t\t} else {\r\n\t\t\t// ceiling the width of divBody to avoid misaligning the borders\r\n\t\t\t$(\"#divBody\").width(Math.ceil($(\"#divBody\").width()));\r\n\t\t\t// PC version\r\n\t\t\t// when the table body has many rows, scroll bar will appear\r\n\t\t\t// set the size of body to minus the scroll bar, scroll bar size: 17px\r\n\t\t\t$(\"#divHead\").width($(\"#divBody\").width() - 17);\r\n\t\t\t$(\"#divFooter\").width($(\"#divBody\").width() - 17);\r\n\t\t\t// set size when user resizes window\r\n\t\t\t$(window).resize(function() {\r\n\t\t\t\t$(\"#divHead\").width($(\"#divBody\").width() - 17);\r\n\t\t\t\t$(\"#divFooter\").width($(\"#divBody\").width() - 17);\r\n\t\t\t});\r\n\t\t}\r\n\t} else {\r\n\t\t// table body is shorter than the table container\r\n\t\t// hide y scroll bar\r\n\t\t$(\"#divBody\").css(\"overflow-y\", \"hidden\");\r\n\t\t// when the table body has few rows, scroll bar will disappear\r\n\t\t// set the size of body to plus the scroll bar, scroll bar size: 17px\r\n\t\t$(\"#divHead\").width($(\"#divBody\").width());\r\n\t\t$(\"#divFooter\").width($(\"#divBody\").width() + 17);\r\n\t\t// set size when user resizes window\r\n\t\t$(window).resize(function() {\r\n\t\t\t$(\"#divHead\").width($(\"#divBody\").width());\r\n\t\t\t$(\"#divFooter\").width($(\"#divBody\").width() + 17);\r\n\t\t});\r\n\t}\r\n\t// fix table not repainting on Chrome\r\n\t$(\"#divBody\").html($(\"#divBody\").html());\r\n}", "title": "" }, { "docid": "8a92818601af72299657fdd86f550ea3", "score": "0.5370664", "text": "function moveWebKitSelection() {\n\t\t\t\t\t\tfunction eventHandler(e) {\n\t\t\t\t\t\t\tvar key = e.keyCode;\n\n\t\t\t\t\t\t\tfunction handle(upBool, sourceNode) {\n\t\t\t\t\t\t\t\tvar siblingDirection = upBool ? 'previousSibling' : 'nextSibling';\n\t\t\t\t\t\t\t\tvar currentRow = editor.dom.getParent(sourceNode, 'tr');\n\t\t\t\t\t\t\t\tvar siblingRow = currentRow[siblingDirection];\n\n\t\t\t\t\t\t\t\tif (siblingRow) {\n\t\t\t\t\t\t\t\t\tmoveCursorToRow(editor, sourceNode, siblingRow, upBool);\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar tableNode = editor.dom.getParent(currentRow, 'table');\n\t\t\t\t\t\t\t\tvar middleNode = currentRow.parentNode;\n\t\t\t\t\t\t\t\tvar parentNodeName = middleNode.nodeName.toLowerCase();\n\t\t\t\t\t\t\t\tif (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {\n\t\t\t\t\t\t\t\t\tvar targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');\n\t\t\t\t\t\t\t\t\tif (targetParent !== null) {\n\t\t\t\t\t\t\t\t\t\treturn moveToRowInTarget(upBool, targetParent, sourceNode);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn escapeTable(upBool, currentRow, siblingDirection, tableNode);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction getTargetParent(upBool, topNode, secondNode, nodeName) {\n\t\t\t\t\t\t\t\tvar tbodies = editor.dom.select('>' + nodeName, topNode);\n\t\t\t\t\t\t\t\tvar position = tbodies.indexOf(secondNode);\n\t\t\t\t\t\t\t\tif (upBool && position === 0 || !upBool && position === tbodies.length - 1) {\n\t\t\t\t\t\t\t\t\treturn getFirstHeadOrFoot(upBool, topNode);\n\t\t\t\t\t\t\t\t} else if (position === -1) {\n\t\t\t\t\t\t\t\t\tvar topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;\n\t\t\t\t\t\t\t\t\treturn tbodies[topOrBottom];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn tbodies[position + (upBool ? -1 : 1)];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction getFirstHeadOrFoot(upBool, parent) {\n\t\t\t\t\t\t\t\tvar tagName = upBool ? 'thead' : 'tfoot';\n\t\t\t\t\t\t\t\tvar headOrFoot = editor.dom.select('>' + tagName, parent);\n\t\t\t\t\t\t\t\treturn headOrFoot.length !== 0 ? headOrFoot[0] : null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction moveToRowInTarget(upBool, targetParent, sourceNode) {\n\t\t\t\t\t\t\t\tvar targetRow = getChildForDirection(targetParent, upBool);\n\n\t\t\t\t\t\t\t\tif (targetRow) {\n\t\t\t\t\t\t\t\t\tmoveCursorToRow(editor, sourceNode, targetRow, upBool);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction escapeTable(upBool, currentRow, siblingDirection, table) {\n\t\t\t\t\t\t\t\tvar tableSibling = table[siblingDirection];\n\n\t\t\t\t\t\t\t\tif (tableSibling) {\n\t\t\t\t\t\t\t\t\tmoveCursorToStartOfElement(tableSibling);\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar parentCell = editor.dom.getParent(table, 'td,th');\n\t\t\t\t\t\t\t\tif (parentCell) {\n\t\t\t\t\t\t\t\t\treturn handle(upBool, parentCell, e);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar backUpSibling = getChildForDirection(currentRow, !upBool);\n\t\t\t\t\t\t\t\tmoveCursorToStartOfElement(backUpSibling);\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction getChildForDirection(parent, up) {\n\t\t\t\t\t\t\t\tvar child = parent && parent[up ? 'lastChild' : 'firstChild'];\n\t\t\t\t\t\t\t\t// BR is not a valid table child to return in this case we return the table cell\n\t\t\t\t\t\t\t\treturn child && child.nodeName === 'BR' ? editor.dom.getParent(child, 'td,th') : child;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction moveCursorToStartOfElement(n) {\n\t\t\t\t\t\t\t\teditor.selection.setCursorLocation(n, 0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction isVerticalMovement() {\n\t\t\t\t\t\t\t\treturn key == VK.UP || key == VK.DOWN;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction isInTable(editor) {\n\t\t\t\t\t\t\t\tvar node = editor.selection.getNode();\n\t\t\t\t\t\t\t\tvar currentRow = editor.dom.getParent(node, 'tr');\n\t\t\t\t\t\t\t\treturn currentRow !== null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction columnIndex(column) {\n\t\t\t\t\t\t\t\tvar colIndex = 0;\n\t\t\t\t\t\t\t\tvar c = column;\n\t\t\t\t\t\t\t\twhile (c.previousSibling) {\n\t\t\t\t\t\t\t\t\tc = c.previousSibling;\n\t\t\t\t\t\t\t\t\tcolIndex = colIndex + getSpanVal(c, \"colspan\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn colIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction findColumn(rowElement, columnIndex) {\n\t\t\t\t\t\t\t\tvar c = 0,\n\t\t\t\t\t\t\t\t r = 0;\n\n\t\t\t\t\t\t\t\teach(rowElement.children, function (cell, i) {\n\t\t\t\t\t\t\t\t\tc = c + getSpanVal(cell, \"colspan\");\n\t\t\t\t\t\t\t\t\tr = i;\n\t\t\t\t\t\t\t\t\tif (c > columnIndex) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn r;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction moveCursorToRow(ed, node, row, upBool) {\n\t\t\t\t\t\t\t\tvar srcColumnIndex = columnIndex(editor.dom.getParent(node, 'td,th'));\n\t\t\t\t\t\t\t\tvar tgtColumnIndex = findColumn(row, srcColumnIndex);\n\t\t\t\t\t\t\t\tvar tgtNode = row.childNodes[tgtColumnIndex];\n\t\t\t\t\t\t\t\tvar rowCellTarget = getChildForDirection(tgtNode, upBool);\n\t\t\t\t\t\t\t\tmoveCursorToStartOfElement(rowCellTarget || tgtNode);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction shouldFixCaret(preBrowserNode) {\n\t\t\t\t\t\t\t\tvar newNode = editor.selection.getNode();\n\t\t\t\t\t\t\t\tvar newParent = editor.dom.getParent(newNode, 'td,th');\n\t\t\t\t\t\t\t\tvar oldParent = editor.dom.getParent(preBrowserNode, 'td,th');\n\n\t\t\t\t\t\t\t\treturn newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction checkSameParentTable(nodeOne, NodeTwo) {\n\t\t\t\t\t\t\t\treturn editor.dom.getParent(nodeOne, 'TABLE') === editor.dom.getParent(NodeTwo, 'TABLE');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (isVerticalMovement() && isInTable(editor)) {\n\t\t\t\t\t\t\t\tvar preBrowserNode = editor.selection.getNode();\n\t\t\t\t\t\t\t\tDelay.setEditorTimeout(editor, function () {\n\t\t\t\t\t\t\t\t\tif (shouldFixCaret(preBrowserNode)) {\n\t\t\t\t\t\t\t\t\t\thandle(!e.shiftKey && key === VK.UP, preBrowserNode, e);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teditor.on('KeyDown', function (e) {\n\t\t\t\t\t\t\teventHandler(e);\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "title": "" }, { "docid": "0f0ab546e1ffd742b52dbfb001d45db5", "score": "0.53647995", "text": "function tbZindexFix() {\n if (/(3\\.[0-9.]* Safari\\/)|Opera/.test(navigator.userAgent)) {\n\n $tb('#cmn_tb_wrapper, #cmn_toolbar_open ').css('z-index', '167777271');\n\n $tb('#cmn_toolbar_open_container, #cmn_tooltip').css('z-index', '167777560');\n\n $tb('#cmn_newsfeed_box, #cmn_share_box, #cmn_network_box, #cmn_complextv_box, #cmn_status_box, #cmn_ad_box, #cmn_subscribe_box').css('z-index', '167777250');\n\n }\n}", "title": "" }, { "docid": "cc2667da36a1a3e3098a5b005d3a8ecf", "score": "0.5363895", "text": "function fixVsRepeatPesqCCusto() {\n\n $timeout(function() {\n $('#modal-pesq-ccusto .table-ccusto').scrollTop(0);\n }, 200);\n\n }", "title": "" }, { "docid": "ecf16f9094cd422bd163f0211a20d830", "score": "0.5351429", "text": "function updateStartPos() {\n startPos = getPos(dom.getParent(selection.getStart(), 'th,td'));\n }", "title": "" }, { "docid": "49f4ece13fde1e1fe26c1423bf3c3f6f", "score": "0.53287876", "text": "function supportFixed() {\n var elem = $('<div>',{\n css : {\n position: 'fixed',\n top: '42px',\n visibility: 'hidden'\n }\n }).appendTo(document.body || document.documentElement),\n \n // also account for page scroll\n support = parseInt(elem.offset().top,10) - (document.body ? document.body.scrollTop : 0) === 42;\n \n elem.remove();\n return support;\n }", "title": "" }, { "docid": "00d6ed1a9a4517050f1de2e31a6c7352", "score": "0.5326396", "text": "function fix($elt) {\n if ($elt.data(\"fixit/status\") !== \"fixed\") {\n $elt.css({\n \"position\": \"fixed\",\n \"width\": $elt.width()\n });\n $elt.data(\"fixit/status\", \"fixed\");\n }\n }", "title": "" }, { "docid": "abf891e99d26fff33cffaa85e4557a37", "score": "0.53153634", "text": "function isolateVertical(tr, map, table, start, top, bottom, left, mapFrom) {\n if (left == 0 || left == map.width) { return false }\n var found = false;\n for (var row = top; row < bottom; row++) {\n var index = row * map.width + left, pos = map.map[index];\n if (map.map[index - 1] == pos) {\n found = true;\n var cell = table.nodeAt(pos), cellLeft = map.colCount(pos);\n var updatePos = tr.mapping.slice(mapFrom).map(pos + start);\n tr.setNodeMarkup(updatePos, null, removeColSpan(cell.attrs, left - cellLeft, cell.attrs.colspan - (left - cellLeft)));\n tr.insert(updatePos + cell.nodeSize, cell.type.createAndFill(removeColSpan(cell.attrs, 0, left - cellLeft)));\n row += cell.attrs.rowspan - 1;\n }\n }\n return found\n}", "title": "" }, { "docid": "abf891e99d26fff33cffaa85e4557a37", "score": "0.53153634", "text": "function isolateVertical(tr, map, table, start, top, bottom, left, mapFrom) {\n if (left == 0 || left == map.width) { return false }\n var found = false;\n for (var row = top; row < bottom; row++) {\n var index = row * map.width + left, pos = map.map[index];\n if (map.map[index - 1] == pos) {\n found = true;\n var cell = table.nodeAt(pos), cellLeft = map.colCount(pos);\n var updatePos = tr.mapping.slice(mapFrom).map(pos + start);\n tr.setNodeMarkup(updatePos, null, removeColSpan(cell.attrs, left - cellLeft, cell.attrs.colspan - (left - cellLeft)));\n tr.insert(updatePos + cell.nodeSize, cell.type.createAndFill(removeColSpan(cell.attrs, 0, left - cellLeft)));\n row += cell.attrs.rowspan - 1;\n }\n }\n return found\n}", "title": "" }, { "docid": "f49d985779cdeaffdb43b605a1c12385", "score": "0.53079545", "text": "function isolateVertical(tr, map, table, start, top, bottom, left, mapFrom) {\n if (left == 0 || left == map.width) { return false }\n var found = false;\n for (var row = top; row < bottom; row++) {\n var index = row * map.width + left, pos = map.map[index];\n if (map.map[index - 1] == pos) {\n found = true;\n var cell = table.nodeAt(pos), cellLeft = map.colCount(pos);\n var updatePos = tr.mapping.slice(mapFrom).map(pos + start);\n tr.setNodeMarkup(updatePos, null, rmColSpan(cell.attrs, left - cellLeft, cell.attrs.colspan - (left - cellLeft)));\n tr.insert(updatePos + cell.nodeSize, cell.type.createAndFill(rmColSpan(cell.attrs, 0, left - cellLeft)));\n row += cell.attrs.rowspan - 1;\n }\n }\n return found\n}", "title": "" }, { "docid": "f49d985779cdeaffdb43b605a1c12385", "score": "0.53079545", "text": "function isolateVertical(tr, map, table, start, top, bottom, left, mapFrom) {\n if (left == 0 || left == map.width) { return false }\n var found = false;\n for (var row = top; row < bottom; row++) {\n var index = row * map.width + left, pos = map.map[index];\n if (map.map[index - 1] == pos) {\n found = true;\n var cell = table.nodeAt(pos), cellLeft = map.colCount(pos);\n var updatePos = tr.mapping.slice(mapFrom).map(pos + start);\n tr.setNodeMarkup(updatePos, null, rmColSpan(cell.attrs, left - cellLeft, cell.attrs.colspan - (left - cellLeft)));\n tr.insert(updatePos + cell.nodeSize, cell.type.createAndFill(rmColSpan(cell.attrs, 0, left - cellLeft)));\n row += cell.attrs.rowspan - 1;\n }\n }\n return found\n}", "title": "" }, { "docid": "ef1f66822d295c251fd455a6e0b3d122", "score": "0.5280243", "text": "function enableFixedPosition(enableFlag) {\r\n\tif (enableFlag) {\r\n\t for (var i = 0, l = fixedElements.length; i < l; ++i) {\r\n\t\tfixedElements[i].style.position = \"fixed\";\r\n\t }\r\n\t} else {\r\n\t var nodeIterator = document.createNodeIterator(\r\n\t\t document.documentElement,\r\n\t\t NodeFilter.SHOW_ELEMENT,\r\n\t\t null,\r\n\t\t false\r\n\t );\r\n\t var currentNode;\r\n\t while (currentNode = nodeIterator.nextNode()) {\r\n\t\tvar nodeComputedStyle = document.defaultView.getComputedStyle(currentNode, \"\");\r\n\t\t// Skip nodes which don't have computeStyle or are invisible.\r\n\t\tif (!nodeComputedStyle)\r\n\t\t return;\r\n\t\tvar nodePosition = nodeComputedStyle.getPropertyValue(\"position\");\r\n\t\tif (nodePosition == \"fixed\") {\r\n\t\t fixedElements.push(currentNode);\r\n\t\t currentNode.style.position = \"absolute\";\r\n\t\t}\r\n\t }\r\n\t}\r\n}", "title": "" }, { "docid": "51b2b187d4e7b4ff1109ff0493dbe541", "score": "0.5279157", "text": "function UpdateTableHeaders() {\n $(\".persist-area\").each(function() { \n var el = $(this),\n offset = el.offset(),\n scrollTop = $(window).scrollTop(),\n floatingHeader = $(\".floatingHeader\", this)\n \n if ((scrollTop > offset.top) && (scrollTop < offset.top + el.height())) {\n floatingHeader.css({\n \"visibility\": \"visible\"\n });\n } else {\n floatingHeader.css({\n \"visibility\": \"hidden\"\n }); \n };\n });\n}", "title": "" }, { "docid": "2a963334d5fe04af0c9967e800ec1976", "score": "0.52759135", "text": "_checkFixedPosition() {\n\n let parent = this.el;\n\n while (parent && parent !== document) {\n let style = getComputedStyle(parent);\n if (style.position === 'fixed') {\n return this.isFixed = true;\n }\n parent = parent.parentNode;\n }\n\n return this.isFixed = false;\n }", "title": "" }, { "docid": "ef3b65c8ff55b83f5928c63d4c0d57d8", "score": "0.5263866", "text": "function fixTableCellSelection(ed) {\n if (!tinymce.isWebKit) {\n return;\n }\n\n var rng = ed.selection.getRng();\n var n = ed.selection.getNode();\n var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH');\n\n if (!tableCellSelected(ed, rng, n, currentCell)) {\n return;\n }\n if (!currentCell) {\n currentCell=n;\n }\n\n // Get the very last node inside the table cell\n var end = currentCell.lastChild;\n while (end.lastChild) {\n end = end.lastChild;\n }\n\n // Select the entire table cell. Nothing outside of the table cell should be selected.\n rng.setEnd(end, end.nodeValue.length);\n ed.selection.setRng(rng);\n }", "title": "" }, { "docid": "8a51a58dbf424fda902dab737e5a6937", "score": "0.52520716", "text": "checkHeadersOffScreen() {\n if (!this.header || !this.header.current || !this.wrapper || !this.wrapper.current) {\n return;\n }\n\n const wrapper = this.wrapper.current;\n const headerWrapper = this.header.current;\n const header = headerWrapper.firstElementChild;\n const headerInner = header.firstElementChild;\n\n const top = this.headerPosition.y;\n const scrollPosY = window.pageYOffset;\n\n // Possibly fix headers if we've scrolled past where they start.\n const headerScrolledPast = scrollPosY > top;\n let tableStillVisible = false;\n\n // Don't fix headers if we've scrolled past the table.\n if (headerScrolledPast) {\n const wrapperBottomEdge = top + wrapper.offsetHeight - header.offsetHeight;\n tableStillVisible = scrollPosY < wrapperBottomEdge;\n }\n\n if (headerScrolledPast && tableStillVisible) {\n // The order of these is important.\n headerWrapper.style.height = headerWrapper.offsetHeight\n ? `${headerWrapper.offsetHeight}px`\n : '';\n\n headerInner.style.width = headerInner.clientWidth ? `${headerInner.clientWidth}px` : '';\n header.style.width = wrapper.clientWidth ? `${wrapper.clientWidth}px` : '';\n\n // Makes sure that a header which is generally transparent still retains a\n // background color.\n header.style.background = getParentBackgroundColor(headerWrapper);\n\n header.classList.add('fixed');\n this.headerIsFixed = true;\n this.checkFixedHeaderHorizontalScrolling();\n //\n } else {\n this.calculateHeaderPosition();\n }\n }", "title": "" }, { "docid": "bde2d779c08a7cbd7f6154801825fd61", "score": "0.524529", "text": "function GoldBorderandPinToTop(id) {\n var rows = document.getElementById(\"table\").rows;\n document.getElementById(\"unique1\").style.outline = \"2px solid black\"; // Fixs werid outline overlap\n parent = rows[id].parentNode;\n if(document.getElementById(id).style.borderTopColor != 'gold' &&\n document.getElementById(id).style.borderBottemColor != 'gold') { //Checks to see if outline is already highlighted\n document.getElementById(id).style.borderTopColor = 'gold';\n document.getElementById(id).style.borderBottomColor = 'gold';\n document.getElementById(id).style.outline = \"2px solid gold\";\n parent.insertBefore(rows[id],rows[1]); // This line makes it change the 2 second position because it looks like you have a place holder row at the top for the catorgories.\n } else {\n document.getElementById(id).style.borderTopColor = 'blue';\n document.getElementById(id).style.borderBottomColor = 'blue';\n document.getElementById(id).style.outline = null;\n parent.insertBefore(rows[id],rows[rows]); // Unpinning a task will make it move all the way to the bottom and unhighlight its border.\n }\n}", "title": "" }, { "docid": "a7088a2ec90f17d7ad71466f2942ac6c", "score": "0.5232363", "text": "function elem_fixed_1(event){\n var doc_top = $(document).scrollTop();\n\n var move_distance = last_scroll_top - doc_top;\n dmdc += move_distance;\n\n // relative時 css top:0 其position().top = 46\n // fixed時 css top:0 其position().top = 0\n var elem_top = parseInt(elem.position().top);\n\n // scroll 小於原本的位置bottom \n console.log(doc_top,ori_elem_bottom);\n if ( doc_top <= ori_elem_bottom ) {\n console.log(1);\n // [有點難解釋]捲軸高度 +??? 小於 elem 原位置底部\n if ( doc_top + elem_height + elem_top <= ori_elem_bottom ) {\n console.log(\"set default\");\n elem.css({'top':'0px'});\n elem.removeClass('elem_scroll_style1_on');\n }\n\n } else { // bug css top vs position top混用錯誤\n // scroll up 超過準備區 且 elem 尚未出現螢幕 , if relative => elem不會再隱藏位置 , only fixed and hidden will equal -elem_height\n if (doc_top <= ori_elem_bottom + placeholder){\n\n if( parseInt(elem_top) == parseInt(-elem_height) &&\n elem.hasClass('elem_scroll_style1_on')\n ){\n elem.removeClass('elem_scroll_style1_on');\n elem.css({'top': '0px'});\n console.log(\"buffer area\");\n }\n return;\n }\n\n { \n // 變fixed前 預先移動到螢幕外\n if ( !elem.hasClass('elem_scroll_style1_on') ){\n elem.css({'top': (-elem_height)+'px'});\n console.log(\"pre_action for fixed\");\n }\n //fixed預先移動完成 即加上fixed\n// console.log(elem_top , -elem_height + ori_elem_top);\n if ( parseInt(elem_top) == parseInt(-elem_height + ori_elem_top) ){ \n console.log(\"add fixed\");\n elem.addClass('elem_scroll_style1_on');\n }\n }\n\n // 超出高度\n if ( dmdc > 50 ){\n console.log(\" show on top\");\n dmdc = 50;\n elem.css({\"top\": \"0px\"});\n }\n if (dmdc < -50) {\n console.log(\" hide on top\");\n dmdc = -50;\n elem.css({\"top\": (-elem_height)+\"px\"});\n }\n }\n\n last_scroll_top = doc_top;\n }", "title": "" }, { "docid": "0458896a9d2e56387e4e51cbe25e5499", "score": "0.52216554", "text": "setTableContentTopValue({ top }) {\n //this.$refs[this.tableContentWrapperRef].style.transform = `translate3d(0,${startOffset}px,0)`;\n window.requestAnimationFrame(() => {\n const ele = this.$refs[this.tableContentWrapperRef];\n if (ele) {\n ele.$el.style.top = `${top}px`;\n }\n });\n }", "title": "" }, { "docid": "7c55f91426727a6d9cd68bfb09a64538", "score": "0.52083886", "text": "function setPopPosition($this, trgt)\n {\n if (trgt.hasClass('top') || trgt.hasClass('btm'))\n {\n if (trgt.hasClass('top'))\n trgt.css({'top': ($this.offset().top - trgt.outerHeight() - 11 - $(window).scrollTop()) + 'px'});\n else if (trgt.hasClass('btm'))\n trgt.css({'top': (($this.outerHeight() + $this.offset().top) - $(window).scrollTop() + 10) + 'px'});\n if (!($this.hasClass('bl') || $this.hasClass('br')))\n {\n trgt.css({'left': ($this.offset().left - ((trgt.outerWidth() - $this.outerWidth()) / 2)) + 'px', 'right': 'auto'});\n if (trgt.offset().left < 0)\n trgt.css({'left': '0', 'right': 'auto'}).find('arrow').css('left', ($this.outerWidth() / 2 - 5) + 'px');\n else if ($(window).width() <= Math.ceil(trgt.offset().left + trgt.outerWidth()))\n trgt.css({'left': 'auto', 'right': ($(window).width() - ($this.offset().left + $this.outerWidth()) - 4) + 'px'}).find('.arrow').css({'left': (trgt.outerWidth() - 4 - $this.outerWidth() / 2) + 'px'});\n }\n else\n {\n if ($this.hasClass('bl'))\n trgt.css({'left': $this.offset().left + 'px', 'right': 'auto'}).find('.arrow')\n .css('left', ($this.outerWidth() / 2) + 'px');\n else\n trgt.css({'left': ($this.offset().left + $this.outerWidth() - trgt.outerWidth()) + 'px', 'right': 'auto'})\n .find('.arrow').css('left', (trgt.outerWidth() - 2 - ($this.outerWidth() / 2)) + 'px');\n }\n }\n else\n {\n trgt.css('top', (($this.offset().top - $(window).scrollTop()) - (trgt.outerHeight() - $this.outerHeight()) / 2) + 'px');\n if (trgt.hasClass('right'))\n trgt.css({'left': ($this.offset().left + $this.outerWidth() + 11) + 'px'});\n else if (trgt.hasClass('left'))\n trgt.css({'left': -(trgt.outerWidth() + 11) + 'px'});\n\n if (trgt.offset().top < 0)\n trgt.css({'top': parseInt(trgt.css('top')) + trgt.offset().top}).find('.arrow').css('top', ($this.outerHeight() / 2 - 5) + 'px');\n else if ($(window).outerHeight() <= Math.ceil(trgt.offset().top + trgt.outerHeight() - $(window).scrollTop()))\n {\n var trgtBtm = Math.ceil(trgt.outerHeight() + trgt.offset().top - $(window).scrollTop()), arw = trgt.find('.arrow');\n trgt.css({'top': (parseInt(trgt.css('top')) - (trgtBtm - $(window).height()) - 8) + 'px'});\n arw.css('top', (parseInt(arw.css('top')) + (trgtBtm - $(window).height()) + 22) + 'px');\n }\n }\n }", "title": "" }, { "docid": "b0870cbd7dc77e2ba4d4f16159f60d0e", "score": "0.51936823", "text": "function updateCurrentTableAndIndex(pTableRow) {\n var tableRows;\n var maxTableIndex;\n\n if (justDoIt == true) {\n \n \t// update current table\n currentTable = pTableRow.parentNode;\n currentRowIndex = 0;\n\n\t\tvar lTableRows = currentTable.getElementsByTagName(\"tr\");\n\t\tvar lTableRowIndex = 1;\n\t\t\n\t\tfor (var i=1; i<lTableRows.length; i++)\n\t\t{\n\t\t\t// if table row is part of main table (i.e., not a nested table row)...\n if (lTableRows.item(i).parentNode == currentTable)\n\t\t\t{\n\t\t\t\t// if current table row found\n\t\t\t\tif (lTableRows.item(i) == pTableRow)\n\t\t\t\t{\n\t\t\t\t\t// update current table row index\n\t currentRowIndex = lTableRowIndex;\n\t break;\n\t }\n\t\t\t\t// else move on to the next table row in main table\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlTableRowIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \n // alert(\"updateCurrentTableAndIndex(currentRowIndex=\" + currentRowIndex + \")\"); \n }\n}", "title": "" }, { "docid": "444cd9214f959d0bd9c8400f7b28133f", "score": "0.51790255", "text": "function full_select_tr(tr)\n {\n var targetTable = $(tr).parents('.tableDiv').attr('id') == 'leftTable' ? '#leftTable' : '#rightTable';\n var trStart = targetTable == '#leftTable' ? lastSelectedTr.left : lastSelectedTr.right;\n if (!trStart) {\n return;\n }\n\n var index1 = $(tr).index();\n var index2 = $(trStart).index();\n\n var startIndex = Math.min(index1, index2);\n var endIndex = Math.max(index1, index2);\n\n $(''+targetTable+' tbody tr').each(function(i, e) {\n if (i > startIndex && i < endIndex\n && !$(e).hasClass('invisible') && !$(e).hasClass('trsel')){\n select_tr(e);\n $('#container').trigger(\"updateConnectionProperties\");\n }\n });\n }", "title": "" }, { "docid": "39d0164fac0d450a1ef6aa2ff8e164a6", "score": "0.51701134", "text": "function moveToNextTableRow(pTableInFocus) {\n var tableInFocus;\n var tableRows;\n var maxRowIndex;\n var tableCells;\n \n if (justDoIt == true) { \n \n if (pTableInFocus != null) {\n \n // if focus is still within same table...\n if (currentTable == pTableInFocus)\n { \n\t // determine the number of rows (including \"header row\") in this table\n\t\t\t var maxRowIndex = getNumberOfTableRows(pTableInFocus);\n\n if (maxRowIndex > 0)\n { \n // if current row is not the last row of this table...\n if ((currentRowIndex >= 0) && (currentRowIndex < maxRowIndex-1)) {\n \n if (tableRowHighlightable(getTableRow(currentRowIndex+1)) == true) {\n\n // unhighlight the current row\n unhighlightTableRow(currentRow);\n \n // make previous row of this table the current row\n currentRowIndex++;\n \n // highlight the (new) current row\n highlightTableRow(getTableRow(currentRowIndex));\n } \n }\n }\n }\n else {\n // make this new table in focus the current table\n currentTable = pTableInFocus;\n\n moveToNextTableRow(currentTable);\n }\n }\n }\n}", "title": "" }, { "docid": "966d48c81a484e61571ce760dc72d20e", "score": "0.516884", "text": "function scrollFix() {\n\t\t\t( function fix() {\n\t\t\t\tif ( $( container )[ 0 ].tagName === 'BODY' ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t\t} catch ( e ) {}\n\t\t\t\t}\n\t\t\t\t$( container ).scrollTop( 0 );\n\t\t\t\t$( container ).scrollLeft( 0 );\n\t\t\t\tfunction check() {\n\t\t\t\t\tif ( $( container ).scrollTop() !== 0 || $( container ).scrollLeft() !== 0 ) {\n\t\t\t\t\t\tfix();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsetTimeout( check, 1 );\n\t\t\t\tsetTimeout( check, 10 );\n\t\t\t\tsetTimeout( check, 100 );\n\t\t\t\tsetTimeout( check, 200 );\n\t\t\t\tsetTimeout( check, 400 );\n\t\t\t} )();\n\t\t}", "title": "" }, { "docid": "9b7bb7d0fc65caffdaf149165607ea35", "score": "0.51291436", "text": "function fixElement(i, pos, flag) {\n var ori = flag == 1 ? 'pos' : 'oppos';\n\n if (viewPortSize < (params.minView || 0)) { // No headers fixing when no enought space for viewport\n pos = undefined;\n }\n\n // Removing all fixing stuff - we can do this because fixElement triggers only when fixState really changed\n this.$(elements[i]).css(this.origin.pos, '').css(this.origin.oppos, '').removeClass(params.outside);\n\n // Fixing if needed\n if (pos !== undefined) {\n pos += 'px';\n this.$(elements[i]).css(this.origin[ori], pos).addClass(params.outside);\n }\n }", "title": "" }, { "docid": "4f0d041295de0f053ca047818b66006f", "score": "0.512054", "text": "function fixTableCellSelection() {\n\t\t\t\t\t\tfunction tableCellSelected(ed, rng, n, currentCell) {\n\t\t\t\t\t\t\t// The decision of when a table cell is selected is somewhat involved. The fact that this code is\n\t\t\t\t\t\t\t// required is actually a pointer to the root cause of this bug. A cell is selected when the start\n\t\t\t\t\t\t\t// and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)\n\t\t\t\t\t\t\t// or the parent of the table (in the case of the selection containing the last cell of a table).\n\t\t\t\t\t\t\tvar TEXT_NODE = 3,\n\t\t\t\t\t\t\t table = ed.dom.getParent(rng.startContainer, 'TABLE');\n\t\t\t\t\t\t\tvar tableParent, allOfCellSelected, tableCellSelection;\n\n\t\t\t\t\t\t\tif (table) {\n\t\t\t\t\t\t\t\ttableParent = table.parentNode;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tallOfCellSelected = rng.startContainer.nodeType == TEXT_NODE && rng.startOffset === 0 && rng.endOffset === 0 && currentCell && (n.nodeName == \"TR\" || n == tableParent);\n\n\t\t\t\t\t\t\ttableCellSelection = (n.nodeName == \"TD\" || n.nodeName == \"TH\") && !currentCell;\n\n\t\t\t\t\t\t\treturn allOfCellSelected || tableCellSelection;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction fixSelection() {\n\t\t\t\t\t\t\tvar rng = editor.selection.getRng();\n\t\t\t\t\t\t\tvar n = editor.selection.getNode();\n\t\t\t\t\t\t\tvar currentCell = editor.dom.getParent(rng.startContainer, 'TD,TH');\n\n\t\t\t\t\t\t\tif (!tableCellSelected(editor, rng, n, currentCell)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!currentCell) {\n\t\t\t\t\t\t\t\tcurrentCell = n;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Get the very last node inside the table cell\n\t\t\t\t\t\t\tvar end = currentCell.lastChild;\n\t\t\t\t\t\t\twhile (end.lastChild) {\n\t\t\t\t\t\t\t\tend = end.lastChild;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Select the entire table cell. Nothing outside of the table cell should be selected.\n\t\t\t\t\t\t\tif (end.nodeType == 3) {\n\t\t\t\t\t\t\t\trng.setEnd(end, end.data.length);\n\t\t\t\t\t\t\t\teditor.selection.setRng(rng);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teditor.on('KeyDown', function () {\n\t\t\t\t\t\t\tfixSelection();\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\teditor.on('MouseDown', function (e) {\n\t\t\t\t\t\t\tif (e.button != 2) {\n\t\t\t\t\t\t\t\tfixSelection();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "title": "" }, { "docid": "ca4d770dab765752d731510b32fe79be", "score": "0.5117911", "text": "_onCellMove(e){let dir=e.detail.direction,cell=e.detail.cell,row=cell.parentNode,body=this.$.tbody,x=Array.prototype.indexOf.call(row.children,cell),y=Array.prototype.indexOf.call(body.children,row);if(\"down\"===dir){if(y+1<body.children.length-1){body.children[y+1].children[x].children[0].setFocus()}else{this.insertRow(y)}}else if(\"up\"===dir){if(0<y){body.children[y-1].children[x].children[0].setFocus()}}else if(\"right\"===dir){if(x+1<row.children.length-1){row.children[x+1].children[0].setFocus()}else if(y+1<body.children.length-1){body.children[y+1].children[1].children[0].setFocus()}}else if(\"left\"===dir){if(1<x){row.children[x-1].children[0].setFocus()}else if(0<y){body.children[y-2].children[body.children[y-2].children.length-2].children[0].setFocus()}}}", "title": "" }, { "docid": "c7ee5ffabd1129ce91d426ec82dbc641", "score": "0.51121503", "text": "function update_positions(table, update_ids) {\n even = true;\n num_rows = 0;\n position = 0;\n\n // Set correct position: Filter through all trs, excluding first th tr and last hidden template tr\n table.find(\"tbody tr:not(.add_template):not(.deleted_row)\").each(function () {\n // Update row coloring\n $(this).removeClass(\"row1 row2\");\n if (even) {\n $(this).addClass(\"row1\");\n even = false;\n } else {\n $(this).addClass(\"row2\");\n even = true;\n }\n });\n\n table.find(\"tbody tr.has_original\").each(function () {\n num_rows++;\n });\n\n table\n .find(\"tbody tr:not(.has_original):not(.add_template)\")\n .each(function () {\n if (update_ids) update_id_fields($(this), num_rows);\n num_rows++;\n });\n\n table.find(\"tbody tr.add_template\").each(function () {\n if (update_ids) update_id_fields($(this), num_rows);\n num_rows++;\n });\n\n table\n .parent()\n .parent(\"div.tabular\")\n .find(\"input[id$='TOTAL_FORMS']\")\n .val(num_rows);\n}", "title": "" }, { "docid": "d9b3ab4a7885064e541eaf5d23f8f516", "score": "0.5110874", "text": "function moveSearchResultUp(row) {\n //citation: http://jsfiddle.net/shemeemsha/4dnoyo77/\n //citation: https://www.w3schools.com/jsref/met_table_deleterow.asp\n var index = row.parentNode.parentNode.rowIndex;\n if (index > 1) {\n var $element = row;\n var row = $($element).parents(\"tr:first\"); \n row.insertBefore(row.prev());\n }\n}", "title": "" }, { "docid": "dd5728e6c198e77716668b5ff350c4d9", "score": "0.51101595", "text": "function songInfoFixTop() {\n $article.find('.song-info').css('position','fixed').css('left','auto').css('top', '65px');\n }", "title": "" }, { "docid": "3cc6deeb3f13d26fce29c103964d2be7", "score": "0.5103056", "text": "function moveToPreviousTableRow(pTableInFocus) {\n\n if (justDoIt == true)\n {\n if (pTableInFocus != null)\n {\n // if focus is still within same table...\n if (currentTable == pTableInFocus)\n {\n\t // determine the number of rows (including \"header row\") in this table\n\t\t\t var maxRowIndex = getNumberOfTableRows(pTableInFocus);\n \n if (maxRowIndex > 0)\n { \n // if current row is not the first row of this table...\n if ((currentRowIndex > 1) && (currentRowIndex < maxRowIndex))\n { \n if (tableRowHighlightable(getTableRow(currentRowIndex-1)) == true)\n { \n // unhighlight the current row\n unhighlightTableRow(currentRow);\n \n // make previous row of this table the current row\n currentRowIndex--;\n \n // highlight the (new) current row\n highlightTableRow(getTableRow(currentRowIndex));\n } \n }\n }\n }\n else {\n // make this new table in focus the current table\n currentTable = pTableInFocus;\n\n moveToPreviousTableRow(currentTable);\n }\n }\n }\n}", "title": "" }, { "docid": "094316af8b2ebf0a2cd97622a10fd947", "score": "0.5098573", "text": "function update_positions(table, update_ids)\n{\n even = true\n num_rows = 0\n position = 0;\n\n // Set correct position: Filter through all trs, excluding first th tr and last hidden template tr\n table.find('tbody tr:not(.add_template):not(.deleted_row)').each(function() {\n if (position_field != '')\n {\n // Update position field\n $(this).find('td.' + position_field + ' input').val(position + 1);\n position++;\n \n // Update row coloring\n $(this).removeClass('row1 row2');\n if (even)\n {\n $(this).addClass('row1');\n even = false;\n }\n else\n {\n $(this).addClass('row2');\n even = true;\n }\n }\n });\n \n}", "title": "" }, { "docid": "8c23aed2249f3f6a2f0bbf5544ca4550", "score": "0.50978273", "text": "function findPositions(getInner, getOuter, thingsToMeasure) {\n\t\t\t\t\t\tvar tablePositions = [];\n\n\t\t\t\t\t\t// Skip the first item in the array = no left (LTR), right (RTL) or top bars\n\t\t\t\t\t\tfor (var i = 1; i < thingsToMeasure.length; i++) {\n\t\t\t\t\t\t\t// Get the element from the details\n\t\t\t\t\t\t\tvar item = thingsToMeasure[i].element;\n\n\t\t\t\t\t\t\t// We need to zero index this again\n\t\t\t\t\t\t\ttablePositions.push(getInner(i - 1, item));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar lastTableLineToMake = thingsToMeasure[thingsToMeasure.length - 1];\n\t\t\t\t\t\ttablePositions.push(getOuter(thingsToMeasure.length - 1, lastTableLineToMake.element));\n\n\t\t\t\t\t\treturn tablePositions;\n\t\t\t\t\t}", "title": "" }, { "docid": "ec42c7ce43b53aa0e767c3d301881288", "score": "0.5090277", "text": "function isolateHorizontal(tr, map, table, start, left, right, top, mapFrom) {\n if (top == 0 || top == map.height) { return false }\n var found = false;\n for (var col = left; col < right; col++) {\n var index = top * map.width + col, pos = map.map[index];\n if (map.map[index - map.width] == pos) {\n found = true;\n var cell = table.nodeAt(pos);\n var ref = map.findCell(pos);\n var cellTop = ref.top;\n var cellLeft = ref.left;\n tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(pos + start), null, setAttr(cell.attrs, \"rowspan\", top - cellTop));\n tr.insert(tr.mapping.slice(mapFrom).map(map.positionAt(top, cellLeft, table)),\n cell.type.createAndFill(setAttr(cell.attrs, \"rowspan\", (cellTop + cell.attrs.rowspan) - top)));\n col += cell.attrs.colspan - 1;\n }\n }\n return found\n}", "title": "" }, { "docid": "ec42c7ce43b53aa0e767c3d301881288", "score": "0.5090277", "text": "function isolateHorizontal(tr, map, table, start, left, right, top, mapFrom) {\n if (top == 0 || top == map.height) { return false }\n var found = false;\n for (var col = left; col < right; col++) {\n var index = top * map.width + col, pos = map.map[index];\n if (map.map[index - map.width] == pos) {\n found = true;\n var cell = table.nodeAt(pos);\n var ref = map.findCell(pos);\n var cellTop = ref.top;\n var cellLeft = ref.left;\n tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(pos + start), null, setAttr(cell.attrs, \"rowspan\", top - cellTop));\n tr.insert(tr.mapping.slice(mapFrom).map(map.positionAt(top, cellLeft, table)),\n cell.type.createAndFill(setAttr(cell.attrs, \"rowspan\", (cellTop + cell.attrs.rowspan) - top)));\n col += cell.attrs.colspan - 1;\n }\n }\n return found\n}", "title": "" }, { "docid": "ec42c7ce43b53aa0e767c3d301881288", "score": "0.5090277", "text": "function isolateHorizontal(tr, map, table, start, left, right, top, mapFrom) {\n if (top == 0 || top == map.height) { return false }\n var found = false;\n for (var col = left; col < right; col++) {\n var index = top * map.width + col, pos = map.map[index];\n if (map.map[index - map.width] == pos) {\n found = true;\n var cell = table.nodeAt(pos);\n var ref = map.findCell(pos);\n var cellTop = ref.top;\n var cellLeft = ref.left;\n tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(pos + start), null, setAttr(cell.attrs, \"rowspan\", top - cellTop));\n tr.insert(tr.mapping.slice(mapFrom).map(map.positionAt(top, cellLeft, table)),\n cell.type.createAndFill(setAttr(cell.attrs, \"rowspan\", (cellTop + cell.attrs.rowspan) - top)));\n col += cell.attrs.colspan - 1;\n }\n }\n return found\n}", "title": "" }, { "docid": "ec42c7ce43b53aa0e767c3d301881288", "score": "0.5090277", "text": "function isolateHorizontal(tr, map, table, start, left, right, top, mapFrom) {\n if (top == 0 || top == map.height) { return false }\n var found = false;\n for (var col = left; col < right; col++) {\n var index = top * map.width + col, pos = map.map[index];\n if (map.map[index - map.width] == pos) {\n found = true;\n var cell = table.nodeAt(pos);\n var ref = map.findCell(pos);\n var cellTop = ref.top;\n var cellLeft = ref.left;\n tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(pos + start), null, setAttr(cell.attrs, \"rowspan\", top - cellTop));\n tr.insert(tr.mapping.slice(mapFrom).map(map.positionAt(top, cellLeft, table)),\n cell.type.createAndFill(setAttr(cell.attrs, \"rowspan\", (cellTop + cell.attrs.rowspan) - top)));\n col += cell.attrs.colspan - 1;\n }\n }\n return found\n}", "title": "" }, { "docid": "1abc7084b3b329b60cd883d8a9dd6e78", "score": "0.5089523", "text": "function updateDraggableXPosition() {\n tablewidth = Number($(table).css(\"width\").substring(0,$(table).css(\"width\").length-2));\n tableheight = $(table).css(\"height\");\n\n $(\"#draggablex\").css({\n 'left': tablewidth + posleft + \"px\",\n 'height' : tableheight\n });\n\n $(\"#draggabley\").css({\n 'width' : tablewidth,\n });\n\n oldX = $(\"#draggablex\").offset().left;\n}", "title": "" }, { "docid": "c654ce3c154d02eb76a42d67d240cb68", "score": "0.5085235", "text": "function fixIE8NavBar() {\n\n function checkNavBarHidden() {\n var bottom = $(\".navbar-fixed-top\").offset().top + $(\".navbar-fixed-top\").height();\n\n var top = $(\"#logged_in_bar\").offset();\n\n if (top) {\n // No idea why happens.\n top = top.top;\n } else {\n top = 999;\n }\n\n if (top < bottom) {\n $(\"#logged_in_bar\").css(\"padding-top\", \"50px\");\n }\n }\n\n if (window.OLD_IE) {\n $(window).resize(function() {\n checkNavBarHidden();\n });\n\n // Fix on load\n checkNavBarHidden();\n }\n\n }", "title": "" }, { "docid": "99c46b70cb860a27acd9f10253c68e54", "score": "0.50758934", "text": "function scrollTable(){\n var $scroll = $('.x-scroll,.y-scroll');\n for (var i = 0; i < $scroll.length; i++) {\n var $table = $scroll.eq(i).find('table');\n var $table_width;\n var $td_array = new Array;\n var $col = $scroll.eq(i).find('colgroup').find('col');\n // set table layout auto\n $scroll.eq(i).addClass('load');\n if($scroll.eq(i).find('.thead,.tbody').length>0){\n // reset table\n var $thead_table = $scroll.eq(i).find('.thead').find('table');\n var $tbody = $scroll.eq(i).find('.tbody');\n $thead_table.unwrap();\n $thead_table.append($tbody.find('tbody'));\n $tbody.remove();\n }else{\n // fix col width\n if($scroll.eq(i).hasClass('x-scroll')){\n for (var j = 0; j < $col.length; j++) {\n if(!isNaN(parseInt($col.eq(j).attr('width')))){\n $col.eq(j).addClass('fix');\n }\n }\n }\n }\n // set col width before wrap\n if($scroll.eq(i).hasClass('x-scroll')){\n var $td = $table.find('tr:first-child').find('td');\n for (var j = 0; j < $td.length; j++) {\n var $td_width;\n if($col.eq(j).hasClass('fix')){\n $td_width = $col.eq(j).attr('width');\n }else{\n $td_width = Math.ceil($td.eq(j).outerWidth()) + 'px';\n }\n $col.eq(j).attr('width', $td_width);\n // get width\n $td_array[j] = parseInt($td_width);\n }\n }\n // wrap '.thead', '.tbody'\n if(!$scroll.eq(i).find('.thead,.tbody').length>0){\n var $thead = $scroll.eq(i).find('table').clone();\n var $tbody = $scroll.eq(i).find('table').clone();\n $scroll.eq(i).children('table').remove();\n $scroll.eq(i).append($thead).append($tbody);\n $thead.wrap('<div class=\"thead\"></div>').find('tbody').remove();\n $tbody.wrap('<div class=\"tbody\"></div>').find('thead').remove();\n }\n // get width\n $table_width = $td_array.reduce(function(a, b) { return a + b; }, 0);\n // set width\n if($scroll.eq(i).hasClass('x-scroll')){\n if($scroll.eq(i).outerWidth() >= $table_width){\n $scroll.eq(i).find('.thead,.tbody').css('width','100%');\n }else{\n $scroll.eq(i).find('.thead,.tbody').css('width',$table_width);\n }\n }\n // set table fixed\n $scroll.eq(i).removeClass('load');\n }\n}", "title": "" }, { "docid": "165ceaed3b2600eef50208c167bac38f", "score": "0.50730157", "text": "function setUnfixed() {\n // Only unfix the target element and the spacer if we need to.\n if (!isUnfixed()) {\n lastOffsetLeft = -1;\n\n // Hide the spacer now that the target element will fill the\n // space.\n spacer.css('display', 'none');\n\n // Remove the style attributes that were added to the target.\n // This will reverse the target back to the its original style.\n target.css({\n 'z-index' : originalZIndex,\n 'width' : '',\n 'position' : originalPosition,\n 'left' : '',\n 'top' : originalOffsetTop,\n 'margin-left' : ''\n });\n\n target.removeClass('scroll-to-fixed-fixed');\n\n if (base.options.className) {\n target.removeClass(base.options.className);\n }\n\n position = null;\n }\n }", "title": "" }, { "docid": "165ceaed3b2600eef50208c167bac38f", "score": "0.50730157", "text": "function setUnfixed() {\n // Only unfix the target element and the spacer if we need to.\n if (!isUnfixed()) {\n lastOffsetLeft = -1;\n\n // Hide the spacer now that the target element will fill the\n // space.\n spacer.css('display', 'none');\n\n // Remove the style attributes that were added to the target.\n // This will reverse the target back to the its original style.\n target.css({\n 'z-index' : originalZIndex,\n 'width' : '',\n 'position' : originalPosition,\n 'left' : '',\n 'top' : originalOffsetTop,\n 'margin-left' : ''\n });\n\n target.removeClass('scroll-to-fixed-fixed');\n\n if (base.options.className) {\n target.removeClass(base.options.className);\n }\n\n position = null;\n }\n }", "title": "" }, { "docid": "d8be53b391c8c524de5f9a10402b583e", "score": "0.5059324", "text": "function UpdateTableHeaders() {\n\t\t$(\"table.stickyHeader\").each(function() {\n\t\t\tvar _this = $(this);\n\t\t\tvar _floatingHeader = $(\".floatingHeader\", _this);\n\t\t\toffset = _this.offset();\n\t\t\tscrollTop = $(window).scrollTop();\n\t\t\tif ((scrollTop > offset.top) && (scrollTop < offset.top + _this.height())) {\n\t\t\t\t_floatingHeader\n\t\t\t\t\t.css(\"visibility\", \"visible\")\n\t\t\t} else {\n\t\t\t\t_floatingHeader\n\t\t\t\t\t.css(\"visibility\", \"hidden\");\n\t\t\t}\n\t\t\tUpdateTableHeaderWidths();\n\t\t});\n\t}", "title": "" }, { "docid": "8b92526d29fc9f25b3374ab9934792ce", "score": "0.5058435", "text": "function scroll(viewid, scrollid, size, divhead_id, tabid) {\n if (parent.$(\"#\" + divhead_id).length > 0) {\n parent.$(\"#\" + divhead_id).width($(\"#\" + tabid).width());\n return;\n }\n\n var scroll = parent.document.getElementById(scrollid);\n\n var tb2 = parent.document.getElementById(viewid).cloneNode(true);\n\n var $table = $(parent.document.getElementById(viewid));\n if ($table.find(\"input[type='checkbox']\").length > 0) {\n var id = $(tb2).find(\"input[type='checkbox']:first\").attr(\"id\");\n $table.find(\"input[type='checkbox']:first\").removeAttr(\"id\");\n $(tb2).find(\"input[type='checkbox']:first\").attr(\"id\", id);\n }\n\n for (var i = tb2.rows.length; i > size; i--) {\n tb2.deleteRow(size);\n }\n var top = parent.$(\"#\" + viewid).offset().top;\n var left = parent.$(\"#\" + viewid).offset().left;\n var bak = parent.document.createElement(\"div\");\n\n scroll.appendChild(bak);\n bak.appendChild(tb2);\n bak.setAttribute(\"id\", divhead_id);\n bak.style.position = \"fixed\";\n $(bak).css({\n \"left\": left,\n \"top\": top,\n width: $(\"#\" + tabid).width(),\n backgroundColor: \"#cfc\",\n display: \"block\"\n });\n parent.$(\"#\" + viewid).find(\"th\").each(function () {\n this.innerHTML = \"\";\n });\n}", "title": "" }, { "docid": "eb507c53ba48ee5f9a7a5fb7403a514d", "score": "0.50523496", "text": "stickRows(rowsToStick, stickyStates, position) {\n // Since we can't measure the rows on the server, we can't stick the rows properly.\n if (!this._isBrowser) {\n return;\n }\n // If positioning the rows to the bottom, reverse their order when evaluating the sticky\n // position such that the last row stuck will be \"bottom: 0px\" and so on. Note that the\n // sticky states need to be reversed as well.\n const rows = position === 'bottom' ? rowsToStick.slice().reverse() : rowsToStick;\n const states = position === 'bottom' ? stickyStates.slice().reverse() : stickyStates;\n // Measure row heights all at once before adding sticky styles to reduce layout thrashing.\n const stickyOffsets = [];\n const stickyCellHeights = [];\n const elementsToStick = [];\n for (let rowIndex = 0, stickyOffset = 0; rowIndex < rows.length; rowIndex++) {\n if (!states[rowIndex]) {\n continue;\n }\n stickyOffsets[rowIndex] = stickyOffset;\n const row = rows[rowIndex];\n elementsToStick[rowIndex] = this._isNativeHtmlTable ?\n Array.from(row.children) : [row];\n const height = row.getBoundingClientRect().height;\n stickyOffset += height;\n stickyCellHeights[rowIndex] = height;\n }\n const borderedRowIndex = states.lastIndexOf(true);\n // Coalesce with other sticky row updates (top/bottom), sticky columns updates\n // (and potentially other changes like column resize).\n this._coalescedStyleScheduler.schedule(() => {\n var _a, _b;\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n if (!states[rowIndex]) {\n continue;\n }\n const offset = stickyOffsets[rowIndex];\n const isBorderedRowIndex = rowIndex === borderedRowIndex;\n for (const element of elementsToStick[rowIndex]) {\n this._addStickyStyle(element, position, offset, isBorderedRowIndex);\n }\n }\n if (position === 'top') {\n (_a = this._positionListener) === null || _a === void 0 ? void 0 : _a.stickyHeaderRowsUpdated({ sizes: stickyCellHeights, offsets: stickyOffsets, elements: elementsToStick });\n }\n else {\n (_b = this._positionListener) === null || _b === void 0 ? void 0 : _b.stickyFooterRowsUpdated({ sizes: stickyCellHeights, offsets: stickyOffsets, elements: elementsToStick });\n }\n });\n }", "title": "" }, { "docid": "536529a1052cc9effbb3c1c1327203e4", "score": "0.50443506", "text": "function inPageTocElementMakeStickyOnScroll() {\n if (window.pageYOffset > inPageTocElementOffset.top) {\n inPageTocElement.style.position = 'fixed';\n inPageTocElement.style.top = 0;\n } else {\n inPageTocElement.style.position = 'relative';\n inPageTocElement.style.top = '';\n }\n}", "title": "" }, { "docid": "b076c2863f03b5fff4847f114eaf4644", "score": "0.5036622", "text": "function getElementAbsolutePos(element) {\n\tvar res = new Object();\n\tres.x = 0; res.y = 0;\n\tif (element !== null) { \n\t\tif (element.getBoundingClientRect) {\n\t\t\tvar viewportElement = document.documentElement; \n \t var box = element.getBoundingClientRect();\n\t\t var scrollLeft = viewportElement.scrollLeft;\n \t\t var scrollTop = viewportElement.scrollTop;\n\n\t\t res.x = box.left + scrollLeft;\n\t\t res.y = box.top + scrollTop;\n\n\t\t}\n\t\telse { //for old browsers\n\t\t\tres.x = element.offsetLeft;\n\t\t\tres.y = element.offsetTop;\n\n\t\t\tvar parentNode = element.parentNode;\n\t\t\tvar borderWidth = null;\n\t\t\tvar offsetParent = element.offsetParent;\n\n\t\t\twhile (offsetParent != null) {\n\t\t\t\tres.x += offsetParent.offsetLeft;\n\t\t\t\tres.y += offsetParent.offsetTop;\n\t\t\t\t\n\t\t\t\tvar parentTagName = \n\t\t\t\t\toffsetParent.tagName.toLowerCase();\t\n\n\t\t\t\tif ((__isIEOld && parentTagName != \"table\") || \n\t\t\t\t\t((__isFireFoxNew || __isChrome) && \n\t\t\t\t\t\tparentTagName == \"td\")) {\t\t \n\t\t\t\t\tborderWidth = kGetBorderWidth\n\t\t\t\t\t\t\t(offsetParent);\n\t\t\t\t\tres.x += borderWidth.left;\n\t\t\t\t\tres.y += borderWidth.top;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (offsetParent != document.body && \n\t\t\t\toffsetParent != document.documentElement) {\n\t\t\t\t\tres.x -= offsetParent.scrollLeft;\n\t\t\t\t\tres.y -= offsetParent.scrollTop;\n\t\t\t\t}\n\n\n\t\t\t\t//next lines are necessary to fix the problem \n\t\t\t\t//with offsetParent\n\t\t\t\tif (!__isIE && !__isOperaOld || __isIENew) {\n\t\t\t\t\twhile (offsetParent != parentNode && \n\t\t\t\t\t\tparentNode !== null) {\n\t\t\t\t\t\tres.x -= parentNode.scrollLeft;\n\t\t\t\t\t\tres.y -= parentNode.scrollTop;\n\t\t\t\t\t\tif (__isFireFoxOld || __isWebKit) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t borderWidth = \n\t\t\t\t\t\t kGetBorderWidth(parentNode);\n\t\t\t\t\t\t res.x += borderWidth.left;\n\t\t\t\t\t\t res.y += borderWidth.top;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparentNode = parentNode.parentNode;\n\t\t\t\t\t} \n\t\t\t\t}\n\n\t\t\t\tparentNode = offsetParent.parentNode;\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\t\t}\n\t}\n return res;\n}", "title": "" }, { "docid": "da952d21d63744a544b65ebee1e1d2b5", "score": "0.5036013", "text": "function setUnfixed() {\n // Only unfix the target element and the spacer if we need to.\n if (!isUnfixed()) {\n lastOffsetLeft = -1;\n\n // Hide the spacer now that the target element will fill the\n // space.\n spacer.css('display', 'none');\n\n // Remove the style attributes that were added to the target.\n // This will reverse the target back to the its original style.\n target.css({\n 'width' : '',\n 'position' : originalPosition,\n 'left' : '',\n 'top' : originalOffsetTop,\n 'margin-left' : ''\n });\n\n target.removeClass('scroll-to-fixed-fixed');\n\n if (base.options.className) {\n target.removeClass(base.options.className);\n }\n\n position = null;\n }\n }", "title": "" }, { "docid": "a1c83348ad5439c1165046ca65683475", "score": "0.50207525", "text": "function w(a,b){return na.nodeName(a,\"table\")&&na.nodeName(11!==b.nodeType?b:b.firstChild,\"tr\")?a.getElementsByTagName(\"tbody\")[0]||a.appendChild(a.ownerDocument.createElement(\"tbody\")):a}", "title": "" }, { "docid": "379c57b6136bb087aa320fc809233e1c", "score": "0.5015383", "text": "function tableSortable($that) {\n\n\n //$(document).scrollTop( {scrolltop} );\n\n \n $that.find(\".dtable > tbody\").sortable({\n axis: \"y\",\n // cursorAt: { top: -30 },\n placeholder: \"ui-state-highlight\",\n items: \"tr:not(.notsortaable)\",\n scroll: true,\n // scrollSensitivity: 450,\n revert: false,\n forcePlaceholderSize: false,\n forceHelperSize: false,\n // helper: \"clone\",\n opacity: 1,\n tolerance: 'pointer',\n handle: \".sortable_move\",\n distance: 0,\n create: function (event, ui) {\n \n },\n update: function (event, ui) {\n var richtung = '';\n var target = -1;\n\n\n if (parseInt(ui.item.prev().attr('data-row-zaehler')) > parseInt(ui.item.attr('data-row-zaehler'))) {\n richtung = \"&unten=\" + ui.item.attr('data-row-id');\n target = ui.item.prev().attr('data-row-id');\n } else {\n richtung = \"&oben=\" + ui.item.attr('data-row-id');\n target = ui.item.next().attr('data-row-id');\n }\n\n\n var url = $that.find(\".sortable_href\").attr(\"data-href\");\n url = url + richtung + \"&target=\" + target;\n\n\n template_progressbar.start();\n RequestHelper.get(url, function (response) {\n\n\n\n jq1112(\"div[name='main']\").css(\"opacity\", \"0\");\n setTimeout(function () {\n jq1112(\"div[name='main']\").html(response);\n jq1112(\"div[name='main']\").css(\"opacity\", \"1\");\n\n jq1112(\"div[name='main']\").ready(function () {\n document_ready();\n window_load();\n template_progressbar.end();\n });\n }, 40);\n\n }, true, true, true);\n \n $that.find(\"*[oldcss]\").each(function() {\n $(this).attr(\"style\",$(this).attr(\"oldcss\"));\n });\n // $that.find(\".dtable > tbody\").sortable( \"refreshPositions\" );\n // window.location.href = \"admin_telefonreport.php?\" + richtung + \"&sortrang=1&target=\" + target + \"&parent_id=\" + $(\"input[name='parent_id']\").val() + \"&fragen=\" + $(\"input[name='fragen']\").val() + \"&scrollTop=\" + $(document).scrollTop();\n },\n sort: function (event, ui) {\n // $(\".ui-state-highlight\").html(\"<td colspan='100'></td>\");\n \n \n // autoScroll();\n \n if (currentlyScrolling) {\n return;\n }\n\n var windowHeight = $(window).height();\n var mouseYPosition = event.clientY;\n var mouseYPosition = (ui.item.offset().top);\n//console.log((mouseYPosition-jq1112(document).scrollTop())+\" \"+(SCROLL_AREA_TOP_HEIGHT)+\" \"+($that.find(\".dtable > tbody .notsortaable\").offset().top+$that.find(\".dtable > tbody .notsortaable\").height()));\n\n if ((mouseYPosition - jq1112(document).scrollTop()) < SCROLL_AREA_TOP_HEIGHT) {\n currentlyScrolling = true;\n\n $('html, body').animate({\n scrollTop: \"-=\" + ui.item.height() + \"px\" // Scroll up half of window height.\n },\n 800, // 400ms animation.\n function () {\n currentlyScrolling = false;\n });\n\n } else if ((mouseYPosition + ui.item.height() - jq1112(document).scrollTop()) > (windowHeight - SCROLL_AREA_BOTTOM_HEIGHT)) {\n\n currentlyScrolling = true;\n\n $('html, body').animate({\n scrollTop: \"+=\" + ui.item.height() + \"px\" // Scroll down half of window height.\n },\n 800, // 400ms animation.\n function () {\n currentlyScrolling = false;\n });\n\n }\n \n\n },\n start: function (event, ui) {\n $(\".ui-state-highlight\").css(\"display\",\"none\");\n ui.item.css(\"position\",\"relative\");\n\n\n // ui.item.attr(\"oldcss\",(typeof ui.item.attr(\"style\") != typeof undefined?ui.item.attr(\"style\"):\" \"));\n ui.item.css(\"width\",ui.item.closest(\"table\").outerWidth());\n ui.item.css(\"height\",ui.item.height());\n \n \n $that.find(\".dtable > tbody > tr:first-child\").each(function() {\n $(this).attr(\"oldcss\",(typeof $(this).attr(\"style\") != typeof undefined?$(this).attr(\"style\"):\" \"));\n $(this).css(\"width\",$(this).outerWidth());\n });\n $that.find(\".dtable > tbody > tr:first-child\").find(\".drow2\").each(function() {\n $(this).attr(\"oldcss\",(typeof $(this).attr(\"style\") != typeof undefined?$(this).attr(\"style\"):\" \"));\n $(this).css(\"width\",$(this).outerWidth());\n });\n ui.item.find(\".drow2\").each(function() {\n $(this).attr(\"oldcss\",(typeof $(this).attr(\"style\") != typeof undefined?$(this).attr(\"style\"):\" \"));\n $(this).css(\"height\",$(this).outerHeight());\n $(this).css(\"width\",$(this).outerWidth());\n });\n \n \n \n \n $(\".ui-state-highlight\").css(\"width\", ui.item.closest(\"table\").outerWidth());\n $(\".ui-state-highlight\").css(\"height\", ui.item.height());\n $(\".ui-state-highlight\").html(\"<td colspan='1000'></td>\");\n ui.item.css(\"position\",\"absolute\");\n $(\".ui-state-highlight\").css(\"display\",\"\");\n },\n stop: function (event, ui) {\n \n $that.find(\"*[oldcss]\").each(function() {\n $(this).attr(\"style\",$(this).attr(\"oldcss\"));\n });\n // $that.find(\".dtable > tbody\").sortable( \"refresh\" );\n // ui.item.find(\".dcol\").css(\"border\",\"\");\n }\n });\n $that.find(\".dtable > tbody\").disableSelection();\n}", "title": "" }, { "docid": "1e07b0775f035f112d874a3ba59373fe", "score": "0.50137323", "text": "function move_up() {\n cur = document.getElementById(\"selected\"); \n //check to see if the top row is already selected.\n if (cur.parentNode.rowIndex <= 1) {\n\n return;\n }\n\t\n\t//place holder variable for swap\n var temp = cur.cellIndex;\n\t//Change the current cell back to normal style\n\tcur.removeAttribute(\"id\"); \n\tcur.style.borderWidth = \"1px\";\n cur = cur.parentNode;\n cur = cur.previousElementSibling;\n cur = cur.firstElementChild;\n \n for (var i = 0; i < temp; i++) {\n cur = cur.nextElementSibling;\n }\n\t//update the new current style and id\n cur.style.borderWidth = \"4px\"; \n cur.id = \"selected\"; \n}", "title": "" }, { "docid": "24973f67aabd3b31a9c194cbb65966ea", "score": "0.5012763", "text": "function supprLigne(quelLigne) {\n var i,len;\n var tab = document.getElementById('tabRC');\n // IE automatically inserts a TBODY that we have to take care of\n if (tab.firstChild && (tab.firstChild.nodeName == \"TBODY\")) tab=tab.firstChild;\n var els = new Array();\n if (quelLigne == '*')\n els = tab.getElementsByTagName('tr');\n else if (quelLigne == 'd') {\n els = getElementsByClass(\"RcChecked\",tab,'tr');\n } else if (quelLigne == 'r') {\n els = getElementsByClass(\"RcRevert\",tab,'tr');\n } else if (quelLigne == 'n') {\n els = getElementsByClass(\"RcNew\",tab,'tr');\n } else if (quelLigne == 'c') {\n els = getElementsByClass(\"RcBlanking\",tab,'tr');\n } else\n els.push(document.getElementById(quelLigne));\n len = els.length;\n for (i=len-1; i>=0; i--){\n if (els[i] != null) {\n lineUID = els[i].getElementsByTagName('th')[0].id;\n delete lrcLines[lineUID];\n tab.removeChild(els[i]);\n }\n }\n return false;\n}", "title": "" }, { "docid": "cc267511f580d2e463b2a67b12a97981", "score": "0.4995513", "text": "function fixScrollPosition() {\n setTimeout(() => {\n goToStep({ cursor: lastKnownState.cursor })\n }, 10)\n }", "title": "" }, { "docid": "d45470aac24dddd59166e0c0c9e96e96", "score": "0.4993429", "text": "function reverseTable()\n\t{\n\t\tfor(var i = 1; i<trs.length; i++)\n\t\t{\n\t\t\ttable.tBodies[0].insertBefore(trs[i], trs[0]);\n\t\t}\n\t}", "title": "" }, { "docid": "90722d072d3898e939cb8a14bee8f475", "score": "0.499131", "text": "function O(e,t){return u(e,\"table\")&&u(11!==t.nodeType?t:t.firstChild,\"tr\")&&ke(e).children(\"tbody\")[0]||e}", "title": "" }, { "docid": "b9082431c489b801893c444979ce614a", "score": "0.4991219", "text": "function fixTableRight() {\n\t\t// get height of table body and table container\n\t\tvar tblBodyHeight = $(\"#tblBodyRightPopup\").height();\n\t\tvar divBodyHeight = $(\"#divBodyRightPopup\").height();\n\t\t// if the table body is longer than the table container\n\t\tif (tblBodyHeight > divBodyHeight) {\n\t\t\t// add y scroll bar\n\t\t\t$(\"#divBodyRightPopup\").css(\"overflow-y\", \"scroll\");\n\t\t\tif (isMobile()) {\n\t\t\t\t// Mobile version\n\t\t\t} else {\n\t\t\t\t// ceiling the width of divBody to avoid misaligning the borders\n\t\t\t\t$(\"#divBodyRightPopup\").width(Math.ceil($(\"#divBodyRightPopup\").width()));\n\t\t\t\t// PC version\n\t\t\t\t// when the table body has many rows, scroll bar will appear\n\t\t\t\t// set the size of body to minus the scroll bar, scroll bar size: 17px\n\t\t\t\t$(\"#divHeadRightPopup\").width($(\"#divBodyRightPopup\").width() - 17);\n\t\t\t\t// set size when user resizes window\n\t\t\t\t$(window).resize(function() {\n\t\t\t\t\t$(\"#divHeadRightPopup\").width($(\"#divBodyRightPopup\").width() - 17);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\t// table body is shorter than the table container\n\t\t\t// hide y scroll bar\n\t\t\t$(\"#divBodyRightPopup\").css(\"overflow-y\", \"hidden\");\n\t\t\t\n\t\t\tif (isMobile()) {\n\t\t\t\t// Mobile version\n\t\t\t} else {\n\t\t\t\t// ceiling the width of divBody to avoid misaligning the borders\n\t\t\t\t$(\"#divBodyRightPopup\").width(Math.ceil($(\"#divBodyRightPopup\").width()));\n\t\t\t\t// PC version\n\t\t\t\t// when the table body has many rows, scroll bar will appear\n\t\t\t\t// set the size of body to minus the scroll bar, scroll bar size: 17px\n\t\t\t\t$(\"#divHeadRightPopup\").width($(\"#divBodyRightPopup\").width());\n\t\t\t\t// set size when user resizes window\n\t\t\t\t$(window).resize(function() {\n\t\t\t\t\t$(\"#divHeadRightPopup\").width($(\"#divBodyRightPopup\").width());\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// fix table not repainting on Chrome\n\t\t$(\"#divBodyRightPopup\").html($(\"#divBodyRightPopup\").html());\n\t\t\n\t\t// get height of table body and table container\n\t\tvar tblBodyHeight = $(\"#tblBodyPopup\").height();\n\t\tvar divBodyHeight = $(\"#divBodyPopup\").height();\n\t\t// if the table body is longer than the table container\n\t\tif (tblBodyHeight > divBodyHeight) {\n\t\t\t// add y scroll bar\n\t\t\t$(\"#divBodyPopup\").css(\"overflow-y\", \"scroll\");\n\t\t\tif (isMobile()) {\n\t\t\t\t// Mobile version\n\t\t\t} else {\n\t\t\t\t// ceiling the width of divBody to avoid misaligning the borders\n\t\t\t\t$(\"#divBodyPopup\").width(Math.ceil($(\"#divBodyPopup\").width()));\n\t\t\t\t// PC version\n\t\t\t\t// when the table body has many rows, scroll bar will appear\n\t\t\t\t// set the size of body to minus the scroll bar, scroll bar size: 17px\n\t\t\t\t$(\"#divHeadPopup\").width($(\"#divBodyPopup\").width() - 17);\n\t\t\t\t// set size when user resizes window\n\t\t\t\t$(window).resize(function() {\n\t\t\t\t\t$(\"#divHeadPopup\").width($(\"#divBodyPopup\").width() - 17);\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\t// table body is shorter than the table container\n\t\t\t// hide y scroll bar\n\t\t\t$(\"#divBodyPopup\").css(\"overflow-y\", \"hidden\");\n\t\t\t\n\t\t}\n\t\t// fix table not repainting on Chrome\n\t\t$(\"#divBodyRight\").html($(\"#divBodyRight\").html());\n\t}", "title": "" }, { "docid": "42d1cdb6fae2647f31a8a081ac2b4b81", "score": "0.4983394", "text": "function paintTable() {\r\n\r\n\tvar se = document.frames('frame1').window.event.srcElement;\r\n\t\r\n\tvar sr, sc, tbl, fAll;\r\n\t\t\t\r\n\tfAll = document.frames('frame1').document.all;\r\n\t\r\n\tif(se.tagName!='TD') {\r\n\t\t\t\tsr = 0;\r\n\t\tsc = 0;\r\n\t\tvar str=\"&nbsp;Cancel\";\r\n\t\tfAll.tblsel.style.width = 0;\r\n\t\tfAll.tblsel.style.height = 0;\r\n\t\treturn;\r\n\t}\r\n\t\r\n\ttbl=fAll.oTable;\r\n\tsr=se.parentElement.rowIndex;\r\n\tsc=se.cellIndex;\r\n\t\r\n\t//Expand the table selector if its too small\r\n\tif(!is_ie4) {\r\n\t\tif(tbl.rows.length == sr+1) {\r\n\t\t\tvar r = tbl.insertRow(-1);\r\n\t\t\tvar td;\r\n\t\t\t\r\n\t\t\tfor(var i=0;i<tbl.rows(1).cells.length;i++) {\r\n\t\t\t\ttd = r.insertCell(-1);\r\n\t\t\t\ttd.innerHTML = \"&nbsp;\";\r\n\t\t\t\ttd.style.pixelWidth = 20;\r\n\t\t\t\ttd.style.pixelHeight = 20;\r\n\t\r\n\t\t\t}\r\n\t\t\t\tvar bdy = document.frames(\"frame1\").document.body;\t\t\t\r\n\t\t\t\tvar ifrm = document.frames(\"frame1\");\r\n\t\t\t\t\r\n\t\t\t\tdocument.all.frame1.style.pixelWidth = ifrm.document.all.oTable.offsetWidth + 3\r\n\t\t\t\tdocument.all.frame1.style.pixelHeight = ifrm.document.all.oTable.offsetHeight + 3 +\r\n\t\t\t\t\tifrm.document.all.tblstat.offsetHeight;\r\n\t\t}\r\n\t\tif(tbl.rows(1).cells.length == sc+1) {\r\n\t\t\tvar td;\r\n\t\t\tfor(var i=0;i<tbl.rows.length;i++) {\r\n\t\t\t\ttd = tbl.rows(i).insertCell(-1);\r\n\t\t\t\ttd.innerHTML = \"&nbsp;\";\r\n\t\t\t\ttd.style.pixelWidth = 20;\r\n\t\t\t\ttd.style.pixelHeight = 20;\r\n\t\t\t}\t\t\t\r\n\t\t\t\tvar bdy = document.frames(\"frame1\").document.body;\r\n\t\t\t\tdocument.all.frame1.style.pixelWidth = bdy.createTextRange().boundingWidth + 5;\r\n\t\t\t\tdocument.all.frame1.style.pixelHeight = bdy.createTextRange().boundingHeight + 5;\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar str=(sr+1) + \" by \" + (sc+1) + \" Table\";\r\n\tfAll.tblsel.style.width = se.offsetWidth*(sc+1)+5;\r\n\tfAll.tblsel.style.height = se.offsetHeight*(sr+1)+5;\r\n\t\r\n\tfAll.tblstat.innerHTML = str;\r\n}", "title": "" }, { "docid": "7176c8e388f4be4b5066542e1ef653de", "score": "0.49764702", "text": "function AdjustTableStyle(prefix, tableId, bodyRow, adjustW, minW, maxW, fitParent) {\n var tableBody = $get(prefix + '.BODY.' + tableId);\n if (tableBody.rows.length > 0) {\n var tableHeader = $get(prefix + '.HEADER.' + tableId);\n var colWidth = 0;\n var tableWidth = 0;\n var tableBodyCells = tableBody.rows[bodyRow].cells;\n var tableHeaderCells = tableHeader.rows[0].cells;\n var bodyColExtraWidth = getColExtraWith(tableBody);\n var headerColExtraWidth = getColExtraWith(tableHeader);\n\n tableBody.parentNode.setAttribute('scrollx', 0);\n\n var extraWidth = 0;\n if (headerColExtraWidth > bodyColExtraWidth) {\n extraWidth = headerColExtraWidth;\n } else {\n extraWidth = bodyColExtraWidth;\n }\n\n for (var i = 0; i < tableHeaderCells.length; i++) {\n if (tableHeaderCells[i].offsetWidth < tableBodyCells[i].offsetWidth) {\n colWidth = tableBodyCells[i].offsetWidth;\n tableHeaderCells[i].style.width = colWidth + 'px';\n tableBodyCells[i].style.width = colWidth + 'px';\n } else {\n colWidth = tableHeaderCells[i].offsetWidth;\n tableHeaderCells[i].style.width = colWidth + 'px';\n tableBodyCells[i].style.width = colWidth + 'px';\n }\n tableWidth += colWidth + extraWidth;\n }\n if ((tableHeader.parentNode.offsetWidth + 17) <= tableWidth) {\n tableHeader.style.width = tableWidth + 'px';\n tableBody.style.width = tableWidth + 'px';\n }\n }\n AdjustTableDivWidth(prefix, tableId, adjustW, minW, maxW, fitParent)\n}", "title": "" }, { "docid": "326836eecc2716813f0e7bf520c5cce8", "score": "0.4975955", "text": "function FixGridHeader(IsSetTimeOut) {\n\tif ($(\".fixheader\").length > 0) {\n\t\t$(\".fixheader thead\").css(\"position\", \"relative\");\n\n\t\t//Remove Already Exisst Hidden TR\n\t\tif ($(\".hiddentr\").length > 0)\n\t\t\t$(\".hiddentr\").remove();\n\n\t\tvar clientWidth = parseInt(document.documentElement.clientWidth);\n\t\tif (clientWidth > 768) {\n\n\t\t\tvar headerCellWidths = new Array();\n\t\t\t$('.fixheader tbody tr:first td').not(\".hide\").each(function (i) {\n\t\t\t\theaderCellWidths[i] = $(this).outerWidth();\n\t\t\t});\n\n\t\t\t$('.fixheader thead tr th').not(\".hide\").each(function (i) {\n\t\t\t\t$(this).css('width', headerCellWidths[i] - 0 + 'px');\n\t\t\t});\n\n\n\t\t\t$('.fixheader tbody tr:first td').not(\".hide\").each(function (i) {\n\t\t\t\t$(this).css('width', headerCellWidths[i] + 'px');\n\t\t\t});\n\n\t\t\t$(\".fixheader thead\").css(\"position\", \"fixed\");\n\n\t\t\tvar thHeight = $(\".fixheader thead\").outerHeight() - 2;\n\t\t\tif (thHeight > 0) {\n\n\t\t\t\tvar firsttr = \"<tr class='hiddentr' style='height: \" + thHeight + \"px;'>\";\n\n\t\t\t\t$('.fixheader thead tr th').each(function (i) {\n\t\t\t\t\tif ($(this).hasClass(\"hide\"))\n\t\t\t\t\t\tfirsttr += \"<td class='hide'></td>\";\n\t\t\t\t\telse\n\t\t\t\t\t\tfirsttr += \"<td></td>\";\n\t\t\t\t});\n\t\t\t\tfirsttr += \"</tr>\";\n\n\t\t\t\t$(firsttr).prependTo(\".fixheader.table > tbody\");\n\t\t\t}\n\n\t\t\tif (IsSetTimeOut) {\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tFixGridHeader(false);\n\t\t\t\t\t//alert(\"Hello\");\n\t\t\t\t}, 50);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2c07ecc401ce8ff6793ac2deb5ec97a1", "score": "0.49624306", "text": "function updateMessageTable(){\n\t\tif(that.lastRow){\n\t\t\tthat.lastRow.cells[0].innerHTML=null;\n\t\t}\n\t\tif(that.rowRef){\n\t\t \tthat.rowRef.cells[0].innerHTML=\"&gt;\"\n\t\t}\n\t}", "title": "" }, { "docid": "894cc98fc4f1fcc4463a5bb6c0a99541", "score": "0.49531996", "text": "positionHeaders() {\n // If there are no columns recorded in this table, we don't have to do\n // anything.\n if (this.columns && this.columns.length >= 1) {\n if (!this.headers) {\n return;\n }\n\n // Determine the boundaries of our container.\n const wrapperBoundaries = this.wrapper.current.getBoundingClientRect();\n let offsetLeft = 0;\n let offsetRight = 0;\n\n const { hasExpandableRowMarkers, expandableRowMarkersPosition } = this.props;\n const hasRightMarker = hasExpandableRowMarkers && expandableRowMarkersPosition === 'right';\n\n const firstColumn = this.columns[0];\n const lastColumn = this.columns[this.columns.length - 1];\n\n // Then for the first column, go through each cell and find it's left\n // offset as related to the window, and use that to calculate the offset\n // relative to the container.\n firstColumn.forEach(cell => {\n const cellBoundaries = cell.getBoundingClientRect();\n const cellLeft = cellBoundaries.left - wrapperBoundaries.left;\n\n if (\n cell.classList.contains('expand-cell-header') &&\n !cell.classList.contains('expand-cell-header-section')\n ) {\n return;\n }\n\n if (cellLeft > offsetLeft) {\n offsetLeft = cellLeft;\n }\n });\n\n // And for the last column, go through each cell and find it's right\n // offset as related to the window, and use that to calculate the offset\n // relative to the container.\n lastColumn.forEach(cell => {\n const cellBoundaries = cell.getBoundingClientRect();\n const cellRight = wrapperBoundaries.right - cellBoundaries.right;\n\n if (cellRight > offsetRight) {\n offsetRight = cellRight;\n }\n });\n\n // Then use that offset as the padding for the header.\n this.headers.style.paddingLeft = offsetLeft ? `${offsetLeft}px` : '';\n this.headers.style.paddingRight = offsetRight ? `${offsetRight}px` : '';\n\n if (this.headerLastCellIsSection && !hasRightMarker && lastColumn.length > 0) {\n const firstCell = lastColumn[0];\n\n if (window && window.getComputedStyle) {\n const firstCellStyles = window.getComputedStyle(firstCell);\n this.headers.style.marginRight = `-${firstCellStyles.paddingRight}`;\n }\n }\n }\n }", "title": "" }, { "docid": "20e237bceba89d5d061b7ef2da28b8fc", "score": "0.4952398", "text": "function centerAlign() {\n\tvar tableWidth = document.getElementById('pageTable').offsetWidth;\n\tvar bodyWidth = document.getElementsByTagName('body')[0].offsetWidth;\n\tvar calcOffset = Math.floor((bodyWidth - tableWidth) / 2);\n\tdocument.getElementById('pageTable').style.position = 'relative';\n\tdocument.getElementById('pageTable').style.left = calcOffset;\n\t/*\n\t * var tableHeight = document.getElementById('pageTable').offsetHeight;\n\t * if(tableHeight < 500) { document.getElementById('pageTable').style.height =\n\t * '500'; }\n\t */\n}", "title": "" }, { "docid": "34b7792142d3eca89e22db5b173d5e53", "score": "0.49495214", "text": "function updateLeftPosition() {\n // Find the right edge of the #v65-onepage-Detail table\n leftBoxRightPos = $leftBox.offset().left + $leftBox.width();\n orderBoxLeftPos = leftBoxRightPos + gutterWidth;\n }", "title": "" }, { "docid": "caf2f271bc3117b9c1175d08c7b998e2", "score": "0.49444416", "text": "readPositionTables() {\n if (this.isResetting) {\n return;\n }\n\n this.isResetting = true;\n this.readTables(); // Find all of the tables, rows and cells and store the content\n this.resetSizing(); // Make sure any sizing that has been explicitly set is stripped out\n this.positionHeaders(); // Make sure headers are appropriately indented on the left and right\n this.setSizing(); // Make sure all columns are the same width\n this.isResetting = false;\n }", "title": "" }, { "docid": "c17675265cb3e51d4b5719005e83a676", "score": "0.49376336", "text": "stickRows(rowsToStick, stickyStates, position) {\n // Since we can't measure the rows on the server, we can't stick the rows properly.\n if (!this._isBrowser) {\n return;\n }\n // If positioning the rows to the bottom, reverse their order when evaluating the sticky\n // position such that the last row stuck will be \"bottom: 0px\" and so on. Note that the\n // sticky states need to be reversed as well.\n const rows = position === 'bottom' ? rowsToStick.slice().reverse() : rowsToStick;\n const states = position === 'bottom' ? stickyStates.slice().reverse() : stickyStates;\n // Measure row heights all at once before adding sticky styles to reduce layout thrashing.\n const stickyOffsets = [];\n const stickyCellHeights = [];\n const elementsToStick = [];\n for (let rowIndex = 0, stickyOffset = 0; rowIndex < rows.length; rowIndex++) {\n if (!states[rowIndex]) {\n continue;\n }\n stickyOffsets[rowIndex] = stickyOffset;\n const row = rows[rowIndex];\n elementsToStick[rowIndex] = this._isNativeHtmlTable\n ? Array.from(row.children)\n : [row];\n const height = row.getBoundingClientRect().height;\n stickyOffset += height;\n stickyCellHeights[rowIndex] = height;\n }\n const borderedRowIndex = states.lastIndexOf(true);\n // Coalesce with other sticky row updates (top/bottom), sticky columns updates\n // (and potentially other changes like column resize).\n this._coalescedStyleScheduler.schedule(() => {\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n if (!states[rowIndex]) {\n continue;\n }\n const offset = stickyOffsets[rowIndex];\n const isBorderedRowIndex = rowIndex === borderedRowIndex;\n for (const element of elementsToStick[rowIndex]) {\n this._addStickyStyle(element, position, offset, isBorderedRowIndex);\n }\n }\n if (position === 'top') {\n this._positionListener?.stickyHeaderRowsUpdated({\n sizes: stickyCellHeights,\n offsets: stickyOffsets,\n elements: elementsToStick,\n });\n }\n else {\n this._positionListener?.stickyFooterRowsUpdated({\n sizes: stickyCellHeights,\n offsets: stickyOffsets,\n elements: elementsToStick,\n });\n }\n });\n }", "title": "" }, { "docid": "6f34030c0b8d0f26d0ca53cd06760243", "score": "0.49345875", "text": "function _checkHighlightTr(thisVar) {\n\t$(thisVar).closest(\"tr\").addClass('checkTr');\n}", "title": "" }, { "docid": "313326909a80ca248237fe1ae49f3987", "score": "0.4933454", "text": "stickRows(rowsToStick, stickyStates, position) {\n // Since we can't measure the rows on the server, we can't stick the rows properly.\n if (!this._isBrowser) {\n return;\n }\n // If positioning the rows to the bottom, reverse their order when evaluating the sticky\n // position such that the last row stuck will be \"bottom: 0px\" and so on. Note that the\n // sticky states need to be reversed as well.\n const rows = position === 'bottom' ? rowsToStick.slice().reverse() : rowsToStick;\n const states = position === 'bottom' ? stickyStates.slice().reverse() : stickyStates;\n // Measure row heights all at once before adding sticky styles to reduce layout thrashing.\n const stickyHeights = [];\n const elementsToStick = [];\n for (let rowIndex = 0, stickyHeight = 0; rowIndex < rows.length; rowIndex++) {\n stickyHeights[rowIndex] = stickyHeight;\n if (!states[rowIndex]) {\n continue;\n }\n const row = rows[rowIndex];\n elementsToStick[rowIndex] = this._isNativeHtmlTable ?\n Array.from(row.children) : [row];\n if (rowIndex !== rows.length - 1) {\n stickyHeight += row.getBoundingClientRect().height;\n }\n }\n // Coalesce with other sticky row updates (top/bottom), sticky columns updates\n // (and potentially other changes like column resize).\n this._scheduleStyleChanges(() => {\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n if (!states[rowIndex]) {\n continue;\n }\n const height = stickyHeights[rowIndex];\n for (const element of elementsToStick[rowIndex]) {\n this._addStickyStyle(element, position, height);\n }\n }\n });\n }", "title": "" }, { "docid": "7ddce868dba5c53cbfd2dd40c3bfa106", "score": "0.49295357", "text": "function scrollToObject() {\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\t//setFocus();\n\t\t}", "title": "" }, { "docid": "0e274497d5ecf085d984aa0c078cc4d3", "score": "0.492608", "text": "function moveMeDown() {\n if (currentSelection.row != null) {\n var currentRow = currentSelection.row;\n var currentRowIndex = currentRow.rowIndex;\n var numRows = currentSelection.table.rows.length;\n\n if (currentRowIndex < numRows - 1) {\n var targetRow = currentSelection.table.rows[currentRowIndex + 1];\n var targetRowContents = targetRow.cells[1].innerHTML;\n targetRow.cells[1].innerHTML = currentRow.cells[1].innerHTML;\n targetRow.className = 'selectedSourceMapping';\n currentRow.cells[1].innerHTML = targetRowContents;\n currentRow.className = '';\n currentSelection.row = targetRow;\n SequenceTracker.swapValue(currentSelection.sequenceId, currentSelection.sequenceIndex, 1);\n update();\n }\n }\n}", "title": "" }, { "docid": "d8bf52f3e08bbfc28f1ccac6102d11b5", "score": "0.49247038", "text": "function fixTocScroll () {\r\n\t\tvar el = document.getElementById(location.hash.slice(1));\r\n\t\tif (el) {\r\n\t\t\tscrollTop($(el).position().top);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "670045240dc4d6c216f0d5b4bfb8527c", "score": "0.4915884", "text": "function scrollToObject() {\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\tsetFocus();\n\t\t}", "title": "" }, { "docid": "cb9ed38c714f2119a51d843b428664da", "score": "0.4906513", "text": "function adjustStickyElements(){\n var stickyElementSelector = '#backlog-table thead, #backlog-filter-container';\n var newStickyOffset = $(\".banner-wrap\").height();\n $(stickyElementSelector).css({top:newStickyOffset});\n AlmCommon.reInitializeStickyOptions(stickyElementSelector, {\n parent:$('#alm-container'),\n offset_top: newStickyOffset,\n bottoming : false\n });\n }", "title": "" }, { "docid": "a031748894d64955180b0cc7df5c3673", "score": "0.48984742", "text": "function GetElementPosition(element) {\n element = GetOuterElementOfType(element, 'table');\n\n var left, top;\n left = top = 0;\n if (element.offsetParent) {\n do {\n left += element.offsetLeft;\n top += element.offsetTop;\n } while (element = element.offsetParent);\n }\n return { left: left, top: top };\n}", "title": "" }, { "docid": "52467580be9e50d6f54426d6cf46188e", "score": "0.48978883", "text": "function td_get_position() {\n\treturn get_position(l.container_div);\n}", "title": "" }, { "docid": "551665775be161fea5d8888cb1d94a0d", "score": "0.48848635", "text": "function addListenersTableRows(row) {\n var doc = document.getElementById(row);\n // remove the old one before creating a new one\n doc.removeEventListener('click', function(e) {\n doc.removeEventListener('touchstart', null);\n doc.removeEventListener('touchmove', null);\n doc.removeEventListener('touchend', null);\n }, false);\n doc.addEventListener('click', function(e) {\n var feedback = document.getElementById(\"TOUCH_FEEDBACK\"); // DEBUG\n var startx = 0;\n var starty = 0;\n var distx = 0;\n var disty = 0;\n var endx = 0;\n var vpw = window.innerWidth; // viewport width\n doc.addEventListener('touchstart', function(e) {\n var touchobj = e.changedTouches[0]; // reference first touch point (ie: first finger)\n startx = parseInt(touchobj.clientX); // get x position of touch point relative to left edge of browser\n starty = parseInt(touchobj.clientY); // get y position of touch point relative to top edge of browser\n updateTouchFeedback(feedback, startx, distx, endx, starty, disty); // DEBUG\n e.preventDefault();\n }, false);\n doc.addEventListener('touchmove', function(e) {\n var touchobj = e.changedTouches[0]; // reference first touch point for this event\n distx = parseInt(touchobj.clientX) - startx;\n fadeWithSwipe(doc, distx);\n disty = parseInt(touchobj.clientY) - starty;\n scroll(disty);\n updateTouchFeedback(feedback, startx, distx, endx, starty, disty); // DEBUG\n e.preventDefault();\n }, false);\n doc.addEventListener('touchend', function(e) {\n doc.style.backgroundColor = \"black\";\n document.getElementById(\"navigation\").style.borderBottom = \"2px solid darkgray\";\n document.getElementById(\"main-table\").style.borderBottom = \"2px solid black\";\n var touchobj = e.changedTouches[0]; // reference first touch point for this event\n distx = parseInt(touchobj.clientX) - startx;\n endx = startx + distx;\n if(distx > 200) {\n pinRowSwipe(row);\n } else if (distx < -200) {\n deleteRowSwipe(doc);\n } else if ((startx < 80) && (endx < 80) && (distx < 50)) {\n deleteRowSwipe(doc);\n } else if ((startx > (vpw - 80)) && (endx > (vpw - 80)) && (distx < 50)) {\n pinRowSwipe(row);\n }\n updateTouchFeedback(feedback, startx, distx, endx, starty, disty); // DEBUG\n e.preventDefault();\n }, false);\n }, false);\n}", "title": "" }, { "docid": "9ce4456c8d1b8c9b9ebe73f82260959d", "score": "0.48801798", "text": "setBodyRowHeight() {\n Array.from(this.table.getElementsByClassName('table-body')[0].getElementsByTagName('tr'))\n .forEach((eachRowElement, index) => {\n const tableBodyRowHeight = eachRowElement.clientHeight;\n\n if (this.getFixedLeftColumns().length !== 0) {\n this.fixedLeftTable.getElementsByClassName('table-body')[0]\n .getElementsByTagName('tr')[index]\n .style\n .height = `${tableBodyRowHeight}px`;\n }\n if (this.getFixedRightColumns().length !== 0) {\n this.fixedRightTable.getElementsByClassName('table-body')[0]\n .getElementsByTagName('tr')[index]\n .style\n .height = `${tableBodyRowHeight}px`;\n }\n });\n }", "title": "" }, { "docid": "bd376aedb1d3b14b6ad3cc9c9a5f7b6f", "score": "0.48799813", "text": "function unsetFixed (position) {\n // For the elements who are fixed elements before, now\n // are not fixed: the fixedPlaceholder has to be replaced\n // by this element.\n position = position ? position + '' : 'relative';\n if (this.fixedPlaceholder) {\n var parent = this.fixedPlaceholder.parentNode;\n parent.insertBefore(this.node, this.fixedPlaceholder);\n parent.removeChild(this.fixedPlaceholder);\n this.fixedPlaceholder = null;\n this.node.style.position = position;\n }\n}", "title": "" }, { "docid": "795d5c328e015175abb63c7aff94f7b8", "score": "0.48738998", "text": "function UltimateScrollingTable( tabId, height, width, sortId )\n{ var __version__ = '14.7.17';\n\n /* Create the variables for the closure */\n var windowWidth;\n var windowHeight;\n var scrollWidth;\n var scrollHeight;\n var naturalWidth;\n var naturalHeight;\n\n var tHeadMC;\n var tBodyMC;\n var tFootMC;\n var thMC;\n var divHR; /* only if there is a header */\n var thHR;\n var tabHR;\n var divFR; /* only if there is a footer */\n var thFR;\n var tabFR;\n\n var withinWindow = 0;\n var overX = 'scroll'; // unused\n var overY = 'scroll';\n var widthToUse;\n var tabWidthToUse;\n var hdrWidthToUse;\n var heightToUse;\n var scrollHeightToUse;\n var headerHeight = 0;\n var footerHeight = 0;\n\n var divRoot = document.createElement('div');\n\n /* other variables */\n var tabRoot = document.getElementById( tabId );\n var parent = tabRoot.parentNode;\n var divMC = document.createElement('div');\n var maxWidth = 10000;\n var tHeadHR;\n var tHeadFR;\n var convertMCIds;\n /* temporary usage */\n var UST, ix, iy;\n\n /* must do this for each of the cloned tables */\n function getGrandChildThList( headTag )\n { var t1 = headTag.getElementsByTagName('th');\n t1 = Array.prototype.slice.call( t1 );\n return t1;\n }\n\n /* calculate the parameters */\n UST = tabRoot.getAttribute('data-ustoverflow-x');\n if ( UST !== null )\n { if ( UST === \"within-window\" )\n { withinWindow = 1;\n } else\n { overX = UST;\n }\n }\n UST = tabRoot.getAttribute('data-ustoverflow-y');\n if ( UST !== null )\n { overY = UST; }\n convertMCIds = 0;\n UST = tabRoot.getAttribute('data-ustmcids');\n if ( UST !== null ) { convertMCIds = 1; }\n if ( sortId === undefined )\n { sortId = tabRoot.getAttribute('data-ustsort');\n if ( sortId )\n { ix = Number( sortId, 10 );\n if ( ! isNaN( ix )) { sortId = ix; }\n }\n }\n if ( height === undefined )\n { UST = tabRoot.getAttribute('data-ustheight');\n } else\n { UST = height;\n }\n UST = Number( UST );\n if ( isNaN( UST ))\n { height = 0;\n } else\n { height = UST;\n }\n if ( width === undefined )\n { UST = tabRoot.getAttribute('data-ustwidth');\n } else\n { UST = width;\n }\n UST = Number( UST );\n if ( isNaN( UST ))\n { width = 0;\n } else\n { width = UST;\n }\n UST = window.getComputedStyle( tabRoot, null ).maxWidth;\n if ( UST.substring( UST.length - 2 ) === \"px\")\n { UST = Number( UST.substring( 0, UST.length - 2 ), 10 );\n if ( ! isNaN( UST ))\n { maxWidth = UST;\n }\n }\n\n /* divRoot will be the container for all 3 copies of the table. */\n parent.insertBefore( divRoot, tabRoot );\n /* divMC will be the container for the scrollable table but first we use\n it as a scratch pad to learn some things about the browser (scrollbar\n sizes) and table (the natural width & height; called maximum width for\n the two-pass auto-sizing algorithm for tables in HTML 4.01). */\n divRoot.appendChild( divMC );\n divMC.style.overflowX = 'scroll';\n divMC.style.overflowY = 'scroll';\n divMC.style.position = 'absolute';\n divMC.appendChild( tabRoot );\n tabRoot.style.width = \"\";\n tabRoot.style.height = \"\";\n\n /* calculate the size of scrollbars */\n divRoot.style.overflow = 'scroll';\n\n divMC.style.width = maxWidth + \"px\";\n\n divRoot.style.width = \"100px\";\n divRoot.style.height = \"100px\";\n scrollWidth = divRoot.offsetWidth - divRoot.clientWidth; \n scrollHeight = divRoot.offsetHeight - divRoot.clientHeight;\n divRoot.style.width = \"\";\n divRoot.style.height = \"\";\n divRoot.style.overflow = 'hidden';\n divRoot.style.position = 'relative';\n divRoot.style.align = 'left';\n\n /* precalculate size of table: divMC, presently being given a huge size,\n allows the table to format to its natural size.\n */\n naturalWidth = tabRoot.offsetWidth;\n naturalHeight = tabRoot.offsetHeight;\n if ( sortId )\n { naturalWidth += 25;\n }\n\n /* find all the interesting pieces of the main content,\n and make <div>s for the header and footer, if needed. */\n tHeadMC = tabRoot.getElementsByTagName('thead')[ 0 ];\n if ( tHeadMC ) { thMC = getGrandChildThList( tHeadMC ); }\n tBodyMC = tabRoot.getElementsByTagName('tbody')[ 0 ];\n tFootMC = tabRoot.getElementsByTagName('tfoot')[ 0 ];\n if ( tHeadMC !== undefined )\n { iy = document.createElement('div');\n iy.style.position = 'absolute';\n divRoot.appendChild( iy );\n divHR = document.createElement('div');\n divHR.style.position = 'static';\n divHR.style.overflow = 'hidden';\n divHR.style.zIndex = '10';\n iy.appendChild( divHR );\n\n tabHR = tabRoot.cloneNode( true );\n tabHR.style.position = 'relative';\n divHR.appendChild( tabHR );\n iy = divHR.getElementsByTagName('table')[ 0 ];\n iy.removeAttribute('id');\n tHeadHR = divHR.getElementsByTagName('thead')[ 0 ];\n thHR = getGrandChildThList( tHeadHR );\n thMC = getGrandChildThList( tHeadMC );\n /* zap or convert all the thMC th ids so there is only one copy in thHR */\n for ( ix = 0; ix < thMC.length; ix++ )\n { iy = thMC[ ix ];\n if ( convertMCIds )\n { if ( iy.id )\n { iy.id = iy.id + \"MC\";\n }\n } else\n { iy.removeAttribute('id');\n }\n }\n }\n if ( tFootMC !== undefined )\n { iy = document.createElement('div');\n iy.style.position = 'absolute';\n divRoot.appendChild( iy );\n divFR = document.createElement('div');\n divFR.style.position = 'static';\n divFR.style.overflow = 'hidden';\n divFR.style.zIndex = '10';\n iy.appendChild( divFR );\n\n tabFR = tabRoot.cloneNode( true );\n tabFR.style.position = 'relative';\n divFR.appendChild( tabFR );\n iy = divFR.getElementsByTagName('table')[ 0 ];\n iy.removeAttribute('id');\n if ( sortId && divHR !== undefined )\n { /* zap all the thFR th ids so there is only one copy in thHR */\n if ( divHR !== undefined )\n { tHeadFR = divFR.getElementsByTagName('thead')[ 0 ];\n thFR = getGrandChildThList( tHeadFR );\n for ( ix = 0; ix < thFR.length; ix++ )\n { iy = thFR[ ix ];\n iy.removeAttribute('id');\n }\n }\n }\n }\n /* Finish styling the Main Content */\n divMC.onscroll = function()\n { var far = ( -this.scrollLeft ) + 'px';\n if ( tabHR ) { tabHR.style.left = far; }\n if ( tabFR ) { tabFR.style.left = far; }\n };\n\n function calculate()\n { /* calculate window width & height, width & height to use,\n header & footer heights\n */\n windowWidth = document.documentElement.clientWidth;\n windowHeight = document.documentElement.clientHeight;\n if ( window.innerWidth < windowWidth )\n { windowWidth = window.innerWidth;\n }\n iy = document.getElementsByTagName('body')[ 0 ];\n if ( iy.clientWidth < windowWidth )\n { windowWidth = iy.clientWidth;\n }\n if ( window.innerHeight < windowHeight )\n { windowHeight = window.innerHeight;\n }\n if ( width === -2 )\n { widthToUse = windowWidth - scrollWidth;\n } else if ( width === -1 )\n { widthToUse = naturalWidth + scrollWidth;\n } else if ( width <= 0 )\n { if ( naturalWidth + scrollWidth < windowWidth - scrollWidth )\n { widthToUse = naturalWidth + scrollWidth;\n } else\n { widthToUse = windowWidth - scrollWidth;\n }\n } else\n { widthToUse = width;\n }\n tabWidthToUse = widthToUse - scrollWidth;\n if ( withinWindow && widthToUse > windowWidth - scrollWidth )\n { widthToUse = windowWidth - scrollWidth;\n }\n hdrWidthToUse = Math.min( tabWidthToUse, widthToUse - scrollWidth );\n divRoot.style.width = ( hdrWidthToUse + scrollWidth ) + 'px';\n\n tabRoot.style.width = tabWidthToUse + 'px';\n divMC.style.width = widthToUse + 'px';\n if ( divHR )\n { divHR.firstChild.style.width = tabWidthToUse + 'px';\n divHR.style.width = hdrWidthToUse + 'px';\n }\n if ( divFR )\n { divFR.firstChild.style.width = tabWidthToUse + 'px';\n divFR.style.width = hdrWidthToUse + 'px';\n }\n\n /* Obtain the calculated header & footer heights */\n UST = tabRoot.getBoundingClientRect();\n iy = tBodyMC.getBoundingClientRect();\n if ( tHeadMC !== undefined )\n { headerHeight = iy.top - UST.top + 1;\n }\n if ( tFootMC !== undefined )\n { footerHeight = UST.bottom - iy.bottom + 1;\n }\n\n /* Calculate the height */\n ix = UST.bottom - UST.top;\n if ( height <= 0 )\n { heightToUse = windowHeight - scrollHeight;\n if ( windowHeight - UST.top >= 100 + headerHeight + footerHeight + scrollHeight )\n { /* Heuristic: if there are at least 100px left on the screen, for the\n scrolling area, use the remaining screen height as the table height.\n If there is less, use the full screen height, assuming the user must\n scroll down anyway, so then might as well have a full screen of data.\n */\n heightToUse -= UST.top;\n }\n if ( heightToUse >= ix )\n { heightToUse = ix + scrollHeight;\n if ( overY === \"scroll\")\n { divMC.style.overflowY = \"hidden\";\n }\n }\n } else\n { if ( ix < height )\n { heightToUse = ix + scrollHeight;\n } else\n { heightToUse = height;\n }\n }\n scrollHeightToUse = scrollHeight;\n if ( tabRoot.clientWidth > hdrWidthToUse )\n { divMC.style.overflowX = 'scroll';\n } else\n { divMC.style.overflowX = 'hidden';\n heightToUse -= scrollHeight;\n scrollHeightToUse = 0;\n }\n if ( tabRoot.offsetHeight > heightToUse )\n { divMC.style.overflowY = 'scroll';\n } else\n { divMC.style.overflowY = 'hidden';\n }\n divRoot.style.height = heightToUse + 'px';\n divMC.style.height = heightToUse + 'px';\n if ( divHR !== undefined )\n { divHR.style.height = headerHeight + 'px';\n }\n if ( divFR !== undefined )\n { divFR.style.height = footerHeight + 'px';\n divFR.parentNode.style.top = ( heightToUse - footerHeight\n - scrollHeightToUse ) + 'px';\n divFR.scrollTop = divFR.scrollHeight - footerHeight;\n divFR.style.top = ( heightToUse - footerHeight ) + 'px';\n }\n\n if ( withinWindow && width > 0 )\n { if ( widthToUse < windowWidth - scrollWidth )\n { divMC.style.height = heightToUse + 'px';\n } else\n { ix = ( windowWidth - scrollWidth ) + 'px';\n divRoot.style.width = ix;\n divMC.style.width = ix;\n ix -= scrollWidth;\n }\n }\n }\n calculate();\n\n if ( sortId && divHR !== undefined )\n { /* Add an onClick handler to the header rows in thHR that clicks the\n corresponding header in thMC. */\n for ( iy = 0; iy < thHR.length; iy++ )\n { ix = thHR[ iy ];\n ix.onclick = function()\n { var inner;\n var iz = thHR.indexOf( this );\n thMC[ iz ].click();\n\n /* copy headers from MC to HR and FR as needed */\n for ( iz = 0; iz < thMC.length; iz++ )\n { inner = thMC[ iz ].innerHTML;\n thHR[ iz ].innerHTML = inner;\n if ( thFR !== undefined )\n { thFR[ iz ].innerHTML = inner;\n }\n }\n calculate();\n divMC.onscroll();\n };\n }\n /* call init before making this table sortable, to deal with any tables\n that are not also UltimateScrollingTable tables, and to prevent future\n initializations from occurring. */\n sorttable.init();\n tabRoot.classList.add(\"sortable\"); // is this needed?\n sorttable.makeSortable( tabRoot );\n if ( sortId[\"constructor\"] === String )\n { document.getElementById( sortId ).click();\n }\n }\n}", "title": "" }, { "docid": "9291a8b91ac07570176fefc2ec6a7ae7", "score": "0.48699242", "text": "function hasFixedParent(elem)\n{\n\tdo\n\t{\n\t\tif (elem.offsetParent && css(elem.offsetParent, 'position') == 'fixed')\n\t\t{\n\t\t\treturn true;\n\t\t};\n\t}\n\twhile (elem = elem.offsetParent);\n\treturn false;\n}", "title": "" } ]
8d5776aeda1998674caed01f622e90a6
Occurs after application has created all windows.
[ { "docid": "c9cc1f75012ec20f28c628449f3c76c2", "score": "0.0", "text": "onStarted() {\r\n // Stub\r\n }", "title": "" } ]
[ { "docid": "a410381c0c42741722127ef2b4b59945", "score": "0.66304755", "text": "function finalize()\n\t\t\t\t{\n\t\t\t\t\twin.destroy();\n\t\t\t\t}", "title": "" }, { "docid": "10877df5f49ff7eaf0d1be89e9eecdcb", "score": "0.64790064", "text": "function onClosed() {\n\t// dereference the window\n\t// for multiple windows store them in an array\n\tmainWindow = null;\n}", "title": "" }, { "docid": "cb7402ed12faecfd383ac002db7f4958", "score": "0.64567816", "text": "onAllWindowsClosed() {\r\n // Stub\r\n }", "title": "" }, { "docid": "6b7a5d36d40ba8e7d7cdc11d113ab3f9", "score": "0.61882025", "text": "function onReady() {\n if (isDevelopment()) {\n installDevExtensions()\n }\n //setupGolem()\n createWindow()\n tray = createTray(win)\n\n ipcHandler(app, tray, win, createPreviewWindow, APP_WIDTH, APP_HEIGHT)\n}", "title": "" }, { "docid": "e8a0bbfd0ca9dc3420556603f33479e5", "score": "0.6048445", "text": "function windowResized() {\n\tremoveElements();\n\tsetup();\n}", "title": "" }, { "docid": "6e5255318522975c41b90e6991a8417c", "score": "0.5908113", "text": "function WindowsManager () {\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Flag to raise while the main window is open.\r\n\t\t\t * @field\r\n\t\t\t * @private\r\n\t\t\t */\r\n\t\t\tvar isMainWindowOpen = false;\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Returns the default display options for a newly created window.\r\n\t\t\t * @method\r\n\t\t\t * @private\r\n\t\t\t * @return { NativeWindowInitOptions }\r\n\t\t\t * \t\tAn object specifying display options for a new window. \r\n\t\t\t */\r\n\t\t\tfunction getDefWindowOptions () {\r\n\t\t\t\tvar options = new NativeWindowInitOptions();\r\n\t\t\t\toptions.type = NativeWindowType.UTILITY;\r\n\t\t\t\treturn options;\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * Returns the default display boundaries for a newly created \r\n\t\t\t * window.\r\n\t\t\t * @method\r\n\t\t\t * @private\r\n\t\t\t * @return { Rectangle }\r\n\t\t\t * \t\tA rectangle defining the boundaries of this new window.\r\n\t\t\t */\t\t\t\r\n\t\t\tfunction getDefBoundaries () {\r\n\t\t\t\tvar bounds = new Rectangle();\r\n\t\t\t\tbounds.x = Math.max(0, (screen.width-800)/2);\r\n\t\t\t\tbounds.y = Math.max(0, (screen.height-600)/2);\r\n\t\t\t\tbounds.width = 800;\r\n\t\t\t\tbounds.height = 600;\r\n\t\t\t\treturn bounds;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Creates the main window of the application.\r\n\t\t\t * @method\r\n\t\t\t * @public\r\n\t\t\t */\r\n\t\t\tthis.makeMainWindow = function () {\r\n\t\t\t\tvar htmlLoader = HTMLLoader.createRootWindow (\r\n\t\t\t\t\ttrue,\r\n\t\t\t\t\tgetDefWindowOptions(), \r\n\t\t\t\t\tfalse,\r\n\t\t\t\t\tgetDefBoundaries()\r\n\t\t\t\t);\r\n\t\t\t\thtmlLoader.addEventListener('htmlDOMInitialize', function() {\r\n\t\t\t\t\tisMainWindowOpen = true;\r\n\t\t\t\t\tmakeWindowModal (htmlLoader.window, self);\r\n\t\t\t\t\thtmlLoader.window.nativeWindow.addEventListener (\r\n\t\t\t\t\t\t'close',\r\n\t\t\t\t\t\t function() {isMainWindowOpen = false}\r\n\t\t\t\t\t);\r\n\t\t\t\t\tvar event = eventManager.createEvent(\r\n\t\t\t\t\t\tWINDOW_CREATED_EVENT,\r\n\t\t\t\t\t\t{'window': htmlLoader.window}\r\n\t\t\t\t\t);\r\n\t\t\t\t\teventManager.fireEvent(event);\r\n\t\t\t\t});\r\n\t\t\t\thtmlLoader.loadString('&nbsp;');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Makes a window modal to a certain parent window.\r\n\t\t\t * @method\r\n\t\t\t * @private\r\n\t\t\t * @param oWindow { Object Window }\r\n\t\t\t * \t\tThe window to be made modal.\r\n\t\t\t * @param oParentWindow { Object Window }\r\n\t\t\t * \t\tThe parent of the modal window. Any attempt to access the \r\n\t\t\t * \t\tparent while the modal window is open will fail.\r\n\t\t\t */\r\n\t\t\tfunction makeWindowModal (oWindow, oParentWindow) {\r\n\t\t\t\t\r\n\t\t\t\toParentWindow.nativeWindow.addEventListener (\r\n\t\t\t\t\t'closing',\r\n\t\t\t\t\tfunction (event) {\r\n\t\t\t\t\t\t//if (isMainWindowOpen) { event.preventDefault() };\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t\toParentWindow.nativeWindow.addEventListener (\r\n\t\t\t\t\t'displayStateChanging', \r\n\t\t\t\t\tfunction (event) {\r\n\t\t\t\t\t\t//if (isMainWindowOpen) { event.preventDefault() };\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t\toParentWindow.nativeWindow.addEventListener (\r\n\t\t\t\t\t'moving',\r\n\t\t\t\t\tfunction (event) {\r\n\t\t\t\t\t\t//if (isMainWindowOpen) { event.preventDefault() };\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t\toParentWindow.nativeWindow.addEventListener (\r\n\t\t\t\t\t'resizing', \r\n\t\t\t\t\tfunction(event) {\r\n\t\t\t\t\t\t//if(isMainWindowOpen) { event.preventDefault() };\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t\toWindow.nativeWindow.addEventListener(\r\n\t\t\t\t\t'deactivate',\r\n\t\t\t\t\tfunction() {\r\n\t\t\t\t\t\t//oWindow.nativeWindow.activate();\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t\toWindow.nativeWindow.addEventListener(\r\n\t\t\t\t\t'closing',\r\n\t\t\t\t\tfunction(){\r\n\t\t\t\t\t\tvar ev = eventManager.createEvent(BROWSER_UNLOAD_EVENT);\r\n\t\t\t\t\t\teventManager.fireEvent(ev);\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t\t \r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "691d5cc0dd892d193f07b8601819beb1", "score": "0.5857857", "text": "async initialiseWindowEventHandlers() {\n const current = ++initCount;\n\n await this.$nextTick();\n\n if (current !== initCount) {\n return;\n }\n\n this.$store.dispatch('window/initialise');\n }", "title": "" }, { "docid": "00f1f6e567cb24c5498c43b1c8b8eb97", "score": "0.5854972", "text": "function onLoadWindow() {\n\twindow.onbeforeunload = onBeforeUnloadWindow;\n\thandleWindowOpened();\n}", "title": "" }, { "docid": "d31b7ec797cd0bfb977c7ac273ebb51d", "score": "0.58362055", "text": "function qodefOnWindowLoad() {\n\n }", "title": "" }, { "docid": "c4457a077fc075aca6748ff8d950c064", "score": "0.5782356", "text": "function createWindow() {\n var window = new BrowserWindow({title: package.name})\n window.loadURL('file://' + (CONFIG.ui ? path.resolve(__dirname, 'ui.html') : path.resolve(app_path, CONFIG.base_html)), CONFIG.main_window_options || {})\n window.on('closed', () => {\n window = null\n var index = windows.indexOf(null)\n windows = windows.splice(index, 1) //TODO\n if(!windows.length) app.quit()\n })\n windows.push(window)\n}", "title": "" }, { "docid": "b0747b39a6fa5ab9ab0b0a73a37cbffe", "score": "0.5770271", "text": "function handleWindowOpened() {\n\tgConnectButton.addClickEventListener(onClickConnectButton);\n\tgDisconnectButton.addClickEventListener(onClickDisconnectButton);\n\tgClearLedMatrixButton.addClickEventListener(onClickClearLedMatrixButton);\n\tgRefreshLedMatrixButton.addClickEventListener(onClickRefreshLedMatrixButton);\n\tgShowLedMessageButton.addClickEventListener(onClickShowLedMessageButton);\n\tgSendUartRequestButton.addClickEventListener(onClickSendUartRequestButton);\n\tgStartTestScenarioButton.addClickEventListener(onClickStartTestScenarioButton);\n\tgCancelTestScenarioButton.addClickEventListener(onClickCancelTestScenarioButton);\n}", "title": "" }, { "docid": "0f40dcf02b99eac617919b2c5f8307c1", "score": "0.57667243", "text": "function load() {\n app.on('ready', createWindow);\n app.on('window-all-closed', function() {\n if (process.platform !== 'darwin') {\n app.quit();\n }\n });\n app.on('activate', function() {\n if (global.mwin === null) {\n createWindow();\n }\n });\n}", "title": "" }, { "docid": "7e4781a4839f3c9334aad41b157560a3", "score": "0.5750604", "text": "function onWindowClosed() {\n winston.info(\"window closed\");\n\n // dereference the window object\n mainWindow = null;\n}", "title": "" }, { "docid": "55df917e7d3e9578e5d4c4ab1084b8b8", "score": "0.57409453", "text": "onCloseWindow(aAppWindow) {\n let domWindow = aAppWindow.docShell.domWindow;\n let windowType = getWindowTypeOrId(domWindow.document.documentElement);\n mark_action(\"winhelp\", \"onCloseWindow\", [\n getWindowTypeForAppWindow(aAppWindow, true) +\n \" (\" +\n getUniqueIdForAppWindow(aAppWindow) +\n \")\",\n ]);\n if (this.waitingList.has(windowType)) {\n this.waitingList.set(windowType, null);\n }\n }", "title": "" }, { "docid": "6b15ad72ff2f134f87ebea2c61a02e67", "score": "0.56888986", "text": "_onAddApplication() {\n this._showLoader();\n this.$.appscoApplicationAddSettings.addApplication();\n }", "title": "" }, { "docid": "45ea4788cd6c76e62a7f412d8ab06ad4", "score": "0.5676795", "text": "RuntimeContext_postWholeContextInit_setup () {\n const self = this\n // We have to wait until post-whole-context-init to guarantee all controllers exist\n //\n // We'll wait til here to create the window cause it's the thing that generally kicks off booting the application/UI-level controllers in the context.\n // However, we can't wait til those controllers are booted to create the window because they might need\n // to present things like the password entry fields in the UI\n self.create_window_whenAppReady()\n }", "title": "" }, { "docid": "a1a697b7565ade9ae22641bcbc6e71ce", "score": "0.56727374", "text": "function mainWindowClosed() {\n mainWindow = null;\n}", "title": "" }, { "docid": "416d6ef213e0191cbba3ca840a34d100", "score": "0.56564814", "text": "function wait_for_window_close() {\n mark_action(\"fdh\", \"wait_for_window_close\", [\n \"(using window from plan_for_window_close)\",\n ]);\n WindowWatcher.waitForWindowClose();\n}", "title": "" }, { "docid": "2726662981338562493cc160732f3f0d", "score": "0.56226474", "text": "monitorWindowLoad(aAppWindow) {\n this.monitoringList.push(aAppWindow);\n }", "title": "" }, { "docid": "13cd2547e05139fe40abc7b1afb3046f", "score": "0.55972373", "text": "_createWindows() {\r\n\r\n this.browserWindow = new BrowserWindow({\r\n webPreferences: {\r\n nodeIntegration: true,\r\n },\r\n titleBarStyle: 'hidden',\r\n autoHideMenuBar: true,\r\n icon: path.join(__dirname, 'style/icon/logo.png'),\r\n title: `P3E`,\r\n width: 500,\r\n height: 1200\r\n });\r\n\r\n if (this.environment === 'development') {\r\n this.browserWindow.webContents.openDevTools();\r\n }\r\n\r\n this.browserWindow.loadURL(`file://${__dirname}/${this._getEntryPoint()}`);\r\n\r\n /**\r\n * On close browser window\r\n */\r\n this.browserWindow.on('closed', () => {\r\n this.browserWindow = null\r\n })\r\n }", "title": "" }, { "docid": "0a87a12224f1a2b913665876d7bb20c7", "score": "0.5593601", "text": "function windowResized() {\n clear();\n paths = [];\n setup();\n}", "title": "" }, { "docid": "17b8045d58a6f97903629d4cf45829eb", "score": "0.559283", "text": "function destroy_about_win() {\n ipcRenderer.send('home-about', 'destroy_about_win');\n}", "title": "" }, { "docid": "f549ed47593bae7fad4c5eb64248baf6", "score": "0.55894345", "text": "function windowInit() {\n // Quit when all windows are closed (including OSX).\n app.on('window-all-closed', function() {\n app.quit();\n });\n\n // This method will be called when Electron has done all the initialization\n // and should be ready for creating menus & browser windows.\n app.on('ready', function() {\n i18n.init({\n ns: {\n namespaces: ['app', 'menus', 'buttons'],\n defaultNs: 'app'\n },\n resGetPath: appPath + 'locales/__lng__/__ns__-__lng__.json', // Path to find file\n resSetPath: appPath + 'locales/__lng__/__ns__-__lng__.json', // Path to store file\n sendMissingTo: 'fallback|current|all', // Send missing values to\n lng: 'en-US'\n }, function(){\n\n var windowSettings = {\n 'min-width': 680,\n 'min-height': 420,\n width: app.settings.v.window.width,\n height: app.settings.v.window.height,\n resizable: true,\n icon: appPath + \"resources/app.png\",\n title: \"PancakeCreator\"\n };\n\n // Centered or fixed window position?\n if (app.settings.v.window.y === 'center') {\n windowSettings.center = true;\n } else {\n windowSettings.x = app.settings.v.window.x;\n windowSettings.y = app.settings.v.window.y;\n }\n\n // Create the main application window.\n mainWindow = new BrowserWindow(windowSettings);\n\n // Window wrapper for dialog (can't include module outside of this) :P\n mainWindow.dialog = function(options, callback) {\n dialog['show' + options.type](mainWindow, options, callback);\n };\n\n // and load the index.html of the app.\n mainWindow.loadUrl('file://' + __dirname + '/index.html');\n\n\n // Save Move/Resize back to file\n mainWindow.on('move', function(){\n var b = this.getBounds();\n app.settings.v.window.x = b.x;\n app.settings.v.window.y = b.y;\n app.settings.v.window.width = b.width;\n app.settings.v.window.height = b.height;\n app.settings.save();\n });\n\n // Emitted when the window is closed.\n mainWindow.on('closed', function() {\n // Dereference the window object, usually you would store windows\n // in an array if your app supports multi windows, this is the time\n // when you should delete the corresponding element.\n mainWindow = null;\n });\n });\n });\n}", "title": "" }, { "docid": "a953a3055a62d47404e879a7a45b2d27", "score": "0.55845165", "text": "static async handleBringWindowsToFront(trace) {\n const windowList = (await workspaceManager_1.WorkspaceManager.getActiveWorkspace(trace)).windows;\n return new Promise((resolve) => {\n launcherClient_1.default.bringWindowsToFront({ windowList }, resolve);\n });\n }", "title": "" }, { "docid": "9a89b23c9ebc961ea733fb2eae381f99", "score": "0.5548587", "text": "function cleanup()\n{\n debug.close();\n\n for (var i in child_windows)\n child_windows[i].close();\n}", "title": "" }, { "docid": "b292aee8b4bb86159604892716ebc275", "score": "0.55228", "text": "function qodeOnWindowLoad() {\n }", "title": "" }, { "docid": "b292aee8b4bb86159604892716ebc275", "score": "0.55228", "text": "function qodeOnWindowLoad() {\n }", "title": "" }, { "docid": "7926dd32b77698f5b19470efc5881905", "score": "0.55189425", "text": "function startup(data, reason) {\n // Shift all open and new browser windows\n watchWindows(shiftBrowser);\n}", "title": "" }, { "docid": "da7caf992b1157a1bf3d56fe33aa713a", "score": "0.5511896", "text": "after() {\n // Fix whitescreen bug on build with Electron BrowserWindow\n exec('electron . --dev');\n }", "title": "" }, { "docid": "98e1011ec6eda7bc51c22c00a38ec28d", "score": "0.55094624", "text": "function createAddWindow(){\n\n //create a new window\n addWindow = new BrowserWindow({\n width:300,\n height:200,\n title:'Add Shopping Item',\n webPreferences: {\n nodeIntegration: true,\n contextIsolation: false,\n }\n });\n\n //load html file into window\n addWindow.loadURL(url.format({\n pathname:path.join(__dirname,'addWindow.html'),\n protocol:'file:',\n slashes:true\n }));\n\n addWindow.on('close',function(){\n \n addWindow = null;\n\n });\n\n\n}", "title": "" }, { "docid": "df5f304d8bfa962f46a83ff217c5177d", "score": "0.5501376", "text": "function createAddWindow(){\n add_item_win = new BrowserWindow({\n width: 450,\n height: 250,\n })\n add_item_win.loadURL(url.format({\n pathname: path.join(__dirname, 'add_item_win.html'),\n protocol: 'file:'\n }))\n add_item_win.on('close',()=>{\n add_item_win = null;\n })\n}", "title": "" }, { "docid": "c0790e5b033c920719a5cf6b299c1bf1", "score": "0.5491035", "text": "function createWindow() {\n var defaults = {\n show: false,\n frame: false\n }\n\n\n window = new BrowserWindow(defaults)\n\n positioner = new Positioner(window)\n\n window.on('blur', function () {\n alwaysOnTop ? '' : hideWindow()\n })\n\n if (showOnAllWorkspaces !== false) {\n window.setVisibleOnAllWorkspaces(true)\n }\n\n window.on('close', windowClear)\n window.loadURL(index)\n}", "title": "" }, { "docid": "179103ce584364f53782dabeb69061ff", "score": "0.54834914", "text": "function addWaiter() {\n let aboutWindow = new BrowserWindow({\n parent: mainWindow,\n modal: true,\n show: false,\n width: 1000,\n height: 650,\n icon: path.join(__dirname, 'assets/icon/icon.ico'),\n })\n aboutWindow.loadURL(url.format({\n pathname: path.join(__dirname, 'addwaiter.html'),\n protocol: 'file:',\n slashes: true\n }))\n aboutWindow.setMenu(null)\n aboutWindow.once('ready-to-show', () => {\n aboutWindow.show()\n })\n}", "title": "" }, { "docid": "b3006aeb2bb79c54ad38a2b83553ac70", "score": "0.54820263", "text": "function createAddWindow(){\n //create new main window\n addWindow = new BrowserWindow({\n width:300,\n height:400,\n title:'Start Scanner'\n });\n // Load our HTML file into window\n addWindow.loadURL(url.format({\n pathname: path.join(__dirname, 'addWindow.html'),\n protocol:'file',\n slashes: true\n })); //flie://direname/mainWindow.html\n \n //Garbage collection handle\n addWindow.on('close', function(){\n addWindow = null;\n });\n}", "title": "" }, { "docid": "98e3d908a7fd9b574858092cd6b53fec", "score": "0.54756236", "text": "function plan_for_window_close(aController) {\n mark_action(\"fdh\", \"plan_for_window_close\", [\n getWindowTypeForAppWindow(aController.window, true),\n ]);\n WindowWatcher.ensureInited();\n WindowWatcher.planForWindowClose(aController.window);\n}", "title": "" }, { "docid": "2f44c9c5943b6a76c90a47b6493a153f", "score": "0.5465827", "text": "onWindowOpened(window) {\n if (window.gInitialPages && !window.gInitialPages.includes(aboutNewTabService.newTabURL)) {\n window.gInitialPages.push(aboutNewTabService.newTabURL);\n }\n }", "title": "" }, { "docid": "bbc078f06c7884b45d000a9752fa11b7", "score": "0.54654086", "text": "function refresh(){\n\tif(useWindowManagement && isDone){\n\t\t//post(\"wins: loadMyWindowDict()...\\n\");\n\t\tloadMyWindowDict(); //some data is maintained on managment side\n\t\t//post(\"wins: saveMyWindowDict()...\\n\");\n\t\tsaveMyWindowDict(); //some data is maintained on window side\n\t}\n\t//post(\"wins: .. reset done\\n\");\n}", "title": "" }, { "docid": "a75415aa6b3453f4883aca47a6f67bc8", "score": "0.54457396", "text": "function newBrowserWindowCreated(event, createdWindow) {\n createdWindow.webContents.on('dom-ready', () => {\n checkIfAuth(createdWindow);\n });\n}", "title": "" }, { "docid": "4901b4a376aa849c1de0871172cacbf5", "score": "0.54387146", "text": "function ResizeWindowHandler() {\n \n console.log(\"***** LocalAdjustWindow() called. *****\");\n \n canvas = document.getElementById(\"canvas\");\n ctx = canvas.getContext(\"2d\");\n\n AdjustToNewWindowSize(canvas, ctx);\n }", "title": "" }, { "docid": "caf5fa07b7749ce0171b14b16337f9bf", "score": "0.54356736", "text": "function createWindow() {\n log.info(\"createWindow function starting\");\n win = new BrowserWindow({\n width: 350,\n height: 600,\n minHeight: 250,\n minWidth: 200,\n titleBarStyle: \"hiddenInset\",\n frame: false,\n webPreferences: { nodeIntegration: true, enableRemoteModule: true },\n icon: image,\n });\n log.info(\"window created\");\n win.setMenuBarVisibility(false);\n log.info(\"setMenuBarVisibility to false\");\n //Set position of the main window\n // const { width, height } = screen.getPrimaryDisplay().workAreaSize;\n // log.info(\"Got width and height of screen\");\n // const calcWidth = (width * 3) / 4 - 175;\n // log.info(\"Calculated width\");\n // const calcHeight = height - 700;\n // log.info(\"Calculated height\");\n // // win.setPosition(calcWidth, calcHeight);\n // log.info(\"Set position\");\n // and load the index.html of the app.\n win.loadURL(\"https://knockknockchat-a47de.web.app/\", { userAgent: \"Chrome\" });\n log.info(\"Loaded URL\");\n\n //TODO: Solve max listeners bug\n process.setMaxListeners(0);\n log.info(\"Set listeners\");\n\n // On close, hide instead of close\n win.on(\"close\", (event) => {\n if (!quitting) {\n console.log(event);\n event.preventDefault();\n win.hide();\n }\n });\n log.info(\"Set on close function\");\n log.info(\"Now returning window\");\n return win;\n}", "title": "" }, { "docid": "b75d63942940678987260c3407f69a4e", "score": "0.5432776", "text": "function mkdfOnWindowLoad() {\n }", "title": "" }, { "docid": "b75d63942940678987260c3407f69a4e", "score": "0.5432776", "text": "function mkdfOnWindowLoad() {\n }", "title": "" }, { "docid": "a382e1f5e1b6932bca88545e7de6ed4e", "score": "0.5424927", "text": "createNewWindow () {\n this.dispatch(Keys.createNewWindow)\n }", "title": "" }, { "docid": "c9e69c8f218c7b8175a8d7ab62c3bc9d", "score": "0.54235053", "text": "function createWindow() {\r\n\twin = new BrowserWindow({\r\n\t\ttitle: \"CD Toolbox\"\r\n\t\t, show: true //##\tHide till it's ready to show\t##//\r\n\t\t, backgroundColor: '#a1af6c' //##\tPrevent white flash during load/page change\t##//\r\n\t\t, width: 1050\r\n\t\t, height: 650\r\n\t\t, webPreferences: { webSecurity: false }\r\n\t});\r\n\t//##\tloadFile for relative path\t##//\r\n\twin.loadFile('index.html');\r\n\r\n\t//##\tRelease resources when closed\t##//\r\n\twin.on('closed', () => {\r\n\t\t\twin = null;\r\n\t\t})\r\n\t\t//##\tHandle Crashes\t##/\r\n\twin.webContents.on('crashed', () => {\r\n\t\tconst options = {\r\n\t\t\ttype: 'info'\r\n\t\t\t, title: 'Renderer Process Crashed'\r\n\t\t\t, message: 'This process has crashed.'\r\n\t\t\t, buttons: ['Reload', 'Close']\r\n\t\t};\r\n\t\tdialog.showMessageBox(options, (index) => {\r\n\t\t\tif (index === 0) win.reload();\r\n\t\t\telse win.close();\r\n\t\t});\r\n\t});\r\n\t//##\tWait till dom is loaded before opening window\t##//\r\n\twin.on('ready-to-show', function () {\r\n\t\t//win.show();\r\n\t\twin.focus();\r\n\t});\r\n\r\n\twin.on('close', function (e) {\r\n\t\t\r\n\t\tif (allowclose == false) {\r\n\t\t\tconsole.log('closing');\r\n\t\t\te.preventDefault();\r\n\t\t\tallowclose = true;\r\n\t\t\twin.webContents.send('info', {\r\n\t\t\t\tmsg: 'hello from main process'\r\n\t\t\t});\r\n\t\t}\r\n\t\tsetTimeout(function () {\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\twin.close();\r\n\t\t\t}\r\n\t\t\tcatch (err)\r\n\t\t\t{}\r\n\t\t}, 100);\r\n\t});\r\n\t\r\n\t//##\tHandle Hanging - temporarily disabled\t##//\r\n\t/*win.on('unresponsive', () => {\r\n\t const options = {\r\n\t type: 'info',\r\n\t title: 'Renderer Process Hanging',\r\n\t message: 'This process is hanging.',\r\n\t buttons: ['Reload', 'Wait', 'Close']\r\n\t }\r\n\t dialog.showMessageBox(options, (index) => {\r\n\t \tif (index === 0) {win.reload()}\r\n\t \telse if (index === 1) {}\r\n\t \telse {win.close()}\r\n\t })\r\n\t})*/\r\n\r\n}", "title": "" }, { "docid": "a95f1b361e40ab31d52b5ac215cb218e", "score": "0.5415828", "text": "disconnectedCallback() {\n if (!this.application.isDestroyed && !this.application.isDestroying) {\n this.application.destroy()\n }\n }", "title": "" }, { "docid": "a8660f37552a4544a0910bd8c7d9b791", "score": "0.5415335", "text": "async activateHandler() {\n log.debug('Activating window.');\n if (!this.wm.hasWindow) {\n await this.wm.open();\n } else {\n this.wm.restoreLast();\n }\n }", "title": "" }, { "docid": "99d860366bad9e0bfe0f835de59a9560", "score": "0.5399231", "text": "initializeWindow(params, cb) {\n this.registerWithDocking(params, () => {\n routerClientInstance_1.default.publish(\"Finsemble.\" + this.windowName + \".componentReady\", {\n name: this.windowName\n });\n });\n }", "title": "" }, { "docid": "c967a604bd4349ec812d16e716d536fb", "score": "0.53987354", "text": "click() { createAddWindow(300, 300); }", "title": "" }, { "docid": "50df3c000de45ab1406621de52b19ee0", "score": "0.5391523", "text": "function finishInitApp ()\n {\n\tinitFormContents();\n\t\n\tvar init_box = myGetElement(\"db_initmsg\");\n\tif ( init_box ) init_box.style.display = 'none';\n\t\n\tno_update = 1;\n\t\n\ttry {\n\t checkTaxon();\n\t checkTaxonStatus();\n\t checkInterval();\n\t checkCC();\n\t checkCoords();\n\t checkStrat();\n\t checkEnv();\n\t checkMeta('specs');\n\t checkMeta('occs');\n\t checkMeta('colls');\n\t checkMeta('taxa');\n\t checkMeta('occs');\n\t checkMeta('refs');\n\t}\n\n\tcatch (err) { };\n\t\n\tno_update = 0;\n\t\n\tupdateFormState();\n }", "title": "" }, { "docid": "29d85a18adbf1c12e59439f37e0620c5", "score": "0.5370544", "text": "function mainWindowCloseCallback() {\n logger.silly(\"Closing main window\");\n\n // Save the sizes of the window\n const size = mainWindow.getSize();\n store.set(\"main-width\", size[0]);\n store.set(\"main-height\", size[1]);\n\n // Check is the window is maximized\n store.set(\"main-maximized\", mainWindow.isMaximized());\n mainWindow = null;\n}", "title": "" }, { "docid": "fda21123957d898ca649bcba21a566ce", "score": "0.5361963", "text": "function cpsh_onQuit(evt) {\n evt.preventDefault();\n quitAppConfirmDialog.hidden = true;\n WapPushManager.close();\n }", "title": "" }, { "docid": "226cac8a3580d92ebf23e27e47eac465", "score": "0.535303", "text": "_listenToDispatchWindow() {\n for (let w = 0; w < this.workspaceManager.n_workspaces; w++) {\n let workspace = this.workspaceManager.get_workspace_by_index(w);\n this.listenWorkspaceEventToDispatch(workspace);\n }\n\n this.signals.push({\n from: this.workspaceManager,\n id: this.workspaceManager.connect(\n 'workspace-added',\n (_, workspace) => {\n this.listenWorkspaceEventToDispatch(workspace);\n }\n )\n });\n\n this.signals.push({\n from: global.display,\n id: global.display.connect(\n 'window-entered-monitor',\n (display, monitorIndex, window) => {\n //Ignore unHandle window and window on primary screens\n global.superWorkspaceManager.windowEnteredMonitor(\n window,\n monitorIndex\n );\n }\n )\n });\n\n this.signals.push({\n from: global.display,\n id: global.display.connect(\n 'window-left-monitor',\n (display, monitorIndex, window) => {\n /* \n //Ignore unHandle window and window on primary screens\n global.superWorkspaceManager.windowLeftMonitor(\n window,\n monitorIndex\n ); */\n }\n )\n });\n }", "title": "" }, { "docid": "f68e92dccdb9363a0076d66649978b20", "score": "0.535012", "text": "function onWindowReady(fn) {\n // Catch cases where onWindowReady is called after \n // the browser event has already occurred.\n if (doc[READYSTATE] === COMPLETE) {\n fn();\n } else {\n var _fn = function() {\n removeEvent(win, LOAD, _fn);\n fn();\n };\n addEvent(win, LOAD, _fn);\n } \n }", "title": "" }, { "docid": "9ecf6d30231534443b635064817fd742", "score": "0.5349682", "text": "function onOpenPartyCreationWindow()\n\t{\n\t\tif (PartyHelper.__active && PartyHelper.getType() === PartyHelper.Type.CREATE) {\n\t\t\tPartyHelper.remove();\n\t\t\treturn;\n\t\t}\n\n\t\tPartyHelper.append();\n\t\tPartyHelper.setType(PartyHelper.Type.CREATE);\n\t}", "title": "" }, { "docid": "2816012db85eefdc1d088236022d74bd", "score": "0.5339481", "text": "activated() {\n this.initResizeEvent();\n this.initSidebarResizeEvent();\n }", "title": "" }, { "docid": "cf25c7d00b73fb5df125b9ac4e5f17fc", "score": "0.532395", "text": "function all_done() {\r\n\tconsole.log('\\n------------------------------------------ All Done ------------------------------------------\\n');\r\n\tbroadcast_state('register_owners', 'success');\r\n\tprocess.env.app_first_setup = 'no';\r\n\r\n\tws_server.check_for_updates(null);\t\t\t\t\t\t\t\t\t//call the periodic task to get the state of everything\r\n}", "title": "" }, { "docid": "bc183cb6473053117bcec82f1a402f43", "score": "0.5323366", "text": "function listenerCreated() {\n if (!(listenerCnt++)) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }", "title": "" }, { "docid": "4ef3f2fe0a333c668c8b80c91e10478d", "score": "0.5321878", "text": "_activateAllWindows() {\n // First activate first window so workspace is switched if needed.\n // We don't do this if isolation is on!\n if (!Docking.DockManager.settings.get_boolean('isolate-workspaces') &&\n !Docking.DockManager.settings.get_boolean('isolate-monitors'))\n this.app.activate();\n\n // then activate all other app windows in the current workspace\n let windows = this.getInterestingWindows();\n let activeWorkspace = global.workspace_manager.get_active_workspace_index();\n\n if (windows.length <= 0)\n return;\n\n let activatedWindows = 0;\n\n for (let i = windows.length - 1; i >= 0; i--) {\n if (windows[i].get_workspace().index() == activeWorkspace) {\n Main.activateWindow(windows[i]);\n activatedWindows++;\n }\n }\n }", "title": "" }, { "docid": "b5261bbd4a113e49d2385660de130d39", "score": "0.5304903", "text": "function init() {\n clearConsole();\n cleanup();\n clearTimeout();\n readProperties();\n createFrameSlots();\n createWindow();\n log(\"Initializing app...\");\n}", "title": "" }, { "docid": "2263c9b2afc9b7e4109567a5c6c0e608", "score": "0.5302779", "text": "function createWindow () {\n // Create a BrowserWindow object\n mainWindow = new BrowserWindow({\n title: 'little shutdown program',\n titleBarStyle: 'hidden',\n backgroundColor: '#c9329e',\n minWidth: 550,\n minHeight: 550,\n width: 550,\n height: 550,\n x: 0,\n y: 0,\n frame: false,\n fullscreen: false,\n show: false,\n icon: path.join(__dirname, 'icon.ico'),\n center: true\n })\n\n // Load the 'index.html' file in the window\n mainWindow.loadURL(\n url.format({\n pathname: path.join(__dirname, 'index.html'),\n protocol: 'file:',\n slashes: true\n })\n )\n\n // Uncomment for instant debugging (from start open dev tools)\n // mainWindow.webContents.openDevTools()\n\n // The renderer process has rendered the page for the first time\n mainWindow.on('ready-to-show', () => {\n // show window\n mainWindow.show()\n // focus window\n mainWindow.focus()\n })\n\n // Window was closed\n mainWindow.on('closed', () => {\n // Dereference the window object\n mainWindow = null\n })\n}", "title": "" }, { "docid": "df7898a5124b5faf9ecad4778e76f149", "score": "0.5301315", "text": "function createAddWindow() {\n //Create new window\n addWindow = new BrowserWindow({\n width: 600,\n height: 800,\n title: \"Dodaj test\"\n });\n //Load html into window\n addWindow.loadURL(\n url.format({\n pathname: path.join(__dirname, \"addWindow.html\"),\n protocol: \"file:\",\n slashes: true\n })\n );\n //Garbage collection handle\n addWindow.on(\"close\", function() {\n addWindow = null;\n });\n}", "title": "" }, { "docid": "c859c5ee15204727e084986a1d74b4e6", "score": "0.52994496", "text": "function createAddWindow() {\n addWindow = new BrowserWindow({\n width: 300,\n height: 200,\n title: 'Add New Todo'\n });\n addWindow.loadURL(`file://${__dirname}/add.html`);\n addWindow.on('closed', () => addWindow = null); //sets value of addWindow to null to free up memory\n}", "title": "" }, { "docid": "a92e92ad7947cc24c57405f9d6d4a63a", "score": "0.52949685", "text": "function startApplication() {\n initialiseColorWell();\n initialiseGridSizeControl();\n initialiseColorToggle();\n deleteGrid();\n makeGrid(gridSize);\n}", "title": "" }, { "docid": "652e4c017a18e69f5ddc022986088c7b", "score": "0.5294023", "text": "handleWin() {\n this.reset();\n\n if (!this._controls instanceof ProgrammaticControls) {\n this.start();\n }\n }", "title": "" }, { "docid": "22d977798707dc15c61f40451fce3d01", "score": "0.5292522", "text": "function cleanup(window, prebootData) {\n prebootData = prebootData || {};\n var listeners = prebootData.listeners || [];\n // set focus on the active node AFTER a small delay to ensure buffer switched\n setTimeout(function () {\n setFocus(prebootData.activeNode);\n }, 1);\n // remove all event listeners\n for (var _i = 0, listeners_1 = listeners; _i < listeners_1.length; _i++) {\n var listener = listeners_1[_i];\n listener.node.removeEventListener(listener.eventName, listener.handler);\n }\n // remove the freeze overlay if it exists\n removeOverlay(window);\n // finally clear out the data stored for each app\n prebootData.apps = [];\n clientNodeCache = {};\n }", "title": "" }, { "docid": "22d977798707dc15c61f40451fce3d01", "score": "0.5292522", "text": "function cleanup(window, prebootData) {\n prebootData = prebootData || {};\n var listeners = prebootData.listeners || [];\n // set focus on the active node AFTER a small delay to ensure buffer switched\n setTimeout(function () {\n setFocus(prebootData.activeNode);\n }, 1);\n // remove all event listeners\n for (var _i = 0, listeners_1 = listeners; _i < listeners_1.length; _i++) {\n var listener = listeners_1[_i];\n listener.node.removeEventListener(listener.eventName, listener.handler);\n }\n // remove the freeze overlay if it exists\n removeOverlay(window);\n // finally clear out the data stored for each app\n prebootData.apps = [];\n clientNodeCache = {};\n }", "title": "" }, { "docid": "bf5be2bf97a9acdbbef4d663724c4663", "score": "0.52917886", "text": "async function loadEventHandlers() {\n\n const handlediag = (index) => {\n if (index === 0) {\n mainWindow.reload();\n } else {\n invokeClosingEvents();\n }\n }\n\n // handles the crashed event\n await mainWindow.webContents.on(config.events.CRASHED, () => {\n dialog.showMessageBox(mainWindow, config.crashedDialogSettings, handlediag(index));\n });\n\n // Emitted when an unresponsive event occurs\n await mainWindow.on(config.events.UNRESPONSIVE, () => {\n dialog.showMessageBox(mainWindow, config.unresponsiveDialogSettings, handlediag(index));\n });\n\n // Emitted when an exception occurs (error handling)\n await process.on(config.events.UNCAUGHT_EXCEPTION, () => {\n dialog.showErrorBox(\n config.errorBoxSettings.title,\n config.errorBoxSettings.content\n );\n invokeClosingEvents();\n });\n\n // Emitted when the window is closed.\n await mainWindow.on(config.events.CLOSED, () => {\n // Dereference the window object, usually you would store windows\n // in an array if your app supports multi windows, this is the time\n // when you should delete the corresponding element.\n app.removeAllListeners();\n mainWindow.removeAllListeners();\n updater.removeUpdateListeners();\n config.errorUrl = null;\n config.events = null;\n config.updateEvents = null;\n config.env = null;\n mainWindow = null;\n if (typeof global.gc !== 'undefined') {\n global.gc();\n }\n });\n\n await mainWindow.webContents.on(config.events.DID_FAIL_LOAD, (event, errorCode, errorDescription) => {\n event.preventDefault();\n if (errorDescription === 'ERR_INTERNET_DISCONNECTED') {\n renderer.getErrorWindow(mainWindow);\n }\n });\n\n await mainWindow.webContents.on(config.events.WILL_PREVENT_UNLOAD,\n (event) => {\n const choice = dialog.showMessageBox(mainWindow,\n config.preventUnloadSettings)\n const leave = choice === 0;\n if (leave) {\n event.preventDefault()\n }\n });\n\n await mainWindow.on(config.events.RESPONSIVE, () => {\n mainWindow.reload();\n });\n\n // Quit when all windows are closed.\n await app.on(config.events.WINDOW_ALL_CLOSED, () => {\n if (process.platform !== config.env.DARWIN) {\n app.quit();\n }\n });\n\n mainWindow.on(config.events.PAGE_TITLE_UPDATED, (event) => {\n event.preventDefault();\n })\n\n await app.on(config.events.ACTIVATE, () => {\n // On OS X it's common to re-create a window in the app when the\n // dock icon is clicked and there are no other windows open.\n if (mainWindow === null) {\n createWindow();\n }\n });\n\n await app.on(config.events.WILL_QUIT, () => {\n globalShortcut.unregisterAll();\n });\n\n await mainWindow.once(config.events.READY_TO_SHOW, () => {\n mainWindow.show();\n });\n\n const invokeClosingEvents = () => {\n app.emit(config.events.WILL_QUIT);\n app.emit(config.events.CLOSED);\n app.quit();\n };\n\n}", "title": "" }, { "docid": "6e2d0e5078b9701cea656de7a500e54f", "score": "0.5289838", "text": "function listenerCreated() {\n listenerCnt += 1;\n if (listenerCnt === 1) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }", "title": "" }, { "docid": "4cd28587317a9d045fa910d0ed1560b3", "score": "0.5286523", "text": "function startupRoutine() {\n // Get screen (display) object\n screen = electron.screen;\n\n // Localize (set i18n stuff)\n localize();\n\n // Set menu\n createMenu();\n\n // Creates window\n mainWindow = new BrowserWindow({\n title: appName,\n height: 700,\n width: 900,\n center: true,\n titleBarStyle: 'hidden',\n icon: Path.join(__dirname, 'gfx', 'app-icon.png'),\n skipTaskbar: conf.get('general.mode') === 'tray',\n });\n\n // Open DevTools and maximize in debug mode\n if (debug) {\n mainWindow.openDevTools();\n mainWindow.maximize();\n }\n\n /* In case of closing main window */\n mainWindow.on('close', () => {\n app.quit();\n });\n\n startApp();\n}", "title": "" }, { "docid": "b94ee19d424cbe1e2df4b5798719860d", "score": "0.52853954", "text": "onExitRequested() {}", "title": "" }, { "docid": "723fec1d7bde190212bdb9197c508d41", "score": "0.52758586", "text": "_onWorkspaceAdded() {\n this._updateSize();\n this._redisplay();\n }", "title": "" }, { "docid": "9eaeb035cdf0da8c12e4ce4ec07efb22", "score": "0.527408", "text": "function qodeOnWindowLoad() {\n qodeInitElementorAnimationHolder();\n }", "title": "" }, { "docid": "09c5b5e674b182290ad5ac9730dd3298", "score": "0.5272572", "text": "function getWindows() {\n\t\t\tchrome.windows.getAll({populate : true}, closeWindows);\n\t\t}", "title": "" }, { "docid": "b49220d824fd8bd0765f27a7ed1e9c84", "score": "0.52713776", "text": "function createWindow() {\n\n global.mwin = new BrowserWindow({\n width: 800,\n height: 600,\n show: false\n });\n global.mwin.setMenu(null);\n global.mwin.hide();\n globalShortcut.register('CommandOrControl+W', () => {\n app.quit();\n });\n globalShortcut.register('CommandOrControl+I', () => {\n global.mwin.openDevTools();\n });\n global.mwin.loadURL(url.format({\n pathname: path.join(__dirname, 'web_frontend/pages/slave.html'),\n protocol: 'file:',\n slashes: true\n }));\n global.mwin.on('closed', function() {\n global.mwin = null;\n });\n global.mwin.webContents.on('did-finish-load', function() {\n global.mwin.show();\n });\n global.mwin.setAlwaysOnTop(true);\n global.mwin.on(\"blur\", () => {\n global.mwin.focus();\n global.mwin.webContents.focus();\n });\n global.mwin.on(\"show\", () => {\n global.mwin.maximize();\n global.mwin.setFullScreen(true);\n for (var i = 0; i < global.config.slaves.length; i++) {\n if (global.config.slaves[i].class != global.config.class) {\n slaves[i] = global.config.slaves[i];\n slaves[i].pile = [];\n }\n }\n foreverConnect();\n });\n}", "title": "" }, { "docid": "1ad3cff5c81cd5f0622abaffa9e2a593", "score": "0.5251897", "text": "function createWindow() {\n // Create the browser window.\n mainWindow = new BrowserWindow_({\n width: 800,\n height: 600\n // show: false\n })\n // and load the index.html of the app.\n mainWindow.loadURL(url_.format({\n pathname: path_.join(__dirname, 'index.html'),\n protocol: 'file:',\n slashes: true\n }))\n\n mainWindow.webContents.openDevTools()\n require('devtron').install()\n\n mainWindow.on('closed', function () {\n // Dereference the window object, usually you would store windows\n // in an array if your app supports multi windows, this is the time\n // when you should delete the corresponding element.\n mainWindow = null\n })\n\n\n}", "title": "" }, { "docid": "d7e679b461e1dcd4c6bd27b95223b9a7", "score": "0.52505875", "text": "function addListenerOnClose() {\n\tchrome.windows.onRemoved.addListener(winId => {\n\t\tchrome.windows.getAll(windows => {\n\t\t\t// Close the extension if it is the only window left and save statistics\n\t\t\tif (windows.length == 1 && windowId == windows[0].id) {\n\t\t\t\tchrome.storage.sync.set({\n\t\t\t\t\tdailyCounts: dailyCounts,\n\t\t\t\t\tlastUse: lastUse,\n\t\t\t\t\ttodayCount: todayCount\n\t\t\t\t}, res => {\n\t\t\t\t\tchrome.windows.remove(windowId);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "cbea296aa3ff9f72e51e91838462bd68", "score": "0.5250369", "text": "function createWindow() {\n //Create the home dir if it doesn't exist\n if (!fs.existsSync(_APPHOME_)) {\n fs.mkdir(_APPHOME_, \"0777\", function() {\n return;\n });\n }\n //Set the app icon\n var appIcon = new Tray(path.join(__dirname, \"/../build/icon.png\"));\n\n const menu = Menu.buildFromTemplate(template());\n Menu.setApplicationMenu(menu);\n log.info(\"backend loaded\");\n log.info(\"creating new window\");\n mainWindow = new BrowserWindow({\n width: 900,\n height: 900,\n resizable: false,\n icon: path.join(__dirname, \"/../build/icon.png\"),\n webPreferences: {\n nodeIntegration: false,\n preload: __dirname + \"/resources/preload.js\"\n }\n });\n\n mainWindow.loadURL(\n process.env.ELECTRON_START_URL ||\n url.format({\n pathname: path.join(__dirname, \"/../build/index.html\"),\n protocol: \"file:\",\n slashes: true\n })\n );\n\n // Open the DevTools.\n //mainWindow.webContents.openDevTools();\n\n mainWindow.on(\"closed\", () => {\n mainWindow = null;\n });\n}", "title": "" }, { "docid": "8ff8fa73e3f52e7a1684f757d5a8991c", "score": "0.52472156", "text": "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight);\r\n screens.currentScreen.resizeElt();\r\n}", "title": "" }, { "docid": "f15cb09106b956e27a45fc6fd0e2996d", "score": "0.5246388", "text": "function handleDestroy() {\n\t\t\t\twin.off( \"focus\", handleFocus );\n\t\t\t}", "title": "" }, { "docid": "dc83b9bfc07337d3976502e37cfe4ff2", "score": "0.52413464", "text": "function createAddWindow(){\n addWindow=new BrowserWindow({\n width: 200,\n height: 300,\n title:'Add Item',\n webPreferences: {\n nodeIntegration : true\n }\n });\n addWindow.loadURL(url.format({\n pathname:path.join(__dirname,\"html\", 'add.html'),\n protocol:'file',\n slashes:true\n }));\naddWindow.on('closed', function(){\naddWindow=null;\n\n});\n //garbage collection\n\n}", "title": "" }, { "docid": "b4c7efc8a2ae3970839928ae4af00d44", "score": "0.5240782", "text": "onProceed() {\n super.onProceed();\n this.shellCommunicationService.notifyShellAboutUnsavedChanges(false);\n }", "title": "" }, { "docid": "2d90609207e9f580e68f672f8009d770", "score": "0.52356213", "text": "function onCreated(creationType) {\r\n if (browser.runtime.lastError) {\r\n console.log(`Error: ${browser.runtime.lastError}`);\r\n } else {\r\n console.log(creationType + \" created successfully\");\r\n }\r\n}", "title": "" }, { "docid": "f9f1cdb12cd3ff89a22dff3acff49c0f", "score": "0.52314156", "text": "static onWindowMinimized(win){}", "title": "" }, { "docid": "f9563c040c4fe31e5addfbeef1e898da", "score": "0.52244467", "text": "connectedCallback () {\n this._closeWindowEvent = new window.CustomEvent('closeWindow', { detail: this._container })\n this._container.addEventListener('click', this._containerClicked.bind(this))\n this._content.addEventListener('closeView', e => {\n this.dispatchEvent(this._closeWindowEvent)\n })\n }", "title": "" }, { "docid": "e2b33affbd146101fc4da114281e3812", "score": "0.52225065", "text": "function createWindow() {\n mainWindow = new BrowserWindow({\n icon: iconPath,\n // Remove if not working\n webPreferences: {\n allowRunningInsecureContent: false,\n experimentalFeatures: false\n },\n titleBarStyle: \"hidden\",\n show: false\n // Remove End\n });\n mainWindow.loadURL(\n url.format({\n pathname: path.join(__dirname, \"/app/index.html\"),\n protocol: \"file:\",\n slashes: true\n })\n );\n mainWindow.on(\"close\", () => {\n app.quit();\n });\n mainWindow.once(\"ready-to-show\", () => {\n mainWindow.show();\n });\n mainWindow.maximize();\n // Menu Start\n const mainMenu = Menu.buildFromTemplate(mainMenuTemplate);\n const trayMenu = Menu.buildFromTemplate(trayMenuTemplate);\n Menu.setApplicationMenu(mainMenu);\n tray = new Tray(iconPath);\n tray.setContextMenu(trayMenu);\n tray.setToolTip(\"Lone\");\n tray.on(\"click\", function() {\n if (mainWindow.isMinimized()) {\n mainWindow.maximize();\n } else {\n mainWindow.minimize();\n }\n });\n // Menu End\n mainWindow.webContents.openDevTools();\n}", "title": "" }, { "docid": "2c4dfb087b260bdfaf1f49fe73e713de", "score": "0.5221481", "text": "checkIfChildApp() {\n if (finsembleWindow.windowOptions &&\n finsembleWindow.windowOptions.customData &&\n finsembleWindow.windowOptions.customData.parentUUID &&\n finsembleWindow.windowOptions.customData.parentUUID !== system_1.System.Application.getCurrent().uuid) {\n let parent = system_1.System.Application.wrap(finsembleWindow.windowOptions.customData.parentUUID);\n parent.addEventListener(\"crashed\", this.close.bind(null, false));\n parent.addEventListener(\"initialized\", this.close.bind(null, false));\n parent.addEventListener(\"out-of-memory\", this.close.bind(null, false));\n }\n }", "title": "" }, { "docid": "5d08c8fca777884fd82cac7b4fa9e39e", "score": "0.5221061", "text": "click() { createAddWindow(); }", "title": "" }, { "docid": "2f6cf1cb0c603bc8b363c1ce1a2d5dcf", "score": "0.52195466", "text": "function onWindowLoad() {\n if (self.isWebView()) {\n // the window and scripts are fully loaded, and a cordova/phonegap\n // object exists then let's listen for the deviceready\n document.addEventListener(\"deviceready\", onPlatformReady, false);\n } else {\n // the window and scripts are fully loaded, but the window object doesn't have the\n // cordova/phonegap object, so its just a browser, not a webview wrapped w/ cordova\n onPlatformReady();\n }\n if (windowLoadListenderAttached) {\n window.removeEventListener(\"load\", onWindowLoad, false);\n }\n }", "title": "" }, { "docid": "2f6cf1cb0c603bc8b363c1ce1a2d5dcf", "score": "0.52195466", "text": "function onWindowLoad() {\n if (self.isWebView()) {\n // the window and scripts are fully loaded, and a cordova/phonegap\n // object exists then let's listen for the deviceready\n document.addEventListener(\"deviceready\", onPlatformReady, false);\n } else {\n // the window and scripts are fully loaded, but the window object doesn't have the\n // cordova/phonegap object, so its just a browser, not a webview wrapped w/ cordova\n onPlatformReady();\n }\n if (windowLoadListenderAttached) {\n window.removeEventListener(\"load\", onWindowLoad, false);\n }\n }", "title": "" }, { "docid": "2f6cf1cb0c603bc8b363c1ce1a2d5dcf", "score": "0.52195466", "text": "function onWindowLoad() {\n if (self.isWebView()) {\n // the window and scripts are fully loaded, and a cordova/phonegap\n // object exists then let's listen for the deviceready\n document.addEventListener(\"deviceready\", onPlatformReady, false);\n } else {\n // the window and scripts are fully loaded, but the window object doesn't have the\n // cordova/phonegap object, so its just a browser, not a webview wrapped w/ cordova\n onPlatformReady();\n }\n if (windowLoadListenderAttached) {\n window.removeEventListener(\"load\", onWindowLoad, false);\n }\n }", "title": "" }, { "docid": "2f6cf1cb0c603bc8b363c1ce1a2d5dcf", "score": "0.52195466", "text": "function onWindowLoad() {\n if (self.isWebView()) {\n // the window and scripts are fully loaded, and a cordova/phonegap\n // object exists then let's listen for the deviceready\n document.addEventListener(\"deviceready\", onPlatformReady, false);\n } else {\n // the window and scripts are fully loaded, but the window object doesn't have the\n // cordova/phonegap object, so its just a browser, not a webview wrapped w/ cordova\n onPlatformReady();\n }\n if (windowLoadListenderAttached) {\n window.removeEventListener(\"load\", onWindowLoad, false);\n }\n }", "title": "" }, { "docid": "4675985cbd0e42fa7026c70b51eff665", "score": "0.5217977", "text": "close() {\n\t\tlogger.info(`Closing windowProcess ${this.uuid}`);\n\t\tconst windowKeys = Object.keys(this.windows);\n\t\twindowKeys.map((windowKey) => {\n\t\t\tconst currentWindow = this.windows[windowKey];\n\t\t\tcurrentWindow.close();\n\t\t});\n\t\tif (this.appWindow) this.appWindow.close();\n\t\tlogger.log(`APPLICATION LIFECYCLE: WindowProcess ${this.uuid} closed.`);\n\t\tthis.emit('close');\n\t}", "title": "" }, { "docid": "d99082638d8575bca6cb5797947f5c6d", "score": "0.5217949", "text": "function init()\n\t{\n\t\t// 1. start stuff up\n\t\toBody = $('body');\n\n\t\t// 2. bind to window resize\n\t\t$(window).off('.appWindow').on('resize.appWindow', $.debounce(100, assessWidth));\n\n\t\t// 3. finally, trigger the handler\n\t\tsetTimeout(assessWidth, 100); // delay, for IE…\n\t}", "title": "" }, { "docid": "666a9ed4dee0d9b023fe1203f9b1f182", "score": "0.5213673", "text": "addContentWindow (window) {\n this.contentWindows.push(window)\n window.on('closed', () => {\n this.contentWindows = this.contentWindows.filter((w) => w !== window)\n })\n }", "title": "" }, { "docid": "4b24214642396e9e50106d1d47a64efb", "score": "0.52128285", "text": "function finishWindow() {\n var alarmRichlist = document.getElementById(\"alarm-richlist\");\n\n if (alarmRichlist.childNodes.length > 0) {\n // If there are still items, the window wasn't closed using dismiss\n // all/snooze all. This can happen when the closer is clicked or escape\n // is pressed. Snooze all remaining items using the default snooze\n // property.\n var snoozePref = getPrefSafe(\"calendar.alarms.defaultsnoozelength\", 0);\n if (snoozePref <= 0) {\n snoozePref = 5;\n }\n snoozeAllItems(snoozePref);\n }\n\n // Stop updating the relative time\n clearTimeout(gRelativeDateUpdateTimer);\n}", "title": "" }, { "docid": "8044d492df638da7593f055678afe0b5", "score": "0.5210923", "text": "function eventWindowLoaded() {\n initCanvas();\n}", "title": "" }, { "docid": "b43e0bc0ade8faf388bd21db1cb58170", "score": "0.5209508", "text": "function resizeWindow(e) {\n\t\tinitLayout();\n\t\tinitNano();\n }", "title": "" }, { "docid": "b354416525991ef898bd6b5b7580c60e", "score": "0.5207651", "text": "clearDesktop () {\n for (let i = 0; i < this.windowArray.length; i++) {\n this.windowArray[i].close()\n }\n this.windowArray = []\n this.zIndex = 0\n this.clickX = 0\n this.clickY = 0\n this.appNumber = 0\n }", "title": "" }, { "docid": "484fcb352101f1c37f87d52781252151", "score": "0.5207272", "text": "function windowMouseupListener() {\n if (!tryDestroy()) {\n selectionMgr.saveSelectionState(true, false)\n }\n }", "title": "" }, { "docid": "da5b94f3e3311f535a55729910f0d8e8", "score": "0.52035", "text": "function windowResized() {\n placeCanvas();\n}", "title": "" }, { "docid": "dfd4c345efe572f29eb059d581d88d2d", "score": "0.5192466", "text": "function createWindow () {\n win = new BrowserWindow({width: 800, height: 600})\n win.loadFile('index.html')\n win.on('closed', () => {\n win = null\n })\n }", "title": "" } ]
a39ae3d9663fcdcc615cb61634e2805e
A directive that enables basic conditional rendering in a template.
[ { "docid": "fcce3105af325188c633764a4667ac06", "score": "0.0", "text": "function when(binding, templateOrTemplateBinding) {\n const getTemplate = typeof templateOrTemplateBinding === \"function\" ? templateOrTemplateBinding : () => templateOrTemplateBinding;\n return (source, context) => binding(source, context) ? getTemplate(source, context) : null;\n}", "title": "" } ]
[ { "docid": "b4b463d9d607e7a1c3f1beac09779e5a", "score": "0.6312425", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "ec2fe5961f1495e9765c325d8a1b3db9", "score": "0.6207813", "text": "function renderCondition(template, condition, value) {\n if (!condition) {\n console.log('Resources:renderCondition: The condition is invalid');\n return template;\n }\n if (!value) {\n var regex = new RegExp(condition+'.*{{\\\\s*endif\\\\s*}}', 'gmi');\n return template.replace(regex, '');\n } else {\n var regex = new RegExp(condition+'(.*){{\\\\s*endif\\\\s*}}', 'gmi');\n return template.replace(regex, '$1');\n }\n }", "title": "" }, { "docid": "df1ffe52310cd40e0b08c0f370d19222", "score": "0.6136027", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "df1ffe52310cd40e0b08c0f370d19222", "score": "0.6136027", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "df1ffe52310cd40e0b08c0f370d19222", "score": "0.6136027", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "df1ffe52310cd40e0b08c0f370d19222", "score": "0.6136027", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "09f3ba4993e6534cc86c2bebef13866f", "score": "0.60726994", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "2b119032ab26e1129e23df2eff3c9e73", "score": "0.58403444", "text": "set ngIfElse(templateRef) {\n assertTemplate('ngIfElse', templateRef);\n this._elseTemplateRef = templateRef;\n this._elseViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "c0ae560479e55f35fe5790f6168fa80b", "score": "0.5735793", "text": "set ngIfElse(templateRef) {\n assertTemplate('ngIfElse', templateRef);\n this._elseTemplateRef = templateRef;\n this._elseViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "c0ae560479e55f35fe5790f6168fa80b", "score": "0.5735793", "text": "set ngIfElse(templateRef) {\n assertTemplate('ngIfElse', templateRef);\n this._elseTemplateRef = templateRef;\n this._elseViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "c0ae560479e55f35fe5790f6168fa80b", "score": "0.5735793", "text": "set ngIfElse(templateRef) {\n assertTemplate('ngIfElse', templateRef);\n this._elseTemplateRef = templateRef;\n this._elseViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "c0ae560479e55f35fe5790f6168fa80b", "score": "0.5735793", "text": "set ngIfElse(templateRef) {\n assertTemplate('ngIfElse', templateRef);\n this._elseTemplateRef = templateRef;\n this._elseViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "b5ae2bc70bbc1ef6fc8b8faeb44afbf8", "score": "0.56957436", "text": "set ngIfElse(templateRef) {\n assertTemplate('ngIfElse', templateRef);\n this._elseTemplateRef = templateRef;\n this._elseViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "e07b3272cb6338dd3b37efe623c99c04", "score": "0.55617076", "text": "function If() {\n var _this_1 = _super.call(this) || this;\n /**\n * Whether or not to animate adding and removing of element.\n */\n _this_1._animate = false;\n /**\n * The current evaluated condition (whether or not the\n * control is visible) of the control.\n */\n _this_1.__condition = true;\n /**\n * A boolean value stating whether or not the condition has already\n * been evaluated.\n */\n _this_1.__firstTime = true;\n /**\n * A boolean value stating whether or not the template has been bound\n */\n _this_1.__isBound = false;\n var _document = _this_1._document;\n _this_1.commentNode = _document.createComment(\"\" + __If + __BOUND_PREFIX + \"placeholder\");\n _this_1.fragmentStore = _document.createDocumentFragment();\n return _this_1;\n }", "title": "" }, { "docid": "10817717ff9460546668b947fbec4b65", "score": "0.54544663", "text": "function supportsTemplate() {\n return 'content' in document.createElement('template');\n\t}", "title": "" }, { "docid": "2a606867c733dd98bdc6bf25a8879ff9", "score": "0.54061854", "text": "function compileConditional () {\n // Insert code here \n}", "title": "" }, { "docid": "1b7e901b1d56d991310b41bbdeda42b5", "score": "0.5365186", "text": "render() {\n return html`<p>your ${this.adjective} template-here</p>`;\n }", "title": "" }, { "docid": "317f5936eb84112009dedc54a0b47961", "score": "0.5364458", "text": "function isInlineTemplate(tNode) {\n return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}", "title": "" }, { "docid": "317f5936eb84112009dedc54a0b47961", "score": "0.5364458", "text": "function isInlineTemplate(tNode) {\n return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}", "title": "" }, { "docid": "2716806bbaa037918172f084fb26695e", "score": "0.5346016", "text": "function isInlineTemplate(tNode) {\n return tNode.type === 4\n /* Container */\n && tNode.value !== NG_TEMPLATE_SELECTOR;\n }", "title": "" }, { "docid": "2716806bbaa037918172f084fb26695e", "score": "0.5346016", "text": "function isInlineTemplate(tNode) {\n return tNode.type === 4\n /* Container */\n && tNode.value !== NG_TEMPLATE_SELECTOR;\n }", "title": "" }, { "docid": "9f2fd8a01507bdde4c748177b1f2460c", "score": "0.53284574", "text": "set ngIfThen(templateRef) {\n assertTemplate('ngIfThen', templateRef);\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "4f63b9b3b4d90e1af91f7927ce61ff71", "score": "0.5291883", "text": "function defineRenderedTrue(model) {\n if (!model.hasOwnProperty('__isRendered')) {\n Object.defineProperty(model, '__isRendered', {\n enumerable: false,\n value: true\n });\n }\n }", "title": "" }, { "docid": "b8bcfee7542bb8b25395c5e05a87c68a", "score": "0.52480364", "text": "function isTemplate(value) {\n return (\n typeof value == \"object\" &&\n value.source &&\n value.data\n );\n}", "title": "" }, { "docid": "9bfd8bb3f58b3bb5e1c2c650c343b27c", "score": "0.52369857", "text": "function create_else_block(ctx) {\n var html_tag;\n var raw_value = marked__WEBPACK_IMPORTED_MODULE_1___default()(\n /*string*/\n ctx[0]) + \"\";\n var html_anchor;\n return {\n c: function c() {\n html_anchor = (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.empty)();\n html_tag = new svelte_internal__WEBPACK_IMPORTED_MODULE_0__.HtmlTag(html_anchor);\n },\n m: function m(target, anchor) {\n html_tag.m(raw_value, target, anchor);\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.insert)(target, html_anchor, anchor);\n },\n p: function p(ctx, dirty) {\n if (dirty &\n /*string*/\n 1 && raw_value !== (raw_value = marked__WEBPACK_IMPORTED_MODULE_1___default()(\n /*string*/\n ctx[0]) + \"\")) html_tag.p(raw_value);\n },\n d: function d(detaching) {\n if (detaching) (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.detach)(html_anchor);\n if (detaching) html_tag.d();\n }\n };\n} // (20:2) {#if inline}", "title": "" }, { "docid": "1a731d5ade34aaeb263048d71db1496f", "score": "0.52214617", "text": "set ngIfThen(templateRef) {\n assertTemplate('ngIfThen', templateRef);\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "1a731d5ade34aaeb263048d71db1496f", "score": "0.52214617", "text": "set ngIfThen(templateRef) {\n assertTemplate('ngIfThen', templateRef);\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "1a731d5ade34aaeb263048d71db1496f", "score": "0.52214617", "text": "set ngIfThen(templateRef) {\n assertTemplate('ngIfThen', templateRef);\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "1a731d5ade34aaeb263048d71db1496f", "score": "0.52214617", "text": "set ngIfThen(templateRef) {\n assertTemplate('ngIfThen', templateRef);\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "85df3c78fafda7175ec7799e450ea6df", "score": "0.5221291", "text": "function isInlineTemplate(tNode) {\n return tNode.type === 4 /* TNodeType.Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}", "title": "" }, { "docid": "0e0b5baf7ecf9086cd3edf5fef2e9ad9", "score": "0.52153164", "text": "function relayMainCondition() {\n\tvar name = 'relay-main-condition';\n\n\treturn {\n\t\ttemplateUrl: 'views/' + name + '.tpl.html',\n\t\trestrict: 'E',\n\t\tscope: {\n\t\t\tngModel: '=',\n\t\t\tngChange: '&'\n\t\t},\n\t\tcontroller: 'RelayMainConditionController',\n\t\tcontrollerAs: 'vm',\n\t\tbindToController: true\n\t};\n}", "title": "" }, { "docid": "6955eda2b842a94ddb53a94063e69093", "score": "0.5211314", "text": "render() {\n return (\n <div>\n { /* This is a comment */ }\n { true ? <b>true</b> : null }\n <hr />\n { false ? null : <div>false</div> }\n <br />\n { `1 + 1 = ${1+1} ` }\n </div>\n );\n }", "title": "" }, { "docid": "d973eb708b43b415c654bd25a1ce11eb", "score": "0.5191741", "text": "render() {\n // Return the template using the html template tag. lit-html will parse the template and\n // create the DOM elements\n return html`\n <section-header header=\"01-basic-setup\">\n <div>Hello world!</div>\n </section-header>\n `;\n }", "title": "" }, { "docid": "55f7a3c9053a71ceb8d3250abc78e8f3", "score": "0.5179208", "text": "function isInlineTemplate(tNode) {\n return tNode.type === 0 /* Container */ && tNode.tagName !== NG_TEMPLATE_SELECTOR;\n}", "title": "" }, { "docid": "55f7a3c9053a71ceb8d3250abc78e8f3", "score": "0.5179208", "text": "function isInlineTemplate(tNode) {\n return tNode.type === 0 /* Container */ && tNode.tagName !== NG_TEMPLATE_SELECTOR;\n}", "title": "" }, { "docid": "4ae92bdba44bfce752ab007066940a91", "score": "0.5170462", "text": "set ngIfThen(templateRef) {\n assertTemplate('ngIfThen', templateRef);\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" }, { "docid": "e8bb8347dc6adcf93d45458e9abf641f", "score": "0.5139938", "text": "static get is() { return 'dom-if'; }", "title": "" }, { "docid": "e8bb8347dc6adcf93d45458e9abf641f", "score": "0.5139938", "text": "static get is() { return 'dom-if'; }", "title": "" }, { "docid": "e8bb8347dc6adcf93d45458e9abf641f", "score": "0.5139938", "text": "static get is() { return 'dom-if'; }", "title": "" }, { "docid": "e8bb8347dc6adcf93d45458e9abf641f", "score": "0.5139938", "text": "static get is() { return 'dom-if'; }", "title": "" }, { "docid": "61c2a726829a15ba4ca4ecb44f15f294", "score": "0.5116059", "text": "function Template() {\n this.defaultTemplate = `\n <li data-id=\"{{id}}\" class=\"{{completed}}\">\n <div class=\"view\">\n <input class=\"toggle\" type=\"checkbox\" {{checked}} />\n <label>{{title}}</label>\n <span>{{entity}}</span>\n {{img}}\n <button class=\"destroy\"></button>\n </div>\n </li>\n `\n}", "title": "" }, { "docid": "5dc5f33c8b8e99c0f944d79317ce10d5", "score": "0.50756896", "text": "function isTemplateNode(node) {\n return node.tagName === 'TEMPLATE' && node.content !== undefined;\n}", "title": "" }, { "docid": "8309e764ace2b2b24ad1acddce712d5b", "score": "0.5065369", "text": "function compileElement(node, scope, isRoot) {\n var tagName = node.tagName\n switch(true) {\n /**\n * <*-if></*-if>\n */\n case is.IfElement(tagName):\n var inst = new ElementDirective(\n vm,\n scope,\n node,\n elements['if'],\n conf.namespace + 'if',\n $(node).attr('is')\n )\n if (!isRoot) {\n inst.$mount(node)\n }\n _elements.push(inst)\n return inst\n /**\n * <*-repeat></*-repeat>\n */\n case is.RepeatElement(tagName):\n var inst = new ElementDirective(\n vm,\n scope,\n node,\n elements['repeat'],\n conf.namespace + 'repeat',\n $(node).attr('items')\n )\n if (!isRoot) {\n inst.$mount(node)\n }\n _elements.push(inst)\n return inst\n }\n }", "title": "" }, { "docid": "1d2d4d46b0d36197c465e6eec7b10692", "score": "0.505485", "text": "function showIf(cond) {\n if (!cond) {\n return { display: \"none\" };\n } else {\n return {};\n }\n}", "title": "" }, { "docid": "d24cc93a3cbdf799c2f0a6117fa2d935", "score": "0.5021764", "text": "static get is() {\n return 'dom-if';\n }", "title": "" }, { "docid": "d24cc93a3cbdf799c2f0a6117fa2d935", "score": "0.5021764", "text": "static get is() {\n return 'dom-if';\n }", "title": "" }, { "docid": "45ad16df623b0380a31caaff6acce28e", "score": "0.50083536", "text": "function App() {\n var data = {\n name : \"Muhammad Shakir Khan\",\n age : 23,\n height : 5.4\n }\n\n // If Statements Example Start\n function getName(name)\n {\n if(name){\n return name;\n }\n else{\n return \"Unknown\";\n }\n }\n // If Statements Example Close\n return (\n <div>\n <h1>Name: {getName(data.name)}</h1>\n <h1>Age: {data.age ? data.age : 'No Age Defined'}</h1>\n <h1>Height: {data.height >= 5.4 && 'Normal Height'}</h1>\n </div>\n );\n}", "title": "" }, { "docid": "de062d8bf4efa69c2cd30b64465eb249", "score": "0.5002526", "text": "function compileElement(node, scope, isRoot) {\n var tagName = node.tagName\n var inst\n switch(true) {\n /**\n * <*-if></*-if>\n */\n case is.IfElement(tagName):\n var children = _slice(node.children)\n var exprs = [$(node).attr('is')]\n children.forEach(function(c) {\n if (is.ElseElement(c)) {\n exprs.push($(c).attr(conf.namespace + 'else') || '')\n }\n })\n inst = new ElementDirective(\n vm, \n scope,\n node, \n elements['if'], \n NS + 'if', \n exprs\n )\n if (!isRoot) {\n inst.$mount(node)\n }\n // save elements refs\n _directives.push(inst)\n // save bindins to scope\n _setBindings2Scope(scope, inst)\n return inst\n /**\n * <*-repeat></*-repeat>\n */\n case is.RepeatElement(tagName):\n inst = new ElementDirective(\n vm, \n scope,\n node, \n elements.repeat,\n NS + 'repeat', \n $(node).attr('items')\n )\n if (!isRoot) {\n inst.$mount(node)\n }\n _directives.push(inst)\n _setBindings2Scope(scope, inst)\n return inst\n }\n }", "title": "" }, { "docid": "31044e4d1c1f85be3b3e4941ad5e1853", "score": "0.50015175", "text": "function Conditional(props) {\n return (\n <div>\n <h1>Heres the information that you waited 1.5 seconds for</h1>\n </div>\n );\n}", "title": "" }, { "docid": "802715e14330c08d740e3f4f29140136", "score": "0.49950606", "text": "_template() {\n return `${(this._title) ? \"<h1>\" + this._title + \"</h1>\" : \"\"}${this._body}`;\n }", "title": "" }, { "docid": "ea3f845695ef4785a0c52cdce62a2f50", "score": "0.4971615", "text": "function ExampleComponent({ text = 'Hello', isBold = false }) {\r\n return h('div', { style: isBold ? { fontWeight: 'bold' } : undefined }, text);\r\n}", "title": "" }, { "docid": "cf495c004ec44e76ae1c58b4da36a8c7", "score": "0.4970351", "text": "get Template() {\n return `\n <p>${this.city}: \n\n ${(this.displayF == true) ? this.far : this.celsius}\n\n &#176<button onclick=\"app.weatherController.toggleFC()\">Toggle</button></p>\n `\n\n }", "title": "" }, { "docid": "12ceaae507b6a3f1b0cc85feafa30cf3", "score": "0.494886", "text": "static get template() {\n return `<div>This is my first [[name]] app.</div>`\n }", "title": "" }, { "docid": "1a3bfc7ece526e7be6eebd954de2d742", "score": "0.49210992", "text": "static get is() {\n return 'dom-if';\n }", "title": "" }, { "docid": "ca103292f4021781016a5116a5f5cdde", "score": "0.4918664", "text": "function matcher(template, context, output) {\n var compiled = dust.compile(template);\n var tmpl = dust.loadSource(compiled);\n return new Promise((res, rej)=>{\n dust.render(tmpl, context, (err, out) => {\n if ( err ) {\n return rej(err);\n }\n res(out)\n })\n })\n}", "title": "" }, { "docid": "520e2b1454cc934da3355b1fa237101c", "score": "0.4917794", "text": "conditionalExpressionHandler(node) {\n return this.ifStatementHandler(node)\n }", "title": "" }, { "docid": "22dbbe5b791d6cd1a1f9a08d70c922a1", "score": "0.48843437", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "22dbbe5b791d6cd1a1f9a08d70c922a1", "score": "0.48843437", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "d31ccb8232744e9ad4f10ca9c94609f1", "score": "0.4864943", "text": "function defaultConditional() {\n return true;\n}", "title": "" }, { "docid": "7354993ea407bd24e66e386de6d0214b", "score": "0.48588288", "text": "render() {\n return (\n <div>\n {this.state.mytags2.length === 0 &&\n \"Theere are no tags (second method to apply condition inside render method).\"}\n {this.renderTags()}\n </div>\n );\n }", "title": "" }, { "docid": "e4ac1206dc77d8f794180b1ae1b0ac56", "score": "0.48572206", "text": "function template(templateSpec,env){ /* istanbul ignore next */if(!env){throw new Exception(\"No environment passed to template\")}if(!templateSpec || !templateSpec.main){throw new Exception('Unknown template object: ' + typeof templateSpec)} // Note: Using env.VM references rather than local var references throughout this section to allow\n// for external users to override these as psuedo-supported APIs.\nenv.VM.checkRevision(templateSpec.compiler);var invokePartialWrapper=function invokePartialWrapper(partial,indent,name,context,hash,helpers,partials,data,depths){if(hash){context = Utils.extend({},context,hash)}var result=env.VM.invokePartial.call(this,partial,name,context,helpers,partials,data,depths);if(result == null && env.compile){var options={helpers:helpers,partials:partials,data:data,depths:depths};partials[name] = env.compile(partial,{data:data !== undefined,compat:templateSpec.compat},env);result = partials[name](context,options)}if(result != null){if(indent){var lines=result.split('\\n');for(var i=0,l=lines.length;i < l;i++) {if(!lines[i] && i + 1 === l){break}lines[i] = indent + lines[i]}result = lines.join('\\n')}return result}else {throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\")}}; // Just add water\nvar container={lookup:function lookup(depths,name){var len=depths.length;for(var i=0;i < len;i++) {if(depths[i] && depths[i][name] != null){return depths[i][name]}}},lambda:function lambda(current,context){return typeof current === 'function'?current.call(context):current},escapeExpression:Utils.escapeExpression,invokePartial:invokePartialWrapper,fn:function fn(i){return templateSpec[i]},programs:[],program:function program(i,data,depths){var programWrapper=this.programs[i],fn=this.fn(i);if(data || depths){programWrapper = _program(this,i,fn,data,depths)}else if(!programWrapper){programWrapper = this.programs[i] = _program(this,i,fn)}return programWrapper},data:function data(_data,depth){while(_data && depth--) {_data = _data._parent}return _data},merge:function merge(param,common){var ret=param || common;if(param && common && param !== common){ret = Utils.extend({},common,param)}return ret},noop:env.VM.noop,compilerInfo:templateSpec.compiler};var ret=function ret(context,options){options = options || {};var data=options.data;ret._setup(options);if(!options.partial && templateSpec.useData){data = initData(context,data)}var depths;if(templateSpec.useDepths){depths = options.depths?[context].concat(options.depths):[context]}return templateSpec.main.call(container,context,container.helpers,container.partials,data,depths)};ret.isTop = true;ret._setup = function(options){if(!options.partial){container.helpers = container.merge(options.helpers,env.helpers);if(templateSpec.usePartial){container.partials = container.merge(options.partials,env.partials)}}else {container.helpers = options.helpers;container.partials = options.partials}};ret._child = function(i,data,depths){if(templateSpec.useDepths && !depths){throw new Exception('must pass parent depths')}return _program(container,i,templateSpec[i],data,depths)};return ret}", "title": "" }, { "docid": "5fe9ecf524ceddfd63d60b15f9ecc90f", "score": "0.48220888", "text": "isTpl(extname){\n if(extname.indexOf('.') > -1){\n extname = path.extname(extname).slice(1);\n }\n if(extname === 'html'){\n return true;\n }\n let exts = this.config.tpl.extname;\n if(!isArray(exts)){\n exts = [exts];\n }\n return exts.indexOf(extname.toLowerCase()) > -1;\n }", "title": "" }, { "docid": "c71a072e14d8ca7eddcc87dcf6da93a3", "score": "0.48178083", "text": "function Template() {\n this.defaultTemplate\n = '<li data-id=\"{{id}}\" class=\"{{completed}}\">'\n + '<div class=\"view\">'\n + '<input class=\"toggle\" type=\"checkbox\" {{checked}}>'\n + '<label>{{title}}</label>'\n + '<button class=\"destroy\"></button>'\n + '</div>'\n + '</li>';\n }", "title": "" }, { "docid": "ea8dd8c0770b4dba5766f72918804d5d", "score": "0.4812195", "text": "render() {\n return false\n }", "title": "" }, { "docid": "6842f3d90539e7eaddb2e5bc88c70202", "score": "0.48034066", "text": "function RegisterComponent_div_1_Template(rf, ctx) { if (rf & 1) {\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelementStart\"](0, \"div\", 8);\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵtext\"](1, \"User info has error.\");\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelementEnd\"]();\n} }", "title": "" }, { "docid": "766b65e11d5bb838815ecce53ecc123d", "score": "0.4801144", "text": "function isNgTemplate(tagName) {\n return splitNsName(tagName)[1] === 'ng-template';\n}", "title": "" }, { "docid": "766b65e11d5bb838815ecce53ecc123d", "score": "0.4801144", "text": "function isNgTemplate(tagName) {\n return splitNsName(tagName)[1] === 'ng-template';\n}", "title": "" }, { "docid": "766b65e11d5bb838815ecce53ecc123d", "score": "0.4801144", "text": "function isNgTemplate(tagName) {\n return splitNsName(tagName)[1] === 'ng-template';\n}", "title": "" }, { "docid": "da4d6208ec2721e7310cc25d47a843c9", "score": "0.47983176", "text": "function hasServerMarkup(expression)\n{\n expression = expression.toString();\n return (expression.indexOf(\"<?\") != -1 && expression.indexOf(\"?>\") != -1);\n}", "title": "" }, { "docid": "c24afe2501c067b0556bf8c03ce3419c", "score": "0.4787832", "text": "render() {\n return (\n <div>\n {//ternary operator : condition?trueDecision:falseDecision\n }\n {this.state.loading ? <h2>loading please wait</h2> : <div>\n <h1>Todo App</h1>\n <AddTodo handleSubmit={this.addTodo} />\n <Todos delTodo={this.delTodo} todos={this.state.todos} />\n </div>}\n </div>\n )\n }", "title": "" }, { "docid": "b4e8f0ef48fdac7f89a9d87d66b20b16", "score": "0.47623312", "text": "compileConditional(o) {\n var fragments, left, right;\n [left, right] = this.variable.cacheReference(o);\n // Disallow conditional assignment of undefined variables.\n if (!left.properties.length && left.base instanceof Literal && !(left.base instanceof ThisLiteral) && !o.scope.check(left.base.value)) {\n this.variable.error(`the variable \"${left.base.value}\" can't be assigned with ${this.context} because it has not been declared before`);\n }\n if (indexOf.call(this.context, \"?\") >= 0) {\n o.isExistentialEquals = true;\n return new If(new Existence(left), right, {\n type: 'if'\n }).addElse(new Assign(right, this.value, '=')).compileToFragments(o);\n } else {\n fragments = new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compileToFragments(o);\n if (o.level <= LEVEL_LIST) {\n return fragments;\n } else {\n return this.wrapInParentheses(fragments);\n }\n }\n }", "title": "" }, { "docid": "c54a71adf168e24d9be5ad0f5f7c6e49", "score": "0.47531945", "text": "isConditional () { return this.children.length > 0 }", "title": "" }, { "docid": "c4a5e096abe744a6e2813919447b97d4", "score": "0.4748719", "text": "function create_if_block(ctx) {\n var portal;\n var current;\n portal = new svelte_portal__WEBPACK_IMPORTED_MODULE_2__.default({\n props: {\n target: \"#layers\",\n $$slots: {\n \"default\": [create_default_slot]\n },\n $$scope: {\n ctx: ctx\n }\n }\n });\n return {\n c: function c() {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.create_component)(portal.$$.fragment);\n },\n m: function m(target, anchor) {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.mount_component)(portal, target, anchor);\n current = true;\n },\n p: function p(ctx, dirty) {\n var portal_changes = {};\n\n if (dirty &\n /*$$scope, submitting, $$slots, title*/\n 166) {\n portal_changes.$$scope = {\n dirty: dirty,\n ctx: ctx\n };\n }\n\n portal.$set(portal_changes);\n },\n i: function i(local) {\n if (current) return;\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.transition_in)(portal.$$.fragment, local);\n current = true;\n },\n o: function o(local) {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.transition_out)(portal.$$.fragment, local);\n current = false;\n },\n d: function d(detaching) {\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.destroy_component)(portal, detaching);\n }\n };\n} // (32:6) {#if $$slots.default}", "title": "" }, { "docid": "28127e92c88c620ae65402dac100e93a", "score": "0.47486234", "text": "function inlineTemplate() {\n return gulp.src(['./src/app/**/*.ts'].concat(globalExcludes), {base: './'})\n .pipe(replace(/templateUrl.*\\'/g, function (matched) {\n let fileName = matched.match(/\\/.*html/g).toString();\n let dirName = this.file.relative.substring(0, this.file.relative.lastIndexOf('/'));\n let fileContent = fs.readFileSync(dirName + fileName, \"utf8\");\n return 'template: \\`' + minifyTemplate(fileContent) + '\\`';\n }))\n .pipe(gulp.dest(libraryBuild));\n}", "title": "" }, { "docid": "0f1370bdc4d41e011d8ae1cf50bc0061", "score": "0.4746146", "text": "function hasServerMarkup(expression)\n{\n expression = expression.toString();\n return (expression.indexOf(\"<%\") != -1 && expression.indexOf(\"%>\") != -1);\n}", "title": "" }, { "docid": "66a7a674ba9de6b72ef5e94f5a4f7d56", "score": "0.47460166", "text": "render() {\n this.domElement && (this.domElement.innerHTML = this.renderTemplate());\n }", "title": "" }, { "docid": "1765feee51ad5d535f5937e48356c569", "score": "0.47435096", "text": "function hasTemplates (str) {\n return /\\{{2}/.test(str);\n }", "title": "" }, { "docid": "5f4de91f32af15d7f5a5ee07c906716f", "score": "0.47324395", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "5f4de91f32af15d7f5a5ee07c906716f", "score": "0.47324395", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "5f4de91f32af15d7f5a5ee07c906716f", "score": "0.47324395", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "5f4de91f32af15d7f5a5ee07c906716f", "score": "0.47324395", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "5f4de91f32af15d7f5a5ee07c906716f", "score": "0.47324395", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "5f4de91f32af15d7f5a5ee07c906716f", "score": "0.47324395", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "5f4de91f32af15d7f5a5ee07c906716f", "score": "0.47324395", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "5f4de91f32af15d7f5a5ee07c906716f", "score": "0.47324395", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "3022ebb558adde72c4d4dfcc8648b670", "score": "0.4728111", "text": "hasComponent(){\n return (bbn.fn.isString(this.component) || (bbn.fn.isObject(this.component) && Object.keys(this.component).length)) || this.currentTemplate ? true : false;\n }", "title": "" }, { "docid": "cabb5c2261e955f107c69f49bd456e33", "score": "0.47113714", "text": "landingView() {\n return this.template(\"landing-view\");\n }", "title": "" }, { "docid": "f0da5713251b81c8135857e46e05a949", "score": "0.4709906", "text": "function emTweetDirective($compile) {\n\t\treturn {\n\t\t\trestrict: 'E', \n\t\t\tscope: { tweet: '=', assignment: '=', text: '=' },\n\t\t\ttransclude: true,\n\t\t\ttemplate: '<ng-include src=\"getTemplateUrl()\"/>',\n\t\t\tcontroller: \"TweetController as cntrl\"\n\t\t}\n\t}", "title": "" }, { "docid": "96921fd391cc34f8bbb04757beee0e6b", "score": "0.47043702", "text": "truthCheck(data) {\n if (data.value) {\n return (\n <div>Yes</div>\n );\n } else {\n return (\n <div>No</div>\n );\n }\n }", "title": "" }, { "docid": "44402f0f6cec9c985b9cebf5b9b7172f", "score": "0.46849948", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "44402f0f6cec9c985b9cebf5b9b7172f", "score": "0.46849948", "text": "static ngTemplateContextGuard(dir, ctx) {\n return true;\n }", "title": "" }, { "docid": "e26312c83a902772d4d44b8127570ec1", "score": "0.46839532", "text": "function disableLayoutDirective(){return{restrict:'A',priority:'900',compile:function compile(element,attr){config.enabled=false;return angular.noop;}};}", "title": "" }, { "docid": "536558ac39a078f265549b1683d0bb08", "score": "0.4683625", "text": "function NgPagination_ng_template_0_Template(rf, ctx) {\n if (rf & 1) {\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelement\"](0, \"i\", 11);\n }\n }", "title": "" }, { "docid": "18dfc8bccbc651e7500cfc77fe3450ce", "score": "0.4673738", "text": "function startTagInTemplate(p, token) {\n const tn = token.tagName;\n\n if (\n tn === $.BASE ||\n tn === $.BASEFONT ||\n tn === $.BGSOUND ||\n tn === $.LINK ||\n tn === $.META ||\n tn === $.NOFRAMES ||\n tn === $.SCRIPT ||\n tn === $.STYLE ||\n tn === $.TEMPLATE ||\n tn === $.TITLE\n ) {\n startTagInHead(p, token);\n } else {\n const newInsertionMode = TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn] || IN_BODY_MODE;\n\n p._popTmplInsertionMode();\n p._pushTmplInsertionMode(newInsertionMode);\n p.insertionMode = newInsertionMode;\n p._processToken(token);\n }\n }", "title": "" }, { "docid": "3162cf2e6313ccbbe182cacbfe349bbd", "score": "0.4672378", "text": "enterBooleanOrExpression(ctx) {\n\t}", "title": "" }, { "docid": "4045a5c8bed2748ae44ea34fe86596be", "score": "0.46706066", "text": "function AppComponent_div_2_Template(rf, ctx) {\n if (rf & 1) {\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelementStart\"](0, \"div\", 2);\n\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelementStart\"](1, \"div\", 3);\n\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelementStart\"](2, \"div\", 4);\n\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelement\"](3, \"img\", 5);\n\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelementStart\"](4, \"div\", 6);\n\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵtext\"](5, \"LOADING\");\n\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelementEnd\"]();\n\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelementEnd\"]();\n\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelementEnd\"]();\n\n _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵɵelementEnd\"]();\n }\n }", "title": "" }, { "docid": "846218f4303c82b81f1b41047423da19", "score": "0.46703452", "text": "get template () {\n return ''\n }", "title": "" }, { "docid": "371b3571ac5d203f7f5c933117396f6d", "score": "0.4642739", "text": "static interpolated(tagTempLit) {\n return tagTempLit.length > 1\n }", "title": "" }, { "docid": "72a37cf4cbd601d035b927f473a7ba00", "score": "0.4634077", "text": "templateHandler () {\n return;\n }", "title": "" }, { "docid": "11e3ae110af60dbe5f1d0a6874cee094", "score": "0.46334943", "text": "function startTagInTemplate(p, token) {\n var tn = token.tagName\n\n if (\n tn === $.BASE ||\n tn === $.BASEFONT ||\n tn === $.BGSOUND ||\n tn === $.LINK ||\n tn === $.META ||\n tn === $.NOFRAMES ||\n tn === $.SCRIPT ||\n tn === $.STYLE ||\n tn === $.TEMPLATE ||\n tn === $.TITLE\n )\n startTagInHead(p, token)\n else {\n var newInsertionMode =\n TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn] ||\n IN_BODY_MODE\n\n p._popTmplInsertionMode()\n p._pushTmplInsertionMode(newInsertionMode)\n p.insertionMode = newInsertionMode\n p._processToken(token)\n }\n }", "title": "" }, { "docid": "af45db324ec5458a6a4818f85f982b4f", "score": "0.46296996", "text": "_shouldRender(){\n return this.shouldRender;\n }", "title": "" } ]
fa0e29c68362eb57993a3ed6f85049f0
onchange of qty field entry totals the price
[ { "docid": "d13d37ffb35d438d7434488daaf3f611", "score": "0.6822554", "text": "function getProductTotal(field) {\n clearErrorInfo();\n var form = field.form;\n\tif (field.value == \"\") field.value = 0;\n\tif ( !isPosInt(field.value) ) {\n var msg = 'Please enter a positive integer for quantity.';\n addValidationMessage(msg);\n addValidationField(field)\n displayErrorInfo( form );\n return;\n\t} else {\n\t\tvar product = field.name.slice(0, field.name.lastIndexOf(\"_\") ); \n var price = form.elements[product + \"_price\"].value;\n\t\tvar amt = field.value * price;\n\t\tform.elements[product + \"_tot\"].value = formatDecimal(amt);\n\t\tdoTotals(form);\n\t}\n}", "title": "" } ]
[ { "docid": "2e7f4eae4cc964acbfb0c3e10fa8eff6", "score": "0.7695458", "text": "function onQuantityChange(e){\n\t\tvar value = this.value;\n\t\tvar sub_index = this.parentElement.parentElement.parentElement.getAttribute(\"data-id\");\n\t\tsubscribed_items[sub_index]['quantity'] = parseInt(value);\n\t\t\n\t\tvar sub_total_element = this.parentElement.parentElement.parentElement.getElementsByClassName(\"sub-total\")[0];\n\t\tvar new_total = subscribed_items[sub_index]['quantity'] * subscribed_items[sub_index]['total'];\n\t\tvar content = \"Sub total: $\" + Number(new_total).toFixed(2);\n\t\tsub_total_element.textContent = content;\n\t\t\n\t\tvar temp_total = 0.0;\n\t\tfor(i = 0; i < subscribed_items.length; i++){\n\t\t\ttemp_total += subscribed_items[i]['quantity'] * subscribed_items[i]['total'];\n\t\t}\n\t\t\n\t\ttransaction_total = temp_total;\n\t\t\n\t\tdocument.getElementById(\"main-total\").textContent = 'Total Amount: $' + Number(transaction_total).toFixed(2);\n\t}", "title": "" }, { "docid": "bd997fa94b7b4b6efddc9c548f90d23b", "score": "0.7655485", "text": "function quantityChanged(event){\n\tvar input = event.target\n\tif(isNaN(input.value) || input.value <= 0){\n\t\tinput.value = 1\n\t}\n\tupdateCartTotal()\n}", "title": "" }, { "docid": "19cb0e6abfc8ccbfed66769c5259f8de", "score": "0.76336974", "text": "function quantityChanged(event){\n var input = event.target;\n if (isNaN(input.value)|| input.value <= 0) { // sets input values that aren't a number or are less than 0 to 1 automatically.\n input.value = 1;\n }\n input.value = Math.round(input.value); // Ensures only whole numbers for qty. (You can't order half an item)\n updateCartTotal();\n}", "title": "" }, { "docid": "22bddfdbd21351219db77ce7ebba6fb9", "score": "0.76128924", "text": "function quantityChanged(e) {\n let input = e.target;\n if (isNaN(input.value) || input.value <= 0) {\n input.value = 1;\n }\n updateCartTotal();\n}", "title": "" }, { "docid": "d9dfc6ba75f18986f137085f55297f08", "score": "0.75520635", "text": "function quantityChanged(event) {\n let input = event.target;\n if (isNaN(input.value) || input.value <= 0) {\n input.value = 1;\n }\n updateCartTotal();\n }", "title": "" }, { "docid": "e2e96244a324356de65e1c41ee1d8074", "score": "0.75501347", "text": "function quantityChanged (e) {\n let input = e.target; //obtengo el html\n if (isNaN(input.value) || input.value <= 0) { //lo que verifico es si el valor de mi input no es un numero o si el valor del input es menor o igual a 0 entonces ejecuta\n input.value = 1; //sino se cumplen las condiciones setealo a uno\n }\n \n updateCartTotal(); //caso contrario ejecuta el total \n}", "title": "" }, { "docid": "1c81c941e3f0f43c5c60921d55fb16ee", "score": "0.7464588", "text": "function quantityChanged(event) {\n var input = event.target;\n if (isNaN(input.value) || input.value <= 0) {\n input.value = 1;\n }\n updateCartTotal();\n}", "title": "" }, { "docid": "03513404c917ed3c88b1a6be0c438fb1", "score": "0.74546826", "text": "function quantityChanged(event)\n{\n var input = event.target\n \n if (isNaN(input.value) || input.value <= 0)\n {\n input.value = 1\n }\n \n //Calling the updateTotal function\n updateTotal()\n}", "title": "" }, { "docid": "01e8e50e117c3807a33f16e117c310e7", "score": "0.7450283", "text": "function quantityChanged(event){\r\n var input = event.target\r\n if(isNaN(input.value) || input.value <= 0){\r\n input.value = 1\r\n } \r\n updateCartTotal()\r\n}", "title": "" }, { "docid": "7f48fbd71b546e85ed2514e27d4ddbed", "score": "0.74017584", "text": "function update_price() {\n var row = $(this).parents('.line-item');\n var kolicina = parseFloat(row.find('.kolicina>input').val());\n var cena = parseFloat(row.find('.cena>input').val());\n var popust = parseFloat(row.find('.popust>input').val());\n var davek = parseFloat(row.find('.davek>input').val());\n popust = (100-popust)/100;\n davek = (100 + davek)/100;\n skupaj = cena*kolicina*popust*davek;\n row.find('.skupaj').html(skupaj.toFixed(2));\n //update_total();\n}", "title": "" }, { "docid": "45c856ca1f601bcf3b31dede76c7ad03", "score": "0.7382451", "text": "function fieldQuantityHandler(evt) {\n var variantId = parseInt($(this).closest('.cart-item').attr('data-variant-id'), 10);\n var variant = product.variants.filter(function (variant) {\n return (variant.id === variantId);\n })[0];\n var cartLineItem = findCartItemByVariantId(variant.id);\n var quantity = evt.target.value;\n if (cartLineItem) {\n updateVariantInCart(cartLineItem, quantity);\n }\n }", "title": "" }, { "docid": "62d26d7975d314f14c4b3f8475dcfa2f", "score": "0.7370314", "text": "quantityChanged (finalize) {\n const page = this.page\n const order = this.parseOrder()\n if (order.qty <= 0) {\n page.lotField.value = 0\n page.qtyField.value = ''\n return\n }\n const lotSize = this.market.baseCfg.lotSize\n const lots = Math.floor(order.qty / lotSize)\n const adjusted = lots * lotSize\n page.lotField.value = lots\n if (!order.isLimit && !order.sell) return\n if (finalize) page.qtyField.value = (adjusted / 1e8)\n }", "title": "" }, { "docid": "47c8f39679c911a8b2c5dd48d11d8ae0", "score": "0.7243038", "text": "function calculateQtyPrice() {\n cart.qty = 0;\n cart.price = 0;\n qtyInputs.forEach(function(input) {\n if (input.value > 0) {\n var priceInput = input.parentNode.parentNode.querySelectorAll('p')[0];\n var priceInputNumber = priceInput.innerHTML.replace(/\\D/g, \"\")\n cart.qty += 1;\n cart.price += input.value*Number(priceInputNumber);\n }\n });\n }", "title": "" }, { "docid": "c3394b8c3680011afb0e9c40f585199a", "score": "0.7227012", "text": "function calculateTotal()\n\t\t{\n\t\t\tvar total_qty = 0;\n\t\t\t$(\".totalLineQty\").each(function(){\n\t\t\t\ttotal_qty += $(this).val()*1;\n\t\t\t});\n\t\t\t$(\"#sum_qty\").text(total_qty);\n\t\t\t$(\"#TotalQty\").val(total_qty);\n\t\t}", "title": "" }, { "docid": "071db1a5ec3cca85775246a36921649e", "score": "0.72188175", "text": "function updateSubtot($product) {\n var price = Number($product.querySelector('.pu span').innerHTML);\n var quantity = Number($product.querySelector('.qty label input').value);\n var total = $product.querySelector('.subtot span');\n \n total.innerHTML = price * quantity;\n}", "title": "" }, { "docid": "e884470341bce453e9de56bf8e46a78c", "score": "0.72162896", "text": "function quantityChanged(event) {\n let input = event.target;\n if(isNaN(input.value) || input.value <= 0) {\n input.value = 1\n }\n let id = input.parentElement.previousElementSibling.children[2].innerText\n updateQuantityLocalStorageBasket(id)\n updateBasketTotal();\n}", "title": "" }, { "docid": "28ece4afb2f2c252300faa64976eca3e", "score": "0.7198032", "text": "function cart_qty_changed($this) {\n var id = parseInt($this.data('id')),\n qty = parseInt($this.val()),\n price = parseFloat($('.cart_price_' + id).text()),\n cart_subtotal = parseFloat($('.cart_subtotal_' + id).text()),\n order_total = parseFloat($('.order_total').text()),\n paid = parseFloat($('#paid').text());\n if (qty.length < 1 || isNaN(qty)) {\n $this.val('1');\n qty = 1;\n }\n var new_cart_subtotal = qty * price;\n\n if ($('.cart_product_price').length > 0) {\n var cart_product_price = parseFloat($('.cart_product_price').text());\n cart_product_price = cart_product_price - cart_subtotal + new_cart_subtotal;\n $('.cart_product_price').text(cart_product_price.toFixed(2));\n }\n\n order_total = order_total - cart_subtotal + new_cart_subtotal;\n var need_to_pay = order_total - paid;\n $('#need_to_pay').val(need_to_pay);\n $('.cart_subtotal_' + id).text(new_cart_subtotal.toFixed(2));\n $('.order_total').text(order_total.toFixed(2));\n $('.coupon_money_input').data('order_total', order_total);\n }", "title": "" }, { "docid": "8afe049a8f3dfad91560e1a626c5f50a", "score": "0.7169497", "text": "function calculateByPrPriceOrQuantiry(e){\n\n var element = e.currentTarget;\n // console.log(element);\n var itemParent = $(element).closest('.row-item');\n var pr_quantity = itemParent.find(\"input.item-quantity\").val();\n\n\n var pr_price = itemParent.find(\"input.item-price\").val();\n\n var pr_total = pr_price * pr_quantity;\n\n itemParent.find(\".item-total\").val(pr_total);\n\n }", "title": "" }, { "docid": "04f40ca05fb299a7e651543529a75ac5", "score": "0.7148129", "text": "function updateSelectedItemSubtotal(n) \n{\n var selectedQty = $('#selected-'+n+'-itemQty').val();\n var selectedPrice = $('#selected-'+n+'-itemPrice').val();\n var selectedSubTotal = selectedQty * selectedPrice;\n\n $('#selected-'+n+'-subTotal').val(parseFloat(selectedSubTotal).toFixed(2));\n getQuoteGrandTotal();\n}", "title": "" }, { "docid": "8a1ed7785309f370c719bda0b58729dd", "score": "0.713522", "text": "function quantityChanged(event) {\n console.log(\"quantity changed\")\n var input = event.target\n console.log(input)\n if(isNaN(input.value) || input.value <= 0) {\n input.value = 1\n }\n updateCartTotal()\n}", "title": "" }, { "docid": "8662b14cafc5bab9a1407ec56daf3447", "score": "0.70982397", "text": "function ajustaQtdeProdutosNF(){\n\tqTot = 0;\n\t$(\".quantidade-produto\").each(function(){\n\t\tqTot += parseFloat(desformataValor($(this).val()));\n\t});\n\t$('#qVol').val(qTot);\n}", "title": "" }, { "docid": "9778b785232eff303fed6f799da25f21", "score": "0.70892507", "text": "function cartQuantityChange(event) {\n const inputCartChange = event.target;\n inputCartChange.value <= 0 ? ( inputCartChange.value = 1 ) : null;\n cartTotalPrice();\n cartCounterUpdate();\n }", "title": "" }, { "docid": "d307d84322a655a84d91b96bf5d5ae58", "score": "0.7062384", "text": "function updatePriceQty (orderForm){\n\t\t\t var itemsQty = 0;\n\t\t\t\t$.each(orderForm.items, function(i){\n\t\t\t\t\titemsQty += orderForm.items[i].quantity;\n\t\t\t\t\ttotalValue += (orderForm.items[i].price * orderForm.items[i].quantity);\n\t\t\t\t})\n\n\t\t\t\t$(\"header .nav-1 .pre-cart .total .numero, header .nav-1 .carrito .info p+p\").text(Fizzmod.Utils.formatPrice(totalValue / 100, ',', '.', 2, \"$\"));\n\t\t\t\t$(\"header .nav-1 .carrito .icono .num p\").text(itemsQty);\n \t}", "title": "" }, { "docid": "71d2df10e092f6eb167563ab5dc0d0bf", "score": "0.7058479", "text": "function calculateSubTotal(e) {\n\n if (e.key === 'Escape') {\n // clear input data\n $(e.target).val('');\n // clear subtotal\n $(e.target).parents('.dataRow').\n first().\n find('.qtyPriceTotal').text('Total $$');\n }\n else if (e.key !== 'Tab') {\n // check if value is number\n var tInput = e.target;\n var result;\n\n if (tInput.value.match(/(\\D|^$)/g)) {\n // invalid input\n result = \"Invalid qty-input.\";\n }\n else { // valid input\n // get item qty.\n var qty = parseInt(tInput.value);\n // get item price elem\n var itmPrice = tInput.parentElement.\n previousElementSibling.\n previousElementSibling.\n firstElementChild.innerText;\n // parse value\n itmPrice = parseFloat(itmPrice.match(/\\d+(\\.\\d{1,2})?/g));\n result = formatter.format(itmPrice * qty);\n }\n // get target & set output\n var targetOutput = tInput.parentElement.\n nextElementSibling.\n nextElementSibling.\n firstElementChild;\n targetOutput.innerText = result;\n }\n}", "title": "" }, { "docid": "caf387bb9b4324e59ea168251aa37339", "score": "0.70472896", "text": "function goombaSubtotal(event){\n var price = 5;\n var subtotal = event.target.value * price;\n goombaSub.value = subtotal + \" coins\";\n baddiesGrandTotal();\n}", "title": "" }, { "docid": "300d2d46e0ee93e022fa12078b6bf48f", "score": "0.7031433", "text": "function calculateTotal(e) {\n if (e.key !== 'Tab') {\n // check if delay is long enough ttd\n\n // if delay is long enough, check if value is number\n var tInput = e.target;\n var result;\n\n if (tInput.value.match(/(\\D|^$)/g)) {\n // invalid input\n result = \"Invalid qty-input.\";\n }\n else { // valid input\n // get item qty.\n var qty = parseInt(tInput.value);\n // get item price elem\n var itmPrice = tInput.parentElement.\n previousElementSibling.\n previousElementSibling.\n firstElementChild.innerText;\n // parse value\n itmPrice = parseFloat(itmPrice.match(/\\d+(\\.\\d{1,2})?/g));\n result = formatter.format(itmPrice * qty);\n }\n // get target & set output\n var targetOutput = tInput.parentElement.\n nextElementSibling.\n nextElementSibling.\n firstElementChild;\n targetOutput.innerText = result;\n }\n}", "title": "" }, { "docid": "4d96614d938d361ad638d1e457a0e481", "score": "0.70278734", "text": "function changeCartQuantity(e) {\r\n if (e.target.classList.contains(\"count-input\")) {\r\n const input = e.target;\r\n if (input.value < 1) {\r\n input.value = 1;\r\n } else if (input.value > 99) {\r\n input.value = 99;\r\n }\r\n const parentRow = input.closest(\".cart-row\");\r\n let price = parentRow.querySelector(\".cart-row-price\").dataset.price;\r\n const sum = parentRow.querySelector(\".cart-row-sum\");\r\n sum.textContent = +input.value * +price;\r\n }\r\n\r\n countCartItems()\r\n}", "title": "" }, { "docid": "dd179bd454a38a9b2096b2091a873873", "score": "0.70269376", "text": "function updateAmount() {\n \n document.getElementById(\"qty\").value = quantity;\n displayPrice();\n hideError();\n}", "title": "" }, { "docid": "0fb1e6df940d8b9053adce55b69d5405", "score": "0.7018566", "text": "function onChangeProductQuantity() {\n var qty = parseInt( $( this ).val() );\n\n /* Se empty lo interpreta come un delete */\n if ( isNaN( qty ) || qty == 0 ) {\n var delete_button = $( this ).parents( 'tr' ).find( 'td input.delete' );\n delete_button.trigger( 'click' );\n } else {\n\n var id_product_key = $( this ).attr( 'data-id_product_key' );\n\n /* Trigger custom event */\n\n /* @todo Da rivedere in quanto viene passato id_product_key al posto dell'id del prodotto + variante */\n var result = $( document ).triggerHandler( 'wpss_summary_order_change_quantity', [id_product_key, qty] );\n\n /* Se l'handler restituisce false esco, proseguo solo se non c'è nessun handler o quest'utlimo ha restituito true */\n if ( typeof result !== 'undefined' && result === false ) {\n return;\n }\n\n $( this ).parents( 'tr' ).find( 'td.wpss-summary-order-cell-product_price' ).html( WPSmartShop.wait16x16 );\n\n /* @todo Da levare questo blocco javascript, fare tutto da php */\n\n $.post( wpSmartShopJavascriptLocalization.ajaxURL, {\n action : 'action_summary_order_update_qty',\n id_product_key : id_product_key,\n qty : qty\n }, function ( data ) {\n var result = $.parseJSON( data );\n\n if ( typeof result.message !== 'undefined' ) {\n alert( result.message );\n }\n\n $( 'div.wpss-summary-order-container' ).replaceWith( result.content );\n WPDK.refresh();\n }\n );\n }\n }", "title": "" }, { "docid": "8b88ea51152884e6c59ad3980b1f7ba6", "score": "0.69622606", "text": "function quantityChanged(e) {\n const qtyInput = e.target.value;\n if (isNaN(qtyInput) || qtyInput <= 0) {\n qtyInput.value = 1;\n }\n updateNumber();\n}", "title": "" }, { "docid": "5da14b6132d3bc53a48bddea38611412", "score": "0.6951571", "text": "function calcPrice() {\n var newPrice = 0;\n if (q2.selected) {\n newPrice = mainProd.price * q2.value;\n }\n else if (q3.selected) {\n newPrice = mainProd.price * q3.value;\n }\n else {\n newPrice = mainProd.price * q1.value;\n }\n price.innerHTML = '$' + newPrice.toFixed(2);\n}", "title": "" }, { "docid": "3f0d22dbf9c42716b211bed48ea5644a", "score": "0.6950026", "text": "function updatePopupSellProductCalculation() {\n var qty = $('#update_product_piece').val();\n var pce = $('#update_product_piece').val();\n var vat = $('#update_product_vat').val();\n var upri = $('#update_product_unit_price').val();\n var pi_upri = pce * upri;\n vat = vat / 100;\n vat = pi_upri * vat;\n var sub_total = pi_upri + vat;\n $('#update_product_subtotal').val(sub_total.toFixed(2));\n $('.addsell_popup_update_error').html(pi_upri.toFixed(2));\n }", "title": "" }, { "docid": "a5f2c1949d2cb7f6e787952363a68a65", "score": "0.6931097", "text": "function updateItemQty(event) {\n var text = event.target;\n var qty = text.value.trim();\n var position = parseInt(text.getAttribute('data-pos'));\n\n if (isNaN(qty)) {\n qty = 1;\n }\n\n if (uc.cart && uc.cart.items && uc.cart.items.length > position) {\n uc.cart.items[position].quantity = qty;\n uc.saveCart();\n }\n}", "title": "" }, { "docid": "a5f2c1949d2cb7f6e787952363a68a65", "score": "0.6931097", "text": "function updateItemQty(event) {\n var text = event.target;\n var qty = text.value.trim();\n var position = parseInt(text.getAttribute('data-pos'));\n\n if (isNaN(qty)) {\n qty = 1;\n }\n\n if (uc.cart && uc.cart.items && uc.cart.items.length > position) {\n uc.cart.items[position].quantity = qty;\n uc.saveCart();\n }\n}", "title": "" }, { "docid": "8ffd2830ef34c4d464814ee2a7075b8c", "score": "0.6927662", "text": "function totalQuo() {\n var total = 0;\n $.each(ids, function (index, value) {\n var subPrice = parseFloat($(\"#proSubPrice-\" + value).val());\n total = total + subPrice;\n });\n $(\"#totalPrice\").text(parseFloat(total));\n}", "title": "" }, { "docid": "9475309ee9bb1e2929f2f1e050010012", "score": "0.6926058", "text": "function amountChanged(event) {\n\n const amount = event.target\n\n if (isNaN(amount.value) || amount.value <= 0) {\n\n amount.value = 1\n\n }\n\n cartTotal()\n \n}", "title": "" }, { "docid": "164c8f8c78611c7727e0efbe68ff2c23", "score": "0.6923489", "text": "function onQuantityChange(event) {\n var id = parseInt(event.target.getAttribute(\"id\"))\n var quantity = parseInt(event.target.value)\n\n updateQuantityLocalStorage(id, getQuantityFromInvalidQuantity(id, quantity))\n save()\n updateTotalItems(event)\n updateTotalPrice()\n}", "title": "" }, { "docid": "191c0f1587e231b2aab9b0aa9c317fdf", "score": "0.69211125", "text": "function updatedPrice(id,price,numberOfItems)\n{\n if((numberOfItems> 0) && isFinite(numberOfItems))\n {\n var updatedPrice = getTextFieldValue(id) + price; \n document.getElementById(id).innerText = updatedPrice;\n console.log(updatedPrice);\n \n var subtotalPrice = getTextFieldValue('subtotal-bill') + price;\n document.getElementById('subtotal-bill').innerText = subtotalPrice;\n console.log('Subtotal '+subtotalPrice);\n \n var tax = subtotalPrice * 0.1\n document.getElementById('tax').innerText = tax;\n \n var newTotal = subtotalPrice + tax;\n document.getElementById('total-bill').innerText = newTotal;\n }\n\n}", "title": "" }, { "docid": "0e37becf066a01d32830fddb06f9c55e", "score": "0.6911355", "text": "function updateRowTotal(input){\r\n var row = input.parentElement.parentElement;\r\n var rowPriceEl = row.getElementsByClassName('cart-row-col')[0];\r\n var rowTotalEl = row.getElementsByClassName('cart-row-col')[2];\r\n var price = parseFloat(rowPriceEl.innerText.replace('$', ''));\r\n rowTotalEl.innerText = '$' + Math.round(price * input.value * 100) / 100;\r\n\r\n updateCartTotal();\r\n}", "title": "" }, { "docid": "695eea1df419f5b8d05f61a6e0b1be0b", "score": "0.6901203", "text": "function update_quantity(item)\r\n {\r\n var total = 0;\r\n for(var i = 0; i < 4; i++)\r\n {\r\n if(items[i].item == item)\r\n {\r\n let qty_name = item + \"_quantity\";\r\n let edit = document.getElementById(qty_name);\r\n items[i].quantity = edit.value;\r\n document.getElementById(item).className = \"badge badge-primary\";\r\n }\r\n total += items[i].quantity * items[i].price;\r\n\r\n }\r\n // Calculate the total amount for an order\r\n document.getElementById(\"total\").textContent = total.toFixed(2);\r\n document.getElementById(\"tax\").textContent = (total * 0.06).toFixed(2);\r\n document.getElementById(\"order-total\").textContent = (total + total * 0.06).toFixed(2); \r\n // Above line of code is not working.\r\n }", "title": "" }, { "docid": "81760cdd132dd94f8c578c07da401029", "score": "0.6888916", "text": "function totalUpdate() {\n var economyClassQuantity = document.getElementById('economyclassTicket-quantity').value\n var firstClassQuantity = document.getElementById('firstclassTicket-quantity').value\n var subtotal = firstClassQuantity * 150 + economyClassQuantity * 100;\n document.getElementById('subPrice').innerText = subtotal\n var tax = subtotal * 0.1\n document.getElementById('tax').innerText = tax\n var total = subtotal + tax\n document.getElementById('totalPrice').innerText = total\n return total\n}", "title": "" }, { "docid": "f08b14105627a893defef22502de8884", "score": "0.687338", "text": "function updateInvoiceSelectedItemSubtotal(n) \n{\n var selectedQty = $('#selected-'+n+'-itemQty').val();\n var selectedPrice = $('#selected-'+n+'-itemPrice').val();\n var selectedSubTotal = selectedQty * selectedPrice;\n\n $('#selected-'+n+'-subTotal').val(parseFloat(selectedSubTotal).toFixed(2));\n getQuoteGrandTotal();\n}", "title": "" }, { "docid": "e441a96d80d1c950ddc3825ee69acb64", "score": "0.6865168", "text": "function updateTotal() {\n var orderItemContainer = document.getElementsByClassName('order-items')[0];\n var orderRows = orderItemContainer.getElementsByClassName('order-row');\n var total = 0;\n for (var i = 0; i < orderRows.length; i++) {\n var orderRow = orderRows[i];\n var priceElement = orderRow.getElementsByClassName('order-price')[0];\n var quantityElement = orderRow.getElementsByClassName('order-quantity-input')[0];\n var price = parseInt(priceElement.innerText.replace('Ugx', ''));\n var quantity = quantityElement.value;\n total = total + (price * quantity);\n }\n document.getElementsByClassName('order-total-price')[0].innerText = total + \" \" + \"Ugx\";\n}", "title": "" }, { "docid": "e5bc3bd75bd9bbec15f23c4afbf4d2ab", "score": "0.6856401", "text": "function recalculateSubtotal(price,qty){\n return price*qty;\n}", "title": "" }, { "docid": "e631ea842dbed1d29ec21d8bee34f179", "score": "0.6856328", "text": "function getProductTotal(field) {\n var form = field.form;\n\t\n\tif (field.value === \"\") {\n\t\tfield.value = 0;\n\t}\n\t\n\tif ( !isPosInt(field.value) ) {\n field.value = 0;\n\t} else {\n\t\tvar product = field.name.slice(0, field.name.lastIndexOf(\"_\") ); \n var price = form.elements[product + \"_price\"].value;\n\t\tvar amt = field.value * price;\n\t\tform.elements[product + \"_tot\"].value = formatDecimal(amt);\n\t\tdoTotals(form);\n\t}\n}", "title": "" }, { "docid": "0b0e41ac420bfab18ae70310e205bddc", "score": "0.6851029", "text": "function updateItemTotal(){\n let quantity = $(this).val(); // Get the item quantity\n let item = $(this).attr(\"id\"); // Get the item selected\n let total;\n \n // Find which item was updated\n if(item == \"item1\"){\n total = quantity * 24.99;\n total = total.toFixed(2);\n $(\"#total1\").html(`${total}`);\n } \n else if(item == \"item2\"){\n total = quantity * 10.00;\n total = total.toFixed(2);\n $(\"#total2\").html(`${total}`);\n } \n else if(item == \"item3\"){\n total = quantity * 24.99;\n total = total.toFixed(2);\n $(\"#total3\").html(`${total}`);\n }\n \n updateSubtotal();\n updateTax();\n updateFinalTotal();\n }", "title": "" }, { "docid": "226132b0b81a9d086eb6d2a5e854276e", "score": "0.6845114", "text": "function updateSubtot($product) {\n // Iteration 1.1\n // quantity of selected product:\n let quantity = $product.querySelector('.qty > label > input').value;\n // unit price of selected product:\n let unitPrice = $product.querySelector('.pu span').innerHTML;\n // total price of selected product:\n let total = quantity * parseInt(unitPrice);\n // display the subtotal price of the selected product:\n $product.querySelector('.subtot span').innerHTML = total;\n // console.log(total);\n return total;\n}", "title": "" }, { "docid": "868add0155c97e6acb098ac812067fec", "score": "0.6824289", "text": "function calculateSum(){\n var totalTickets = parseInt(document.getElementById('qty').value);\n \n if (isNaN(totalTickets)){\n console.log('User did not enter a valid quantity.');\n document.getElementById('qty').focus();\n document.getElementById('qty').select();\n return false;\n }\n\n var ticketPrice = 20;\n salePrice = price * totalTickets;\n document.getElementById('totalPrice').value = salePrice.toFixed(2);\n\n \tdocument.getElementById('totalPrice').innerHTML = salePrice.toFixed(2);\n\t\t\treturn true;\n\t\t\t}", "title": "" }, { "docid": "287e8746ceccc81f12492b27d607fca5", "score": "0.680708", "text": "function handleProductChange(product, isIncrease) {\n const productInput = document.getElementById(product + 'Quantity');\n const productCount = parseInt(productInput.value);\n let newProduct = productCount;\n if (isIncrease == false && productCount > 0) {\n newProduct = productCount - 1;\n }\n if (isIncrease == true) {\n newProduct = productCount + 1;\n }\n\n productInput.value = newProduct;\n let productPrice = 0;\n let subtotal = 0;\n let total = 0;\n if (product == 'case') {\n productPrice = newProduct * 59;\n\n }\n if (product == 'phone') {\n productPrice = newProduct * 1219;\n }\n document.getElementById(product + 'Price').innerText = productPrice;\n calculateTotal();\n}", "title": "" }, { "docid": "18dac652d57922bb4a256b411bf49e84", "score": "0.68052137", "text": "function pb_increase(context, amount) {\n var data = cart_table.row( $(context).parents('tr') ).data();\n var target = '#product-quantity-'+data.productId;\n var result = parseInt($(target).val())+amount;\n if (result > 0 && result <= data.stock) {\n $(target).val(result);\n basket_increase_amount(data.productId, amount);\n }\n}", "title": "" }, { "docid": "4c0af60579cdd9fd1d7ea850f58d51c8", "score": "0.679229", "text": "function _productChanged(rowNumber, taxPercentage)\n{\n unitPrice = dojo.byId(\"unit_price[\" + rowNumber + \"]\").value;\n quantity = dojo.byId(\"quantity[\" + rowNumber + \"]\").value;\n beforeTax = unitPrice * quantity;\n tax = (beforeTax * taxPercentage) / 100;\n lineTotal = beforeTax + tax;\n amount = dojo.byId('amount[' + rowNumber + ']');\n amount.value = lineTotal;\n\n}", "title": "" }, { "docid": "3f15c420a153e8a1e97840ff98ec13d6", "score": "0.6788605", "text": "function updateTotal2(e) {\n // 'this' is reference to checkbox clicked on\n var form = this.form;\n\n // get current value in total text box, using parseFloat since it is a string\n var val = parseFloat( form.elements['price_for_fruit'].value );\n\n // if check box is checked, add its value to val, otherwise subtract it\n if ( this.checked ) {\n val += parseFloat(this.value);\n } else {\n val -= parseFloat(this.value);\n }\n\n // format val with correct number of decimal places\n // and use it to update value of total text box\n form.elements['price_for_fruit'].value = formatDecimal2(val);\n}", "title": "" }, { "docid": "511871dddf62c2b5f2c8c65e1f8d4155", "score": "0.67696154", "text": "function plus_cart(productId) {\n\n var productId = productId;\n var id = productId+'qty';\n\n var incQty = $('#'+id+'').val();\n \n var incValue = parseInt(incQty) + 1;\n\n $('#'+id+'').val(incValue);\n manage_cart(productId, type='update');\n\n var price = $('#'+productId+'-price').text();\n var total = parseInt(price) * parseInt(incValue);\n $('#'+productId+'-subtotal').text(total);\n\n\n var grandTotal = $('#grandTotal').text();\n var finalGrandTotal = parseInt(grandTotal) + parseInt(price);\n $('#grandTotal').text(finalGrandTotal);\n\n}", "title": "" }, { "docid": "baf4f6c10b7aa98133752f6d558dafb7", "score": "0.6758302", "text": "function totalPrice(e){\n let item = e.target.parentNode.previousSibling;\n let price=e.target.parentNode.nextSibling.nextSibling.nextSibling.firstChild;\n let tprice=price.parentNode.nextSibling.nextSibling.firstChild;\n tprice.innerHTML=price.textContent*item.textContent +\".00\";\n Ntotal();\n}", "title": "" }, { "docid": "6e206e9c4ecea08577f7371cf70ac420", "score": "0.6748497", "text": "function calculateTotal(){\n const ticket1Count=getInputValue('ticket-1');\n const ticket2Count=getInputValue('ticket-2');\n \n const totalPrice=ticket1Count*150 + ticket2Count*100;\n document.getElementById('total-price').innerText='$'+ totalPrice;\n \n const text=Math.round(totalPrice*0.1);\n document.getElementById('text-amount').innerText='$'+text;\n \n const grandTotal=totalPrice+text;\n document.getElementById('grand-total').innerText='$'+grandTotal;\n \n }", "title": "" }, { "docid": "1afcbac4d42b837241cf6eab46c7c9e7", "score": "0.674403", "text": "function calcsqprice(){\n\t\t$(\".dimclass\").change(function(){\n\t\t myval = parseFloat($(this).val());\n\t\t alert(myval);\n\t\t});\t\n\t\n\t}", "title": "" }, { "docid": "98bb244e5f14d6459229df34269c4c29", "score": "0.6737797", "text": "function updateSubtot($product) {\n //PRECIO\n const unitaryPriceStr = $product.querySelector(\".pu span\").innerText;\n const unitaryPrice = parseFloat(unitaryPriceStr);\n // console.log(unitaryPrice)\n\n //CANTIDAD\n const quantity = $product.querySelector(\".qty\");\n const quantityValue = parseFloat(quantity.querySelector(\"input\").value);\n // console.log(quantityValue)\n\n //MULTIPLICACION\n const subtotal = unitaryPrice * quantityValue;\n // console.log(result)\n console.log(subtotal);\n $product.querySelector(\".subtot span\").innerHTML = subtotal;\n return subtotal;\n}", "title": "" }, { "docid": "b7f1e5a5be1081393449766c39bf2a15", "score": "0.67208964", "text": "function totalPrice(item) {\n var subTotal0 = item0Price * quantity0\n}", "title": "" }, { "docid": "0760ec25f31137af9ca7b9356775e3d8", "score": "0.67170674", "text": "function calculatePrice(prId) {//با تغییر تعداد هر کالای موجود در سبد خرید مجموع قیمت آن کالا تغییر می کند\r\n var unitPrice = $(\"#prRowTr\" + prId + \" .unitPrice\").html();\r\n var num = $(\"#prRowTr\" + prId + \" .inputNum\").val();\r\n $(\"#prRowTr\" + prId + \" .sumPrice\").html(parseInt(unitPrice) * num);\r\n refreshSumPrice();\r\n}", "title": "" }, { "docid": "15d1549e239392b24835b79973fe8a1f", "score": "0.66906565", "text": "function updateTotal(){\n // Getting the table row of item\n var itemRow = $('tbody tr');\n // console.log(itemRow);\n // Getting all the price of every row and calculating total\n var total = 0;\n itemRow.each(function(){\n\tvar cartPrice = $(this).find('.food-price').text();\n\tvar cartQuantity = $(this).find('.cart-quantity').val();\n\t//console.log(cartPrice, cartQuantity);\n\tvar quantity = cartQuantity;\n\t// Chaking error \n\tif (isNaN(quantity) || quantity <= 0) {\n\t $(this).find('.cart-quantity').val(1);\n\t quantity = 1;\n\t}\n\ttotal += parseFloat(cartPrice) * parseFloat(quantity);\n\t//console.log(total);\n });\n total = total.toFixed(2);\n $('#cart-total').val(total);\n $('.cart-total').text(total);\n}", "title": "" }, { "docid": "389ddd9aad3aadf92c1093eaf7297497", "score": "0.66901577", "text": "updatePrice() { }", "title": "" }, { "docid": "04185f3a0d45f4c9920200212deddf4f", "score": "0.66886115", "text": "function totalPur() {\n var total = 0;\n $.each(ids, function (index, value) {\n var subPrice = parseFloat($(\"#proSubPrice-\" + value).val());\n total = total + subPrice;\n });\n $(\"#totalPrice\").text(parseFloat(total));\n}", "title": "" }, { "docid": "cb72e2e80ac017b9ce5232116bc5da8f", "score": "0.6678452", "text": "function updateTotal1(e) {\n // 'this' is reference to checkbox clicked on\n var form = this.form;\n\n // get current value in total text box, using parseFloat since it is a string\n var val = parseFloat( form.elements['price_for_fastfood'].value );\n\n // if check box is checked, add its value to val, otherwise subtract it\n if ( this.checked ) {\n val += parseFloat(this.value);\n } else {\n val -= parseFloat(this.value);\n }\n\n // format val with correct number of decimal places\n // and use it to update value of total text box\n form.elements['price_for_fastfood'].value = formatDecimal1(val);\n}", "title": "" }, { "docid": "d7785a9ae606618660105e95606c1744", "score": "0.6678355", "text": "function updatepolloTotal(form) {\r\nvar cantidad = parseInt(document.getElementById('cantidad').value);\r\n \r\nvar sz_tot = parseFloat(form.elements['sz_tot'].value);\r\nvar tops_tot = parseFloat(form.elements['tops_tot'].value);\r\n\r\nform.elements['total'].value = formatDecimal( ( cantidad*sz_tot) + tops_tot);\r\n\r\n}", "title": "" }, { "docid": "f44cf9ecfaa79793988055c080ce9299", "score": "0.6675941", "text": "function updateTotal3(e) {\n // 'this' is reference to checkbox clicked on\n var form = this.form;\n\n // get current value in total text box, using parseFloat since it is a string\n var val = parseFloat( form.elements['price_for_stationary'].value );\n\n // if check box is checked, add its value to val, otherwise subtract it\n if ( this.checked ) {\n val += parseFloat(this.value);\n } else {\n val -= parseFloat(this.value);\n }\n\n // format val with correct number of decimal places\n // and use it to update value of total text box\n form.elements['price_for_stationary'].value = formatDecimal3(val);\n}", "title": "" }, { "docid": "62b82c6b560a212284e914557f890b7b", "score": "0.6672289", "text": "function updateTotal4(e) {\n // 'this' is reference to checkbox clicked on\n var form = this.form;\n\n // get current value in total text box, using parseFloat since it is a string\n var val = parseFloat( form.elements['price_for_fashion'].value );\n\n // if check box is checked, add its value to val, otherwise subtract it\n if ( this.checked ) {\n val += parseFloat(this.value);\n } else {\n val -= parseFloat(this.value);\n }\n\n // format val with correct number of decimal places\n // and use it to update value of total text box\n form.elements['price_for_fashion'].value = formatDecimal4(val);\n}", "title": "" }, { "docid": "90c8251751dae27c95f3b6e9f56ede52", "score": "0.6669683", "text": "function updatePriceContainer(sub,num) {\n\tconst HST = Math.round((sub * 0.13) * 100) / 100;\n\tconst totalCost = parseFloat(sub) + parseFloat(HST);\n\n\tconsole.log(sub, HST, totalCost)\n\n\tsubtotal.innerText = \"$\" + parseFloat(sub).toFixed(2);\n\tnumItems.innerText = \"(\" + parseInt(num) + \" items)\";\n\ttax.innerText = \"$\" + HST.toFixed(2);\n\ttotal.innerText = \"$\" + parseFloat(totalCost).toFixed(2);\n}", "title": "" }, { "docid": "09cfec676bd7813f9b7c58d05945d340", "score": "0.6663636", "text": "function onChangedCountProduct(product, price) {\n const inputValue = document.getElementById(product + '-value');\n let productNumber = parseInt(inputValue.value);\n calculateProductPrice(product, price, productNumber);\n}", "title": "" }, { "docid": "06b1998176a346bc97fe917c9c883637", "score": "0.6662601", "text": "function updateCartTotal(){\r\nvar cartItemContainer=document.getElementsByClassName('cart-items')[0];\r\n\r\nvar cartRows=cartItemContainer.getElementsByClassName('cart-row');\r\nvar total=0;\r\nfor (var i = 0; i < cartRows.length; i++) {\r\n var cartRow = cartRows[i];\r\n var priceElement=cartRow.getElementsByClassName('cart-price')[0];\r\n var quantityElement=cartRow.getElementsByClassName('cart-quantity-input')[0];\r\n var price=parseFloat(priceElement.innerText.replace('$',''));\r\n var quantity=quantityElement.value;\r\n total=total+(price*quantity);\r\n \r\n \r\n}\r\ntotal=Math.round(total*100) / 100\r\ndocument.getElementsByClassName('cart-total-price')[0].innerText='$'+total;\r\n}", "title": "" }, { "docid": "53d5112bdee504f232d5146b1776dc73", "score": "0.6661068", "text": "function reCalculateIncrease(id) {\n //get price for peice\n // #P_id is id div for price & substring to remove $ sign\n var price = parseInt(\n $(\"#P_\" + id)\n .text()\n .substring(1)\n );\n //get quantity\n var pecies = parseInt($(\"#V_\" + id).val()) + 1;\n $(\"#V_\" + id).val(pecies);\n //edit total for pecies\n $(\"#T_\" + id).text(\"$\" + pecies * price);\n\n //edit total and sub total price\n var total = parseInt(\n $(\"#subTotal\")\n .text()\n .substring(1)\n );\n $(\"#subTotal\").text(\"$\" + (total + price));\n $(\"#total\").text(\"$\" + (total + price));\n }", "title": "" }, { "docid": "cbc47b5d705202ee5d8a753310195ab9", "score": "0.6652683", "text": "function proMulti(id) {\n var quantity = $(\"#proQuantity-\" + id).val();\n var price = $(\"#proUnitPrice-\" + id).val();\n var subPrice = quantity * price;\n $(\"#proSubPrice-\" + id).val(subPrice);\n total();\n}", "title": "" }, { "docid": "aac07381ba44f306823a43afa22be7a4", "score": "0.66480535", "text": "function updateSubtotal(product) {\n console.log('Calculating subtotal, yey!');\n let price = product.querySelector(\".price span\")\n let priceNum = +(price.innerText)\n \n \n \n let quantity = product.querySelector(\".quantity input\")\n let quantityNum = quantity.value\n \n\n let subtotal = product.querySelector('.subtotal span')\n \n\n subtotalNum = priceNum * quantityNum\n subtotal.innerHTML = subtotalNum\n //console.log(subtotalNum);\n return subtotalNum\n \n}", "title": "" }, { "docid": "d9d153444c8d2d8a50aeebb529228abb", "score": "0.66477835", "text": "function recalculateTotal(sc) {\n var total = 0;\n sc.find('selected').each(function() {\n total += price;\n });\n return total;\n }", "title": "" }, { "docid": "761f82e0115b5821e20c4875df131e14", "score": "0.6645175", "text": "function updateCartTotal() {\n var cartItemContainer = document.getElementsByClassName('cartTable')[0];\n var cartRows = cartItemContainer.getElementsByClassName('cart-item');\n var total = 0;\n for (var i = 0; i < cartRows.length; i++) {\n var cartRow = cartRows[i];\n var priceElement = cartRow.getElementsByClassName('cart-price')[0];\n var quantityElement = cartRow.getElementsByClassName('cart-amount')[0];\n var price = parseFloat(priceElement.innerText.replace('kr', ''));\n var quantity = quantityElement.value;\n console.log(price * quantity);\n total = total + (price * quantity); \n }\n total = Math.round(total * 100) / 100;\n document.getElementsByClassName('cart-total')[0].innerText = 'Totalt: ' + total + ' kr';\n}", "title": "" }, { "docid": "af13f0c62410894d6fa2cea102148495", "score": "0.66434467", "text": "function updateProductQuantity() {\n var $this = $(this);\n $('.shop-analytics-single-product-details').data('quantity', $this.val());\n }", "title": "" }, { "docid": "84afc8cb6bf33b155997c8efda4bbbfa", "score": "0.6643424", "text": "function calculateTotalPrice() {\n var total = 0;\n var items = $(\"#crm_cart ul li\");\n items.each(function () {\n var singlePrice = parseInt($(this).find('.price').text().trim().slice(2)) || 0;\n var amount = parseInt($(this).find('input').val()) || 0;\n total += singlePrice * amount;\n })\n items.find('.total-price').text(' ' + total + ' 元');\n }", "title": "" }, { "docid": "07041196717c8459f839f9b4201c23cd", "score": "0.6638071", "text": "function updateTotalItems(event) {\n if(event) {\n var inputValue = parseInt(event.target.value)\n var productId = parseInt(event.target.getAttribute(\"id\"))\n event.target.value = getQuantityFromInvalidQuantity(productId, inputValue)\n }\n\n var totalItems = getTotalItemsLocalStorage()\n var total_items = document.getElementsByName(\"total-items\")[0]\n total_items.innerText = totalItems\n}", "title": "" }, { "docid": "5bd10774aec2b169b33214bc0cb1d359", "score": "0.66359484", "text": "function proMultiQuo(id) {\n var quantity = $(\"#proQuantity-\" + id).val();\n var price = $(\"#proUnitPrice-\" + id).val();\n var subPrice = quantity * price;\n $(\"#proSubPrice-\" + id).val(subPrice);\n totalQuo();\n}", "title": "" }, { "docid": "7f67e563f708e8bc0e92f90323fba64b", "score": "0.66336673", "text": "function updateQuantity(e) {\n if (e.target.classList.contains(\"quantity\")) {\n let input = e.target;\n\n //input validation: quantity must be a number between 1 and max.stock\n if (isNaN(input.value) || input.value <= 0) {\n input.value = 1;\n }\n\n //send the changed quantity of a product from the input field to local storage\n let idInput = e.target.getAttribute(\"id\");\n let cart = JSON.parse(localStorage.getItem(\"cart\"));\n\n for (let i = 0; i < cart.length; i++) {\n if (cart[i].id === idInput) {\n cart[i].qt = Number(input.value);\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n }\n }\n\n calculateTotalPrice();\n ui.navCartIconCounter();\n }\n}", "title": "" }, { "docid": "48a118975a9577ed9c7fc1ed4a23124b", "score": "0.6629894", "text": "function totalUpdate() {\n let mobilePrice =\n parseInt(document.getElementById(\"phone-quantity\").value) * 1219;\n let casePrice = parseInt(document.getElementById(\"case-quantity\").value) * 59;\n let subtotal = mobilePrice + casePrice;\n let tax = subtotal / 10;\n let total = subtotal + tax;\n\n document.getElementById(\"subtotal\").innerText = subtotal;\n document.getElementById(\"tax\").innerText = tax;\n document.getElementById(\"total\").innerText = total;\n}", "title": "" }, { "docid": "3dd354f7d11461ee1a4a3fcab7d72be6", "score": "0.66287637", "text": "function editQuant(ev, table, tableId, fn){\n key = ev.parentNode.parentNode.children[1].innerHTML;\n if(Number(ev.value) === 0){\n delete table[key];\n }\n else{\n table[key][0] = Number(ev.value);\n }\n var ctr = document.getElementById(tableId);\n var amount = 0;\n var item = 0;\n for(var i = 0; i < Object.keys(table).length; i++){\n amount += table[Object.keys(table)[i]][0]*table[Object.keys(table)[i]][1];\n item += table[Object.keys(table)[i]][0];\n }\n ctr.children[1].lastChild.innerHTML = amount;\n ctr.children[2].firstChild.innerHTML = item;\n fn();\n\n}", "title": "" }, { "docid": "ecb012a6096a5ebffea02fca4ad51c2f", "score": "0.6624976", "text": "function total() {\n var total = 0;\n $.each(ids, function (index, value) {\n var subPrice = parseFloat($(\"#proSubPrice-\" + value).val());\n total = total + subPrice;\n });\n $(\"#totalPrice\").text(parseFloat(total));\n}", "title": "" }, { "docid": "aef99d3ccafaf4ccfdff31be8ffaf69c", "score": "0.66145515", "text": "function updateTotalPrice(num) {\n totalPrice += num;\n totalPriceDOM.innerHTML = `Total : $${totalPrice.toFixed(2)}`;\n}", "title": "" }, { "docid": "78e6a9e1775ef56ad63723738e478603", "score": "0.6607981", "text": "lotChanged () {\n const page = this.page\n const lots = parseInt(page.lotField.value)\n if (lots <= 0) {\n page.lotField.value = 0\n page.qtyField.value = ''\n return\n }\n const lotSize = this.market.baseCfg.lotSize\n page.lotField.value = lots\n page.qtyField.value = (lots * lotSize / 1e8)\n }", "title": "" }, { "docid": "7db21f9bd002986f70a4d42f49cca65a", "score": "0.6607282", "text": "function updateQuantity() {\n let quantityInputs = document.getElementsByClassName(\"quantity-input\");\n for (let i = 0; i < quantityInputs.length; i++) {\n let input = quantityInputs[i];\n input.addEventListener(\"change\", quantityChanged);\n }\n\n function quantityChanged(e) {\n let input = e.target;\n let stock = parseFloat(document.getElementById(\"stock\").innerText);\n if (isNaN(input.value) || input.value <= 0) {\n input.value = 1;\n }\n\n if (input.value > stock) {\n input.value = stock;\n }\n }\n}", "title": "" }, { "docid": "6235cf85cf75184b18afdb8c13752b38", "score": "0.6606235", "text": "function handleTotalCost($fieldset, $input, checked) {\n const priceRegex = /\\$\\d+/i; // regex to find price value\n // get price from activity label\n const activityPrice = $input.parent().text().match(priceRegex)[0].slice(1);\n let $totalElement = $fieldset.children('h3'); // look for total element\n\n if ($totalElement.length === 0) {\n $fieldset.append(`<h3>Total: $${activityPrice}</h3>`);\n } else {\n let total = $totalElement.text().match(priceRegex)[0].slice(1); // get price from total element\n total = parseInt(total);\n total = checked ? total + parseInt(activityPrice) : total - parseInt(activityPrice);\n $totalElement.text(`Total: $${total}`);\n }\n}", "title": "" }, { "docid": "9536414ca6587a248c00e2379ffab429", "score": "0.66000086", "text": "function updateTotalPrices() {\n document.getElementById(\"total-value\").innerText = \"£\" + getTotal();\n document.getElementById(\"checkout-total-value\").innerText = \"£\" + getTotal();\n}", "title": "" }, { "docid": "a88355c6e5446b5c1ae96b88cd3d4ff5", "score": "0.6598693", "text": "function updateTotal5(e) {\n // 'this' is reference to checkbox clicked on\n var form = this.form;\n\n // get current value in total text box, using parseFloat since it is a string\n var val = parseFloat( form.elements['price_for_electronics'].value );\n\n // if check box is checked, add its value to val, otherwise subtract it\n if ( this.checked ) {\n val += parseFloat(this.value);\n } else {\n val -= parseFloat(this.value);\n }\n\n // format val with correct number of decimal places\n // and use it to update value of total text box\n form.elements['price_for_electronics'].value = formatDecimal5(val);\n}", "title": "" }, { "docid": "5cd2c3fce8ad30d08d91fc39d8081f78", "score": "0.65946424", "text": "function updateCost(e) {\n\n // 'this' reffered to checkbox clicked on\n var myForm = this.form;\n\n // include current value in total-cost block, use parseFloat method to convert string to number\n var val = parseFloat(myForm.elements['total-cost'].value);\n\n // Add the checkbox value to total value if checkbox is checked\n if (this.checked) {\n val += parseFloat(this.value);\n } \n else {\n val -= parseFloat(this.value);\n }\n\n // update total-cost value with latest value\n myForm.elements['total-cost'].value = val\n }", "title": "" }, { "docid": "351a641b9db268b2cf20376d4782f0c8", "score": "0.6594543", "text": "function updateSubtot($product) { //productElement instead of $product\n // Iteration 1.1\n // if($product.querySelector(\"tr\")===){\n let price=$product.querySelector(\".pu span\").innerHTML\n console.log(price)\n let qtyInput=$product.querySelectorAll(\".qty input\")[0]\n console.log(qtyInput.value)\n // }\n \n let subTotal=$product.querySelector(\".subtot span\").innerHTML\n subTotal=price*qtyInput.value\n return $product.querySelector(\".subtot span\").innerHTML=subTotal\n //Quantity Inputs\n \n}", "title": "" }, { "docid": "c47f7252883f735473bf0e8ba1f2c195", "score": "0.6584096", "text": "function editCalculateTotalAmount()\n{\n\tvar tableProductLength = $(\"#editSubExpensesTable tbody tr\").length;\n\tvar totalAmount = 0;\n\tfor(x = 0; x < tableProductLength; x++) {\n\t\tvar tr = $(\"#editSubExpensesTable tbody tr\")[x];\n\t\tvar count = $(tr).attr('id');\n\t\tcount = count.substring(3);\n\t\t\t\t\t\n\t\ttotalAmount = Number(totalAmount) + Number($(\"#editSubExpensesAmount\"+count).val());\n\t} // /for\n\n\ttotalAmount = totalAmount.toFixed(2);\n\n\t// sub total\n\t$(\"#editTotalAmount\").val(totalAmount);\n\t$(\"#editTotalAmountValue\").val(totalAmount);\n\t\n}", "title": "" }, { "docid": "2988e9b683776340ec5c0dd4f1918e79", "score": "0.65779376", "text": "function updateTotalCartPricing() {\n $('.cart .pricing').text(formatAsMoney(cart.subtotal));\n }", "title": "" }, { "docid": "05442ffd22f19e83e8aaeef6196eece3", "score": "0.6575746", "text": "function updateTotal() {\n\n let items = document.querySelectorAll(\"#cart ul li.item\");\n let total = 0;\n for (let item of items) {\n let price = item.querySelector(\".product-price\").textContent;\n let amount = item.querySelector(\".amount\").value;\n total += parseInt(price) * amount;\n }\n let totalElement = document.querySelector(\".total span\");\n totalElement.textContent = total;\n}", "title": "" }, { "docid": "5ed58f3a0a918aa1e7535e355d139ecb", "score": "0.65705055", "text": "function changeTotalPrice(quantity) {\n var chosenGlaze = document.querySelector('input[name=\"glaze\"]:checked').value;\n if (chosenGlaze == \"none\") {\n let totalPrice = 3.25*quantity;\n document.getElementById(\"rollprice\").innerHTML = \"$\" + totalPrice.toFixed(2);\n }\n else {\n let totalPrice = (3.25+0.50)*quantity;\n document.getElementById(\"rollprice\").innerHTML = \"$\" + totalPrice.toFixed(2);\n }\n}", "title": "" }, { "docid": "e4cb2d41d079af0c23742b31d6ec4a81", "score": "0.6570033", "text": "function updateQuantity(event) {\n event.preventDefault();\n event.target.classList.add('changed');\n const id = Number(event.target.classList[1]);\n const newQuantity = Number(event.target.value);\n for (let i = 0; i < cart.length; i++) {\n if (cart[i].product.id === id) {\n cart[i].quantity = newQuantity;\n summary(cart);\n const cartQuantityHeader = document.querySelector('.cart-quantity-header');\n cartQuantityHeader.textContent = summary(cart)[0];\n shoppingCart(event);\n return;\n }\n }\n}", "title": "" }, { "docid": "fdcce801f028031dee3eb624fe3b6591", "score": "0.65578866", "text": "function updateSubtot(products) {\n\n let unitPrice = document.querySelectorAll('.pu > span');\n let qty = document.querySelectorAll('.qty input[type=number]');\n let subtotal = document.querySelectorAll('.subtot > span');\n let total = 0;\n\n\n if (unitPrice !== []) {\n for (let i = 0; i<products.length; i++){\n total = parseFloat(unitPrice[i].innerText) * parseFloat(qty[i].value);\n subtotal[i].innerHTML = total;\n }\n }\n}", "title": "" }, { "docid": "aaeb485dd2537bf681b194418dc0f882", "score": "0.6556164", "text": "function quantityChanged(event) {\n let input = event.target;\n let name = input.dataset.name;\n if (isNaN(input.value) || input.value <= 0) {\n input.value = 1;\n }\n\n //Update cart object Quantity\n cart.forEach((item, index) => {\n if (item.name === name) {\n cart[index].quantity = input.value;\n }\n });\n\n //Save cart to storage\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n\n //Recalculate total\n updateCartTotal();\n }", "title": "" }, { "docid": "e9265a3eb71bc6264f88c4ef6a689293", "score": "0.6553459", "text": "function Total ()\n{\n let learningQty=parseFloat($(\"#learningQty\").val());\n let learningTotal=learningQty * 39.99;\n $(\"#total\").text(learningTotal);\n\n let jqueryDonation=parseFloat($(\"#jqueryDonation\").val());\n let jQueryTotal=jqueryDonation * 14.99;\n $(\"#itemTotal\").text(jQueryTotal);\n\n let grandTotal= learningTotal + jQueryTotal;\n $(\"#grandTotal\").text(grandTotal.toFixed(2));\n}", "title": "" }, { "docid": "54354f77725497907c522651d8c82903", "score": "0.6542721", "text": "function modifyItemNumber(btnObj, qty, op){\n var itemQty = parseInt(btnObj.parent().find('input').val());\n itemQty = op=='+'?(itemQty+qty):(itemQty-qty);\n btnObj.parent().find('input').val(itemQty);\n validateItemQty(btnObj.parent().find('input'));\n calculateTotalPrice();\n }", "title": "" }, { "docid": "b984b84f44dac4e5d2afc147ca83bec8", "score": "0.6541699", "text": "function updateNumber() {\n total = 0;\n let cartRowContainer = document.getElementsByClassName(\"sliding-menu\")[0];\n let cartRow = cartRowContainer.getElementsByClassName(\"main-cart\");\n console.log(cartRow);\n for (let i = 0; i < cartRow.length; i++) {\n let Row = cartRow[i];\n let priceElement = Row.getElementsByClassName(\"cart-price\")[0];\n let quantityElement = Row.getElementsByClassName(\"cart-quantity\")[0];\n let itemPrice = parseFloat(priceElement.innerText.replace(\"$\", \" \"));\n\n let itemQuantity = quantityElement.value;\n console.log(itemPrice);\n console.log(itemQuantity);\n total += itemPrice * itemQuantity;\n }\n let finalTotal = Math.round(total);\n let TotalElement = (document.querySelector(\".cart-total .cart-total-amt\").innerText = \"$\" + finalTotal);\n console.log(TotalElement);\n}", "title": "" } ]
d164e2a5a0bd4057fc8e6b361de91b09
show function for the ball
[ { "docid": "0a57e65c5d55d49305a01d20938b198d", "score": "0.68508184", "text": "show(){\n fill(237,34,94)\n \n ellipse(this.pos.x,this.pos.y,this.r*2)\n }", "title": "" } ]
[ { "docid": "e44d492a8a952c11ee4d01dfa62c1c8c", "score": "0.7918927", "text": "function display() {\n\tstroke(255);\n\tstrokeWeight(4);\n\tfill(200, 0, 200);\n\tellipse(ball.x, ball.y, 24, 24);\n}", "title": "" }, { "docid": "7173963d964b8772fdbe9d0536fb195f", "score": "0.7855488", "text": "function displayBall() {\n // Draw the ball\n ellipse(ball.x, ball.y, ball.size);\n}", "title": "" }, { "docid": "024f055a9b874903c2007dd053896e58", "score": "0.7837003", "text": "function displayBall() {\n // Draw the ball\n push();\n fill(0,255,0);\n ellipse(ball.x, ball.y, ball.size, ball.size);\n pop();\n}", "title": "" }, { "docid": "b6c179b5f79b90700166d334156a04ff", "score": "0.7788247", "text": "displayBalls(ball) {\n push();\n fill(255, 50, 50);\n stroke(0);\n ellipse(ball.x, ball.y, ball.size);\n pop();\n }", "title": "" }, { "docid": "12ada0bcebbe9778f2e745111a7b5967", "score": "0.7769854", "text": "function displayBall() {\n // Displaying the ball as an image now\n image(ballImage, ball.x, ball.y, ball.size, ball.size);\n}", "title": "" }, { "docid": "0c46a15015e18721ad9e50760f45e2ce", "score": "0.7717844", "text": "function displayBall() {\n\n ////////////////// NEW /////////////////////\n image(ball.image,ball.x,ball.y,ball.size,ball.size);\n //////////////// END NEW //////////////////\n}", "title": "" }, { "docid": "a54c2b995f12c6011dfeba7abe852ff4", "score": "0.75759363", "text": "function showBall()\r\n{\r\n\tballTx.clearRect(0, 0, 800, 600);\r\n\r\n\tfor (ball of ballList){\r\n\t\tif(ball.showOrNot){\r\n ball.drawBall();\r\n\t\t}\r\n }\r\n \r\n}", "title": "" }, { "docid": "68ba4103029b0ec34b1c105f1565b1c3", "score": "0.73981315", "text": "function showBall() {\r\n ctx.beginPath();\r\n ctx.arc(ball.x, ball.y, ball.r, 0, Math.PI * 2);\r\n ctx.fillStyle = \"#000\";\r\n ctx.fill();\r\n ctx.closePath();\r\n}", "title": "" }, { "docid": "4a776d0e79c9c4e40bbe749ce89ca06f", "score": "0.72711796", "text": "show() {\n\n // Draw a triangle rotated in the direction of velocity\n const angle = window['p'].angleToPoint(this.x, this.y, this.x + this.vx, this.y + this.vy) + window['p'].HALF_PI;\n const color = window['p'].activationColor(this.brain.score, window.highestScore);\n\n window['p'].push();\n window['p'].translate(this.x, this.y);\n window['p'].rotate(angle);\n\n window['p'].fill(color);\n window['p'].beginShape();\n window['p'].vertex(0, -this.r * 2);\n window['p'].vertex(-this.r, this.r * 2);\n window['p'].vertex(this.r, this.r * 2);\n window['p'].endShape(window['p'].CLOSE);\n\n window['p'].pop();\n }", "title": "" }, { "docid": "ea07628b7470aed430a9de959a899318", "score": "0.72438544", "text": "showBallLocation(){\n\n super.drawBall(images[gameImage.BALL]);\n\n }", "title": "" }, { "docid": "6d545b648e4b1f10016d2d9677ef697e", "score": "0.7242189", "text": "show() {\r\n\t\tfill(this.color);\r\n\t\tellipse(this.pos.x, this.pos.y, this.size);\r\n\t\tif (this.king) { // Draws a dot in the center of the circle if we are a king\r\n\t\t\tfill(0);\r\n\t\t\tellipse(this.pos.x, this.pos.y, 5, 5);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "f3b79f08a9adab28faf4471345f44286", "score": "0.71107423", "text": "function draw(){\n background(140);\n ball.update();\n ball.display();\n}", "title": "" }, { "docid": "4be00b9b0c8c4078b544b926ca0157ce", "score": "0.71094924", "text": "function debug() {\n blur = false\n text(`ball : ${round(balls[0].x)},${round(balls[0].y)}`\n ,140,200) \n text(`l: ${round(paddles[0].x)},${round(paddles[0].y)}`\n ,80,200) \n text(`r: ${round(paddles[1].x)},${round(paddles[1].y)}`,220,200) \n}", "title": "" }, { "docid": "ecb9c8ed1b34e539517cfbbbedc48530", "score": "0.7088407", "text": "drawBall(){\n \tstroke(0);\n strokeWeight(1);\n \tfill(color(this.ballColor));\n\t\t ellipse(this.x,this.y,10,10);\n\t}", "title": "" }, { "docid": "4700f0a7fd6bded4bab416960c98da34", "score": "0.7052305", "text": "function display(){\r\n // Score tag at top-left corner\r\n let scoretag = 'Score: ' + score.toString();\r\n textSize(32);\r\n fill(0, 102, 153);\r\n text(scoretag, 20, 40);\r\n\r\n // Timer tag at top-right corner\r\n let timetag = 'Time: ' + timer.toString();\r\n textSize(32);\r\n fill(0, 102, 153);\r\n text(timetag, 500, 40);\r\n\r\n // Draw a falling ball\r\n stroke(50);\r\n fill(100);\r\n ellipse(x, y, 24, 24);\r\n}", "title": "" }, { "docid": "089282fa3d4f3e11dbfb55b7189897d6", "score": "0.702327", "text": "showBalls(){\n // fill(this.color) //I can uncomment this line to fill each ball with one color only, but I want them to change color constantly so\n //so I i make them change color inside draw() \n circle(this.positionX, this.positionY, this.radius)\n }", "title": "" }, { "docid": "64a0a515c272877fae8bae95e1019c4b", "score": "0.7017414", "text": "show() {\n stroke(255);\n strokeWeight(1);\n text(this.n + \" \" + this.t, this.x+30, this.y);\n strokeWeight(4);\n ellipse(this.x, this.y, 20);\n }", "title": "" }, { "docid": "5b541cddd7e5624a64242b7b53a99066", "score": "0.7014076", "text": "show() {\n noStroke();\n if (this.isFood) {\n ellipse(this.pos[0], this.pos[1], 8);\n } else {\n fill(144, 238, 144);\n image(ROCK, this.pos[0], this.pos[1], this.radius * 2, this.radius * 2);\n // ellipse(this.pos[0], this.pos[1], this.radius * 2);\n fill(255, 255, 255);\n }\n }", "title": "" }, { "docid": "58659843dba42aa63fed599c620e9b34", "score": "0.6964191", "text": "show() {\n fill(this.red, this.green, this.blue);\n stroke(this.red, this.green, this.blue);\n push();\n var pos = this.body.position;\n translate(pos.x, pos.y);\n ellipse(0, 0, this.r * 2);\n pop();\n }", "title": "" }, { "docid": "637624dca879a66f5d790536bd50a09f", "score": "0.69337714", "text": "show() {\n fill(255, 252, 179);\n ellipse(this.pos.x, this.pos.y, 6, 6);\n }", "title": "" }, { "docid": "ab81c22f0fe77782b8e2e991c573f292", "score": "0.68349427", "text": "display(){\n\t\t\t\n\t\t\t//sine function variable\n\t\t\tthis.r = this.rad + this.rad * (sin(this.theta) + 1); \n\t\t\t\t\n\t\t\t//DRAW FLOWER \n\t\t\t\t\tpush(); //push matrix move flower to center \n\t\t\t\t\ttranslate(-300,0); //translate left 300\n\t\t\t\t\tdrawFlower(this.y,this.y,this.r,this.r,color(242,163,144));//flower function calling \n\t\t\t\t\tpop();\n\t\t\t\n\t\t}", "title": "" }, { "docid": "060ca63b3637afc4b7664e4964a0d526", "score": "0.680971", "text": "show() {\n if (!this.dead && !this.hunting.dead) {\n //Funcion para seleccionar el color RGB que se desea para los fantasmas\n fill(this.r, this.g, this.b);\n //Función que dibuja el elipse del fantasma en las posiciones indicadas\n //con el ancho y alto indicado por this.rad\n ellipse(this.pos.x, this.pos.y, this.rad, this.rad);\n }\n }", "title": "" }, { "docid": "d37dd47f7a08b516a86cb5f18814bdc3", "score": "0.6745835", "text": "function draw() {\n background(0);\n\n ball.display();\n ball2.display();\n ball3.display();\n ball.move('40');\n ball2.move('40');\n ball3.move('40');\n ball.edgeCheck();\n ball2.edgeCheck();\n ball3.edgeCheck();\n}", "title": "" }, { "docid": "98172a5375d732cdcdc28f2a7759f80a", "score": "0.6727058", "text": "show() {\n //if this dot is the best dot from the previous generation then draw it as a big green dot\n if (this.isBest) {\n ctx.fillStyle = 'green'\n ellipse(this.pos.x, this.pos.y, 8, 8);\n }\n else { //all other dots are just smaller black dots\n ctx.fillStyle = 'black'\n ellipse(this.pos.x, this.pos.y, 2, 2);\n }\n\n // if (this.dead && !this.reachedGoal && !this.isBest) {\n // this.erase();\n // }\n }", "title": "" }, { "docid": "02bda909e4f0fcc42825ea323485cd7b", "score": "0.672091", "text": "show() {\n push();\n noStroke();\n fill(255, 150, 0);\n translate(this.pos.x, this.pos.y);\n // We want to draw the wall from the center, instead of the top left\n rectMode(CENTER);\n rect(0, 0, this.w, this.h);\n pop();\n }", "title": "" }, { "docid": "b3977d3b28a13004056a24ae2c6c2a07", "score": "0.6710314", "text": "function draw(){\n background(140);\n ball.update();\n ball.display();\n wall.display();\n}", "title": "" }, { "docid": "40410db12747ddfe2efab26760339e00", "score": "0.66845226", "text": "show () {\n p.stroke(0);\n p.fill(this.color);\n p.triangle(this.x1, this.y1, this.x2, this.y2, this.x3, this.y3);\n p.stroke(100);\n }", "title": "" }, { "docid": "b492fa79924176d8a60cb39c30a5e338", "score": "0.6660622", "text": "function draw() {\n\n background(160);\n\n for (j = 0; j < ball.length; j++) {\n\n\n ball[j].update(img);\n ball[j].display(img);\n\n }\n\n\n}", "title": "" }, { "docid": "52b1e7357a67923474360d5dea3d3f63", "score": "0.665468", "text": "display() {\n //condition to fill with darker blue when object is in the upper left region\n if (this.centerx < 0) {\n fill(64, 122, 157);\n\n }\n //condition to fill with lighter blue when object is in the lower right region\n else {\n fill(67, 171, 234, 255);\n }\n\n //dynamic shape/object for planet\n ellipse(this.centerx, this.centery, this.dim, this.dim);\n\n\n }", "title": "" }, { "docid": "db15fe7181acfe1daef7808ccd7b50e8", "score": "0.6642908", "text": "function setupBall(){\n\n}", "title": "" }, { "docid": "d1c62d50780ea0c4f99ddd8acc01b9ae", "score": "0.66175556", "text": "function DrawBall()\r\n{\r\n\r\n \r\n\tgfx.beginPath();\r\n\t//gfx.arc(x,y, ballRadius, 0, Math.PI*2);\r\n\tvar nuke = document.getElementById('nuke');\r\n\tgfx.drawImage(nuke, x, y, 25,25);\r\n\t//gfx.fillStyle = \"#AAF478\";\r\n\t//gfx.fill();\r\n\tgfx.closePath();\r\n}", "title": "" }, { "docid": "3c444ad884c863caa23c13ea632802ce", "score": "0.6610251", "text": "function drawSingleBall(ball) {\n context.beginPath();\n context.arc(ball.x,ball.y,ball.ballRadius,0,2*Math.PI);\n context.fillStyle=\"white\";\n context.fillStroke=\"white\";\n context.Stroke=\"10\"\n context.fill();\n context.closePath();\n\t}", "title": "" }, { "docid": "ceba89fd1cbb7875172b112b6a11b126", "score": "0.65868497", "text": "display() {\n this.model(true);\n\n // Display hitbox\n if (showHitboxes) {\n fill(255, 63);\n stroke(255);\n ellipse(this.pos.x, this.pos.y, this.r, this.r);\n }\n }", "title": "" }, { "docid": "e6dbcf5bab5ae2995124a09935adc7c0", "score": "0.6586076", "text": "show () {\n fill(0, 255, 0);\n rect(this.x, this.y, offset, offset);\n }", "title": "" }, { "docid": "50bf8eee89f0417099c7b2661fd41b84", "score": "0.65849406", "text": "function draw() {\n //set the color of the box\n background( World.bgcolor );\n\n //get information from the update method in Ball\n ball.update();\n\n //get information for the update method in GrowingBox\n b.update();\n \n }", "title": "" }, { "docid": "478fb750b2c995df236afde554ac7c9b", "score": "0.65844846", "text": "function drawBall() {\n\t\tctx.beginPath();\n\t\tctx.arc(x, y, ballRadius, 0, Math.PI*2);\n\t\tctx.fillStyle = \"#EE6622\";\n\t\tctx.fill();\n\t\tctx.closePath();\n\t\tctx.drawImage(ball_image,x-(ballRadius*2),y-(ballRadius*1.1),35,38); //(35,38 is the initial position of the ball on game start).\n\t}", "title": "" }, { "docid": "28d7081f024413743625de7c0c5f106c", "score": "0.6579555", "text": "function display (p, pos, vel) {\n //p.line(pos.x, pos.y, (pos.x + vel.x), (pos.y + vel.y));\n //p.fill(0);\n //p.ellipse(pos.x, pos.y, 50);\n p.point(pos.x, pos.y);\n\n}", "title": "" }, { "docid": "9d7cf6de628383ec60b5e50292411ea4", "score": "0.6571528", "text": "display(){\n // Don't add a heading unless it exists\n if (this.velocity.heading() != 0) {\n this.angle = this.velocity.heading();\n }\n\n noStroke();\n fill(this.color.red,this.color.green,this.color.blue);\n push();\n ellipseMode(CENTER);\n translate(this.location.x, this.location.y);\n rotate(this.angle);\n ellipse(0, 0, this.fishRadius*2, this.fishRadius*2);\n fill(255);\n this.tail.draw(this.color.red,this.color.green,this.color.blue);\n pop();\n }", "title": "" }, { "docid": "49e6c830a4ece20794555cd4d07772ab", "score": "0.65616024", "text": "drawBall() {\n ctx.beginPath();\n if (this.direction == \"left\") {\n ctx.arc(\n this.ball_start_point + gameData.TANK_BALL_GAP_X_1,\n this.ball_end_point - gameData.TANK_BALL_GAP_Y,\n this.radius,\n 0,\n Math.PI * 2,\n true\n );\n } else if (this.direction == \"right\") {\n ctx.arc(\n this.ball_start_point - gameData.TANK_BALL_GAP_X_2,\n this.ball_end_point - gameData.TANK_BALL_GAP_Y,\n this.radius,\n 0,\n Math.PI * 2,\n true\n );\n }\n\n ctx.closePath();\n ctx.fill();\n }", "title": "" }, { "docid": "6bec4e8a91c37cd69973ac7acabada3c", "score": "0.6548945", "text": "display() {\n push();\n noStroke();\n // Terrible at maths but basically something happens with circles, those values affect the size of a circle (?)\n // Then we apply those varying values to our image to have them change ~rhythmically.\n this.growth = sin(this.angle) * (this.radius / 2);\n // Aha, display bat image but take changing values based on the circle changes into consideration\n image(this.preyImage, this.x, this.y, this.radius * 2 + this.growth);\n // increment value that allows whole equation to change\n this.angle += 0.05;\n pop();\n\n }", "title": "" }, { "docid": "1659995eed30c6876e31a2c6daf46334", "score": "0.6547811", "text": "drawBall() {\n this.ctx.beginPath();\n this.ctx.arc(this.x, this.y, this.ballRadius, 0, 6.3);\n this.ctx.fillStyle = \"red\";\n this.ctx.fill();\n this.ctx.closePath();\n }", "title": "" }, { "docid": "ba557f9b249fe63ba39c14141e0ea043", "score": "0.6530368", "text": "function drawBall()\n {\n ctx.beginPath();\n ctx.arc(x, y, ballRadius, 0, Math.PI * 2, true);\n ctx.closePath();\n ctx.fillStyle = \"#6DB33F\";\n ctx.fill();\n\t\t\n }", "title": "" }, { "docid": "0b28295796f4909d2f0331fcb4d04d57", "score": "0.65138566", "text": "display() {\n push();\n noStroke();\n // This oscillation doesn't work but here it is I guess. \n // Terrible at maths but basically something happens with circles, those values affect the size of a circle (?)\n // Then we apply those varying values to our image to have them change ~rhythmically.\n this.growth = sin(this.angle) * (this.radius / 2);\n // Aha, display bat image but take changing values based on the circle changes into consideration\n image(this.preyImage, this.x, this.y, this.radius * 2 + this.growth);\n // increment value that allows whole equation to change\n this.angle += 0.05;\n pop();\n }", "title": "" }, { "docid": "4e4f6f4537e96ffd1f524a6fc14ff208", "score": "0.6513537", "text": "show(p) {\n // Draw a triangle rotated in the direction of velocity\n var angle =\n angleToPoint(this.x, this.y, this.x + this.vx, this.y + this.vy) +\n Math.PI / 2\n let color = activationColor(this.brain.score, global.highestScore)\n\n p.push()\n p.translate(this.x, this.y)\n p.rotate(angle)\n p.fill(color)\n p.noStroke()\n p.beginShape()\n p.vertex(0, -this.r * 2)\n p.vertex(-this.r, this.r * 2)\n p.vertex(this.r, this.r * 2)\n p.endShape(p.CLOSE)\n p.pop()\n\n if (!this.dead) {\n p.noFill()\n for (let i = 0; i < this.nearestMines.length; i++) {\n let mine = this.nearestMines[i]\n p.stroke('rgba(0,0,0,0.1)')\n p.line(this.x, this.y, mine.x, mine.y)\n }\n }\n }", "title": "" }, { "docid": "99fd7da14e03224d10e866a128405008", "score": "0.65126705", "text": "show() {\n var pos = this.body.position;\n var angle = this.body.angle;\n\n push();\n translate(pos.x, pos.y);\n rotate(angle);\n rectMode(CENTER);\n strokeWeight(1);\n stroke(120, 90, 30);\n fill(96, 62, 17);\n rect(0, 0, this.w, this.h);\n pop();\n }", "title": "" }, { "docid": "3edce5e73489536325dbe6ad21a62694", "score": "0.6509234", "text": "show() {\n // white border of the bubble\n stroke(255);\n strokeWeight(3);\n \n // when clicked, bubble turns red\n fill(this.brightness, 0, 150, 50);\n \n // the bubble is a circle located at this.x and this.y\n ellipse(this.x, this.y, this.r*2)\n \n }", "title": "" }, { "docid": "db0bd8589715c67e41ddfc99fb2a2669", "score": "0.65045154", "text": "function drawBall() {\n ctx.beginPath();\n\n ctx.arc(ball.xPosition, ball.yPosition, ball.radius, 0, Math.PI * 2);\n ctx.strokeStyle = ball.border;\n ctx.stroke();\n ctx.fillStyle = ball.color;\n ctx.fill();\n\n ctx.closePath();\n}", "title": "" }, { "docid": "097b689c0ed2da3f00a273b97fc6b319", "score": "0.6489197", "text": "function changeBall(){\n\n}", "title": "" }, { "docid": "ed8c67ad52f8d41bd52ed27792fd8af6", "score": "0.6479967", "text": "function printInstruction() {\n fill(0);\n textAlign(CENTER);\n textSize(30);\n text(\"Instructions\", width / 2, height / 2 - 100);\n textAlign(LEFT);\n textSize(20);\n text(\"* To move the paddle, use the mouse.\", width / 2 - 500, height / 2 - 70);\n text(\"* The ball will appear in the middle of the canvas at the beginning and start moving downwards in a random direction.\", width / 2 - 500, height / 2 - 40);\n text(\"* You will have 5 lives at each level and each time the ball has fallen, you will lose a life.\", width / 2 - 500, height / 2 - 10);\n text(\"* There are four levels. The speed of the ball will increase as the level increases.\", width / 2 - 500, height / 2 + 20);\n}", "title": "" }, { "docid": "049322f633806d8cbc4454405a5b7918", "score": "0.64788514", "text": "display() {\n push();\n noStroke();\n // Display properties\n // with an if statement to create the effect of camouflage , make them appear And\n // disappear to make them harder to catch\n\n this.radius = this.health;\n this.visibletimer -= deltaTime / 1000;\n\n if (this.visibletimer > 0) {\n // Display prey as an image\n if (this.radius > 20) {\n imageMode(CENTER);\n image(rusastroImg, this.x, this.y, this.radius * 2, this.radius * 2);\n }\n }\n\n if (this.visibletimer < -this.visibleduration) {\n this.visibletimer = this.visibleduration\n }\n\n pop();\n }", "title": "" }, { "docid": "dea8f9d27735a69c36e31883f203167d", "score": "0.6464234", "text": "display(){\n image (circle, this.x, this.y, this.w, this.h)\n }", "title": "" }, { "docid": "4194bcb9f39627e120da48e8fbca7d1a", "score": "0.6456095", "text": "function drawBall(){\n ctx.beginPath();\n ctx.arc(x,y,ballRadius,0,Math.PI*2);\n ctx.fillStyle = \"#0095DD\";\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "f6c75aebf3b39d1e98f73c553222f37f", "score": "0.64532095", "text": "display() {\n stroke(255);\n fill(255);\n ellipse(this.x, this.y, 10);\n }", "title": "" }, { "docid": "5c8fb35f6daddd9900ba1fe6ada3d175", "score": "0.6442217", "text": "display(dir){\n this.position.y += dir * this.speed;\n fill(\"white\");\n ellipse(this.position.x, this.position.y, this.size.x, this.size.y);\n }", "title": "" }, { "docid": "d9203e8ba4c1884baca78ce5edb9a5d1", "score": "0.6436439", "text": "display() {\n stroke(255, this.lifespan)\n strokeWeight(2)\n fill(127, this.lifespan)\n ellipse(this.position.x, this.position.y, 12, 12)\n }", "title": "" }, { "docid": "56a5933a3de184f357f168888e3b2b36", "score": "0.6419408", "text": "display() {\n push();\n noStroke();\n this.radius = this.health;\n imageMode(CENTER);\n image(this.image,this.x, this.y, this.radius * 3, this.radius * 3);\n pop();\n }", "title": "" }, { "docid": "30dfee11b2a3f7bed11831459bb65bb5", "score": "0.64119864", "text": "show() {\n push();\n translate(this.pos);\n fill(...this.color);\n ellipse(0, 0, this.size);\n fill(0);\n text(this.id, this.textOffset, this.textOffset, this.sizeHalf, this.sizeHalf)\n pop();\n }", "title": "" }, { "docid": "5a1aa350650b2239fdb6f3d5eac0350d", "score": "0.6401541", "text": "function drawBall() {\n ctx.beginPath();\n ctx.arc(x, y, ballRadius, 0, Math.PI*2);\n ctx.fillStyle = \"red\";\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "e360c51521d7156b472a33329c7596c4", "score": "0.63994396", "text": "display() {\n noStroke();\n fill(173,213,231);\n ellipse(this.x,this.y,random(1,5),random(1,5));\n }", "title": "" }, { "docid": "34470c8427b7f1b0d4d5d298d814c0f7", "score": "0.6394382", "text": "show(){\n noFill();\n //rect(this.x+10,this.y+5,this.r-20,this.r);\n //rect(this.x,this.y, this.r, this.r);\n if(!this.jumping){\n // image(playerRun[frameCount%playerRun.length],this.x,this.y,this.r,this.r);\n image(playerRun[floor(this.ind)%playerRun.length],this.x,this.y,this.r,this.r);\n }\n else {\n image(playerJump[(frameCount+3)%playerJump.length],this.x,this.y,this.r,this.r);\n }\n }", "title": "" }, { "docid": "6d67cd78ca492cf3251b0d05478633df", "score": "0.6389105", "text": "function displayPaddle(paddle) {\n rect(paddle.x, paddle.y, paddle.w, paddle.h);\n}", "title": "" }, { "docid": "472bb3aeaaf3491df2b8d747f2cc790b", "score": "0.6381532", "text": "display() {\n fill(this.color);\n strokeWeight(8);\n stroke(this.color);\n\n line(this.x, this.y, this.x, this.y + 40); //body line\n ellipse(this.x - 20, this.y + 10, this.wingW, this.wingH); //left top wing\n ellipse(this.x + 20, this.y + 10, this.wingW, this.wingH); //right big wing\n\n ellipse(this.x - 20, this.y + 20, this.wingW - 10, this.wingH); //left bottom wing\n ellipse(this.x + 20, this.y + 20, this.wingW - 10, this.wingH); //right bottom wing\n\n noStroke();\n }", "title": "" }, { "docid": "c170ed4bbfc4677b118f14c579c8603c", "score": "0.63738257", "text": "drawDebug() {\n // visionRadius\n ctx.strokeStyle = \"gray\"\n ctx.beginPath();\n ctx.arc(this.position.x, this.position.y, this.visionRadius, 0, 2 * Math.PI);\n ctx.stroke();\n\n // position\n ctx.fillText(\n `position: (${this.position.x.toFixed(2)}, ${this.position.y.toFixed(2)})`,\n this.position.x - 10, this.position.y - 10\n )\n\n // position\n ctx.fillText(\n `velocity: (${this.velocity.x.toFixed(2)}, ${this.velocity.y.toFixed(2)})`,\n this.position.x - 10, this.position.y - 20\n )\n\n let angle = Math.atan2(this.velocity.y, this.velocity.x)\n\n // angle\n ctx.fillText(\n `angle: ${angle}`,\n this.position.x - 10, this.position.y - 30\n )\n }", "title": "" }, { "docid": "9f1309fd3c7295465907bd39b613fced", "score": "0.6369998", "text": "show() {\n fill(121, 85, 72);\n rect(this.x, 0, this.width, this.topHeight);\n rect(this.x, this.bottomY, this.width, this.bottomHeight);\n }", "title": "" }, { "docid": "13514e148ed1c20b7a1cd81a88d854a6", "score": "0.63594466", "text": "function drawBall() {\n\tctx.beginPath();\n\tctx.arc(ballX, 100, ballRadius, 0, Math.PI * 2);\n\tctx.fillStyle = \"red\";\n\tctx.fill();\n\tctx.closePath();\n}", "title": "" }, { "docid": "94022b403556e3a9ec3cda46333aa66b", "score": "0.634844", "text": "function render(){\n // clear the canvas\n drawRect(0, 0, canvas.width, canvas.height, \"#000\");\n\n // draw the user score to the left\n //drawText(display_1_param, canvas.width/4, canvas.height/5);\n\n // draw the COM score to the right\n //drawText(display_2_param, 3*canvas.width/4, canvas.height/5);\n\n // draw the ball\n drawArc(ball.x, ball.y, ball.radius, ball.color);\n}", "title": "" }, { "docid": "f5b7a302c76c545e2bb8af0aba86a5c9", "score": "0.6344308", "text": "display() {\n stroke(this.stroke);\n strokeWeight(this.strokeWeight);\n fill(this.color);\n ellipse( this.posX, this.posY, this.size)\n\n }", "title": "" }, { "docid": "85b5744d27f4040930759eac97df3550", "score": "0.63439953", "text": "display() {\n stroke(2);\n fill(255, 255, 255, this.alpha);\n rect(this.x, this.y, this.size, this.height);\n\n //if the mosue if hovering over any sector, the stats bix for that sectors should pop up\n if(mouseX < this.x + this.size && mouseX > this.x){\n if (mouseY < this.y + this.height && mouseY > this.y){\n if (mouseMode === \"normal\"){\n fill(255);\n rect(mouseX, mouseY, 200, 100);\n\n //drawing the rext box\n textSize(20);\n fill(0);\n text(this.name, mouseX + 10, mouseY + 20);\n textSize(20);\n text(\"Demand: \" + Math.round(this.demand), mouseX + 10, mouseY + 50);\n text(\"Satsifaction: \" + this.satisfaction, mouseX + 10, mouseY + 70);\n }\n }\n }\n }", "title": "" }, { "docid": "fc0f92822114f3464bb91d4ae7265e9f", "score": "0.63346934", "text": "show () {\n this.canvas2D.logic();\n }", "title": "" }, { "docid": "91551d149e3ffcb8abc805f94e5c6966", "score": "0.63342303", "text": "show() {\r\n this.p5.noStroke();\r\n switch(this.status) {\r\n case 3:\r\n this.p5.image(this.img3, this.x, this.y);\r\n break;\r\n case 2:\r\n this.p5.image(this.img2, this.x, this.y);\r\n break;\r\n case 1:\r\n this.p5.image(this.img1, this.x, this.y);\r\n break;\r\n case 0:\r\n this.p5.image(this.img0, this.x, this.y);\r\n break;\r\n default:\r\n break;\r\n }\r\n }", "title": "" }, { "docid": "0eb8ba53992561e8ae00a800a059d72c", "score": "0.63339686", "text": "show() {\n this.pipes1.show();\n this.pipes2.show();\n push();\n\n //noStroker()\n fill(225, 225, 0);\n ellipse(this.x, this.y, this.size);\n\n this.ground.show();\n }", "title": "" }, { "docid": "2ec3db21fbcc0909bfab514a0a6f15fd", "score": "0.6332089", "text": "show() {\r\n \r\n textSize(20);\r\n fill(this.colour);\r\n text(\"lives: \" + this.lives, 20, height -5);\r\n text(\"user: \" + username, width - 200, height-5);\r\n text(\"score: \" + this.score, 20, 20);\r\n text(\"highscore: \" + highscore, width/2 - 55, 20);\r\n text(\"level: \" + this.level_num, (width) - 100, 20);\r\n\r\n this.updateHighscore();\r\n\r\n }", "title": "" }, { "docid": "a07a288381d52b690110df9ad283e535", "score": "0.6318349", "text": "show(){\n fill('red');\n rect(this.x-5, this.y-5, 10, 10, 2);\n }", "title": "" }, { "docid": "6d4413bfca35410f53c886c21253db9f", "score": "0.63161725", "text": "display() {\n push();\n noStroke();\n fill(this.color.r, this.color.g, this.color.b);\n ellipse(this.x, this.y, this.size);\n pop();\n }", "title": "" }, { "docid": "c0d4dddadb5b57aee99d2a16a0676728", "score": "0.63017255", "text": "display() {\n push();\n noStroke();\n this.radius = this.health;\n if (this.radius > 1){\n image(this.image, this.x, this.y, this.radius * 2, this.radius * 2);\n }\n pop();\n}", "title": "" }, { "docid": "96c8eacc05c7479e1daf3ec1739eae20", "score": "0.6283234", "text": "function drawBall(){\r\n\tcontext.save();\r\n\r\n//\tballPaddleLogic();\r\n\r\n\tcontext.beginPath();\r\n\tcontext.fillStyle = \"rgb(200,0,0)\"; //color to fill shape in with\r\n\r\n\tcontext.arc(xBall*screenModifierX,yBall*screenModifierY,\r\n\t\tballR*screenModifierX,0,Math.PI*2,true);\r\n\tcontext.closePath();\r\n\tcontext.fill();\r\n\r\n\tcontext.restore();\r\n}", "title": "" }, { "docid": "2d5d58943ee8c7855c36aa9f653a8d67", "score": "0.6281118", "text": "display() {\n if (!this.visible) {\n push();\n // Title of planet\n push();\n let tag;\n let symbol_xPos = this.x + 24;\n let symbol_yPos = this.y + 60;\n let text_xPos = this.x - 30;\n let text_yPos = this.y + 60;\n\n fill(green.r, green.g, green.b);\n\n // push();\n // Symbol\n textFont(symbolFont);\n textSize(this.symbolSize);\n text(this.symbol, symbol_xPos, symbol_yPos);\n\n // push();\n // Title\n textFont(globalFont);\n textSize(this.titleSize);\n text(this.title, text_xPos, text_yPos);\n pop();\n\n push();\n // Custom colour of our Jupiter\n // RGB parameters + position\n // Brown\n pointLight(this.fill.r, this.fill.g, this.fill.b, this.fill.pointLight);\n\n // Calling the superclass Planet.js' display method\n super.display();\n pop();\n pop();\n }\n }", "title": "" }, { "docid": "2eb2eddc504e4aed250193e4b4bd14bc", "score": "0.6279308", "text": "function drawBall(x, y)\n{\n// this.grid.setPixelColor(x, y, this.ball.color);\n this.grid.circleFill(x, y, this.ball.radius);\n}", "title": "" }, { "docid": "2e0c72c9f1bb7fe4c47527c0595cb86c", "score": "0.6277203", "text": "function drawBall () {\n ctx.beginPath()\n // ctx.arc(x, y, ballRadius, 0, Math.PI * 2)\n ctx.drawImage(tennisBall, x - ballRadius, y - ballRadius , ballRadius * 2, ballRadius * 2);\n // ctx.fillStyle = '#0095DD'\n ctx.fill()\n ctx.closePath()\n }", "title": "" }, { "docid": "e0a6245615a51b2849e68fc8981c4c3c", "score": "0.6275126", "text": "function drawBall() {\n ctx.beginPath();\n ctx.arc(ball.x, ball.y, ball.size, 0, Math.PI * 2);\n\n ctx.fillStyle = '#fd746c';\n ctx.fill();\n ctx.closePath();\n}", "title": "" }, { "docid": "516c555d17f79451b0fb709b38340e84", "score": "0.62722474", "text": "show() {\r\n // white if alive, black otherwise ( don't judge me for making the dead cells black )\r\n fill(this.alive ? 255 : 0);\r\n // and a rectangle at i, j * the side length\r\n rect(this.j * l, this.i * l, l, l);\r\n }", "title": "" }, { "docid": "faebcf46a3fc470cecf7b12491639bf3", "score": "0.6266219", "text": "function ball(params) {\n \n canvasCtx.beginPath();\n canvasCtx.arc( x, y, ballRadius, 0, Math.PI * 2 );\n canvasCtx.fillStyle = 'red';\n canvasCtx.fill();\n canvasCtx.closePath();\n\n }", "title": "" }, { "docid": "98e2d60f8d60db72859da5b6e7f81439", "score": "0.6255318", "text": "function Point(){\r\n $(\"#scorep1\").text(player1Name +\":\" + score1);\r\n $(\"#scorep2\").text(player2Name +\":\" + score2);\r\n speedBall = initialSpeedBall;\r\n ballx = gc.width/2 - radiusBall/2;\r\n bally = gc.height/2 - radiusBall/2;\r\n\r\n}", "title": "" }, { "docid": "5b83ca9766e26ed7e68d15bd88460239", "score": "0.6245028", "text": "display() {\n fill(127);\n stroke(20);\n strokeWeight(2);\n ellipse(this.x, this.y, 32, 32);\n }", "title": "" }, { "docid": "a0e7787a336e9e5b735d815dfeef951a", "score": "0.62396014", "text": "display() {\n if (this.goalDisappeared === false) {\n if (this.health > this.stillExist) {\n push();\n noStroke();\n imageMode(CENTER);\n this.radius = this.health;\n image(this.img, this.x, this.y, this.radius * 2, this.radius * 2);\n pop();\n }\n }\n }", "title": "" }, { "docid": "ab08b05acc4b35d406c5947129a279a6", "score": "0.6237091", "text": "showRadius() {\r\n console.log(`This Dot has a radius of ${this.radius}.`)\r\n }", "title": "" }, { "docid": "300a40a10987163091fddec47d6e8771", "score": "0.62366694", "text": "function show() {\r\n var i1 = 0;\r\n var i2 = 0;\r\n \r\n //update positions of elements\r\n positionOfPaddle1 += speedOfPaddle1;\r\n positionOfPaddle2 += speedOfPaddle2;\r\n topPositionOfBall += topSpeedOfBall;\r\n leftPositionOfBall += leftSpeedOfBall;\r\n\r\n //stop paddle from leaving top of gameboard\r\n //paddle1\r\n if (positionOfPaddle1 <= 0) {\r\n positionOfPaddle1 = 0;\r\n }//if\r\n\r\n //paddle2\r\n if (positionOfPaddle2 <= 0) {\r\n positionOfPaddle2 = 0;\r\n }//if\r\n\r\n //stop paddles from leaving bottom of gameboard\r\n if (positionOfPaddle1 >= gameboardHeight - paddleHeight) {\r\n positionOfPaddle1 = gameboardHeight - paddleHeight;\r\n }//if\r\n if (positionOfPaddle2 >= gameboardHeight - paddleHeight) {\r\n positionOfPaddle2 = gameboardHeight - paddleHeight;\r\n }//if\r\n\r\n //if ball hits top or bottom or bottom of gameboard, change direction\r\n if (topPositionOfBall <= 0 || topPositionOfBall >= gameboardHeight - ballHeight) {\r\n topSpeedOfBall *= -1;\r\n }//if\r\n\r\n //ball on left edge of gameboard\r\n if (leftPositionOfBall <= paddleWidth) {\r\n //if ball hits left paddle, change direction\r\n if (topPositionOfBall > positionOfPaddle1 && topPositionOfBall < positionOfPaddle1 + paddleHeight) {\r\n bounce.play();\r\n leftSpeedOfBall *= -1;\r\n i1++;\r\n } else {\r\n out.play();\r\n startBall();\r\n score2++;\r\n document.getElementById(\"score2\").innerHTML = score2;\r\n }//else\r\n }//if\r\n\r\n //ball on right edge of gameboard\r\n if (leftPositionOfBall >= gameboardWidth - paddleWidth - ballHeight) {\r\n //if ball hits right paddle, change direction\r\n if (topPositionOfBall > positionOfPaddle2 && topPositionOfBall < positionOfPaddle2 + paddleHeight) {\r\n bounce.play();\r\n leftSpeedOfBall *= -1;\r\n i2++;\r\n } else {\r\n out.play();\r\n startBall();\r\n score1++;\r\n document.getElementById(\"score1\").innerHTML = score1;\r\n }//else\r\n }//if\r\n\r\n document.getElementById(\"paddle1\").style.top = positionOfPaddle1 + \"px\";\r\n document.getElementById(\"paddle2\").style.top = positionOfPaddle2 + \"px\";\r\n document.getElementById(\"ball\").style.top = topPositionOfBall + \"px\";\r\n document.getElementById(\"ball\").style.left = leftPositionOfBall + \"px\";\r\n \r\n //Stop game once a player reachers 10 points\r\n if (score1 == 10 || score2 == 10) {\r\n stopGame();\r\n }//if\r\n\r\n}", "title": "" }, { "docid": "8551509e0a5e72b58d4b2ffefb9469da", "score": "0.6235686", "text": "function Ball(x, y, angle, v, diameter) {\n this.x = x;\n this.y = y;\n this.angle = angle;\n this.v = v;\n this.radius = diameter / 2;\n\n this.draw = function () {\n context.beginPath();\n context.fillStyle = 'pink';\n context.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);\n context.fill();\n\n\n };\n\n this.move = function () {\n // add horizontal increment to the x pos\n // add vertical increment to the y pos\n\n this.x += this.v * Math.cos(this.angle);\n this.y += this.v * Math.sin(this.angle);\n };\n\n this.superlog = function(){\n\n // console.clear();\n var cell = document.querySelector('#X');\n if (cell !== null) {cell.innerHTML = this.x;}\n\n cell = document.querySelector('#Y');\n if (cell !== null) {cell.innerHTML = this.y;}\n\n cell = document.querySelector('#v');\n if (cell !== null) {cell.innerHTML = this.v;}\n\n cell = document.querySelector('#r');\n if (cell !== null) {cell.innerHTML = this.radius;}\n\n cell = document.querySelector('#a');\n if (cell !== null) {cell.innerHTML = this.angle;}\n }\n}", "title": "" }, { "docid": "e15e9404b10bfc6e4c942ad182c33fa3", "score": "0.6226992", "text": "function drawBalloon() {\r\n\t// Zeichne den Ballon\r\n\tupdateBalloon();\r\n\t\r\n\tballoonSprite.drawFrame(ctx, balloon.getFrame(), balloon.getX(), balloon.getY());\r\n}", "title": "" }, { "docid": "e41bc283c160a9c5d61a8c3b10dfa5f4", "score": "0.6218944", "text": "display() {\n fill(255);\n stroke(0);\n ellipse(this.x, this.y, this.r*2, this.r*2);\n }", "title": "" }, { "docid": "0ed7f231dbf4f8d771630c9fd50ad267", "score": "0.62187696", "text": "function draw() {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n showBall();\r\n showPaddle();\r\n showScore();\r\n showBricks();\r\n}", "title": "" }, { "docid": "677c58920642d7b872ae2cfc630bb893", "score": "0.62100214", "text": "display(){\n stroke(this.colour);\n strokeWeight(4);\n line(this.startX, this.startY, this.destX, this.destY);\n stroke('black');\n strokeWeight(1);\n }", "title": "" }, { "docid": "83a091ace41f4b97ef8ba1fbd1c0dcd8", "score": "0.62009203", "text": "function displayPaddle(paddle) {\n // Draw the paddles\n push();\n stroke(255);\n strokeWeight(4);\n rect(paddle.x, paddle.y, paddle.w, paddle.h, 32, 32, 32, 32);\n pop();\n}", "title": "" }, { "docid": "0c594d52e42e222570012f86707c4fe7", "score": "0.61902976", "text": "function showBalls(ev) {\r\n let htmlBalls = '';\r\n for (let i = 0; i < 1; i++) {\r\n const number = getRandomNumber(20);\r\n if (!showArrayNumbers.includes(number)) {\r\n htmlBalls += `<div class=\"main__container-balls--ball\" id=\"ball-${number}\"> ${number}</div>`;\r\n showArrayNumbers.push(number);\r\n } else {\r\n i--;\r\n }\r\n }\r\n\r\n balls.innerHTML += htmlBalls;\r\n compareBalls();\r\n}", "title": "" }, { "docid": "f801daada51882938f6c5b32dc7eac2f", "score": "0.6190024", "text": "show(x, y) {\r\n this.canvas.show(x, y);\r\n }", "title": "" }, { "docid": "44dea78534c70dd57bdb9793ee0d3753", "score": "0.6175215", "text": "show() {\n // if the ghost is in eaten mode\n // set the ghost to be translucent\n if (this.mode.eaten) {\n fill(255, 0, 0, 30);\n\n // if the ghost is in frightened mode\n // set the ghost to be blue\n } else if (this.mode.frightened) {\n fill(0, 0, 255);\n\n } else {\n // if the ghost is in either scatter or chase mode, just put to red (original colour)\n fill(255, 0, 0);\n }\n noStroke();\n ellipse(this.currentPosition.x, this.currentPosition.y, this.width);\n }", "title": "" }, { "docid": "351fbdcb87fef777b136d15a8243e3da", "score": "0.6171958", "text": "function drawBall() {\n ctx.beginPath();\n ctx.arc(x, y, ballRadius, 0, Math.PI*2);\n ctx.fillStyle = colorArray[ballColorIndex];\n ctx.fill();\n ctx.closePath();\n}", "title": "" }, { "docid": "09fc90e1324647d381a0049ac4a60847", "score": "0.6167883", "text": "function drawBall(indexNumber) {\n fill(ballColors[indexNumber]);\n ellipse(ballXs[indexNumber], ballYs[indexNumber], ballRadius * 2, ballRadius * 2);\n}", "title": "" }, { "docid": "e9c75020fb2991e54452dc1107316e05", "score": "0.616747", "text": "function Ball() { \n // set the ball diameter \n this.d = 24;\n // set random x position for every ball\n this.x = random(this.d*2,width-this.d*2); \n // set random y position for every ball \n this.y = random(this.d*2,height-this.d*2);\n // set random speed between -5 and 5 (not inlcuding 5)\n this.speedX = random(-5, 5); \n // set random speed between 5 and -5 (not inlcuding -5)\n this.speedY = random(5, -5);\n\n this.display = function() {\n // make the balls black\n fill(0)\n // set the coordinates and diameter for the circle\n circle(this.x, this.y, this.d*2);\n }\n \n this.movement = function() {\n // keep adding speed to the current value of x position\n this.x += this.speedX;\n // keep adding speed to the current value of y position \n this.y += this.speedY; \n // keep the balls bouncing from left and right side\n if (this.x > width-this.d || this.x < this.d) {\n // change the direction of the ball\n this.speedX = -this.speedX;\n }\n // keep the balls bouncing from top and bottom side\n if (this.y > height-this.d || this.y < this.d) {\n // change the direction of the ball\n this.speedY = -this.speedY;\n }\n }\n\n}", "title": "" }, { "docid": "010c0658bd474b8a2c4c272475f8662e", "score": "0.6160404", "text": "function print(velocityCalculator, label) {\n var velocity = velocityCalculator.getVelocity();\n var position = getPosition();\n var flingCurve = new FlingCurve(position, velocity,\n velocityCalculator.getTime() / 1000);\n\n console.log(\"%s end position: %d, (fling duration:%d), velocity: %d \",\n label, flingCurve.getFinalPosition(),\n flingCurve.getDuration() * 1000, velocity);\n }", "title": "" } ]
a8c0df6815f2872573a49b6b12e7f5ed
Construct a forward node iterator.
[ { "docid": "ac58acfd81f4c710397dac06148ccabb", "score": "0.80341065", "text": "function ForwardNodeIterator(node) {\n this._node = node;\n }", "title": "" } ]
[ { "docid": "24d28d1b8851fc57dac3f91759e0eb1e", "score": "0.80646485", "text": "function ForwardNodeIterator(node) {\r\n this._node = node;\r\n }", "title": "" }, { "docid": "24d28d1b8851fc57dac3f91759e0eb1e", "score": "0.80646485", "text": "function ForwardNodeIterator(node) {\r\n this._node = node;\r\n }", "title": "" }, { "docid": "178a51a677e033d7913e8a6bf9dfb13d", "score": "0.75059503", "text": "function ForwardIterator(node, index, count) {\n this._node = node;\n this._index = index;\n this._count = count;\n }", "title": "" }, { "docid": "3d62bf2eeaa3de7c500f2ef4af5d4d4e", "score": "0.7474395", "text": "function ForwardValueIterator(node) {\r\n this._node = node;\r\n }", "title": "" }, { "docid": "3d62bf2eeaa3de7c500f2ef4af5d4d4e", "score": "0.7474395", "text": "function ForwardValueIterator(node) {\r\n this._node = node;\r\n }", "title": "" }, { "docid": "a5220bce1e6e9872a151a01ec7657431", "score": "0.7441098", "text": "function ForwardValueIterator(node) {\n this._node = node;\n }", "title": "" }, { "docid": "a5220bce1e6e9872a151a01ec7657431", "score": "0.7441098", "text": "function ForwardValueIterator(node) {\n this._node = node;\n }", "title": "" }, { "docid": "895a5e398cc57c917e84396e69388308", "score": "0.6290841", "text": "function nodeIterator_traverse(iterator, forward) {\n /**\n * 1. Let node be iterator’s reference.\n * 2. Let beforeNode be iterator’s pointer before reference.\n */\n var node = iterator._reference;\n var beforeNode = iterator._pointerBeforeReference;\n /**\n * 3. While true:\n */\n while (true) {\n /**\n * 3.1. Branch on direction:\n */\n if (forward) {\n /**\n * - next\n */\n if (!beforeNode) {\n /**\n * If beforeNode is false, then set node to the first node following\n * node in iterator’s iterator collection. If there is no such node,\n * then return null.\n */\n var nextNode = TreeAlgorithm_1.tree_getFollowingNode(iterator._root, node);\n if (nextNode) {\n node = nextNode;\n }\n else {\n return null;\n }\n }\n else {\n /**\n * If beforeNode is true, then set it to false.\n */\n beforeNode = false;\n }\n }\n else {\n /**\n * - previous\n */\n if (beforeNode) {\n /**\n * If beforeNode is true, then set node to the first node preceding\n * node in iterator’s iterator collection. If there is no such node,\n * then return null.\n */\n var prevNode = TreeAlgorithm_1.tree_getPrecedingNode(iterator.root, node);\n if (prevNode) {\n node = prevNode;\n }\n else {\n return null;\n }\n }\n else {\n /**\n * If beforeNode is false, then set it to true.\n */\n beforeNode = true;\n }\n }\n /**\n * 3.2. Let result be the result of filtering node within iterator.\n * 3.3. If result is FILTER_ACCEPT, then break.\n */\n var result = TraversalAlgorithm_1.traversal_filter(iterator, node);\n if (result === interfaces_1.FilterResult.Accept) {\n break;\n }\n }\n /**\n * 4. Set iterator’s reference to node.\n * 5. Set iterator’s pointer before reference to beforeNode.\n * 6. Return node.\n */\n iterator._reference = node;\n iterator._pointerBeforeReference = beforeNode;\n return node;\n}", "title": "" }, { "docid": "58f89ed46bb8c9c05e1d7465b7926ba7", "score": "0.6247444", "text": "function nodeIterator_traverse(iterator, forward) {\n /**\n * 1. Let node be iterator’s reference.\n * 2. Let beforeNode be iterator’s pointer before reference.\n */\n let node = iterator._reference;\n let beforeNode = iterator._pointerBeforeReference;\n /**\n * 3. While true:\n */\n while (true) {\n /**\n * 3.1. Branch on direction:\n */\n if (forward) {\n /**\n * - next\n */\n if (!beforeNode) {\n /**\n * If beforeNode is false, then set node to the first node following\n * node in iterator’s iterator collection. If there is no such node,\n * then return null.\n */\n const nextNode = TreeAlgorithm_1.tree_getFollowingNode(iterator._root, node);\n if (nextNode) {\n node = nextNode;\n }\n else {\n return null;\n }\n }\n else {\n /**\n * If beforeNode is true, then set it to false.\n */\n beforeNode = false;\n }\n }\n else {\n /**\n * - previous\n */\n if (beforeNode) {\n /**\n * If beforeNode is true, then set node to the first node preceding\n * node in iterator’s iterator collection. If there is no such node,\n * then return null.\n */\n const prevNode = TreeAlgorithm_1.tree_getPrecedingNode(iterator.root, node);\n if (prevNode) {\n node = prevNode;\n }\n else {\n return null;\n }\n }\n else {\n /**\n * If beforeNode is false, then set it to true.\n */\n beforeNode = true;\n }\n }\n /**\n * 3.2. Let result be the result of filtering node within iterator.\n * 3.3. If result is FILTER_ACCEPT, then break.\n */\n const result = TraversalAlgorithm_1.traversal_filter(iterator, node);\n if (result === interfaces_1.FilterResult.Accept) {\n break;\n }\n }\n /**\n * 4. Set iterator’s reference to node.\n * 5. Set iterator’s pointer before reference to beforeNode.\n * 6. Return node.\n */\n iterator._reference = node;\n iterator._pointerBeforeReference = beforeNode;\n return node;\n}", "title": "" }, { "docid": "b820efe4d2ede774d6fc1dbe3ace2507", "score": "0.60497963", "text": "*[Symbol.iterator]() {\n\t\tlet node = this.head;\n\t\twhile(node) {\n\t\t\tyield node;\n\t\t\tnode = node.next;\n\t\t}\n\t}", "title": "" }, { "docid": "18c3c63e5c46fa51dc35578cc0074ab0", "score": "0.59611696", "text": "function NodeIteratorImpl(root, reference, pointerBeforeReference) {\n var _this = _super.call(this, root) || this;\n _this._iteratorCollection = undefined;\n _this._reference = reference;\n _this._pointerBeforeReference = pointerBeforeReference;\n algorithm_1.nodeIterator_iteratorList().add(_this);\n return _this;\n }", "title": "" }, { "docid": "e148d87b2b4317d5b2501409eab6aea7", "score": "0.59230286", "text": "function RetroNodeIterator(node) {\r\n this._node = node;\r\n }", "title": "" }, { "docid": "e148d87b2b4317d5b2501409eab6aea7", "score": "0.59230286", "text": "function RetroNodeIterator(node) {\r\n this._node = node;\r\n }", "title": "" }, { "docid": "e6f59e61ff91a598150b90b613874144", "score": "0.59111947", "text": "function RetroNodeIterator(node) {\n this._node = node;\n }", "title": "" }, { "docid": "e6f59e61ff91a598150b90b613874144", "score": "0.59111947", "text": "function RetroNodeIterator(node) {\n this._node = node;\n }", "title": "" }, { "docid": "62fcc5dea00ca14ffaa93cf14e38603a", "score": "0.588742", "text": "function create_nodeIterator(root, reference, pointerBeforeReference) {\n return NodeIteratorImpl_1.NodeIteratorImpl._create(root, reference, pointerBeforeReference);\n}", "title": "" }, { "docid": "62fcc5dea00ca14ffaa93cf14e38603a", "score": "0.588742", "text": "function create_nodeIterator(root, reference, pointerBeforeReference) {\n return NodeIteratorImpl_1.NodeIteratorImpl._create(root, reference, pointerBeforeReference);\n}", "title": "" }, { "docid": "cd4be293beef28b1f8dd5a1a5a8a0b59", "score": "0.58825725", "text": "function iterItems(node) {\n var leaf = firstLeaf(node);\n return new ForwardIterator(leaf, 0, -1);\n }", "title": "" }, { "docid": "45b9017ae7d5d429ed7b851adbc4d7b4", "score": "0.58680993", "text": "*[Symbol.iterator]() {\n let node = this.head;\n while (node) {\n yield node;\n node = node.next;\n }\n }", "title": "" }, { "docid": "3c6718b7213ca5e35f952ec8540ff83c", "score": "0.5826505", "text": "*[Symbol.iterator]() {\n let node = this.head;\n while (node) {\n yield node;\n node = node.next;\n }\n }", "title": "" }, { "docid": "1a887f14d8de8e641a359f2149678b6c", "score": "0.5811749", "text": "static _create(root, reference, pointerBeforeReference) {\n return new NodeIteratorImpl(root, reference, pointerBeforeReference);\n }", "title": "" }, { "docid": "1a887f14d8de8e641a359f2149678b6c", "score": "0.5811749", "text": "static _create(root, reference, pointerBeforeReference) {\n return new NodeIteratorImpl(root, reference, pointerBeforeReference);\n }", "title": "" }, { "docid": "fde3062fc2cd6465b92385d5ed2ce030", "score": "0.5713256", "text": "function RangeNodeIterator(range, nodeTypes, filter) {\n\t\tthis.nodes = getNodesInRange(range, nodeTypes, filter);\n\t\tthis._next = this.nodes[0];\n\t\tthis._position = 0;\n\t}", "title": "" }, { "docid": "fde3062fc2cd6465b92385d5ed2ce030", "score": "0.5713256", "text": "function RangeNodeIterator(range, nodeTypes, filter) {\n\t\tthis.nodes = getNodesInRange(range, nodeTypes, filter);\n\t\tthis._next = this.nodes[0];\n\t\tthis._position = 0;\n\t}", "title": "" }, { "docid": "b8cc689e612edf076b82f19cae0b3c01", "score": "0.5639526", "text": "function RangeNodeIterator(range, nodeTypes, filter) {\n this.nodes = getNodesInRange(range, nodeTypes, filter);\n this._next = this.nodes[0];\n this._position = 0;\n }", "title": "" }, { "docid": "b8cc689e612edf076b82f19cae0b3c01", "score": "0.5639526", "text": "function RangeNodeIterator(range, nodeTypes, filter) {\n this.nodes = getNodesInRange(range, nodeTypes, filter);\n this._next = this.nodes[0];\n this._position = 0;\n }", "title": "" }, { "docid": "b8cc689e612edf076b82f19cae0b3c01", "score": "0.5639526", "text": "function RangeNodeIterator(range, nodeTypes, filter) {\n this.nodes = getNodesInRange(range, nodeTypes, filter);\n this._next = this.nodes[0];\n this._position = 0;\n }", "title": "" }, { "docid": "b8cc689e612edf076b82f19cae0b3c01", "score": "0.5639526", "text": "function RangeNodeIterator(range, nodeTypes, filter) {\n this.nodes = getNodesInRange(range, nodeTypes, filter);\n this._next = this.nodes[0];\n this._position = 0;\n }", "title": "" }, { "docid": "e4c51c38456bd1067043c31e373f0804", "score": "0.5637868", "text": "_moveForward(originNode, offset){\n return this._move(originNode, offset, (node)=>node.next);\n }", "title": "" }, { "docid": "89a915a8475cb8b731186d97382cd07e", "score": "0.56122804", "text": "function RangeNodeIterator(range, nodeTypes, filter) {\r\n this.nodes = getNodesInRange(range, nodeTypes, filter);\r\n this._next = this.nodes[0];\r\n this._position = 0;\r\n }", "title": "" }, { "docid": "46735c5f22765da03e324e6c948eac2c", "score": "0.54938054", "text": "[Symbol.iterator]() {\n let current = this.head;\n const iterator = {\n next() {\n if (current == null) {\n return {\n done: true,\n value: undefined\n };\n }\n else {\n let data = current.data;\n current = current.next;\n return {\n done: false,\n value: data\n };\n }\n }\n };\n return iterator;\n }", "title": "" }, { "docid": "9f63fd578a91b9b05dcd518063ddf397", "score": "0.5485747", "text": "iter(from = 0) {\n return HeapCursor.from([this]).goto(from);\n }", "title": "" }, { "docid": "9ddba7a17d07bfb09840e73431acbb25", "score": "0.54531926", "text": "iter(from = 0) {\n return HeapCursor.from([this]).goto(from);\n }", "title": "" }, { "docid": "e8033cacde21fc875a63f41fce0ec3a6", "score": "0.5452749", "text": "[Symbol.iterator]() {\n if (this.empty()) {\n return {\n next() {\n return {\n done: true\n }\n }\n }\n } else {\n const thisH = this.HeadNode\n let p = null\n return {\n next() {\n p ? p = p.nextPtr : p = thisH\n return {\n value: p ? p._data : undefined,\n done: !!p\n }\n }\n }\n }\n }", "title": "" }, { "docid": "54be33e989db6dc9931717e0a89ab3fe", "score": "0.5422346", "text": "function iteratorFromIncrementing(start) {\n let i = start;\n return iteratorFromFunction(() => ({\n value: i++,\n done: false\n }));\n}", "title": "" }, { "docid": "348b5284faa6bfdcad085810c2c7caa4", "score": "0.5380274", "text": "iter(from = 0) {\n return HeapCursor.from([this]).goto(from);\n }", "title": "" }, { "docid": "72e55111a23262d44c2ffbcd89b586a0", "score": "0.5332158", "text": "GetIterator() {}", "title": "" }, { "docid": "2352ecfc1e60353dd1f1419930b698a5", "score": "0.53230655", "text": "constructor(root, reference, pointerBeforeReference) {\n super(root);\n this._iteratorCollection = undefined;\n this._reference = reference;\n this._pointerBeforeReference = pointerBeforeReference;\n algorithm_1.nodeIterator_iteratorList().add(this);\n }", "title": "" }, { "docid": "2352ecfc1e60353dd1f1419930b698a5", "score": "0.53230655", "text": "constructor(root, reference, pointerBeforeReference) {\n super(root);\n this._iteratorCollection = undefined;\n this._reference = reference;\n this._pointerBeforeReference = pointerBeforeReference;\n algorithm_1.nodeIterator_iteratorList().add(this);\n }", "title": "" }, { "docid": "7927f0664a5939391be06901a4943d01", "score": "0.52559215", "text": "function NodeL(it, succ, prec){\n this.item = it;\n this.next = succ;\n this.prev = prec;\n}", "title": "" }, { "docid": "1dc57435a0f73bdad81e49fc411b6e68", "score": "0.52504194", "text": "_next() {\n const sub = this._pop();\n\n this._state.start = this._state.start.concat(sub.start);\n this._state.end = this._state.end.concat(sub.end);\n this._state.nodes = this._state.nodes.concat(sub.nodes);\n this._state.tail = this._state.tail.concat(sub.tail);\n\n return this._push();\n }", "title": "" }, { "docid": "7b1d6527d588d0f07a422c94fedeb141", "score": "0.52241874", "text": "function iteratorFunction() {\n \n return {\n next: function() {\n return {done: true};\n }\n }\n \n }", "title": "" }, { "docid": "1ac4cc31a2a398a26ec5439585324483", "score": "0.52192163", "text": "function TreeNodeIteratorWrapper(items)\n {\n this._first = true;\n this._items = items;\n // cache available size of the iterator to avoid\n // multiple calculations\n // Iterator is not suppose to life longer than one iteration\n // so this is safe to do here since any data change\n // during the iteration will corrupt data anyway and it should\n // be avoided in a code that uses this iterator.\n this._availableCount = items.getCachedRowCount(0);\n this._totalCount = items.getTreeNodeBindings().keys.length;\n }", "title": "" }, { "docid": "8b6535dd8fccf1fb662aec2a627b267e", "score": "0.5212094", "text": "function SparqlConstructIterator(source, query, options) {\n TransformIterator.call(this, source, options);\n\n // Push constant triple patterns only once\n this._template = query.template.filter(function (triplePattern) {\n return rdf.hasVariables(triplePattern) || this._push(triplePattern);\n }, this);\n this._blankNodeId = 0;\n}", "title": "" }, { "docid": "12d45cef5df6a63fb4171db361df109f", "score": "0.51906127", "text": "function forward_node(node){\n if ((node.childNodes)&&((node.childNodes.length)>0))\n return node.childNodes[0];\n else while (node) {\n if (node.nextSibling)\n return node.nextSibling;\n else node=node.parentNode;}\n return false;}", "title": "" }, { "docid": "930030170cc7f6320c120c630ad00075", "score": "0.5185176", "text": "iterate() {\n\t\tTraversal.prototype.iterate.call(this);\n\t\treturn this;\n\t}", "title": "" }, { "docid": "3ae83c3cf04adf3e16b601db5c060365", "score": "0.5180924", "text": "function ChainIterator(source) {\r\n\t this._cloned = false;\r\n\t this._source = source;\r\n\t this._active = undefined;\r\n\t }", "title": "" }, { "docid": "7805c1fefb58903f14f05aecfb1e57ff", "score": "0.51620793", "text": "function ChainIterator(source) {\r\n this._cloned = false;\r\n this._source = source;\r\n this._active = undefined;\r\n }", "title": "" }, { "docid": "7805c1fefb58903f14f05aecfb1e57ff", "score": "0.51620793", "text": "function ChainIterator(source) {\r\n this._cloned = false;\r\n this._source = source;\r\n this._active = undefined;\r\n }", "title": "" }, { "docid": "866f3f1fdbb6d654d22002966cac7a1e", "score": "0.51549566", "text": "function ChainIterator(source) {\n this._cloned = false;\n this._source = source;\n this._active = undefined;\n }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.5154646", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.5154646", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.5154646", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.5154646", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.5154646", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.5154646", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.5154646", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.5154646", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.5154646", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5f4ed77136e6791f8e3d94016336b599", "score": "0.5147858", "text": "function iteratorFor(items) {\n var iterator = {\n next: function() {\n\tvar value = items.shift()\n\treturn {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n\treturn iterator\n }\n }\n\n return iterator\n }", "title": "" }, { "docid": "165e3f34d05f0f516ab0a6d04431b734", "score": "0.5118791", "text": "function makeIterator(src, thisObj){\n switch(typeof src) {\n case 'object':\n // typeof null == \"object\"\n return (src != null)? function(val, key, target){\n return deepMatches(val, src);\n } : src;\n case 'string':\n case 'number':\n return prop(src);\n case 'function':\n if (typeof thisObj === 'undefined') {\n return src;\n } else {\n return function(val, i, arr){\n return src.call(thisObj, val, i, arr);\n };\n }\n default:\n return src;\n }\n }", "title": "" }, { "docid": "165e3f34d05f0f516ab0a6d04431b734", "score": "0.5118791", "text": "function makeIterator(src, thisObj){\n switch(typeof src) {\n case 'object':\n // typeof null == \"object\"\n return (src != null)? function(val, key, target){\n return deepMatches(val, src);\n } : src;\n case 'string':\n case 'number':\n return prop(src);\n case 'function':\n if (typeof thisObj === 'undefined') {\n return src;\n } else {\n return function(val, i, arr){\n return src.call(thisObj, val, i, arr);\n };\n }\n default:\n return src;\n }\n }", "title": "" }, { "docid": "5342e05dbbb5eced225b599efc5fad82", "score": "0.51179904", "text": "function RetroIterator(node, index, count) {\n this._node = node;\n this._index = index;\n this._count = count;\n }", "title": "" }, { "docid": "4a322c508f53a53a5f779740fc3a0ece", "score": "0.5117313", "text": "function RedBlackTreeIterator(tree, stack) {\n\t this.tree = tree\n\t this._stack = stack\n\t}", "title": "" }, { "docid": "800af15207731fe479a55894a26d4184", "score": "0.5117068", "text": "prepend(value) {\n const preNode = new Node(value) // call class node to get value & next\n preNode.next = this.head // make preNode.next = old head\n this.head = preNode // move head to be preNode\n this.length++ // increase length\n }", "title": "" }, { "docid": "3bced4bb7c8ba6d55725ef228fad50ab", "score": "0.5116324", "text": "function RedBlackTreeIterator(tree, stack) {\n this.tree = tree\n this._stack = stack\n}", "title": "" }, { "docid": "3bced4bb7c8ba6d55725ef228fad50ab", "score": "0.5116324", "text": "function RedBlackTreeIterator(tree, stack) {\n this.tree = tree\n this._stack = stack\n}", "title": "" }, { "docid": "3bced4bb7c8ba6d55725ef228fad50ab", "score": "0.5116324", "text": "function RedBlackTreeIterator(tree, stack) {\n this.tree = tree\n this._stack = stack\n}", "title": "" }, { "docid": "3bced4bb7c8ba6d55725ef228fad50ab", "score": "0.5116324", "text": "function RedBlackTreeIterator(tree, stack) {\n this.tree = tree\n this._stack = stack\n}", "title": "" }, { "docid": "3bced4bb7c8ba6d55725ef228fad50ab", "score": "0.5116324", "text": "function RedBlackTreeIterator(tree, stack) {\n this.tree = tree\n this._stack = stack\n}", "title": "" }, { "docid": "3bced4bb7c8ba6d55725ef228fad50ab", "score": "0.5116324", "text": "function RedBlackTreeIterator(tree, stack) {\n this.tree = tree\n this._stack = stack\n}", "title": "" }, { "docid": "9b7e34003881c7f16be0d2ab1fb792d2", "score": "0.51160216", "text": "function iteratorFor(items) {\r\n var iterator = {\r\n next: function() {\r\n var value = items.shift()\r\n return {done: value === undefined, value: value}\r\n }\r\n }\r\n\r\n if (support.iterable) {\r\n iterator[Symbol.iterator] = function() {\r\n return iterator\r\n }\r\n }\r\n\r\n return iterator\r\n }", "title": "" }, { "docid": "37ff60bf3b6523454ebe969433bd54c9", "score": "0.5096923", "text": "feedForward() {\n this._connections.forEach(conn =>\n conn.neuron.pushInput(this.getOutput(), conn.weight));\n return this;\n }", "title": "" }, { "docid": "58823280aafc64290242e3747a52745a", "score": "0.5095396", "text": "prepend(value) {\n this.head = {\n value: value,\n next: this.head,\n prev: null\n };\n\n this.head.next.prev = this.head;\n\n this.length++;\n return this;\n }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.50874615", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "2b3b7271462bcbd287298bd012ffea7a", "score": "0.5074589", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift();\n\t return {done: value === undefined, value: value}\n\t }\n\t };\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t };\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "2b3b7271462bcbd287298bd012ffea7a", "score": "0.5074589", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift();\n\t return {done: value === undefined, value: value}\n\t }\n\t };\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t };\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "4f4aa6e77280bd3e3a65ae01e3f87d6d", "score": "0.5058789", "text": "forEach(fn) {\n //assign node to head\n let node = this.head;\n //assign couner for iterator\n let counter = 0;\n //while a node exists\n while (node) {\n //call our passed function(fn)\n fn(node, counter);\n //crawl through the nodes by calling node.next\n node = node.next;\n //increment counter by 1\n counter++;\n }\n }", "title": "" }, { "docid": "0d616b1e51eb975b065991f50a359061", "score": "0.50581115", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function next() {\n\t var value = items.shift();\n\t return { done: value === undefined, value: value };\n\t }\n\t };\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function () {\n\t return iterator;\n\t };\n\t }\n\t\n\t return iterator;\n\t }", "title": "" }, { "docid": "0d616b1e51eb975b065991f50a359061", "score": "0.50581115", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function next() {\n\t var value = items.shift();\n\t return { done: value === undefined, value: value };\n\t }\n\t };\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function () {\n\t return iterator;\n\t };\n\t }\n\t\n\t return iterator;\n\t }", "title": "" }, { "docid": "2978d1d4b944816cf3a88a48fca98672", "score": "0.5048819", "text": "function EnumerateIterator(source, start) {\r\n this._source = source;\r\n this._index = start;\r\n }", "title": "" }, { "docid": "fe156157dd3e222dbf3759d00365730f", "score": "0.5047261", "text": "prepend(value) {\n const newNode = new Node (value);\n newNode.next = this.head;\n this.head = newNode;\n this.length++;\n return this;\n }", "title": "" }, { "docid": "10886112aebae15dc931df90e345db3b", "score": "0.5046206", "text": "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "title": "" }, { "docid": "10886112aebae15dc931df90e345db3b", "score": "0.5046206", "text": "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "title": "" }, { "docid": "ee15b565b81e3d7cf2811c2c977af4b3", "score": "0.5045608", "text": "function makeIterator(src, thisObj){\r\n if (src == null) {\r\n return identity;\r\n }\r\n switch(typeof src) {\r\n case 'function':\r\n // function is the first to improve perf (most common case)\r\n // also avoid using `Function#call` if not needed, which boosts\r\n // perf a lot in some cases\r\n return (typeof thisObj !== 'undefined')? function(val, i, arr){\r\n return src.call(thisObj, val, i, arr);\r\n } : src;\r\n case 'object':\r\n return function(val){\r\n return deepMatches(val, src);\r\n };\r\n case 'string':\r\n case 'number':\r\n return prop(src);\r\n }\r\n }", "title": "" }, { "docid": "3723f225eea5e66ed7b9a37d88b0e540", "score": "0.5040663", "text": "prepend(value) {\n let prependObj = new Node(value);\n prependObj.next = this.head;\n this.head = prependObj;\n this.length++;\n }", "title": "" }, { "docid": "3798264e1ff4048d486789c2c221b180", "score": "0.5040585", "text": "function iteratorFor(items) {\n var iterator = {\n next: function () {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function () {\n return iterator\n }\n }\n\n return iterator\n }", "title": "" }, { "docid": "ed5dfe2b7bd399132651f197e3562fc9", "score": "0.5038364", "text": "prepend(value) {\n const node = new Node(value, null, this.head);\n\n if (node.next) {\n node.next.prev = node;\n } else {\n this.tail = node;\n }\n\n this.head = node;\n this.numberOfNodes += 1;\n }", "title": "" }, { "docid": "cc2b2dbc99816b55054466771b2957c6", "score": "0.503437", "text": "function RedBlackTreeIterator(tree, stack) {\n\t this.tree = tree;\n\t this._stack = stack;\n\t}", "title": "" } ]
0b80bf2b7a861ca3eb722a768608bdc1
Removes a property from the current state and return a new state.
[ { "docid": "de2a15ae393018bcb1c3393ad16f5688", "score": "0.85346776", "text": "removeStateProp(property) {\n delete this.state[property];\n return { ...this.state, ...INITIAL_STATE };\n }", "title": "" } ]
[ { "docid": "bf86becde6728c6ebc6117ed281eb5f2", "score": "0.6650429", "text": "function removeCurrentObjectProperty () {\n var self = walker.self();\n var parent = walker.parent();\n changed = true;\n parent.properties = parent.properties.filter(function (item) {\n return item != self;\n });\n }", "title": "" }, { "docid": "a8ca978c1aad563b2c2da7a312b7c1f0", "score": "0.6515315", "text": "removeProperty(aProperty){\n let propIndex = this._indexOfProperty(aProperty);\n if(propIndex >= 0){\n this._properties.splice(propIndex, 1);\n }\n }", "title": "" }, { "docid": "c40cdfb5e0fe6f368996af39f0f5dae0", "score": "0.63088816", "text": "function deleteProp( obj,property){\n delete obj[property]\n return obj\n\n}", "title": "" }, { "docid": "d36ca56b77f7f8ce3706603d197de28b", "score": "0.6292197", "text": "function deleteProp(obj, prop){\n delete obj[prop]\n return obj\n}", "title": "" }, { "docid": "a647606525ac32f135f2d315cae3bbae", "score": "0.5981482", "text": "handleRemovePropertyFromSavedList(propertyId) {\n const savedProperties = this.state.saved;\n const updatedSavedProperties = savedProperties.filter(property => property.id !== propertyId);\n this.handleToggleSavedFlag(propertyId);\n this.setState({ saved: updatedSavedProperties });\n }", "title": "" }, { "docid": "2fbc0d24aab101aabed1944bea0a4ded", "score": "0.5744372", "text": "function reviveProperty(holder, property) {\n\t\t\tvar value = holder[property]\n\t\t\tif (value && typeof value === 'object') {\n\n\t\t\t\t// the property value is an object\n\t\t\t\t// process all of its properties first\n\t\t\t\tvar propertiesToDelete\n\t\t\t\tfor (var p in value) {\n\t\t\t\t\tif (Object.hasOwnProperty.call(value, p) && value !== holder) {\n\t\t\t\t\t\tvar v = reviveProperty(value, p)\n\t\t\t\t\t\t// if return value is not undefined, we will keep the value\n\t\t\t\t\t\tif (v !== void 0) value[p] = v\n\t\t\t\t\t\telse { // ancient code here\n\t\t\t\t\t\t\tif (!propertiesToDelete) propertiesToDelete = []\n\t\t\t\t\t\t\tpropertiesToDelete.push(p)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// delete the properties requested\n\t\t\t\tif (propertiesToDelete) propertiesToDelete.forEach(function (property) {\n\t\t\t\t\tdelete value[property]\n\t\t\t\t})\n\t\t\t}\n\t\t\treturn reviver.call(holder, property, value)\n\t\t}", "title": "" }, { "docid": "36e53f4cca98c54c4c5521768360c449", "score": "0.570925", "text": "erase (property, propertyValue) {\n var object = {};\n object[property] = propertyValue;\n this.model.remove(object, function(err, result) {\n if (err) throw err;\n });\n }", "title": "" }, { "docid": "bb8e5cb8c9326571d5acc2ed8eb2c1ea", "score": "0.5696897", "text": "undecorate(property) {\n if (!this.decorationSlots[property]) return;\n // @todo: valued undecoration issue here\n if (this.decorationSlots[property] <= 1)\n return void delete this.decorationSlots[property];\n this.decorationSlots[property] -= 1;\n }", "title": "" }, { "docid": "beef921a110239a585b4830e0f5e8976", "score": "0.5693749", "text": "function unset(property, key=settings.key) {\n $(selector(key, property)).remove();\n }", "title": "" }, { "docid": "190190d8e408023a8d2a3c1637319d71", "score": "0.5689109", "text": "_upgradeProperty(prop) {\r\n if (this.hasOwnProperty(prop)) {\r\n const val = this[prop];\r\n delete this[prop];\r\n this[prop] = val;\r\n }\r\n }", "title": "" }, { "docid": "22746f30eebb622427bb07b89bb2fe0c", "score": "0.5615743", "text": "deleteProperty(obj,prop) {\n if (this.subtrees[prop]) {\n delete this.subtrees[prop];\n }\n \n let robj = this;\n while (robj.parent) robj = robj.parent;\n return this.handler.deletePath (robj.target, this.keypath(prop));\n }", "title": "" }, { "docid": "1a07973663a4436bf4522b0a55d3e8b7", "score": "0.5576101", "text": "function removeProperty(element, property) {\r\n element.style.removeProperty(property);\r\n}", "title": "" }, { "docid": "5668b3978232e008c9e510049e4a28f5", "score": "0.5521089", "text": "deleteProperty(target, prop) {\n console.log('Deleting...')\n delete target[prop]\n }", "title": "" }, { "docid": "961f59cb98db91f2d7e8ba8633aec44b", "score": "0.549447", "text": "popState() {\n if (this._states.length > 1) {\n return this._states.pop();\n }\n return this._states[0];\n }", "title": "" }, { "docid": "2154b85ac9f7c33fedc6a5c7a4ff6dd6", "score": "0.54899096", "text": "unfreezeProperty(prop) {\n redefineReadWriteable(this, prop);\n }", "title": "" }, { "docid": "cdc8134600e3c3bdf1f51a79c6411147", "score": "0.545997", "text": "function unset(alias, property, callback) {\n\t return new Promise(function(resolve, reject){\n\t getComponent(alias).then(function(component){\n\n\t // Set this flag so Chiasm knows the change originated from setConfig().\n\t settingProperty = true;\n\n\t component[property] = defaults[alias][property];\n\n\t settingProperty = false;\n\t resolve();\n\t }, reject);\n\t });\n\t }", "title": "" }, { "docid": "66940bd32e10028fdd27ddab704b2990", "score": "0.54588085", "text": "function removeState(state) {\n states.splice(states.indexOf(state), 1);\n}", "title": "" }, { "docid": "902f972ee08b2b9be8d3b924ec649df0", "score": "0.54003215", "text": "remove(){\n delete this.state.winnings[this.state.count-1];\n this.setState(prevState=>({\n ...prevState,\n count:this.state.count-1,\n winnings:this.state.winnings\n }))\n }", "title": "" }, { "docid": "2f0393c7f5f79b549352de9296507093", "score": "0.53923535", "text": "function subtract(o, p) {\r\n for(prop in p) {\r\n delete o[prop];\r\n }\r\n return o;\r\n}", "title": "" }, { "docid": "ddb958d32447c55b9e13026e4ae0ddce", "score": "0.53278184", "text": "remove() {\n\tvar next = this._next;\n\tvar prev = this._previous;\n\tif (prev) {\n\t\tprev._next = next;\n\t}\n\tif (next) {\n\t\tnext._previous = prev;\n\t}\n\tthis._next = undefined;\n\tthis._previous = undefined;\n\treturn this;\n}", "title": "" }, { "docid": "716a00e67edc94e4b154a06f10e3cd4e", "score": "0.5317111", "text": "pop(): NavigationState {\n invariant(this._routeNodes.size > 1, 'can not pop a NavigationState with only one route');\n\n // When popping, removes the rest of the routes past the current index.\n var routeNodes = this._routeNodes.slice(0, this._index);\n return this._update(routeNodes, routeNodes.size - 1);\n }", "title": "" }, { "docid": "2f9a87fb4b79af3ebfb53689f71691d4", "score": "0.52733934", "text": "function removeProperty(obj,key){\n delete obj[key];\n }", "title": "" }, { "docid": "34baff0c1933e692e421fd728dcb39d9", "score": "0.5264705", "text": "destroy() {\n // Remove the prop element\n if (this.prop !== null) {\n this._dom.container.removeChild(this.prop)\n this._dom.prop = null\n }\n }", "title": "" }, { "docid": "0ca17aa2386eb3b30decd981a90f4689", "score": "0.52538365", "text": "remove(){\r\n this.toRemove = true;\r\n return this;\r\n }", "title": "" }, { "docid": "86e9c34a3b029ffbdeb1f0bd7ea4b41d", "score": "0.52483296", "text": "deleteProperty(target, property) {\n const { freeze, tag } = options.delete;\n if (tag) {\n warnUser(target, `Property \"${property}\"`, 'delete', freeze);\n }\n if (!freeze) {\n delete target[property];\n }\n return true;\n }", "title": "" }, { "docid": "5e895e74c92e2b01f24339a55730bc67", "score": "0.52340543", "text": "removeItem( path ) {\n let state = this.getState();\n if ( ! has( state, path ) ) return;\n unset( state, path );\n window.localStorage.setItem( '__state', JSON.stringify( state ) );\n }", "title": "" }, { "docid": "9959b2c49bbd049157b83bdc876c1ed3", "score": "0.52252316", "text": "function unliftState(liftedState) {\n\t var computedStates = liftedState.computedStates;\n\t var currentStateIndex = liftedState.currentStateIndex;\n\t var state = computedStates[currentStateIndex].state;\n\n\t return state;\n\t}", "title": "" }, { "docid": "9959b2c49bbd049157b83bdc876c1ed3", "score": "0.52252316", "text": "function unliftState(liftedState) {\n\t var computedStates = liftedState.computedStates;\n\t var currentStateIndex = liftedState.currentStateIndex;\n\t var state = computedStates[currentStateIndex].state;\n\n\t return state;\n\t}", "title": "" }, { "docid": "9959b2c49bbd049157b83bdc876c1ed3", "score": "0.52252316", "text": "function unliftState(liftedState) {\n\t var computedStates = liftedState.computedStates;\n\t var currentStateIndex = liftedState.currentStateIndex;\n\t var state = computedStates[currentStateIndex].state;\n\n\t return state;\n\t}", "title": "" }, { "docid": "13e14485f3abf09328f846b2e9a541b3", "score": "0.52217734", "text": "function unliftState(liftedState) {\n\t var computedStates = liftedState.computedStates;\n\t var currentStateIndex = liftedState.currentStateIndex;\n\t var state = computedStates[currentStateIndex].state;\n\t\n\t return state;\n\t}", "title": "" }, { "docid": "13e14485f3abf09328f846b2e9a541b3", "score": "0.52217734", "text": "function unliftState(liftedState) {\n\t var computedStates = liftedState.computedStates;\n\t var currentStateIndex = liftedState.currentStateIndex;\n\t var state = computedStates[currentStateIndex].state;\n\t\n\t return state;\n\t}", "title": "" }, { "docid": "7161de7ae4881f54a5783726bd7a1440", "score": "0.52028596", "text": "function removeProperty(obj, key) {\n delete obj[key];\n}", "title": "" }, { "docid": "09aa27d47dfd12a5498fc5b83c45cf07", "score": "0.5195502", "text": "function removeProperty(index) {\n ctrl.vendorProperties.splice(index, 1);\n }", "title": "" }, { "docid": "c1852074255091bdb02efb4cc8113054", "score": "0.5186882", "text": "function deleteProp(obj,str){\n delete obj.str\n return obj\n}", "title": "" }, { "docid": "4c0568cf625428936566ff1b7faa67e9", "score": "0.51811343", "text": "function propertyNull() {\n delete this[name];\n }", "title": "" }, { "docid": "4c0568cf625428936566ff1b7faa67e9", "score": "0.51811343", "text": "function propertyNull() {\n delete this[name];\n }", "title": "" }, { "docid": "245b8d80a13de121dff343ffe1a73ef0", "score": "0.5159714", "text": "function propertyNull() {\n\t delete this[name];\n\t }", "title": "" }, { "docid": "ea44f625ec42f615c8687ed3ade5dd19", "score": "0.5154338", "text": "remove(properties) {\n properties = getProperties(properties);\n\n this.fields.pop();\n this.value.pop();\n this.updateValueAndValidity(properties);\n }", "title": "" }, { "docid": "3ca2a553f059b7d7dbe26f0f5d67e480", "score": "0.51371175", "text": "popState() {\n\t\tthis.state = this.stateStack.pop();\n\t}", "title": "" }, { "docid": "02fb887d1e944df3f54910dbc96b498e", "score": "0.51269794", "text": "clear() {\n this.value = null;\n\n return this;\n }", "title": "" }, { "docid": "98421ae688709aaaf97adca90cc783e4", "score": "0.5124817", "text": "function removeProperty(element, name) {\n dom.removeAttr(element, normalise(name));\n }", "title": "" }, { "docid": "3b3457efe7eab3036f4c4372530874a9", "score": "0.5109522", "text": "function unliftState(liftedState) {\n var computedStates = liftedState.computedStates;\n var currentStateIndex = liftedState.currentStateIndex;\n var state = computedStates[currentStateIndex].state;\n\n return state;\n}", "title": "" }, { "docid": "3b3457efe7eab3036f4c4372530874a9", "score": "0.5109522", "text": "function unliftState(liftedState) {\n var computedStates = liftedState.computedStates;\n var currentStateIndex = liftedState.currentStateIndex;\n var state = computedStates[currentStateIndex].state;\n\n return state;\n}", "title": "" }, { "docid": "3b3457efe7eab3036f4c4372530874a9", "score": "0.5109522", "text": "function unliftState(liftedState) {\n var computedStates = liftedState.computedStates;\n var currentStateIndex = liftedState.currentStateIndex;\n var state = computedStates[currentStateIndex].state;\n\n return state;\n}", "title": "" }, { "docid": "3b3457efe7eab3036f4c4372530874a9", "score": "0.5109522", "text": "function unliftState(liftedState) {\n var computedStates = liftedState.computedStates;\n var currentStateIndex = liftedState.currentStateIndex;\n var state = computedStates[currentStateIndex].state;\n\n return state;\n}", "title": "" }, { "docid": "e3a5ec470c790a80b1107239f6ed3f4c", "score": "0.5106602", "text": "function deleteProperty(propertyName) {\n var property = document.getElementById(\"custom property \" + propertyName);\n property.innerHTML = '';\n }", "title": "" }, { "docid": "9cedcbfb40e4888bb56ce5f2240ab508", "score": "0.50966835", "text": "function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n warning(false, \"[JSS] DOMException \\\"\" + err.message + \"\\\" was thrown. Tried to remove property \\\"\" + prop + \"\\\".\") ;\n }\n }", "title": "" }, { "docid": "1b3ce348ba19f266aef414a87585f7d0", "score": "0.5083994", "text": "function pop(obj, prop, defaultValue) {\n if (obj == null) {\n throw new Error('pop was given ' + obj)\n }\n if (hasOwn(obj, prop)) {\n var value = obj[prop]\n delete obj[prop]\n return value\n }\n else if (arguments.length == 2) {\n throw new Error(\"pop was given an object which didn't have an own '\" +\n prop + \"' property, without a default value to return\")\n }\n return defaultValue\n}", "title": "" }, { "docid": "1b3ce348ba19f266aef414a87585f7d0", "score": "0.5083994", "text": "function pop(obj, prop, defaultValue) {\n if (obj == null) {\n throw new Error('pop was given ' + obj)\n }\n if (hasOwn(obj, prop)) {\n var value = obj[prop]\n delete obj[prop]\n return value\n }\n else if (arguments.length == 2) {\n throw new Error(\"pop was given an object which didn't have an own '\" +\n prop + \"' property, without a default value to return\")\n }\n return defaultValue\n}", "title": "" }, { "docid": "ee39221ab762cd97d600e4c70614724c", "score": "0.508089", "text": "function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n warning(false, \"[JSS] DOMException \\\"\" + err.message + \"\\\" was thrown. Tried to remove property \\\"\" + prop + \"\\\".\");\n }\n }", "title": "" }, { "docid": "85a9fc42d380fdc0c2f42c869986e8ad", "score": "0.50735", "text": "function cleaningLady( property ) {\n\t\t\t\n\t\t\tvar itemData = data.items[ 'item-' + params.id ];\n\t\t\t\n\t // If default style for this property doesn't exist, remove it from local storage data\n\t if ( defaultStyle[ property ] === undefined && itemData.style[ property ] !== undefined ) {\n\t delete itemData.style[ property ];\n\t }\n\t // Add default style to local storage if this property exists in default styles\n\t if ( defaultStyle[ property ] !== undefined && itemData.style[ property ] === undefined ) {\n\t itemData.style[ property ] = defaultStyle[ property ];\n\t }\n\t\t\t\n\t\t}", "title": "" }, { "docid": "d89eb348f160df8c2945745f6b72edb1", "score": "0.5070977", "text": "release() {\n this.unprocessed = undefined;\n\n if (!this.isLazy) {\n this.state = this.tx(undefined);\n }\n\n this.isDirty = true;\n return this.parent.removeWatch(this.id);\n }", "title": "" }, { "docid": "be4ac68a6c8d267f5606ef24047e7693", "score": "0.50685835", "text": "pop() {\n const item = this.data[this.index - 1]; // index was +1 when last item was pushed, so to grab last item , index has to be -1\n delete this.data[this.index - 1]; // we can't do -- delete item -- here, bcz we wanna delete property of actual object\n this.index--; // last item is deleted, so its index is removed\n return item;\n }", "title": "" }, { "docid": "1263d0bea1465ecb82d546ecc1e2fafb", "score": "0.50667095", "text": "reset() {\r\n this._state = 'normal';\r\n return this._state;\r\n }", "title": "" }, { "docid": "a7c13ce084e9923960765e030b1a0d79", "score": "0.50632", "text": "function getPropertyAndUnset(target, name) {\n var value = target.hasOwnProperty(name) ? target[name] : null;\n delete target[name];\n return value;\n}", "title": "" }, { "docid": "4d30a6cd407531287aed539cb7d2dd34", "score": "0.50627595", "text": "function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n false ? undefined : void 0;\n }\n}", "title": "" }, { "docid": "4d30a6cd407531287aed539cb7d2dd34", "score": "0.50627595", "text": "function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n false ? undefined : void 0;\n }\n}", "title": "" }, { "docid": "4d30a6cd407531287aed539cb7d2dd34", "score": "0.50627595", "text": "function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n false ? undefined : void 0;\n }\n}", "title": "" }, { "docid": "4d30a6cd407531287aed539cb7d2dd34", "score": "0.50627595", "text": "function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n false ? undefined : void 0;\n }\n}", "title": "" }, { "docid": "57a482ca7e00aee863d3d55ab15ffe8c", "score": "0.5044007", "text": "function propertyFunction() {\n var x = value.apply(this, arguments);\n if (x == null) delete this[name];\n else this[name] = x;\n }", "title": "" }, { "docid": "57a482ca7e00aee863d3d55ab15ffe8c", "score": "0.5044007", "text": "function propertyFunction() {\n var x = value.apply(this, arguments);\n if (x == null) delete this[name];\n else this[name] = x;\n }", "title": "" }, { "docid": "4659f241edb47e94d14704c2489e1b6f", "score": "0.5043055", "text": "clear () {\n this.state.clear();\n }", "title": "" }, { "docid": "081fa2c35e0f99925af03bcf9fbeaf87", "score": "0.5042279", "text": "unset() {\n this.value = Branch.UNSELECTED;\n }", "title": "" }, { "docid": "39d697629ce38df1e29a1ec582280b3b", "score": "0.5041076", "text": "removeData(stateValueRep, data, senderAddress, context, protobufInfo) {\n return new Promise((resolve, reject) => {\n // Removing state\n });\n }", "title": "" }, { "docid": "74f34a0aacc4ac15d38a878fde283e19", "score": "0.503868", "text": "componentWillReceiveProps(nextProps) {\n const {value, removeProp, otherPropPath} = this.props;\n // Remove other explanation\n if (value === 'other' && nextProps.value !== 'other') {\n removeProp(...otherPropPath);\n }\n }", "title": "" }, { "docid": "e62d69939558055f335037614ad0735a", "score": "0.50376403", "text": "function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap[\"delete\"](prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n true ? warning(false, \"[JSS] DOMException \\\"\" + err.message + \"\\\" was thrown. Tried to remove property \\\"\" + prop + \"\\\".\") : undefined;\n }\n}", "title": "" }, { "docid": "77fd52d58dc7215dcae4cb2da8dd56ee", "score": "0.5020667", "text": "getStoredPropertyState(property) {\n return this._stateStorage[property];\n }", "title": "" }, { "docid": "dd40024a8822a8402eaaee945aadd577", "score": "0.50169754", "text": "pop() {\n return this._store.pop();\n }", "title": "" }, { "docid": "1df0d9604773a8a8957270884caa57f6", "score": "0.4998509", "text": "undo() {\n if (this.history.length) {\n const prev = this.state.deref();\n this.future.push(prev);\n const curr = this.state.reset(this.history.pop());\n this.notify({\n id: History_1.EVENT_UNDO,\n value: {\n prev,\n curr\n }\n });\n return curr;\n }\n }", "title": "" }, { "docid": "d25ad638903784d6fbbcb79a2889e1c3", "score": "0.4976527", "text": "unwrap() {\r\n\t\t\t\t\tif (this.properties.length) {\r\n\t\t\t\t\t\treturn this;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn this.base;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "title": "" }, { "docid": "c762c2bd5c819f883f29322d57ae2bdc", "score": "0.49663666", "text": "restoreState(){\n if(this.state && this.state.trim().length>0){\n this.name = this.state;\n }\n }", "title": "" }, { "docid": "f26d989aaa1857dc4091187d4fef8a4e", "score": "0.49663526", "text": "onPropertyWillUnshadow() {\n\t\t// need to call parent classes version\n\t\tsuper.onPropertyWillUnshadow();\n\n\t\tconst managedType = this.stateType().getManagedType();\n\t\tconst updateName = managedType && managedType.getUpdateName();\n\n\t\tif (updateName) {\n\t\t\tthis.store().removeRemoteListener(updateName, this);\n\t\t}\n\t}", "title": "" }, { "docid": "59aa163febd979c79004484f63a728de", "score": "0.49570113", "text": "remove() {\n this.obj.remove()\n }", "title": "" }, { "docid": "d3c383c948dda279d6b3a94b1601cb8c", "score": "0.49551862", "text": "function removeFromAppState(itemKey) {\n let appStateEncoded = getItemInLocalStorage(\"dx_app_state\");\n if (appStateEncoded !== null) {\n appState = JSON.parse(atob(appStateEncoded));\n if (appState.hasOwnProperty(itemKey)) {\n delete appState[itemKey];\n storeAppState();\n } else {\n dxLog(\"Trying to remove property '\" + itemKey + \"' from dx_app_state but this property is not defined.\");\n }\n }\n\n}", "title": "" }, { "docid": "60f1e2a6b60182f632fe4b352d2f32e2", "score": "0.49435365", "text": "unwrap() {\n if (this.properties.length) {\n return this;\n } else {\n return this.base;\n }\n }", "title": "" }, { "docid": "9cae3c70f763fe971b0976e765dc907b", "score": "0.49354056", "text": "clearValue() {\n return this.deactivate();\n }", "title": "" }, { "docid": "df203ee5972610169f7be53b09bd229b", "score": "0.49352002", "text": "function clearProp() {\n abortExistingEntRequest();\n var clearMap={sunrise:\"\",sunset: \"\"};\n editingNewProp = false;\n gVClassUri = null;\n dwr.util.setValues( clearMap );\n clear(dwr.util.byId(\"propertyList\"));\n clear(dwr.util.byId(\"vClassList\"));\n\n var ele = dwr.util.byId(\"entitiesList\");\n while( ele != null && ele.length > 0){\n ele.remove(0);\n }\n}", "title": "" }, { "docid": "9ef675322f2751962a5db6040d2d402c", "score": "0.49279645", "text": "function deleteProp(obj){\n\tconsole.log(obj);\n\tfor(let prop in obj){\n\t\tif(prop === 'rollno'){\n\t\t\t//console.log(prop);\n\t\t\tdelete obj[prop];\n\t\t}\n\t}\n\treturn obj;\n}", "title": "" }, { "docid": "537eb96b98310ae9e89463210c4b20ce", "score": "0.49263564", "text": "undoEdge() {\n\t\tconst { temp } = this.state;\n\n\t\tif( temp != null ) {\n\t\t\tthis.setState( { temp:null } );\n\t\t\t// remove edgeline with only start\n\t\t\tconst edgeID = temp[1];\n\t\t\tdocument.removeEventListener( 'mousemove', this.followMouseFunction );\n\t\t\tthis.setState( { requestType:this.props.type } );\n\t\t\tthis.operateOnList( 'delete', 'edge', edgeID );\n\t\t}// if\n\t}", "title": "" }, { "docid": "0d2dfc73a87be5766cd3aad8a489f233", "score": "0.4924075", "text": "removeMapEventByProperty(eventProperty, by){\n\t\tconsole.log(\"Remove map event with property \"+by+\" = \" + eventProperty);\n\t\tvar removed = false;\n\t\tvar target = undefined;\n\t\tvar events = this.mapEvents;\n\t\tfor(var i=0;i<events.length;i++){\n\t\t\tvar event = events[i];\n\t\t\tif(event[by] === eventProperty){\n\t\t\t\tunByKey(event);\n\t\t\t\tremoved = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.mapEvents = this.mapEvents.filter(function(value, index, arr){return value.id != eventProperty});\n\t\treturn removed;\n\t}", "title": "" }, { "docid": "1182d8d4c02439c3c533361f190a750f", "score": "0.49212533", "text": "reset() {\r\n return this.currentState = this.initialState;\r\n }", "title": "" }, { "docid": "5518f5f2110f2419e735d913a43b4d6d", "score": "0.49207175", "text": "clear() {\n const state = this.destroy() || {};\n this.empty(this.getElement());\n return state;\n }", "title": "" }, { "docid": "35e746c80489e52d445b17f1c1c80022", "score": "0.4918772", "text": "remove() {\n return this.item.pop();\n }", "title": "" }, { "docid": "6279ab40f082980ee9757b3b64013681", "score": "0.49171707", "text": "remove(selector, callback, context) {\n if (!context) var context = {};\n if (!context.modifier) context.modifier = {};\n context.modifier[this.config.aliases.launched] = ['unspread'];\n return super.remove(selector, callback, context);\n }", "title": "" }, { "docid": "278d2acbe53c47f38f1bba2ddfc2587e", "score": "0.49131402", "text": "function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n true ? Object(tiny_warning_esm[\"default\"])(false, \"[JSS] DOMException \\\"\" + err.message + \"\\\" was thrown. Tried to remove property \\\"\" + prop + \"\\\".\") : undefined;\n }\n}", "title": "" }, { "docid": "2e2389132fed2297abb30bfcbd4106f3", "score": "0.49009293", "text": "function destroyProperty(property, callback) {\n property.destroy(function(err, status) {\n if(err) return callback(err);\n if(status === 0) return callback(new Error('Error destroying ' + property._attributes.key + ' property'));\n callback(null);\n });\n}", "title": "" }, { "docid": "4300c3251fc666c96073e7e8083d2a85", "score": "0.4886977", "text": "clearStates() {\n while (this.#states.length > 0) {\n this.#states.pop();\n }\n }", "title": "" }, { "docid": "4246e65885c61e25f5d1aca62c273b05", "score": "0.48840582", "text": "removeWatch(id) {\n return this.state.removeWatch(id);\n }", "title": "" }, { "docid": "a6b7c66b70b5e65da300d0582dcbdb11", "score": "0.48819333", "text": "remove() {\n this[ELEMENT].parentNode.removeChild(this[ELEMENT]);\n return this;\n }", "title": "" }, { "docid": "18c89dfb9a67b1711d23a384eb0b90f9", "score": "0.48802543", "text": "function removeProperty(cssRule, prop) {\n\t\t\ttry {\n\t\t\t\tcssRule.style.removeProperty(prop);\n\t\t\t} catch (err) {\n\t\t\t\t(0, _warning2['default'])(false, '[JSS] DOMException \"%s\" was thrown. Tried to remove property \"%s\".', err.message, prop);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "bc6adfce5a3ac3b5dd657242d58f3228", "score": "0.48783568", "text": "function deleteItem() {\n state.splice(0, 1);\n}", "title": "" }, { "docid": "740e73740bd6ad3c86c7a3a4cd1c213a", "score": "0.48588938", "text": "MemberExpression(path) {\n if (isMDXContentStaticProperty(path.node)) {\n path.parentPath.remove()\n }\n }", "title": "" }, { "docid": "493e00de8f29303e5c13d905bcf64a10", "score": "0.4858166", "text": "testRemoveJsProperties() {\n const stubs = new PropertyReplacer();\n const orig = {'a': 1, 'b': undefined};\n const x = {'a': 1, 'b': undefined};\n\n stubs.remove(x, 'a');\n assertFalse('x.a removed', 'a' in x);\n assertTrue('x.b not removed', 'b' in x);\n stubs.reset();\n assertObjectEquals('x.a reset', x, orig);\n\n stubs.remove(x, 'b');\n assertFalse('x.b removed', 'b' in x);\n stubs.reset();\n assertObjectEquals('x.b reset', x, orig);\n\n stubs.set(x, 'c', 2);\n stubs.remove(x, 'c');\n assertObjectEquals('x.c added then removed', x, orig);\n stubs.reset();\n assertObjectEquals('x.c reset', x, orig);\n\n stubs.remove(x, 'b');\n stubs.set(x, 'b', undefined);\n assertObjectEquals('x.b removed then added', x, orig);\n stubs.reset();\n assertObjectEquals('x.b reset', x, orig);\n\n stubs.remove(x, 'd');\n assertObjectEquals('removing non-existing key', x, orig);\n stubs.reset();\n assertObjectEquals('reset removing non-existing key', x, orig);\n }", "title": "" }, { "docid": "3570dfdf6048b7734556a71574020aef", "score": "0.48469794", "text": "function propertyFunction() {\n\t var x = value.apply(this, arguments);\n\t if (x == null) delete this[name];\n\t else this[name] = x;\n\t }", "title": "" }, { "docid": "849d8b7f3b5dbba00ba0bbd215bbb7ae", "score": "0.48440975", "text": "function deleteProp(money){ \n if (money.H==0){\n delete money.H;\n }\n if (money.Q==0){\n delete money.Q;\n }\n if (money.D==0){\n delete money.D;\n }\n if (money.N==0){\n delete money.N;\n }\n if (money.P==0){\n delete money.P;\n }\n return money;\n }", "title": "" }, { "docid": "4f065b3bfa111b710416cd0e005e9569", "score": "0.48393303", "text": "function setNoRemove(newState) {\r\n\tnoRemove = newState;\r\n}", "title": "" }, { "docid": "d940335948af542a965a714e0ea74c69", "score": "0.48386446", "text": "function removeProperties(obj, stray) {\n \n\tfor (var i = 0; i < stray.length; i++) {\n\t\tvar currentProp = stray[i];\n\t\tif (obj[currentProp] !== undefined) {\n\t\t\tdelete obj[currentProp];\n\t\t}\n\t}\t\n\treturn obj;\n \n // for (var i = 0; i < stray.length; i++) {\n // if (obj[stray[i]] === stray[i]) {\n // delete obj[stray[i]];\n // }\n // }\n // return obj;\n \n}", "title": "" }, { "docid": "2d2d0a1afa81e9d8c134ed71929a71cd", "score": "0.48344582", "text": "reset() {\r\n this.current = this.historyOfStates.currentArray[0];\r\n this.historyOfStates.currentArray.splice(1);\r\n this.historyOfStates.deletedArray.splice(0);\r\n this.lastOperation = null;\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "51c80408cb2e80b9163b6c75e373771d", "score": "0.48336276", "text": "function removeProperty(cssRule, prop) {\n\t try {\n\t cssRule.style.removeProperty(prop);\n\t } catch (err) {\n\t (0, _warning2['default'])(false, '[JSS] DOMException \"%s\" was thrown. Tried to remove property \"%s\".', err.message, prop);\n\t }\n\t}", "title": "" }, { "docid": "376c8ccb5915ca013f4d80216494192b", "score": "0.48086628", "text": "deleteProperty(room, prop) {\n prop = String(prop);\n\n let returnValue = false;\n // try to guess if user is deleting a handler by the property name\n if (!prop.startsWith('on')) {\n try {\n returnValue = trappedRoomManager.onPropertyUnset(room, prop,\n identifier);\n } finally {}\n\n return returnValue !== false;\n }\n\n try {\n returnValue = trappedRoomManager.onEventHandlerUnset(room, prop,\n identifier);\n } finally {}\n\n return returnValue !== false;\n }", "title": "" } ]
9f0d1d658739cf0d2e092c9dae25880b
Execution of a "direct" dispatch there must be at most one dispatch accumulated on the event or it is considered an error. It doesn't really make sense for an event with multiple dispatches (bubbled) to keep track of the return values at each dispatch execution, but it does tend to make sense when dealing with "direct" dispatches.
[ { "docid": "96425fb978c2b11d3cd3a0608046183a", "score": "0.0", "text": "function executeDirectDispatch(event) {\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n var dispatchListener = event._dispatchListeners;\n var dispatchID = event._dispatchIDs;\n (\"production\" !== process.env.NODE_ENV ? invariant(\n !Array.isArray(dispatchListener),\n 'executeDirectDispatch(...): Invalid `event`.'\n ) : invariant(!Array.isArray(dispatchListener)));\n var res = dispatchListener ?\n dispatchListener(event, dispatchID) :\n null;\n event._dispatchListeners = null;\n event._dispatchIDs = null;\n return res;\n}", "title": "" } ]
[ { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "b828a2aaf4ae9598cc45cb6819abac46", "score": "0.7180883", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "221629dcced4658b24b7f883d6952397", "score": "0.70905644", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){ReactTreeTraversal.traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "5b02381811acfe8081dde85cfb93c0af", "score": "0.69860524", "text": "function accumulateTwoPhaseDispatchesSingle(event){event&&event.dispatchConfig.phasedRegistrationNames&&EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker,accumulateDirectionalDispatches,event)}", "title": "" }, { "docid": "d897e212b63689df587c5971b094b952", "score": "0.69721097", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n ReactTreeTraversal.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "7120dd8b529602407346dfc187273b1a", "score": "0.69651675", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\r\n if (event && event.dispatchConfig.phasedRegistrationNames) {\r\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\r\n }\r\n }", "title": "" }, { "docid": "d21b491e1c8f46fb37b333b07b467283", "score": "0.6949189", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "d21b491e1c8f46fb37b333b07b467283", "score": "0.6949189", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "af09f211281fc32d7ff875c46acac20c", "score": "0.69430286", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "title": "" }, { "docid": "0e5bd75d745663bc4865d1865e20f5c1", "score": "0.69361365", "text": "function executeDirectDispatch(event) {\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n var dispatchListener = event._dispatchListeners;\n var dispatchID = event._dispatchIDs;\n \"production\" !== \"production\" ? invariant(!Array.isArray(dispatchListener), 'executeDirectDispatch(...): Invalid `event`.') : invariant(!Array.isArray(dispatchListener));\n var res = dispatchListener ? dispatchListener(event, dispatchID) : null;\n event._dispatchListeners = null;\n event._dispatchIDs = null;\n return res;\n }", "title": "" }, { "docid": "f720bf4b292ba692d5dd748475027fb7", "score": "0.69356555", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\r\n if (event && event.dispatchConfig.phasedRegistrationNames) {\r\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\r\n }\r\n }", "title": "" }, { "docid": "28b0df96c972b53ae965898ab0bbf624", "score": "0.6935179", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){EventPluginUtils.traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "28b0df96c972b53ae965898ab0bbf624", "score": "0.6935179", "text": "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){EventPluginUtils.traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2158d2bd2b4c7130ef54d0543bb93902", "score": "0.69129133", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" }, { "docid": "2ee2039770b85cee9705afdefd784689", "score": "0.68983483", "text": "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "title": "" } ]
34ddcec244da2f7fd9bc50565ef2c006
Removes the markers from the map, but keeps them in the array.
[ { "docid": "ddcb47ee9d750b7d53bb5ffe8017efe0", "score": "0.0", "text": "function clearMarkers() {\n setMapOnAll(null);\n }", "title": "" } ]
[ { "docid": "e1ae3b45d6c57d228549bdccf5551c42", "score": "0.8528848", "text": "function removeMarkers(){\n\t for(i=0; i<myMarker_array.length; i++){\n\t myMarker_array[i].setMap(null);\n\t }\n\t}", "title": "" }, { "docid": "e92dad6a5d5aef594108f8e4dc9943f4", "score": "0.8390347", "text": "function clearMarkersFromMap() {\r\n // This is implemented for you and no further work is needed on it\r\n markers.forEach(function (marker) {\r\n if (marker) {\r\n map.removeObject(marker);\r\n }\r\n });\r\n markers = [];\r\n }", "title": "" }, { "docid": "9a1129eea3ee8c9766b15634af6b0a80", "score": "0.8365533", "text": "function clearMarkersArray () {\n\tif(!markers) return;\n\t\n markers.forEach((marker) => {\n \tmarker.setMap(null);\n });\n markers = []; \n}", "title": "" }, { "docid": "659c2ba31ad6210feb9703737492a85d", "score": "0.83445", "text": "function clearMarkers() {\n for (i in markers) {\n markers[i].setMap(null);\n }\n markers.length = 0; // clear array\n }", "title": "" }, { "docid": "aa8295a17b43b2e447a16abe59c39bdc", "score": "0.833091", "text": "function removeMarkers()\n{\n //remove markers from the map\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n\n //delete markers from the array\n markers = [];\n}", "title": "" }, { "docid": "753d802cdcc1a9bf2b307805f4fa3718", "score": "0.83210146", "text": "function removeAllMarker() {\n for (let i = 0; i < mapPins.length; i++) {\n mapPins[i].setMap(null);\n }\n\n // clear the array\n mapPins = [];\n}", "title": "" }, { "docid": "4dbc4f72fc06d6973f78c23210365f1e", "score": "0.8306049", "text": "function removeMarkers() {\n setAllMap(null);\n}", "title": "" }, { "docid": "3f655ab770f9809d2e73f4c9d6cef5f0", "score": "0.83012855", "text": "function deleteMarkers() {\n for (var i = 0; i < markers.length; i++) {\n setMapOnAll(null);\n }\n markers = [];\n}", "title": "" }, { "docid": "087b9220663a5d43aed52b7d9056e46e", "score": "0.8298143", "text": "function removeMarkers () {\t\t\n\tfor(i=0; i<this.getMarker.length; i++){\n\t this.getMarker[i].setMap(null);\n\t}\n\tthis.getMarker = [];\n}", "title": "" }, { "docid": "acf9de8bea541805164b27dd1304193b", "score": "0.82969385", "text": "function ocultarMarkers() {\n if (markersArray) {\n for (i in markersArray) {\n markersArray[i].setMap(null);\n }\n }\n}", "title": "" }, { "docid": "3de6e9d5574f7b22d4d3331c73680025", "score": "0.8225034", "text": "function clearMarkers(){\n for (var s = 0; s < markers.length; s++){\n markers[s].setMap(null);\n }\n markers = [];\n }", "title": "" }, { "docid": "9ccf3004b57591ca8b962c1d2a0c1dac", "score": "0.8223641", "text": "function removeMarkers() {\n for( i = 0; i < gmarkers.length; i++){\n gmarkers[i].setMap(null);\n }\n }", "title": "" }, { "docid": "f7dbbd6c9a557fc0c0aefab908a6afe8", "score": "0.82130307", "text": "function RemoveLoadMarkersFromArray() {\n \n \n \n if (loadsMarkerArray) {\n if (loadsMarkerArray) {\n for (var i = 0; i < loadsMarkerArray.length; i++) {\n loadsMarkerArray[i].setMap(null);\n }\n }\n }\n loadsMarkerArray = new Array();\n}", "title": "" }, { "docid": "77e24967910de9a0d4154bdbdfa8b842", "score": "0.8211601", "text": "function clearMarkers() {\n for (var i = 0; i < markersArr.length; i++) {\n markersArr[i].setMap(null);\n }\n markersArr.length = 0;\n}", "title": "" }, { "docid": "73f1e9d1ee4d7b01f6915b19ef1ec501", "score": "0.816807", "text": "function deleteMarkers() {\n for (var i = 0; i < variousmarkers.length; i++) {\n variousmarkers[i].setMap(null);\n }\n\n //Resets the variousmarkers.\n variousmarkers = [];\n }", "title": "" }, { "docid": "8f356608e1cc3d563298d64928a230ab", "score": "0.81670487", "text": "function deleteMarkers() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n markers = [];\n}", "title": "" }, { "docid": "5cd5c731d02b3d004bad76c4aa429c6a", "score": "0.81524456", "text": "function removeMarkers() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "title": "" }, { "docid": "d7833103834de6e7dc4b0e0d4034faab", "score": "0.8142029", "text": "function deleteMarkers() {\n for (let i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n markers = [];\n}", "title": "" }, { "docid": "cfc179783c1d1ed13778082b9cff457a", "score": "0.81372654", "text": "function removeMarkers()\n{\n for (i in markers){\n markers[i].setMap(null);\n }\n}", "title": "" }, { "docid": "87b4b4da99ccff486dd9c29ef84d96c4", "score": "0.8126106", "text": "function removeMarkers() {\n markers.forEach((e) => {\n e.setMap(null);\n })\n}", "title": "" }, { "docid": "a932cbce271db659b46c22893e8e65b3", "score": "0.8125662", "text": "function removeMarkers() {\n // Loop over markers and remove them from map\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n // Clear marker list\n markers = new Array();\n}", "title": "" }, { "docid": "7414a638f1e1982dacae1b416feca4c1", "score": "0.8117541", "text": "function removeMarkers(points) {\n for (var i in points) {\n points[i].setMap(null);\n }\n points = []\n}", "title": "" }, { "docid": "b45231bdaefe15d023a4a56384bacd8b", "score": "0.8106778", "text": "function wipeMarkers()\n{\n for (var i = 0; i < markers.length; i++) \n {\n var marker = markers[i]\n marker.remove()\n }\n}", "title": "" }, { "docid": "c66b6c3540534685beafef1c359d9489", "score": "0.8105501", "text": "function removeMarkers() {\n clearMarkers()\n markers = []\n markerLabelNum = 0\n}", "title": "" }, { "docid": "bc4b7834b7f9d58fe9c8cc70a7192326", "score": "0.8097368", "text": "removeAllMarkers() {\n \tthis.markers.forEach(marker => {\n \t\tmarker.remove();\n \t});\n }", "title": "" }, { "docid": "181e18db57adc2acf5923d49ddfa4637", "score": "0.8073224", "text": "function clearmarkers(map) {\n for (var i = 0; i < coord.length; i++) {\n coord[i].setMap(map);\n }\n\n coord = [];\n }", "title": "" }, { "docid": "9d7ad22e276f7ce1e34dac113f60b59b", "score": "0.807188", "text": "function clearMarkers() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n markers = [];\n }", "title": "" }, { "docid": "73989162f5acdd523ad32dbff624e344", "score": "0.8070038", "text": "function clearMarkers() {\n \t\tsetMapOnAll(null);\n \t\tmarkerArray = [];\n \t\t}", "title": "" }, { "docid": "d92d0168d8b6bb5853de327088e44b93", "score": "0.8064949", "text": "function deleteAllMarkers(){\n for(var i = 0; i < allMarkers.length; i++)\n {\n allMarkers[i].setMap(null);\n }\n\n\t allMarkers = [];\n }", "title": "" }, { "docid": "9742bca23500c555844100554362fb3b", "score": "0.80631083", "text": "function removeMarkers()\n{\n if(markers.length > 0)\n {\n for (var i=0; i< markers.length; i++)\n {\n markers[i].setMap(null);\n }\n }\n}", "title": "" }, { "docid": "feefedfc32386354104a9db0c025ea35", "score": "0.8059731", "text": "clearMarkers() {\n for (var i = 0; i < this.markers.length; i++) {\n this.markers[i].setMap(null);\n }\n }", "title": "" }, { "docid": "288fe544cd47939a11ead30f2bfc2e40", "score": "0.8048286", "text": "function DeletMarkers(arr)\n{\n for(let i=0; i<arr.length; i++)\n {arr[i].remove();}\n arr=[];\n}", "title": "" }, { "docid": "3f8e436a8b22d5d7bc072753ce3031f5", "score": "0.7992765", "text": "function removeMarkers()\n{\n // remove markers from map\n $.each(markers, function(i, marker) {\n marker.setMap(null);\n });\n\n // delete all references to markers currently in array\n markers = [];\n}", "title": "" }, { "docid": "21c7c0c1c3d0ee375b7a6d21f0b58c7f", "score": "0.798971", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n //locations = [];\r\n }", "title": "" }, { "docid": "c89f8fffb1972832efe5f403964a9d97", "score": "0.79864186", "text": "function clearMarkers(){\n for (let i = 0; i < markerHolder.length; i++){\n markerHolder[i].setMap(null);\n }\n markerHolder = [];\n }", "title": "" }, { "docid": "dee3265b4fdd764b832b17fdbfef7277", "score": "0.79859984", "text": "function clearMarkers(){\n\t\tfor (var i = 0; i < markers.length; i++) {\n\t\t\tmarkers[i].setMap(null);\n\t\t}\n\n\t\tmarkers = [];\n\t}", "title": "" }, { "docid": "101d82495723fd925a7503564816308a", "score": "0.7983328", "text": "function clearMarkers() {\n for (let i in restaurantMarkers) {\n restaurantMarkers[i].setMap(null);\n }\n restaurantMarkers = [];\n}", "title": "" }, { "docid": "e9dfcb28f93185bdedcb44c34682a465", "score": "0.7976855", "text": "function clearMarkers() {\n setMapOnAll(null);\n markers = [];\n }", "title": "" }, { "docid": "d5a46af26bb8699f890eda87fec574d5", "score": "0.79719836", "text": "function removeAllMarkers() {\r\n\t\tfor ( var key in this.markerArray[0]) {\r\n\t\t\tvar m = this.markerArray[0][key];\r\n\t\t\tthis.markers.removeMarker( m );\r\n\t\t\tm.destroy();\r\n\t\t}\r\n\t\tthis.markerArray = new Array();\r\n\t\tthis.markerArray[0] = new Object();\r\n\t}", "title": "" }, { "docid": "b11f3893ed0481465e6e73f5bcb37188", "score": "0.79649377", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n setAllMap(peta1.getMap());\n}", "title": "" }, { "docid": "47db9d1e7bf3d6bf049878dad82df13c", "score": "0.7963759", "text": "function clearMarkers() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n markers = [];\n}", "title": "" }, { "docid": "6ea2b7bc6e4b5093e48da278042dc817", "score": "0.7951171", "text": "function removeMarkers() {\n icaos = Object.keys(map_markers)\n for (i = 0; i < icaos.length; i++) {\n map_markers[icaos[i]].setMap(null)\n delete map_markers[icaos[i]]\n }\n}", "title": "" }, { "docid": "b8fd75186582f541d5dd6561d4c31012", "score": "0.79470843", "text": "function clearMarkers() {\n setMapOnAll(null);\n markers = []\n }", "title": "" }, { "docid": "0efae361c6006ce1b331602d9199f4ad", "score": "0.79394287", "text": "function clearMarkers() {\n setMapOnAll(null);\n markers = [];\n}", "title": "" }, { "docid": "46a97353205827c64da0cac2bb1a3ba9", "score": "0.79380035", "text": "function clearMarkers() {\r\n setMapOnAll(null);\r\n markers = [];\r\n }", "title": "" }, { "docid": "901855ebc76216bf81dfa5f99b4220f0", "score": "0.79362595", "text": "function clearMarkers() {\n for (let i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n markers = [];\n}", "title": "" }, { "docid": "0367d1d952ced2a598489ac56b809b20", "score": "0.7935654", "text": "function deleteMarkers() {\n for (let i = 0; i < state.markers.length; i++) {\n state.markers[i].setMap(null);\n }\n state.markers = [];\n}", "title": "" }, { "docid": "f5e9bb154a95fc2ee08e7da2351e0404", "score": "0.79312575", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "a8b6e3f0dbbadb5e74f0651805e06743", "score": "0.792379", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "a8b6e3f0dbbadb5e74f0651805e06743", "score": "0.792379", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "a8b6e3f0dbbadb5e74f0651805e06743", "score": "0.792379", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "a8b6e3f0dbbadb5e74f0651805e06743", "score": "0.792379", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "84b0b1da1b561a6dd1d1c5eba2bdd7d5", "score": "0.7921004", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "title": "" }, { "docid": "84b0b1da1b561a6dd1d1c5eba2bdd7d5", "score": "0.7921004", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "title": "" }, { "docid": "84b0b1da1b561a6dd1d1c5eba2bdd7d5", "score": "0.7921004", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "title": "" }, { "docid": "84b0b1da1b561a6dd1d1c5eba2bdd7d5", "score": "0.7921004", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "title": "" }, { "docid": "84b0b1da1b561a6dd1d1c5eba2bdd7d5", "score": "0.7921004", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "title": "" }, { "docid": "84b0b1da1b561a6dd1d1c5eba2bdd7d5", "score": "0.7921004", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "title": "" }, { "docid": "904e0c6fe2cf0d49f3f2474bc20b41e2", "score": "0.79188484", "text": "function clearMarkers() {\n if(markers.length != 0){\n for (var i = 0; i < markers.length; i++) {\n if (markers[i]) {\n markers[i].setMap(null);\n }\n }\n markers = [];\n }\n }", "title": "" }, { "docid": "ef1b5e4e35fd76ed2cc85d53345f9a99", "score": "0.7916061", "text": "function clearMarkers() {\n $.each(self.mapMarkers(), function(key, value) {\n value.marker.setMap(null);\n });\n self.mapMarkers([]);\n }", "title": "" }, { "docid": "32fb9d99b427e56e46cbdb31962acb67", "score": "0.79153335", "text": "function removeMarkers()\n{\n // clear markers and remove from map\n for (marker in markers) {\n markers[marker].setMap(null);\n markers[marker].length = 0;\n }\n}", "title": "" }, { "docid": "d690913efb109317cbd43dbccd4a76dd", "score": "0.7913825", "text": "function deleteMarkers() {\n\tif (markers) {\n\t\tfor (var i = 0; i < markers.length; i++) {\n\t\t\tmarkers[i].setMap(null);\n\t\t}\n\t\tmarkers.length = 0;\n\t}\n}", "title": "" }, { "docid": "663f7cbc509d1bbec2fa96084e9de4aa", "score": "0.7912334", "text": "function deleteMarkers() {\n if(markers){\n for(var i=0;i<markers.length;i++){\n markers[i].setMap(null);\n }\n markers.length=0;\n }\n}", "title": "" }, { "docid": "89208ee539a296499100497b42eca513", "score": "0.7910984", "text": "function clearTheMap() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n markers = [];\n }", "title": "" }, { "docid": "99fd6476cbcedcd783cbe2bf3c701f4d", "score": "0.7910773", "text": "function clearMarkers() {\n\n setAllMap(null);\n\n }", "title": "" }, { "docid": "46e40bbc48af22f67cbd79bd45f06a4f", "score": "0.7908265", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "46e40bbc48af22f67cbd79bd45f06a4f", "score": "0.7908265", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "46e40bbc48af22f67cbd79bd45f06a4f", "score": "0.7908265", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "b8eb2781d1b684d999c815d90eba41e0", "score": "0.7903618", "text": "function clearMarkers() {\n $.each(markers, function(index, value) {\n map.removeOverlay(value);\n });\n removeTemporarayMarker();\n markers = [];\n markerPositions = [];\n}", "title": "" }, { "docid": "ee452f6e16995a8aea617a99ec902e20", "score": "0.7903436", "text": "function clearMarkers() {\n\tfor (var i = 0; i < markers.length; i++) {\n\t\tmarkers[i].setMap(null);\n\t\tif (i === markers.length - 1) markers = [];\n\t}\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "d4a494958dfbaaf8308384bc8e01adaf", "score": "0.7899047", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "title": "" }, { "docid": "e74da84e185445bf43ec006d5a8dcf60", "score": "0.7897882", "text": "function deleteMarkers() {\n if (searchMarker !== undefined) {\n searchMarker.setMap(null);\n }\n setAllMap(null);\n markers = [];\n }", "title": "" }, { "docid": "cd0a4149dbf97fa36e9edb7dfa95bba3", "score": "0.78934795", "text": "function clearMarkers(){\n\t for(i=0; i<markers.length; i++){\n\t markers[i].setMap(null);\n\t \n\t};\n}", "title": "" }, { "docid": "e0e8d02622f62eb70813bd9328a0678e", "score": "0.78903985", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "title": "" }, { "docid": "052ec2670ee038c7b895385ff3455100", "score": "0.7887927", "text": "function deleteMarkers() {\n clearMarkers();\n markers = [];\n lalo = [];\n}", "title": "" }, { "docid": "74043926590097a62340e238aa9aeb28", "score": "0.7887038", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "title": "" }, { "docid": "74043926590097a62340e238aa9aeb28", "score": "0.7887038", "text": "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "title": "" }, { "docid": "44851853f0ac423a46bff70b94fb822c", "score": "0.78865826", "text": "function clearMarkers() {\n setAllMap(null);\n }", "title": "" }, { "docid": "4a3e1df43a4e5ed12628a1d38cb4190c", "score": "0.78864175", "text": "function clearMarkers() {\r\n setAllMap(null);\r\n}", "title": "" }, { "docid": "3f7f416e6c7c6940a6cb30d159f8c4c3", "score": "0.788535", "text": "function clearMarkers() {\n for (var i = _markers.length - 1; i >= 0; i--) {\n _markers[i].setMap(null);\n }\n _markers.length = null;\n}", "title": "" }, { "docid": "7e3b9d1d462e9d2ef4816f82d9fa8d57", "score": "0.7884837", "text": "function clearMarkers() {\n setAllMap(null);\n }", "title": "" }, { "docid": "27835cb2ebc692e55dd5f46980499e2f", "score": "0.78835315", "text": "clearMarkers() {\n this.setMapOnAll(null);\n }", "title": "" }, { "docid": "a9fa26e9fff4881f053152dd37a11186", "score": "0.7881008", "text": "function removeMarkers()\n{\n if (currentMarkers.length !== 0)//if there are markers on the page...\n {\n for (let i = 0; i < currentMarkers.length; i++)\n {\n currentMarkers[i].remove();//remove markers one by one.\n }\n }\n}", "title": "" }, { "docid": "2f838a41843b48b32857c9878dc3b609", "score": "0.78794813", "text": "function clearMarkers() {\r\n setAllMap(null);\r\n}", "title": "" }, { "docid": "2f838a41843b48b32857c9878dc3b609", "score": "0.78794813", "text": "function clearMarkers() {\r\n setAllMap(null);\r\n}", "title": "" }, { "docid": "1901d419e2e481b31c180449a3b74ec2", "score": "0.7877123", "text": "function clearMapMarkers() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null)\n }\n}", "title": "" }, { "docid": "a7d2e5be0aedb90a9cc38067d706579c", "score": "0.78751063", "text": "function clearMarkers() {\n setAllMap(null);\n}", "title": "" }, { "docid": "a7d2e5be0aedb90a9cc38067d706579c", "score": "0.78751063", "text": "function clearMarkers() {\n setAllMap(null);\n}", "title": "" }, { "docid": "a7d2e5be0aedb90a9cc38067d706579c", "score": "0.78751063", "text": "function clearMarkers() {\n setAllMap(null);\n}", "title": "" }, { "docid": "a7d2e5be0aedb90a9cc38067d706579c", "score": "0.78751063", "text": "function clearMarkers() {\n setAllMap(null);\n}", "title": "" } ]
461b84c53aa901d76e6fd50508456574
Add Rotten Tomatoes rating
[ { "docid": "1bd6fdca8646e66577bcfe89be1a561c", "score": "0.7260938", "text": "function appendRottenTomatoesRating(parent, rating) {\n let ratingElem = document.createElement(\"span\");\n ratingElem.className = \"rating-text\";\n parent.appendChild(ratingElem);\n ratingElem.innerHTML = rating;\n}", "title": "" } ]
[ { "docid": "0f0ec32d2821761fd06b56161cc33896", "score": "0.7756909", "text": "function newRotten() {\n if (JSON.parse(body).Ratings && JSON.parse(body).Ratings[1]) {\n return (\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n } else {\n return(\"Rotten Tomatoes Rating: Looks like this movie doesn't have a valid rotten tomatoes rating.\");\n };\n }", "title": "" }, { "docid": "1b8b7734b9a744ff2f03ddbae3db38c2", "score": "0.69069314", "text": "function getRottenTomatoesRatingObject (data) {\n return data.Ratings.find(function (item) {\n return item.Source === \"Rotten Tomatoes\";\n });\n }", "title": "" }, { "docid": "99603560e5eec5a4a87c1a64f4775ca6", "score": "0.652563", "text": "function getRottenTomatoes(response) {\n\tvar ratingsData = response[\"Ratings\"];\n\tif (ratingsData) {\n\t\tvar rottenTomatoesRating = ratingsData.find(parseRottenTomatoes);\n\t\tif (rottenTomatoesRating) {\n\t\t\treturn rottenTomatoesRating[\"Value\"];\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5c24fdea68b2c5439ab1ae2dcbd40fe4", "score": "0.6276887", "text": "function getRottenTomatoImg(strRating) {\n let rating = parseInt(strRating, 10);\n let img = (rating >= 60) ? \"images/fresh32.png\" : \"images/rotten32.png\";\n return chrome.extension.getURL(img);\n}", "title": "" }, { "docid": "ab60a9cb998861a171de71cac0982911", "score": "0.614396", "text": "function rating() {\r\n if (moves >= 12 && moves <= 18) {\r\n star.children[2].children[0].className = \"fa fa-star-o\";\r\n }\r\n if (moves > 18) {\r\n star.children[1].children[0].className = \"fa fa-star-o\";\r\n }\r\n}", "title": "" }, { "docid": "99fad6df7046ac15961e2017e966210c", "score": "0.61297256", "text": "function loadTomatoes(index) {\n var position = '';\n // Check if movie is Fresh, Certified Fresh, or Rotten\n switch (movies[index].critics_rating) {\n case 'Fresh':\n position = '0 0';\n break;\n case 'Rotten':\n position = '-35px 0';\n break;\n default:\n position = '-70px 0';\n } // switch()\n // Show Critics score\n $('#critics').css('background-position', position)\n .text(movies[index].critics_score + '%');\n \n // Check if movie is rated Upright or Spilled by the audience\n // and apply associated image portion from assets.png\n if (movies[index].audience_rating == 'Upright') {\n position = '-70px -35px';\n } else {\n position = '0 -35px';\n }\n // Show Audience score\n $('#audience').css('background-position', position)\n .text(movies[index].audience_score + '%');\n \n $('#ratings').css('visibility', 'visible');\n }", "title": "" }, { "docid": "c60e8bf852dbcfec666697b3abb1636c", "score": "0.61189616", "text": "addRating(ratings) {\n this._rating.push(ratings)\n }", "title": "" }, { "docid": "ac08a6e5bb29d9bea037d299534be2fa", "score": "0.60541236", "text": "function stars(rating){\n\n var vote = Math.ceil(rating / 2);\n\n var stars = '';\n for (var i= 1; i <= 5; i++){\n if(i <= vote){\n stars += '<i class=\"fas fa-star\"></i> ';\n } else{\n stars += '<i class=\"far fa-star\"></i> ';\n }\n }\n return stars;\n }", "title": "" }, { "docid": "1946d0a71b79e4c46a9f330fe77fa9e4", "score": "0.60031193", "text": "function moonRating(rating) {\n let rounded = (Math.round((rating / 2) * 2) / 2);\n let newMoons = Math.floor(5 - rounded);\n let result = '';\n for(let i = 0; i < 5; i++) {\n if(rounded >= 1) {\n result += 'o';\n rounded--;\n }\n else if(rounded === 0.5) {\n result += 'c';\n rounded = rounded - 0.5;\n }\n }\n result += 'x'.repeat(newMoons);\n return result;\n}", "title": "" }, { "docid": "86ba0fd129dc585483a7b264501fa12a", "score": "0.599889", "text": "update_rating(){\n for(star of game.rating.stars_element){\n star.classList.add('awarded');\n }\n if(game.rating.stars < 3){\n for(let i=0; i< (3 - game.rating.stars); i++){\n game.rating.stars_element[i].classList.remove('awarded');\n }\n }\n }", "title": "" }, { "docid": "c460f8f4e88c9424cafcd8fdf1b2ac90", "score": "0.59362525", "text": "function appendRatings(ratings) {\n let ratingContainer = document.createElement(\"div\");\n let imageUrl = \"\";\n ratingContainer.className = \"rating-container\";\n\n if (ratings.length > 0) {\n imageUrl = chrome.extension.getURL(\"images/IMDb32.png\");\n appendLogo(ratingContainer, imageUrl, \"imdbIcon\");\n appendImdbRating(ratingContainer, ratings[0].Value);\n }\n if (ratings.length > 1) {\n imageUrl = getRottenTomatoImg(ratings[1].Value);\n appendLogo(ratingContainer, imageUrl, \"rtIcon\");\n appendRottenTomatoesRating(ratingContainer, ratings[1].Value);\n }\n if (ratings.length > 2) {\n imageUrl = chrome.extension.getURL(\"images/metacritic-logo.png\");\n appendLogo(ratingContainer, imageUrl, \"metacriticIcon\");\n appendMetacriticRating(ratingContainer, ratings[2].Value);\n }\n $(\"div.bob-play-hitzone\").append(ratingContainer);\n}", "title": "" }, { "docid": "45beb59fd349cb43c43c27c2b87af20b", "score": "0.5933813", "text": "function setRating() {\n for(var i = 0; i < starCount; i++) {\n var li = document.createElement(\"li\");\n var icon = document.createElement(\"i\");\n icon.className = \"fa fa-star\";\n li.appendChild(icon);\n resultStarElement.appendChild(li);\n }\n}", "title": "" }, { "docid": "d9b7878943cf11aeb2f6969f41697922", "score": "0.5932826", "text": "function changeRating() {\n const star = document.querySelectorAll('.stars li i');\n if (moveCount > 16 && moveCount <= 26) {\n if (starCount === 5) {\n star[4].classList.remove('fa');\n star[4].classList.add('far');\n starCount = starCount - 1;\n }\n }\n if (moveCount > 26 && moveCount <= 32) {\n if (starCount === 4) {\n star[3].classList.remove('fa');\n star[3].classList.add('far');\n starCount = starCount - 1;\n }\n }\n if (moveCount > 32 && moveCount <= 40) {\n if (starCount === 3) {\n star[2].classList.remove('fa');\n star[2].classList.add('far');\n starCount = starCount - 1;\n }\n }\n if (moveCount > 40) {\n if (starCount === 2) {\n star[1].classList.remove('fa');\n star[1].classList.add('far');\n starCount = starCount - 1;\n }\n }\n}", "title": "" }, { "docid": "35a8fb749d20f57fe45234355560da57", "score": "0.59193206", "text": "function starRating() {\n\n let m = counter;\n let star = document.getElementsByClassName(\"fa-star\");\n let stars = [...star];\n\n if(m === 9){\n stars[2].classList.remove(\".fa-star\");\n stars[2].classList.add(\"fa-star-o\");\n }\n\n if(m === 17){\n stars[1].classList.remove(\".fa-star\");\n stars[1].classList.add(\"fa-star-o\");\n }\n}", "title": "" }, { "docid": "6c820c77141f3f2f4278d8898e476290", "score": "0.58999485", "text": "function addFiveStarsToTheProductShirt() {\n $(\"#firstProduct\").find(\".ratings\").children(\"span:last-child\").attr(\"class\", \"glyphicon glyphicon-star\");\n}", "title": "" }, { "docid": "e6735c4f6bb7e19fa880cf93db73cf30", "score": "0.58670074", "text": "function avgRate() {\n $(\"#average-rate\").raty({readOnly: true,\n score: (averageRating),\n hints: ['crap', 'awful', 'ok', 'nice', 'awesome']});\n }", "title": "" }, { "docid": "18e0de3c2c975886b1a0908f39f3ac79", "score": "0.58319825", "text": "function starRating () {\n if (movesCounter > (factor * movesFactor) && factor <= nStars) {\n starElementChildren[nStars - factor].firstElementChild.classList.remove('fa-star')\n starElementChildren[nStars - factor].firstElementChild.classList.add('fa-star-o')\n factor++\n }\n}", "title": "" }, { "docid": "dbe7b8dd6b553942ad5288ff2fb0e794", "score": "0.58288455", "text": "function setRating(business) {\n if (business.rating === 0) {\n business.stars = \"./assets/yelp-stars/regular_0.png\"\n }\n else if (business.rating === 1) {\n business.stars = \"./assets/yelp-stars/regular_1.png\"\n }\n else if (business.rating === 1.5) {\n business.stars = \"./assets/yelp-stars/regular_1_half.png\"\n }\n else if (business.rating === 2) {\n business.stars = \"./assets/yelp-stars/regular_2.png\"\n }\n else if (business.rating === 2.5) {\n business.stars = \"./assets/yelp-stars/regular_2_half.png\"\n }\n else if (business.rating === 3) {\n business.stars = \"./assets/yelp-stars/regular_3.png\"\n }\n else if (business.rating === 3.5) {\n business.stars = \"./assets/yelp-stars/regular_3_half.png\"\n }\n else if (business.rating === 4) {\n business.stars = \"./assets/yelp-stars/regular_4.png\"\n }\n else if (business.rating === 4.5) {\n business.stars = \"./assets/yelp-stars/regular_4_half.png\"\n }\n else if (business.rating === 5) {\n business.stars = \"./assets/yelp-stars/regular_5.png\"\n }\n}", "title": "" }, { "docid": "1fdb433755bca71ade250ac67485ae4c", "score": "0.5822377", "text": "function randomRating() {\n return Math.round(5 * Math.random());\n}", "title": "" }, { "docid": "8f5074b32e5e8205671db65785721418", "score": "0.57992816", "text": "function getStars(vote) {\r\n vote = Math.floor(vote/2);\r\n var stars = '';\r\n for (var i = 1; i <= 5; i++) {\r\n if (i <= vote) {\r\n stars += '<i class=\"fas fa-star\"></i>';\r\n } else {\r\n stars += '<i class=\"far fa-star\"></i>';\r\n }\r\n }\r\n return stars;\r\n }", "title": "" }, { "docid": "2a881e928f6baad70dd80a0d223d77dd", "score": "0.5787012", "text": "function showRating() {\n starsRating = \" \";\n \n for (y = 0; y < comentario.score; y++) {\n starsRating += `<i class=\"fa fa-star\" style=\"color: #F6BA17;\"></i>`\n }\n for (x = 0; x < (5 - comentario.score); x++) {\n starsRating += `<i class=\"fa fa-star\"></i>`\n }\n \n return starsRating;\n}", "title": "" }, { "docid": "f4410a0b2d6bca0befb89dfe626a9c4e", "score": "0.578019", "text": "function starRating(movesCounter) {\n if (movesCounter < 14) {\n starCount = 3;\n } else if (movesCounter < 18) {\n starCount = 2;\n stars.children[2].firstElementChild.className = \"fa fa-star-o\";\n } else {\n starCount = 1;\n stars.children[1].firstElementChild.className = \"fa fa-star-o\";\n }\n moves.innerHTML = movesCounter;\n}", "title": "" }, { "docid": "2b187e995bd9165181e9ab32cb2fb3de", "score": "0.5739373", "text": "function populateYotpoReview($target, score, count) {\r\n\t\t$target.show()\r\n\t\t$target.append(count + ' Reviews')\r\n\r\n\t\tvar $stars = $target.find('.star-gauge')\r\n\t\tif (!(score && $stars.length)) return // No stars found, bail\r\n\r\n\t\t// Generate five star icons; using empty, half, and full stars\r\n\t\tfor (var i = 1; i <= 5; score--, i++) {\r\n\t\t\tvar icon = 'fa-star-o'\r\n\t\t\tif (score >= 0.25) icon = 'fa-star-half-o'\r\n\t\t\tif (score >= 0.75) icon = 'fa-star'\r\n\t\t\t$stars.append('<i class=\"fa ' + icon + '\"></i>')\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "6688d59362279371ca89e439a11526dd", "score": "0.573843", "text": "function setStars(node) {\n\t\tvar rating = this.get().rating,\n\t\t\t\taddedStars = 0;\n\t\tfor (var i=1; i<=rating; i++) {\n\t\t\taddStar('fullstar');\n\t\t\taddedStars += 1;\n\t\t}\n\t\tif (rating !== addedStars && rating > addedStars && rating - addedStars >= .5) {\n\t\t\taddStar('halfstar');\n\t\t\ti += 1;\n\t\t}\n\t\tfor (i; i<6; i++) {\n\t\t\taddStar();\n\t\t}\n\t\tfunction addStar(klass) {\n\t\t\tvar star = document.createElement('span');\n\t\t\tif (klass) star.classList.add(klass);\n\t\t\tnode.append(star);\n\t\t}\n\t}", "title": "" }, { "docid": "68df05b5ffcf654438e6c19621d9ef45", "score": "0.5708516", "text": "function setupRating() {\n contentId = $('.js-todoContainer').attr('data-primary-key');\n if (contentId) {\n rating = new Interactions.Interaction({ ContentID: contentId });\n SiteMember.done(function (member) {\n if (member.MembershipId) {\n rating.set('MemberID', parseInt(member.MembershipId, 10));\n rating.set('FromEmailAddress', member.Emails[0].EmailAddress);\n rating.fetch({url: rating.urlRoot + '/' + rating.get('MemberID') + '/' + rating.get('ContentID') + '/1', success: generateRatingUI });\n } else {\n //Not logged in, generate widget with 0 stars filled and bind a click event to open the login overlay\n $('#UserRating').ratings(5, 0, false).on('click', function () {\n SALT.trigger('open:customOverlay', 'loginOverlay');\n });\n }\n });\n bindEventsForFeedBack();\n }\n }", "title": "" }, { "docid": "b0f8b7412f61348d0cfe65932b0676de", "score": "0.5669796", "text": "function Rater(props) {\n const classes = useStyles();\n const { stars, title } = props;\n const starItems = [];\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < 5; i++) {\n starItems.push(stars > i);\n }\n\n return (\n <span className={classes.root}>\n <Typography variant=\"subtitle2\" className={classes.title}>\n {title}\n </Typography>\n <Typography className={classes.stars}>\n {starItems.map((val, index) =>\n val ? (\n // eslint-disable-next-line react/no-array-index-key\n <StarIcon fontSize=\"small\" key={index} />\n ) : (\n // eslint-disable-next-line react/no-array-index-key\n <StarOutlineIcon fontSize=\"small\" key={index} />\n ),\n )}\n </Typography>\n </span>\n );\n}", "title": "" }, { "docid": "8ee0f473aa24fe0b71c086fd8b71d5c9", "score": "0.56338996", "text": "function rating() {\n if (totalClicks <= 29) {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\" aria-hidden=\"true\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>`;\n } else if (totalClicks >= 30 && totalClicks <= 39) {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>`;\n } else if (totalClicks >= 40) {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>`;\n } else {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>`;\n }\n}", "title": "" }, { "docid": "b53de9ce4c07770acdeb3757fd95370b", "score": "0.56277114", "text": "function avRating(businesses, id, rating) {\n for (var i = 0; i < businesses.length; i++) {\n if (businesses[i].id == id) {\n rating.setAttribute(\"class\", \"stars\")\n if (businesses[i].rating <= 1.24) {\n rating.setAttribute(\"data-class\", \"one-bomb\")\n }\n if (businesses[i].rating > 1.24 && businesses[i].rating <= 1.75) {\n rating.setAttribute(\"data-class\", \"one-five-bomb\")\n }\n if (businesses[i].rating > 1.75 && businesses[i].rating <= 2.25) {\n rating.setAttribute(\"data-class\", \"two-bomb\")\n }\n if (businesses[i].rating > 2.25 && businesses[i].rating <= 2.75) {\n rating.setAttribute(\"data-class\", \"two-five-bomb\")\n }\n if (businesses[i].rating > 2.75 && businesses[i].rating <= 3.25) {\n rating.setAttribute(\"data-class\", \"three-bomb\")\n }\n if (businesses[i].rating > 3.25 && businesses[i].rating <= 3.75) {\n rating.setAttribute(\"data-class\", \"three-five-bomb\")\n }\n if (businesses[i].rating > 3.75 && businesses[i].rating <= 4.25) {\n rating.setAttribute(\"data-class\", \"four-bomb\")\n }\n if (businesses[i].rating > 4.25 && businesses[i].rating <= 4.75) {\n rating.setAttribute(\"data-class\", \"four-five-bomb\")\n }\n if (businesses[i].rating > 4.75) {\n rating.setAttribute(\"data-class\", \"five-bomb\")\n }\n }\n }\n}", "title": "" }, { "docid": "d6eee1eb61050383afd95ebcefb8146a", "score": "0.5616214", "text": "function createStarRating(rating) {\n if (isNaN(rating)){\n ratingText = \"No rating available.\"\n } \n else {\n ratingText = \"\";\n for (var i = 1; i < rating; i++) {\n ratingText = ratingText + \"★\";\n }\n }\n return \"Average Rating: \" + ratingText;\n}", "title": "" }, { "docid": "cd5b3c5c2b3467433be7258b65c01791", "score": "0.5615474", "text": "function avgRat(restaurants) {\n $.each(restaurants, function() {\n // Reset temp rating storage\n let r = 0;\n let avg;\n // For each rating in this.restaurantsArray add value to storage\n $.each(this.ratings, function() {\n r += this.stars;\n });\n // Calcualte avg from temp storage to 1 decimals\n avg = r/this.ratings.length;\n this.ratingsAvg = Math.round(avg);\n // Return number of reviews\n return rCount = \" (\" + this.ratings.length + \")\";\n });\n}", "title": "" }, { "docid": "53f025f4c8ac91417c89a9a4ee4062bb", "score": "0.56066537", "text": "ratingLeq(rating){\r\n return new FluentRestaurants(this.data.filter(function f(x){ return(lib220.getProperty(x, 'stars').value <= rating);}));\r\n }", "title": "" }, { "docid": "5110ee1700a9b6ef9ec6bbbff4f0a984", "score": "0.5600765", "text": "function rating() {\n for (const star of stars) {\n if (movesCounter.innerText <= 19 && minutes.innerText <= 1) {\n one.style.color = 'orange';\n two.style.color = 'orange';\n three.style.color = 'orange';\n starRatingText = '3 out of 3 stars';\n } else if (movesCounter.innerText <= 30 && minutes.innerText <= 2) {\n one.style.color = 'orange';\n two.style.color = 'orange';\n starRatingText = '2 out of 3 stars';\n } else {\n one.style.color = 'orange';\n starRatingText = '1 out of 3 stars';\n }\n }\n}", "title": "" }, { "docid": "e4505b4f558509deab2988f7cc885e64", "score": "0.55936", "text": "formatRating(rating) {\n\n rating = rating * 25;\n return rating;\n }", "title": "" }, { "docid": "0330c75367b5e5f45769d8fb78974ced", "score": "0.55670553", "text": "function rating() {\n\tlet rating = 3;\n if (moves > stars3 && moves < stars2) {\n ratingStars[0].classList.remove(\"fas\");\n ratingStars[0].classList.add(\"far\");\n stars3 = 100;\n } else if (moves > stars2 && moves < star1) {\n ratingStars[1].classList.remove(\"fas\");\n ratingStars[1].classList.add(\"far\");\n stars2 = 100;\n } \n return { score: rating };\n}", "title": "" }, { "docid": "9dd23d3c75c56cc4013f7434fddeb255", "score": "0.55660564", "text": "function convertToStar(vote) {\r\n var voteStandardized = Math.ceil(vote/2);\r\n var voteStar = '';\r\n for (var i = 1; i <= 5; i++) {\r\n if (i <= voteStandardized) {\r\n voteStar += '<i class=\"fas fa-star star\"></i>';\r\n } else {\r\n voteStar += '<i class=\"far fa-star star\"></i>';\r\n };\r\n };\r\n return voteStar;\r\n }", "title": "" }, { "docid": "ef7c592367233737ab5c4b8ece728c73", "score": "0.55652755", "text": "function setRating(moves) {\nvar rating = 3;\nif (moves > rank3stars && moves < rank2stars) {\n$ratingStars.eq(2).removeClass('fa-star').addClass('fa-star-o');\nrating = 2;\n} else if (moves > rank2stars && moves < rank1stars) {\n$ratingStars.eq(1).removeClass('fa-star').addClass('fa-star-o');\nrating = 1;\n} else if (moves > rank1stars) {\n$ratingStars.eq(0).removeClass('fa-star').addClass('fa-star-o');\nrating = 0;\n}\t\nreturn { score: rating };\n}", "title": "" }, { "docid": "c9930eb97fc4b84f6ec1eac0b59701c5", "score": "0.5551976", "text": "function ratingDisplay(review, rating) {\n if (review <= 1.24) {\n rating.setAttribute(\"data-class\", \"one-bomb\")\n }\n if (review > 1.24 && review <= 1.75) {\n rating.setAttribute(\"data-class\", \"one-five-bomb\")\n }\n if (review > 1.75 && review <= 2.25) {\n rating.setAttribute(\"data-class\", \"two-bomb\")\n }\n if (review > 2.25 && review <= 2.75) {\n rating.setAttribute(\"data-class\", \"two-five-bomb\")\n }\n if (review > 2.75 && review <= 3.25) {\n rating.setAttribute(\"data-class\", \"three-bomb\")\n }\n if (review > 3.25 && review <= 3.75) {\n rating.setAttribute(\"data-class\", \"three-five-bomb\")\n }\n if (review > 3.75 && review <= 4.25) {\n rating.setAttribute(\"data-class\", \"four-bomb\")\n }\n if (review > 4.25 && review <= 4.75) {\n rating.setAttribute(\"data-class\", \"four-five-bomb\")\n }\n if (review > 4.75) {\n rating.setAttribute(\"data-class\", \"five-bomb\")\n }\n}", "title": "" }, { "docid": "4149fb01de205958b229cf528582acac", "score": "0.55426306", "text": "function rateMovie(rating, movieID) {\n const settings = {\n method: 'POST', // from API docs\n url: `https://api.themoviedb.org/3/movie/${movieID}/rating?api_key=${apiKey}&session_id=${sessionID}`,\n headers: {\n \"content-type\": \"application/json;charset=utf-8\"\n },\n data: JSON.stringify({ \"value\": rating })\n };\n\n $.ajax(settings).then((response) => {\n // give user a message confirming their rating\n $('<p>').text('Movie rated successfully').css({\n position: 'absolute',\n background: 'rgba(0,200,0,.75)',\n width: '100%',\n padding: '1rem',\n color: '#fff',\n top: 0,\n left: 0,\n textAlign: 'center'\n }).appendTo('body').fadeOut(3000, function() {\n this.remove();\n });\n console.log(response);\n }).catch((error) => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "5163527d06a20d2dbad647eb99f1296c", "score": "0.552724", "text": "function addStarsVote(voto) {\n\n var stellaVuota = \"<i class='far fa-star'></i>\";\n var stellaPiena = \"<i class='fas fa-star'></i>\";\n var str = \"\";\n\n for (var i = 1; i <= 5; i++) {//ciclo per appendere cinque stelle: Se voto è maggiore o uguale al contatore i\n\n if (voto >= i) {\n\n str += stellaPiena;\n } else {\n\n str += stellaVuota;\n }\n }\n\n return str;\n}", "title": "" }, { "docid": "90d330642a9ece21193abdfda36dbba5", "score": "0.5527178", "text": "function stars(rating) {\n\tvar fullStar = \"\";\n\tfor(var i = 0; i < rating; i++){\n\t\tfullStar += \"<span class='fa fa-star checked'></span>\";\n\t}\n\tvar emptyStar = \"\";\n\tfor(var j = 0; j < (5-rating); j++){\n\t\temptyStar += \"<span class='fa fa-star'></span>\"\n\t}\n\tvar myStars = fullStar + emptyStar;\n\t\n\treturn(myStars);\n}", "title": "" }, { "docid": "cbe31f4a5efc42ce30eee98ebe411c27", "score": "0.55244446", "text": "function rateDrink(stars) {\n let starClassActive = \"rating__star fas fa-star\";\n let starClassInactive = \"rating__star far fa-star\";\n let starsLength = stars.length;\n let i;\n stars.map((star) => {\n star.onclick = () => {\n i = stars.indexOf(star);\n if (star.className === starClassInactive) {\n for (i; i >= 0; --i) stars[i].className = starClassActive;\n } else {\n for (i; i < starsLength; ++i) stars[i].className = starClassInactive;\n }\n };\n });\n}", "title": "" }, { "docid": "d261da8f0a3a317237308cf16da9c293", "score": "0.55197436", "text": "function setRatingStars(){\r\n var oneStar = document.getElementsByClassName(\"one-star\");\r\n var twoStar = document.getElementsByClassName(\"two-star\");\r\n var threeStar = document.getElementsByClassName(\"three-star\");\r\n var fourStar = document.getElementsByClassName(\"four-star\");\r\n var fiveStar = document.getElementsByClassName(\"five-star\");\r\n var stars = [oneStar, twoStar,threeStar, fourStar, fiveStar];\r\n\r\n var numOfSearchResults = oneStar.length;\r\n var reviews = [];\r\n for(var index = 0; index < numOfSearchResults; index++){\r\n reviews.push(parseFloat(document.getElementById(\"rating-\"+arrayOfNumber[index]).innerText));\r\n }\r\n\r\n for(var reviewIndex = 0; reviewIndex < numOfSearchResults; reviewIndex++){\r\n var ratingValue = reviews[reviewIndex];\r\n for(var ratingIndex = 1; ratingIndex<=stars.length; ratingIndex += 0.5){\r\n if(ratingIndex <= ratingValue){\r\n if(ratingIndex == 1){\r\n stars[ratingIndex-1][reviewIndex].classList.remove(\"fa-star-o\");\r\n stars[ratingIndex-1][reviewIndex].classList.add(\"fa-star\");\r\n }else if(ratingIndex%1 == 0.5) {\r\n stars[Math.round(ratingIndex-1)][reviewIndex].classList.remove(\"fa-star-o\");\r\n stars[Math.round(ratingIndex-1)][reviewIndex].classList.add(\"fa-star-half-o\");\r\n }else if(ratingIndex%1 == 0){\r\n stars[ratingIndex-1][reviewIndex].classList.remove(\"fa-star-half-o\");\r\n stars[ratingIndex-1][reviewIndex].classList.add(\"fa-star\");\r\n }\r\n\r\n }else{break;}\r\n }\r\n }\r\n}", "title": "" }, { "docid": "4632c8264e296c07170db29cb2c6c8f8", "score": "0.5497154", "text": "function setRating() {\n rating = $(this).attr('value');\n }", "title": "" }, { "docid": "51b5e631fa80eb9ebcaf6a1820150a2d", "score": "0.54959744", "text": "set rating(r) {\n if (r < 6 && r > 0 && Number.isInteger(r)) {\n this._rating = r;\n }\n else {\n console.log('Rating must be an integer between 1 and 5')\n }\n }", "title": "" }, { "docid": "03cd593623ec97cf8fd01124e1684fd0", "score": "0.5481314", "text": "saveRating(rating) {\r\n\t\t\tjQuery.ajax({\r\n\t\t\t\tdata: {\r\n\t\t\t\t\taction: 'save_rating',\r\n\t\t\t\t\tnonce: postratings.nonce,\r\n\t\t\t\t\tpost_id: postratings.post_id,\r\n\t\t\t\t\trating: rating\r\n\t\t\t\t},\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\turl: postratings.url,\r\n\t\t\t\tsuccess: function(data) {\r\n\t\t\t\t\t//console.log(data);\r\n\t\t\t\t},\r\n\t\t\t\terror: function(data) {\r\n\t\t\t\t\tconsole.log(data);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "3b57bd8201854428ed7f473858c19551", "score": "0.5449796", "text": "function weightedAverageMovieReview(rachel, roger, jake) {\n return ((rachel * .25) + (roger * 1) + (jake * 2.2)) / (.25 + 1 + 2.2);\n}", "title": "" }, { "docid": "b710e4ebb195e53caf3bfab78e9c394a", "score": "0.54471", "text": "function calculateRating(ratingVal){\n\n //to show star rating\n var num = Number(ratingVal);\n var b =parseInt(ratingVal);\n var unchecked = 5-num;\n var starrating='<i class=\"fa fa-star\"></i>';\n var star='<i class=\"fa fa-star\"></i>';\n var emptystar='<i class=\"fa fa-star-o\"></i>';\n for(var i=1;i<b;i++){\n starrating+=star;\n }\n\n if(unchecked>0){\n if((unchecked%1)!=0){\n starrating+='<i class=\"fa fa-star-half-o\"></i>'\n }\n else if(unchecked>=1){\n starrating+=emptystar;\n }\n for(var i=1;i<unchecked;i++){\n starrating+=emptystar;\n }\n }\n\n return starrating;\n\n}", "title": "" }, { "docid": "a6a368a5a7d7c51e8dd2d0257d5722b6", "score": "0.54454654", "text": "function starMultiplier2(voteFrom10to5){\n var test1 = \"\";\n for (var i = 0; i < 5; i++) {\n if (i < voteFrom10to5) {\n test1 += \"<i class='fas fa-star'></i>\";\n } else {\n test1 += \"<i class='far fa-star'></i>\";\n }\n }\n if (voteFrom10to5 == 0) {\n test1 = \"Nessun voto\";\n }\n return test1;\n}", "title": "" }, { "docid": "f1f780d458f1dec04c7a0fb0a032434c", "score": "0.544382", "text": "function dramaMoviesRate (movies){\n\n}", "title": "" }, { "docid": "22d9414d6a95c1f52f3e0948a3025dee", "score": "0.5433168", "text": "function addRatingLS(rating) {\r\n localStorage.removeItem('movieRatings');\r\n\r\n localStorage.setItem('movieRatings', JSON.stringify(rating));\r\n\r\n averageRating();\r\n}", "title": "" }, { "docid": "8fbf9a9ca7270fa13f21f1ff28724008", "score": "0.5432015", "text": "calculate_rating(){\n // calculate rating for moves count only\n let moves_stars = 3;\n if(game.moves.count > 0 && game.moves.count <= 35){\n moves_stars = 3;\n }else if(game.moves.count > 35 && game.moves.count <= 60){\n moves_stars = 2;\n }else if(game.moves.count >60){\n moves_stars = 1;\n }\n \n // calculate rating for time passed only\n let time_stars = 3;\n if(timer.time.total_in_seconds > 0 && timer.time.total_in_seconds <= 40){\n time_stars = 3;\n }else if(timer.time.total_in_seconds > 40 && timer.time.total_in_seconds <= 90){\n time_stars = 2;\n }else if(timer.time.total_in_seconds >90){\n time_stars = 1;\n }\n \n // calculate final rating stars based on individual rating for moves count and for time passed \n const final_starts = Math.floor((moves_stars + time_stars)/2);\n game.rating.stars = final_starts;\n game.rating.update_rating();\n }", "title": "" }, { "docid": "c8095c5bd295cad62ffa9905c6ff755e", "score": "0.54314506", "text": "function rating(n){\n var stars = \"\";\n for(var i=0 ; i<n ; i++){\n stars += \"<span class='fa fa-star checked' id='star1'></span>\";\n }\n for(var i=n ; i<5 ; i++){\n stars += \"<span class='fa fa-star' id='star1'></span>\";\n }\n\n return stars;\n}", "title": "" }, { "docid": "27fc7b2f84171399488034ea1b48554b", "score": "0.5427844", "text": "getRatingClass(rating) {\n if (rating === 1) {\n return 'inline-rating rating-red';\n } else if (rating === 5) {\n return 'inline-rating rating-green';\n } else {\n return 'inline-rating';\n }\n }", "title": "" }, { "docid": "93222313ade2e0dfa727cfd7e7f48462", "score": "0.5426524", "text": "function starMultiplier2(voteFrom10to5){\n var test1 = \"\";\n for (var i = 0; i < voteFrom10to5; i++) {\n test1 = test1 + \"<i class='fas fa-star'></i>\";\n }\n if (voteFrom10to5 == 0) {\n test1 = \"Nessun voto\";\n }\n return test1;\n\n}", "title": "" }, { "docid": "3d1754e2b101cf43111901e08786837b", "score": "0.5416903", "text": "function starRaterAdder(power) {\n let newStar = '../stars/small-star.png';\n if(power === 'creator-star-1') {\n } if(power === 'creator-star-2') {\n document.getElementById('creator-star-1').classList.remove('dead-star');\n document.getElementById('creator-star-1').classList.add('star-rater','live-star');\n $(document.getElementById('creator-star-1')).attr('src', newStar);\n } if(power === 'creator-star-3') {\n document.getElementById('creator-star-1').classList.remove('dead-star');\n document.getElementById('creator-star-1').classList.add('star-rater','live-star');\n document.getElementById('creator-star-2').classList.remove('dead-star');\n document.getElementById('creator-star-2').classList.add('star-rater','live-star');\n $(document.getElementById('creator-star-1')).attr('src', newStar);\n $(document.getElementById('creator-star-2')).attr('src', newStar);\n } if(power === 'creator-star-4') {\n document.getElementById('creator-star-1').classList.remove('dead-star');\n document.getElementById('creator-star-1').classList.add('star-rater','live-star');\n document.getElementById('creator-star-2').classList.remove('dead-star');\n document.getElementById('creator-star-2').classList.add('star-rater','live-star');\n document.getElementById('creator-star-3').classList.remove('dead-star');\n document.getElementById('creator-star-3').classList.add('star-rater','live-star');\n $(document.getElementById('creator-star-1')).attr('src', newStar);\n $(document.getElementById('creator-star-2')).attr('src', newStar);\n $(document.getElementById('creator-star-3')).attr('src', newStar);\n } if(power === 'creator-star-5') {\n document.getElementById('creator-star-1').classList.remove('dead-star');\n document.getElementById('creator-star-1').classList.add('star-rater','live-star');\n document.getElementById('creator-star-2').classList.remove('dead-star');\n document.getElementById('creator-star-2').classList.add('star-rater','live-star');\n document.getElementById('creator-star-3').classList.remove('dead-star');\n document.getElementById('creator-star-3').classList.add('star-rater','live-star');\n document.getElementById('creator-star-4').classList.remove('dead-star');\n document.getElementById('creator-star-4').classList.add('star-rater','live-star');\n $(document.getElementById('creator-star-1')).attr('src', newStar);\n $(document.getElementById('creator-star-2')).attr('src', newStar);\n $(document.getElementById('creator-star-3')).attr('src', newStar);\n $(document.getElementById('creator-star-4')).attr('src', newStar);\n };\n ratingSetting(power);\n}", "title": "" }, { "docid": "1051c072136c06cb967b3f3b8489a533", "score": "0.54093057", "text": "function rating() {\n\tif(moves>0 && moves<13)\n\t{\n\tstarRating.innerHTML = star + star + star;\t\n\t}\n\telse if(moves>12 && moves<17)\n \t{\n \tstarRating.innerHTML = star + star;\n \t}\n \telse if (moves>16)\n \t{\n \tstarRating.innerHTML = star;\n \t}\n \t totalStars = starRating.innerHTML;\n}", "title": "" }, { "docid": "3a3b8bb4b93739d3bdeaa269d45bec42", "score": "0.5400591", "text": "setRating(value) {\r\n //validate and apply newRating\r\n let newRating = 0;\r\n if (value >= 0\r\n && value <= this.numOfStars) {\r\n newRating = value;\r\n }\r\n //limit max value to max number of stars\r\n if (value > this.numOfStars) {\r\n newRating = this.numOfStars;\r\n }\r\n this._rating = newRating;\r\n //update ratingAsInteger. rating parsed to int for the value-[n] modifier\r\n this.ratingAsInteger = parseInt(this._rating.toString());\r\n //update halfStarsVisible\r\n this.setHalfStarVisible();\r\n //update calculated Color\r\n this.setColor();\r\n }", "title": "" }, { "docid": "dd676637c4010570044da5ba1043563d", "score": "0.5394964", "text": "function calculateRating(ratingVal) {\n\n //to show star rating\n var num = Number(ratingVal);\n var b = parseInt(ratingVal);\n var unchecked = 5 - num;\n var starrating = '<i class=\"fa fa-star\"></i>';\n var star = '<i class=\"fa fa-star\"></i>';\n var emptystar = '<i class=\"fa fa-star-o\"></i>';\n for (var i = 1; i < b; i++) {\n starrating += star;\n }\n\n if (unchecked > 0) {\n if ((unchecked % 1) != 0) {\n starrating += '<i class=\"fa fa-star-half-o\"></i>'\n } else if (unchecked >= 1) {\n starrating += emptystar;\n }\n for (var i = 1; i < unchecked; i++) {\n starrating += emptystar;\n }\n }\n\n return starrating;\n\n}", "title": "" }, { "docid": "a5729a53b66ef839b92de404792e361c", "score": "0.53779507", "text": "function rating() {\n if (moves > 10 && moves <= 14) {\n stars[2].classList.remove('fa-star');\n } else if (moves > 14) {\n stars[1].classList.remove('fa-star');\n }\n}", "title": "" }, { "docid": "a4e43d0032d2932105c23b94b4c90b62", "score": "0.53619736", "text": "function initRatings(){\n\t/************************** REVIEW LIST **************************/\n\n\t// If .review-list exists, continue\n\tif ($('.review-list-item, .review-index-item').length > 0){\n\t\t// Get the # of stars for each review-list item and use it for the raty function\n\t\t$('.review-list-item, .review-index-item').each(function(){\n\t\t\tvar ratyHTML \t= $(this).find('.raty');\n\t\t\tvar stars \t\t= ratyHTML.data().stars;\n\n\t\t\tratyHTML.raty({\n\t\t\t\tstarHalf \t: '/images/raty/images/star-half.png',\n\t\t\t\tstarOff \t: '/images/raty/images/star-off.png',\n\t\t\t\tstarOn \t: '/images/raty/images/star-on.png',\n\t\t\t\thints \t\t: ['Horrible', \"Mediocre\", \"Okay\", \"Great\", \"Awesome!\"],\n\t\t\t\treadOnly\t: true, \n\t\t\t\tscore\t\t: stars\n\t\t\t});\t\n\t\t});\n\t}\n}", "title": "" }, { "docid": "1c87dd43887ec1a39289af33a707a838", "score": "0.535315", "text": "function printStars(rating) {\n\trating = parseFloat(rating)+0.25;\n\tvar ret = \"\";\n\tvar i = 0;\n\tfor (i=1; i<= rating; i++) {\n\t\tret += '<i class=\"fa fa-star\" aria-hidden=\"true\"></i>';\n\t}\n\n\tif (i - rating <= 0.5)\n\t\tret += '<i class=\"fa fa-star-half\" aria-hidden=\"true\"></i>';\n\n\treturn ret;\n}", "title": "" }, { "docid": "49ab56fb31be0af89df6580dbf2691ce", "score": "0.5350351", "text": "function createStars(voto){\n //imposto la mia variabile con la metà del valore per ottenere una valutazione in quinti anzichè in decimi,questa quindi verrà sostituita con l elemento iesimo dell'array del voto\n var voto = voto/2;\n\n var star = \"\";\n\n for(var i=1; i<=5;i++){\n //soluzione alternativa con operatore ternario\n star += (i <= voto) \n ? '<i class=\"fas fa-star\"></i>' \n : '<i class=\"far fa-star\"></i>'\n }\n return star;\n}", "title": "" }, { "docid": "fec0872a4a10afe209d56e04c8404d4a", "score": "0.5338053", "text": "function updateStars() {\n\t\t\tfor (let i = 0; i < stars.length; i++) {\n\t\t\t\tif (stars[i].dataset.value <= rating) {\n\t\t\t\t\t// stars[i].classList.replace(\"fa-star\", \"fa-star-o\");\n\t\t\t\t\tstars[i].classList.remove(\"fa-star-o\")\n\t\t\t\t\tstars[i].classList.add(\"fa-star\")\n\t\t\t\t} else {\n\t\t\t\t\t//stars[i].classList.replace(\"fa-star-o\", \"fa-star\");\n\t\t\t\t\tstars[i].classList.remove(\"fa-star\")\n\t\t\t\t\tstars[i].classList.add(\"fa-star-o\")\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "445595432c8b6b3e41752ff0eaac862b", "score": "0.5334057", "text": "function printStars(num) {\n // converting the vote number with a number from 1 to 5\n var num = Math.ceil(num / 2);\n var stars = \"\";\n for (var i = 1; i <= 5; i++) {\n if(i <= num) {\n stars += \"<i class='fas fa-star'></i>\";\n } else {\n stars += \"<i class='far fa-star'></i>\";\n }\n }\n return stars;\n }", "title": "" }, { "docid": "2b0f6d1c2abfc4a7ae1066a233a372c5", "score": "0.5328151", "text": "function averageRating() {\r\n // Get rating from local storage\r\n let movieRating = JSON.parse(localStorage.getItem('movieRatings'));\r\n \r\n // Calculate rating\r\n let total = 0;\r\n for(var i = 0; i < movieRating.length; i++) {\r\n movieRating[i] === 'N/A' ? movieRating[i] = 0 : total += parseFloat(movieRating[i]);\r\n };\r\n let averageRating = (total / movieRating.length).toFixed(1);\r\n\r\n // Show in tolltip\r\n let ratingFAB = document.querySelector('.rating');\r\n\r\n ratingFAB.addEventListener('mouseover', () => {\r\n ratingFAB.setAttribute('data-tooltip', `Average rating of the movies is: ${averageRating} / 10!`);\r\n });\r\n}", "title": "" }, { "docid": "063fd7c1653618e8a79794a10559c497", "score": "0.5323245", "text": "function setRating(moves) {\n\t\tif (moves === 127) {\n\t\t\t$ratingStars.eq(2).removeClass('fa-star').addClass('fa-star-o');\n\t\t\trating = 2;\n\t\t} else if (moves >= 128 && moves <= 228) {\n\t\t\t$ratingStars.eq(1).removeClass('fa-star').addClass('fa-star-o');\n\t\t\trating = 1;\n\t\t} else if (moves >= 229) {\n\t\t\t$ratingStars.eq(0).removeClass('fa-star').addClass('fa-star-o');\n\t\t\trating = 0;\n\t\t}\n\t\treturn { score: rating };\n\t}", "title": "" }, { "docid": "07ef4dd359fdcebd5af808d3f9b33f29", "score": "0.5320817", "text": "function renderStars(rating) {\n var wholeStars = Math.floor(rating);\n var stars = _.range(wholeStars)\n .map(()=> {return <i className=\"fa fa-star \"/>})\n\n if (rating.toString().indexOf('.5') > -1) {\n stars.push(\n <i className=\"fa fa-star-half-o \"></i>\n )\n }\n if (5 - rating > 0) {\n _.range(5 - Math.ceil(rating)).forEach(function() {\n stars.push(\n <i className=\"fa fa-star-o \"></i>\n )\n })\n }\n return stars;\n}", "title": "" }, { "docid": "12719aaa76f94b1be5025944378e856e", "score": "0.5316288", "text": "function addReviews(imdb_rating, rt_rating, m_rating) {\n const elements = document.getElementsByClassName('videoMetadata--container');\n element = elements[0];\n\n // imdb logo img and div for review\n const imdb_png = document.createElement(\"img\");\n\timdb_png.src = chrome.extension.getURL(\"images/imdb_logo.png\");\n\timdb_png.className = \"imdbLogo\";\n\n const imdb_div = document.createElement(\"div\");\n imdb_div.style.width = \"50px\";\n imdb_div.style.height = \"20px\";\n imdb_div.style.color = \"white\";\n imdb_div.style.fontsize = \"16px\";\n imdb_div.style.textAlign = \"center\";\n imdb_div.innerHTML = imdb_rating;\n\n // rotten tomatoes logo img and div for review\n const rt_png = document.createElement(\"img\");\n rt_png.src = chrome.extension.getURL(\"images/rt_logo.png\");\n\trt_png.className = \"rtLogo\";\n\n const rt_div = document.createElement(\"div\");\n rt_div.style.width = \"50px\";\n rt_div.style.height = \"20px\";\n rt_div.style.color = \"white\";\n rt_div.style.fontsize = \"16px\";\n rt_div.style.textAlign = \"center\";\n rt_div.innerHTML = rt_rating;\n\n // metacritic logo img and div for review\n const m_png = document.createElement(\"img\");\n m_png.src = chrome.extension.getURL(\"images/metacritic_logo.png\");\n\tm_png.className = \"mLogo\";\n\n const m_div = document.createElement(\"div\");\n m_div.style.width = \"50px\";\n m_div.style.height = \"20px\";\n m_div.style.color = \"white\";\n m_div.style.fontsize = \"16px\";\n m_div.style.textAlign = \"center\";\n m_div.innerHTML = m_rating;\n\n // appends the logo and div containing the rating from imdb, rotten tomatoes,\n // and metacritic respectively, to the videoMetadata--container\n element.appendChild(imdb_png);\n element.appendChild(imdb_div);\n\n element.appendChild(rt_png);\n element.appendChild(rt_div);\n\n element.appendChild(m_png);\n element.appendChild(m_div);\n}", "title": "" }, { "docid": "c48de01f8f6ef08c369996449ca039f6", "score": "0.5314652", "text": "function printVote(vote) {\r\n somma =\"\";\r\n for (var i = 0; i <5; i++) {\r\n\r\n if ( i < vote) { //contatore i\r\n var risultato = '<i class=\"fas fa-star\"></i>';\r\n } else {\r\n var risultato = '<i class=\"far fa-star\"></i>';\r\n }\r\n somma = somma + risultato;\r\n }\r\n return somma;\r\n}", "title": "" }, { "docid": "43c087e4af10f61bc90317fa4cf2e92d", "score": "0.5306996", "text": "function ratingDisplay () { \n const starsContainer = document.querySelector('.stars');\n if (gameLet.totalMoves === 30) {\n starsContainer.children[2].lastChild.className = 'whiteColor fa fa-star white';\n }\n else if (gameLet.totalMoves === 40) {\n starsContainer.children[1].lastChild.className = 'whiteColor fa fa-star white';\n }\n }", "title": "" }, { "docid": "5c061f0b9128a86dc4a4cb9534913c85", "score": "0.5304287", "text": "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "c0acf4391c9a4cf1cd8671925350e200", "score": "0.5301671", "text": "function renderReviews() {\n averageRating = 0;\n count = 0;\n reviews.forEach(function(eachReview) {\n var eachRate = eachReview.get('rating');\n var li = $(document.createElement('li'))\n .raty({\n readOnly: true,\n score: (eachRate),\n hints: ['crap', 'awful', 'ok', 'nice', 'awesome']\n })\n .appendTo(reviewsList);\n\n count++;\n averageRating += eachRate;\n\n $(document.createElement('p'))\n .text(\"Time: \" + eachReview.get('createdAt'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Heard about event from: \" + eachReview.get('heardFrom'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Rate clearness of instructions: \" + eachReview.get('clearnessWeb'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Purchased challenger package?: \" + eachReview.get('challengerPurchased'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Satisfaction of pack: \" + eachReview.get('challengerSatisfaction'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Comments about bus: \" + eachReview.get('challengerBus'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Venue Rating: \" + eachReview.get('venueRate'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Venue comments: \" + eachReview.get('venueComments'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Rate event activities: \" + eachReview.get('rateActivities'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Would attend in the future again: \" + eachReview.get('attendAgain'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Event comments: \" + eachReview.get('eventComments'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Additional comments: \" + eachReview.get('additionalComments'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Future event comments: \" + eachReview.get('futureComments'))\n .appendTo(li);\n });\n }", "title": "" }, { "docid": "f62944f832fc20587d92d323d1fbee0d", "score": "0.52927893", "text": "function rateIt(selector){\n\t\tvar selectorRating=selector.split('\\'')[1];\n\t\tvar selectorRatingText='\\''+selectorRating+' .ratingText'+'\\'';\n\t\tselectorRating='\\''+selectorRating+' .rating'+'\\'';\n\n\t\t$(eval(selectorRating)).rating({\n\t\t\tshowCancel:false\n\t\t});\n\t\t$(eval(selectorRating)).bind(\"change\",function(){\n\t\t\t$(eval(selectorRatingText)).text(level[$(eval(selectorRating)).val()]);\n\t\t});\n\n\t\t$(eval(selectorRating)).val(1).change();\n\t}", "title": "" }, { "docid": "f57f076d1380cb3b78ae9b22327747b2", "score": "0.5288208", "text": "function stars(num){\n let rating = ''\n for(var i=0;i<num;i++){\n rating += '*'\n }\n return rating\n}", "title": "" }, { "docid": "7c2ad049840f4c3bae5b9a474438a6f7", "score": "0.5283104", "text": "function ratings(rating) {\n switch (true) {\n case rating === 5:\n return `<p><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break;\n case rating >= 4.5:\n return `<p><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star-half-alt\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break\n case rating >= 4:\n return `<p><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break\n case rating >= 3.5:\n return `<p><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star-half-alt\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break\n case rating >= 3:\n return `<p><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break\n case rating >= 2.5:\n return `<p><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star-half-alt\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break\n case rating >= 2:\n return `<p><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break\n case rating >= 1.5:\n return `<p><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"fas fa-star-half-alt\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break\n case rating >= 1:\n return `<p><i class=\"fas fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break\n case rating >= 0.5:\n return `<p><i class=\"fas fa-star-half-alt\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break\n case rating >= 0:\n return `<p><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><i class=\"far fa-star\" aria-hidden=\"true\"></i><span class=\"sr-only\">${rating}</span></p>`;\n break\n default:\n return \"\";\n }\n}", "title": "" }, { "docid": "1346092b18520f458f9a33a1840b6b6e", "score": "0.5281138", "text": "function starRating(lostLife, selector) {\nlet starArray = $(selector).children().toArray();\n// console.log(selector);\n$(starArray).attr('class', 'fa fa-star');\nwhile (lostLife > 0) {\n $(starArray.pop()).attr('class', 'fa fa-star-o');\n lostLife--;\n}\n}", "title": "" }, { "docid": "82af9ab4513e73e73117195a01bd5db6", "score": "0.5276414", "text": "ratingChanged(newRating) {\n this.props\n\t .dispatch(rateRecipie(this.props.id, {\n\t \tid: this.props.id,\n\t \trating: this.props.recipie.rating + newRating,\n\t \tnumberOfRatings: this.props.recipie.numberOfRatings + 1\n\t }));\n }", "title": "" }, { "docid": "6ff9f54919268e5c356cfe5ee24c3612", "score": "0.52650714", "text": "function $fc_demo_star_rating_click()\n\t{\n\t\t$.scrap_note_time('Your rating has been subitted', 2000);\n\t}", "title": "" }, { "docid": "9e2acc90f610db13d504b64eeb2a350f", "score": "0.5259259", "text": "function setRating(rating) {\n document.getElementById(\"starRating\").innerHTML = \"\" + rating.toFixed(1) + \" / 5\";\n}", "title": "" }, { "docid": "e36425c6d526c63b35671d46d287a6b9", "score": "0.5258465", "text": "function rating(e){\n\tnode = $(e.target);\n\n\tnode.removeClass('icon-star-empty');\n\tnode.addClass('icon-star');\n\n\tnode.siblings('a').each(function(i, element) {\n\t\telement = $(element);\n\t\tif (element.data('rating') <= node.data('rating')) {\n\t\t\telement.removeClass('icon-star-empty');\n\t\t\telement.addClass('icon-star');\n\t\t\tnode.siblings('.rateStatus').html(node.attr('title'));\n\t\t} else {\n\t\t\telement.removeClass('icon-star');\n\t\t\telement.addClass('icon-star-empty');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9e79779ae7a913c5bc8af110023f1b78", "score": "0.52584326", "text": "function setStars()\n\t{\n\t\tvar pos = Input.mousePosition;\n\n\t\tpos -= offset;\n\t\tif(!clicked)\n\t\t{\n\t\t\t\tif(pos.x >= start.x && pos.x < fifth*1 && (Screen.height - pos.y) >= start.y && (Screen.height - pos.y) < end.y)\n\t\t\t\t{\n\t\t\t\t\tamnt = 1;\n\t\t\t\t\tif(Input.GetMouseButtonDown(0))\n\t\t\t\t\t{\n\t\t\t\t\tclicked = true;\n\t\t\t\t\tisRated = true;\n\t\t\t\t\tSubmitRating(amnt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(pos.x >= fifth*1 && pos.x < fifth*2 && (Screen.height - pos.y) >= start.y && (Screen.height - pos.y) < end.y)\n\t\t\t\t{\n\t\t\t\t\tamnt = 2;\n\t\t\t\t\tif(Input.GetMouseButtonDown(0))\n\t\t\t\t\t{\n\t\t\t\t\tclicked = true;\n\t\t\t\t\tisRated = true;\n\t\t\t\t\tSubmitRating(amnt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(pos.x >= fifth*2 && pos.x < fifth*3 && (Screen.height - pos.y) >= start.y && (Screen.height - pos.y) < end.y)\n\t\t\t\t{\n\t\t\t\t\tamnt = 3;\n\t\t\t\t\tif(Input.GetMouseButtonDown(0))\n\t\t\t\t\t{\n\t\t\t\t\tclicked = true;\n\t\t\t\t\tisRated = true;\n\t\t\t\t\tSubmitRating(amnt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(pos.x >= fifth*3 && pos.x < fifth*4 && (Screen.height - pos.y) >= start.y && (Screen.height - pos.y) < end.y)\n\t\t\t\t{\n\t\t\t\t\tamnt = 4;\n\t\t\t\t\tif(Input.GetMouseButtonDown(0))\n\t\t\t\t\t{\n\t\t\t\t\tclicked = true;\n\t\t\t\t\tisRated = true;\n\t\t\t\t\tSubmitRating(amnt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(pos.x >= fifth*4 && pos.x < fifth*5 && (Screen.height - pos.y) >= start.y && (Screen.height - pos.y) < end.y)\n\t\t\t\t{\n\t\t\t\t\tamnt = 5;\n\t\t\t\t\tif(Input.GetMouseButtonDown(0))\n\t\t\t\t\t{\n\t\t\t\t\tclicked = true;\n\t\t\t\t\tisRated = true;\n\t\t\t\t\tSubmitRating(amnt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tamnt = 0;\n\t\t\t\t}\n\n\t\t\t\t/*if(Input.GetMouseButtonDown(0))\n\t\t\t\t{\n\t\t\t\t\tclicked = true;\n\t\t\t\t\tisRated = true;\n\t\t\t\t\tSubmitRating(amnt);\n\t\t\t\t}*/\n\t\t}\n\t\t\tpersonalRating = amnt;\n\t\t\treturn amnt;\n\t}", "title": "" }, { "docid": "4f51b21c8cf67bb1ec628ffd1f012e34", "score": "0.52437854", "text": "function StarRating() {\n this.options = {\n activeClass: 'active',\n settedClass: 'setted',\n element: null,\n items: null,\n onselect: null\n };\n this.init.apply(this, arguments);\n}", "title": "" }, { "docid": "fbf25de228f3d52928ad0c431aa42ced", "score": "0.5234702", "text": "function fillReview(review) {\n const review_author = review.user_name;\n const review_text = review.text;\n\n let rating = \"\";\n for(let i=0; i<review.rating; i++) {\n rating = rating + `<span class=\\\"fa fa-star checked\\\"></span>`; //fill the stars of the rating\n }\n for(let i=0; i<5-review.rating; i++) {\n rating = rating + `<span class=\"fa fa-star\"></span>`; //add the empty stars\n }\n\n return `<div class=\"card review\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">`+review_author+`</h5>\n <p class=\"card-text left\">`+review_text+`</p>\n </div>\n <div class=\"card-footer\">\n `+rating+`\n </div>\n </div>`;\n}", "title": "" }, { "docid": "ef1212924eb74ac648bd397842743e4d", "score": "0.5231269", "text": "function updateRating(player, opponents){\n player.R = newR(player, opponents);\n player.RD = newRD(player, opponents);\n // to avoid scenarios where players can't improve due to low deviation\n if (player.RD < 30){\n player.RD = 30\n }\n}", "title": "" }, { "docid": "2bd2ad3221a2fa63b2cb5e8e0e67aa9a", "score": "0.5219343", "text": "function rating() {\n\t\t\t$( \"select[id^='rating']\" ).barrating('show', {\n\t\t\t theme: 'fontawesome-stars',\n\t\t\t onSelect: function(value, text, event) {\n\t\t\t\tif (typeof(event) !== 'undefined') {\n\t\t\t\t\t$.post( '', {\n\t\t\t\t\t\t\t\tid_status: text,\n\t\t\t\t\t\t\t\trating: value,\n\t\t\t\t\t\t\t\taction:'store_rating'\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.done(function( data ) {\t\n\t\t\t\t\t\t\t\tvar content = $( data ).find(\"#rating_result\"+text);\n\t\t\t\t\t\t\t\t$(\"#rating_result\"+text).html( content );\n\t\t\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t }\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "f4f0e397dbdb94b385f6d2fa1c6cf654", "score": "0.5214411", "text": "function rating() {\n\tif (moves>=15) {\n\t\tif (grade !== \"Average\") {\n\t\t\tgrade=\"Average\";\n\t\t\t\n starsContainer.removeChild(starsContainer.children[0]);\n\t\t}\n\t}\n\t\t\n\tif (moves>24){\n\t\tif (grade !== \"poor\") {\n\t\t\tgrade=\"poor\";\n\tstarsContainer.removeChild(starsContainer.children[0]); \n\t\n\t\t}\n\t}\n\t\n\t\n}", "title": "" }, { "docid": "0ed46863297a53f3f586d5cc2e67c1ef", "score": "0.52105266", "text": "function star_rating(r) {\n\tdocument.write('<span class=\"star-active\">');\n\tfor(var i=0;i<5;i++){\n\t\tif (i==r) {\n\t\t\tdocument.write('</span><span class=\"star-inactive\">');\n\t\t}\n\t\tdocument.write('★');\n\t}\n\tdocument.write('</span>');\n}", "title": "" }, { "docid": "add6bc422c7ce6453f970e76bd3972bf", "score": "0.52085453", "text": "function changeRating( newRating, name ) {\n //loop farmer data to find correct records\n farmers.map(item =>{\n //match records\n if(item.index === name){\n //update new rating score in frontend\n item.score = newRating;\n //update new rating score in backend\n updateScore(item.index, newRating).then(res =>{\n console.log(res);\n });\n } \n })\n }", "title": "" }, { "docid": "f3e7ecb8845d28fcd7d620bb9fa859c5", "score": "0.5195801", "text": "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "f3e7ecb8845d28fcd7d620bb9fa859c5", "score": "0.5195801", "text": "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "fc664149db0d8f8a9cce2342afcdb9cf", "score": "0.5193192", "text": "function adjustRating(rating){\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "ad4dc15c0edbd8ae980ff8dee92d8d82", "score": "0.5186921", "text": "function add_stars_style() {\r\n\t// add style for the stars\r\n\tvar css=document.styleSheets[0]\r\n\tvar nrules = css.cssRules.length\r\n\t\r\n\tcss.insertRule(\".vote_div { width:65px; height:23px; background: url(\" + imgUrl + \"); z-index:3 }\", nrules++)\r\n css.insertRule(\".star { display:block; position:relative; left:0px; top:0px; width:13px; height:23px; z-index:1; text-decoration: none;text-indent: -9000px; border-left: 0px; padding: 0px 0px 0px 0px; margin:0px}\", nrules++)\r\n css.insertRule(\".vote_div td { width:13px; height:23px; border-left: 0px; padding: 0px 0px 0px 0px; margin:0px; }\", nrules++)\r\n}", "title": "" }, { "docid": "37584a6bdeb49a84c12f97e7d8feb9f7", "score": "0.51835704", "text": "function increaseBookRating(id) {\n if (gBooks[id - 1].rating === 10) return;\n gBooks[id - 1].rating++;\n}", "title": "" }, { "docid": "57e73e4ee7410be1ec57f3c36c11491e", "score": "0.5183506", "text": "ratingGeq(rating){\r\n return new FluentRestaurants(this.data.filter(function f(x){ return(lib220.getProperty(x, 'stars').value >= rating);}));\r\n }", "title": "" }, { "docid": "ccd79bd98cc19d0128e8c66cb3086084", "score": "0.51802105", "text": "function starRating() {\n\tif (moveCount === 35) {\n\t\t$('#one').css('display', 'none');\n\t\tstar = '2 stars';\n\t}\n\tif (moveCount === 45) {\n\t\t$('#two').css('display', 'none');\n\t\tstar = '1 star';\n\t}\n\tif (moveCount === 50) {\n\t\t$('#three').css('display', 'none');\n\t\tstar = '0 stars';\n\t}\n}", "title": "" }, { "docid": "6cd1f5bea5016025f52b61ced8de6332", "score": "0.5178585", "text": "function starRating() {\n\tif (moves.innerHTML > 13 && moves.innerHTML < 19) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\tif (i > 1) {\n\t\t\t\tstars[i].style.visibility = 'collapse';\n\t\t\t}\n\t\t}\n\t} else if (moves.innerHTML > 24) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tstars[i].style.visibility = 'collapse';\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e61b2f1c79a8b6646c7d1e4e3a78dead", "score": "0.5177785", "text": "function getClassByRating() {\n if (movie.vote_average >= 8) {\n return \"green\";\n } else if (movie.vote_average >= 5) {\n return \"orange\";\n } else {\n return \"red\";\n }\n }", "title": "" }, { "docid": "63cb4b4154c340d536fa94684cf6b80d", "score": "0.517749", "text": "function StarRating() {\r\n $(\".starnull\").html('<span>without a star</span>');\r\n //$(\".starnull\").html('<span><i class=\"fa fa-star\"></i> </span><span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star-o\"></i></span>');\r\n $(\".star50\").html('<span><i class=\"fa fa-star\"></i> </span><span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span>');\r\n $(\".star40\").html('<span><i class=\"fa fa-star\"></i> </span><span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star-o\"></i></span>');\r\n $(\".star30\").html('<span><i class=\"fa fa-star\"></i> </span><span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span>');\r\n $(\".star20\").html('<span><i class=\"fa fa-star\"></i> </span><span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span>');\r\n $(\".star10\").html('<span><i class=\"fa fa-star\"></i> </span><span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span>');\r\n\r\n $(\".star45\").html('<span><i class=\"fa fa-star\"></i> </span><span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star-half-o\"></i></span>');\r\n $(\".star35\").html('<span><i class=\"fa fa-star\"></i> </span><span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star-half-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span>');\r\n $(\".star25\").html('<span><i class=\"fa fa-star\"></i> </span><span><i class=\"fa fa-star\"></i></span> <span><i class=\"fa fa-star-half-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span>');\r\n $(\".star15\").html('<span><i class=\"fa fa-star\"></i> </span><span><i class=\"fa fa-star-half-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span>');\r\n $(\".star05\").html('<span><i class=\"fa fa-star-half-o\"></i> </span><span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span> <span><i class=\"fa fa-star-o\"></i></span>');\r\n $(\".starUnrated\").html('<span>without a star</span>');\r\n}", "title": "" }, { "docid": "738efca5eceb745cb23a696d79aa21f9", "score": "0.51738966", "text": "function starRating(place) {\n let rating = [];\n if (place.rating) {\n for (let i = 0; i < 5; i++) {\n if (place.rating < (i + 0.5)) {\n rating.push('&#10025;');\n } else {\n rating.push('&#10029;');\n }\n }\n return rating.join(' ');\n }\n}", "title": "" }, { "docid": "3ed2c46268541d527d82bc8307ae1890", "score": "0.5171528", "text": "function createTotalReviews() {\n return randomizer(50, 100)\n}", "title": "" } ]
e7d0be50486f4d85174e942112e91873
console.log(upperMy("hi how are you today"))
[ { "docid": "27d98f2655ae922b7b8915b4609f39e0", "score": "0.0", "text": "function reverseInt(number){\n number = number.toString().split('')\n let result = ''\n for (let i = number.length - 1; i >= 0; i--){\n result += number[i]\n }\n return parseInt(result)\n}", "title": "" } ]
[ { "docid": "258ffe8093a20bddfdc9245830797457", "score": "0.7493322", "text": "function myFunction(thing) {\n return thing.toUpperCase();\n}", "title": "" }, { "docid": "f7ac17aea8ffed71dc7d0c83872da317", "score": "0.7450521", "text": "function logShout(string) {\n console.log(string.toUpperCase());\n}", "title": "" }, { "docid": "d57f65b2ffb82aadd345502fcae04be4", "score": "0.7190431", "text": "function upper(Input_string)\n{\n\tif(typeof(Input_string)=== 'string')\n\t{\n\t\tlet result = Input_string.toUpperCase();\n\t\tconsole.log(result);\n\t\treturn(result);\n\t\t\n\t\t\n\t}\n\telse{\n\t\treturn null\n\t}\n}", "title": "" }, { "docid": "722c895dae5de405d75d7d183f009119", "score": "0.71585864", "text": "function logShout(string) {\n return console.log(string.toUpperCase())\n}", "title": "" }, { "docid": "92b750c802038577c158427f15dbc24d", "score": "0.7111083", "text": "function toUpperCase(string) {\n // YOUR CODE BELOW HERE //\n\nreturn string.toUpperCase(); //returns given arg in uppercase\n\n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "3bab3a2882336d10524a05807497dc35", "score": "0.70506305", "text": "function makeUppercase(word){\n return word.toUpperCase();\n}", "title": "" }, { "docid": "5eb4ebc18c19313f95dca42947cac38b", "score": "0.7021472", "text": "function uppercaser(str) { return str.toUpperCase(); }", "title": "" }, { "docid": "6e9f1a5cc169164f1cfe7936915e567a", "score": "0.70019174", "text": "function makeUppercase(word){\n return word.toUpperCase();\n}", "title": "" }, { "docid": "4b10d54ebdd4da91789f13012810e94f", "score": "0.69508874", "text": "function uppercaser(str) {\n return str.toUpperCase();\n}", "title": "" }, { "docid": "4b10d54ebdd4da91789f13012810e94f", "score": "0.69508874", "text": "function uppercaser(str) {\n return str.toUpperCase();\n}", "title": "" }, { "docid": "a6890103d12b7f83b23cbe6854ed3475", "score": "0.68984544", "text": "function capitalized(string) {\n return string.toUpperCase()\n\n}", "title": "" }, { "docid": "66995947fe4a23d619a72dfb0f352ca6", "score": "0.68780637", "text": "function capitalize(str){\n return\n}", "title": "" }, { "docid": "f7d39bb843f83c4243c826e8e105517d", "score": "0.6863092", "text": "function yell(string){\n return string.toUpperCase();\n}", "title": "" }, { "docid": "ff63aeba59942793540cfed7475807c0", "score": "0.684098", "text": "function yell(str){ \n return str.toUpperCase();\n}", "title": "" }, { "docid": "f9684fceec119d9ba68efb31f430a5b1", "score": "0.67941415", "text": "function yell (str){\r\n return str.toUpperCase();\r\n}", "title": "" }, { "docid": "f216da945532911d713f294cb8fddfb1", "score": "0.6790558", "text": "upper(value)\n {\n return value.toUpperCase();\n }", "title": "" }, { "docid": "b809f16e6850cbe53f985f071d3147e7", "score": "0.67054147", "text": "function capitalize(message) {\n // YOUR CODE HERE\n}", "title": "" }, { "docid": "f66e8731f79163f7275e66c33c2a2b2b", "score": "0.66861975", "text": "function getUppercase(){\n\treturn upperLetters[Math.floor(Math.random() * upperLetters.length)];\n}", "title": "" }, { "docid": "4583664ab2111329ca52250bad89d513", "score": "0.66731876", "text": "function capitalazer(sentence) {\n let upper;\n let lower;\n\n lower = sentence.toLowerCase();\n upper = sentence[0].toUpperCase() + lower.slice(1);\n return upper;\n}", "title": "" }, { "docid": "896f91c67332b286e67f9643344cb685", "score": "0.66537267", "text": "function toUpperCase(string) {\n // YOUR CODE BELOW HERE //\n //this exercise shows the function toUpperCase returning a string to be all uppercase letters\n \n return string.toUpperCase();\n\n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "b0bd14c290d534ec72e25c79784311b6", "score": "0.6635687", "text": "function yell(string) {\n return string.toUpperCase();\n}", "title": "" }, { "docid": "06cc91ecf5a5edddc0df9013932abbd8", "score": "0.6633817", "text": "function imprimirNombreMayus (n){ // n tiene scope local//\n n = n.toUpperCase();\n console.log(n);\n}", "title": "" }, { "docid": "10d15395cee3c1c860736c4165223366", "score": "0.6629961", "text": "static capitalize (word) {\n\n return word.slice(0, 1).toUpperCase() + word.slice(1, word.length)\n }", "title": "" }, { "docid": "2fbf786d7cb1a25d0c1db947aee2c506", "score": "0.662429", "text": "function upper(all, letter) { // all is -b and -w, letter is b and w\r\n return letter.toUpperCase();\r\n}", "title": "" }, { "docid": "6a48685192fb30173b7ad142ef0eb9ba", "score": "0.66210747", "text": "function makeUpperCase(str) {\n return str.toUpperCase()\n}", "title": "" }, { "docid": "58fb77b9a50091f76bf18c6171c844e0", "score": "0.6616055", "text": "function i(t){return t[0].toUpperCase()+t.substr(1)}", "title": "" }, { "docid": "bfa46a542870948d09bf613c986e001a", "score": "0.6616043", "text": "upper() { return this.pyObject.toUpperCase() }", "title": "" }, { "docid": "57dfae755cca96d53dea782e6bb427ea", "score": "0.65923256", "text": "function getUpperCase(){\n return String.fromCharCode(Math.floor((Math.random()*26)+65))\n}", "title": "" }, { "docid": "7af1f55fb55eaed9f4cf2dd7320376b6", "score": "0.6577252", "text": "function i(e){return e[0].toUpperCase()+e.substr(1)}", "title": "" }, { "docid": "c16186e39515c12b060071b32742d99a", "score": "0.6564324", "text": "function yell(str) {\n return str.toUpperCase();\n}", "title": "" }, { "docid": "2841a9a911573aaeaf22711ef1ed54b1", "score": "0.6553853", "text": "function upperAll(str) {\n return str.toUpperCase()\n}", "title": "" }, { "docid": "0e0667079a86ee0369a98600f28c1c85", "score": "0.65370655", "text": "function stringToUpperCase(input_str) {\n return input_str.toUpperCase();\n}", "title": "" }, { "docid": "9e49c1f520803469361d1ebc7a0d4341", "score": "0.6511152", "text": "function imprimirNombreEnMayusculas(n)\n{\n n = n.toUpperCase();\n console.log(n)\n}", "title": "" }, { "docid": "51e78f254a27af794879036c46e7d7c7", "score": "0.65008664", "text": "function capital(){\r\nvar str = prompt(\"Enter a string:\");\r\nvar output = str.substring(0, 1).toUpperCase() + str.substring(1);\r\nalert(\"After capitalizing first letter: \"+output)\r\n}", "title": "" }, { "docid": "fc3ca7694893352dd66b9dd4d7159c84", "score": "0.6497631", "text": "function makeUpper(str) {\n return str.toUpperCase();\n}", "title": "" }, { "docid": "df645634b365bfa5e3f32604eb65e284", "score": "0.64912516", "text": "function o(e,t){return t.toUpperCase()}", "title": "" }, { "docid": "c35beaaba90da4a1ce7f552a3f0ea2a9", "score": "0.6486105", "text": "function makeUpperCase(str) {\n \n return str.toUpperCase();\n \n}", "title": "" }, { "docid": "9015d99f3c33f665df93087841b63cf4", "score": "0.6476335", "text": "function upperCase(str) {\n return str.toUpperCase();\n}", "title": "" }, { "docid": "5d36223f66be2ddb04036e815300a04e", "score": "0.6467656", "text": "function imprimirNombreEnMayusculas(n) {\n n = n.toUpperCase()\n console.log(n)\n}", "title": "" }, { "docid": "3b9dea7818e6ded4f14dc9a2c46add4d", "score": "0.6466734", "text": "static capitalize (string){\n return string.charAt(0).toUpperCase() + string.slice(1) \n }", "title": "" }, { "docid": "7999c426b2e6e30dc190225b83f8f40d", "score": "0.6458895", "text": "function getWord(left, right){\n let newWord = left + right;\n console.log(newWord.charAt(0).toUpperCase() + newWord.slice(1));\n}", "title": "" }, { "docid": "c592049e4abbadc483530dea9adcd6b2", "score": "0.64567083", "text": "function makeUpperCase(str) {\n return str.toUpperCase();\n}", "title": "" }, { "docid": "c5a6a2d821854851ebbecb61f115ff91", "score": "0.64527774", "text": "function capitalizeWord(string) {\n \n}", "title": "" }, { "docid": "84f77900291ce6f3df091e95f24a824d", "score": "0.64471763", "text": "function n(e){return e[0].toUpperCase()+e.substr(1)}", "title": "" }, { "docid": "84f77900291ce6f3df091e95f24a824d", "score": "0.64471763", "text": "function n(e){return e[0].toUpperCase()+e.substr(1)}", "title": "" }, { "docid": "a73cb4ec7a64add7f5afcb812cadc875", "score": "0.6414122", "text": "function upperCase(search){\n return search.toUpperCase();\n} // end of upperCase function", "title": "" }, { "docid": "bc396fc9630753b6cdb09853b7dcc4ec", "score": "0.6397355", "text": "function imprimirNombreEnMayusculas() {\n nombre = nombre.toUpperCase()\n console.log(nombre)\n}", "title": "" }, { "docid": "7b007a5d0566119ae77654d5c0f58290", "score": "0.6388913", "text": "function upper(s) {\n\tvar u = s.toLocaleUpperCase(); // Use instead of toUpperCase() to work for locales without the default Unicode case mappings\n\tif (s.length != u.length) mistakeLog(Mistake(\"platform\", {note:\"length\", watch:{s:s, u:u}})); // Make sure the case change didn't change the length\n\treturn u;\n}", "title": "" }, { "docid": "cd2c7bcbed8a47cbf07bd03ef03fa74c", "score": "0.63683945", "text": "static capitalize(string){\n return string[0].toUpperCase() + string.slice(1);\n }", "title": "" }, { "docid": "ad1e4da66ce132cbca44d9049ebd393b", "score": "0.63648254", "text": "function ucFirst(someString) {\n var res = someString[0].toUpperCase() + someString.slice(1);\n console.log(res);\n}", "title": "" }, { "docid": "29a71b7d8a566316bb9aa7da81f4a7c7", "score": "0.63500017", "text": "function makeUpperCase(str) { \n let upperCase = str.toUpperCase();\n \n return upperCase\n }", "title": "" }, { "docid": "c2b399da051acf3da804b5e66e5e0273", "score": "0.63438725", "text": "function capitalize() {\n return this[0].toUpperCase() + this.substr(1).toLowerCase();\n}", "title": "" }, { "docid": "0d582b372e965d33fbb268b8e9dcd4b6", "score": "0.6342463", "text": "static capitalize(string){\n let first = string[0].toUpperCase()\n return first + string.slice(1)\n }", "title": "" }, { "docid": "30491a72e3b52a5812b548c93e73f1f2", "score": "0.6334198", "text": "function strtoupper(text){\n\treturn text.toUpperCase();\n}", "title": "" }, { "docid": "98bc7f24a08c33339b24e3a3b76cbf55", "score": "0.63291234", "text": "function allInOne(){\nvar newSentence= sentence + reverseCapitalizer(capitalizer());\nreturn newSentence;\n}", "title": "" }, { "docid": "34ef3dc9e5d6f9b2227f6e4db3819b73", "score": "0.6325656", "text": "function myFunction5 (input5){\n return input5.charAt(0).toLowerCase()+ input5.slice(1)\n }", "title": "" }, { "docid": "2b768069f17c17615f8ab4c54457d690", "score": "0.6319863", "text": "static capitalize(str){\n return str.slice(0,1).toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "3f0a7d807aef3f8d88619247973b7d78", "score": "0.6296682", "text": "function strm(word='the quick brown fox'){\n var tyu = word.toLowerCase().split(' ');\n for(var i=0;i<tyu.length;i++){\n tyu[i]=tyu[i].charAt(0).toUpperCase()+ tyu[i].substring(1);\n var u = tyu.join(' ');\n \n }\ndocument.write(u)\n}", "title": "" }, { "docid": "041b6742290ea20d91e7d94eaf7d94df", "score": "0.629629", "text": "static capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1)\n }", "title": "" }, { "docid": "b5600725604a2a5788483855026b783a", "score": "0.6288913", "text": "function capitalize(text) {\n\n let capitalized = text.charAt(0).toUpperCase() \n + text.slice(1);//YOUR CODE HERE (approximately 1 line)\n\n return capitalized; // DON'T UPDATE THIS LINE\n}", "title": "" }, { "docid": "99d09495cfb20b096feaea297b037258", "score": "0.6285804", "text": "function Step2() {\r\n let step2 = prompt(\"Enter a phrase:\");\r\n function capLetter(step2) {\r\n let step2b = step2.toLowerCase().split(\" \");\r\n console.log(step2b);\r\n for (let i = 0; i < step2b.length; i++) {\r\n step2b[i] = step2b[i].charAt(0).toUpperCase + step2b[i].substring(1);\r\n }\r\n return step2b.join(\" \");\r\n }\r\n console.log(capLetter(step2));\r\n}", "title": "" }, { "docid": "da8e104f218431cc45ebd5e6db8eb624", "score": "0.62806946", "text": "function upperCase(str) {\n var array = str.split(' ');\n var Newarr = [];\n\n for (var i = 0; i < array.length; i++) {\n Newarr.push(array[i].charAt(0).toUpperCase() + array[i].slice(1));\n }\n let upperValues = Newarr.join(' ');\n return alert(upperValues);\n}", "title": "" }, { "docid": "5dcb373c07e0f7553fcf43a393e4fe31", "score": "0.6275899", "text": "function LetterCapitalize(str) {\n\n}", "title": "" }, { "docid": "bd9344eb151dd5b12f86230399f80f69", "score": "0.62641233", "text": "function convertToUpper(string) {\n return string.toUpperCase();\n}", "title": "" }, { "docid": "218ea1b1685dce6be69f2ddff83ed1b6", "score": "0.62563324", "text": "function upperCase() {\r\n const randomLetter = Math.floor(Math.random() * 26);\r\n return alphabet[randomLetter].toUpperCase();\r\n}", "title": "" }, { "docid": "a69ef6a47e4291a74cc1e6cb65674db2", "score": "0.62558067", "text": "function firstUp(string){\n return string[0].toUpperCase() + string.substring(1);\n}", "title": "" }, { "docid": "2f431e0826306eef0383cf75ea53d9b5", "score": "0.6249497", "text": "function getUpperCase () {\n var result = window.confirm(\"Would you like Upper Case Characters?\")\n return result\n}", "title": "" }, { "docid": "b950f3bb7973fa7f4ead6a0aef71b9d6", "score": "0.62443", "text": "function setUpperCase(str){\n return str[0].toUpperCase() + str.slice(1).toLowerCase();\n}", "title": "" }, { "docid": "ee5803f507a6ea54ebb9d848e214372a", "score": "0.6240711", "text": "static capitalize(st){\n return st.charAt(0).toUpperCase()+st.slice(1)\n }", "title": "" }, { "docid": "1cf339ad5cfa5d32e743f8b1f4571752", "score": "0.62310195", "text": "function yell(params) {\n let low = params.toUpperCase();\n\n return low;\n}", "title": "" }, { "docid": "54f3b7a4629ff3ef0b15db541e3369ee", "score": "0.62277853", "text": "static capitalize(str){\n return (str.charAt().toUpperCase() + str.slice(1))\n }", "title": "" }, { "docid": "3dfb3f7b50b703ffee30ef0675ed90e6", "score": "0.62265587", "text": "function allUpperCase(str) {\n return str.toUpperCase();\n}", "title": "" }, { "docid": "357ac98ef163727455fa91647f26b3d8", "score": "0.622041", "text": "function yell(name = '') {\n return `hello ${name.toUpperCase()}`;\n}", "title": "" }, { "docid": "f90ed04db58a24042a2186c663dad8dd", "score": "0.62052506", "text": "function capitalize(truc){\n let machin = truc.charAt(0).toUpperCase()\n return machin + truc.slice(1).toLowerCase()\n}", "title": "" }, { "docid": "29a9e4f09fb8ccd722de6cf9d2b971b8", "score": "0.6204392", "text": "function yell(str) {\n\treturn str.toUpperCase()\n}", "title": "" }, { "docid": "8830d54ecf9354be2ab21f29e059cd38", "score": "0.61994433", "text": "function sayHi(){\n return 'Hi'\n}", "title": "" }, { "docid": "374c41c85cd7b7299b01b39753414086", "score": "0.6198631", "text": "yellHi() {\n console.log('HEY IANNNN');\n }", "title": "" }, { "docid": "0b60a2944b2ca81bddf6b7321b5449d7", "score": "0.61985505", "text": "function randomUpperCase() {\n return String.fromCharCode(Math.floor(Math.random() * 26) + 65);\n}", "title": "" }, { "docid": "383c13c1b620a965d49a66a5b6427a83", "score": "0.61966", "text": "function stringvar ()\n{\n \nvar temp = \"akshay singh rathore\";\nvar t1= temp.split(\"\");\nvar t2;\nfor(var i=0 ; i<=t1.length-1; i++)\n{\n t2= t1[i].charAt(0).toUpperCase();\n console.log(t2);\n \n}\n}", "title": "" }, { "docid": "8490ceb317661242b5c1b82831113f90", "score": "0.61899626", "text": "function upperFirst(inputString) {\n return inputString[0].toUpperCase() + inputString.slice(1,inputString.length)\n}", "title": "" }, { "docid": "c1c092606276fc8e5243b727b1bcbb41", "score": "0.6186297", "text": "function upperCase (name) {\n return name.toUpperCase();\n}", "title": "" }, { "docid": "7147e39b2877b8f9451428ea4cf8ec3e", "score": "0.6170915", "text": "function upperCase(str) {\n return str.toUpperCase();\n }", "title": "" }, { "docid": "fd8cee3cd165414d98fa4adf0c755ff8", "score": "0.6170864", "text": "function toUpper(string) {\n return string.toUpperCase();\n }", "title": "" }, { "docid": "9b12734979e49ef2eb56c227f49f7c35", "score": "0.61656034", "text": "function capitalize(myPoem) {\n\tvar words = myPooem.split(\" \");\nString.prototype.capitalize = function() {\n return this.charAt(0).toUpperCase() + this.slice(1);\n}\n\ncapitalize.apply([words]);\n\t}", "title": "" }, { "docid": "e0db1b0472948201cdf9437357446356", "score": "0.6163885", "text": "function ponerTodasLasLetrasMayusculas(){\n\n let ponerTodasLasLetrasMayusculas = \"Hola clase\";\n console.log(ponerTodasLasLetrasMayusculas.toUpperCase())\n}", "title": "" }, { "docid": "58f26181c92ca8f00765286c14247647", "score": "0.6162014", "text": "function sayHi(name){\n return \"Hi \"+ name;\n}", "title": "" }, { "docid": "bb3ad50a03515956c421a4484d65c1a1", "score": "0.6159054", "text": "function convertToUpperCase(str) {\n return str.toUpperCase();\n}", "title": "" }, { "docid": "7c9eeedc13d448e2b49ef3c5ae7983c8", "score": "0.61544067", "text": "function capitalize(name) {\n let nameCapitalized = name[0].toUpperCase() + name.slice(1);\n console.log(nameCapitalized);\n}", "title": "" }, { "docid": "0ed2bd9684a04069dd16915bb072aeda", "score": "0.61512595", "text": "function exports(str) {\n if (str.length < 1) return str;\n\n return str[0].toUpperCase() + str.slice(1);\n }", "title": "" }, { "docid": "642bc86db62c11860149d1c443632cf4", "score": "0.61499846", "text": "function n(e){return e.replace(r,function(e,t){return t.toUpperCase()})}", "title": "" }, { "docid": "796d6a4e440c0455726fa989374e7aef", "score": "0.61381084", "text": "function isUpper(value){\n if(value.charCodeAt(0) >= 65 && value.charCodeAt(0) <= 90)\n return after = after.replace(/^\\w/, after[0].toUpperCase())\n else \n return after \n }", "title": "" }, { "docid": "ce02fe98928583046f4d9be70b15c771", "score": "0.6137697", "text": "function capitalize(s) { return s.toUpperCase(); }", "title": "" }, { "docid": "16b3d58adba6c466762f1f6106e872c8", "score": "0.6135987", "text": "static capitalize(input) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n }", "title": "" }, { "docid": "7a99d35ce5ce323afb79401fada85bd2", "score": "0.61275345", "text": "function r(e){if(\"string\"!=typeof e)throw new TypeError(\"expected a string.\");return e=e.replace(/([A-Z])/g,\" $1\"),1===e.length?e.toUpperCase():(e=e.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\\W_]+(\\w|$)/g,function(e,t){return t.toUpperCase()}))}", "title": "" }, { "docid": "77380ce2589944931a3296b71ef80e44", "score": "0.6124981", "text": "function uppercase_first(some_string){\n /*some_string.toLowerCase();*/ //Change all to lowercase\n return some_string.charAt(0).toUpperCase() + some_string.slice(1);\n}", "title": "" }, { "docid": "bc1abd18fbf3546e9f8f326c807a1e21", "score": "0.6123285", "text": "function caseTester(word) {\n if (word[0] === word[0].toUpperCase()) {\n console.log(\"The first letter is uppercase = \" + word);\n } else {\n console.log(\"The first letter is lowercase = \" + word);\n }\n}", "title": "" }, { "docid": "bf9054b5997676b98697a5ff015679d7", "score": "0.61204803", "text": "uppercase(...words) {\n return words.map((word) => word.toUpperCase());\n }", "title": "" }, { "docid": "7c528289d9073240e085f4dffbfe486f", "score": "0.6113625", "text": "function capitalizeWord(string) {\nvar arr = [];\nvar yarr = [];\n arr.push(string.slice(0,1));\n yarr.push(string.slice(1));\n return arr[0].toUpperCase() + yarr[0];\n}", "title": "" }, { "docid": "4c6b90877fdfd50c41e6cec7e5129642", "score": "0.61100566", "text": "function capitalizeAll(sentence){\n sentence = sentence.replace(sentence[0], sentence[0].toUpperCase()) //captializes first char\n return sentence.replace(/\\s\\w/gi, letter => letter.toUpperCase()) //replaces every char after a space **bind the substring to the function in which it's firing, 'this'**\n //console.log(sentence.replace(/\\s\\w/gi, letter => letter.toUpperCase()))\n}", "title": "" }, { "docid": "7dc0386a0322ff01ca06f15b12f4b7be", "score": "0.61053336", "text": "function upperFirst(mySentence) {\n let splitString = mySentence.split(\" \")\n let capitalizedArray = []\n for (let i = 0; i < splitString.length; i++) {\n capitalizedArray.push(splitString[i].charAt(0).toUpperCase() + splitString[i].slice(1))\n }\n return capitalizedArray.join(\" \")\n}", "title": "" }, { "docid": "c6ab99ba7a5f18ecf1d9e3fc67188b7c", "score": "0.61015856", "text": "static capitalize(string) {\n // return string.charAt(0)\n return string[0].toUpperCase() + string.slice(1)\n }", "title": "" } ]
ea8152b87c101fd5ef03d10f6d3a7e2c
Canvasspecific functions These functions involve changing the size of the canvas and resizing that, so pixelations are possible.
[ { "docid": "3d57b11f93a733fd25427c4ca02cdadf", "score": "0.0", "text": "function pixelate(degree) {\n let size = degree / 100,\n w = c.width * size,\n h = c.height * size;\n\n ctx.drawImage(img, 0, 0, w, h);\n\n ctx.msImageSmoothingEnabled = false;\n ctx.webkitImageSmoothingEnabled = false;\n ctx.imageSmoothingEnabled = false;\n\n ctx.drawImage(c, 0, 0, w, h, 0, 0, c.width, c.height);\n\n }", "title": "" } ]
[ { "docid": "31ab65ef27ec0733588188b4b303402a", "score": "0.7441982", "text": "resizeFunc() {\n // this.canvas.height = Math.round(window.innerHeight * 0.9);\n // // console.log(`cavas height is ${this.canvas.height} and mod2 is ${this.canvas.height % 2}`);\n // this.canvas.height -= this.canvas.height % 2;\n // this.canvas.width = Math.round(window.innerWidth * 0.9);\n // // console.log(`cavas height is ${this.canvas.width} and mod2 is ${this.canvas.width % 2}`);\n // this.canvas.width -= this.canvas.width % 2;\n // // console.log(`resize triggered width:${this.canvas.width},height: ${this.canvas.height}`);\n this.fitShapesToCanvas(this.canvas, this.globalGameState);\n this.drawShapes(this.globalGameState.shapes);\n }", "title": "" }, { "docid": "fc02a47249f5c0d6e5c490d62cfe5122", "score": "0.7324553", "text": "function cnv2Resize() {\n canvas.width = window.innerWidth*19/20;\n canvas.height = window.innerHeight*19/40;\n\n initBtnEL();\n\n render();\n}", "title": "" }, { "docid": "4e5419145b5e15545ea6de3a153f1979", "score": "0.72458607", "text": "_adjustCanvasSize () {\n const width = this._canvas.offsetWidth * window.devicePixelRatio\n const height = this._canvas.offsetHeight * window.devicePixelRatio\n\n if (this._canvas.width !== width) {\n this._canvas.width = width\n }\n\n if (this._canvas.height !== height) {\n this._canvas.height = height\n }\n }", "title": "" }, { "docid": "27286ee222a1226dac618be1c3309178", "score": "0.72417253", "text": "function adjustCanvasSize() {\n\tif (window.innerHeight >= window.innerWidth * (3/4)) {\n\t\tvar s = window.innerWidth;\n\t\tvar t = Math.floor(s * (3/4));\n\t\tModule.setCanvasSize(s * resModifier, t * resModifier);\n\t\tcanvasMask.style.width = s + \"px\";\n\t\tcanvasMask.style.height = t + \"px\";\n\t} else {\n\t\tvar s = window.innerHeight;\n\t\tvar t = Math.floor(s * (4/3));\n\t\tModule.setCanvasSize(t * resModifier, s * resModifier);\n\t\tcanvasMask.style.width = t + \"px\";\n\t\tcanvasMask.style.height = s + \"px\";\n\t}\n}", "title": "" }, { "docid": "8700b975b05eb7022dc9a357f85eff07", "score": "0.71829337", "text": "function resizeCanvas() {\n let canvas = document.getElementById(\"c\");\n const ctx = canvas.getContext(\"2d\");\n w = canvas.width = window.innerWidth * 0.95;\n h = canvas.height = window.innerHeight * 0.65;\n }", "title": "" }, { "docid": "594fbdbff0b8f1edffbc222185007b81", "score": "0.71779233", "text": "function correctCanvasSize() {\n // set global variables to proper sizes\n width = window.innerWidth;\n height = window.innerHeight;\n center = [parseInt(width/2), parseInt(height/2)];\n canvas.width = width;\n canvas.height = height;\n edge_pixels = (width+height)*2;\n offset_increment = edge_pixels*(speed/edge_pixels);\n}", "title": "" }, { "docid": "15cd884e099d38199976e022997a5b3b", "score": "0.7171408", "text": "_updateCanvasSize()\n {\n this.canvas.width = this.config.container.clientWidth;\n this.canvas.height = this.config.container.clientHeight;\n }", "title": "" }, { "docid": "3c46d90091c4aa6c8db9be522ec46105", "score": "0.71305364", "text": "calculateCanvas(){\n\n\n if(screen.height < screen.width) {\n this.canvas.height = screen.height;\n let coefficient = screen.height/768;\n this.canvas.width = coefficient * 1024;\n this.Utils.SCALE = 420 * coefficient;\n }else{\n this.canvas.width = screen.width;\n let coefficient = screen.width/1024;\n this.canvas.height = coefficient * 768;\n this.Utils.SCALE = 420 * coefficient;\n }\n\n\n }", "title": "" }, { "docid": "652796e2bf396319349c19bb05c1c6a3", "score": "0.7102608", "text": "function updateCanvasSize() {\n w = window.innerWidth;\n h = window.innerHeight;\n canvas.width = w;\n canvas.height = h;\n bandSize = h / 8;\n}", "title": "" }, { "docid": "f04266e614da4048fd9d16606a598988", "score": "0.71002233", "text": "function resize_canvas() {\n\t\tconst s = Math.min(window.innerHeight, window.innerWidth) - 10;\n\t\tcanvas_elem.width = s;\n\t\tcanvas_elem.height = s;\n\t}", "title": "" }, { "docid": "126aec0e444c31e86c9cc1cb44331285", "score": "0.7069436", "text": "function resizeCanvas()\n\t\t\t\t\t{\n\t\t\t\t\t\tcontext.fillStyle = \"rgb(0,0,0)\";\n\t\t\t\t\t\tcanvasWidth = 500;\n\t\t\t\t\t\tcanvasHeight = 500;\n\t\t\t\t\t\tcontext.fillRect(0,0,canvasWidth,canvasHeight);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}", "title": "" }, { "docid": "74589e60e37c355c1e2a7489521c1b4c", "score": "0.7068743", "text": "function canvasResize(){\n canvas.height = canvas.offsetHeight;\n canvas.width = canvas.offsetWidth;\n }", "title": "" }, { "docid": "afe577cd4278ee7d46f93e9ec49a924a", "score": "0.70525163", "text": "function resizeCanvas(){\r\n \tif(canvasContainer!=undefined){\r\n\t\tcanvasContainer.scaleX=canvasContainer.scaleY=scalePercent;\r\n\t}\r\n}", "title": "" }, { "docid": "cfc8e3087d6de3b1b8cfe0b3d0b0d586", "score": "0.7049659", "text": "function resize_canvas(){\n c.width = window.innerWidth;\n c.height = window.innerHeight;\n width = c.width;\n height = c.height;\n}", "title": "" }, { "docid": "bd73a94a11447da57e99417e8891014a", "score": "0.70455706", "text": "function adjustCanvas() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n //Change values based on the canvas size\n adjustValues();\n}", "title": "" }, { "docid": "745dd9bc0c235fe0996c3c036000e7c0", "score": "0.7039901", "text": "resizeCanvas(): void {\n let config: ImageViewerConfigType = this.getCurrentViewerConfig();\n // TODO: make this configurable\n let sideBarWidth = this.state.layout.toolbarWidth;\n let windowSize = $(window).width() - 11 - sideBarWidth;\n let splitBarWidth = 4;\n let newWidth = 0;\n if (this.state.layout.assistantView) {\n windowSize -= splitBarWidth;\n let ratio = this.isAssistantView ? this.state.layout.assistantViewRatio :\n 1 - this.state.layout.assistantViewRatio;\n newWidth = Math.round(windowSize * ratio);\n } else {\n newWidth = this.isAssistantView ? 0 : windowSize;\n }\n this.divCanvas.style.width = sprintf('%dpx', newWidth);\n this.setCanvasSize(config);\n }", "title": "" }, { "docid": "60b492581e0b8b183d01768f0b97b23a", "score": "0.7020818", "text": "function setupCanvasSize() {\n\tmaxWidth = window.innerWidth;\n\tmaxHeight = window.innerHeight;\n\thalfWidth = maxWidth / 2;\n\thalfHeight = maxHeight / 2;\n\t\n\tcanvas.width = maxWidth;\n\tcanvas.height = maxHeight;\n}", "title": "" }, { "docid": "c96749d0cd74692ef6d98fec9509517f", "score": "0.7020521", "text": "resizeCanvases() {\n\t\tthis.getAllCanvases().forEach(canvas => {\n\t\t\tDomHelper.setCanvasSize(\n\t\t\t\tcanvas,\n\t\t\t\tthis.renderDimensions.windowWidth,\n\t\t\t\tMath.max(\n\t\t\t\t\tthis.renderDimensions.whiteKeyHeight,\n\t\t\t\t\tthis.renderDimensions.blackKeyHeight\n\t\t\t\t)\n\t\t\t)\n\t\t})\n\t\tthis.repositionCanvases()\n\t}", "title": "" }, { "docid": "df0763920a918e17640945cd5ff9e009", "score": "0.70130587", "text": "function resizeCanvas() {\n canvas.attr(\"width\", vw);\n canvas.attr(\"height\", vh);\n}", "title": "" }, { "docid": "564514e6e775758579b8e5963c62302b", "score": "0.6999846", "text": "function resizeCanvas() {\n\t\t//reset the canvas dimensions first.\n\t\tc.width = window.innerWidth;\n\t\tc.height = window.innerHeight;\n\t\twidth = c.width;\n\t\theight = c.height;\n\t\tcat.x = width - cat.width;\n\t\tcat.y = height - cat.height;\n\t\teyeL.x = cat.x + cat.width - 322;\n\t\teyeL.y = cat.y + cat.height - 248;\n\t\teyeR.x = cat.x + cat.width - 179;\n\t\teyeR.y = cat.y + cat.height - 227;\n\t\tcat.weapon.l1s.x = eyeL.x;\n\t\tcat.weapon.l1s.y = eyeL.y;\n\t\tcat.weapon.l2s.x = eyeR.x;\n\t\tcat.weapon.l2s.y = eyeR.y;\n\t\t//make sure the starField function knows how big...\n\t\t//the new canvas is by re-calling starFieldInit();\n\t\tstarFieldInit();\n\t\trender();\n\t}", "title": "" }, { "docid": "141c9996e69559505af9bc3c57500ac0", "score": "0.6993067", "text": "function resizeCanvases() {\n\t imageCanvas.width = lineCanvas.width = element.clientWidth;\n\t imageCanvas.height = lineCanvas.height = element.clientHeight;\n\t}", "title": "" }, { "docid": "7be6094f3672a8ba188654966a01329c", "score": "0.69804", "text": "function resizeCanvases() {\n\t offset = $(\"#imageCanvas\" + element.id).offset();\n\t //console.log(offset)\n\t imageCanvas.width = lineCanvas.width = element.clientWidth;\n\t imageCanvas.height = lineCanvas.height = element.clientHeight;\n\t}", "title": "" }, { "docid": "ffcd243ea72019814b490c7a40c1891b", "score": "0.69673043", "text": "function resize() {\n \t// Our canvas must cover full height of screen regardless of the resolution\n \tvar height = window.innerHeight;\n \t// So we need to calculate the proper scaled width that should work well with every resolution\n \tvar ratio = canvas.width/canvas.height;\n \tvar width = height * ratio;\n \tcanvas.style.width = width+'px';\n \tcanvas.style.height = height+'px';\n }", "title": "" }, { "docid": "ffcd243ea72019814b490c7a40c1891b", "score": "0.69673043", "text": "function resize() {\n \t// Our canvas must cover full height of screen regardless of the resolution\n \tvar height = window.innerHeight;\n \t// So we need to calculate the proper scaled width that should work well with every resolution\n \tvar ratio = canvas.width/canvas.height;\n \tvar width = height * ratio;\n \tcanvas.style.width = width+'px';\n \tcanvas.style.height = height+'px';\n }", "title": "" }, { "docid": "ffcd243ea72019814b490c7a40c1891b", "score": "0.69673043", "text": "function resize() {\n \t// Our canvas must cover full height of screen regardless of the resolution\n \tvar height = window.innerHeight;\n \t// So we need to calculate the proper scaled width that should work well with every resolution\n \tvar ratio = canvas.width/canvas.height;\n \tvar width = height * ratio;\n \tcanvas.style.width = width+'px';\n \tcanvas.style.height = height+'px';\n }", "title": "" }, { "docid": "fa7d36a121ece0386f95e037f6c04757", "score": "0.69529593", "text": "function resizeCanvas() {\n\tlet clientWidth = document.getElementById('canvaswrapper').clientWidth;\n\twidth = clientWidth;\n\theight = width / 1.5;\n\tcanvas.width = width;\n\tcanvas.height = height;\n\tchartwidth = width / 6 * 5;\n\tchartheight = height * 0.75;\n\tcan_margin = height - chartheight;\n\tcol_margin = chartheight / 17;\n\tcol_width = chartwidth / 34;\n\tdraw();\n}", "title": "" }, { "docid": "e73b68b7e351afffc8603e2098251a00", "score": "0.6944853", "text": "function resizeCanvas() {\n\t\t//console.log(\"resized\");\n\t\t\n\t\ttheWidth = window.innerWidth;\n\t\ttheHeight = window.innerHeight;\n\t\tmainCanvas.width = theWidth;\n\t\tmainCanvas.height = theHeight;\n\t\n\t\tsetupCircles();\n\t}", "title": "" }, { "docid": "e73b68b7e351afffc8603e2098251a00", "score": "0.6944853", "text": "function resizeCanvas() {\n\t\t//console.log(\"resized\");\n\t\t\n\t\ttheWidth = window.innerWidth;\n\t\ttheHeight = window.innerHeight;\n\t\tmainCanvas.width = theWidth;\n\t\tmainCanvas.height = theHeight;\n\t\n\t\tsetupCircles();\n\t}", "title": "" }, { "docid": "f6efbcb72e1f576ce837af65a009bba7", "score": "0.6925236", "text": "function Update_Canvas_Height_Width() {\n // var Container_Main_Canvas_Width = document.getElementById(\"Canvas_Row\").clientWidth;\n // var Container_Main_Canvas_Height = document.getElementById(\"fractal_canvas\").width;\n // document.querySelector('#fractal_canvas').width = Container_Main_Canvas.offsetWidth;\n // document.querySelector('#fractal_canvas').height = Math.round(Container_Main_Canvas.width * aspect);\n\n\n\n //this changes the canvas as the page is adjusted, should keep the aspect ratio\n canvas.style.width = '100%';\n canvas.style.height = '100%';\n canvas.width = canvas.offsetWidth;\n canvas.height = canvas.offsetHeight;\n //renderer.setSize(canvas.width, canvas.height);\n\n}", "title": "" }, { "docid": "b09a7cc06b4661d5d799effebe88ccfc", "score": "0.69240487", "text": "function resizeCanvas() {\n // Get external canvas size:\n canvasStyle = window.getComputedStyle(canvasElement);\n canvasWidth = Math.max(parseInt(canvasStyle.width, 10), 1);\n canvasHeight = Math.max(parseInt(canvasStyle.height, 10), 1);\n\n // Resize off-screen buffer:\n canvasRender.width = canvasWidth;\n canvasRender.height = canvasHeight;\n\n // Resize pinch&zoom canvas:\n canvasShow.style.width = canvasWidth;\n canvasShow.style.height = canvasHeight;\n canvasShow.setAttribute(\"width\", canvasWidth);\n canvasShow.setAttribute(\"height\", canvasHeight);\n }", "title": "" }, { "docid": "ea2fffe5c5145f48996ed8bbef423576", "score": "0.6917949", "text": "function rescaleCanvas() {\r\n let canWidth = $('body').width()\r\n let canHeight = $('body').height()\r\n $('#can').attr(\"width\", canWidth)\r\n $('#can').attr(\"height\", canHeight)\r\n}", "title": "" }, { "docid": "ce61ca90b3871fbcd28667f663dc6003", "score": "0.6913201", "text": "function resizeCanvas() {\r\n // When zoomed out to less than 100%, for some very strange reason,\r\n // some browsers report devicePixelRatio as less than 1\r\n // and only part of the canvas is cleared then.\r\n var ratio = Math.max(window.devicePixelRatio || 1, 1);\r\n canvas.width = canvas.offsetWidth * ratio;\r\n canvas.height = canvas.offsetHeight * ratio;\r\n canvas.getContext(\"2d\").scale(ratio, ratio);\r\n var ctx = canvas.getContext(\"2d\");\r\n ctx.fillStyle = 'rgb(255, 255, 255)';\r\n ctx.fillRect(0, 0, canvas.width, canvas.height); \r\n\r\n \r\n\r\n}", "title": "" }, { "docid": "a61ecb7ea4b8add0abbd3b5e4b1bf576", "score": "0.68934506", "text": "function adjust_canvas(init){\n var self = this;\n\t\t// get canvas settings\n var settings = settingsGetter('canvas') || {};\n\n\t\t// calculate proportions (as height/width)\n var proportions;\n if (settings.proportions) {\n if ($.isPlainObject(settings.proportions)) {\n if (typeof settings.proportions.height !== 'number' || typeof settings.proportions.width !== 'number'){\n throw new Error('The canvas proportions object`s height and a width properties must be numeric');\n }\n proportions = settings.proportions.height/settings.proportions.width; // if proportions are an object they should include width and height\n } else {\n proportions = settings.proportions || 0.8; // by default proportions are 0.8\n }\n }\n\n\t\t// we put this in a time out because of a latency of orientation change on android devices\n setTimeout(resize,init ? 0 : 500); // end timeout\n\n function resize(){\n var height, width;\n var $canvas = self.$el;\n\n\t\t\t// static canvas size\n if (settings.width){\n\t\t\t\t// if this is not init, we've already set screen size, so don't mess around\n if (!init){\n return true;\n }\n\n width = settings.width;\n height = width*proportions;\n\n } else { // dynamic canvas size\n\t\t\t\t// get current screen size\n var screenSize = {\n width: $(window).innerWidth(),\n height: $(window).innerHeight()\n };\n\n var maxHeight = screenSize.height;\n var maxWidth = Math.min(settings.maxWidth, screenSize.width, $canvas.parent().innerWidth());\n\n\t\t\t\t// calculate the correct size for this screen size\n if (maxHeight > proportions * maxWidth) {\n height = maxWidth*proportions;\n width = maxWidth;\n } else {\n height = maxHeight;\n width = maxHeight/proportions;\n }\n }\n\n\t\t\t// remove border width and top margin from calculated width (can't depend on cool box styles yet...)\n\t\t\t// we compute only margin-top because of a difference calculating margins between chrome + IE and firefox + mobile\n height -= parseInt($canvas.css('border-top-width'),10) + parseInt($canvas.css('border-bottom-width'),10) + parseInt($canvas.css('margin-top'),10);\n width -= parseInt($canvas.css('border-left-width'),10) + parseInt($canvas.css('border-right-width'),10);\n\n\t\t\t// reset canvas size\n $canvas.width(width);\n $canvas.height(height);\n $canvas.css('font-size',height*(settings.textSize || 3)/100);\n\n\t\t\t// refresh all stimuli (we don't want to do this before we have trials)\n if (trial()) {\n trial()._layout_collection.refresh();\n trial()._stimulus_collection.refresh();\n }\n\n\t\t\t// scroll to top of window (hides some of the mess on the top of mobile devices)\n window.scrollTo(0, 1);\n }\n }", "title": "" }, { "docid": "741e11ac441cb0cdf38bc6ff8900de4d", "score": "0.6876862", "text": "function resizeCanvas() {\n\tvar newHeight = window.innerHeight;\n\tvar newWidth = initWidth/initHeight * newHeight;\n\tcanvas.setWidth(newWidth);\n\tcanvas.setHeight(newHeight);\n\tcanvas.calcOffset();\n}", "title": "" }, { "docid": "117f856f244dc6bd310f3b573d999941", "score": "0.6872813", "text": "function resizeCanvas() {\r\n c.width = window.innerWidth;\r\n c.height = window.innerHeight;\r\n redraw();\r\n}", "title": "" }, { "docid": "9f15d143b0f999a7869585b3454e442d", "score": "0.6871402", "text": "function updateSize() {\n\t\t//$log.log(preDebugMsg + \"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\tvar bgDirty = false;\n\t\tif(bgCanvas === null) {\n\t\t\tbgDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tbgCanvas = 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\tif(bgCanvas.width != rw) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.width = rw;\n\t\t}\n\t\tif(bgCanvas.height != rh) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.height = rh;\n\t\t}\n\n\t\tvar dotDirty = false;\n\t\tif(dotCanvas === null) {\n\t\t\tdotDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theDotCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tdotCanvas = 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\tif(dotCanvas.width != rw) {\n\t\t\tdotDirty = true;\n\t\t\tdotCanvas.width = rw;\n\t\t}\n\t\tif(dotCanvas.height != rh) {\n\t\t\tdotDirty = true;\n\t\t\tdotCanvas.height = rh;\n\t\t}\n\n\t\tif(undotCanvas === null) {\n\t\t\tundotDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theUnselectedDotCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tundotCanvas = 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\tif(undotCanvas.width != rw) {\n\t\t\tundotDirty = true;\n\t\t\tundotCanvas.width = rw;\n\t\t}\n\t\tif(undotCanvas.height != rh) {\n\t\t\tundotDirty = true;\n\t\t\tundotCanvas.height = rh;\n\t\t}\n\n\t\tvar axesDirty = false;\n\t\tif(axesCanvas === null) {\n\t\t\taxesDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theAxesCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\taxesCanvas = 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\tif(axesCanvas.width != rw) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.width = rw;\n\t\t}\n\t\tif(axesCanvas.height != rh) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.height = rh;\n\t\t}\n\n\n\t\tif(dropCanvas.width != rw) {\n\t\t\tdropCanvas.width = rw;\n\t\t}\n\t\tif(dropCanvas.height != rh) {\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\n\t\tvar W = selectionCanvas.width;\n\t\tvar H = selectionCanvas.height;\n\t\tdrawW = W - leftMarg - rightMarg;\n\t\tdrawH = H - topMarg - bottomMarg * 2 - fontSize;\n\n\t\t//$log.log(preDebugMsg + \"updateSize found selections: \" + JSON.stringify(selections));\n\t\tupdateSelectionsWhenZoomingOrResizing();\n\t\tupdateDropZones(textColor, 0.3, false);\n\t\t//$log.log(preDebugMsg + \"updateSize updated selections to: \" + JSON.stringify(selections));\n\t}", "title": "" }, { "docid": "2b505b55ac7e8c33d4c6cf775f67445d", "score": "0.68690354", "text": "function resize(){\r\n\t\tcanvas.width = w = this.innerWidth;\r\n\t\tcanvas.height = h = this.innerHeight;\r\n\t}", "title": "" }, { "docid": "a28582e589c65a7eb3cd6f203d0d8076", "score": "0.6861022", "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": "0ed52ad9f1b5f34b693b0c207da17b95", "score": "0.6857577", "text": "function resize() {\n canvas.width = 1920;\n canvas.height = 1000;\n}", "title": "" }, { "docid": "a85b4fa040d47622722d19c065aaab72", "score": "0.6854813", "text": "function canvasResize(){\n\t\t\t\t\t\tscreenWidth = window.innerWidth;\n\t\t\t\t\t\tscreenHeight = window.innerHeight;\n\n\t\t\t\t\t\tcanvasPosition = canvas.getBoundingClientRect(); // Gets the canvas position\n\t\t\t\t\t\tcanvas.width = screenWidth;\n\t\t\t\t\t\tcanvas.height = screenHeight;\n\t\t\t\t\t}", "title": "" }, { "docid": "3e14dcb35e5d1dbe8f39b736b212be77", "score": "0.68456155", "text": "function resizeCanvas() {\r\n canvas.width = 0.75 * window.innerWidth;\r\n canvas.height = 0.75 * window.innerHeight;\r\n}", "title": "" }, { "docid": "4ce0045995d50983264416c6d64aec40", "score": "0.6841204", "text": "function fixCanvas() {\n \n const newHeight = +getComputedStyle(canvas).getPropertyValue(\"height\").slice(0, -2);\n const newWidth = +getComputedStyle(canvas).getPropertyValue(\"width\").slice(0, -2);\n\n canvas.setAttribute('height', newHeight * scale);\n canvas.setAttribute('width', newWidth * scale);\n\n}", "title": "" }, { "docid": "ead8207dbdfb3e4ba29abfd629933609", "score": "0.68143165", "text": "function resize(){\n c.width = (c.clientWidth)\n c.height= (c.clientHeight)\n ctx = c.getContext('2d')\n padding = calcPadding()\n createBlocks()\n draw()\n }", "title": "" }, { "docid": "542d24771547f4a589daee92ee7cd9b0", "score": "0.68135333", "text": "function resizeCanvas() {\n // When zoomed out to less than 100%, for some very strange reason, some browsers report devicePixelRatio as less than 1 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": "5fa88c637b0060a5cd812f84e27964dc", "score": "0.6804876", "text": "responsive(canvas) {\n let container = document.getElementsByClassName(\"canvas__container\")[0];\n let width = container.offsetWidth;\n let height = container.offsetHeight;\n let widthn = width;\n let heightn = height;\n canvas.setDimensions({\n width: widthn,\n height: heightn\n });\n }", "title": "" }, { "docid": "9751079d126c3746b981f6763eb975b0", "score": "0.6792111", "text": "UpdatePaintCanvasSize(){\r\n\t\tif(this.paintCanvas == null) return;\r\n\t\t\r\n\t\tif(this.paintCanvas.width != this.width || this.paintCanvas.height != this.height){\r\n\t\t\tthis.paintCanvas.width = this.width;\r\n\t\t\tthis.paintCanvas.height = this.height;\r\n\t\t\tglext.ResizeCanvas(this.width, this.height);\r\n\t\t\t\r\n\t\t\tlet dw = this.width - this.getActivePaintLayer().width;\r\n\t\t\tlet dh = this.height - this.getActivePaintLayer().height;\r\n\t\t\t\r\n\t\t\tthis.getActivePaintLayer().ResizeCanvas(Math.floor(dw/2.0), Math.floor(dw/2.0), Math.ceil(dh/2.0), Math.ceil(dh/2.0));\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "48d3bbae2ca63f9d58bf836ae20bced8", "score": "0.6784563", "text": "function resizeCanvas() {\n\t\t// get window size\n\t\tvar windowWidth = $(window).innerWidth();\n\t\tvar windowHeight = $(window).innerHeight();\n\t\t// track if changed\n\t\tvar hasChanged = false;\n\t\tif (canvas.width != windowWidth) {\n\t\t\t// update width on change\n\t\t\tcanvas.setAttribute('width', parseInt(windowWidth));\n\t\t\thasChanged = true;\n\t\t}\n\t\tif (canvas.height != windowHeight) {\n\t\t\t// update height on change\n\t\t\thasChanged = true;\n\t\t\tcanvas.setAttribute('height', parseInt(windowHeight));\n\t\t}\n\t\t// clear computed settings on change\n\t\tif (hasChanged) {\n\t\t\tcomputeSettings();\n\t\t}\n\t}", "title": "" }, { "docid": "910e7b6fa01bd93aaa1f3782eedaa714", "score": "0.6773207", "text": "resizeCanvas() {\n // fix weird height glitch\n var scale = RayTracer.isRetina() ? 2 : 1;\n var canvas = this.$canvas.get(0);\n canvas.width = this.$canvas.width() * scale;\n canvas.height = this.$canvas.height() * scale;\n this.gl.viewport(0, 0, canvas.width, canvas.height);\n }", "title": "" }, { "docid": "99c823056437754867b2361311915ec5", "score": "0.67587346", "text": "function resizeCanvas() {\n context.canvas.width = SCREEN_WIDTH;\n context.canvas.height = SCREEN_HEIGHT;\n }", "title": "" }, { "docid": "2e30da3b5dcee71b04e34ce09a0553e2", "score": "0.67458606", "text": "function resize(){\n c.width = parseInt($('#myCanvas').css('width'));\n $('#myCanvas').css('height', function(){\n return Math.floor(c.width*floors[currentFloor].height/floors[currentFloor].width);\n });\n c.height = parseInt($('#myCanvas').css('height'));\n $('svg').attr({'width':c.width,'height':c.height});\n $('svg').css({'width':c.width,'height':c.height});\n ctx.clearRect(0,0,c.width,c.height);\n ctx.drawImage(can[currentFloor], shiftX, shiftY, can[currentFloor].width/currentZoom,\n can[currentFloor].height/currentZoom, 0,0,c.width,c.height);\n }", "title": "" }, { "docid": "8d43a247cde6cb6bcca8a822146aaa78", "score": "0.67458504", "text": "function resize() {\r\n\t\tcanvas.width = w = this.innerWidth;\r\n\t\tcanvas.height = h = this.innerHeight;\r\n\t}", "title": "" }, { "docid": "457653afb673471d8677f832ebce65ce", "score": "0.6738506", "text": "function setCanvasSize() {\n c.width = window.innerWidth * 0.98;\n cellWidth = c.width / width;\n cellHeight = cellWidth * 1.62;\n c.height = height * cellHeight;\n}", "title": "" }, { "docid": "895abf9d3775e0b0e7d34f99f324abf2", "score": "0.6735411", "text": "function init_canvas(){\n var canvas_style = window.getComputedStyle(document.getElementById(\"canvas\"))\n initial_canvas_width = parseInt(canvas_style.width ,10);\n initial_canvas_height = parseInt(canvas_style.height,10);\n console.log(\"init_canvas\");\n var ro = new ResizeObserver(entries =>{\n entry = entries[0];\n new_canvas_width = entry.contentRect.width;\n new_canvas_height = entry.contentRect.height;\n })\n}", "title": "" }, { "docid": "fae49a9adf70267049594f13d80049cb", "score": "0.67319417", "text": "resizeCanvas() {\n this.canvas.width = this.canvas.clientWidth;\n this.canvas.height = this.canvas.clientHeight;\n }", "title": "" }, { "docid": "9f06e1121bb82eae0c6e82c7351df526", "score": "0.67307425", "text": "function resizeCanvas() {\n /*canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n stateScreenOffsetX = canvas.width / 2 - 400;\n stateScreenOffsetY = canvas.height / 2 - 300; */\n}", "title": "" }, { "docid": "062572e45959ae7979fb9073a5cbd0ff", "score": "0.67299706", "text": "function resizeCanvas() {\n var ratio = window.devicePixelRatio || 1;\n canvas.width = canvas.offsetWidth * ratio;\n canvas.height = canvas.offsetHeight * ratio;\n canvas.getContext('2d').scale(ratio, ratio);\n }", "title": "" }, { "docid": "e8f46b5921c3ac2fd40d45af51c143a9", "score": "0.6729559", "text": "resize () {\n this.canvas.width = this.board.sizeX * this.board.tileWidth\n this.canvas.height = this.board.sizeY * this.board.tileWidth\n }", "title": "" }, { "docid": "88172284cc96ed4b3ab101341fa984bb", "score": "0.6721254", "text": "resize() {\n this.canvas.element.style.width = '100%';\n this.canvas.element.style.height = '100%';\n this.canvas.element.width = this.canvas.element.offsetWidth * window.devicePixelRatio;\n this.canvas.element.height = this.canvas.element.offsetHeight * window.devicePixelRatio;\n this.canvas.width = this.canvas.element.offsetWidth;\n this.canvas.height = this.canvas.element.offsetHeight;\n this.canvas.context.scale(window.devicePixelRatio, window.devicePixelRatio);\n }", "title": "" }, { "docid": "4d8726c1d72c4651f08259e87ada05f6", "score": "0.67104876", "text": "function resizeCanvas() {\n //ajustement de la taille du canvas en fonction des dimensions de l'écran\n canvas.style.left = window.innerWidth * 0.125 + \"px\";\n canvas.width = window.innerWidth * 0.5;\n canvas.height = window.innerWidth * 0.5;\n canvasCanon.style.left = window.innerWidth * 0.125 + \"px\";\n canvasCanon.width = window.innerWidth * 0.5;\n canvasCanon.height = window.innerWidth * 0.5;\n\n //redéfinition de la largeur et de la longueur du canvas\n axeX = canvas.width;\n axeY = canvas.height;\n\n //redéfinition des caractéristiques du canon\n CANON_WIDTH = axeX / 4;\n CANON_HEIGHT = axeY / 4;\n CANON_X = (axeX / 2) - (CANON_WIDTH / 2);\n CANON_Y = (axeY / 2) - (CANON_HEIGHT / 2);\n\n //redéfinition du chemin\n chemin = Array();\n chemin.push({x : (3.25 / 12) * axeX, y: (6.25 / 12) * axeY,});\n chemin.push({x : (2.75 / 12) * axeX, y: (6.5 / 12) * axeY,});\n chemin.push({x : (2.5 / 12) * axeX, y: (7 / 12) * axeY,});\n chemin.push({x : (2.5 / 12) * axeX, y: (8 / 12) * axeY,});\n chemin.push({x : (2.75 / 12) * axeX, y: (9 / 12) * axeY,});\n chemin.push({x : (3 / 12) * axeX, y: (9.25 / 12) * axeY,});\n chemin.push({x : (3.75 / 12) * axeX, y: (9.5 / 12) * axeY,});\n chemin.push({x : (6 / 12) * axeX, y: (9.5 / 12) * axeY,});\n chemin.push({x : (8.5 / 12) * axeX, y: (9 / 12) * axeY,});\n chemin.push({x : (9 / 12) * axeX, y: (8 / 12) * axeY,});\n chemin.push({x : (9.125 / 12) * axeX, y: (4 / 12) * axeY,});\n chemin.push({x : (9 / 12) * axeX, y: (2.75 / 12) * axeY,});\n chemin.push({x : (7 / 12) * axeX, y: (2.25 / 12) * axeY,});\n chemin.push({x : (3.75 / 12) * axeX, y: (2.25 / 12) * axeY,});\n chemin.push({x : (2.75 / 12) * axeX, y: (2.5 / 12) * axeY,});\n chemin.push({x : (2.5 / 12) * axeX, y: (3 / 12) * axeY,});\n chemin.push({x : (2.25 / 12) * axeX, y: (4 / 12) * axeY,});\n chemin.push({x : (2.5 / 12) * axeX, y: (4.5 / 12) * axeY,});\n chemin.push({x : (3.25 / 12) * axeX, y: (5.125 / 12) * axeY,});\n}", "title": "" }, { "docid": "9548cdd54738dec6a3a451b11adfa360", "score": "0.66975415", "text": "function resizeCanvas() {\n\t\tvar ratio = window.devicePixelRatio || 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": "38558f97d423846d6c45d808722fd1a9", "score": "0.66940665", "text": "function canvasAdjustment(){\n\t\t\t\t // finally query the various pixel ratios\n\t\t\t var devicePixelRatio = window.devicePixelRatio || 1;\n\t\t\t //console.log(devicePixelRatio);\n\t\t\t var backingStoreRatio = ctx.webkitBackingStorePixelRatio ||\n\t\t\t\t ctx.mozBackingStorePixelRatio ||\n\t\t\t\t ctx.msBackingStorePixelRatio ||\n\t\t\t\t ctx.oBackingStorePixelRatio ||\n\t\t\t\t ctx.backingStorePixelRatio || 1;\n\n\t\t\t\t ratio = devicePixelRatio / backingStoreRatio;\n\t\t\t\t //console.log(ratio);\n\t\t\t\t \n\t\t\t\t // upscale the canvas if the two ratios don't match\n\t\t\t\t\t if (devicePixelRatio !== backingStoreRatio) {\n\n\t\t\t\t\t var oldWidth = canvas.width;\n\t\t\t\t\t var oldHeight = canvas.height;\n\n\t\t\t\t\t canvas.width = oldWidth * ratio;\n\t\t\t\t\t canvas.height = oldHeight * ratio;\n\n\t\t\t\t\t canvas.style.width = oldWidth + 'px';\n\t\t\t\t\t canvas.style.height = oldHeight + 'px';\n\n\t\t\t\t\t\t\tctx.scale(ratio, ratio);\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t \t}", "title": "" }, { "docid": "c132ae1151641fa0482812c6481d1c6d", "score": "0.6679181", "text": "function setCanvasSize() {\n ratio = width / height;\n if (window.innerWidth / width < window.innerHeight / height) {\n c.width = window.innerWidth * 0.8;\n c.height = c.width / width * height;\n } else {\n c.height = window.innerHeight * 0.8;\n c.width = c.height / height * width;\n }\n cellSize = c.width / width;\n}", "title": "" }, { "docid": "5da8b640b6fe131d4b6e9f4820f758be", "score": "0.6676924", "text": "function resize_canvas() {\n var w = $(\".patcher_container\").width(),\n h = $(\".patcher_container\").height();\n canvas.width = w;\n canvas.height = h;\n update_canvas();\n}", "title": "" }, { "docid": "43bece8f37abd96d3eb994b3f9328b65", "score": "0.6674223", "text": "function resizeCanvas() {\n cuadrito.width = window.innerWidth - 100;\n cuadrito.height = window.innerHeight - 200;\n redraw();\n }", "title": "" }, { "docid": "f216ad9e8dab4d684e285e2009dc9873", "score": "0.6670457", "text": "function resize() {\n canvas.width = window.innerWidth-100;\n canvas.height = window.innerHeight-100;\n}", "title": "" }, { "docid": "bef16859c410f7b7111b3efabd7517a6", "score": "0.66692364", "text": "adaptCanvas() {\n const rect = document.body.getBoundingClientRect();\n this.canvas.width = rect.width;\n this.canvas.height = rect.height;\n }", "title": "" }, { "docid": "8934f3b7bac2871e64c0a5c7677a2082", "score": "0.66585094", "text": "function resize() {\n\t\t// canvas.width = $(window).width();\n\t\t// canvas.height = $(window).height();\n\t\tcanvas.width = 3000;\n\t\tcanvas.height = 3000;\n\n\t\tctx.fillStyle = \"#fff\"\n\t\tctx.fillRect(0, 0, 3000, 3000)\n\t}", "title": "" }, { "docid": "528cbfe58a47d82751c6e7070a08bcc5", "score": "0.6657573", "text": "function canvasSize(){\n\tcanvas.setAttribute('width',inputwidth.value);\n\tcanvas.setAttribute('height',inputheight.value);\n\n}", "title": "" }, { "docid": "de183e4ccbb203d25e1fde6a0cef496c", "score": "0.66547227", "text": "function resizeCanvas() {\n canvas.width = window.innerWidth * 3;\n canvas.height = window.innerHeight * 3;\n redraw();\n}", "title": "" }, { "docid": "98e0e0bc551c922efcf7fbf276299737", "score": "0.6651501", "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": "98e0e0bc551c922efcf7fbf276299737", "score": "0.6651501", "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": "3bd94ca3c4416ee0a1420b400cc6c76f", "score": "0.66497153", "text": "function resize(e){\n\tvar newWidth = canvas.x + (e.pageX - canvas.offsetLeft) - canvas.x1;\n\tvar newHeight = canvas.y + (e.pageY - canvas.offsetTop) - canvas.y1;\n\t\n\tif(newWidth < 40)\n\t\tinputs[currentIndex() - 1].width = 40;\n\telse if(inputs[currentIndex() - 1].posx + inputs[currentIndex() - 1].width > canvas.width)\n\t\tinputs[currentIndex() - 1].width = canvas.width - inputs[currentIndex() - 1].posx;\n\telse\n\t\tinputs[currentIndex() - 1].width = newWidth;\n\t\t\n\tif(newHeight < 30)\n\t\tinputs[currentIndex() - 1].height = 30;\n\telse if(inputs[currentIndex() - 1].posy + inputs[currentIndex() - 1].height > canvas.height)\n\t\tinputs[currentIndex() - 1].height = canvas.height - inputs[currentIndex() - 1].posy;\n\telse\n\t\tinputs[currentIndex() - 1].height = newHeight;\n}", "title": "" }, { "docid": "7bf44e127661b23d1bb26dc16be6dffd", "score": "0.66291326", "text": "function SizeCanvas()\n{\n with (EPE)\n {\n //Resize the Canvas (because it does not support style)\n var w = parseInt(pad.style.width) - canvas_border * 2;\n var h = parseInt(pad.style.height) - canvas_border * 2;\n\n ResizeCanvas(w, h);\n\n\n EPE_SetDrawing();\n }\n}", "title": "" }, { "docid": "bf7e4f5d083c748a54228ca1f4581137", "score": "0.6624558", "text": "function resize(){\n ctx.canvas.width = window.innerWidth;\n ctx.canvas.height = window.innerHeight;\n }", "title": "" }, { "docid": "70a61e12bc58dd7ab18addb694421007", "score": "0.66235507", "text": "resize() {\n\t\tthis.resizeCanvases()\n\t\tthis.drawPiano(this.ctxWhite, this.ctxBlack)\n\t}", "title": "" }, { "docid": "70a61e12bc58dd7ab18addb694421007", "score": "0.66235507", "text": "resize() {\n\t\tthis.resizeCanvases()\n\t\tthis.drawPiano(this.ctxWhite, this.ctxBlack)\n\t}", "title": "" }, { "docid": "8de60953006cb4d2af6ab2f6ca37c5a3", "score": "0.6612094", "text": "function resizeCanvas(width, height) {\n\tif (!isNaN(width) && width > 0) {\n\t\t// valid width value\n\n\t\t// round to brush size\n\t\twidth = Math.ceil(width/Brush.size)*Brush.size;\n\n\t\t// resize canvases\n\t\tEls.editor.width = width;\n\t\tEls.transparency.width = width;\n\t\tEls.overlay.width = width;\n\t\tEls.template.width = width;\n\t\t// no need for saveCanvas to be resized - it is resized anyway whenever it is used to selection size\n\t}\n\n\tif (!isNaN(height) && height > 0) {\n\t\t// valid height value\n\n\t\t// round to brush size\n\t\theight = Math.ceil(height/Brush.size)*Brush.size;\n\n\t\t// resize canvases\n\t\tEls.editor.height = height;\n\t\tEls.transparency.height = height;\n\t\tEls.overlay.height = height;\n\t\tEls.template.height = height;\n\t\t// no need for saveCanvas to be resized - it is resized anyway whenever it is used to selection size\n\t}\n\n\t// update varibles etc.\n\tinit();\n}", "title": "" }, { "docid": "10ca6c916b03df6ed913a3d1771a0734", "score": "0.66051054", "text": "function changeBgWidth(value){\n\tif(value >= 160){\n\t\tdocument.getElementById(\"canvasContainer\").style.width = (value + \"px\");\n\t\tdocument.getElementById(\"sidebar\").style.left = (parseInt(value) + 20) + 'px';\n\t\tcanvas.width = value;\n\t}\n\telse{\n\t\tcanvas.width = 160;\n\t\tdocument.getElementById(\"canvasContainer\").style.width = (160 + \"px\");\n\t\tdocument.getElementById(\"sidebar\").style.left = ( 180 + \"px\");\n\t}\n\tdocument.getElementById(\"bgwidth\").value = canvas.width;\n\t\n\t//change width of launchContainer to match\n\tdocument.getElementById(\"launchContainer\").style.width = canvas.width + \"px\";\n\tdocument.getElementById(\"transcode\").style.width = (parseInt(canvas.width) - 25) + \"px\";\n\tdocument.getElementById(\"vlm.conf\").style.width = (parseInt(canvas.width) - 25) + \"px\";\n\tdocument.getElementById(\"launchCode\").style.width = (parseInt(canvas.width) - 25) + \"px\";\n\t//resize/move sources whose attributes are too large\n\tif(inputs.length == 0){\n\t\tdraw();\n\t\treturn;\n\t}\n\tvar i;\n\tfor(i = 0; i < inputs.length ; ++i){\n\t\tif(inputs[i].width > canvas.width)\n\t\t\tinputs[i].width = canvas.width;\n\t\tif(inputs[i].height > canvas.height)\n\t\t\tinputs[i].height = canvas.height;\n\t\tboundsCheck(i);\n\t}\n}", "title": "" }, { "docid": "85c8010094387f85e5d959346258f993", "score": "0.6597143", "text": "function resize() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n\n brickWidth = canvas.width / brickColumns;\n}", "title": "" }, { "docid": "6b4ba7da36b0fae3a115da0628f85af6", "score": "0.65962636", "text": "function resizeCanvas() {\n\tcontext.canvas.width = window.innerWidth;\n\tcontext.canvas.height = window.innerHeight;\n}", "title": "" }, { "docid": "8d5cda52381fab49fe5e771698e76f2c", "score": "0.6596038", "text": "function sizeCanvasToScreen()\r\n {\r\n canvas.width = window.innerWidth*.85;\r\n canvas.height = window.innerHeight*.85;\r\n }", "title": "" }, { "docid": "907ee5995f63fbb57fa6fd2c76d41e0d", "score": "0.6588877", "text": "function resizeCanvas() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n\n draw()\n }", "title": "" }, { "docid": "7de90c523ea9b770b982a4eda8482f0e", "score": "0.65744716", "text": "function resizeCanvas() {\n const canvs = document.getElementById('planetChart');\n if (canvs != null && canvs !== undefined) {\n canvs.width = $('.planet-chart-visual').innerWidth();\n canvs.height = $('.planet-chart-visual').innerHeight();\n }\n}", "title": "" }, { "docid": "bb5af699b928415e3d38b912ec475ed8", "score": "0.65703076", "text": "function windowResized() {\n\n // Read the DIV current (new) size and adjust them to fit proportionally\n let tempWidth = document.getElementById(divName).offsetWidth;\n let tempHeight = document.getElementById(divName).offsetHeight;\n\n // Check if the ratio is defined, if not just use the new DIV dimensions\n if (!(sketchRatio == null)) {\n\n // Find out which one is smaller - we have to make that one FIT\n // For this calculation we need to take the RATIO into consideration\n if (tempWidth * sketchRatio[1] > tempHeight * sketchRatio[0]) {\n\n // The WIDTH is bigger than 'allowed' and so we need to adjust that\n // To do this we take the HEIGHT value and use that to calculate new WIDTH value\n // We let the HEIGHT untouched\n tempWidth = tempHeight / sketchRatio[1] * sketchRatio[0];\n\n } else {\n\n // The HEIGHT is bigger than 'allowed' and so we need to adjust that\n // To do this we take the WIDTH value and use that to calculate new HEIGHT value\n // This also runs if the ratios are \"same\" (1:1)\n // We let the WIDTH untouched\n tempHeight = tempWidth / sketchRatio[0] * sketchRatio[1];\n }\n }\n\n // The calculation is done, the values are adjusted lets apply them\n resizeCanvas(tempWidth, tempHeight);\n}", "title": "" }, { "docid": "d853b5ff185f7a07c79674c8c5662027", "score": "0.6560941", "text": "function resize(call_callback){\n\tvar canvas = document.getElementsByClassName('pg-canvas')[0];\n\tvar dpr = window.devicePixelRatio || 1; //devie pixel ratio\n\t// console.log(dpr);\n\tcanvas.width = parseInt(String(window.getComputedStyle(canvas.parentNode).getPropertyValue(\"width\")).replace('px', ''))*dpr;\n\tcanvas.height = parseInt(String(window.getComputedStyle(canvas.parentNode).getPropertyValue(\"height\")).replace('px', ''))*dpr;\n\t// canvas.width = screen.width;\n\t// canvas.height = screen.height;\n\t// density = \n\t//adjust_for_screen_size\n\t// alert(200/(canvas.width*canvas.height));\n\tif (call_callback){\n\t\tmoveBall(200, 6, 2, 0, 200, dpr, true, true, 0.00003409152893688976, '#ceebff');\n\t\t//#a5c9d3\n\t};\n}", "title": "" }, { "docid": "ee6e671585252b3b63b339df089e942d", "score": "0.65605384", "text": "function fitCanvas() {\n // cap the width to a sizeable measure\n canvas.width = (window.innerWidth >= 700) ? 700 : window.innerWidth * 0.8;\n canvas.height = canvas.width * 0.6;\n}", "title": "" }, { "docid": "ab4330bd21bca229f1568e1ca6142150", "score": "0.6558884", "text": "function sizeCanvas() {\n \t\tcamera.aspect = window.innerWidth / window.innerHeight;\n \t\tcamera.updateProjectionMatrix();\n \t\trenderer.setSize( window.innerWidth, window.innerHeight);\n $('#homeCopy').css('top', (window.innerHeight / 2) - 90);\n }", "title": "" }, { "docid": "48db1fde884952d50d8e8bcd424b395d", "score": "0.6554333", "text": "function resizeCanvas() {\r\n //Resize canvas to meet screen\r\n canvas.width = window.innerWidth;\r\n canvas.height = window.innerHeight;\r\n }", "title": "" }, { "docid": "7f672e57f37a2d7418a722f355fa42b5", "score": "0.6547853", "text": "resizeCanvas () {\n const w = window.innerWidth\n const h = window.innerHeight\n if (this.canvas.width !== w) {\n this.canvas.width = w\n this.canvas.height = h\n }\n if (this.canvas.width > this.canvas.height) {\n this.transformX =\n (this.canvas.height / Constants.CANVAS_HEIGHT) * Constants.CANVAS_WIDTH\n this.transformY = this.canvas.height\n } else {\n this.transformX = this.canvas.width\n this.transformY =\n (this.canvas.width / Constants.CANVAS_WIDTH) * Constants.CANVAS_HEIGHT\n }\n }", "title": "" }, { "docid": "24668528ecb3d89aad7a2f71366eeb0a", "score": "0.6544633", "text": "function resize() {\n let canvas = document.querySelector('canvas'), width = window.innerWidth, height = window.innerHeight;\n let wratio = width / height, ratio = canvas.width / canvas.height;\n\n if (wratio < ratio) {\n canvas.style.width = width + 'px';\n canvas.style.height = (width / ratio) + 'px';\n } else {\n canvas.style.width = (height * ratio) + 'px';\n canvas.style.height = height + 'px';\n }\n}", "title": "" }, { "docid": "8f98f460737d6d12b96f2babbe4d5dd9", "score": "0.65399885", "text": "fixCanvasDPI() { \n const height = window.getComputedStyle(this.canvas).getPropertyValue('height').slice(0, -2);\n const width = window.getComputedStyle(this.canvas).getPropertyValue('width').slice(0, -2);\n \n this.canvas.setAttribute('width', simpleUtils.fixDPI(width));\n this.canvas.setAttribute('height', simpleUtils.fixDPI(height));\n }", "title": "" }, { "docid": "89df920715f74415444398a0215f9573", "score": "0.6534025", "text": "function resize() {\n context.canvas.width = window.innerWidth;\n context.canvas.height = window.innerHeight;\n}", "title": "" }, { "docid": "6f32882d69da5c068bd658826671e608", "score": "0.65313745", "text": "function resize()\n{\n\tWIDTH = window.innerWidth;\n\tHEIGHT = window.innerHeight;\n\tcanvas.width = WIDTH;\n\tcanvas.height = HEIGHT;\n\t\n\t// Settings\n\tc.mozImageSmoothingEnabled = false;\n\tc.imageSmoothingEnabled = false;\n}", "title": "" }, { "docid": "ff3862e4c688d2b42d5ae1b46ab93512", "score": "0.65290934", "text": "resizeCanvases() {\n\t\tDomHelper.setCanvasSize(\n\t\t\tthis.getPianoCanvasWhite(),\n\t\t\tthis.renderDimensions.windowWidth,\n\t\t\tthis.renderDimensions.whiteKeyHeight\n\t\t)\n\t\tthis.getPianoCanvasWhite().style.top =\n\t\t\tthis.renderDimensions.windowHeight -\n\t\t\tthis.renderDimensions.whiteKeyHeight +\n\t\t\t\"px\"\n\n\t\tDomHelper.setCanvasSize(\n\t\t\tthis.getPlayedKeysWhite(),\n\t\t\tthis.renderDimensions.windowWidth,\n\t\t\tthis.renderDimensions.whiteKeyHeight\n\t\t)\n\t\tthis.getPlayedKeysWhite().style.top =\n\t\t\tthis.renderDimensions.windowHeight -\n\t\t\tthis.renderDimensions.whiteKeyHeight +\n\t\t\t\"px\"\n\n\t\tDomHelper.setCanvasSize(\n\t\t\tthis.getPianoCanvasBlack(),\n\t\t\tthis.renderDimensions.windowWidth,\n\t\t\tthis.renderDimensions.whiteKeyHeight\n\t\t)\n\t\tthis.getPianoCanvasBlack().style.top =\n\t\t\tthis.renderDimensions.windowHeight -\n\t\t\tthis.renderDimensions.whiteKeyHeight +\n\t\t\t\"px\"\n\n\t\tDomHelper.setCanvasSize(\n\t\t\tthis.getPlayedKeysBlack(),\n\t\t\tthis.renderDimensions.windowWidth,\n\t\t\tthis.renderDimensions.whiteKeyHeight\n\t\t)\n\t\tthis.getPlayedKeysBlack().style.top =\n\t\t\tthis.renderDimensions.windowHeight -\n\t\t\tthis.renderDimensions.whiteKeyHeight +\n\t\t\t\"px\"\n\t}", "title": "" }, { "docid": "fe71ef2b7ca0e9ec6843ce926fbb3660", "score": "0.6523948", "text": "adjustCanvasDimensions(fractal_plane_height) {\n var ratio = this.canvasLargeMandelbrot.clientWidth / this.canvasLargeMandelbrot.clientHeight;\n\n const width = fractal_plane_height * ratio;\n let x1, x2, y1, y2, centerx, centery;\n\n centerx = 0;\n centery = 0;\n x1 = centerx - (width / 2);\n x2 = centerx + (width / 2);\n y1 = centery + (fractal_plane_height / 2);\n y2 = centery - (fractal_plane_height / 2);\n\n let rect = new Rectangle(x1, y1, x2, y2);\n\n this.constantsMandelbrotLarge.update(rect);\n this.constantsMandelbrotLarge.updateCanvas(this.canvasLargeMandelbrot);\n\n this.constantsJuliaLarge.update(rect);\n this.constantsJuliaLarge.updateCanvas(this.canvasJuliaLarge);\n\n this.canvasPreview.height = this.canvasPreview.width / ratio;\n this.canvasExportM.height = this.canvasExportM.width / ratio;\n\n this.constantsPreview.update(rect);\n this.constantsPreview.updateCanvas(this.canvasPreview);\n\n this.constantsExportM.update(rect);\n this.constantsExportM.updateCanvas(this.canvasExportM);\n\n this.constantsJulia.update(rect);\n this.constantsJulia.updateCanvas(this.canvasJuliaPreview);\n\n this.svgOverlay.setAttribute(\"width\", this.canvasLargeMandelbrot.width);\n this.svgOverlay.setAttribute(\"height\", this.canvasLargeMandelbrot.height);\n\n this.elmCanvasWidthText.textContent = this.canvasLargeMandelbrot.width.toString();\n this.elmCanvasHeightText.textContent = this.canvasLargeMandelbrot.height.toString();\n\n }", "title": "" }, { "docid": "539dd18e316620b4595ac99f845b9e46", "score": "0.6523171", "text": "_calculateSize() {\n this._canvas.width = this._container.clientWidth;\n this._canvas.height = this._container.clientHeight;\n\n let videoW = this._activeVideo.videoWidth\n , videoH = this._activeVideo.videoHeight\n , minW = this._canvas.width\n , minH = this._canvas.height\n\n // Intrinsic ratio\n // Will be more than 1 if W > H and less if H > W\n var videoRatio = (videoW / videoH).toFixed(2);\n\n var widthRatio = minW / videoW;\n var heightRatio = minH / videoH;\n\n // Whichever ratio is more, the scaling\n // has to be done over that dimension\n if (widthRatio > heightRatio) {\n this._videoWidth = minW;\n this._videoHeight = Math.ceil( this._videoWidth / videoRatio );\n }\n else {\n this._videoHeight = minH;\n this._videoWidth = Math.ceil( this._videoHeight * videoRatio );\n }\n\n this._videoX = (minW - this._videoWidth)/2;\n this._videoY = (minH - this._videoHeight)/2;\n\n this.emit('resize');\n }", "title": "" }, { "docid": "62ba657fd69998e8582ae89edc5a14ac", "score": "0.65209454", "text": "function resizeCanvas(){\n\t\t$('#gesture').show()\n\t\t\t.attr({width:$(window).width(),height:$(window).height()})\n\t\t\t.css('background-color',$('#color').val());\n\t}", "title": "" }, { "docid": "0d28fba4bdedd9b1d360173c524d30c9", "score": "0.65136874", "text": "function setSize() {\n parentWidth = $(\"#demo\").width();\n let size = parentWidth < windowHeight - 200 ? parentWidth : windowHeight - 200;\n resizeCanvas(size, size);\n}", "title": "" }, { "docid": "e2b5315676e30314d846047f3c4d5175", "score": "0.6510998", "text": "function setDimensions(e) {\n\tCANVAS_WIDTH = canvas.clientWidth;\n\tCANVAS_HEIGHT = canvas.clientHeight;\n\tcanvas.width = CANVAS_WIDTH;\n\tcanvas.height = CANVAS_HEIGHT;\n}", "title": "" }, { "docid": "c46973acfed929ad8d6f44567deb078f", "score": "0.6509602", "text": "function updateScreenSize(){\n\t//updates width to be propotional to screen size\n \tcanvasWidth = window.innerWidth*2/3;\n \t//updates height be propotional to the width\n \tcanvasHeight = canvasWidth * 1/resolution;\t\n\t//this line updates the size of the canvas to the screen\t\n\tcanvas.style.width = canvasWidth+'px';\n\tcanvas.style.height = canvasHeight+'px';\n}", "title": "" }, { "docid": "dd14febe6113ef488ae5f75b2ba3cfa6", "score": "0.6503079", "text": "function resize() {\n canvas.height = container.clientHeight;\n canvas.width = container.clientWidth;\n }", "title": "" } ]
c0bb09a997d35df1fedd08b5d10ed7da
Function that gets triggered when the company dropdown list is used to switch companies
[ { "docid": "134d81cc0b8de6416b24fb4a36fce69d", "score": "0.64125746", "text": "updateCompany(e) {\n this.setState({\n defaultCompany: e.target.value,\n logoPath: global.paths[global.env].BASE_URL+'images/logo/'+e.target.value+'/logo.gif'\n });\n\n /* Update default company */\n this.SetCompany(e.target.value);\n }", "title": "" } ]
[ { "docid": "f6ef0328538bc6110175fb7593db4243", "score": "0.7194255", "text": "function changeCompanyBindings(){\n\n var selector = thisInstance.constants.selector;\n // chen new company is selected on company drop-down\n $(selector.companySelect).on(\"change\", function(){\n cleanOldContestDetailOrForm();\n $.ajax({ // ajax call to get company current contest detail or new contest form if no contest is running right now\n url: $(selector.companySelect).data(\"get_company_contest_url\"),\n method: \"post\",\n data: {\n companyId: $(this).val().trim()\n },\n success: function(data){\n if(data.success){\n if(data.contestFound){\n $(selector.contestDetailButtonSection).removeClass(\"hide\");\n $(selector.formFieldDiv).append(data.partial);\n $(selector.contestBoxWrap).addClass(thisInstance.constants.classes.contestDetailStyleClass);\n cancelContestBindings(data.options);\n }\n else{\n $(selector.createContestButtonSection).removeClass(\"hide\");\n $(selector.formFieldDiv).append(data.partial);\n $(selector.contestBoxWrap).removeClass(thisInstance.constants.classes.contestDetailStyleClass);\n newContestBindings(data.datePickerStartDate);\n }\n }\n else{\n showError(\"Something Went Wrong.\");\n }\n },\n error: function(error){\n if(error && error.status === 401){\n location.reload();\n }\n else {\n showError(\"Something Went Wrong.\");\n }\n }\n });\n });\n }", "title": "" }, { "docid": "2a41343583985d50ecca6b91e8875210", "score": "0.70146424", "text": "onCompanyNavClick(company_name) {\n\t\tif (this.state.companySelected.has(company_name)) {\n\t\t\tthis.removeSelectedCompany(company_name);\n\t\t} else {\n\t\t\tthis.addSelectedCompany(company_name);\n\t\t}\n\t}", "title": "" }, { "docid": "6bcc01056ee61cad58c80eeac6e85c0f", "score": "0.70014364", "text": "handleSelectCompany() {\n const thisCompany = this.displayData.companies.filter(\n company => company._id.toString() === this.selectedCompany)[0];\n this.displayData.currentlyDisabled = thisCompany.disabled;\n }", "title": "" }, { "docid": "ae515491f5110936d43ecf75964ed69b", "score": "0.69839466", "text": "function ClickCompany(obj)\n/////////////////////////////////////////////////////\n{\n dValue = this.divSelObj.value; // JR - ITS 327\n COS.clearCombo(this.divSelObj);\n COS.populateDivision(this.divSelObj, obj[obj.selectedIndex].value);\n\n //traverse the Divisions to reset the old value\n for (var i =0; i < this.divSelObj.options.length; i++)\n {\n if (this.divSelObj.options[i].value == dValue)\n\tthis.divSelObj.options[i].selected = true;\n }\n COS.clickDivision(this.divSelObj);\n return true;\n} //end function clickCompany()", "title": "" }, { "docid": "889499510268a30e2e094e7b8fe5abc8", "score": "0.68278533", "text": "function changeCompanyStatus(status) {\n switch (status) {\n case \"inactive\":\n selectOption(\"companystatusinactiv\");\n break;\n case \"active\":\n selectOption(\"companystatusaktiv\");\n break;\n default:\n alert(\"this status is not support : \" + status);\n break;\n }\n}", "title": "" }, { "docid": "ac688b96d7a89c6be465ad9e7119606c", "score": "0.6653486", "text": "function singleDomainClick() {\n // Switch active buttons, enable input, show other sites\n $('#all-domains').removeClass('active');\n $('#single-domain').addClass('active');\n $('.custom-combobox input').prop('disabled', false); // Enable input\n $('#other-sites-container').show(); // Show \"other sites\" table\n \n CURR_DOMAIN = DEFAULT_DOMAIN;\n $('#mapDropdown').val(CURR_DOMAIN);\n $('#mapDropdown').change();\n}", "title": "" }, { "docid": "5376bfbaa09329ee8a0049cdbcc9c659", "score": "0.63925", "text": "function onComicChange()\n{\n\tvar ctrl = this.controls(\"comicList\");\n\tvar newComic = ctrl.GetSelectValue(ctrl.newindex);\n\tthis.parameters(\"comicType\").value = newComic;\n\n\t// change the logo to the comics logo\n\tthis.layers(\"logo\").src = \"images/logos/\" + newComic + \".png\";\n\tloadNewComic(new Date(), \"comic\");\n\n\tif(this.parameters(\"currentMode\").value != FULLMODE)\n\t\ttoFullMode();\n}", "title": "" }, { "docid": "2ccb9e7e4d8a4ed02cd1d1fe1c52bb31", "score": "0.6322207", "text": "function ClickCompanySearchMult(obj)\n///////////////////////////////////////////////\n{\n // if not object exists, return\n if(!this.labSelObj)\n return;\n\n //if (obj.selectedIndex == 0)\n // return this.clickEnvironmentSearchMult(this.envSelObj);\n\n COS.clearCombo(this.labSelObj);\n\n var jL = 0;\n\n for(var x=0; x < obj.options.length; x++)\n {\n // if selected\n if((obj.options[x].selected || this.refreshAll) && obj.options[x].value != \"0\" && obj.options[x].value != \"-1\")\n {\n var index = obj[obj.options[x].index].value;\n if(this.labSelObj)\n {\n for(var i=0; i < companyArray[index].length; i=i+2)\n {\n // skip all\n if(companyArray[index][i] != \"0\")\n {\n this.labSelObj.options[jL] = new Option(companyArray[index][i+1], companyArray[index][i]);\n jL++;\n }\n }\n }\n }\n }\n // sort the array\n COS.sortSelect(this.labSelObj,COS.compareText);\n\n return true;\n} //end function clickCompany()", "title": "" }, { "docid": "68fa6880c68dddc113a79f2bd73287e6", "score": "0.6310209", "text": "function handleCompanyOptions($concreteOwnerSearchDiv, $resultDiv, ownerType){\n $('#' + concreteOwnerOption).on('change', function () {\n const companySearchOption = this.value;\n\n if(companySearchOption == 'name'){\n $concreteOwnerSearchDiv.empty();\n $resultDiv.empty();\n\n let $findOwnerButton = buildOwnerSearchForm($concreteOwnerSearchDiv, searchByCompanyCharacteristicsMetadata.companyName);\n $concreteOwnerSearchDiv.append($resultDiv);\n makeAjaxCall($findOwnerButton, ownerType, $resultDiv);\n }\n if(companySearchOption == 'absent'){\n $concreteOwnerSearchDiv.empty();\n $resultDiv.empty();\n }\n })\n}", "title": "" }, { "docid": "351e9963747b5d4d44b41931df26599f", "score": "0.6213007", "text": "function selectedCompany(){\r\n $('.autocompleteList').on('click', '.companyMatchLI', function(event){\r\n event.preventDefault();\r\n let selectedCompany = $(this).closest('li').data('value');\r\n getCompany(selectedCompany);\r\n getQuote(selectedCompany);\r\n \r\n $('.autocompleteList').empty();\r\n $('#autocompleteHeader').addClass('hidden');\r\n $('#autocompleteDiv').addClass('hidden');\r\n $('#autocompleteHeader').removeClass('auto-bg-color');\r\n $('#autocompleteDiv').removeClass('auto-bg-color');\r\n });\r\n}", "title": "" }, { "docid": "6aac2337b05f1c58cc4578c0d1d967e5", "score": "0.6209619", "text": "function onChanges(){\n\n \t\t$( '#select-status' ).on( 'change', function() {\n\t\t\t\tif ( $( this ).val() == 'employer' ) {\n\t\t\t\t\twindow.location =home_url + '/employer/home' ;\n\t\t\t\t} else {\n\t\t\t\t\twindow.location = home_url + '/jobseeker/home' ;\n\t\t\t\t}\n\t\t\t});\n\n }", "title": "" }, { "docid": "f30a34287f9dc2ea7bfa3ee33ebe345a", "score": "0.6206055", "text": "function Activate() {\n CompanyMenuCtrl.ePage.Masters.isActivate = true;\n CompanyMenuCtrl.ePage.Masters.isDeactivate = false;\n CompanyMenuCtrl.ePage.Entities.Header.Data.UICmpCompany.IsActive = true;\n }", "title": "" }, { "docid": "ec1826267cc54d570a2de3da9ccff22d", "score": "0.6182605", "text": "function updateCompanyDisplay() { \r\n setCompanyDisplay(prevState => !prevState);\r\n }", "title": "" }, { "docid": "0c523aaf8c2230f898e43707fd9dfac0", "score": "0.6171772", "text": "updateComOpen(company) {\n this.updateCom = true; // OPEN UPDATE FORM\n this.company = company;\n this.updateCompanyForm.controls['nameUpdate'].setValue(company.name);\n this.updateCompanyForm.controls['companyUpEmail'].setValue(company.companyEmail);\n this.updateCompanyForm.controls['companyUpPassword'].setValue(company.companyPassword);\n }", "title": "" }, { "docid": "d87cd522ca244a4f9abae6e1bfa0999f", "score": "0.6158677", "text": "function onCompanyDDLSelection($http, contactResource, customerSupplierResource, vm) {\n //alert('on company selection - ' + $(\"#selectCustSupp\").val());\n var selectedValue = $(\"#selectCustSupp\").val();\n var selectedFulName = $(\"#selectContact\").val();\n if (selectedValue != -1) {\n // repopulate the contact DDL based on company selection\n $http({\n method: \"get\",\n headers: vm.messageHeadersForEnc,\n url: ('https://localhost:44302/api/Contact?customerSupplierId=' + selectedValue),\n }).success(function (data) {\n var listitems = '<option value=-1 selected=\"selected\">---- Select Contact ----</option>';\n $.each(data, function (index, item) {\n var firstName = cleanSpaces(item.firstName);\n var lastName = cleanSpaces(item.lastName);\n var fulName = (firstName + '_' + lastName);\n if (selectedFulName == fulName) {\n listitems += '<option value=' + fulName + ' selected>' + (item.firstName + ' ' + item.lastName) + '</option>';\n }\n else {\n listitems += '<option value=' + fulName + '>' + (item.firstName + ' ' + item.lastName) + '</option>';\n }\n });\n $(\"#selectContact option\").remove();\n $(\"#selectContact\").append(listitems);\n }\n ).error(function (data) {\n // display error message\n alert('error - web service access')\n });\n }\n else {\n populateContactDropDown(vm, contactResource);\n populateCompanyDropDown(vm, customerSupplierResource);\n }\n }", "title": "" }, { "docid": "19df55f13ff4dd7de1ba9ccc32c482fe", "score": "0.615022", "text": "function setDropDownListToBeChosen() {\n bindChosenDDLMulitpleSelectEvent('ddlStockAdjustmentType');\n bindChosenDDLMulitpleSelectEvent('ddlStockAdjustmentReason');\n bindChosenDDLMulitpleSelectEvent('ddlStockAdjustmentBatchNo');\n}", "title": "" }, { "docid": "4e2052b905d0b2b1e3c6f80f2905a146", "score": "0.6130508", "text": "modifyCompany() {\r\n if (gridActionNotify(this.strings, this.props.notifyToaster, this.state.selectedData.length, true, true)) {\r\n browserHistory.push('/company/' + this.state.selectedData[0].Id);\r\n }\r\n }", "title": "" }, { "docid": "bc7eded0c4846277a9457d4b5fd24cc3", "score": "0.61233616", "text": "function setCompType(compType) {\n\t$('#selectComparison').val(compType).change();\n}", "title": "" }, { "docid": "40c0fb4b06b624a61015796329c86449", "score": "0.6072611", "text": "function showCompanies() {\n\tactiveListWindow = $('.companyContainer .list-window');\n\tactiveTblWrapper = $('.companyContainer .tbl_wrapper');\n\tstateActiveWindow = 'comp';\n\tnoListing();\n\tlistAll();\n\tsetTimeout(function() {\n\t\tprepKeyboard(activeTblWrapper, activeListWindow);\n\t}, 900);\n\tif ((stateSlideShow === true) && (slideShowSize != 'standard')) { // runs if Tenants button is clicked while full slideshow is running\n\t\tconsole.debug('SLIDESHOW IS TRUE === COMPANY FUNCTION ==========================');\n\t\tstateSlideShow = false; // prevents idle timer 'active' cycle from running\n\t\tdirectoryTextHide();\n\t\t$('#tsSlideshow').fadeOut(300, function() {\n\t\t\t$('.directoryContainer').fadeIn(300);\n\t\t\tif ($('.companyContainer').hasClass('activeLeft')) {\n\t\t\t\t$('#scrollSearch').fadeIn(300).addClass('controlOn');\n\t\t\t}\n\t\t});\n\t}\n\tif ($('.companyContainer').hasClass('activeLeft')) {\n\t\t$('.companyContainer').delay(300).fadeIn();\n\t\tconsole.debug('Companies Button - Companies is Active already');\n\t} else {\n\t\tif (!$('.directoryContainer').hasClass('activeFull') ) { // if Map is active\n\t\t\tconsole.debug('Companies Button - 1 - Map was Active');\n\t\t\t$('.activeFull').toggleClass('activeFull').fadeOut(function() {\n\t\t\t\t$('.directoryContainer').delay(300).fadeIn().toggleClass('activeFull');\n\t\t\t\t$('.companyContainer').delay(300).fadeIn().toggleClass('activeLeft');\n\t\t\t\tif (slideShowSize == 'standard') {\n\t\t\t\t\t$('#tsSlideshow').delay(300).fadeIn();\n\t\t\t\t}\n\t\t\t\tif (adaValue === false) {\n\t\t\t\t\t$('#scrollSearch').delay(300).fadeIn();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif ((!$('.companyContainer').hasClass('activeLeft') ) && ($('.directoryContainer').hasClass('activeFull') )) { // if comp list not active\n\t\t\tconsole.debug('Companies Button - 2 - Return from Other Lists');\n\t\t\t$('.activeLeft').toggleClass('activeLeft').fadeOut( function(){\n\t\t\t\t$('.companyContainer').delay(300).fadeIn().toggleClass('activeLeft');\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b04d01e34cda42af7e57826df254c0b7", "score": "0.6070444", "text": "function changeYear() {\n console.log('changeYear() starting');\n var yearSelected = document.getElementById(icebergYearOptionsID).value;\n var bergList = getJSON(namesReq + '/' + yearSelected);\n updateOptions(icebergNameOptionsID, bergList);\n console.log('changeYear() finished');\n}", "title": "" }, { "docid": "2d29673a7504965bff1456a2c458c6e2", "score": "0.6068809", "text": "function GetCompanyByBossId(boos_id, comp_id) {\n let data = {\n boss_id: boos_id,\n __RequestVerificationToken: $('input[name=\"__RequestVerificationToken\"]').val()\n };\n\n $.ajax({\n type: \"POST\",\n url: \"/Staff/GetCompany\",\n data: data,\n success: function (response) {\n let option = '<option value=\"0\">-- All Companies -- </option>';\n for (let i = 0; i < response.length; i++) {\n option += '<option value=\"' + response[i].PK_Comp_Id + '\">' + response[i].Comp_Name + '</option>';\n }\n $('#ddlEditCompany').html(option);\n $('#ddlEditCompany').val(comp_id);\n },\n error: function () {\n $('#ddlEditCompany').html('<option value=\"0\">-- All Companies --</option>');\n //$('#ddlLocation').html('<option value=\"0\">-- All Locations --</option>');\n }\n });\n }", "title": "" }, { "docid": "d1cbc04a4e7e6cdce4f2f4d6f519f4cd", "score": "0.6009944", "text": "function OnChange(param) {\n var dropdownSize = document.getElementById(\"select1\");\n var dropdownColor = document.getElementById(\"select2\");\n var dropdownRange = document.getElementById(\"select4\");\n\n reconfigureGridRelatedStructures(dropdownSize, dropdownColor, dropdownRange);\n drawDistricts();\n serviceFlag = true;\n}", "title": "" }, { "docid": "e57ae1f3adf424ce98e572d1ee783e0e", "score": "0.60051465", "text": "function ClientSelected() {\n\n CleanCombos();\n\n UpdateClientAreas();\n UpdateActivities();\n}", "title": "" }, { "docid": "089f36e3e505c11df358d8658b2da416", "score": "0.59475964", "text": "function onChangeCountryClick() {\n $.country_dropdown_view.updateCountrySelectedItem(countryConfig[Alloy.CFG.countrySelected].value);\n $.language_dropdown_view.updateLanguageSelectedItem(Alloy.CFG.languageSelected);\n showCountrySelector();\n}", "title": "" }, { "docid": "8e73b1899989a6168533eddc3bd522ce", "score": "0.59466904", "text": "function allDomainsClick() {\n // Switch active buttons, disable input, hide other sites\n $('#single-domain').removeClass('active');\n $('#all-domains').addClass('active');\n $('.custom-combobox input').val(''); // Empty input\n $('.custom-combobox input').prop('disabled', true); // Disable input\n $('#other-sites-container').hide(); // Hide \"other sites\" table\n \n CURR_DOMAIN = 'all';\n mapChange(true);\n}", "title": "" }, { "docid": "1bfb494c70c8f3eedea6a3503590eec4", "score": "0.59368587", "text": "function OnTypeOfConstructionOtherName_Change( e , type )\r\n{\r\n var newOtherNameValue = $.widgetAppTextFieldATC20ModeFormsBuildingDescriptionTypeOfConstructionOtherName.get_text_value() ;\r\n Alloy.Globals.ATC20ModeBuildingDescription[\"OTHER_TYPE_OF_CONSTRUCTION\"] = newOtherNameValue ;\r\n // If the value is not empty, we must also set the selected item of the TypeOfConstruction picker to \"Other\"\r\n if( newOtherNameValue )\r\n {\r\n $.widgetAppComboBoxATC20ModeFormsBuildingDescriptionTypeOfConstruction.set_selected_index( \"7\" ) ;\r\n Alloy.Globals.ATC20ModeBuildingDescription[\"TYPE_OF_CONSTRUCTION\"] = \"7\" ;\r\n }\r\n}", "title": "" }, { "docid": "b5b4a86b498e0cc66756ca7b65194b4d", "score": "0.59209573", "text": "function OnPrimaryOccupancyOtherName_Change( e , type )\r\n{\r\n var newOtherNameValue = $.widgetAppTextFieldATC20ModeFormsBuildingDescriptionPrimaryOccupancyOtherName.get_text_value() ;\r\n Alloy.Globals.ATC20ModeBuildingDescription[\"OTHER_PRIMARY_OCCUPANCY\"] = newOtherNameValue ;\r\n // If the value is not empty, we must also set the selected item of the PrimaryOccupancy picker to \"Other\"\r\n if( newOtherNameValue )\r\n {\r\n $.widgetAppComboBoxATC20ModeFormsBuildingDescriptionPrimaryOccupancy.set_selected_index( \"10\" ) ;\r\n Alloy.Globals.ATC20ModeBuildingDescription[\"PRIMARY_OCCUPANCY\"] = \"10\" ;\r\n }\r\n}", "title": "" }, { "docid": "c1d441d5128765dfe4e3fe1da6ddf8a9", "score": "0.59070396", "text": "function callSiteChange(evt) {\n $obj = $(evt.target ? evt.target : evt.srcElement);\n if ($obj.is('select')) {\n var selectedIndex = $obj[0].selectedIndex;\n if (selectedIndex > 0) {\n var callSiteID = $obj[0].options[selectedIndex].value;\n openFunction(callSiteID);\n }\n }\n}", "title": "" }, { "docid": "285659f7b7e846a7679cf2b5b35dbcab", "score": "0.59063965", "text": "onDropdownShow() {}", "title": "" }, { "docid": "6f58e0bdca0bb6c2cbf17e49dcb5ab05", "score": "0.58756435", "text": "function PopulateCompanySearch(obj, index)\n/////////////////////////////////////////////\n{\n var j = 0;\n\n COS.clearCombo(obj);\n for(var i=0; i < environmentArray[index].length; i=i+2){\n\tobj.options[j] = new Option(environmentArray[index][i+1], environmentArray[index][i]);\n j++;\n }\n COS.sortSelect(obj,COS.compareText);\n obj.options[0].selected=true;\n\n} //end function populateCompany()", "title": "" }, { "docid": "bf428eee7e01cf88eea696eff51afd02", "score": "0.58604574", "text": "function dealwithCompany(data){\n\tvar parsedData = data.companyList;\n\tvar select = document.getElementById(\"busCompany\");\n\tfor(var i in parsedData){\n\t\tvar opt = document.createElement(\"option\");\n\t\topt.value = parsedData[i].compid;\n\t\topt.text = parsedData[i].compnm;\n\t\tselect.appendChild(opt);\n\t}\n}", "title": "" }, { "docid": "4e91789e29c8a15c9074b42b1cd2a168", "score": "0.58471984", "text": "function cancelOnCompany() {\n $scope.company = angular.copy($scope.originCompany);\n $scope.companyInfo = true;\n }", "title": "" }, { "docid": "c98d3fd91e807996a6896b9fea15c4a1", "score": "0.584682", "text": "function EstadoChange() {\n loadCiudadbyEstados($(\"#cmbEstado\").val());\n}", "title": "" }, { "docid": "4f090a0cf4bc986661a31a5fc17f7d68", "score": "0.58343005", "text": "function cmbTipoSolicitudOnChange() {\n\n\tlimpiarLista();\n\tlistado1.actualizaDat();\n\n\tif(get(\"frmContenido.cbTipoSolicitud\")!=\"\") {\n\t\teval(\"frmContenido\").oculto= \"S\";\n\t\tset(\"frmContenido.conectorAction\", \"LPMantieneValoresPorDefecto\");\n\t\tset(\"frmContenido.accion\", \"cargarValoresPorDefecto\");\n\t\tset(\"frmContenido.oidTipoSolicitud\", get(\"frmContenido.cbTipoSolicitud\"));\t\n\t\tenviaSICC('frmContenido', '', '', 'N');\t\n\t}\n }", "title": "" }, { "docid": "fa4dab622e6c09c79d7da8a0aa928780", "score": "0.5833954", "text": "function handleThisChange(e, value){\n selectedCourses = value\n}", "title": "" }, { "docid": "dc735a56727192068dca8829b6bbc70e", "score": "0.58017844", "text": "function optionChanged(subject)\n{\n console.log(\"dropdown selection\", subject);\n createCharts(subject);\n createMetada(subject);\n createGaugeChart(subject);\n}", "title": "" }, { "docid": "2cebf0d0d85fcd78c5741f0ba3d9e973", "score": "0.5784591", "text": "function selectedBrand(brand){\n const selectedBrand = brand.options[brand.selectedIndex].value;\n console.log(\"This is the selected brand: \" + selectedBrand);\n\n ui.clearYear();\n ui.selectFirstModel();\n ui.clearPrice();\n\n // Load the car models.\n fipe.getModel(selectedBrand).then(data=>{\n ui.modelJson(data);\n });\n\n carBrand = selectedBrand;\n \n}", "title": "" }, { "docid": "29713e9644e81f2f211d2dce1584c0d0", "score": "0.5782754", "text": "function displayChange() {\n\tfromCurrencyDropDownChange();\n\ttoCurrencyDropDownChange();\n\tfromCurrencyTextboxChange();\n\ttoCurrencyTextboxChange();\n}", "title": "" }, { "docid": "5484a5cb13b2996852c5ae8dcdef5f25", "score": "0.5775801", "text": "function seasonChange() {\n console.log(\"season change ran\")\n // season = seasonDropdown.val();\n // console.log(\"new season: \" + season)\n}", "title": "" }, { "docid": "839dac93718ccda9d7ba52fc590b14e5", "score": "0.5753003", "text": "departmentChange() {\n let currentDepartment = $('.department-modal .department-select').val();\n let icon = icons[currentDepartment];\n if(currentDepartment == 'Reception'){\n $('.new-drop-btn').show();\n $('.drop').find('.add-dep-btn').show();\n } else {\n $('.new-drop-btn').hide();\n $('.drop').find('.add-dep-btn').hide();\n }\n this.view.closeModal();\n this.view.departmentChange(icon);\n }", "title": "" }, { "docid": "2e4b9800334fc8b42f9d10ed76796aa9", "score": "0.5742397", "text": "function afterSelectVendor(fieldName, newValue, oldValue){\n document.getElementById(fieldName).value = newValue;\n enableField(\"helpdesk_sla_steps.vn_id\");\n disableField(\"helpdesk_sla_steps.em_id\");\n disableField(\"helpdesk_sla_steps.cf_id\");\n $(\"helpdesk_sla_steps.role\").value = \"\";\n enableRadioButtons(\"multiple_required\", false);\n}", "title": "" }, { "docid": "a0c090023dc9b42b550e8bb374dc7bee", "score": "0.5724294", "text": "function getcompany ()\r\n{\r\n\tvar type;\r\n\ttype=document.getElementById(\"type\").value;\r\n\t//alert(type);\r\n\tshowList(type);\r\n\t}", "title": "" }, { "docid": "2ba8b2090f9ff4f8a19d56f4abecd4f9", "score": "0.572176", "text": "onSelectNewCompany(data) {\n this.setState({\n new_vendor_company: data.split(\",\")[1],\n new_companyId: data.split(\",\")[0]\n })\n\n }", "title": "" }, { "docid": "89de69442aa760515818e69f7002b0de", "score": "0.5711334", "text": "function doAfterSelectOptionChangedForContactUs(fieldName)\n{\n\tif(1>2)\n\t{\n\t}\n\t\n\tdoAfterSelectOptionChangedForContactUsExt(fieldName);\n}", "title": "" }, { "docid": "be86784daafb5e3c31185fd9999eba1a", "score": "0.57062274", "text": "changeHandler(e) {\n\n /*\n The <select> dropdown sets a value to 'selected month' on the local state.\n This value will be used to filter the array of shows displayed.\n */\n this.setState({selectedMonth: e.target.value})\n }", "title": "" }, { "docid": "6a700d5aa9ac98ce16e5a7a077277093", "score": "0.5695233", "text": "function handleProjectDropDownChange() {\r\n var value = $('#projects').val();\r\n\r\n var billingAccounts = getBillingAccountsByDirectProjectId(value);\r\n\r\n $(\"#billingProjects\").empty();\r\n $(\"#billingProjects\").append($('<option></option>').val(0).html(\"Please select an existing account\"));\r\n\r\n var hasCMCBilling = false;\r\n var CMCBillingExisting = false;\r\n\r\n if($(\"input[name=CMCBillingID]\").val() && $(\"input[name=CMCBillingID]\").val() > 0 && value > 0) {\r\n hasCMCBilling = true;\r\n }\r\n\r\n $.each(billingAccounts, function(key, value) {\r\n\t\tvar _cca = value[\"cca\"] == \"true\" ? true : false;\r\n $(\"#billingProjects\").append($('<option></option>').val(value[\"id\"]).html(value[\"name\"]).data(\"cca\", _cca));\r\n\r\n if(value[\"id\"] == $(\"input[name=CMCBillingID]\").val()) {\r\n CMCBillingExisting = true;\r\n }\r\n });\r\n\r\n if(hasCMCBilling && !CMCBillingExisting) {\r\n $(\"#billingProjects\").append($('<option></option>').val($(\"input[name=CMCBillingID]\").val()).html($(\"input[name=CMCBillingName]\").val()).data(\"cca\", false));\r\n }\r\n\r\n $(\"#billingProjects\").val(0);\r\n\r\n if(value > 0) {\r\n $(\"a.addBilling\").show();\r\n $(\"a.addBilling\").attr(\"href\", \"../editProject?formData.projectId=\" + value + \"#addBillingAccount\");\r\n } else {\r\n $(\"a.addBilling\").hide();\r\n $(\"a.addBilling\").attr(\"href\", \"javascript:;\");\r\n }\r\n\r\n if(hasCMCBilling) {\r\n $(\"#billingProjects\").val($(\"input[name=CMCBillingID]\").val());\r\n } else {\r\n $(\"#billingProjects\").val(0);\r\n }\r\n\r\n var result = getCopilotsByDirectProjectId(value);\r\n\r\n var copilots = result.copilots;\r\n var selected = result.selected;\r\n var $contestCopilots = $(\"#contestCopilot\");\r\n\r\n $contestCopilots.html(\"\");\r\n\r\n $contestCopilots.append($('<option></option>').val(0).html(\"Unassigned\"));\r\n\r\n $.each(copilots, function(key, value) {\r\n $contestCopilots.append($('<option></option>').val(key).html(value));\r\n });\r\n\r\n // set the selection drop down value\r\n $contestCopilots.val(selected);\r\n\r\n // we only refresh stylish selection when it's not hidden\r\n $('.copilotSelect select').resetSS();\r\n $('.copilotSelect select').getSetSSValue(selected);\r\n}", "title": "" }, { "docid": "54245fdbd57d07ee3c17be867412dcfb", "score": "0.56926376", "text": "function teamChangeEventHandler() {\n\tshowSeasonsForTeam();\n\t$.cookie(\"selectedTeam\", $(\"#defaultTeam\").val(), { expires: 365 });\t\n}", "title": "" }, { "docid": "7c8462880b3a1c9a9a32b75a0a45fac3", "score": "0.56814086", "text": "function brandSelectChangeHandler(event) {\n addParameterToUrl('brand', event.target.value);\n searchRequest();\n }", "title": "" }, { "docid": "dd0aafae2d4d279f2a6485eda2ec9f60", "score": "0.5679136", "text": "function changeCountry() {\n\t\tvar val = $(\"#countryList\").val()\n\t\tvar dropDownValue = names[val];\t\n\t\tconsole.log(val);\n\t\t//console.log(dropDownValue);\t// Gets country name selected\n\t\tif(val != 'Country Not Selected') {\n\t\t\tvis.selectAll(\"path\").remove();\n\t\t\tdropDownValue\n\t\t\tdrawUnemployment(dropDownValue, nameAndValues, values);\n\n\t\t\t//dots\n\t\t\tvis.selectAll(\"circle\").remove();\n\t\t\tdrawDisasters(dropDownValue, nameAndValues, countryCodeIntensities);\n\t\t} else {\n\t\t\tvis.selectAll(\"path\").remove();\n\t\t\tdrawAllLines();\n\t\t\tvis.selectAll(\"circle\").remove();\n\t\t\tdrawAllCircles();\n\t\t}\n\t}", "title": "" }, { "docid": "2e30894aa3b5c40a64d68b6fdbd1b544", "score": "0.56636655", "text": "function onContactDDLSelection($http, customerSupplierResource, contactResource, vm) {\n //alert('on contact selection - ' + $(\"#selectContact\").val()); \n var selectedCompany = $(\"#selectCustSupp\").val();\n var selectedFulName = $(\"#selectContact\").val();\n if (selectedFulName != -1) {\n // repopulate the contact DDL based on company selection\n $http({\n method: \"get\",\n headers: vm.messageHeadersForEnc,\n url: ('https://localhost:44302/api/customerSupplier?contactFulName=' + selectedFulName),\n }).success(function (data) {\n var listitems = '<option value=-1 selected=\"selected\">---- Select Customer ----</option>';\n $.each(data, function (index, item) {\n if (selectedCompany == item.id) {\n listitems += '<option value=' + item.id + ' selected>' + item.name + '</option>';\n }\n else {\n listitems += '<option value=' + item.id + '>' + item.name + '</option>';\n }\n });\n $(\"#selectCustSupp option\").remove();\n $(\"#selectCustSupp\").append(listitems);\n }\n ).error(function (data) {\n // display error message\n alert('error - web service access')\n });\n }\n else {\n populateCompanyDropDown(vm, customerSupplierResource);\n populateContactDropDown(vm, contactResource);\n }\n }", "title": "" }, { "docid": "c295cf72676deb90b027d06179479b7d", "score": "0.56568074", "text": "displayAccounts() {\n // Dispatches the event.\n this.dispatchEvent(new CustomEvent(\"selectvaluechange\", {\n detail: this.currentVal\n }));\n }", "title": "" }, { "docid": "fd119f1f9bfa0217a47e249f60a23d9d", "score": "0.5653361", "text": "function ChangeSelected()\n{\n if(saveobj._id == currentSelectedDropdownlistId)\n {\n var divDBItems = document.getElementById('divDBItems');\n var itmsVisible = new Array();\n var changeitms = new Array();\n \n if(divDBItems != null)\n {\n var items = saveobj._getDropdownItems();\n for(var i=0;i<divDBItems.childNodes[0].childNodes[0].childNodes[0].childNodes.length;i++)\n {\n itmsVisible[i] = divDBItems.childNodes[0].childNodes[0].childNodes[0].childNodes[i].childNodes[0].childNodes[0].checked;\n changeitms[i] = new ItemObj('',items[i].split('||')[0],itmsVisible[i]); \n }\n }\n\n saveobj._setDropdownItemsActivity(itmsVisible);\n var changeItem = new DropDownObj(Ext.Const.OpenedId, saveobj._controlIdValue, droptype, saveobj._labelKeyValue, saveobj._getLabel(), saveobj.get_IsTemplateField(), saveobj.get_TemplateAttribute(), saveobj._labelKeyValue + '|sub', saveobj._getSubLabel(), 'CapTypeConfiguration', changeitms);\n changeItems.UpdateItem(3,changeItem);\n ModifyMark();\n }\n}", "title": "" }, { "docid": "58ed245224a6c4e3af0371c034dc3175", "score": "0.563202", "text": "function setSelectedCompetition() {\n\tvar currentCompetitionSelect = document.getElementById(\"currentCompetitionSelect\");\n\t//console.log(currentCompetitionSelect.options.length);\n\t//console.log(defaults[\"competition\"]._id);\n\n\t//Iterate through the select menu's options\n\tfor(var i = 0; i < currentCompetitionSelect.options.length;i++) {\n\t\t//console.log(currentCompetitionSelect.options[i].value);\n\n\t\t//Check if the default competition value equals an option value\n\t\tif(defaults[\"competition\"]._id === currentCompetitionSelect.options[i].value){\n\n\t\t\t//Select it if true\n\t\t\tcurrentCompetitionSelect.options[i].selected = true;\n\t\t\t//console.log(currentCompetitionSelect.options[i].value);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "663080f3bf03c90c1d7513eef6312014", "score": "0.56234366", "text": "function past_activity_dropdown_onchange() {\n /* Connect to Past Activity Unit Input */\n let pActUnit = document.getElementById(\"pAct-unit\");\n\n /* Show Form, Hide 'Add New Activity' Button */\n switch (past_activity_dropdown.value) {\n case 'Walk': case 'Run': case 'Bike':\n pActUnit.value = 'km';\n break;\n case 'Swim':\n pActUnit.value = 'laps';\n break;\n case 'Yoga': case 'Soccer': case 'Basketball':\n pActUnit.value = 'minutes';\n break;\n default:\n pActUnit.value = 'units';\n }\n}", "title": "" }, { "docid": "1a7018a5bb350d4e48d8b2b60ef76a5e", "score": "0.56142795", "text": "checkCompanySettings() {\n if (!employeeService.get(this).displayData.company) {\n scope.get(this).$watchCollection(() => employeeService.get(this).displayData.company, newVal => {\n if (newVal) {\n this.handleSettings();\n }\n });\n } else {\n this.handleSettings();\n }\n }", "title": "" }, { "docid": "160c373b80258ad60d910b0a9090143e", "score": "0.56058514", "text": "function ChangeCountries(element) \n {\n \n var value = $(\"OPTION:selected\", element).val();\n var text = $(\"OPTION:selected\", element).text();\n var ClanCountry = aspxControlIds.ClanCountry;\n var SearchCountry = aspxControlIds.SearchCountry;\n var DdlClanContinent = aspxControlIds.DdlClanContinent;\n var DdlSearchContinent = aspxControlIds.DdlSearchContinent;\n var GetCountryControlToChange = null;\n\n if ($(element).attr(\"id\") == $(DdlClanContinent).attr(\"id\")) {\n GetCountryControlToChange = ClanCountry;\n }\n\n if ($(element).attr(\"id\") == $(DdlSearchContinent).attr(\"id\")) {\n GetCountryControlToChange = SearchCountry;\n }\n var GetTc = $(\"#\" + $(GetCountryControlToChange).parent().attr(\"id\"));\n \n if (value == \"\" || value == null) {\n $(function() {\n $(GetCountryControlToChange + \">option\").remove();\n $(GetCountryControlToChange).prepend(\"<option value='' selected='selected'>\" + aspxValues.Choose + \"</option>\");\n $(GetCountryControlToChange).attr(\"disabled\",\"disabled\");\n });\n } else {\n \n $(function() {\n \n GetTc.prepend(LoadingTag);\n \n $.ajax({\n type: \"GET\",\n\t url: aspxValues.MainUrl + \"xml.ashx\",\n\t cache: false,\n\t contentType: \"application/rss+xml; charset=utf-8\",\n\t timeout: 3000,\n\t async: true, \n\t data: \"xml=c&ci=\" + value + \"&li=\" + CurrentLangId,\n\t dataType: (jQuery.browser.msie) ? \"text\" : \"xml\",\n\t \n error: function(XMLHttpRequest, textStatus, errorThrown) {\n\n\n // speciel combobox fix\n $(GetCountryControlToChange).attr(\"disabled\", \"disabled\");\n $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"input\").attr(\"disabled\", \"disabled\");\n $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"input\").val(\"\");\n $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"btn\").attr(\"disabled\", \"disabled\");\n $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"btn\").addClass(\"ui-button-disabled ui-state-disabled\");\n \n\n GetTc.find(LoadingId).remove();\n },\n\t \n\t success: function(xmlData) {\n \n xmlData = parseXml(xmlData);\n \n if (xmlData != null) {\n \n /*\n Clear ClanCountry\n */\n \n $(GetCountryControlToChange + \">option\").remove();\n \n var theItem = null;\n var theId = null;\n\t $(xmlData).find(\"c\").each(function()\n\t {\n\t\t theCountry = $(this).text();\n\t\t theId = $(this).attr(\"i\");\n \t\t \n\t\t $(GetCountryControlToChange).append(\n $(\"<option></option>\").val(theId).html(theCountry)\n );\n \n\t });\n\n\t $(GetCountryControlToChange).prepend(\"<option value='' selected='selected'>\" + aspxValues.Choose + \"</option>\");\n\t \n // speciel combobox fix\n\t $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"input\").removeAttr(\"disabled\");\n\t $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"input\").val(\"\");\n\t $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"btn\").removeClass(\"ui-state-disabled\");\n\t $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"btn\").removeClass(\"ui-button-disabled\");\n\t $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"btn\").removeAttr(\"disabled\");\n\t $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"btn\").hover(function () {\n\t $(this).addClass(\"ui-state-hover\");\n\t });\n\t $(\"#\" + $(GetCountryControlToChange).attr(\"id\") + \"btn\").mouseleave(function () {\n\t $(this).removeClass(\"ui-state-hover\");\n\t });\n\n GetTc.find(LoadingId).remove();\n \n } else {\n \t GetTc.find(LoadingId).remove();\n \t }\n \n\t }\n }); \n \n });\n }\n }", "title": "" }, { "docid": "34374dda1d3a968ef4c01eb9c6f6add7", "score": "0.56045896", "text": "function wg_constraint_selector_changed() {\n let slug = this.getAttribute('data-slug');\n let cfield = constraint_field(slug);\n // add selected value to constraint_field\n cfield.value += ' ' + this.options[this.selectedIndex].value;\n }", "title": "" }, { "docid": "ef879b92e19b5b8030e9307bdec401dd", "score": "0.5596569", "text": "function onSelectOpaqueConstructionMenu() {\n // The selection in Opaque Construction Menu is stored in choice\n let choice = $(\"#opaqueConstructionMenu\").find(\":selected\").val();\n\n if (choice === CONTAINER || choice === UNINSULATED) {\n opConsValue = 0;\n changeOTResistance();\n changeEOTResistance();\n onSelectDegreeDaysMenu();\n } else if (choice === CELLULOSE || choice === FIBERGLASS) {\n opConsValue = 3;\n changeOTResistance();\n changeEOTResistance();\n onSelectDegreeDaysMenu();\n } else if (choice === SPRAY_FOAM) {\n opConsValue = 6;\n changeOTResistance();\n changeEOTResistance();\n onSelectDegreeDaysMenu();\n } else {\n opConsValue = 0;\n }\n\n doPlan();\n}", "title": "" }, { "docid": "c299f5db7ccc69ddb5aa966f0847cf00", "score": "0.5595434", "text": "function onCitiesDropdownChanged() {\n // find the league and team dropdown\n const statesDropdown = document.getElementById(\"statesDropdown\");\n const citiesDropdown = document.getElementById(\"citiesDropdown\");\n const hotelsDropdown = document.getElementById(\"hotelsDropdown\");\n\n hotelsDropdown.options.length = 0;\n //find the message paragraph\n const messagePara = document.getElementById(\"messagePara\");\n //erase previous team message\n messagePara.innerHTML = \"\";\n\n //get the selected city\n let selectedCity = citiesDropdown.value;\n //if select one is picked, exit the function\n if (selectedCity == \"\") {\n const hotelsDropdown = document.getElementById(\"hotelsDropdown\");\n let select1OneOption = new Option(\"Select the City first...\", \"\");\n hotelsDropdown.appendChild(select1OneOption);\n return;\n }\n\n //go use the selected leagueCode to find the matching league from the array\n let selectedStatesAbbr = statesDropdown.value;\n let matchingState = cityStates.find(arrayElement => arrayElement.stateAbbr == selectedStatesAbbr);\n let matchingCity = matchingState.cities.find(arrayElement => arrayElement.name == selectedCity);\n //change the background when the state changes\n //create the select1one option\n let select1OneOption = new Option(\"Select one...\", \"\");\n hotelsDropdown.appendChild(select1OneOption);\n //loop through the cities in the matching states and create option elements for each\n for (let i = 0; i < matchingCity.hotels[i].length; i++) {\n let theOption = new Option(matchingCity.hotels[i]);\n hotelsDropdown.appendChild(theOption);\n }\n\n}", "title": "" }, { "docid": "c6764560a10a1ec287647f4774431df3", "score": "0.55845886", "text": "function updatePrice(company) {\n switch(company) {\n case 'liberac':\n liberacFees.value = '$8.00'\n liberacTotal.value = '$8.00'\n case 'klickex':\n case 'westernunion':\n case 'moneygram':\n case 'pacificezy':\n case 'anz':\n competitorFees.value = new Intl.NumberFormat('latn', { style: 'currency', currency: 'NZD' }).format(fees[company].fixed)\n competitorTotal.value = calculateFees(company, parseInt(transferSlider.value))\n break\n default:\n console.error('No competitor to update?')\n break\n }\n}", "title": "" }, { "docid": "801bbb7b965eb2bf5e8d6d6abcc0c136", "score": "0.5570775", "text": "function PopulateCompany(obj, index)\n//////////////////////////////////////////\n{\n var j = 0;\n\n if (index > -1)\n {\n for(var i=0; i<a[index].length; i=i+2)\n {\n this.comSelObj.options[j] = new Option(a[index][i+1], a[index][i]);\n j++;\n }\n this.comSelObj.options[0].selected=true;\n }\n} //end function populateCompany()", "title": "" }, { "docid": "f968136c803b368ea9ba093d8d968e0e", "score": "0.5568024", "text": "function citySelectEvent() {\n nbc.focused.city = nbc.cities.find(x => x.id === document.getElementById(this.id).value).id;\n // Reset the category selection back to \"Select Category\" when new city is selected.\n nbc.focused.category = \"NA\";\n // Reset the subcat selection back to all when city is changed.\n nbc.focused.subcat = \"NA\";\n\n localStorage.setItem(localStorageNavVar.city, nbc.focused.city);\n localStorage.setItem(localStorageNavVar.cat, nbc.focused.category);\n localStorage.setItem(localStorageNavVar.subcat, nbc.focused.subcat);\n /*\n This function chain checks for a selected city, category and subcategory.\n It then will filter the list of places on the selected items.\n */\n nbc.availablePlaces = nbc.filterOnSubcat(nbc.filterOnCategory(nbc.filterOnCity(nbc.places)));\n nbc.availableCategories = nbc.filterCategoryOptions();\n // Change available categories to select from when city changes\n if (availData.cat) {\n nbc.placeOptionElements(catboxId, nbc.generateOptionElements(nbc.availableCategories)); \n }\n nbc.availableSubcats = nbc.filterSubcatOptions();\n if (availData.subcat) {\n nbc.placeOptionElements(subcatboxId, nbc.generateOptionElements(nbc.availableSubcats)); \n }\n updateDom();\n}", "title": "" }, { "docid": "6ab29fd0fc33b350dd9a2b879044f36c", "score": "0.5564581", "text": "function ChangeAgency(combo, record) {\n if (Ext.getCmp('ddlAgency').getValue() == currentAgency) {\n return;\n }\n else {\n currentAgency = Ext.getCmp('ddlAgency').getValue();\n }\n\n Ext.Ajax.request\n ({\n url: 'Pageflow/WorkFlowContent.aspx',\n params: { action: 'SetAgencyCode', agencyCode: currentAgency },\n method: \"POST\",\n success: function () {\n window.location.reload();\n }\n });\n }", "title": "" }, { "docid": "c52de9d5b24e6e153a27ba3c7017b08f", "score": "0.5556489", "text": "function handleOnChange(obj) {\r\n if (obj.name == 'entityId') {\r\n var url = getAppPath() + \"/policymgr/regionalmgr/maintainRegionalTeam.do?entityId=\" + obj.value\r\n + commonGetMenuQueryString() + \"&process=getUnderwriterId\";\r\n\r\n new AJAXRequest(\"get\", url, '', setUnderwriterId, false);\r\n }\r\n}", "title": "" }, { "docid": "0796ad175f6fbee03467cdab8073df99", "score": "0.5551505", "text": "function bindCityOptionClick(){\n //列表中选中城市\n wrapper.on('click','.city_option',function(){\n var city_id = $(this).attr(\"data-id\");\n var city_name = $(this).attr(\"data-name\");\n $(this).parents('div').siblings('input.selected_city_input').attr(\"city_id\",city_id).attr('city_name',city_name).val(city_name);\n $(this).parents(\".city_options\").hide();\n });\n }", "title": "" }, { "docid": "00bbb75fb9b435cf9db274639f30ca23", "score": "0.55450124", "text": "function changeCities(){\n \n\t//get the select table and cities that are going to be added\n\t\n\t//the two current selectors seen by user\n\tvar states=document.getElementById(\"states\");\n\tvar cityList=document.getElementById(\"cities\");\n\t\n\t//currently selected state\n\tvar stateVal=states.options[states.selectedIndex].value;\n\t//list of cities within the state\n\tvar citiesInState=cityDict[stateVal];\n\t\n\t//remove all the current planes from the list\n\tfor(var i=cityList.length-1; i>=0; i--){\n\t\tcityList.remove(i);\n\t}\n\t\n\t//add the new planes to the list\n\tfor(var i=0; i<citiesInState.length;i++){\n\n\t\tvar newOption = document.createElement('option');\n\t \t\n\t newOption.text= properCapitlize(citiesInState[i]);\n\t newOption.innerHTML= properCapitlize(citiesInState[i]);\n\t newOption.value=citiesInState[i];\n\t \t\n\t cityList.appendChild(newOption);\n\t}\n\t\n}", "title": "" }, { "docid": "4dee14c6926c4f3468300687653fa820", "score": "0.553915", "text": "function customeToTeam(){\n\t\t$('.e-custome-start').click(function(){\n\t\t\t$('.e-custome-home').hide(0,function(){\n\t\t\t\t$('.e-custome').show();\n\t\t\t\t});\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "a655dd2526e0ad9b00da40219b1ae260", "score": "0.55336803", "text": "function changeList() {\n var id = $(this).val();\n var orgs = storage.getOrgs();\n var lists = {};\n\n // search through the organzations and find the board that was selected\n $.each(orgs, function(key, org) {\n var board = $.grep(org.boards, function(e){ return e.id === id; })[0];\n if (board) { lists = board.lists; }\n });\n\n\n // clear the lists dropdown\n $('.js-lists').html('');\n\n $.each(lists, function(key, list) {\n var listSelected = false;\n if (key == 0) listSelected = true;\n\n // append the list\n $('.js-lists').append(createOption(list, listSelected));\n });\n}", "title": "" }, { "docid": "72f78d09e3b19de8931174ac2b58cd7c", "score": "0.5529591", "text": "function updateCurrentList() {\n $(\".eh_list_select\").on(\"change\", function(){\n console.log($(this).val())\n if ($(this).val() == \"new_list\") {\n OpenInNewTab(\"https://emailhunter.co/leads_lists/new?utm_source=chrome_extension&utm_medium=extension&utm_campaign=extension\")\n }\n else {\n chrome.storage.sync.set({'current_leads_list_id': $(this).val()}, function() {\n // Current list updated\n });\n }\n });\n}", "title": "" }, { "docid": "04ea7555351082230c56c6c9d4fc6637", "score": "0.55294263", "text": "activateAIMenuEvent(){\n let that = this;\n let $opponent_selection = $('#opponent');\n $opponent_selection.change(function(){\n if($(this).val() === 'AI'){\n that.showAIMenu();\n }\n else{\n that.hideAIMenu();\n }\n });\n }", "title": "" }, { "docid": "07987b47016eced1bb38b67f230351fc", "score": "0.552865", "text": "function onOrgNameChange(onChange) {\n var name = document.getElementById('organization_name');\n name.addEventListener('change', function(e) {\n onChange(e.target.value);\n });\n}", "title": "" }, { "docid": "e30bed4aeae456fedf09c7c6e1009ad8", "score": "0.5520709", "text": "function changeSelection(evt) {\n setCountySelected(evt.target.value);\n // this function has data the real county data from the fetch.\n // this helps to find if the guessed option and real county are same\n RealCountyFetch();\n\n }", "title": "" }, { "docid": "3a4c91035856c8f5723473d466f91db6", "score": "0.5518702", "text": "function setAsChosen (arrayName, eventName) {\r\n if (checkoutModel.get(arrayName).length && checkoutModel.get(arrayName)[0].setAsDefaultChoice) {\r\n EventBus.trigger(\r\n eventName,\r\n checkoutModel.get(arrayName)[0].selectAction\r\n );\r\n }\r\n }", "title": "" }, { "docid": "2bbe7e01e24c07f7050e8055f42328f9", "score": "0.5515576", "text": "function openDropdown() {\n\n // TODO\n \n}", "title": "" }, { "docid": "1e4ac0523ec53b7ab97a99f65a51b3fd", "score": "0.5514223", "text": "function $fc_change_view_type()\n {\n $('select[name=\"dropFastSellType\"]').live('change', function()\n {\n $('.frmFastSellsType').submit();\n });\n }", "title": "" }, { "docid": "fef12eb6fd8202ce08f32bba104bfe11", "score": "0.55122316", "text": "handleSelect() {\n if (this.select.name == \"All\") {\n this.filters.switcher = \"\";\n this.filters.select = \"\";\n this.switcher = {\n data: [{ id: 0, model: 'sale', icon: '/img/sale.png', value: false },\n { id: 1, model: 'priority', icon: '/img/clock.png', value: false },\n { id: 2, model: 'bookmarked', icon: '/img/heart.png', value: false }\n ]\n }\n } else {\n this.filters.select = this.select.name;\n }\n\n this.filter_status_text = this.select.name;\n this.filter_status_color = this.select.color;\n }", "title": "" }, { "docid": "fe58bfd780e0f0e381c14fc0eb6e6d88", "score": "0.5511374", "text": "function PaisChange() {\n loadEstadosbyPais($(\"#MainContent_cmbPais\").val());\n}", "title": "" }, { "docid": "c04c23f71825f7f58d3355eb4e2dac52", "score": "0.55059016", "text": "set_country (num) {\n cy.get(\".dropdown-trigger\")\n .last()\n .click();\n cy.get(\".dropdown-item\")\n .eq(num)\n .click();\n }", "title": "" }, { "docid": "31f6374241aad557cf981370fd767449", "score": "0.5503926", "text": "function currencyListChangeHandler(currency) {\n console.debug('change event triggered for currency list to ' + currency);\n chosenCurrency = currency;\n for (let index in chosenProductPlan) {\n document.getElementById(index + '-currency').innerHTML = chosenCurrency;\n }\n calculatePerSeatPrice();\n indicateCurrentPlan(currentPlanNode[chosenProduct].planName);\n}", "title": "" }, { "docid": "2946fc6bf4ede8fdd4c0bda7495f578f", "score": "0.550205", "text": "function setEventosComoBoxes() {\n\n\n $(\"#cmbtipovehiculo\").change(function() {\n var valor_cmbtipovehiculo = $(this).children(':selected').text();//$(this).val();\n actualizarVistaClasificacionLlantas(valor_cmbtipovehiculo)\n $(\"#txtconsecutivovehiculo\").trigger('change');\n });\n\n}", "title": "" }, { "docid": "02804d96a511fc3741c58037eccfd632", "score": "0.5501789", "text": "function handleChartDropdownChange() {\n $(\"#chart-select\").on('change', () => {\n selectedChart = $('#chart-select').val();\n displayAccountAnalytics(selectedAccountData);\n })\n}", "title": "" }, { "docid": "69efa2fd59af2e089e7e0b62c1b9e6ba", "score": "0.5500456", "text": "function navigation_select() {\n if (Data.navigation.filter != null) {\n if (Data.navigation.filter.placeholder != null) {\n var t;\n // Ajout du placeholder pour application de sa taille\n Data.navigation.filter.dropdownlist.appendChild(\n Data.navigation.filter.placeholder\n );\n t = Data.navigation.filter.placeholder.getElementsByClassName(\n 'epjs_option'\n )[0];\n // Ouverture du menu hors de la zone visible\n Data.navigation.filter.button.tag.style.width = '';\n Data.navigation.filter.dropdown.style.position = 'absolute';\n Data.navigation.filter.dropdown.style.transform =\n 'translate(-9000px, 0)';\n Data.navigation.filter.container.setAttribute('data-open', 'true');\n Data.navigation.filter.placeholder.style.display = 'inline-block';\n t.removeAttribute('data-disabled');\n Data.navigation.filter.container.style.maxWidth =\n Data.navigation.filter.placeholder.offsetWidth + 60 + 'px';\n // Fermeture du menu\n Data.navigation.filter.container.removeAttribute('data-open');\n Data.navigation.filter.dropdown.style.position = '';\n Data.navigation.filter.dropdown.style.transform = '';\n Data.navigation.filter.dropdown.style.minWidth =\n Data.navigation.filter.container.offsetWidth + 'px';\n Data.navigation.filter.dropdown.style.width =\n Data.navigation.filter.container.offsetWidth + 'px';\n // Suppression du placeholder apres le calcul\n t.setAttribute('data-disabled', true);\n Data.navigation.filter.dropdownlist.removeChild(\n Data.navigation.filter.placeholder\n );\n } else {\n Data.navigation.filter.container.style.maxWidth = '';\n }\n }\n }", "title": "" }, { "docid": "1ffbd7395d05aab9ef20ff995731a9e3", "score": "0.5499351", "text": "onOk() {\n activeCommodity(productid, status)\n }", "title": "" }, { "docid": "1bc49512d883f8b840b062e7e640292c", "score": "0.54951066", "text": "function setSelectedDomain(activeDomain) {\n var dName = document.getElementById(\"domainName\"); \n\t//console.log(\"Set selected domain called \" + activeDomain);\n for(var i = 0; i < dName.options.length; i++) {\n if (activeDomain.indexOf(dName.options[i].value) !== -1) {\n dName.selectedIndex = i;\n\t\t\t \n break;\n }\n } // end of FOR loop\n} // end of setSelectedDomain", "title": "" }, { "docid": "842f5568a93c17aa4b9011c9b82e9f8f", "score": "0.5494797", "text": "function changeBl() {\n\t//alert(\"Changing Building1\");\n\tdetailsTabController.changeBlRes();\n}", "title": "" }, { "docid": "db47d52654e084c341b978bda685ef03", "score": "0.54947054", "text": "function handleChangeSelect() {\n goToSelectCountry();\n paintBarGraph();\n}", "title": "" }, { "docid": "ee030a080d490f4566780b9b6e96bdc1", "score": "0.54917794", "text": "function changeComputerInfo() {\n let selection = computerList;\n let getIndexOfSelectedComputer = selection.getElementsByTagName(\"option\")[selection.selectedIndex].index;\n \n for (let i = 0; i < computersArray.length; i++) {\n if(getIndexOfSelectedComputer == computersArray[i].index) {\n laptopFeatures.innerHTML = computersArray[i].features;\n laptopPhoto.src = computersArray[i].photoLink;\n laptopModel.innerHTML = computersArray[i].model;\n laptopDescription.innerHTML = computersArray[i].description;\n laptopPrice.innerHTML = computersArray[i].price + ' ' + computersArray[i].currency;\n }\n }\n}", "title": "" }, { "docid": "9da6197315fe60c1a85ca0d16f5f32ea", "score": "0.5490619", "text": "onChangeSelect(control, selectedOption) {\n\t\t\t\t\n if(control === \"Delivery_Team\" )\n this.loadConditionalValues(selectedOption.value);\n \n this.setState({\n [control] : selectedOption\n }) \n }", "title": "" }, { "docid": "70343fe90c03333091050c6a410497c9", "score": "0.5468348", "text": "function cusChangeView(){\n\t\t$('.e-custome-view').click(function(){\n\t\t\t$('.e-custome-team ul li').toggleClass('active');\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "cffad662e4e1b3fa87ba966f2f8acb0b", "score": "0.54428357", "text": "function BlockCompany() {\n\n}", "title": "" }, { "docid": "cdffac860173b5098c88ae1ab92d4300", "score": "0.54397625", "text": "function ActivitySelected() {\n UpdateVehicleTypes();\n}", "title": "" }, { "docid": "f7c2c77807b670409ad1647f6e44e981", "score": "0.5434648", "text": "function updateDropDownList(dropDownList, cls, func) {\n // Update drop downlist\n console.log(dropDownList); \n $(dropDownList).empty();\n trains.forEach(function(scheduleInfo, index) { \n $(dropDownList).append($(\"<a class=\\\"\" + cls + \" dropdown-item\\\" id=\\\"\" + index + \"\\\" href=\\\"#\\\">\" + scheduleInfo.trainName + \"</a>\"));\n });\n $(\".\"+ cls).click(func);\n }", "title": "" }, { "docid": "5e520cc3c8d37f6aec0dc292714a5ef2", "score": "0.54283255", "text": "function showTenants() {\n\tactiveListWindow = $('.companyContainer .list-window');\n\tactiveTblWrapper = $('.companyContainer .tbl_wrapper');\n\tstateActiveWindow = 'comb';\n\tnoListing();\n\tlistAll();\n\t$('.activeCompDetail').removeClass('activeCompDetail');\n\tsetTimeout(function() {\n\t\tprepKeyboard(activeTblWrapper, activeListWindow);\n\t}, 900);\n\tif ((stateSlideShow === true) && (slideShowSize != 'standard')) { // runs if Tenants button is clicked while full slideshow is running\n\t\tconsole.debug('SLIDESHOW IS TRUE === COMPANY FUNCTION ==========================');\n\t\tstateSlideShow = false; // prevents idle timer 'active' cycle from running\n\t\tdirectoryTextHide();\n\t\t$('#tsSlideshow').fadeOut(300, function() {\n\t\t\t$('.directoryContainer').fadeIn(300);\n\t\t\tif ($('.companyContainer').hasClass('activeLeft')) {\n\t\t\t\t$('#scrollSearch').delay(900).fadeIn(300).addClass('controlOn');\n\t\t\t}\n\t\t});\n\t}\n\tif ($('.companyContainer').hasClass('activeLeft')) {\n\t\t$('.companyContainer').delay(300).fadeIn();\n\t\tconsole.debug('Tenants Button - Combined is Active already');\n\t} else {\n\t\tif (!$('.directoryContainer').hasClass('activeFull') ) { // if Map is active\n\t\t\tconsole.debug('Tenants Button - 1');\n\t\t\t$('.activeFull').toggleClass('activeFull').fadeOut(function() {\n\t\t\t\t$('.directoryContainer').delay(300).fadeIn().toggleClass('activeFull');\n\t\t\t\t$('.companyContainer').delay(300).fadeIn().toggleClass('activeLeft');\n\t\t\t\tif (slideShowSize == 'standard') {\n\t\t\t\t\t$('#tsSlideshow').delay(300).fadeIn();\n\t\t\t\t}\n\t\t\t\tif (adaValue === false) {\n\t\t\t\t\t$('#scrollSearch').delay(300).fadeIn();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif ((!$('.companyContainer').hasClass('activeLeft') ) && ($('.directoryContainer').hasClass('activeFull') )) { // if comb list not active\n\t\t\tconsole.debug('Tenants Button - 2 - Return from Other Lists');\n\t\t\t$('.activeLeft').toggleClass('activeLeft').fadeOut( function(){\n\t\t\t\t$('.companyContainer').delay(300).fadeIn().toggleClass('activeLeft');\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "aa7035042606919d43b147f0e1ead6ea", "score": "0.5425779", "text": "getOneCompany() {\n this.adminService.getOneCompany(sessionStorage.token, this.findOneCom.controls['companyId'].value).subscribe((company) => {\n this.oneCompany = company;\n this.findOneCom.controls['companyId'].setValue(\"\");\n }, (err) => {\n console.log(err);\n this.findOneCom.controls['companyId'].setValue(\"\");\n });\n }", "title": "" }, { "docid": "5a49694ecf033e0f9f1abea59b393798", "score": "0.5422243", "text": "function onOrgAbbrChange(onChange) {\n var abbr = document.getElementById('organization_abbr');\n abbr.addEventListener('change', function(e) {\n onChange(e.target.value);\n });\n}", "title": "" }, { "docid": "345c7548a058f0622993e96dca8a05db", "score": "0.54219264", "text": "function afterSelectCraftsperson(fieldName, newValue, oldValue){\n document.getElementById(fieldName).value = newValue;\n enableField(\"helpdesk_sla_steps.cf_id\");\n disableField(\"helpdesk_sla_steps.em_id\");\n disableField(\"helpdesk_sla_steps.vn_id\");\n $(\"helpdesk_sla_steps.role\").value = \"\";\n enableRadioButtons(\"multiple_required\", false);\n}", "title": "" }, { "docid": "82d30cadf09e1903db1e3c644c7173f4", "score": "0.5418958", "text": "function ActivaComboDestE() {\n $('#selSalidaCost').change(function () {\n var detVenta = {\n idSalida: $('#selSalidaCost').val()\n };\n LlamaRecupDestVta(detVenta);\n });\n\n $('#selMSalidaCost').change(function () {\n var detVenta = {\n idSalida: $('#selMSalidaCost').val()\n };\n LlamaRecupDestVtaM(detVenta);\n });\n}", "title": "" }, { "docid": "3e07ebc821b972c840cf229c154de425", "score": "0.5410978", "text": "function updateSelect() {\n \n var obj;\n\n if($(\"input[name=province]:checked\", \"#setCouncil\").val() == \"Ourense\") {\n $(\"#councilChooserTitle\").text(\"Ourense\");\n obj = JSON.parse(concOurense);\n } else if ($(\"input[name=province]:checked\", \"#setCouncil\").val() == \"Pontevedra\") {\n $(\"#councilChooserTitle\").text(\"Pontevedra\");\n obj = JSON.parse(concPontevedra);\n } else if ($(\"input[name=province]:checked\", \"#setCouncil\").val() == \"Lugo\") {\n $(\"#councilChooserTitle\").text(\"Lugo\");\n obj = JSON.parse(concLugo);\n } else if ($(\"input[name=province]:checked\", \"#setCouncil\").val() == \"Coruna\") {\n $(\"#councilChooserTitle\").text(\"A Coru\\u00f1a\");\n obj = JSON.parse(concCoruna);\n }\n\n $('#selectCouncil').find('option').remove().end();\n\n $.each(obj.items, function (i, item) {\n $(\"#selectCouncil\").append($(\"<option>\", { \n value: item.idConc,\n text : item.nome \n }));\n \n if (document.getElementById('jqueryMobile') !== null) {\n $(\"#selectCouncil\").selectmenu(\"refresh\");\n }\n });\n}", "title": "" }, { "docid": "c72301a7ea02d435fbe3d8974d9203cd", "score": "0.5407711", "text": "function setCTSelectHandlers() {\n\t\tgoogle.visualization.events.addListener(sgCharts.chamberTable, 'select', function() {\n\t\t\t// get selected row\n\t\t\tvar selectedItem = sgCharts.chamberTable.getSelection()[0];\n\t\t\tif (selectedItem) {\n\t\t\t\t// get chamber number from row and set active chamber\n\t\t\t\t// if(!sgCharts.getIsActive()) {\n\t\t\t\t\tsgCharts.setActive(sgCharts.dtChamberTable.getValue(selectedItem.row, 0));\n\t\t\t\t// } else {\n\t\t\t\t// \tsgCharts.setActive(selectedItem.row + 1);\n\t\t\t\t// }\n\t\t\t\t// show inactive form and return if active chamber table chamber is inactive\n\t\t\t\t// if(sgCharts.getIsActive() && (sgCharts.dtChamberTable.getValue(selectedItem.row, 1) === false)) {\n\t\t\t\tif(sgCharts.dtChamberTable.getValue(selectedItem.row, 1) === false) {\n\t\t\t\t\t$('#sg-dashboard-div').hide();\n\t\t\t\t\t$('#sg-chamberinfo').hide();\n\t\t\t\t\t$('#add-number').text(sgCharts.getActive());\n\t\t\t\t\t$('#add-title').val('');\n\t\t\t\t\t$('#sg-notactive').show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// hide inactive form if shown\n\t\t\t\t$('#sg-notactive').hide();\n\t\t\t\t// show general chamber info\n\t\t\t\t// if(sgCharts.getIsActive()){\n\t\t\t\t\t$('#chamber-number').text('Chamber ' + sgCharts.getActive());\n\t\t\t\t\t$('#chamber-title').text(sgCharts.dtChamberTable.getValue(selectedItem.row, 3));\n\t\t\t\t\tif(sgCharts.dtChamberTable.getValue(selectedItem.row, 2) === 'Cooling') {\n\t\t\t\t\t\t$('#chamber-type').text('Cooling Chamber');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#chamber-type').text('Heating Chamber');\n\t\t\t\t\t}\n\t\t\t\t\t$('#sg-update-details-text').val(sgCharts.dtChamberTable.getValue(selectedItem.row, 6));\n\t\t\t\t\t$('#deactivate-chamber').show();\n\t\t\t\t// } else {\n\t\t\t\t// \t$('#chamber-number').hide();\n\t\t\t\t// \t$('#deactivate-chamber').hide();\n\t\t\t\t// \t$('#sg-update-details').hide();\n\t\t\t\t// \t$('#chamber-title').text(sgCharts.dtChamberTable.getValue(selectedItem.row, 1));\n\t\t\t\t// \tif(sgCharts.dtChamberTable.getValue(selectedItem.row, 0) === 'Cooling') {\n\t\t\t\t// \t\t$('#chamber-type').text('Cooling Chamber');\n\t\t\t\t// \t} else {\n\t\t\t\t// \t\t$('#chamber-type').text('Heating Chamber');\n\t\t\t\t// \t}\n\t\t\t\t// \t$('#sg-update-details-text').val(sgCharts.dtChamberTable.getValue(selectedItem.row, 4));\n\t\t\t\t// }\n\t\t\t\t$('#sg-chamberinfo').show();\n\t\t\t\t// get data for selected table and populate tables in dashbaord\n\t\t\t\tsetupDashboard();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "a575e2976280a32bfe2af226e58a8504", "score": "0.540358", "text": "function viewCompanyDetails(company_id, type)\n{\n companyid = company_id;\n $.ajax({\n url: \"/get/company/details/\"+company_id,\n type: 'GET',\n dataType: 'json',\n success: function(result){\n if(result.success == 'true') {\n\n var active_tab = $('#wizardControl a.btn-primary').attr('id');\n var active_step = $('.tab-content div.active').attr('id');\n $('#'+active_step).removeClass('active');\n $('#step1').addClass('active');\n $('#'+active_tab).removeClass('btn-primary');\n $('#'+active_tab).addClass('btn-default');\n $('#basic_info_tab').removeClass('btn-default');\n $('#basic_info_tab').addClass('btn-primary');\n\n if(result.data.company_detail.entity_type_id == 3 || result.data.company_detail.entity_type_id == 4) {\n $('#license_tab').addClass('license-show');\n } else {\n $('#license_tab').removeClass('license-show');\n }\n if(result.data.company_detail.company_status == '1' && result.data.entity_type != '2') {\n $('#btn-display').css('display','block');\n } else {\n $('#btn-display').css('display','none');\n }\n\n if(result.data.entity_type == '2') {\n $('.foc-update-section').css('display','block');\n if (result.data.company_detail.foc == '1') {\n $(\"#foc_update_enable\").prop(\"checked\", true);\n $(\"#foc_update_enable\").attr('checked', 'checked');\n }else {\n $(\"#foc_update_disable\").prop(\"checked\", true);\n $(\"#foc_update_disable\").attr('checked', 'checked');\n }\n\n }else {\n $('.foc-update-section').css('display','none');\n }\n\n $('#company_registration_no').val(result.data.company_detail.company_reg);\n $('#company_entity_type').val(result.data.company_detail.company_type);\n $('#name_of_business').val(result.data.company_detail.company_name);\n\n if(type == 0) {\n if(result.data.company_detail.company_status==1){\n $(\"#suspend-company\").remove();\n $(\"#approve-company\").remove();\n $(\"#reject-company\").remove();\n $(\"#un-suspend-company\").remove();\n $(\"#approve-pending-company\").remove();\n $('.btn-footer').append('<button type=\"button\" class=\"btn btn-danger pull-right\" id=\"reject-company\" style=\"display: block; margin: 3px;\">Reject</button>');\n $('.btn-footer').append('<button type=\"button\" class=\"btn btn-success pull-right\" data-dismiss=\"modal\" id=\"approve-company\" style=\"display: block; margin: 3px;\">Approve</button>');\n $('#approve-pending-company').css(\"display\",\"block\")\n }else if(result.data.company_detail.company_status==2){\n $(\"#approve-company\").remove();\n $(\"#suspend-company\").remove();\n $(\"#reject-company\").remove();\n $(\"#un-suspend-company\").remove();\n $(\"#approve-pending-company\").remove();\n $('.btn-footer').append('<button type=\"button\" class=\"btn btn-primary pull-right\" data-dismiss=\"modal\" id=\"suspend-company\" style=\"display: block; margin: 3px;\">Suspend</button>');\n } else if(result.data.company_detail.company_status==6){\n $(\"#approve-company\").remove();\n $(\"#suspend-company\").remove();\n $(\"#reject-company\").remove();\n $(\"#un-suspend-company\").remove();\n $(\"#approve-pending-company\").remove();\n $('.btn-footer').append('<button type=\"button\" class=\"btn btn-primary pull-right\" data-dismiss=\"modal\" id=\"un-suspend-company\" style=\"display: block; margin: 3px;\">Un-Suspend</button>');\n } else {\n //$('#suspend-company').css(\"display\",\"none\")\n //$('#approve-company').css(\"display\",\"none\")\n //$('#approve-pending-company').css(\"display\",\"none\")\n //$('#reject-company').css(\"display\",\"none\")\n\n $(\"#suspend-company\").remove();\n $(\"#approve-company\").remove();\n $(\"#reject-company\").remove();\n $(\"#un-suspend-company\").remove();\n $(\"#approve-pending-company\").remove();\n }\n } else {\n $(\"#suspend-company\").remove();\n $(\"#approve-company\").remove();\n $(\"#reject-company\").remove();\n $(\"#un-suspend-company\").remove();\n $(\"#approve-pending-company\").remove();\n }\n\n $('#company-details-modal').modal('show');\n }\n }\n });\n}", "title": "" } ]
86b614424ca77f6cd63467e4a99fe125
This function constructs a post's HTML
[ { "docid": "e52d4c80374f0b7cd80772fb01d8dddf", "score": "0.0", "text": "function createNewRow(post) {\n var newPostPanel = $(\"<div>\");\n newPostPanel.addClass(\"panel panel-default bg-inverse text-white\");\n\n var newPostPanelBody = $(\"<div>\");\n newPostPanelBody.addClass(\"panel-body bg-inverse text-white\");\n \n var newPostCelebName = $(\"<h2>\");\n var newPostDateofDeath = $(\"<h4>\");\n var newPostCauseofDeath = $(\"<h4>\");\n var newPostUsername = $(\"<p>\");\n\n newPostCelebName.text(post.name);\n newPostDateofDeath.text(\"predicted death date: \" + post.deathdate);\n newPostCauseofDeath.text(\"casue of death: \" + post.causeofdeath);\n newPostUsername.text(\"posted by: \" + post.username);\n\n newPostPanelBody.append(newPostCelebName);\n newPostPanelBody.append(newPostDateofDeath);\n newPostPanelBody.append(newPostCauseofDeath);\n newPostPanelBody.append(newPostUsername);\n newPostPanel.prepend(newPostPanelBody);\n newPostPanelBody.data(\"post\", post);\n return newPostPanel;\n }", "title": "" } ]
[ { "docid": "0a40b4b0e5a46e32a5369ebec5a577de", "score": "0.7468867", "text": "function makePost(post) {\n\tlet article = document.createElement('article');\n\tlet output = `<h6>${post.date}</h6>`;\n\toutput += `<h3>${post.title}</h3>`;\n\toutput += `<p>${post.body}</p>`;\n\toutput += `<p class=\"read-more\"><a href=\" ${post.url} \" target=\"_blank\" id=\"link2\">Read More...</a></p>`;\n\tarticle.innerHTML = output;\n\tblogOutput.appendChild(article);\n}", "title": "" }, { "docid": "5ae274ce4443226b2ddc3eee7c776207", "score": "0.74336976", "text": "function formatSinglePost(Post){\n\n var postHtmlString = '<div style=\"clear:both\"></div>';\n\n var thumbnail = '';\n\n if(Post.postType === 'link'){\n postHtmlString += '<div class=\"image-container\">' + Post.thumbnail + '</div>'; \n }\n\n postHtmlString += '<div class=\"post\">' + anchorFormat(Post.title) + ' by ' \n + '<a class=\"user\" onclick=\"openInNewTab(\\'http://reddit.com/u/' + Post.author + '\\');\">'\n + Post.author + '</a> in <a class=\"sub\" onclick=\"openInNewTab(\\'http://reddit.com/r/' + Post.sub + '\\');\">'\n + Post.sub + '</a><p class=\"post-info\"><a class=\"user\" onclick=\"openInNewTab(\\'http://reddit.com/u/' \n + User.name + '\\');\">' + User.name + '</a> ' + Post.karma + ' points '\n + Post.time.substr(0, 10) + '</p>';\n\n if(Post.postType === 'comment'){\n postHtmlString += '<p class=\"post-comment\">' + Post.comment + '</p>'; \n }\n \n postHtmlString += '<p class=\"full-comments\">' + anchorFormat(Post.fullComments) + '</p>'\n + '</div><div style=\"clear:both\"></div>';\n\n return postHtmlString;\n}", "title": "" }, { "docid": "b373ed16a95aa71ed825c05e16e3322b", "score": "0.73922485", "text": "function post_post(post) {\n let p = document.createElement('p');\n p.innerHTML = `${post.name} (${post.time}): ${post.content}`;\n p.setAttribute('class', 'post_content');\n document.querySelector('#postbox').append(p);\n return;\n}", "title": "" }, { "docid": "e2ec29ce0f07f464cbe8fb2ecb0d4315", "score": "0.73003", "text": "function createPostHtml( data ) {\n\n\t\t\tif( optionsValue.postStyle === 'timeline' ) {\n\t\t\t\tvar html = '';\n\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t // Get Image\n\t\t\t\t if (data[i]._links['wp:featuredmedia']) {\n\t\t\t\t var feature_image = 'style=\"background-image: url(' + data[i]._embedded['wp:featuredmedia'][0].source_url + ');\"';\n\t\t\t\t } else {\n\t\t\t\t var feature_image = '';\n\t\t\t\t }\n\t\t\t\t // Get Date\n\t\t\t\t var getPostDate = new Date(data[i].date);\n\n\t\t\t\t html += '<article class=\"bddex-timeline-post bddex-timeline-column\">';\n\t\t\t\t html += '<div class=\"bddex-timeline-bullet\"></div>';\n\t\t\t\t html += '<div class=\"bddex-timeline-post-inner\">';\n\t\t\t\t html += '<a class=\"bddex-timeline-post-link\" href=\"' + data[i].link + '\" title=\"' + data[i].title.rendered + '\">';\n\t\t\t\t html += '<time datetime=\"' + get_post_date(getPostDate) + '\">' + get_post_date(getPostDate) + '</time>';\n\t\t\t\t html += '<div class=\"bddex-timeline-post-image\" ' + feature_image + ' ></div>';\n\t\t\t\t if ( settingsValue.showExcerpt == 1 ) {\n\t\t\t\t html += '<div class=\"bddex-timeline-post-excerpt\">';\n\t\t\t\t html += '' + data[i].excerpt.rendered.split(/\\s+/).slice(0, settingsValue.excerptLength).join(\" \");\n\t\t\t\t html += '</div>';\n\t\t\t\t }\n\t\t\t\t if ( settingsValue.showTitle == 1 ) {\n\t\t\t\t html += '<div class=\"bddex-timeline-post-title\">';\n\t\t\t\t html += '<h2>' + data[i].title.rendered + '</h2>';\n\t\t\t\t html += '</div>';\n\t\t\t\t }\n\t\t\t\t html += '</a>';\n\t\t\t\t html += '</div>';\n\t\t\t\t html += '</div>';\n\t\t\t\t html += '</article>';\n\t\t\t\t}\n\t\t\t\toptionsValue.postContainer.append(html);\n\t\t\t}else if( optionsValue.postStyle === 'grid' ) {\n\t\t\t\tvar html = '';\n\t\t\t\tfor( var i = 0; i < data.length; i++ ) {\n\t\t\t\t\t// Get Image\n\t\t\t\t\tif( data[i]._links['wp:featuredmedia'] ) {\n\t\t\t\t\t\tvar feature_image = '<img src=\"'+data[i]._embedded['wp:featuredmedia'][0].source_url+'\" />';\n\t\t\t\t\t}else {\n\t\t\t\t\t\tvar feature_image = '';\n\t\t\t\t\t}\n\t\t\t\t\t// Get Date\n\t\t\t\t\tvar getPostDate = new Date( data[i].date );\n\n\t\t\t\t\thtml += '<article class=\"bddex-grid-post bddex-post-grid-column\">';\n\t\t\t\t\thtml += '<div class=\"bddex-grid-post-holder\">';\n\t\t\t\t\thtml += '<div class=\"bddex-grid-post-holder-inner\">';\n\t\t\t\t\tif( data[i]._links['wp:featuredmedia'] ) {\n\t\t\t\t\t\thtml += '<div class=\"bddex-entry-media\">';\n\t\t\t\t\t\thtml += '<div class=\"bddex-entry-overlay\">';\n\t\t\t\t\t\thtml += '<a href=\"'+data[i].link+'\"></a>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\tif( settingsValue.showImage == 1 ) {\n\t\t\t\t\t\t\thtml += '<div class=\"bddex-entry-thumbnail\">'+feature_image;\n\t\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '<div class=\"bddex-entry-wrapper\">';\n\n\t\t\t\t\thtml += '<header class=\"bddex-entry-header\">';\n\t\t\t\t\tif( settingsValue.showTitle == 1 ) {\n\t\t\t\t\t\thtml += '<h2 class=\"bddex-entry-title\"><a class=\"bddex-grid-post-link\" href=\"'+data[i].link+'\" title=\"'+data[i].title.rendered+'\">'+data[i].title.rendered+'</a></h2>';\n\t\t\t\t\t}\n\t\t\t\t\tif( settingsValue.showMeta == 1 && settingsValue.metaPosition == 'meta-entry-header') {\n\t\t\t\t\t\thtml += '<div class=\"bddex-entry-meta\">';\n\t\t\t\t\t\thtml += '<span class=\"bddex-posted-by\"><a href=\"'+data[i]._embedded.author[0].link+'\">'+data[i]._embedded.author[0].name+'</a></span>';\n\t\t\t\t\t\thtml += '<span class=\"bddex-posted-on\"><time datetime=\"'+get_post_date( getPostDate )+'\">'+get_post_date( getPostDate )+'</time></span>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</header>';\n\n\t\t\t\t\thtml += '<div class=\"bddex-entry-content\">';\n\t\t\t\t\tif( settingsValue.showExcerpt == 1 ) {\n\t\t\t\t\t\thtml += '<div class=\"bddex-grid-post-excerpt\">';\n\t\t\t\t\t\thtml += '<p>'+data[i].excerpt.rendered.split( /\\s+/ ).slice( 0, settingsValue.excerptLength ).join( \" \" )+'...</p>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</div>';\n\t\t\t\t\thtml += '</div>';\n\t\t\t\t\tif( settingsValue.showMeta == 1 && settingsValue.metaPosition == 'meta-entry-footer' ) {\n\t\t\t\t\t\thtml += '<div class=\"bddex-entry-footer\">';\n\t\t\t\t\t\thtml += '<div class=\"bddex-author-avatar\">';\n\t\t\t\t\t\thtml += '<a href=\"'+data[i]._embedded.author[0].link+'\">';\n\t\t\t\t\t\thtml += '<img src=\"'+data[i]._embedded.author[0].avatar_urls[96]+'\" class=\"avatar avatar-96 photo\" />';\n\t\t\t\t\t\thtml += '</a>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\thtml += '<div class=\"bddex-entry-meta\">';\n\t\t\t\t\t\thtml += '<div class=\"bddex-posted-by\">';\n\t\t\t\t\t\thtml += '<a href=\"'+data[i]._embedded.author[0].link+'\">'+data[i]._embedded.author[0].name+'</a>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\thtml += '<div class=\"bddex-posted-on\">';\n\t\t\t\t\t\thtml += '<time datetime=\"'+get_post_date( getPostDate )+'\">'+get_post_date( getPostDate );\n\t\t\t\t\t\thtml += '</time>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</div>';\n\t\t\t\t\thtml += '</article>';\n\t\t\t\t}\n\t\t\t\toptionsValue.postContainer.append( html );\n\t\t\t}else if( optionsValue.postStyle === 'block' ) {\n\t\t\t\tvar html = '';\n\t\t\t\tfor ( var i = 0; i < data.length; i++ ) {\n\t\t\t\t // Get Image\n\t\t\t\t if ( data[i]._links['wp:featuredmedia'] ) {\n\t\t\t\t var feature_image = '<img src=\"' + data[i]._embedded['wp:featuredmedia'][0].source_url + '\" />';\n\t\t\t\t } else {\n\t\t\t\t var feature_image = '';\n\t\t\t\t }\n\t\t\t\t // Get Date\n\t\t\t\t var getPostDate = new Date( data[i].date );\n\n\t\t\t\t html += '<article class=\"bddex-post-block-item bddex-post-block-column\">';\n\t\t\t\t html += '<div class=\"bddex-post-block-item-holder\">';\n\t\t\t\t html += '<div class=\"bddex-post-block-item-holder-inner\">';\n\t\t\t\t if ( settingsValue.showImage == 1 ) {\n\t\t\t\t html += '<div class=\"bddex-entry-media\">';\n\t\t\t\t html += '<div class=\"bddex-entry-overlay\">';\n\t\t\t\t html += '<a href=\"' + data[i].link + '\"></a>';\n\t\t\t\t html += '</div>';\n\t\t\t\t html += '<div class=\"bddex-entry-thumbnail\">' + feature_image;\n\t\t\t\t html += '</div>';\n\t\t\t\t html += '</div>';\n\t\t\t\t }\n\t\t\t\t html += '<div class=\"bddex-entry-wrapper\">';\n\n\t\t\t\t html += '<header class=\"bddex-entry-header\">';\n\t\t\t\t if ( settingsValue.showTitle == 1 ) {\n\t\t\t\t html += '<h2 class=\"bddex-entry-title\"><a class=\"bddex-grid-post-link\" href=\"' + data[i].link + '\" title=\"' + data[i].title.rendered + '\">' + data[i].title.rendered + '</a></h2>';\n\t\t\t\t }\n\t\t\t\t if ( settingsValue.showMeta == 1 && settingsValue.metaPosition == 'meta-entry-header' ) {\n\t\t\t\t html += '<div class=\"bddex-entry-meta\">';\n\t\t\t\t html += '<span class=\"bddex-posted-by\"><a href=\"' + data[i]._embedded.author[0].link + '\">' + data[i]._embedded.author[0].name + '</a></span>';\n\t\t\t\t html += '<span class=\"bddex-posted-on\"><time datetime=\"' + get_post_date( getPostDate ) + '\">' + get_post_date( getPostDate ) + '</time></span>';\n\t\t\t\t html += '</div>';\n\t\t\t\t }\n\t\t\t\t html += '</header>';\n\n\t\t\t\t html += '<div class=\"bddex-entry-content\">';\n\t\t\t\t if ( settingsValue.showExcerpt == 1 ) {\n\t\t\t\t html += '<div class=\"bddex-grid-post-excerpt\">';\n\t\t\t\t html += '<p>' + data[i].excerpt.rendered.split(/\\s+/).slice( 0, settingsValue.excerptLength ).join( \" \" ) + '</p>';\n\t\t\t\t html += '</div>';\n\t\t\t\t }\n\t\t\t\t html += '</div>';\n\t\t\t\t html += '</div>';\n\t\t\t\t if ( settingsValue.showMeta == 1 && settingsValue.metaPosition == 'meta-entry-footer' ) {\n\t\t\t\t html += '<div class=\"bddex-entry-footer\">';\n\t\t\t\t html += '<div class=\"bddex-author-avatar\">';\n\t\t\t\t html += '<a href=\"' + data[i]._embedded.author[0].link + '\">';\n\t\t\t\t html += '<img src=\"' + data[i]._embedded.author[0].avatar_urls[96] + '\" class=\"avatar avatar-96 photo\" />';\n\t\t\t\t html += '</a>';\n\t\t\t\t html += '</div>';\n\t\t\t\t html += '<div class=\"bddex-entry-meta\">';\n\t\t\t\t html += '<div class=\"bddex-posted-by\">';\n\t\t\t\t html += '<a href=\"' + data[i]._embedded.author[0].link + '\">' + data[i]._embedded.author[0].name + '</a>';\n\t\t\t\t html += '</div>';\n\t\t\t\t html += '<div class=\"bddex-posted-on\">';\n\t\t\t\t html += '<time datetime=\"' + get_post_date( getPostDate ) + '\">' + get_post_date( getPostDate );\n\t\t\t\t html += '</time>';\n\t\t\t\t html += '</div>';\n\t\t\t\t html += '</div>';\n\t\t\t\t html += '</div>';\n\t\t\t\t }\n\t\t\t\t html += '</div>';\n\t\t\t\t html += '</article>';\n\t\t\t\t}\n\t\t\t\toptionsValue.postContainer.append( html );\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "4357de3104fd0976d6520da58d267a11", "score": "0.70213276", "text": "function makePost(link, story, time, message, postImage, videoSource, description) {\r\n var one = '<div class=\"row card-panel\"><div class=\"col s2\" align=\"center\"><img class=\"circle responsive-img profilePic\" src=\"';\r\n var two = '\"></div><div class=\"col s10\"><div class=\"row\"><div class=\"col s10 left\"><h5>';\r\n var three = '</h5></div><div class=\"col s10\">';\r\n var four = '</div></div></div><div class=\"col s12 flow-text center-align\">';\r\n var five = '</div><div class=\"col s12\">';\r\n var six = '</div><div class=\"col s12\" align=\"center\"><img class=\"postImages responsive-img materialboxed\" src=\"';\r\n var seven = '\"></div></div>';\r\n var eight = '\"><video class=\"responsive-video\" controls><source src=\"';\r\n var nine = '\" type=\"video/mp4\"></video></div></div>';\r\n if (videoSource == \"\") {\r\n $(\".postsContainer\").append(one + link + two + story + three + time + four + message + five + description + six + postImage + seven);\r\n } else\r\n $(\".postsContainer\").append(one + link + two + story + three + time + four + message + five + description + six + \"\" + eight + videoSource + nine);\r\n }", "title": "" }, { "docid": "afd3894dfb3b251119375d57ed543a2b", "score": "0.6851884", "text": "function createPostHTML(id, title, text) {\n const article = document.createElement('article');\n\n // template string\n const summaryText = text && text.length > 150 ? text.substring(0, 150) + \"...\" : text;\n article.innerHTML = `\n <h1>${title}</h1>\n <p>${summaryText}</p>\n <a href=\"./edit-post.html?id=${id}\">Edit</a>\n `\n return article;\n}", "title": "" }, { "docid": "b00c087d00b6aa42a8753a054592752a", "score": "0.6825333", "text": "function writeNewPostsHTML(postsArray){\n\n var wallElement = document.getElementById('wall');\n var topPost = document.getElementsByClassName(\"post\")[0];\n \n for(var i in postsArray){ \n var postDiv = document.createElement(\"div\"); \n createPost(postDiv,postsArray[i]);\n wallElement.insertBefore(postDiv, topPost);\n }\n}", "title": "" }, { "docid": "9389bcafd352e0368db7c262ff0b1c6d", "score": "0.68216187", "text": "function createPostHtml(postData) {\n \n const postedBy = postData.postedBy;\n\n if(postedBy===undefined || postedBy._id === undefined) {\n return console.log(\"User object not populated\");\n }\n\n const displayName = postedBy.firstName + \" \" + postedBy.lastName;\n const timestamp = timeDifference(new Date(),new Date(postData.createdAt));\n \n let replyFlag = \"\";\n if (postData.replyTo && postData.replyTo._id) {\n if (!postData.replyTo._id) {\n return alert(\"Reply to is not populated\");\n } else if (!postData.replyTo.postedBy._id) {\n return alert(\"Posted by is not populated\");\n }\n\n const replyToUsername = postData.replyTo.postedBy.username;\n replyFlag = `<div class='replyFlag'>\n Replying to <a href='/profile/${replyToUsername}'>@${replyToUsername}<a>\n </div>`;\n }\n return `<div class='post' data-id='${postData._id}'>\n\n <div class='mainContentContainer'>\n <div class='userImageContainer'>\n <img src='${postedBy.profilePic}'>\n </div>\n <div class='postContentContainer'>\n <div class='header'>\n <a href='/profile/${postedBy.username}' class='displayName'>${displayName}</a>\n <span class='username'>@${postedBy.username}</span>\n <span class='date'>${timestamp}</span>\n <div>${replyFlag}</div>\n \n </div>\n <div class='postBody'>\n <span>${postData.content}</span>\n </div>\n <div class='postFooter'>\n <div class='postButtonContainer'>\n <button class=\"comment\" data-bs-toggle=\"modal\" data-bs-target=\"#replyModal\">\n <i class='far fa-comment'></i>\n </button>\n </div>\n <div class='postButtonContainer green'>\n <button class='retweet'>\n <i class='fas fa-retweet'></i>\n </button>\n </div>\n <div class='postButtonContainer red'>\n <button class='likeButton'>\n <i class='far fa-heart'></i>\n <span>${postData.likes.length||\"\"}</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>`;\n}", "title": "" }, { "docid": "4e005a2ae794ae74454e0a3b47195dd3", "score": "0.681961", "text": "function renderPost(post) {\n return $(`\n <div class=\"post-card\">\n <header>\n <h3>${post.title} </h3>\n <h4>~ By ${post.user.username}</h4>\n </header>\n <p>${post.body}</p>\n <footer>\n <div class=\"comment-list\"></div>\n <a href=\"#\" class=\"toggle-comments\">(<span class=\"verb\">show</span> comments)</a>\n </footer>\n </div>\n `).data('post', post);\n}", "title": "" }, { "docid": "0ac2b371eb9063b29ec6bf9b12bd1e51", "score": "0.6815648", "text": "function createPostHtml(postData){\n //returning -> textBox-value\n //-- postData => complete database of Post --\n //return postData.content;\n\n //--------------------------\n //CHECK if Post is retweeted\n //---------------------------\n //Is the post retweeted\n var isRetweet = postData.retweetData != undefined;\n //console.log(isRetweet);\n\n //Retweeted by\n var retweetedBy = isRetweet ? postData.postedBy.username : null;\n\n //If Post isRetweeted => set the postData to retweetedData\n postData = isRetweet? postData.retweetData : postData;\n\n /** RETWEETED POST html TEXT **/\n var retweetText='';\n //Set retweet Text (if post is retweeted)\n if(isRetweet){\n var retweetText = `<span>\n <i class=\"fas fa-retweet\"></i>\n Retweeted by <a href='/profile/${retweetedBy}'>@${retweetedBy}</a>\n </span>`\n }\n //------------------------\n\n //Extracting user info. from postData\n var postedBy = postData.postedBy;\n var displayName = postedBy.firstName +\" \"+ postedBy.lastName;\n \n //timeStamp\n //var timeStamp = postData.createdAt;\n var timeStamp = timeDifference(new Date(), new Date(postData.createdAt));\n\n //** Check if postData EXISTS (passed)**/\n if(postData == undefined){\n return console.log(\"Post object is null\");\n }\n\n\n //Check if no user for Post Exists =>Post not populated for 'User' data\n if(postedBy._id === undefined){\n console.log('POST -> User object not Populated')\n }\n\n //*****MAKE LIKE BUTTON still active when user refresh the page*****\n //if user is logged in -> show likes(red)\n //Show all Posts liked by the user -> when user is logged in\n var likeButtonActiveClass = postData.likes.includes(userJs._id)? \"active\":\" \";\n \n //*****MAKE RETWEET BUTTON still active when user refresh the page*****\n //if user is logged in -> show retweets(green)\n //Show all Posts Retweeted by the user -> when user is logged in\n var retweetButtonActiveClass = postData.retweetUsers.includes(userJs._id)? \"active\":\" \";\n\n\n //Give POST_id -> to eachPost - data-id='${postData._id}'\n return `<div class='post' data-id='${postData._id}'>\n <!-- If POST is Retweeted-->\n <div class='postActionContainer'>\n ${retweetText}\n </div>\n\n <!-- Main Post Container -->\n <div class='mainContentContainer'>\n <div class='userImageContainer'> \n <img src='${postedBy.profilePic}'>\n </div>\n <div class='postContentContainer'>\n <div class='header'>\n <a href='/profile/${postedBy.username}' class='displayName'>${displayName}</a>\n <span class='userName'>@${postedBy.username}</span>\n <span class='date'>${timeStamp}</span>\n </div>\n <div class='postBody'>\n <span>${postData.content}</span>\n </div>\n <div class='postFooter'>\n <div class='postButtonContainer'>\n <button>\n <i class=\"far fa-comments\"></i>\n </button>\n </div>\n <div class='postButtonContainer green'>\n <button class='retweetButton ${retweetButtonActiveClass}'>\n <i class=\"fas fa-retweet\"></i>\n <span>${postData.retweetUsers.length || \"\"}</span>\n </button>\n </div>\n <div class='postButtonContainer red'>\n <button class='likeButton ${likeButtonActiveClass}'>\n <i class=\"far fa-heart\"></i>\n <span>${postData.likes.length || \"\"}</span>\n </button>\n </div>\n </div>\n </div> \n </div>\n <div>`;\n }", "title": "" }, { "docid": "d3bd69b7f994c471023348dd16bdc7d6", "score": "0.67994964", "text": "function makePost(text, timestamp){\n\n\tvar html = \t\"<h4>\" + text + \"</h4>\"\n\thtml +=\t\t\"<br>\"\n\thtml +=\t\t\"<h6>\" + timestamp + \"</h4>\"\n\thtml += \t\"<hr><br>\"\n\n\treturn html\n}", "title": "" }, { "docid": "6ecc4dc2c88fad60c0f5faf067beebbf", "score": "0.6797955", "text": "function postComponent(state) {\n return '\\\n <div class=\"partner-feed-post\"> \\\n <a href=\"'+ state.url +'\" target=\"blank\"> \\\n <img src=\"'+ state.image +'\"> \\\n <div class=\"title\">'+ state.title +'</div> \\\n </a> \\\n </div> \\\n ';\n }", "title": "" }, { "docid": "b2a98ec7fc56078765caf8ba7420d632", "score": "0.67954415", "text": "function generatepost(i){\n\t\tvar newpostdiv = document.createElement('div');\n\t\tnewpostdiv.style.border=\"1px solid #ccc\";\n\t\tswitch(postArray[i].type){\n\t\t\tcase \"manual\":\n\t\t\t var newname = document.createElement('div');\n\t\t\t newname.innerHTML = postArray[i].name;\n\t\t\t newname.setAttribute(\"class\",\"manual_name\");\n\t\t\t var newtagdiv = document.createElement('div');\n\t\t\t var newtag = document.createElement('img');\n\t\t\t newtagdiv.appendChild(newtag);\n\t\t\t newtag.setAttribute(\"class\",\"tag\");\n\t\t\t newtag.style.width=\"15%\";\n\t\t\t newtag.setAttribute(\"src\",\"images/AFF.png\");\n\t\t\t var newimagediv = document.createElement('div');\n\t\t\t var newimage = document.createElement('img');\n\t\t\t newimagediv.appendChild(newimage);\n\t\t\t newimagediv.style.width=\"100%\";\n\t\t\t newimage.setAttribute(\"src\",postArray[i].image);\n\t\t\t newimage.style.width=\"100%\";\n\t\t\t var newtext = document.createElement('div');\n\t\t\t newtext.innerHTML=postArray[i].text;\n\t\t\t newtext.setAttribute(\"class\",\"manual_text\");\n\t\t\t var newlinktext = document.createElement('a');\n\t\t\t newlinktext.setAttribute(\"class\",\"manual_linktext\");\n\t\t\t newlinktext.setAttribute(\"href\",postArray[i].link);\n\t\t\t newlinktext.setAttribute(\"target\",\"blank\");\n\t\t\t newlinktext.innerHTML=postArray[i].linktext;\n\t\t\t newpostdiv.appendChild(newtagdiv);\n\t\t\t newpostdiv.appendChild(newname);\n\t\t\t newpostdiv.appendChild(newimage);\n\t\t\t newpostdiv.appendChild(newtext);\n\t\t\t newpostdiv.appendChild(newlinktext);\n\t\t\t newpostdiv.setAttribute(\"class\",\"postbox manual\");\n\t\t\t postbody.appendChild(newpostdiv);\n\t\t\t break;\n\t\t\tcase \"twitter\":\n\t\t\t var newname = document.createElement('div');\n\t\t\t newname.setAttribute(\"class\",\"twitter_name\");\n\t\t\t newname.innerHTML = postArray[i].name;\n\t\t\t var newtagdiv = document.createElement('div');\n\t\t\t var newtag = document.createElement('img');\n\t\t\t newtag.setAttribute(\"class\",\"tag\");\n\t\t\t newtagdiv.appendChild(newtag);\n\t\t\t newtag.style.width=\"15%\";\n\t\t\t newtag.setAttribute(\"src\",\"images/twitter.png\");\n\t\t\t var newusername = document.createElement('div');\n\t\t\t newusername.setAttribute(\"class\",\"twitter_username\");\n\t\t\t newusername.innerHTML=postArray[i].username;\n\t\t\t var newtweet = document.createElement('div');\n\t\t\t newtweet.setAttribute(\"class\",\"twitter_tweet\");\n\t\t\t newtweet.innerHTML=postArray[i].tweet;\n\t\t\t newpostdiv.appendChild(newtagdiv);\n\t\t\t newpostdiv.appendChild(newname);\n\t\t\t newpostdiv.appendChild(newusername);\n\t\t\t newpostdiv.appendChild(newtweet);\n\t\t\t newpostdiv.setAttribute(\"class\",\"postbox twitter\");\n\t\t\t postbody.appendChild(newpostdiv);\n\t\t\t break;\n\t\t\tcase \"instagram\":\n\t\t\t var newname = document.createElement('div');\n\t\t\t newname.setAttribute(\"class\",\"instagram_name\");\n\t\t\t newname.innerHTML = postArray[i].name;\n\t\t\t var newtagdiv = document.createElement('div');\n\t\t\t var newtag = document.createElement('img');\n\t\t\t newtag.setAttribute(\"class\",\"tag\");\n\t\t\t newtagdiv.appendChild(newtag);\n\t\t\t newtag.style.width=\"15%\";\n\t\t\t newtag.setAttribute(\"src\",\"images/instagram.png\");\n\t\t\t var newimagediv = document.createElement('div');\n\t\t\t var newimage = document.createElement('img');\n\t\t\t newimagediv.appendChild(newimage);\n\t\t\t newimagediv.style.width=\"100%\";\n\t\t\t newimage.setAttribute(\"src\",postArray[i].image);\n\t\t\t newimage.style.width=\"100%\";\n\t\t\t var newusername = document.createElement('div');\n\t\t\t newusername.setAttribute(\"class\",\"instagram_username\");\n\t\t\t newusername.innerHTML=postArray[i].username;\n\t\t\t var newcaption = document.createElement('div');\n\t\t\t newcaption.setAttribute(\"class\",\"instagram_caption\");\n\t\t\t newcaption.innerHTML=postArray[i].caption;\n\t\t\t newpostdiv.appendChild(newtagdiv);\n\t\t\t newpostdiv.appendChild(newname);\n\t\t\t newpostdiv.appendChild(newimage);\n\t\t\t newpostdiv.appendChild(newusername);\n\t\t\t newpostdiv.appendChild(newcaption);\n\t\t\t newpostdiv.setAttribute(\"class\",\"postbox instagram\");\n\t\t\t postbody.appendChild(newpostdiv);\n\t\t\t break;\n\t\t\tdefault:\n\t\t\t break;\n\t\t} \n\t}", "title": "" }, { "docid": "905e205f221ef66e2c9c4d96014b7614", "score": "0.6754382", "text": "function buildPostHtml(data) {\n var htmlDoc =\n \"<!DOCTYPE html>\" +\n \"<html lang=\\\"zxx\\\">\" +\n \"<head>\" +\n \"<meta charset=\\\"UTF-8\\\">\" +\n \"<title>Archive</title>\" +\n \"<link href=\\\"../../../stylesheets/style.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\" +\n \"<link href=\\\"../../../semantic/dist/semantic.min.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\" +\n \"</head>\" +\n\n \"<body>\" +\n \"<header class=\\\"ui vertical masthead center aligned segment\\\">\" +\n \"<h1 class=\\\"ui blue header\\\">NOW!</h1>\" +\n \"<nav>\" +\n \"<a href=\\\"../../../\\\">Home</a> | <a href=\\\"../\\\">Now</a> | <a href=\\\"/users/\" + data.username + \"/archive/\\\">Past</a>\" +\n \"</nav>\" +\n \"</header>\" +\n\n \"<main>\" +\n \"<div class=\\\"ui middle aligned center aligned segment\\\">\" +\n //<img class=\\\"ui middle aligned center medium rounded image\\\" src=\\\"driving.gif\\\">\n \"<div class=\\\"content\\\">\" +\n // Data\n \"<div class=\\\"post\\\">\" +\n \"<h4>\" + data.post.title + \"</h4>\" +\n \"<img src=\\\"\" + data.post.image + \"\\\">\" +\n \"<p>\" + data.post.blog + \"</p>\" +\n \"<p>\" + data.post.date + \"</p>\" +\n \"</div>\" +\n // End\n \"</div>\" +\n \"</div>\" +\n \"</main>\" + \n\n \"<footer>\" + \n \"<div class=\\\"ui vertical footer segment\\\">\" + \n \"<div class=\\\"ui container\\\">\" + \n \"<div class=\\\"ui center aligned stackable divided equal height stackable grid\\\">\" + \n \"<div class=\\\"three wide column\\\">\" + \n \"<div class=\\\"contact\\\">\" + \n \"<h5>Contact Us</h5>\" + \n \"<p>BATMAN Street</p>\" + \n \"<p>BATMAN CAVE</p>\" + \n \"</div>\" + \n \"</div>\" + \n \"</div>\" + \n \"</div>\" + \n \"</div>\" + \n \"</footer>\" + \n\n \"<script src=\\\"../../../semantic/dist/semantic.min.js\\\"></script>\" + \n \"<script src=\\\"http://code.jquery.com/jquery-2.0.3.min.js\\\"></script>\" + \n \"</body>\" + \n \"</html>\";\n return htmlDoc;\n}", "title": "" }, { "docid": "ce2e0c6e53b92deffc5d51d44aff60c8", "score": "0.666368", "text": "function buildForumEntry(post)\n {\n var titleAndType = '<div><span class=\"forum-title\">'+post.title+'</span>'+buildType(post.type)+'</div>';\n var author = '<div class=\"forum-author\">By: '+post.author+' on '+formatDate(post.date)+'</div>';\n var owner = '<div class=\"forum-owner\">'+post.owner+'</div>';\n var body = '<pre>'+post.body+'</pre>';\n var comment = '';\n var commentBtn = '<div class=\"btn-group\"><a class=\"btn btn-mini btn-primary btn-forum-comment\" id=\"\"><i class=\"icon-comment icon-white\"></i> comment</a></div>';\n var expandBtn = '<div class=\"btn-group\"><a class=\"btn btn-mini btn-inverse btn-forum-comment-show\" id=\"\"><i class=\"icon-plus-sign icon-white\"></i> show</a></div>';\n var deleteBtn = '';\n var footer = '<hr style=\"border-top: 1px dotted #b0b0b0;border-bottom: 0px\">';\n var entry;\n if(post.owner == $.cookie(\"owner\"))\n {\n deleteBtn = '<div class=\"btn-group\"><a class=\"btn btn-mini btn-danger btn-forum-comment-del\" id=\"\"><i class=\"icon-remove-sign icon-white\"></i> delete</a></div>';\n }\n if(post.comments.length > 0)\n {\n comment = buildComments(post.comments);\n entry = '<div class=\"forum-post\">'+titleAndType+author+owner+body+deleteBtn+commentBtn+expandBtn+comment+footer+'</div>';\n }\n else\n {\n entry = '<div class=\"forum-post\">'+titleAndType+author+owner+body+deleteBtn+commentBtn+footer+'</div>';\n }\n return entry;\n }", "title": "" }, { "docid": "27bb1a414cc3373237ec3fc6271d91ca", "score": "0.6659546", "text": "function createPost(post) {\n //create post container:\n var postContainer = $('<div>', {\n id: 'post' + post._id,\n class: 'post'\n });\n // post header\n postHeader = getPostHeader(post);\n postHeader.appendTo(postContainer);\n // post body\n postBody = getPostBody(post);\n postBody.appendTo(postContainer);\n // post footer\n postFooter = getPostFooter(post);\n postFooter.appendTo(postContainer);\n // post comments\n postComments = getPostComments(post._id, post.commentsCount, post.comments);\n postComments.appendTo(postContainer);\n\n return postContainer;\n}", "title": "" }, { "docid": "46cd489935128746ac165f2d7624a0cb", "score": "0.66124976", "text": "function writeOldPostsHTML(postsArray){\n\n var wallElement = document.getElementById('wall');\n\n for(var i in postsArray){ \n\n var postDiv = document.createElement(\"div\"); \n createPost(postDiv,postsArray[i]);\n wallElement.appendChild(postDiv);\n }\n\n}", "title": "" }, { "docid": "6c2000764264813aee4e14c7c789496a", "score": "0.66112137", "text": "function creatpost(cty, repo) {\n return `\n <div class=\"post\">\n <h2 class=\"post-title\">${cty}</h2>\n <div class=\"post-body\">\n <ul>\n <li>\n <p class=\"nbr\">${repo.confirmed}</p>\n <p class=\"label\">Confirmed</p>\n </li>\n <li>\n <p class=\"nbr\">${repo.deaths}</p>\n <p class=\"label\">Deaths</p>\n </li>\n <li>\n <p class=\"nbr\">${repo.recovered}</p>\n <p class=\"label\">Recovered</p>\n </li>\n </ul>\n </div>\n </div>\n `;\n}", "title": "" }, { "docid": "2bc7ffdf417837b355021133162f926d", "score": "0.66092247", "text": "function renderPosts(posts) {\n\n // Get the DOM element that will contain the posts.\n var postsDiv = document.getElementById(\"posts\");\n\n posts.forEach(function (post) {\n\n // Create the DOM elements.\n var postDiv = document.createElement(\"div\"),\n postNameDiv = document.createElement(\"a\"),\n postContentDiv = document.createElement(\"div\");\n\n // Set the content of each element.\n postNameDiv.innerHTML = post.name;\n postNameDiv.setAttribute('href', \"#post\" + post.id);\n postContentDiv.innerHTML = post.content;\n\n // Set CSS classes on each div so they can be styled.\n postDiv.setAttribute(\"class\", \"post\");\n postNameDiv.setAttribute(\"class\", \"post-name\");\n postContentDiv.setAttribute(\"class\", \"post-content\");\n\n // Assemble the post div.\n postDiv.appendChild(postNameDiv);\n postDiv.appendChild(postContentDiv);\n\n // Add the post div to the container for posts.\n postsDiv.appendChild(postDiv);\n });\n }", "title": "" }, { "docid": "d3b5b8981029e97206b7970161122169", "score": "0.66087687", "text": "function createHtml(postsData){\n var myHtmlString = '';\n\n for(i=0; i < postsData.length ; i++ ){\n //featured image via registered field in functions.php\n var myImg = postsData[i].my_featured_image_src;\n //var imgLink = postsData[i]._links['wp:attachment'][0].href;\n\n //Acf custom field (uses plugin to add acf/REST support)\n var testField = postsData[i].acf.test_field;\n\n myHtmlString += '<div class=\"col-md-6 data-wrap\">'\n myHtmlString += '<h2>' + postsData[i].title.rendered + '</h2>';\n myHtmlString += '<div class=\"col-md-6 no-padding-left\">' + postsData[i].excerpt.rendered + '</div>';\n\n myHtmlString += '<img src=\"' + myImg + '\" />';\n //console.log();\n\n myHtmlString += '</div>';\n\n //for reference\n //myHtmlString += postsData[i]._links['wp:attachment'][0].href;\n\n }\n\n postsContainer .innerHTML = myHtmlString;\n\n}", "title": "" }, { "docid": "19483387a33954e9d105f1f738a9a376", "score": "0.6593899", "text": "function render(posts) {\n\n const container = document.querySelector('.js-blogPosts');\n container.innerHTML = '';\n const postsReverse = posts.reverse();\n for (const post of postsReverse) {\n\n const div = document.createElement('div');\n div.innerHTML = `\n <article class=\"container box style1 right postinput blogBox\">\n <img class=\"image fit\"src=\"images/${post.data.image}\" alt=\"\" />\n <div class=\"inner\">\n <header>\n <h2><a href=\"#/post/${post.id}\">${post.data.title}</a></h2>\n </header>\n <p class=\"previewText\">${post.data.post}</p>\n <span><a href=\"#/post/${post.id}\">-Read more</a></span>\n </div>\n </article>\n `;\n container.appendChild(div);\n };\n }", "title": "" }, { "docid": "c7056bff57b08107f027e73d0db08f79", "score": "0.6546267", "text": "html(attrs) {\n if (attrs.cloaked) return \"\";\n\n return this.attach(\n \"post-article\",\n Object.assign({}, attrs, {\n topicData: this.parentWidget.attrs.topicData\n })\n );\n }", "title": "" }, { "docid": "0788085aad91912d2804f480f96b77a3", "score": "0.6539209", "text": "function createPost () {\n list.html(null);\n $.post( URL + '/posts', { \n title: 'Kobe is the best player',\n body: 'and this is why...'}, \n function(response){\n var li = $('<li> Post Title: ' + response.title + '<br>Post Body: ' + response.body + '<br>Post ID: ' + response.id + '</li>')\n list.append(li);\n });\n content.html(list);\n }", "title": "" }, { "docid": "4c1f33ba5c4bc91bd70fa3840778b97b", "score": "0.65020436", "text": "function createPost(event) {\n // event.preventDefault()\n let title = document.getElementById(\"title\").value;\n let body = document.getElementById(\"body\").value;\n let author = document.getElementById(\"author\").value;\n\n console.log(\"!!\");\n\n let pageTemplate = document.getElementById(\"page-template\");\n\n let templateFn = _.template(pageTemplate.innerHTML)\n\n let postDiv = document.getElementById(\"post\")\n\n let templateHTML = templateFn({ title: title, body: body, author: author })\n\n postDiv.innerHTML += templateHTML\n\n\n\n // put variables in an object\n // send object into template function and return html string\n // append html string\n}", "title": "" }, { "docid": "eb534d8d0268d8ebc5bbf1e9e90b0469", "score": "0.6497748", "text": "function postAppender( post ){\n\t$(\"<div id=status-id_\"+post.post_id+\" class='box status'><div id='Status_head'><img alt='S.writer' src='user-pics/\"+ post.user_profile_picture +\"'><div><a href='profile.php?id=\"+ post.user_id +\"'>\"+ post.user_firstname + \" \" + post.user_lastname +\"</a><br><a href='post.php?post-id=\"+post.post_id+\"'><span class='postSince'>\"+ post.post_time_ago +\"</span></a></div></div><div id='status_content'><p>\"+ post.post_content +\"</p></div><div id='status_footer'>\" +\n\t\t\t\"<div class='comments-head'><span id='like' data-id='\"+post.post_id+\"' class='like'>Like</span>-<span>Comments</span><div id='the-likes'></div></div>\" +\n\t\t\t\"<div id='comments'></div><div id='comment-area'><img alt='me' class='profile-photo'><textarea placeholder='Leave a comment...' data-stid='\"+post.post_id+\"'></textarea></div></div></div>\").appendTo(\"#posts\").hide().fadeIn();\n}", "title": "" }, { "docid": "57c365acc8aa742d68bb7060144c8bab", "score": "0.64548546", "text": "function createPostElement(userName, userBlobKey, businessName, postBlobKey, caption) {\n const postElement = document.createElement('div');\n postElement.classList = \"post\";\n var content = `\n <div class=\"post-subwrapper space-between\">\n <div class=\"post-header\">\n <img id=\"post-avatar\" src=\"/serve?blob-key=${userBlobKey}\" class=\"post-profile-photo\">\n <div class=\"post-user-business\">\n <p class=\"boldest-text\">${userName}</p>\n <p>${businessName}</p>\n </div>\n </div>\n <img class=\"post-share-icon\" src=\"/images/post_share_icon.png\">\n </div>\n <img src=\"/serve?blob-key=${postBlobKey}\" class=\"post-photo image-resizing\">\n <div class=\"post-line-height\"> \n <div class=\"post-subwrapper\">\n <div class=\"space-between\">\n <p>\n <span class=\"post-margin-right\">\n <img class=\"heart-icon\" src=\"/images/heart_icon.svg\">\n </span>\n 482\n </p>\n <p>2 hours ago</p>\n </div>\n <p>\n <span class=\"boldest-text\">${userName}</span>\n ${caption}\n </p>\n <p class=\"post-view-all\" onclick=\"viewAllPostComments()\"> View all 294 comments</p>\n <p>\n <span class=\"boldest-text\">Sarah Wu</span>\n Love this photo!\n </p>\n <p>\n <span class=\"boldest-text\">Smruthi Balajee</span>\n Wow, I'd really love to visit this place sometime!\n </p>\n <hr class=\"line-break-lighter\">\n <textarea class=\"post-comments\" id=\"add-comment\" placeholder=\"Commenting publicly...\"\n onkeypress=\"addComment(event)\"></textarea>\n </div>\n </div>\n `;\n postElement.innerHTML = content;\n return postElement;\n}", "title": "" }, { "docid": "ec9736792a5d42e4ddd74ee99daa1df8", "score": "0.6453336", "text": "function displayPost(username,createdate,triptext){\n\tvar ele = \"<div class='row oldpost'><div class='col-lg-9'><strong>\"+username+\"</strong></div>\"+\n\t \t\t\"<div class='col-lg-3'><strong>\"+createdate+\"</strong></div>\"+\n\t \t\t\"<div class='col-lg-12'><textarea cols='120' disabled>\"+triptext+\"</textarea></div></div>\";\n\treturn ele;\n\n}", "title": "" }, { "docid": "8b24ba56a27231b4fd280b073edb5a06", "score": "0.64233816", "text": "function renderOnePost(post) {\n\n const mainContainer = document.querySelector('.js-to-hide');\n mainContainer.style.display = \"none\";\n\n\n const postContainer = document.querySelector('.js-one-post');\n postContainer.style.display = \"block\";\n\n postContainer.innerHTML = '';\n \n const div = document.createElement('div');\n postContainer.innerHTML = `\n <a href=\"../index.html\">Back to home</a>\n <header>\n <img class=\"image fit\"src=\"images/${post.data.image}\" alt=\"\" />\n <h2>${post.data.title}</h2>\n <p>${post.data.post}</p>\n </header>\n <section>\n <hr />\n <header>\n <p></p>\n </header>\n </section>\n <div id=\"disqus_thread\"></div>\n\n `;\n postContainer.appendChild(div);\n // };\n }", "title": "" }, { "docid": "3185bb6c76bfb082e9969a868bab4612", "score": "0.64066947", "text": "function renderBlog(posts) {\n const postContainer = $('<ul></ul>');\n posts.fetch({\n success: () => {\n posts.forEach((post, i, arr) => {\n //should have used .get for these\n let singlePost = (`\n <li>\n <h1>${post.attributes.title}</h1>\n <p>${post.attributes.body}</p>\n </li`);\n console.log('*');\n postContainer.append(singlePost);\n });\n }\n });\n return postContainer;\n}", "title": "" }, { "docid": "f48a058a40e6bc58d5ee3821a8e0e48b", "score": "0.63865715", "text": "generateHTMLtemplate(data) {\n var mydata = data;\n var ret = ``;\n if (mydata.length > 1) {\n mydata.forEach(function(element){\n element.forEach(function(elem){\n if (elem.type == \"page\" || elem.type == \"post\") {\n ret += `${elem.content.rendered}`;\n }\n })\n })\n }\n else {\n ret += `${mydata[0].content.rendered}`;\n }\n return ret;\n }", "title": "" }, { "docid": "e851e012968c921b312e8eed4c530b65", "score": "0.6378643", "text": "function createPost(protoClass='proto-post'\n , imgSrc='https://static.scientificamerican.com/blogs/cache/file/638FC5CE-96EC-46DA-AAC64985822092FE_source.jpg?w=590&h=800&BDB89ACC-71A2-463A-928419A181070C770'\n , postContent, authorUsername , authorImg){\n let newPost = document.getElementsByClassName(protoClass)[0].cloneNode(true)\n newPost.getElementsByTagName('img')[0].src = authorImg\n newPost.getElementsByTagName('img')[1].src = imgSrc\n newPost.getElementsByTagName('h1')[0].textContent = authorUsername\n newPost.getElementsByTagName('p')[0].textContent = postContent\n return newPost;\n}", "title": "" }, { "docid": "fb777a3cdf37d0b926d71a0256f98064", "score": "0.6375588", "text": "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"post/post.html\");\n let css = await fetch(\"post/post.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n let pageDom = document.createElement(\"div\");\n pageDom.innerHTML = html;\n\n this._app.setPageTitle(\"Neuen Post\", {isSubPage: true});\n this._app.setPageCss(css);\n this._app.setPageHeader(pageDom.querySelector(\"header\"));\n this._app.setPageContent(pageDom.querySelector(\"main\"));\n\n let submitBtn = document.getElementById(\"button-submit\");\n submitBtn.addEventListener(\"click\", function (){save();});\n\n db=this._app;\n // Fertig bearbeitetes HTML-Element zurückgeben\n return pageDom;\n }", "title": "" }, { "docid": "aeecd69a9454d631634e49b451cce5a1", "score": "0.6375488", "text": "function createPost(postDiv,postJson){\n postDiv.innerHTML = '';\n postDiv.className=\"post\";\n postDiv.setAttribute(\"post-id\",postJson.id);\n var postContentDiv = document.createElement(\"div\"); \n appendText(postContentDiv,postJson.text, \"post-text\");\n appendText(postContentDiv,postJson.dateTime, \"post-footer-text\");\n postDiv.appendChild(postContentDiv);\n var a = document.createElement('a');\n var linkText = document.createTextNode(\"Load older comments\");\n var commentSectionDiv = document.createElement(\"div\");\n var commentTextSectionDiv = document.createElement(\"div\");\n appendCommentText(commentTextSectionDiv, postJson.comment_array);\n commentSectionDiv.appendChild(commentTextSectionDiv);\n createCommentInput(commentSectionDiv, postJson.id);\n \n a.appendChild(linkText);\n a.title = \"Load older comments\";\n a.href = \"javascript:void(0);\";\n a.onclick = function() {updateOldComments(commentTextSectionDiv);};\n postDiv.appendChild(a);\n\n postDiv.appendChild(commentSectionDiv);\n}", "title": "" }, { "docid": "9aff350804a0c40e2ea674ba728d71c9", "score": "0.6369067", "text": "function get_full_post(id, title, body){\n document.getElementById(\"full_post_col\").style.display = \"block\";\n var full_Post = document.getElementById(\"full_post\");\n full_Post.innerHTML = \"\";\n\n var post_List = document.getElementById(\"read_blog\");\n post_List.className = \"col-lg-6 col-md-6 col-sm-12 col-xs-12\";\n\n var post_Content = document.createElement(\"div\");\n var post_Title = document.createElement(\"h4\");\n post_Title.innerHTML = title;\n post_Content.appendChild(post_Title);\n \n var post_Body = document.createElement(\"p\");\n post_Body.innerHTML = body;\n post_Content.appendChild(post_Body);\n\n var post_Comment = document.createElement(\"div\");\n full_Post.appendChild(post_Content);\n\n show_comments(id);\n}", "title": "" }, { "docid": "46c65ebd9392e4c03185721b6c547c72", "score": "0.63574487", "text": "function renderPosts(data) {\n post1.innerHTML = null;\n const cardBox = document.createElement(\"h3\");\n cardBox.textContent = \"POSTS\";\n post1.appendChild(cardBox);\n\n data.forEach((element) => {\n const postUser = userTrid.cloneNode(true);\n const postTitle = postUser.querySelector(\".title-turn\");\n postTitle.textContent = element.title;\n postTitle.dataset.post_id = element.id;\n postUser.querySelector(\".desk\").textContent = element.body;\n post1.appendChild(postUser);\n });\n}", "title": "" }, { "docid": "e50b70343b2da9934aa699574d355893", "score": "0.63337046", "text": "function eachfor(post) {\n\t\tvar littlePost = \"\"\n\n\t\tlittlePost = $(post.doc.content).text().slice(0, 300)\n\n\t\t$('#postArea').append(\" <div class='row'><div class='col-md-8 col-md-offset-2' >\" +\n\t\t\t\" <div class='col-md-4' >\" +\n\t\t\t\"<a href='#' class='thumbnail'> \" +\n\t\t\t\"<img src='\" + post.doc.mainimg + \"' alt=''>\" +\n\t\t\t\" </a> \" +\n\t\t\t\"</div>\" +\n\t\t\t\" <div class='col-md-8'>\" +\n\t\t\t\" <h3>\" + post.doc.title + \"</h3>\" +\n\t\t\t\"</div>\" +\n\t\t\t\"<div class='col-md-8 col-md-offset-0'>\" +\n\t\t\t\" <p>\" + littlePost + \"</p><a href='#'><h5 class='text-right' id='showPostButton_\" + post.doc._id + \"'>Read more...</h5></a> \" +\n\t\t\t\"</div>\" +\n\t\t\t\"</div>\" +\n\t\t\t\"</div>\")\n\t\tvar singlePost = post.doc\n\n\t\t$('#showPostButton_' + post.doc._id).on('click', function(e) {\n\t\t\t//svinei to periexomeno prwta\n\t\t\t$('#postArea').html('');\n\t\t\tshowSinglePost(singlePost.title, singlePost.content, singlePost.author, singlePost._id)\n\t\t\t// db.get(post.doc._id).then(function (singlePost) {\n\n\t\t\t// showSinglePost(singlePost.title, singlePost.content, singlePost.author, singlePost._id)\n\n\t\t\t// })\n\n\t\t})\n\t}", "title": "" }, { "docid": "ffe05940b78c59041e20e4b960e3ae7c", "score": "0.6313181", "text": "function renderBlogpost(data) {\n if (!Array.isArray(data)) {\n return console.error(\"ERROR: Incorrect blogpost data format.\");\n }\n if (data.length === 0) {\n return console.error(\"ERROR: Blogpost data array is empty\");\n }\n\n let HTML = \"\";\n const targetDOM = document.querySelector(\"#blog_posts\");\n\n const generateTags = tags => {\n if (!Array.isArray(tags)) {\n return console.error(\"ERROR: Incorrect blogpost.tags data format.\");\n }\n if (tags === 0) {\n return console.error(\"ERROR: blogpost.tags data array is empty\");\n }\n\n let HTML = \"\";\n\n for (let i = 0; i < tags.length; i++) {\n if (i === tags.length - 1) {\n HTML += `<a href=\"#\">${tags[i]}</a>`;\n } else {\n HTML += `<a href=\"#\">${tags[i]}</a>, `;\n }\n }\n\n return HTML;\n };\n\n for (let i = 0; i < data.length; i++) {\n const postData = data[i];\n\n HTML += `<div class=\"blogpost col-4 col-md-12 mb-30\">\n <img src=\"./img/blog/${postData.img}.jpg\" alt=\"${postData.imgAlt}\">\n <div class=\"content\">\n <div class=\"tag\">\n ${generateTags(postData.tags)}\n </div>\n <a href=\"#\">\n <h5 class=\"no-decoration\">${postData.title}</h5>\n </a>\n <p class=\"color-secondary\">${postData.description}</p>\n <div class=\"date-coment\">\n <span>${postData.date}</span>\n <span><i class=\"fa fa-comments\"></i> ${postData.comments}</span>\n </div>\n </div>\n </div>`;\n }\n\n targetDOM.innerHTML = HTML;\n}", "title": "" }, { "docid": "8460646f22859bc354c1f8ff0469af05", "score": "0.62573034", "text": "function fetch_content_post(data, service_name){\r\n var rendered_post = '';\r\n for(var i=0; i < data.length; ++i){\r\n rendered_post += '<div class=\"post post_hidden\">\\\r\n <div class=\"user-block\">\\\r\n <img class=\"img-circle img-bordered-sm\" src=\"http://'+server+'/public/assets/dist/img/profile/tips.png\" alt=\"User Image\">\\\r\n <span class=\"username\">\\\r\n <a href=\"#\">'+service_name+'</a>\\\r\n <a href=\"#\" class=\"pull-right btn-box-tool\"><i class=\"fa fa-times\"></i></a>\\\r\n </span>\\\r\n <span class=\"description\">Received '+service_name+' - '+ data[i].date +'</span>\\\r\n </div>\\\r\n <p>\\\r\n '+ data[i].content +'.\\\r\n </p>\\\r\n </div>';\r\n }\r\n return rendered_post;\r\n}", "title": "" }, { "docid": "28b0d7a842146c08552c9dead231800b", "score": "0.6256018", "text": "function montarblog(lista){\n let html = \"\";\n\n for(let i in lista){\n html += \"<h3>\"+lista[i].title+\"</h3>\";\n html += lista[i].body+\"<br/>\"\n html += \"<hr/>\"\n }\n\n document.getElementById(\"posts\").innerHTML = html;\n\n\n }", "title": "" }, { "docid": "d8d09a6e8df05e73f4220a63c80685e7", "score": "0.6253315", "text": "function renderPosts() {\n $('.posts').html('');\n for (var i=0; i<posts.length; i++) {\n $('.posts').append(`<p class=\"post\" data-postid=\"${posts[i].id}\"> \n ${posts[i].text} \n <button type=\"button\" class=\"btn btn-primary remove\" data-postid=\"${posts[i].id}\">REMOVE</button>\n </p><br>\n\n <form class=\"form-group comment-form\" data-post-id=\"${posts[i].id}\">\n <input type=\"text\" class=\"form-control name\" placeholder=\"Your name\" data-postid=\"${posts[i].id}\">\n <input type=\"text\" class=\"form-control comment\" placeholder=\"Your comment\" data-postid=\"${posts[i].id}\">\n <br><button type=\"button\" class=\"btn btn-primary add-comment\" data-postid=\"${posts[i].id}\"> Comment</button>\n </form>\n \n ${getCommentsHTML(posts[i].commentsList)}`);\n }\n bindEvent();\n}", "title": "" }, { "docid": "55744593a25c9592abb2194cb3c2f155", "score": "0.6238555", "text": "function scaffoldPost(post) {\n 'use strict';\n if (debugMode) {\n console.groupCollapsed(\"Scaffolding post\");\n }\n\n var postBackgroundColor = post.attr(\"bgcolor\"), postCells = post.children(), authorCell = postCells.eq(0);\n\n /*\n * Assign unique IDs to each post row based on the post's own ID, which\n * comes from its anchor.\n */\n authorCell.addClass(\"post_author_info\");\n var postAnchor = authorCell.children(\"a[name]\"), postID = postAnchor.attr(\"name\"),\n userLink = authorCell.children(\"span\").children('a[href*=\"user_info\"]');\n\n /*\n * Build additional links in the poster's cell: \"send PM\" and \"view photos.\"\n * TODO: Extend the post count as a link to search for all the users' posts.\n */\n userLink.addClass(\"user_link\");\n var userLinkURL = userLink.attr(\"href\"), userID = userLinkURL.split(\"=\")[1], parentSpan = userLink.parent(),\n userName = parentSpan.parent().children().filter(\"b:first\").text();\n userLink.attr(\"title\", userName);\n userLink.data(\"userid\", userID);\n var sendPM = createLink(\"mail_compose.aspx?user=\" + userID, \"send PM\", {\n title: \"Send \" + userName + \" a private message\",\n classes: [\"pm_link\"]\n });\n\n $(document.createElement(\"br\")).appendTo(parentSpan);\n sendPM.appendTo(parentSpan);\n\n $(document.createElement(\"br\")).appendTo(parentSpan);\n var viewPhotos = createLink(\"photo_folder.aspx?user=\" + userID, \"view photos\", {\n title: \"View \" + userName + \"'s photo gallery\",\n classes: [\"photo_gallery_link\"]\n });\n viewPhotos.appendTo(parentSpan);\n\n var postContentCell = postCells.eq(1), postContent = postContentCell.html();\n postContentCell.empty();\n postContentCell.addClass(\"post_message\");\n postContentCell.prepend('<div id=\"content_' + postID + '\" class=\"post_message_content content_by_' + userID + '\" style=\"margin-top: -1em;\"></div>');\n var contentDiv = $(\"#content_\" + postID);\n contentDiv.append(postContent);\n var postFooter = contentDiv.children(\"p.small\").remove();\n post.wrap('<tbody id=\"post_' + postID + '\" class=\"tww_post post_by_' + userID + '\"></tbody>');\n var postBody = $(\"tbody#post_\" + postID);\n postBody.addClass(\"post_by_\" + userID);\n postBody.append('<tr id=\"footer_' + postID + '\" class=\"post_footer\"><td align=\"right\"><div class=\"voting_links\" style=\"float: left; display: none;\"><a class=\"plain vote_link\" style=\"font-size: 11px;\" id=\"nsfw_' + postID + '\">[nsfw]</a></div></td></tr>');\n var postText = contentDiv.text();\n postCells.eq(0).attr(\"rowspan\", \"2\");\n\n postFooter.appendTo('#footer_' + postID + ' > td:first-child').parent().css(\"height\", \"15px\").attr(\"bgcolor\", postBackgroundColor);\n postBody.appendTo(\"#tww_post_table\");\n\n var scaffoldedPost = new Post(postID, postText, userName, userID);\n if (debugMode) {\n console.dir(scaffoldedPost);\n console.groupEnd(\"Scaffolding post\");\n }\n return scaffoldedPost;\n}", "title": "" }, { "docid": "20fcda19cd6cafed867cbef27d7b1c96", "score": "0.6228547", "text": "function fetch_notify_post(data){\r\n var rendered_post = '';\r\n for(var i=0; i < data.length; ++i){\r\n rendered_post += '<div class=\"post post_hidden\">\\\r\n <div class=\"user-block\">\\\r\n <img class=\"img-circle img-bordered-sm\" src=\"http://'+server+'/public/assets/dist/img/profile/notify.jpg\" alt=\"User Image\">\\\r\n <span class=\"username\">\\\r\n <a href=\"#\">'+ data[i].title +'</a>\\\r\n <a href=\"#\" class=\"pull-right btn-box-tool\"><i class=\"fa fa-times\"></i></a>\\\r\n </span>\\\r\n <span class=\"description\">Received '+ data[i].date +'</span>\\\r\n </div>\\\r\n <p>\\\r\n '+ data[i].content +'.\\\r\n </p>\\\r\n </div>';\r\n }\r\n return rendered_post;\r\n}", "title": "" }, { "docid": "84381c0959b4d66a39dbb36ddd68fbda", "score": "0.6201248", "text": "function buildPostContentByPostDate(data) {\n\tvar post_date, articleTemplate, mustacheHtml, selectionTemplate, prevMonthAgo;\n\n\t$.each(data ,function( index, value ) {\n\t\t// using moment.js to set localized date\n\t\tpost_date = moment(value.post_date);\n\t\tvalue.post_date = post_date.format(\"LL\");\n\n\t\tvar timeRangeObject = generatePostDateTimeRangeAndLable(post_date);\n\n\t\t// if new article - grouped by country\n\t\tif( prevMonthAgo === undefined || timeRangeObject.monthAgo !== prevMonthAgo ) {\n\t\t\tprevMonthAgo = timeRangeObject.monthAgo;\n\n\t\t\tvalue.article_header = timeRangeObject.lable;\n\n\t\t\t// using the mustache template to build the html for the article\t\t\t\t\t\n\t\t\tarticleTemplate = $('#postArticlePostDateTpl').html();\n\t\t\tmustacheHtml = Mustache.to_html(articleTemplate, value);\n\t\t\t$(\"div#main\").append(mustacheHtml);\n\n\t\t\t// additional id to add...\n\t\t\t$(\"div#main article\").last().attr('id', prevMonthAgo+\"month\");\n\n\t\t}\n\n\t\t// using the mustache template to build the html for the article\n\t\tselectionTemplate = $('#postSectionPostDateTpl').html();\n\t\tmustacheHtml = Mustache.to_html(selectionTemplate, value);\n\t\t$(\"#\"+prevMonthAgo+\"month\").append(mustacheHtml);\n\n\t\taddPostAttributes(value);\n\t}); // end of each() loop\n\n\t// detach (less expensive remove) the hidden articles\n\t$(\".to_delete\").detach();\n\n\t// after the DOM is completed, add the event handler\n\t$(\"section>div.post\").click(function() {\n\t\tclickOnPostHandler($(this));\n\t});\n}", "title": "" }, { "docid": "aeb3480b1899f27f5ca39b8cf2a5caaa", "score": "0.61759603", "text": "async function showPost() {\n const posts = await getPosts();\n posts.forEach(post => {\n const postElement = document.createElement('div');\n postElement.classList.add('post');\n postElement.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">\n ${post.title}\n </h2>\n <p class=\"post-body\">\n ${post.body}\n </p>\n </div>\n `;\n postsContainer.appendChild(postElement)\n })\n}", "title": "" }, { "docid": "8081debcee6714b53d4c4ecbfc00ee36", "score": "0.6175349", "text": "showPosts(posts){\n let html = '';\n\n posts.forEach(function(post){\n html += `\n <div class=\"card mb-3\">\n <div class=\"card-body\">\n <h4 class=\"card-title\">${post.title}</h4>\n <p class=\"card-text\">${post.body}</p>\n <a href=\"#\" class=\"edit card-link\" data-id=\"${post.id}\">\n <i href=\"#\" class=\"fa fa-edit\"></i>\n </a>\n <a href=\"#\" class=\"delete card-link\" data-id=\"${post.id}\">\n <i href=\"#\" class=\"fa fa-times\"></i>\n </a>\n </div>\n </div>\n `;\n })\n\n this.posts.innerHTML = html;\n }", "title": "" }, { "docid": "52ddc7f5aa303cbb5a64960341820821", "score": "0.61615574", "text": "function createNewsAndPublish(post) {\n\n\t\tif (!post.message) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Get template\n\t\tvar newsHtml = BLOG_ITEM_TEMPLATE;\n\n\t\t// Fill image\n\t\tif (post.full_picture) {\n\t\t\tnewsHtml = newsHtml.replace('{imgUrl}', post.full_picture);\n\t\t} else {\n\t\t\tnewsHtml = newsHtml.replace('{imgUrl}', IMG_URL_DEFAULT);\n\t\t}\n\n\t\t// Fill message\n\t\tvar message = '';\n\t\tif (post.message) {\n\t\t\tmessage = post.message.replace(/\\n/g, '<br>');\n\t\t}\n\t\tnewsHtml = newsHtml.replace('{message}', message);\n\n\t\t// Fill date\n\t\tconst locale = getLocale();\n\t\tconst createdTime = new Date(post.created_time);\n\t\tnewsHtml = newsHtml.replace('{month}', MONTHS[locale][createdTime.getMonth()]);\n\t\tnewsHtml = newsHtml.replace('{date}', createdTime.getDate());\n\n\t\t// Fill URL\n\t\tnewsHtml = newsHtml.split('{postUrl}').join(post.permalink_url);\n\n\t\t// Publish news\n\t\t$('#newsDiv').append(newsHtml);\n\n\t\treturn 1;\n\t}", "title": "" }, { "docid": "8f111867fed873beaf8efee2b9143207", "score": "0.6158077", "text": "function updatePost(postTitle, postDesc) {\n var lineBreak = document.createElement(\"br\");\n\n //Project post box\n var box = document.createElement(\"div\");\n box.id = 'postBox';\n\n //Create project title\n var head = document.createElement(\"h2\");\n var nodeHead = document.createTextNode(postTitle);\n head.appendChild(nodeHead);\n\n //Create project description\n var para = document.createElement(\"p\");\n var nodePara = document.createTextNode(postDesc);\n para.appendChild(nodePara);\n\n //Posts the title and description\n var element = document.getElementById('post');\n box.appendChild(head);\n box.appendChild(para);\n element.appendChild(box);\n element.appendChild(lineBreak);\n}", "title": "" }, { "docid": "8f87083e4c694bcb906946a665ed9679", "score": "0.6151572", "text": "function createHTML(sPost) {\n singlePost.innerHTML = `<div class=\"post_card\">\n <img class=\"post_img\" id=\"image_modal\" src=\"${sPost.images[0].src}\" alt=\"${sPost.images[0].alt}\">\n <div id=\"modal_container\" class=\"modal\">\n <img class=\"modal_image\" id=\"img1\">\n <span class=\"close_modal\"><i class=\"fas fa-times\"></i></span>\n </div>\n <div class=\"text_container\">\n <h2 class=\"post_name\">${sPost.name}</h2>\n ${sPost.short_description}\n ${sPost.description}\n </div>`;\n\n\n // Modal for all images on the single blog page\n\n var modal_container = document.getElementById(\"modal_container\");\n var open_image = document.getElementById(\"image_modal\");\n var modal_image = document.getElementById(\"img1\");\n open_image.onclick = function () {\n modal_container.style.display = \"block\";\n modal_image.src = this.src;\n };\n\n // Closes the modal opened on all single blog pages\n\n var span = document.getElementsByClassName(\"close_modal\")[0];\n\n span.onclick = function () {\n modal_container.style.display = \"none\";\n };\n\n window.onclick = function(event) {\n if (event.target == modal_container) {\n modal_container.style.display = \"none\"\n }\n };\n\n // Change the title of each post\n\n document.title = \"Eple's Blog\" + \" \" + \"|\" + \" \" + sPost.name;\n\n // Change the innerHTML of the single blogpage\n\n document.getElementById(\"sp_h1\").innerHTML = \"Welcome to the\" + \" \" + sPost.name + \" \" + \"post\";\n}", "title": "" }, { "docid": "6869e68722bbb3e0148c935393de719a", "score": "0.61462057", "text": "function showNewPost(post) {\n\n\t}", "title": "" }, { "docid": "66cbab78d280da66b024bc26fa859545", "score": "0.61450744", "text": "function embed(post) {\n var $ = cheerio.load(post.content());\n $('.lang.raw').each(function() {\n var content = $(this).text(),\n $pre = $(this).parent();\n\n $pre.before(content);\n $pre.remove();\n });\n\n post.content($.html());\n}", "title": "" }, { "docid": "cdfc7b38bef92c35abfc38081b59ed43", "score": "0.6129535", "text": "function render() {\n\n var titleVal = textTitle.val(); //raw title markup\n var authorVal = textAuthor.val(); //raw author markup\n var urlVal = textUrl.val(); //raw URL markup\n var categoryVal = textCategory.val(); //raw category markup\n var dateVal = textDate.val();\n var bodVal = textBody.val(); // Raw body markup\n\n\n var t = marked(titleVal); //convert title markup to html\n var b = marked(bodVal); // Convert body markup to html\n var a = marked(authorVal); //convert author markup to html\n var u = marked(urlVal); // Convert URL markup to html\n var d = marked(dateVal);\n var c = marked(categoryVal); //convert category markup to html\n var allTheBlock = t + a + u + c + b;\n\n\n\n liveRawHtmlOutput.text(allTheBlock); // Render raw markup\n pMarkOut.html(allTheBlock); // Render article preview (rendered as HTML)\n\n // Update JSON article\n mObj.title = t;\n mObj.body = b;\n mObj.category = c;\n mObj.publishedOn = d;\n mObj.author = a;\n mObj.authorURL = u;\n mObj.category = c;\n\n var secretData = {};\n\n var jsonStr = pJson.text(JSON.stringify(mObj));\n\n $.get('template.html', function(articleTemplate){\n // var articleTemplate = $('#articleTemplate').html();\n\n var secretData = mObj;\n var renderer = Handlebars.compile(articleTemplate);\n\n var compiledHtml = renderer(mObj);\n $('#pMarkOut').html(compiledHtml);\n // hljs.highlightBlock(\"#articleDemo\");\n $('pre code').each(function(i, block) {\n hljs.highlightBlock(block);\n });\n });\n }", "title": "" }, { "docid": "4c25303ce2f8e0a747ef1f869731fc28", "score": "0.61139977", "text": "function getPosts(){\n fetch(url) //http://owillz.onlinewebshop.net/wp-json/wp/V2/posts\n .then((res) => res.json())\n\n .then((data)=> {\n // function data()\n\n let content = '';\n data.forEach((post) => {\n \t//let post.categories = [Accident, Fight, Riot]\n //console.log(post.content.rendered);\n //let img = post.content.rendered.querySelector('img').src\n // console.log(img);\n \t//let category = document.getElementById('categories').innerHTML\n content += `\n \t\t\t\t\n \n\t <div class=\"${post.categories}\">\n\t <div class=\"shadow box\">\n\t <h2>${post.title.rendered}</h2>\n\t <p>${post.excerpt.rendered}</p> <span><a href=\"${post.link}\" class=\" btn btn-lg btn-outline-primary\" target=\"_blank\">Read More </a></span> <hr>\n\t\t </div> \n </div>\n \n `;\n });\n document.getElementById('content').innerHTML = content;\n })\n\n .catch((err) => alert(err))\n }", "title": "" }, { "docid": "dc2e99c9a8d664cfe49a379892cb7354", "score": "0.6105671", "text": "function createPostCard({img, title, text, link}) {\n\n const postCard = document.createElement('div');\n postCard.classList.add('card');\n\n const postImg = document.createElement('img'); \n postImg.classList.add('card__image');\n postImg.setAttribute('src', img);\n \n const postBody = document.createElement('div');\n postBody.classList.add('card__body');\n \n const postTitle = document.createElement('h2');\n postTitle.classList.add('card__title');\n postTitle.textContent = title;\n \n const postText = document.createElement('p');\n postText.classList.add('post__text');\n postText.textContent = text;\n \n const postLink = document.createElement('a');\n postLink.classList.add('post__link');\n postLink.textContent = link;\n postLink.setAttribute('href', link) \n \n postBody.append(postTitle, postText, postLink);\n postCard.append(postImg, postBody);\n\n return postCard;\n}", "title": "" }, { "docid": "f0a6706452cc37f41bd7d172680cb87f", "score": "0.60963225", "text": "function make_post(data, settings, via, hide) {\n var base = $(settings.base),\n class_char = settings.class_char;\n\n settings.total = data.count;\n\n var post = $('<div>').attr('class', 'stream-post clearfix');\n if (hide)\n post.css('display', 'none');\n post.attr('id', data.id);\n var post_content = $('<div>').attr('class', 'stream-post-content');\n\n var post_meta = $('<p>').attr('class', 'post-content-meta ' + class_char)\n var post_body = $('<p>').attr('class', 'post-content-body ' + class_char);\n\n if (!data.category) {\n var meta = '<a target=\"_blank\" class=\"username\" href=\"http://twitter.com/' + data.user + '\">@' + data.user + '</a>'\n + ' Via ' + via + ' &middot; '\n + '<time>' + moment(data.time).startOf('minute').fromNow() + '</time>';\n post_meta.html(meta);\n var text = format_tweet(data.text);\n post_body.html(text);\n } else {\n post_body = undefined;\n var cat = data.category.toLowerCase();\n var meta = '<a target=\"_blank\" href=\"http://badgerherald.com/' + cat + '\">' + data.category + ' </a>'\n + '<time>' + moment(data.time).startOf('minute').fromNow() + '</time>'\n + '<br/>' + '<a target=\"_blank\" class=\"title\" href=\"' + data.url + '\">' + data.title + '</a>';\n post_meta.html(meta);\n }\n\n var post_avatar = $('<div>').attr('class', 'stream-post-avatar');\n\n var avi = undefined;\n var img = undefined;\n\n async.series([function(callback) {\n if (!data.avi) {\n callback();\n } else {\n avi = $('<img/>').attr('src', data.avi);\n avi.on('load', function() {\n callback();\n });\n }\n }, function(callback) {\n if (!data.img) {\n callback();\n } else {\n img = $('<img/>').attr('src', data.img).css('width', '100%');\n img.on('load', function() {\n callback();\n });\n }\n }, function(callback) {\n $(post_body).find('a.testable_link').each(function(i, a) {\n IsValidImageUrl($(a), callback);\n });\n callback();\n }], function(err) {\n if (err)\n console.log('ERROR making post ' + data.id + '!');\n if (img)\n post_body.append(img);\n post_avatar.append(avi);\n post.append(post_avatar);\n post_content.append(post_meta);\n post_content.append(post_body);\n post.append(post_content);\n post.find('time').data('time', data.time);\n base.prepend(post);\n\n // Trim DOM. Basically the worst way to do this. Oh well.\n if (base.children().length > MAX_LENGTH) {\n base.children().last().remove();\n }\n\n // Keep scroll locked if not at top.\n var stream;\n if (post.is(':visible')) {\n if ($(window).width() > 768) {\n stream = base.parent();\n } else {\n stream = $(document);\n }\n if (stream.scrollTop() > 0) {\n var post_height = post.outerHeight();\n var new_top = stream.scrollTop() + post_height + parseInt(post.css('marginBottom'));\n stream.scrollTop(new_top);\n }\n }\n\n update_top_bar();\n\n });\n\n // Try to reload images after a small delay\n\n if (img) {\n img.on('error', {'img': this, 'data': data}, function() {\n setTimeout(function() {\n img.attr('src', data.img);\n }, 500);\n });\n }\n\n if (avi) {\n avi.on('error', {'img': this, 'data': data}, function() {\n setTimeout(function() {\n avi.attr('src', data.avi);\n }, 500);\n });\n }\n }", "title": "" }, { "docid": "ac534d011ad02553d54b6eca47ce9e4b", "score": "0.607997", "text": "threadsBottom() {\n\t\tlet html = parseHTML\n\t\t\t`<script id=\"postData\" type=\"application/json\">\n\t\t\t\t${JSON.stringify(_.pick(this, 'posts', 'title', 'links'))}\n\t\t\t</script>`;\n\t\tif (this.full)\n\t\t\thtml += this.pageEnd();\n\t\treturn html;\n\t}", "title": "" }, { "docid": "a796272097f87a98fec6b03d03fe78d0", "score": "0.6072454", "text": "async function showPosts() {\n const posts = await getPosts();\n\n // we take each post item in the array and loop through with the forEach and create the html and content\n posts.forEach(post => {\n const postEl = document.createElement('div');\n postEl.classList.add('post');\n postEl.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <p class=\"post-body\">${post.body}</p>\n </div>\n `;\n\n // we then append the item to the page\n postContainer.appendChild(postEl);\n })\n}", "title": "" }, { "docid": "e80b4c0fdd14e3ba92f0c9f9fc7c106e", "score": "0.60699826", "text": "function handlePostData(postData) {\n\n let published = postData.published.slice(0, 10);\n let title = postData.title;\n let content = postData.content;\n\n // regular expressions (inkább majd az adott helyre berakni!)\n const regexpLineBreaks = /\\n/g;\n const regexpPara = /<p[>| ][^&].+?>?.+?<\\/p>/g; // /<p[>| ][^<&].+?>?.+?<\\/p>/g ez volt!!!!!!!!!!\n const regexpWhiteSpace = /&nbsp;/g;\n const regexpBlogLinks = /<a href=\\\"https?:\\/\\/fenykoto.blogspot.com\\/.+?>.+?<\\/a>/g;\n const regexpPostPath = /\\/20.+?.html/g;\n const regexpLinkText = />.+?</g;\n const regexp1 = />/g;\n const regexp2 = /</g;\n const regexpBr = /<br \\/>/g;\n const regexpClosingP = /<\\/p>/g;\n const regexpOpeningP = /<p>/g;\n const regexpOpeningPLong = /<p.+?>/g;\n const regexpOriginalImage = /<a href=\\\"https?:\\/\\/[1-9].bp.blogspot.com.+?>/g;\n const regexpRawOrImgUrl = /\"https?:\\/\\/.+?\"/g;\n const regexpQuotes = /\\\"/g;\n const regexpSmallImage = /<img.+?\\/>/g;\n const regexpRawSmallImgUrl = /\"http.+?\"/g;\n\n // clearing the content from line breaks\n let clearedContent = content.replace(regexpLineBreaks, \"\");\n\n\n // CHECKING AND CHANGING THE ORIGINAL POST LINKS FOR FURTHER USAGE\n\n let blogPostLinks = Array.from(clearedContent.matchAll(regexpBlogLinks), (m) => m[0]);\n\n let blogPostPaths =[];\n let linkTexts =[];\n\n // if there is a post link in the text, extracts the path and the inner text\n if (blogPostLinks.length > 0){\n\n // extracting the post path\n blogPostLinks.forEach((postLink) => {\n let postPath = postLink.match(regexpPostPath);\n blogPostPaths.push(postPath);\n })\n\n // extracting the text from the link\n blogPostLinks.forEach((postLink) => {\n let rawLinkTextArray = postLink.match(regexpLinkText);\n let rawLinkTextString = rawLinkTextArray[0];\n let rawLinkText2 = rawLinkTextString.replace(regexp1, \"\");\n let linkText = rawLinkText2.replace(regexp2, \"\");\n linkTexts.push(linkText);\n })\n }\n \n function replacer(match){\n let postPath = match.match(regexpPostPath).join();\n let rawLinkText = match.match(regexpLinkText).join();\n let rawLinkText2 = rawLinkText.replace(regexp1, \"\");\n let linkText = rawLinkText2.replace(regexp2, \"\");\n let linkReplacer = `<span data-post-path=${postPath} class=\"post-link\">${linkText}</span>`\n return linkReplacer;\n }\n\n let textWithPostLinks = clearedContent.replace(regexpBlogLinks, replacer);\n\n\n // EXTRACTING THE \"REAL\" TEXT FROM THE CONTENT\n \n // extracting the paragraphs\n\n let rawTexts = Array.from(textWithPostLinks.matchAll(regexpPara), (m) => m[0]);\n\n let text = [];\n\n rawTexts.forEach((rawText) => {\n let text1 = rawText.replace(regexpWhiteSpace, \"\");\n let text2 = text1.replace(regexpBr, \"\");\n let text3 = text2.replace(regexpClosingP, \"\");\n let text4 = text3.replace(regexpOpeningP, \"\");\n let text5 = text4.replace(regexpOpeningPLong, \"\");\n let text6 = text5.trim(); // kell ez???\n text.push(text6);\n });\n\n console.log(text);\n\n\n // DEALING WITH THE LARGE IMAGE LINKS\n\n let rawOriginalImages = Array.from(\n clearedContent.matchAll(regexpOriginalImage),\n (m) => m[0]\n );\n\n let originalImgUrls = [];\n\n rawOriginalImages.forEach((rawOriginalImage) => {\n let rawOrImgUrl = rawOriginalImage.match(regexpRawOrImgUrl);\n let finalOrImgUrl = rawOrImgUrl[0].replace(regexpQuotes, \"\");\n originalImgUrls.push(finalOrImgUrl);\n });\n\n\n // DEALING WITH THE SMALL IMAGE LINKS\n\n let rawSmallImages = Array.from(\n clearedContent.matchAll(regexpSmallImage),\n (m) => m[0]\n );\n\n let smallImgUrls = [];\n\n rawSmallImages.forEach((rawSmallImage) => {\n let rawSmallImgUrl = rawSmallImage.match(regexpRawSmallImgUrl);\n let finalSmallImgUrl = rawSmallImgUrl[0].replace(regexpQuotes, \"\");\n smallImgUrls.push(finalSmallImgUrl);\n });\n\n displayPostItem(published, title, text, originalImgUrls, smallImgUrls);\n}", "title": "" }, { "docid": "dd044538397b93889718f7a68cf2be92", "score": "0.60621035", "text": "function newPosts(response){\n var results = response.data.children;\n for (var i = 0; i < results.length; i++){\n var author = results[i].data.author;\n var title = results[i].data.title;\n //if forumText is truthy will return the forumText, if falsey returns title\n var forumText = results[i].data.selftext ? results[i].data.selftext : '<a href=\"' + titleLink + '\">' + titleLink + '</a>';\n var numComments = results[i].data.num_comments;\n var postDiv = postData('div', 'posts', null);\n redditContainer.appendChild(postDiv);\n\n var headerDiv = postData('div', 'title', null);\n var titleLink = createLink('a', results[i].data.url, title);\n headerDiv.appendChild(titleLink);\n postDiv.appendChild(headerDiv);\n\n var bodyTextDiv = postData('div', 'forumText', forumText);\n postDiv.appendChild(bodyTextDiv);\n\n var footerDiv = postData('div', 'footer', null);\n postDiv.appendChild(footerDiv);\n\n var dateDiv = postData('div', 'date', redditDate(results[i].data.created_utc) + ' ' + postTime(results[i].data.created_utc));\n footerDiv.appendChild(dateDiv);\n\n var authorDiv = postData('div', 'author', null);\n var authorLink = createLink('a', \"https://www.reddit.com/user/\" + author, \"by: \" + author);\n authorDiv.appendChild(authorLink);\n footerDiv.appendChild(authorDiv);\n\n var commentDiv = postData('div', 'numComments', null);\n var commentLink = createLink('a', \"https://www.reddit.com\" + results[i].data.permalink, numComments + \" comments\");\n commentDiv.appendChild(commentLink);\n footerDiv.appendChild(commentDiv);\n }\n return redditContainer;\n }", "title": "" }, { "docid": "2d8611b93dc5926d2d17662414c5c437", "score": "0.6050868", "text": "function createFileData(post) {\n 'use strict';\n var filename = \"\";\n var filenameExtension = \".md\";\n var yamlStr = \"\";\n var markdownStr = \"\";\n var content = \"\";\n var meta = {};\n var formattedPost = {};\n\n filename = post.meta.title.replace(/\\s+/g, '-').toLowerCase();\n // markdownStr = toMarkdown(post.content);\n markdownStr = md(post.content);\n content = post.content;\n meta = {\n title: post.meta.title,\n featureImage: post.meta.featureImage,\n date: moment().format(\"YYYY-MM-DD\"),\n modified: moment().format(\"YYYY-MM-DD\"),\n description: post.meta.description, // need to implement this\n status: 'Draft', // need to add a feature to switch this\n tags:[] // also need to implement this\n };\n yamlStr = '---\\n' + yaml.stringify(meta) + '---\\n\\n';\n\n formattedPost = {\n filename: filename,\n filenameExtension: filenameExtension,\n yaml: yamlStr,\n markdown: markdownStr,\n content: content,\n meta: meta\n };\n // console.log('formatted: ', formattedPost);\n return formattedPost;\n}", "title": "" }, { "docid": "1ea2155fca9521b298ca9353576e5334", "score": "0.6048302", "text": "function buildPostingDiv(posting) {\n const postTitleDiv = document.createElement(\"div\");\n postTitleDiv.appendChild(\n document.createTextNode(posting.title)\n );\n\n const usernameDiv = document.createElement(\"div\");\n usernameDiv.classList.add(\"left-align\");\n var postingLink = createLink(\n \"/user-page.html?user=\" + posting.email, posting.email);\n postingLink.classList.add(\"posting-link\");\n usernameDiv.appendChild(postingLink);\n\n const distanceDiv = document.createElement(\"div\");\n distanceDiv.appendChild(\n document.createTextNode(posting.distance + \" miles away\")\n );\n\n const headerDiv = document.createElement(\"div\");\n headerDiv.classList.add(\"posting-header\");\n headerDiv.appendChild(postTitleDiv);\n headerDiv.appendChild(usernameDiv);\n headerDiv.appendChild(distanceDiv);\n\n const bodyDiv = document.createElement(\"div\");\n bodyDiv.classList.add(\"posting-body\");\n bodyDiv.appendChild(\n document.createTextNode(\"Description: \" + posting.description)\n );\n bodyDiv.appendChild(document.createElement(\"br\"));\n bodyDiv.appendChild(document.createTextNode(\"Price: \" + posting.price));\n\n const postingDiv = document.createElement(\"div\");\n postingDiv.classList.add(\"posting-div\");\n postingDiv.appendChild(headerDiv);\n postingDiv.appendChild(bodyDiv);\n\n return postingDiv;\n}", "title": "" }, { "docid": "f9f3d3b3595e3a0ff0df525e1ed3358f", "score": "0.60455406", "text": "function displayPosts(data) {\n console.log(data);\n postsSection.textContent = \"\";\n data.forEach((post) => {\n const postDiv = document.createElement(\"div\");\n const header = document.createElement(\"p\");\n const body = document.createElement(\"p\");\n header.textContent = `\"${post.title}\" from ${post.pseudonym} posted on ${post.date}`;\n body.textContent = post.body;\n postDiv.append(header);\n postDiv.append(body);\n postsSection.append(postDiv);\n });\n}", "title": "" }, { "docid": "a04b6359ed7a610862bdec39fb22dadc", "score": "0.60050845", "text": "function displayPosts(output){\n postSection.innerHTML = `\n <div id=\"page-header\" class=\"container bg-light border-top border-bottom\">\n <h1 class=\"my-1\"><span data-gettext>Posts</span></h1>\n </div>\n <section id=\"posts\" class=\"container mt-5\">${output}</section>\n `;\n }", "title": "" }, { "docid": "5553384e3aefb3c29738f561f61b5635", "score": "0.6001023", "text": "function buildFeed(data,limit,page){\n var totalPosts = data.response['total_posts'];\n var pages = Math.ceil(totalPosts / limit);\n var page = page;\n // clear default offline message and any previous build...\n $(\"#feed\").html(\"\");\n // loop over array to print selected page of posts...\n for(var i = 0; i < data.response['posts'].length; i++){\n // write start of html block...\n $('#feed').append('<article class=\"row tumblr\" id=\"'+data.response['posts'][i]['id']+'\">');\n // determine post type and write appropriate html to match...\n switch(data.response['posts'][i]['type']){\n case 'text':\n $('#'+data.response['posts'][i]['id']+'').append(\n '<div class=\"span6\" id=\"postContent'+data.response['posts'][i]['id']+'\">'+data.response['posts'][i]['title']+data.response['posts'][i]['body']+'</div>'); \n break;\n case 'photo':\n $('#'+data.response['posts'][i]['id']+'').append(\n '<div class=\"span6\" id=\"postContent'+data.response['posts'][i]['id']+'\">\\\n <img src=\"'+data.response['posts'][i]['photos']['0']['original_size']['url']+'\" >'+data.response['posts'][i]['caption']+'</div>');\n break;\n case 'quote':\n $('#'+data.response['posts'][i]['id']+'').append(\n '<div class=\"span6\" id=\"postContent'+data.response['posts'][i]['id']+'\">\\\n <blockquote>'+data.response['posts'][i]['text']+'</blockquote><p>'+data.response['posts'][i]['source']+'</p></div>');\n break; \n case 'link':\n $('#'+data.response['posts'][i]['id']+'').append(\n '<div class=\"span6\" id=\"postContent'+data.response['posts'][i]['id']+'\">\\\n <p>'+data.response['posts'][i]['title']+'</p>'+data.response['posts'][i]['description']+'</div>');\n break;\n case 'chat':\n $('#'+data.response['posts'][i]['id']+'').append(\n '<div class=\"span6\" id=\"postContent'+data.response['posts'][i]['id']+'\">\\\n <p>'+data.response['posts'][i]['title']+'</p><p>'+data.response['posts'][i]['body']+'</p></div>');\n break;\n case 'audio':\n $('#'+data.response['posts'][i]['id']+'').append(\n '<div class=\"span6\" id=\"postContent'+data.response['posts'][i]['id']+'\">'+data.response['posts'][i]['embed']+data.response['posts'][i]['caption']+'</div>');\n break;\n case 'video':\n $('#'+data.response['posts'][i]['id']+'').append(\n '<div class=\"span6\" id=\"postContent'+data.response['posts'][i]['id']+'\">'+data.response['posts'][i]['player']['2']['embed_code']+data.response['posts'][i]['caption']+'</div>');\n break;\n };\n // complete html block with blog post time and controls...\n $('#'+data.response['posts'][i]['id']+'').append(\n '<div class=\"span6\">\\\n <div class=\"span4 offset1\"><i class=\"icon-time\"></i> '+data.response['posts'][i]['date']+'</div>\\\n <div class=\"span4 offset1 tumblrControl\">\\\n <i class=\"icon-retweet\"></i>\\\n <a href=\"http://www.tumblr.com/reblog/'+data.response['posts'][i]['id']+'/'+data.response['posts'][i]['reblog-key']+'\" target=\"blank\">Reblog this post</a>\\\n </div>\\\n <div class=\"span4 offset1 tumblrControl\">\\\n <i class=\"icon-comment\"></i>\\\n <a href=\"http://'+data.response['blog']['name']+'.tumblr.com/post/'+data.response['posts'][i]['id']+'#notes\" target=\"blank\">Post notes: '+data.response['posts'][i]['note_count']+'</a>\\\n </div>\\\n </div>\\\n </article>');\n }; // end of for loop... \n // pagination code, though heavily edited, is from botmonster.com/jquery-bootpag...\n // pagination controls...\n $('#feed').append('<div id=\"page-selection\" class=\"text-center\"></div>\\\n <script>$(\"#page-selection\").bootpag({total:'+pages+', page:'+page+'}).on(\"page\",function(event,num){\\\n var offset = '+limit+' * (num - 1);\\\n getFeed('+limit+',offset,num);\\\n });</scr'+'ipt>');\n // note split of script tag to work around javascript bug... \n}", "title": "" }, { "docid": "0b630015dbe6f8e8efc8363c1c75352b", "score": "0.59958017", "text": "function blog3()\r\n{\r\n var container3 = document.getElementById(\"blog_content_supplies\");\r\n\r\n var disp3=\"\";\r\n\r\n for(i=7;i<tech.length;i++)\r\n {\r\n disp3 += \"<section>\";\r\n disp3 += \"<img src=images\\\\img3.jpg>\"\r\n disp3 += \"<h3>\" +tech[i].PostTitle +\"</h3>\";\r\n disp3 += \"<p>\" +tech[i].PostAuthor +\" \" +tech[i].PostDate +\"</p>\";\r\n disp3 += \"<p>\" +tech[i].PostDetail +\"</p>\";\r\n disp3 += \"</section>\";\r\n }\r\n\r\n container3.innerHTML = disp3;\r\n}", "title": "" }, { "docid": "6812dcaa0d97eb75956570ef04e3920e", "score": "0.59757894", "text": "function createPost(el) {\n \n let flag = 'show';\n let hr = document.createElement('hr');\n let post = document.createElement('div');\n post.className = 'content'\n let allCommentsDiv = document.createElement('div');\n let author = document.createElement('span');\n let title = document.createElement('h5');\n let description = document.createElement('p');\n const showComments = document.createElement(\"a\");\n showComments.innerText = \"Show comments\";\n showComments.style = `\n font-size: 12px;\n `\n showComments.className =\"btn btn-outline-success my-2 my-sm-0\"\n showComments.addEventListener('click', () => {\n onCommentsClick(el.id, allCommentsDiv, post, flag);\n if (flag === 'show') {\n showComments.innerText = 'Hide Comments';\n flag = 'hide';\n } else {\n showComments.innerText = 'Show Comments';\n flag = 'show';\n }\n });\n author.innerHTML = `Created by <b>${el.user.username.charAt(0).toUpperCase() + el.user.username.slice(1)}</b>`;\n author.style = `\n color: #787C7E;\n font-family: 'monospace';\n `;\n title.innerText = el.title.charAt(0).toUpperCase() + el.title.slice(1);\n description.innerText = el.description.charAt(0).toUpperCase() + el.description.slice(1);\n post.appendChild(author);\n post.appendChild(hr)\n post.appendChild(title);\n post.appendChild(description);\n post.appendChild(showComments);\n post.appendChild(allCommentsDiv)\n \n document.querySelector('#posts').prepend(post)\n}", "title": "" }, { "docid": "47c44bed5c00027da4022983d32ebc4e", "score": "0.5952795", "text": "async function getPost(){\n let postTitle = window.location.href.split('?id=');\n if(postTitle.length===2){\n postTitle = postTitle[1];\n }else{\n //window.location.replace('adminPanel.php','_self');\n }\n let resp = await fetch('app/routes/postData.php?id='+postTitle);\n let data = await resp.json();\n\n //set title \n postId = data.postInfo.id;\n title.textContent = data.postInfo.title;\n mainImgUrl.textContent = data.postInfo.mainImage;\n tagHandler.selectedTags.push(data.mainCategory);\n tagHandler.addSelectedHTMLtag(data.mainCategory);\n tagHandler.mainTag = data.mainCategory;\n data.categories = data.categories.filter(cat=>cat!==data.mainCategory);\n data.categories = data.categories.map((cat)=>cat.name);\n tagHandler.selectedTags.push(...data.categories);\n data.categories.forEach(category=>{\n tagHandler.addSelectedHTMLtag(category);\n });\n let postContents = data.postContents.sort((a,b)=>a.position-b.position);\n postContents.forEach(section=>{\n let a = new Box(section.type);\n if(section.type==='resources'){\n let tmpContainer = document.createElement('div');\n tmpContainer.innerHTML = section.content;\n let strContent = \"\";\n Array.from(tmpContainer.children).forEach((child)=>{\n let name = child.textContent;\n let link = child.href;\n strContent +=`<div><input type=\"text\" placeholder=\"Name\" value=\"${name}\"><input type=\"text\" placeholder=\"Link\" value=\"${link}\"></div>`\n });\n section.content = strContent;\n a.boxContentElement.insertAdjacentHTML('afterbegin',strContent);\n }else{\n a.boxContentElement.innerHTML = section.content;\n }\n })\n\n \n\n if(data.postInfo.STATUS==='published'){\n //hide publish button\n publishBtn.classList.add('hidden');\n //show withdraw btn\n }else{\n withdrawBtn.classList.add('hidden');\n }\n console.log(data);\n}", "title": "" }, { "docid": "9b1eef4c6c6836e3f1e936c12d1fb03b", "score": "0.5945341", "text": "function displayNews(arrayOfNewsObject) {\n if (postContainer) {\n postContainer.innerHTML = '';\n }\n arrayOfNewsObject.forEach((post) => {\n postContainer.innerHTML += `<article class=\"one-post\">\n <h3 class=\"post-title\">${post.title}</h3>\n <img class=\"post-img\" src=${post.img} alt=${arrayOfNewsObject[0].title}>\n <h5 class=\"post-date\">${post.date}</h4>\n <p class=\"post-body\">${post.description}</p>\n <label class=\"post-more\" for=\"post-link\"><a id=\"post-link\" class=\"post-link\" href=${post.url}>READ MORE</a></label>\n </article>`;\n });\n body.appendChild(postContainer);\n}", "title": "" }, { "docid": "1d44c81c27edc3e55f002ee05fc7e48d", "score": "0.59424484", "text": "fakePost(options = {}) {\n const summary = paragraph();\n const post = {\n id: options.id || uuid().split('-')[0],\n title: capitalizeWords(words()),\n summary,\n content: `${summary}\\n${paragraphs()}`,\n timestamp: \"2008-02-14 20:00\",\n slug: options.slug || slug(),\n }\n return post;\n }", "title": "" }, { "docid": "71c8434d6bb93e4340341efe78829e34", "score": "0.59414726", "text": "async function showPosts() {\n const posts = await getPosts();\n // console.log(posts);\n\n posts.forEach(post => {\n const postElement = document.createElement('div');\n postElement.classList.add('post');\n postElement.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <hr>\n <p class=\"post-body\">\n ${post.body} \n </p>\n </div>\n `;\n // make data visible on DOM\n postContainer.appendChild(postElement);\n\n });\n}", "title": "" }, { "docid": "73c1bb4dd6e7444cd16b6b299b292554", "score": "0.5933015", "text": "function makeTodoElements(docId, docData) {\r\n document.getElementById(post-div).innerHTML = `<span>${docData}</span>`\r\n}", "title": "" }, { "docid": "d0c9aada2eab6c3544248495942c8858", "score": "0.5931668", "text": "function appendPosts(posts_array){\n var container_posts = $(\".posts\");\n //console.log(\"Posts array received\", posts_array);\n for(var i = 0; i < posts_array.length; i++){\n var post = posts_array[i]; //we are storing the posts in a temp variable for easy access, we don't have to write posts_array[i] everytime\n $(container_posts).append(\"<div class='post'>\" + (i+1) + \". \" + \"<a href='#'>\" + post.title + \"</a></div>\"); //There is not point of doing that, we can do it with one string.ok\n }\n }", "title": "" }, { "docid": "da1122163c47b99370a3e4f0bbbbf554", "score": "0.5930234", "text": "function generateMainBloggerHtml(objectBlogger) {\n return `\n <div class=\"row article debug-layout border-radius\">\n <div class=\"col-sm-3 hidden-xs\">\n <img class=\"v-center\" src=\"${objectBlogger.foto}\" width=\"100px\" height=\"100px\" alt=\"${objectBlogger.name}\"> \n </div> \n <div class=\"col-sm-9\" height=\"100%\">\n <div class=\"row\">\n <div class=\"col-xs-8 col-sm-8\">\n <a href=\"blog.html\"><h3>${objectBlogger.name}</h3></a>\n </div>\n <div class=\"col-xs-4 col-sm-4\">\n <b>Rate: </b>${objectBlogger.rate}\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-8 col-sm-8\">\n <b>Numero articoli: </b>${objectBlogger.nart}\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-12 col-sm-12\">\n <b>Specialità: </b>${objectBlogger.specialità} \n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-12 col-sm-12\">\n <b>Presentazione:</b> ${objectBlogger.pres}\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-xs-4 col-sm-4\">\n <b>#Follower:</b> ${objectBlogger.follower}\n </div>\n </div>\n </div>\n </div>\n `;\n}", "title": "" }, { "docid": "691cafc9e1c561aee126b5ea8a9d4e45", "score": "0.5920158", "text": "function blog2()\r\n{\r\n var container2 = document.getElementById(\"blog_content_art\");\r\n\r\n var disp2=\"\";\r\n\r\n for(i=4;i<8;i++)\r\n {\r\n disp2 += \"<section>\";\r\n disp2 += \"<img src=images\\\\img1.jpg>\"\r\n disp2 += \"<h3>\" +tech[i].PostTitle +\"</h3>\";\r\n disp2 += \"<p>\" +tech[i].PostAuthor +\" \" +tech[i].PostDate +\"</p>\";\r\n disp2 += \"<p>\" +tech[i].PostDetail +\"</p>\";\r\n disp2 += \"</section>\";\r\n }\r\n\r\n container2.innerHTML = disp2;\r\n\r\n}", "title": "" }, { "docid": "c37162fdf235567efbf73d7ae18c8943", "score": "0.59091294", "text": "function post(error, issue) {\n if (error || !issue) {\n // redirect to front page if id incorrent\n document.location.replace('index.html');\n return;\n }\n\n var parent = document.querySelector('.threads'),\n content = [];\n\n content.push('<div id=\"' + issue.id + '\" class=\"post\">');\n content.push('<h1 class=\"post-title\">');\n content.push('<a href=\"?' + issue.number + '\">' + issue.title + '</a>');\n content.push('</h1>');\n content.push('<div class=\"post-meta\">');\n content.push('by <a href=\"' + issue.user.html_url + '\">' + issue.user.login + '</a> &middot; ');\n content.push(new Date(issue.created_at).toLocaleDateString() + ' &middot; ');\n content.push('<a href=\"' + issue.html_url + '\">' + (issue.comments === 1 ? '1 comment' : (issue.comments ? (issue.comments + ' comment(s)') : 'discuss')) + '</a>');\n content.push('</div>');\n\n if (issue.labels.length) {\n content.push('<div class=\"post-meta-categories\">');\n issue.labels.forEach(function (label) {\n content.push('<span class=\"post-meta-category\" style=\"background: #' + label.color + '\">');\n content.push(label.name);\n content.push('</span>');\n });\n content.push('</div>');\n }\n\n var markdown = new Remarkable({ html: true });\n\n content.push('<div class=\"post-body\">');\n content.push(markdown.render(issue.body).replace(/<pre>/g, '<pre class=\"prettyprint\">'));\n content.push('</div>');\n\n parent.innerHTML += content.join('');\n prettyPrint();\n\n if (issue.comments) {\n var commentContainer = document.createElement('div');\n commentContainer.className = 'post-comments';\n commentContainer.innerHTML = 'Loading ' + issue.comments + ' comments...';\n parent.appendChild(commentContainer);\n\n this.listIssueComments(issue.number, function (error, data) {\n if (error)\n return;\n\n commentContainer.innerHTML = '';\n\n var comments = [];\n data.forEach(function (comment) {\n comments.push('<div id=\"' + comment.id + '\" class=\"post-comment\">');\n comments.push('<a class=\"post-comment-author\" href=\"' + comment.user.html_url + '\">');\n comments.push(comment.user.login);\n comments.push('</a>');\n comments.push('<span class=\"post-comment-date\">commented ');\n comments.push(new Date(comment.created_at).toLocaleDateString());\n comments.push(':</span>');\n comments.push('<div class=\"post-comment-body\">');\n comments.push(markdown.render(comment.body).replace(/<pre>/g, '<pre class=\"prettyprint\">'));\n comments.push('</div>');\n comments.push('</div>');\n });\n\n commentContainer.innerHTML += comments.join('');\n prettyPrint();\n });\n }\n}", "title": "" }, { "docid": "699e4f0f88fbd6b9b5f8dc1f5cbfe65a", "score": "0.590548", "text": "function createNewRow(post) {\n var formattedDate = new Date(post.createdAt).toLocaleDateString('en-us', { weekday:\"long\", year:\"numeric\", month:\"short\", day:\"numeric\"}) \n var newRow = '<div class=\"post-wrapper__post\">';\n newRow += '<img src=\"https://placeimg.com/350/240/any\">';\n newRow += '<div class=\"post-wrapper__post__date\">';\n newRow += '<span>' + formattedDate + '</span></div>';\n newRow += '<div class=\"post-wrapper__post__category\">';\n newRow += '<span>' + post.User.username + '</span>';\n newRow += '</div>';\n newRow += '<div class=\"post-wrapper__post__word\">';\n newRow += '<span>Word : ' + post.word + \"</span>\";\n newRow += '</div>';\n newRow += '<h3>' + post.title + '</h3>';\n newRow += '<a href=\"/displayBlog?post_id=' + post.id +'\" id=\"view-more\"><b>view more →</b></a>';\n \n // newRow += '<a href=\"/cms?post_id=' + post.id + '\" id=\"view-more\"><b>view more →</b></a>';\n newRow += '</div>'\n\n $(\".post-wrapper\").append(newRow)\n }", "title": "" }, { "docid": "ca0119664a9693cb86d534bf5fff3ba3", "score": "0.5904901", "text": "function formatAndBlog(blog) {\n\n blogContainer.innerHTML += `\n <div class=\"post\" data-blogID='${JSON.stringify(blog)}' id=\"post${blog.id}\">\n <h1 class=\"title\">${blog.title}</h1>\n <p class=\"meta\"><strong>Posted on ${blog.date} </strong>\n &nbsp;&bull;&nbsp; \n <!-- Button to Open the Modal -->\n <button type=\"button\" class=\"btn btn-primary btn-blog\" id='btn-add-comment' postID='${blog.id}' data-toggle=\"modal\" data-target=\"#myModal\">Add Comment</button>\n <div class=\"entry\">\n <p>${blog.post}</p>\n </div> \n </div>\t\t\t \n`;\n\n}", "title": "" }, { "docid": "fa100112d79d03ef8c87e03e58496932", "score": "0.5899688", "text": "async function getPosts() {\n let res = await fetch(postUrl)\n let data = await res.json()\n let output = ''\n data.forEach((post) => {\n output += `\n <div>\n <h3>${post.title}</h3>\n <p>${post.body}</p>\n </div>\n `\n })\n document.getElementById('output').innerHTML = output\n}", "title": "" }, { "docid": "937d9364e9632ca95905cc424696b53c", "score": "0.5893803", "text": "function createRedditHTML(title, link) { \n return `\n <a href=\"https://www.reddit.com${link}\" target=\"_blank\">\n <div class=\"reddit-article\">\n <div class=\"reddit-logo\">\n <img src=\"https://i.postimg.cc/tCGYGhRG/reddit-icon-25878.jpg\" alt=\"Reddit logo\">\n </div>\n <h3 class=\"reddit-title\">${title}</h3>\n </div>\n </a>\n `\n}", "title": "" }, { "docid": "42cd388bb6aaaece1af34d9f45dd513f", "score": "0.588899", "text": "function createPostInfo(photoPost) {\n const postInfo = document.createElement('div')\n postInfo.className = \"post-info\"\n postInfo.innerHTML = `\n<span> ${photoPost.author}</span>\n<span> ${new Date(photoPost.createdAt).getDay().toString()+'.'+new Date(photoPost.createdAt).getMonth().toString()+' '+\nnew Date(photoPost.createdAt).getFullYear().toString()+' '+new Date(photoPost.createdAt).getHours().toString()+':'+new Date(photoPost.createdAt).getMinutes().toString()}\n</span>\n`\n return postInfo\n }", "title": "" }, { "docid": "da7422dc475dc7dd322520a51a7a0fa4", "score": "0.5888441", "text": "function makePost(e) {\n e.preventDefault();\n setPost();\n console.log(titleRef.current.value);\n console.log(contentRef.current.value);\n }", "title": "" }, { "docid": "13d8858319ad4d6ad06d3a9e0002d8b1", "score": "0.5878565", "text": "async function showPosts() {\n const posts = await getPosts();\n\n posts.forEach((post) => {\n const postEl = document.createElement(\"div\");\n postEl.classList.add(\"post\");\n postEl.innerHTML = ` <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <p class=\"post-body\">\n ${post.body}\n </p>\n </div>`;\n\n postsContainer.appendChild(postEl);\n });\n}", "title": "" }, { "docid": "4f4b2edec850b2a512a3315c999faca0", "score": "0.5873671", "text": "function renderNewPostForm() {\n const $form = $('<form>').addClass().attr(\"method\", \"POST\").attr(\"action\", \"/resources/new\");\n const $title = $('<textarea>').addClass('form-control').attr('name', \"title\").attr(\"placeholder\", \"Title\")\n const $description = $('<textarea>').addClass('form-control').attr('name', \"description\").attr(\"placeholder\", \"description\");\n const $url = $('<textarea>').addClass('form-control').attr('name', \"url\").attr(\"placeholder\", \"url\");\n const $select = $('<select>').addClass(\"form-control\").attr(\"name\", \"topic\").attr('id','exampleFormControlSelect2')\n const $submitButton = $('<input>').addClass(\"btn btn-outline-secondary\").attr('type', 'submit').attr('value', 'post');\n const $formDiv = $('<div>').addClass('form-group')\n const $formDiv1 = $('<div>').addClass('form-group')\n const $formDiv2 = $('<div>').addClass('form-group')\n\n const $titleDiv = $formDiv.append($title)\n const $descDiv = $formDiv1.append($description)\n const $urlDiv = $formDiv2.append($url)\n\n\n return $form\n .append($titleDiv)\n .append($descDiv)\n .append($urlDiv)\n .append($select)\n .append(viewTopicsInSelect())\n .append($submitButton)\n .appendTo('#post-new-resource')\n}", "title": "" }, { "docid": "ddf1689a9f48a0899fe1a8b1e482abbd", "score": "0.5872084", "text": "function createPost(newPost) {\n const ride = newPost.ride;\n\n const postArea = ownPostArea;\n const postMarkup = getOwnPostMarkup(ride);\n\n const postContainer = createPostContainer(newPost.postNumber);\n postContainer.innerHTML = postMarkup;\n\n findDistance(ride.origin, ride.destination).then((distance) => {\n postContainer.querySelector('#distance').innerText = distance;\n }).catch((err) => console.log(err));\n\n insertPost(allPosts, newPost);\n insertPostDOM(postArea, postContainer, allPosts);\n}", "title": "" }, { "docid": "d118309b3f9bb2d307812cc2ce4801d9", "score": "0.58695245", "text": "async function renderPosts() {\n\n let posts = await getPosts();\n posts = posts.posts;\n let postsElements = \"\";\n let selectedPostId;\n\n posts.forEach(post => {\n\n postsElements += `\n\n <div class=\"row preview-posts-container\" id=\"${post.id}\">\n <div class=\"row preview-posts\">\n <div class=\"col-md\">\n <p class=\"creation-date\">Created at: ${post.created_at}</p>\n </div>\n <div class=\"col-md\">\n <p class=\"update-date\"> Modified at: ${post.updated_at}</p>\n </div>\n </div>\n <div class=\"row preview-posts\">\n <h3 id=\"field-id\" style=\"display:none\">${post.id}</h3>\n <h3 class=\"field-title\">${post.title}</h3>\n </div>\n <div class=\"row preview-posts\">\n <img class=\"field-image\" width=\"200\" src=\"${post.image}\">\n <input class=\"input-image\" type=\"url\" value=\"${post.image}\" style=\"display:none\">\n </div>\n <div class=\"row preview-posts\">\n <p class=\"field-body\">${post.body}</p>\n </div>\n <div class=\"row preview-posts\">\n <div class=\"col-sm\">\n <button class=\"modify-button fa fa-edit fa-2x\" value=\"${post.id}\"></button>\n <button class=\"confirm-button\" value=\"${post.id}\" style=\"display:none\">confirm</button>\n </div>\n <div class=\"col-sm\"> \n <button class=\"delete-button fa fa-close fa-2x\" value=\"${post.id}\"></button> \n <button class=\"cancel-button\" value=\"${post.id}\" style=\"display:none\">cancel</button> \n </div>\n </div>\n <div class=\"row preview-posts\">\n <button class=\"comment-button\" value=\"${post.id}\">Check comments</button>\n </div>\n <div class=\"row preview-posts comment-container\" style=\"display:none\">\n <div class=\"row preview-comments\">\n <form autocomplete=\"off\" class=\"comment-form\">\n <div class=\"row\">\n <input\n type=\"text\"\n name=\"title\"\n class=\"title\"\n placeholder=\"type the title here*\"\n required\n />\n </div>\n <div class=\"row\">\n <textarea\n name=\"body\"\n class=\"body\"\n cols=\"30\"\n rows=\"5\"\n placeholder=\"type the body here*\"\n ></textarea>\n </div>\n <div class=\"row\">\n <input type=\"submit\" value=\"Publish\" class=\"comment-submit-button\"/>\n </div>\n </form>\n </div>\n </div>\n </div><hr>`;\n\n // append the posts to the div\n container.innerHTML = postsElements;\n\n // click listner to each button, and call respected function for each\n $(\".delete-button.fa.fa-close\").click(function (e) {\n selectedPostId = e.target.value;\n deletePost(selectedPostId);\n })\n\n $(\".modify-button.fa.fa-edit\").click(function (e) {\n selectedPostId = e.target.value;\n modifyPost(selectedPostId);\n })\n\n $(\".confirm-button\").click(function (e) {\n selectedPostId = e.target.value;\n confirmUpdate(selectedPostId);\n })\n\n $(\".cancel-button\").click(function (e) {\n selectedPostId = e.target.value;\n cancelUpdate(selectedPostId);\n })\n\n $(\".comment-button\").click(function (e) {\n selectedPostId = e.target.value;\n showComments(selectedPostId);\n })\n });\n }", "title": "" }, { "docid": "00337c9c8ce5bf7f0a4d6008b516f4dd", "score": "0.5866039", "text": "function render() {\n\n var titleVal = textTitle.val(); //raw title markup\n var authorVal = textAuthor.val(); //raw author markup\n var urlVal = textUrl.val(); //raw URL markup\n var categoryVal = textCategory.val();//raw category markup\n var bodVal = textBody.val(); // Raw body markup\n console.log(bodVal);\n\n var t = titleVal; //convert title markup to html\n var b = marked(bodVal); // Convert body markup to html\n var a = authorVal; //convert author markup to html\n var u = urlVal; // Convert URL markup to html\n var c = categoryVal; //convert category markup to html\n var allTheBlock = t + a + u + c + b;\n\n\n\n liveRawHtmlOutput.text(allTheBlock); // Render raw markup\n pMarkOut.html(allTheBlock); // Render article preview (rendered as HTML)\n\n // Update JSON article\n mObj.title = t;\n mObj.body = b;\n mObj.category = \"pets\";\n mObj.publishedOn = \"2015-12-31\";\n mObj.author = a;\n mObj.authorURL = u;\n mObj.category = c;\n\n var secretData = {};\n count++;\n console.log(count);\n\n console.log(mObj);\n var jsonStr = pJson.text(JSON.stringify(mObj));\n var articleTemplate = $('#articleTemplate').html();\n\n var secretData = mObj;\n var renderer = Handlebars.compile(articleTemplate);\n console.log();\n\n var compiledHtml = renderer(mObj);\n console.log(compiledHtml);\n $('#pMarkOut').html(compiledHtml);\n\n\n }", "title": "" }, { "docid": "e26f05052b2c98e515a3487e01b0d14f", "score": "0.5859286", "text": "function movetofeed(post_text, poster_name, i) {\n let postblock = document.getElementById(\"post_feed\");\n\n //Creates new div for the post\n let textdiv = document.createElement(\"div\");\n textdiv.setAttribute(\"class\", \"row\");\n postblock.insertBefore(textdiv, postblock.firstChild);\n\n //Adds divider above post\n let linebreak = document.createElement(\"div\");\n linebreak.setAttribute(\"class\", \"divider\");\n postblock.insertBefore(linebreak, postblock.firstChild);\n\n //Text paragraph and poster name config\n let paragraph = document.createElement(\"p\");\n paragraph.setAttribute(\"id\", poster_name+ \"no\" + i);\n paragraph.setAttribute(\"class\", \"col s12\");\n paragraph.innerHTML = post_text;\n textdiv.insertBefore(paragraph, textdiv.firstChild);\n\n let poster = document.createElement(\"p\");\n poster.setAttribute(\"id\", poster_name);\n poster.setAttribute(\"class\", \"col s12\");\n poster.innerHTML = \"Posted by: \" + poster_name;\n textdiv.appendChild(poster);\n\n if (post_text !== \"These are premade posts so don't worry about responding to these.\" || post_text !== \"Welcome to Inspire. Feel free to share your toughts!\"){\n addtodatabase((poster_name+ \"no\" + i), poster_name, post_text);\n }\n return i++;\n}", "title": "" }, { "docid": "3fbda1cb0415ce2004fb7a3c8c70530f", "score": "0.5857431", "text": "function processHtml(entry) {\n\t// console.log(\"PROCESSHTML ENTRY\", entry);\n\tif (!entry) {\n\t\tconsole.error(\"Error: No entry in processHtml\");\n\t\treturn;\n\t}\n\tif (!entry.humdrumOutput) {\n\t\treturn;\n\t}\n\tlet parameters = getHumdrumParameters(entry.humdrumOutput);\n\t// console.log(\"EXTRACTED PARAMETERS\", parameters);\n\n\tif (!parameters) {\n\t\treturn;\n\t}\n\n\tlet preHtml = parameters.PREHTML;\n\tlet postHtml = parameters.POSTHTML;\n\n\tlet preElement = entry.container.querySelector(\"div.PREHTML\");\n\tlet postElement = entry.container.querySelector(\"div.POSTHTML\");\n\n\tif (!preHtml) {\n\t\tif (preElement) {\n\t\t\tpreElement.style.display = \"none\";\n\t\t}\n\t}\n\tif (!postHtml) {\n\t\tif (postElement) {\n\t\t\tpostElement.style.display = \"none\";\n\t\t}\n\t}\n\tif (!preHtml && !postHtml) {\n\t\treturn;\n\t}\n\n\t// Also deal with paged content: show preHtml only above first page\n\t// and postHtml only below last page.\n\n\tlet lang = entry.options.lang || \"\";\n\tlet langs = lang.split(/[^A-Za-z0-9_-]+/).filter(e => e);\n\tlet preContent = \"\";\n\tlet postContent = \"\";\n\tif (langs.length > 0) {\n\t\tfor (let i=0; i<langs.length; i++) {\n\t\t\tif (preHtml) {\n\t\t\t\tpreContent = preHtml[`CONTENT-${langs[i]}`];\n\t\t\t} \n\t\t\tif (typeof preContent !== 'undefined') {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (let i=0; i<langs.length; i++) {\n\t\t\tif (postHtml) {\n\t\t\t\tpostContent = postHtml[`CONTENT-${langs[i]}`];\n\t\t\t} \n\t\t\tif (typeof postContent !== 'undefined') {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (typeof preContent === 'undefined') {\n\t\t\tif (preHtml) {\n\t\t\t\tpreContent = preHtml.CONTENT;\n\t\t\t}\n\t\t}\n\t\tif (typeof postContent === 'undefined') {\n\t\t\tif (postHtml) {\n\t\t\t\tpostContent = postHtml.CONTENT;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif (preHtml) {\n\t\t\tpreContent = preHtml.CONTENT;\n\t\t}\n\t\tif (postHtml) {\n\t\t\tpostContent = postHtml.CONTENT;\n\t\t}\n\t}\n\n\t// Get the first content-lang parameter:\n\tif (typeof preContent === 'undefined') {\n\t\tif (preHtml) {\n\t\t\tfor (var name in preHtml) {\n\t\t\t\tif (name.match(/^CONTENT/)) {\n\t\t\t\t\tpreContent = preHtml[name];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (typeof postContent === 'undefined') {\n\t\tif (postHtml) {\n\t\t\tfor (var name in postHtml) {\n\t\t\t\tif (name.match(/^CONTENT/)) {\n\t\t\t\t\tpostContent = postHtml[name];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tlet preStyle = \"\";\n\tlet postStyle = \"\";\n\n\tif (preHtml) {\n\t\tpreStyle = preHtml.STYLE || \"\";\n\t}\n\tif (postHtml) {\n\t\tpostStyle = postHtml.STYLE || \"\";\n\t}\n\n\tif (!preContent) {\n\t\tif (preElement) {\n\t\t\tpreElement.style.display = \"none\";\n\t\t}\n\t} else if (preElement) {\n\t\tpreElement.style.display = \"block\";\n\t\tif (preStyle) {\n\t\t\tpreElement.style.cssText = preStyle;\n\t\t}\n\t\tpreElement.innerHTML = preContent;\n\t}\n\n\tif (!postContent) {\n\t\tif (postElement) {\n\t\t\tpostElement.style.display = \"none\";\n\t\t}\n\t} else if (postElement) {\n\t\tpostElement.style.display = \"block\";\n\t\tif (postStyle) {\n\t\t\tpostElement.style.cssText = postStyle;\n\t\t}\n\t\tpostElement.innerHTML = postContent;\n\t}\n}", "title": "" }, { "docid": "a5b7479075dc28bf5db15080309de455", "score": "0.5853148", "text": "function renderContent() {\n if (hasVideo)\n return <Video src={post.media.reddit_video.fallback_url}/>;\n else if (hasEmbed)\n return <div css={embed} dangerouslySetInnerHTML={{__html: htmlEmbed}}/>;\n else if (hasImage)\n return (\n <AnimatedHover>\n <img src={post.url} alt='source' css={sourceImg}/>\n </AnimatedHover>\n );\n else if (hasText)\n return (\n <Typography variant='h5' css={text}>\n <Markdown source={he.decode(post.selftext)}/>\n </Typography>\n );\n else return null;\n }", "title": "" }, { "docid": "5ed97372323cd706718a79a2a07086e6", "score": "0.5852851", "text": "async function showPosts() {\n const posts = await getPosts();\n posts.forEach(post => {\n const postEl = document.createElement('article');\n postEl.classList.add('article');\n postEl.innerHTML = `\n <article class=\"article article_style_profile\" id=\"article_style_profile\">\n <img src='https://picsum.photos/490/490' width=490 height=490 class=\"article__picture\">\n <div class=\"article__content\">\n <h3 class=\"article__title\">${post.title}</h3>\n <p class=\"article__text\">${post.body}</p>\n <a href=\"/${post.id}\" class=\"article__link\">download profile</a>\n </div>\n </article>\n `;\n articleContainer.appendChild(postEl);\n });\n}", "title": "" }, { "docid": "b826ebcd0e60c304811b986e9fb6372b", "score": "0.5848733", "text": "function createMidPost(i,abt,date,msg,type,url,asso,aff)\n{\n var abtArray=abt.split(\"/\");\n var name = abtArray[1]+\"/\"+abtArray[2];\n //convertisco aossiciazioni in array\n var assoArray = asso.split(\";\");\n //trovo la mia preferenza, se ho fatto like o dislike\n var mypref=\"\";\n switch(assoArray[0])\n {\n case \"-1\":\n mypref=\"dislike\";\n break;\n case \"1\":\n mypref=\"like\";\n break;\n default:\n mypref=\"\";\n }\n //segnalo gli stati dei messaggi\n var st=\"<ul>\";\n for(var j=3;j<assoArray.length;j++)\n {\n st += \"<li>\"+assoArray[j]+\"</li>\";\n }\n st += \"</ul>\";\n //formulo il postdiv\n var tmpid = \"mpost\"+i;\n var post = \"<div class='postdiv midpost \"+mypref+\"' id='\"+tmpid+\"' title='\"+type+\"'>\"; \n post += stringNDM(name,date,msg); \n \n if(type==\"video\")\n {\n post += stringVidUNM(url,name,msg,assoArray[1],assoArray[2],st,aff); \n } \n else if(type==\"image\")\n {\n post += stringImgUNM(url,name,msg,assoArray[1],assoArray[2],st,aff); \n } \n else if(type==\"audio\")\n {\n post += stringAudUNM(url,name,msg,assoArray[1],assoArray[2],st,aff);\n } \n else{\n post += stringText(assoArray[1],assoArray[2],st,aff);\n }\n post +=\"<div class='postAbout'>\"+abt+\"<div></div>\"//close root \n $(\"#mid\").append(post);\n\n addPostIcons(tmpid); \n addPostFun(tmpid); \n //calcola l'offset a partire dal suo diametro \n var ofst = calcolaMidPostPosition(i);\n $(\"#\"+tmpid).position({\n my: \"center\",\n at: \"center\",\n of: \"#mid\",\n offset: ofst,\n collision: \"fit\"\n }); \n $(\"#\"+tmpid).css(\"z-index\",numTotaleDiPostsDaMostrare);\n numTotaleDiPostsDaMostrare--;\n\n}", "title": "" }, { "docid": "6b129af554e9691a7f98dfe4c062e22b", "score": "0.58378756", "text": "function createPost(postdetails) {\n var postboxDiv = document.createElement('div');\n postboxDiv.setAttribute('class','postbox owned');\n postboxDiv.setAttribute('id',postdetails.postid);\n var voteColumnDiv = document.createElement('div');\n voteColumnDiv.setAttribute('class','vote-column');\n var fishDiv = document.createElement('div');\n fishDiv.setAttribute('class','fish');\n voteColumnDiv.append(fishDiv);\n var upvoteCountDiv = document.createElement('div');\n upvoteCountDiv.setAttribute('class','upvote-count');\n upvoteCountDiv.append('0');\n voteColumnDiv.append(upvoteCountDiv);\n var fishboneDiv = document.createElement('div');\n fishboneDiv.setAttribute('class','fishbone');\n voteColumnDiv.append(fishboneDiv);\n postboxDiv.append(voteColumnDiv);\n var photoColumnDiv = document.createElement('div');\n photoColumnDiv.setAttribute('class','photo-column');\n var imgLinkA = document.createElement('a');\n imgLinkA.setAttribute('href','/post/'+postdetails.postid);\n var postImageImg = document.createElement('img');\n postImageImg.setAttribute('class','post-image');\n postImageImg.setAttribute('src','https://drive.google.com/uc?id='+postdetails.imgurl+'&export=download');\n imgLinkA.append(postImageImg);\n photoColumnDiv.append(imgLinkA);\n postboxDiv.append(photoColumnDiv);\n var infoColumnDiv = document.createElement('div');\n infoColumnDiv.setAttribute('class','info-column');\n var infoHeaderDiv = document.createElement('div');\n infoHeaderDiv.setAttribute('class','info-header');\n var posterLinkA = document.createElement('a');\n posterLinkA.setAttribute('class','poster-link'); \n posterLinkA.setAttribute('href','/user/'+postdetails.ownerusername);\n var postProfilePicImg = document.createElement('img');\n postProfilePicImg.setAttribute('class','post-profilepic'); \n postProfilePicImg.setAttribute('src','https://drive.google.com/uc?id='+postdetails.profileimg+'&export=download'); \n posterLinkA.append(postProfilePicImg);\n infoHeaderDiv.append(posterLinkA);\n var posterInfoDiv = document.createElement('div');\n posterInfoDiv.setAttribute('class','poster-info');\n posterLinkA = document.createElement('a');\n posterLinkA.setAttribute('class','poster-link');\n posterLinkA.setAttribute('href','/user/'+postdetails.ownerusername);\n var postOwnerDiv = document.createElement('div');\n postOwnerDiv.setAttribute('class','post-owner');\n postOwnerDiv.append(postdetails.ownerusername);\n posterLinkA.append(postOwnerDiv);\n posterInfoDiv.append(posterLinkA);\n var postLocationDiv = document.createElement('div');\n postLocationDiv.setAttribute('class','post-location');\n posterLinkA = document.createElement('a');\n posterLinkA.setAttribute('class','poster-link');\n posterLinkA.setAttribute('href','/user/'+postdetails.ownerusername);\n postLocationDiv.append(posterLinkA);\n locationLinkA = document.createElement('a');\n locationLinkA.setAttribute('href','#location');\n locationLinkA.append(postdetails.postlocation);\n postLocationDiv.append(locationLinkA);\n posterInfoDiv.append(postLocationDiv);\n infoHeaderDiv.append(posterInfoDiv);\n infoColumnDiv.append(infoHeaderDiv);\n var infoBodyDiv = document.createElement('div');\n infoBodyDiv.setAttribute('class','info-body');\n var postTextSpan = document.createElement('span');\n postTextSpan.setAttribute('class','post-text');\n var captionP = document.createElement('p');\n captionP.append(postdetails.postcaption);\n postTextSpan.append(captionP);\n infoBodyDiv.append(postTextSpan);\n infoColumnDiv.append(infoBodyDiv);\n var infoFooterDiv = document.createElement('div');\n infoFooterDiv.setAttribute('class','info-footer');\n var postHR = document.createElement('hr');\n postHR.setAttribute('class','post-hr');\n infoFooterDiv.append(postHR);\n var footerContentSpan = document.createElement('span');\n footerContentSpan.setAttribute('class','footer-content');\n footer1Span = document.createElement('span');\n footer1Span.setAttribute('class','footer-1');\n var saveA = document.createElement('a');\n saveA.setAttribute('href','/post/'+postdetails.postid);\n saveA.append('comments');\n footer1Span.append(saveA);\n footerContentSpan.append(footer1Span);\n footerContentSpan.append(' | ');\n var footer2Span = document.createElement('span');\n footer2Span.setAttribute('class','footer-2');\n var reportA = document.createElement('a');\n reportA.setAttribute('href','/edit/post/'+postdetails.postid);\n reportA.append('edit');\n footer2Span.append(reportA);\n footerContentSpan.append(footer2Span);\n footerContentSpan.append(' | ');\n var footer3Span = document.createElement('span');\n footer3Span.setAttribute('class','footer-3');\n var optionsA = document.createElement('a');\n optionsA.setAttribute('href','#delete'+postdetails.postid);\n optionsA.append('delete');\n footer3Span.append(optionsA);\n footerContentSpan.append(footer3Span);\n infoFooterDiv.append(footerContentSpan);\n infoColumnDiv.append(infoFooterDiv);\n postboxDiv.append(infoColumnDiv);\n\n $('.postlist').prepend(postboxDiv);\n $('.postingbox').removeClass('postingbox-focused');\n $('.postingbox-text').removeClass('postingbox-text-focused');\n $('.upload-button').css('display','none');\n $('.submit-button').css('display','none');\n }", "title": "" }, { "docid": "93891e508d03aa17442344f7b98bc665", "score": "0.5837444", "text": "function display_posts() {\n \tpost_array.forEach(function(item){\n \t\tinsertpost = \"<div id='user-post'>\" +\n\t\t\t\t\t\t\t\"<a id='post-user'>\" + item.author + \"</a>\" +\n\t\t\t\t\t\t\t\"<a id= 'delete'> x </a>\" +\n\t\t\t\t\t\t\t\"<div id='content'>\" + item.content + \"</div>\" +\n\t\t\t\t\t\t\t\"<div id= 'date'>\" + item.date + \"</div>\" +\n\t\t\t\t\t\t \"</div>\"\n\t\t$(\"#posts\").append(insertpost);\n \t});\n }", "title": "" }, { "docid": "88a2969f685ce79fdc7a8d78aac5c514", "score": "0.583369", "text": "async function showPosts() {\n let posts = await getPosts();\n\n posts.forEach(post => {\n const postEl = document.createElement('div');\n postEl.classList.add('post');\n postEl.innerHTML = `\n <div class=\"post-number\" id=\"post-number\">${post.id}</div>\n <div class=\"post-info\">\n <h3 class=\"post-title\">${post.title}</h3>\n <p class=\"post-body\">${post.body}</p>\n </div>\n `;\n\n postsContainer.appendChild(postEl);\n });\n}", "title": "" }, { "docid": "87cd84bc91df453597b7a33097530f97", "score": "0.5832719", "text": "function single_post_md_parse() {\n // post\n if (jQuery(\"#PostContent\").length <= 0) {\n return;\n }\n\n var md_str = jQuery(\"#PostContent\").text();\n var html_str = SimpleMDE.prototype.markdown(md_str);\n jQuery(\"#PostContent\").parent().html(html_str);\n\n // comments\n jQuery( \".comment-container > textarea\" ).each(function() {\n var comment_md_str = jQuery( this ).text();\n var comment_html_str = SimpleMDE.prototype.markdown(comment_md_str);\n console.log(comment_html_str);\n jQuery(this).parent().html(comment_html_str);\n });\n}", "title": "" }, { "docid": "a5b736fc3e223850277ca2c32cdb7a4d", "score": "0.5813406", "text": "async function showPosts() {\n const posts = await getPosts();\n console.log(posts);\n\n posts.forEach((p) => {\n const postEl = document.createElement(\"div\");\n postEl.classList.add(\"post\");\n postEl.innerHTML = `\n <div class=\"number\">${p.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${p.title}</h2>\n <p class=\"post-body\">${p.body}</p>\n </div>\n`;\n postsContainer.appendChild(postEl);\n });\n}", "title": "" }, { "docid": "6ec00ba68d890faf73db236a73312832", "score": "0.5813131", "text": "function blog(data){\n \n let renderhtml = '';\n \n for(let i in data){\n\n renderhtml += `\n <li class=\"border\">\n <h3>${data[i].title}</h3>\n <p>${data[i].body}</p>\n <p>likes: ${data[i].likes}</p>\n <button id=${data[i].id}>Load comments</button>\n <ul id=\"comment-${data[i].id}\" class=\"comments\">\n <!--getComments() and renderComments() is called when the button is pressed -->\n </ul>\n </li>\n `\n\n document.getElementById(\"blog\").innerHTML = renderhtml;\n }\n console.log(data);\n }", "title": "" }, { "docid": "20ed4d7f55694a410764ab4f944aa14b", "score": "0.58026797", "text": "function PostMicro( element)\n{\n\t// Point the post and DOM node to each other\n\tthis.element = element;\n\n\t// The title\n\tvar metadata = getChildByTagClass( element, null, PM_TITLE_CLASS, _skipPostContent );\n\tthis.title = metadata == null ? '' : getNodeText( metadata );\n\t\n\t// The author\n\tmetadata = getChildByTagClass( element, null, PM_AUTHOR_CLASS, _skipPostContent );\n\tthis.author = metadata == null ? '' : getNodeText( metadata );\n\t\n\t// The date\n\tmetadata = getChildByTagClass( element, 'abbr', PM_DATE_CLASS, _skipPostContent );\n\tif ( null == metadata )\n\t\tthis.date = null;\n\telse\n\t{\n\t\tvar s = metadata.getAttribute( 'title' );\n\t\tif ( null == s )\n\t\t\tthis.date = null;\n\t\telse\n\t\t{\n\t\t\tvar matches = s.match( /(\\d{4})(\\d{2})(\\d{2})T(\\d{2})(\\d{2})[+-](\\d{4})/ );\n\t\t\tif ( null == matches )\n\t\t\t\tthis.date = null;\n\t\t\telse\n\t\t\t\t// I haven't figured out how to deal with the time zone, so it assumes that server\n\t\t\t\t// time and local time are the same - which is rather bad.\n\t\t\t\tthis.date = new Date( matches[1], matches[2]-1, matches[3], matches[4], matches[5] );\n\t\t}\n\t}\n\t\n\t// The node containing the url\n\tmetadata = getChildAnchor( element, PM_URL_REL, _skipPostContent );\n\tthis.url = metadata.getAttribute( 'href' );\n\t\n\t// The node containing the content\n\t// Any offsets (e.g. as used by annotations) are from the start of this node's children\n\tthis.contentElement = getChildByTagClass( this.element, null, PM_CONTENT_CLASS, _skipPostContent );\n\n\treturn this;\n}", "title": "" }, { "docid": "fe732cc8720d4a17e40014189b2fa08a", "score": "0.5796322", "text": "function getPost(){\n\n var text =localStorage.getItem(\"testJSON\");\n var info = JSON.parse(text);\n var output = '';\n var update = document.getElementById('blogbody');\n\n if(info.blogPost.length === 0){\n update.innerHTML = '<h3>No Blog post yet, click on <a href=\"formpage.html\">create</a> to publish your first post.......</h3>';\n }else{\n for(var i = info.blogPost.length-1; i>=0; i--){ \n output += '<div id=\"articles\">'+\n '<div>'+\n '<article>'+\n '<details>'+\n '<summary><h3>' + info.blogPost[i][\"title\"] + '</h3></summary>'+\n '<h>' + info.blogPost[i][\"name\"] + '</h><br>' + \n info.blogPost[i][\"time\"] + \n '<p>' + info.blogPost[i][\"post\"] + '</p>'+\n '</details>'+\n '</article>'+\n '</div>'+\n '<div id=\"icon\">'+\n '<i class=\"fa fa-trash\" onclick=\"deletePost('+ i + ')\"></i>'+\n '</div>'+\n '<div id=\"icon\">'+\n '<i class=\"fa fa-edit\" onclick=\"editPost('+ i + ')\"></i>'+\n '</div>'+\n '</div>';\n }\n update.innerHTML = output\n } \n}", "title": "" }, { "docid": "9669422a77e809859125fc083ee6f5b9", "score": "0.57954186", "text": "async function createPost(container) {\n const pageParams = new URLSearchParams(window.location.search);\n const id = pageParams.get('id');\n\n const postEl = createPostElement();\n\n const postItem = (await (await fetch(`${baseURL}posts/${id}`)).json()).data;\n\n const postTitle = postEl.title;\n postTitle.textContent = postItem.title;\n\n const postBody = postEl.body;\n postBody.textContent = postItem.body;\n\n container.append(postEl.element);\n\n const response = await (await (fetch(`${baseURL}comments?post_id=${id}`))).json()\n const comments = response.data;\n\n const commentsSection = createCommentsSection({\n commentsArr: comments,\n number: comments.length\n });\n\n container.append(commentsSection);\n}", "title": "" }, { "docid": "35d84867d55f2c18fcfde54baf2714c8", "score": "0.57939345", "text": "function render_posts(div, posts, title, single_user, controls, delete_class, f_name = null) {\n\n $('.user_interaction').addClass('d-none')\n div.removeClass('d-none').html('').append(`<span class=\"feelist_title\">${title} \n\n ${delete_class === 'delete_action' ? `<small class=\"float-right delete_feelist\" title=\"Delete feelist?\" \n data-cy=\"delete_feelist\" data-f_name=\"${f_name}\">\n <i class=\"far fa-trash-alt\"></i></small>` :\n \n `${delete_class === '' ?\n `<small data-cy=\"remove_from_globe\" class=\"float-right \" id=\"remove_from_globe\" title=\"Remove from globe?\" \n data-glober_id=\"${sessionStorage.getItem('glober_id')}\">\n <i class=\"far fa-trash-alt\"></i></small>` : \n \n `${delete_class === 'delete_post' ? `<small data-cy=\"create_new_post\" class=\"float-right new_post\" id=\"new_post\">\n <i class=\"fas fa-pen-alt\"></i>&nbsp;new</small>`:`` }`}`}</span>`)\n\n\n var counter=0\n $.each(posts, function (key, post) {\n counter++\n div.append(`<div class=\"row mb-1\" id=\"${post.post_id}\">\n <div class=\"col-md-4 border_blue_l p-2 d-flex justify-content-around\">\n <img class=\"avatar\" src=\"assets/dist/images/avatars/${post.image_id}.png\"/>\n <div>\n <div class=\"d-flex justify-content-center\"><a href=\"/user/${post.user_id}\" class=\"user\">${post.name}</a></div>\n <div class=\"d-flex justify-content-center\"><small class=\"text-muted\">${post.created_at}</small></div>\n </div>\n </div>\n <div class=\"col-md-8 border_blue_l p-2\">\n <p class=\"card-text m-1 blue\">\n When I feel/feel like... <span class=\"i_feel_${post.post_id} text-secondary\">${post.i_feel.join(' ')}</span>\n </p>\n <p class=\"card-text m-1 blue\">Because...<span class=\"because_${post.post_id}\">${post.because.join(' ')}</span>\n </p>\n <p class=\"card-text m-1 blue\">I ... <span class=\"card-text action_${post.post_id}\">${post.action}</span></p>\n <p class=\"card-text \">\n \n ${controls.indexOf('delete') !== -1 ? `<small data-cy=\"delete_post${counter}\" class=\" ${delete_class}\n r-2 float-right\" title=\"Delete?\" \n data-post_id=\"${post.post_id}\">\n <i class=\"far fa-trash-alt\"></i>\n </small>` : ``}\n \n ${controls.indexOf('edit') !== -1 ? `<small data-cy=\"edit_post${counter}\" class=\"edit_post float-right mr-2\" title=\"Edit post?\"\n data-post_id=\"${post.post_id}\">\n <i class=\"far fa-edit\"></i>\n \n </small>` : ``} \n \n <small class=\" mr-2 float-left\" title=\"likes\" \"\n data-post_id=\"${post.post_id}\">\n <i class=\"fas fa-heart \" >\n <span>&nbsp; ${post.likes}</span> </i>\n </small>\n \n </p>\n </div>\n </div>`)\n })\n }", "title": "" }, { "docid": "ab58c29c110c6fad302961acefcea0fa", "score": "0.57873005", "text": "function blog1()\r\n{\r\n var container1 = document.getElementById(\"blog_content_tech\");\r\n\r\n var disp1=\"\";\r\n\r\n for(i=1;i<4;i++)\r\n {\r\n disp1 += \"<section>\";\r\n disp1 += \"<img src=images\\\\img2.jpg>\";\r\n disp1 += \"<h3>\" +tech[i].PostTitle +\"</h3>\";\r\n disp1 += \"<p>\" +tech[i].PostAuthor +\" \" +tech[i].PostDate +\"</p>\";\r\n disp1 += \"<p>\" +tech[i].PostDetail +\"</p>\";\r\n disp1 += \"</section>\";\r\n }\r\n\r\n container1.innerHTML = disp1;\r\n\r\n}", "title": "" } ]
05a27755d57eda7b86be605b64098c47
Trust the developer to only use possibleRegistrationNames in true
[ { "docid": "f88f66619f9fc95a9cff2f25ee8ea331", "score": "0.0", "text": "function registerTwoPhaseEvent(registrationName, dependencies) {\n registerDirectEvent(registrationName, dependencies);\n registerDirectEvent(registrationName + 'Capture', dependencies);\n}", "title": "" } ]
[ { "docid": "db3ce3841610e4da945978c5ea10337f", "score": "0.66301966", "text": "function allow () { }", "title": "" }, { "docid": "e4f7e978b7ba5b79a21efc404e6e3c92", "score": "0.6533753", "text": "Deny() {}", "title": "" }, { "docid": "fb24ee2d19ddd8170cf1fe0baf4c90ab", "score": "0.62276655", "text": "get secured () {\n return !!this._acl\n }", "title": "" }, { "docid": "790c55151e93094904bfc83987006456", "score": "0.6198898", "text": "function blockCardAbilityMods(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "34a6e7099ef426d22e7cdf2260e49bc1", "score": "0.61111313", "text": "isNotAllowed() {\n return !this.isAllowed();\n }", "title": "" }, { "docid": "d356de301768e0cc6b0b16052eb05b87", "score": "0.604649", "text": "function NotAllowed() {\n\t/**\n\t * Check if the loggedOnUser is in the list of Active Leads\n\t */\n\t\n\tif (!isDev && !activeLeadsObj.hasOwnProperty(loggedOnUser)){\n\t\tlet failHTML = `<div class=\"wrapper well\">You are not allowed - speak with an admin to get access</div>`\n\t\tdocument.getElementById('wrapper').innerHTML = failHTML\n\t}\n}", "title": "" }, { "docid": "1c8fc8937f1673637800c76e156fa115", "score": "0.5974114", "text": "function isRestricted() {\n return !mc.unrestricted;\n }", "title": "" }, { "docid": "e23872a88855016bf1802c81192cbdae", "score": "0.5897034", "text": "async allowUnauthorizedTrustlines(wallet) {\n return this.coreXrplClient.changeFlag(account_set_flag_1.AccountSetFlag.asfRequireAuth, false, wallet);\n }", "title": "" }, { "docid": "243c73af52ad80df9598adefc587e7da", "score": "0.5885554", "text": "function oppBlockOnPlayAbility(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "37cf1a3dd650f870fc5246c800485319", "score": "0.5868585", "text": "check_allow(){\n if (!this.allow){\n this.error_allow = true;\n } else {\n this.error_allow = false;\n }\n }", "title": "" }, { "docid": "5d78e7af5d411cc433aa9b8a607e673c", "score": "0.5853559", "text": "get isAllowed() {\n\t\tconst {allowed} = this.config;\n\t\treturn !isFunction(allowed) || allowed(this.generator.options);\n\t}", "title": "" }, { "docid": "907fd5b6e679f0e698c1110793cfd4f4", "score": "0.58187765", "text": "function disableDigitalRestrictionsManagement() {\n if (!getChrome()){\n var gettingInfo = browser.runtime.getPlatformInfo();\n gettingInfo.then((got) => {\n if (got.os == \"win\") {\n var setting = browser.privacy.websites.protectedContentEnabled.set({\n value: false\n });\n console.log(\"Setting Protected Content(Digital Restrictions Management) false/val=\", {\n value: false\n })\n setting.then(onSet);\n }\n });\n }\n}", "title": "" }, { "docid": "673afc47872ff6b73fc751fe0df336c4", "score": "0.58169913", "text": "function oppBlockCardAbilityMods(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "81081ee5dbef11a3a2dfae486ab046eb", "score": "0.58152807", "text": "justProtect() {\n return this.keyCloak.protect();\n }", "title": "" }, { "docid": "fca3569079bea4ea1770c1b3c5bc8be9", "score": "0.57997215", "text": "skipCheckAccessCheck() {\n return false;\n }", "title": "" }, { "docid": "a7cb390abc588c6b74634ef258cd5198", "score": "0.57915336", "text": "function forbidden() {\n this.error('You are not allowed to do that.', 403);\n}", "title": "" }, { "docid": "2a44ba2c526825a217b217a6d03ff78d", "score": "0.5777116", "text": "function isUsable() {\n\treturn true;\n}", "title": "" }, { "docid": "cab5f5bc809b4a8aeb4a38b23bb11eb7", "score": "0.57747304", "text": "function resourceEligibilityCheck(){\n if(client.resources == 3251){\n resourceEligible = false;\n } else if (client.resources == 3250 && client.senior == 1 || client.disabled == 1){ \n resourceEligible = true; \n } else if (client.resources == 2250){\n resourceEligible = true; \n } else {\n resourceEligible = false; \n }\n}", "title": "" }, { "docid": "ceb04d52af726c0d6147e1e9a8c8d73f", "score": "0.57740355", "text": "deny ({ principal, action, securor }) {\n return this.secure({ principal, action, strategy: DENY, securor })\n }", "title": "" }, { "docid": "b172bf4b21d976538c039e0d0911f523", "score": "0.5750667", "text": "function blockOnPlayAbility(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "56e5a56b31afd0fc627f714e2a612654", "score": "0.56453925", "text": "static getAllowed() {\n const { api_url } = getConfig();\n return request(`${api_url}${url}/allowed`, \"GET\");\n }", "title": "" }, { "docid": "447a3ec7571ec7d7503879597b7046fa", "score": "0.56379753", "text": "async requireAuthorizedTrustlines(wallet) {\n return this.coreXrplClient.changeFlag(account_set_flag_1.AccountSetFlag.asfRequireAuth, true, wallet);\n }", "title": "" }, { "docid": "b309a6aefa821d099eaf54f062cb248a", "score": "0.55930024", "text": "denies ({ principals, actions, data }) {\n return this.secured && this._acl.denies({ principals, actions, securable: this, data })\n }", "title": "" }, { "docid": "c4979a88c894dcfb0cb7a22fd96f16e8", "score": "0.55825734", "text": "get locked() {\n const { users, roles, guilds, channels, permissions } = this.private;\n return !!(users || roles || guilds || channels || permissions);\n }", "title": "" }, { "docid": "94e7a080c9cb5477f88254e8460d8c66", "score": "0.55801874", "text": "checkPermission() {\n const { ctx, enforcer } = this\n const { originalUrl: path, method } = ctx\n const user = this.getUserName()\n\n return enforcer.enforce(user, path, method)\n }", "title": "" }, { "docid": "01af1f82e7c6d301c754e1fa1359c145", "score": "0.5531295", "text": "throw() {\n if (!this.check()) throw new Meteor.Error('access-denied', Security.errorMessages.notAllowed);\n }", "title": "" }, { "docid": "5c8eaeb48583acdf9ac5c68a3c08e270", "score": "0.5512921", "text": "async requiresCurrentUser(req) {\n await this.requiresLogin(req)\n const userId = req.params.userId || req.params.id\n if (req.userId !== userId) throw new ForbiddenError()\n }", "title": "" }, { "docid": "22ef923bec654db6fc9f2e5c7b591025", "score": "0.5494834", "text": "disable() {\n return this._client.send(\"Security.disable\");\n }", "title": "" }, { "docid": "01382635ebaf49b7c1be1b7fe352e696", "score": "0.54916716", "text": "isAllowed(action, target) {\n return this.governess.isAllowed(action, target);\n }", "title": "" }, { "docid": "4922d14e9bebea0ceffe75acfecfb60d", "score": "0.5490802", "text": "setPublicReadOnly() {\n this.access.setPublicReadOnly();\n }", "title": "" }, { "docid": "80f48e6a1dd34a55185da9177e1ddfa6", "score": "0.54849917", "text": "setPublicNoAccess() {\n this.access.setPublicNoAccess();\n }", "title": "" }, { "docid": "cfb0fbad04de898eab8813e9bbfa8ff3", "score": "0.546988", "text": "allowInput () {\n this.blocked = false\n }", "title": "" }, { "docid": "e036bbc99c84ca1292f8325c02545b69", "score": "0.5438179", "text": "function warnControlledUsage(params) {\n \n }", "title": "" }, { "docid": "ed76b7af02cb4ccedf3f9a74bbe7b9c9", "score": "0.5429671", "text": "isPrivate() {\n return !!this.owner;\n }", "title": "" }, { "docid": "1c6c2b71a28bbad334a84c0388917d43", "score": "0.5427828", "text": "function oppPlayCardAbilityMods(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "fe242fe7d75ee10e2576cb9a06e33ca2", "score": "0.54211134", "text": "function is_privileged(user, data){\n if (data['owner'] != user &&\n data['admins'].indexOf(user) == -1){\n return false\n }else{\n return true\n }\n}", "title": "" }, { "docid": "cecfde205180b24dbe5aee71a313feee", "score": "0.5418254", "text": "deny() {\n return this._denier.apply(this, arguments);\n }", "title": "" }, { "docid": "cecfde205180b24dbe5aee71a313feee", "score": "0.5418254", "text": "deny() {\n return this._denier.apply(this, arguments);\n }", "title": "" }, { "docid": "1814cc1388529edc1d6b55364a58bde6", "score": "0.54080397", "text": "function takeDamageAbilityMods(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "6c2359087cec02f0ef6fcf38cbf4d6a0", "score": "0.5405491", "text": "async function eip712_permit(ali_address, owner, spender, value, nonce, deadline, p_key) {\n\treturn eip712_sign(\n\t\tali_address,\n\t\t'Permit',\n\t\t{owner, spender, value, nonce, deadline},\n\t\tp_key\n\t);\n}", "title": "" }, { "docid": "25376faea78d6f93ed67f9bad42feade", "score": "0.5401348", "text": "skipValidation() {\n return oAuthTypes.includes(this.provider);\n }", "title": "" }, { "docid": "babce2903c0486ba8a284ee10ce1b9ca", "score": "0.5380195", "text": "grants ({ principals, actions, data }) {\n return !this.secured || this._acl.grants({ principals, actions, securable: this, data })\n }", "title": "" }, { "docid": "3787f5736310b1b0084a0464a8fc4b49", "score": "0.53704566", "text": "function EnableSignedSOWReceived()\n{\n\ttry\n\t{\n\t\tif( DebugModeProject ) \n\t\t\twindow.alert( \"function EnableSignedSOWReceived()\" );\n\t\tvar user_r_only = IsAuthorizedForTeams( ['Project Signed SOW Received'] ) ? false : true;\t\t\n\t\tmySetDisabled( 'cust_signedsowreceived', user_r_only );\n\t}\n\tcatch( err )\n\t{\n\t\tif( DebugModeProject ) window.alert( \"function EnableSignedSOWReceived() error code \" + err );\n\t}\n}", "title": "" }, { "docid": "6028d824b4716a74d53f9e764bf79601", "score": "0.53676236", "text": "function originIsAllowed(origin) {\n\t// FIX THIS TO USE IN PRODUCTION ENVIRONMENT\n\treturn true;\n}", "title": "" }, { "docid": "feb27993a78866694551c63280d8be29", "score": "0.53640306", "text": "enable() {\n return this._client.send(\"Security.enable\");\n }", "title": "" }, { "docid": "1c82328e8f225f2938083e20a72083c6", "score": "0.5357894", "text": "isNotGuarded() {\n return !this.isGuarded;\n }", "title": "" }, { "docid": "a07c207a2ff4d283585e946e9f2b7be5", "score": "0.5351222", "text": "_canControl(user, event) {\n if (canvas.controls.ruler.active) return false;\n const tool = game.activeTool;\n if (tool === \"target\") return true;\n return game.user.isGM || (this.location && this.location.hasPerm(user, \"OWNER\"));\n }", "title": "" }, { "docid": "229dada14bce4e7fd1338653e3041c65", "score": "0.53348774", "text": "function originIsAllowed(origin) {\n return true;\n}", "title": "" }, { "docid": "7dd3e901a7b74f666fffa815bd343643", "score": "0.53299165", "text": "checkOwner () {\n return true\n }", "title": "" }, { "docid": "908cf48c8f01dc36c45f73a108eca22b", "score": "0.5318091", "text": "get isBlocked() {\r\n return this.subTypes.includes('user_block');\r\n }", "title": "" }, { "docid": "870b7ce252f45a6a680fb7ceff04aa7c", "score": "0.5309066", "text": "async allowIncomingXrp(wallet) {\n return this.coreXrplClient.changeFlag(account_set_flag_1.AccountSetFlag.asfDisallowXRP, false, wallet);\n }", "title": "" }, { "docid": "147873e05511867b867e34e73e254d5f", "score": "0.52931", "text": "isGuarded() {\n return !this._unguarded;\n }", "title": "" }, { "docid": "60c1e7f47004081f22469d07a4030db1", "score": "0.5288264", "text": "function allowClicked()\n{ \n //if checked save the allow permission.\n var bRememberAlways = document.theForm.cbRemember.checked;\n if (bRememberAlways)\n {\t\n\tdwscripts.setCommandReturnValue(\"allowAlways\");\n }\n else\n {\n\t dwscripts.setCommandReturnValue(\"allow\");\n }\n saveDomainPermissions(\"Allow\", bRememberAlways);\n\n window.close();\n}", "title": "" }, { "docid": "57048a08f9fc8f54d06fb117ee097305", "score": "0.5285004", "text": "function EnableEstiamted( show_me )\n{\n\ttry\n\t{\n\t\tvar toDisable = ( IsAuthorizedForTeams( ['Service Mgmt'] ) == true ) ? false : true;\n\t\t\n\t\tif( DebugModeProject ) \n\t\t\twindow.alert( \"function EnableEstiamted\\nshow_me = \" + show_me.toString() + \"\\ntoDisable = \" + toDisable.toString());\n\t\t\n\t\tshow_me -= 11;\n\t\tfor( var i = 0; i < 8; i++ )\n\t\t\tmySetDisabled( gdf[ show_me ][ i ], toDisable );\n\t}\n\tcatch( err )\n\t{\n\t\tif( DebugModeProject ) window.alert( \"function EnableEstiamted error code \" + err );\n\t}\n}", "title": "" }, { "docid": "aaf2db0239e64a9632dc986d9116e205", "score": "0.5280905", "text": "function oppCardOnPlayAbility(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "00beefa824a4162f2acfb687aa5dd308", "score": "0.52721334", "text": "function disable_free_admission(){\n\n var type_access_options=document.getElementsByName('type_access[]');\n if(type_access_options[0].value()===\"Ticket\"){\n type_access_options[2].prop(disabled,true);\n }\n }", "title": "" }, { "docid": "91abfaaa90f965f4168b9c97cbc5d8ad", "score": "0.5271487", "text": "function allow( targetObj, state ){\r\n\t\ttargetObj.disabled = !state;\r\n\t}", "title": "" }, { "docid": "f52a38c8328c037b53a8a26b67afd952", "score": "0.5249187", "text": "function doDamageAbilityMods(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "7c4456aa004ac08c3e479a04109b2daa", "score": "0.5232931", "text": "function isAllowed(variable) {\n return options.allow.indexOf(variable.name) !== -1;\n }", "title": "" }, { "docid": "4fcc78cdd6b8080d016b9ffd2d5320b1", "score": "0.52305883", "text": "shareAccessValidator() {\n const {user, user_list} = this.state;\n if (user_list.find(e => e === user) === undefined) {\n //Allow it to add\n return true\n } else {\n return false\n }\n }", "title": "" }, { "docid": "377e4c380cbb37de4ca397840e131ffa", "score": "0.52269703", "text": "allowSend() {\n return true;\n }", "title": "" }, { "docid": "9ae5c340df7ca953dc27d346b8ac40e6", "score": "0.52225864", "text": "function trustNone() {\n return false;\n}", "title": "" }, { "docid": "9ae5c340df7ca953dc27d346b8ac40e6", "score": "0.52225864", "text": "function trustNone() {\n return false;\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.52208906", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.52208906", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.52208906", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.52208906", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.52208906", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.52208906", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.52208906", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.52208906", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "0ce4f327b5b4f5fd2721cbe2c31c8195", "score": "0.52208906", "text": "function trustNone () {\n return false\n}", "title": "" }, { "docid": "1e17123b01f9ef68d7db2572181dd774", "score": "0.5211784", "text": "async requireAllow () {\n\t\tawait this.requireAllowParameters(\n\t\t\t'body',\n\t\t\t{\n\t\t\t\trequired: {\n\t\t\t\t\t'array(number)': ['accountIds']\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "64ec6395c5bfebe9b152f210b8e7fc97", "score": "0.52000636", "text": "function handleIllegalAccessFailure(sendResponse, obj) {\n notify(\n NOTIFICATION.illegalAccess.title,\n NOTIFICATION.illegalAccess.message\n );\n // empty user cache\n setCachedValue('tipp_account', {});\n chrome.browserAction.setPopup({ popup: 'splash.html' });\n return sendResponse((obj) ? obj : {});\n }", "title": "" }, { "docid": "3702a16fa22a695444a2671c0a833cbf", "score": "0.51875645", "text": "function fixPRIVATE()\n{\n\tif (ScriptUtil.getPatient().hasPrivatePieces(ScriptUtil.getUser()))\n\t{\n\t\tvar items = ScriptUtil.getItemsInSection(\"Adult Immu Last Form Items\");\n\t\tvar i = 0;\n\t\tvar curitem;\n\t\tfor (i ; i < sizeOfArray(items); i++)\n\t\t{\n\t\t\tif (get(items[i].getId()).getValue() == \"PRIVATE\")\n\t\t\t{\n\t\t\t\tsetVal(items[i].getId(), \"\");\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "da9aafad0e3f563c92bf26175342a3f3", "score": "0.5185458", "text": "function privacySandboxPrefSetterToTrueExpectErrorAndControlled(prefName) {\n this[prefName].set(\n {value: true},\n chrome.test.callbackFail(privacySandboxErrorMessage, () => {\n this[prefName].get({}, expectControlled(prefName, false));\n }));\n}", "title": "" }, { "docid": "25607d13868edc24305f2579316636ea", "score": "0.51640576", "text": "function isWrongSecret(isSpecialist, secretKey) {\n if (isSpecialist) {\n return secretKey != process.env.SPECIALIST_MANIPULATION_KEY;\n }\n // !isSpecialist\n return secretKey != process.env.STUDENT_MANIPULATION_KEY;\n}", "title": "" }, { "docid": "5b2c66919f32edf1bef3e1165728d69d", "score": "0.5163626", "text": "function TEMP_ALLOW(userId) {\n // User is logged in:\n return userId;\n}", "title": "" }, { "docid": "07852bb3b1388cbe08a2aa08a37fcb41", "score": "0.5162293", "text": "static isAccessAllowed(stateMetadata, user) {\n switch (stateMetadata.visibility) {\n case DurableEntity_1.VisibilityEnum.ToOwnerOnly:\n if (!stateMetadata.owner || stateMetadata.owner !== user) {\n return false;\n }\n return true;\n case DurableEntity_1.VisibilityEnum.ToListOfUsers:\n if (!stateMetadata.allowedUsers || !stateMetadata.allowedUsers.includes(user)) {\n return false;\n }\n return true;\n case DurableEntity_1.VisibilityEnum.ToEveryone:\n return true;\n default:\n // Should always return false here, to prevent accidental exposure of external entities\n return false;\n }\n }", "title": "" }, { "docid": "080112c07efbfd2f5fa6580e35bbacc4", "score": "0.51598585", "text": "async btcModifiable() {\n const email = this.getEmail();\n let modifiable = await this.service.users.query(['btcAddressModifiable'], email);\n modifiable = modifiable[0] && modifiable[0].btcaddressmodifiable || false;\n this.response(200, { modifiable });\n }", "title": "" }, { "docid": "2727cfcaed790f5fbf20958589c87ac3", "score": "0.5155932", "text": "function Preauthorization() {\n\n}", "title": "" }, { "docid": "c0294ed82c190d4fc9d7e1fb20d21242", "score": "0.515123", "text": "isYoutubeBlocked(nanodegree) {\n const isChinaUser = i18n.getCountryCode() === 'CN';\n // Some of our big India enterprise customers are blocking Youtube\n const isIndiaUser = i18n.getCountryCode() === 'IN';\n const isEnterprise = NanodegreeHelper.isEnterprise(nanodegree);\n return isChinaUser || (isIndiaUser && isEnterprise);\n }", "title": "" }, { "docid": "7d444629916c3d5c0817939e9d9f0cb7", "score": "0.5150373", "text": "function privacySandboxPrefSetterToFalseExpectControlled(prefName) {\n this[prefName].set({value: false}, chrome.test.callbackPass(() => {\n this[prefName].get({}, expectControlled(prefName, false));\n }));\n}", "title": "" }, { "docid": "24e8e0e7d00ca518d17c7ea0cfb3804d", "score": "0.5138778", "text": "function grantTypeAllowed(clientID, grantType, callback) {\n callback(false, true);\n}", "title": "" }, { "docid": "d92637d23ffb686ac12b5e0020cd86b3", "score": "0.5132265", "text": "validatePrivileges(){\n return !this.privileges || this.privileges.length==0\n }", "title": "" }, { "docid": "27a0b0ef6b600de87db64c0a66944b36", "score": "0.51314914", "text": "function showNotAuthorizedDialog() {\n console.log(\"Not authorised\");\n if (!$rootScope.coreModel.modal.loginModal) {\n $rootScope.coreModel.modal.loginModal = true;\n var modalInstance = $modal.open({\n templateUrl: serverURls['NOACCESS_FORM'],\n controller: \"LoginCtrl\",\n backdrop: \"static\"\n });\n\n modalInstance.result.then(\n function() { /* On Success */\n $rootScope.coreModel.modal.loginModal = false;\n },\n function() { /* On error */\n $rootScope.coreModel.modal.loginModal = false;\n });\n }\n }", "title": "" }, { "docid": "8bb8fd4a035ca38cce9efc04722fd5ca", "score": "0.512857", "text": "function allowPermittedAction() {\n if ($state.$current.name.indexOf('manage') > -1 && $scope.curTrial.actions.indexOf('manage-sites') < 0) {\n $state.go('main.trials', null, {reload: true});\n }\n }", "title": "" }, { "docid": "be8f03950d7db850c2e6f67f243ebc26", "score": "0.51233757", "text": "verifyPermission(resource, postUserId){\n if(resource != postUserId){\n throw new InvalidAccessException();\n }\n }", "title": "" }, { "docid": "011860f9a07fe66c8ff3fafe7386bb0c", "score": "0.5122856", "text": "isAdmin () {\n return this.deploy().then((instance) => {\n return instance.isAdmin({from: this.account})\n })\n }", "title": "" }, { "docid": "df8afec0fd2ac9acacac9e3d023765b1", "score": "0.5118062", "text": "async allowLogin () {\n\t\tawait this.generateAccessToken();\n\t\tthis.grantSubscriptionPermissions(); // NOTE - no await here, this can run in parallel\n\t\tthis.getCountryCode(); // NOTE - no await here, this is not part of the actual request flow\n\t}", "title": "" }, { "docid": "f76dd9c2aa4910dca61ab2b85dbeec18", "score": "0.5112066", "text": "isSecurityEnabled() {\n\t\treturn true;//to do\n\t}", "title": "" }, { "docid": "cdb22523e43bc3094626a1a793a7a079", "score": "0.51105905", "text": "static forceAllow() {\n BrowserPollConnection.forceAllow_ = true;\n }", "title": "" }, { "docid": "3d22d96c298efec1da0cabf382ac9b7b", "score": "0.5102212", "text": "static function verifyIgnoreACL(user : User) {\n var tempIgnoreACL = user.Roles*.Role*.Privileges*.Permission.contains(\"ignoreacl\")\n \n if(user.ignoreACLDenormIndExt != tempIgnoreACL)\n user.ignoreACLDenormIndExt = tempIgnoreACL\n }", "title": "" }, { "docid": "846729b677a9c73eeefdb327e58ef508", "score": "0.5098207", "text": "static forceAllow() {\r\n BrowserPollConnection.forceAllow_ = true;\r\n }", "title": "" }, { "docid": "0479c0bf4715ed13e2ddfb7cb4ad486b", "score": "0.5095318", "text": "function cardOnPlayAbility(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "2edd46bb05d429365630dd140ff4b121", "score": "0.5094918", "text": "function testAccountAccess() {\n\t\tgetAccountKey(validateAccountAccess);\n\t}", "title": "" }, { "docid": "3067e1acd40653b92988e8448208336e", "score": "0.5089966", "text": "function playCardAbilityMods(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "9430dc7be6df9b26cca0b43514705b98", "score": "0.5083557", "text": "function requiresGrantedAccessRights(req, res, next) {\n //check, if user has granted access for this coach\n //fetch permission table {user:, coach:, validTil:}\n console.log(req.params.uid);\n next();\n}", "title": "" }, { "docid": "35dbe816c9bf4679e8701fd1723c1ece", "score": "0.5078992", "text": "cannot(value) {\n\t\treturn !this.can(value)\n\t}", "title": "" }, { "docid": "9f58b8e56357a5c68ae177e8fa91974b", "score": "0.5078937", "text": "function PrivateIsCaged() { return (CurrentCharacter.Cage == null) ? false : true }", "title": "" }, { "docid": "071504635f389a5eadaca4f7d295a8cb", "score": "0.50696343", "text": "set legal(covered) {\n this._legal = covered;\n }", "title": "" } ]
c863f7bfcb84722cb7a974ebe503b1ba
TODO: Create a function to generate markdown for README
[ { "docid": "e36a448b5e5d22a1472246b01bf3b4bd", "score": "0.79937625", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n # Table of contents\n * [Description](#description)\n * [Installation](#installation)\n * [Contributing](#contributing)\n * [User Story](#userstory)\n * [Tests ](#Tests)\n * [License](#license)\n\n ## Description\n ${data.description}\n\n ## Installation\n ${data.installation}\n\n ## Contribution\n ${data.contribution}\n\n ## User Story\n ${data.userstory}\n\n ## Tests\n ${data.tests}\n\n ## License\n ${data.license === 'MIT' ? mit : ''}\n ${data.license === 'APACHE' ? apache : ''}\n ${data.license === 'ISC'? isc : ''}\n \n\n ## Questions\n For any questions do not hesitate to reach out. \\n\n Contact me:\n On Github: ${data.username} \\n\n Via Email: ${data.email}\n\n`;\n}", "title": "" } ]
[ { "docid": "079ca5194d9b4e9e3158bdf13916889e", "score": "0.84491825", "text": "function generateMarkdown (data) {\n// a notice is added to the section of the README entitled License that explains which license the application is covered under // (Line 23)\n\n// WHEN I click on the links in the Table of Contents\n// THEN I am taken to the corresponding section of the README\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n ## Table of Contents\n - [Description](#description)\n - [Installation](#installation)\n - [Usage](#usage)\n - [Contributing](#contributing)\n - [Tests](#tests)\n - [Questions](#questions)\n ## Description\n \n ${data.description}\n ## Installation\n ${data.installation}\n \n ## Usage\n \n ${data.usage}\n ## Contributing\n \n ${data.contributing}\n ## Tests\n \n ${data.tests}\n ## Questions\n You can reach out to me if you have any questions with the following links:\n * GitHub: [${data.github}](#https://github.com/${data.github})\n * Email: [${data.email}](#${data.email})\n \n`;\n\n}", "title": "" }, { "docid": "73e110bca1731a77f3e263444dbae104", "score": "0.8408663", "text": "function generateMarkdown(data) {\n return `\n # ${data.title} \n \n ${renderLicenseBadge(data.license)}\n\n ## Demo\n ![demo](https://github.com/mitch-skaff/README-Generator/blob/main/demo.gif)\n\n ## Table of Contents\n * [Description](#Description)\n * [Installation](#Installation)\n * [License](#License)\n * [Usage](#Usage)\n * [Tests](#Tests)\n * [Contributing](#Contributing)\n * [Questions](#Questions)\n \n ## Description\n ${data.describe}\n\n ## Installation\n ${data.install}\n\n ${renderLicenseSection(data.license)}\n\n ## Usage\n ${data.usage}\n\n ## Tests\n ${data.test}\n\n ## Contributing\n ${data.contribute}\n\n ## Questions\n For any further questions regarding this project please contact me through either my GitHub, https://github.com/${data.github}, or my email, ${data.email}!`;\n}", "title": "" }, { "docid": "a3cd8fa8f7d98fe5aae09a442d8d767d", "score": "0.84012496", "text": "function generateMarkdown(data) {\n // README template literal, the contents of the README.md\n return `# ${data.title}\n ![${data.license} License Badge](${renderLicenseBadge(data.license)})\n\n ## Table of Contents\n\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contribution](#contribution)\n * [License](#license)\n \n # Installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ## Description\n\n ${data.description}\n\n ## Contribution\n\n ${data.contributors}\n\n ## License\n\n ${renderLicenseSection(data.license)}\n\n ## Tests\n\n ${data.test}\n\n ## Questions\n\n Questions can be asked by following the links below to message me on LinkedIn or email.\n\n # Contact\n * GitHub: https://github.com/${data.git}\n * LinkedIn: ${data.linkedin}\n * Email: ${data.email}`\n;\n}", "title": "" }, { "docid": "a37d920c170f2011225409c62e4b4fd5", "score": "0.8343332", "text": "function generateMarkdown( readmeData ) {\n return `\n# ${readmeData.projectTitle}\n\n## Description: \n${readmeData.projectDesc}\n\n## Table of Contents\n1. **[Installation](#installation)**\n2. **[Usage](#usage)**\n3. **[License](#license)**\n4. **[Contributing](#contributing)**\n5. **[Tests](#tests)**\n6. **[Questions](#questions)**\n\n## Installation:\n${readmeData.installInstr}\n\n## Usage:\n${readmeData.usageInfo}\n\n## License:\nLicensing information can be viewed at:\n[${readmeData.licenseBadge}](https://${renderLicenseLink( readmeData.licenseBadge )})\n<br>The license for this application is covered under ${renderLicenseSection( readmeData.licenseBadge )}.\n${renderLicenseBadge( readmeData.licenseBadge )}\n\n## Contributing:\n${readmeData.contributingInstr}\n\n## Tests:\n${readmeData.testInstr}\n\n## Questions:\nThe author may be reached via:\n[Github](https://github.com/${readmeData.githubUsername})\n[Email](mailto:${readmeData.email})\n`;\n}", "title": "" }, { "docid": "123164eda507c7bfbd6501e77d14d391", "score": "0.83108974", "text": "function generateMarkdown (info) {\n return `\n ${renderLicenseBadge(info.license)}\n\n ## ${info.title}\n\n ${info.livelink}\n\n ## Description\n ${info.description}\n\n ## Table of Contents\n *[Installation](#installation)\n\n *[Useage](#usage)\n\n ${renderLicenseLink(info.license)}\n\n *[Contribute](#contribute)\n\n *[Test](#test)\n\n *[Questions](#questions)\n\n ## Installation\n To install the dependencies, run the following command(s): ${info.installation}\n\n ## Useage\n ${info.useage}\n\n${renderLicenseSection(info.license)}\n\n ## Contribute\n ${info.contribute}\n\n ## Test\n\n To run test, run the following command: ${info.test}\n<br>\n\n ## Questions\n If you have any questions about the repo, open an issue or contact me directly at ${info.email}. You can find more of my work at https://github.com/${info.github}.`;\n\n \n}", "title": "" }, { "docid": "6c4dec9bb12b4bffb974911e3a382e84", "score": "0.82429916", "text": "function generateMarkdown({ usage, contributions, title, npmi, npmTest, description, email, username, license }) {\n return `# ${title} \n ${renderLicenseBadge(license)}\n\n\n## Description\n${description}\n\n## Table of contents\n * Installation\n * Usage\n * License\n * Contributing\n * Tests\n * Questions\n\n\n## Installation\n### To install necessary dependencies, run the following command:\n\\`\\`\\`\n ${npmi}\n\\`\\`\\`\n\n## Usage\n${usage}\n\n${renderLicenseSection(license)}\n\n## Contributing\n${contributions}\n\n## Tests\n\\`\\`\\`\n ${npmTest}\n\\`\\`\\`\n\n## Questions\n### If you have any questions about the repo, open an issue or contact me directly at ${email}. You can find more of my work at ${username}\n\n`;\n}", "title": "" }, { "docid": "6a969d721c42d694d08e9cbfc9a6fd1d", "score": "0.8220472", "text": "function generateMarkdown(md) {\n const { title, github, repo, license } = md\n let readmeContent = '';\n const sectionArr = [\n {\n header: 'Install',\n content: createInstall(md.install)\n },\n {\n header: 'Usage',\n content: createUsage(md.usage)\n },\n {\n header: 'Screenshot', \n content: createScreenshot(md.screenshot)\n },\n {\n header: 'Tech Created',\n content: createTechWith(md['techwith'])\n },\n {\n header: 'License',\n content: createLicense(license)\n },\n {\n header: 'Contributor', \n content: md.contributor\n },\n {\n header: 'Tests',\n content: createTest(md.tests)\n },\n {\n header: 'Question(s)',\n content: createQuestion(md.question, github, repo)\n },\n];\n\n// If content exists, then add section to README\n\nsectionArr.forEach((sectionItem) => {\n if (sectionItem.content && sectionItem.header === 'screenshot') {\n readmeContent += `### ${sectionItem.header}\n ${sectionItem.content}\n `\n } else if (sectionItem.content) {\n readmeContents += `## ${sectionItem.header}\n ${sectionItem.content}\n \n `;\n }\n });\n return `# ${title}\n ![GitHub issues](https://img.shields.io/github/issues/tonyslonaker/generateMarkdown?color=red)\n [![Issues](https://img.shields.io/github/issues/${github}/${\n repo\n })](https://github.com/tonyslonaker/Professional-README-Generator/issues${github}/${\n repo\n }/issues) [![Issues](https://img.shields.io/github/tonyslonaker/contributors/${\n github\n }/${repo})](https://github.com/tonyslonaker/Professional-README-Generator/${github}/${\n repo\n }/graphs/contributors) ${addLicenseBadge(license)}\n ## Description\n ${createDescription(title, data.description, data.link)}\n ## Contents\n ${createTableOfContents(sectionArr)}\n ${readmeContents}`;\n }", "title": "" }, { "docid": "c585d08a3164562cc9731c70a26d6d59", "score": "0.8148111", "text": "function generateREADME(answers) {\n return `# ${answers.title} \n \n #### Table of Contents \n 1. [Project Description](#project-description) \n 2. [Installation Instructions](#installation-instructions)\n 3. [Usage Information](#usage-information)\n 4. [Contributor](#contributor)\n 5. [Code of Conduct](#code-of-conduct)\n 6. [Test Instructions](#test-instructions)\n 7. [License](#license)\n 8. [Questions](#questions)\n\n ## Mock-Up\n\n Here is a video demonstrating this application\n ![GIF Of Functionality](./INSERT GIF HERE) \n\n ## Project Description\n * ${answers.description}\n ## Installation Instructions\n * [App Link](${answers.install})\n ## Usage Information\n * ${answers.use}\n ## Contributor Guidelines\n * ${answers.contributions}\n ## Code of Conduct\n * [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md)\n ## Test Instructions\n * ${answers.test}\n ## License\n * licensed under the ${answers.license}\n ## Questions\n * For additional help or questions about collaboration, please reach out to ${answers.email}\n * Follow me on Github at [${answers.github}](http://github.com/${answers.github})`;\n }", "title": "" }, { "docid": "5be1f4072014c486427bfac468103c00", "score": "0.81059176", "text": "function generateMarkdown({ name, title, description, installNotes, usageNotes, email, gitHubUser, license }) {\n return `# ${title}\n \n ## Description\n ${description}\n\n ## License\n ${renderLicenseBadge({license})}\n ${renderLicenseLink({license})}\n ${renderLicenseSection({name, license})}\n\n ## Table of Contents\n - [License](#license)\n - [Installation](#installation)\n - [Usage](#usage)\n - [Contribute](#how-to-contribute)\n - [Questions](#questions)\n \n ## Installation\n ${installNotes}\n\n ## Usage\n ${usageNotes}\n\n ## How to Contribute\n Contact through [email](mailto:${email}) to contribute to ${title}.\n\n ## Questions\n If you have any questions, contact me through [email](mailto:${email}).\n\n Check out other projects on [GitHub](http://www.github.com/${gitHubUser}).\n `;\n}", "title": "" }, { "docid": "240fe4498ed2e8165aa0369edb2fa933", "score": "0.8068038", "text": "function generateMarkdown(data) {\n return `\n # ${data.title} \\n\n\n <br>\n ${data.description} \\n\n <br>\n\n [Deployed last version](${data.deployedLink})\\n\n [Github repo](${data.gitHubLink})\n\n <br>\n\n ## Table of Contents \n \n ##### * [Technologies used](#Technologies)\n ##### * [Usage walkthrough](#Walkthrough)\n ##### * [Installation](#Installation)\n ##### * [Credits](#Credits)\n ##### * [License](#License)\n ##### * [Contact Info](#Contact)\n\n\n ## Technologies:\n _*${data.technologies}*_\n\n ## Walkthrough:\n #### Video:\n Please follow this *[link](${data.videoLink})* to watch the walkthrough video.\n\n #### Screenshots:\n ${screenshots(data.screenshot1, data.screenshot2)}\n\n ## Installation:\n Run the following commands in your integrated terminal to initalize the application:\\n\n 1. git clone [Repository link you can find under \"code\" button] (To get the code from a repo)\\n\n 2. npm install inquirer\\n\n 3. npm install fs\\n\n 3. node index.js\\n\n 4. Answer all the questions accordingly\\n\n 5. Get the output in a form of a new custom generated README.md file\n \n ## Credits:\n ${credits(data.credit1, data.credit2, data.credit3)}\n\n ## License: \\n\n ##### Copyright: ${data.name}\\n\n ##### ${renderLicenseBadge(data.license)}\\n\n ##### ${renderLicenseLink(data.license)}\n\n\n ## Contact: \\n\n ##### ${data.email}\n`\n}", "title": "" }, { "docid": "759d2331d910731e5b7a41fe0afa5139", "score": "0.8019456", "text": "function generateREADME(answers) {\n return `\n # ${answers.projectTitle}\n Creator: ${answers.yourName}\n GitHub: https://github.com/${answers.username}\n\n <a name=\"desc\"></a>\n # Description\n ${answers.description}\n\n \n # Table of Contents \n 1. [Description](#desc)\n 2. [Installation](#install)\n 3. [Usage](#usage)\n 4. [Licenses](#lic)\n 5. [Contributing](#contr)\n 6. [Tests](#test)\n 7. [Questions](#quest)\n \n <a name=\"install\"></a>\n # Installation \n ${answers.installation}\n \n <a name=\"usage\"></a>\n # Usage \n ${answers.usage}\n\n <a name=\"lic\"></a>\n # Licenses\n ${answers.license}\n \n <a name=\"contr\"></a>\n # Contributing \n ${answers.contributing}\n \n <a name=\"test\"></a>\n # Tests \n ${answers.test}\n\n <a name=\"quest\"></a>\n # Questions \n Please direct all quesitons to me, ${answers.yourName}. I can be found at ${answers.email} or at https://github.com/${answers.username}.\n\n `;\n}", "title": "" }, { "docid": "1078d5a294fa06c4ceae80af93f71bbe", "score": "0.799732", "text": "function generateMarkdown(data) {\n \n\n return `# ${data.title}\n ## Table of Contents\n * [Description](#Description)\n * [Installation](#Installation-Instructions)\n * [Usage Instructions](#Instructions-on-usage)\n * [Contribution Guidelines](#Contuibution-Guidelines)\n * [License](#License)\n * [Testing instructions](#Test-Instructions) \n * [e-mail](#Email-address)\n \n ## Description\n ${data.description}\n ## Installation Instructions \n ${data.installation}\n ## Instructions on usage \n ${data.usage}\n ## Contuibution Guidelines\n ${data.contribution}\n ## License\n [![license](https://img.shields.io/badge/license-${data.license}-blue)](https://shields.io)\n ## Test Instructions\n ${data.test}\n ### GitHub Profile\n [GitHub Profile](http://github.com/${data.username})\n ### Email address\n [e-mail address](${data.email})\n`;\n}", "title": "" }, { "docid": "ebdc522780adfbebd7680794a68f73e4", "score": "0.7989781", "text": "function generateMarkdown(data) {\n return `## ${data.projectName}\n---------------------------------------------------------------------\n${renderLicenseBadge(data.license)}\n\n## Description \n${data.description}\n\n## Table of Contents\n1. [Installation](#installation)\n2. [Usage](#usage)\n3. [License](#license)\n4. [Contributing](#contributing) \n5. [Tests](#tests)\n6. [Questions](#questions)\n\n## Installation\nPlease run the following command to install the neccessary dependencies: ${data.dependencies}\n\n## Usage\nYou should know...${data.repo}\n\n## License\nThe project is licensed under ${data.license}\n\n\n## Contributing\n${data.contribute}\n\n## Tests\nPlease run the following command to run tests: ${data.tests}\n\n## Questions\nIf you have any questions about the repo, please open an issue or contact me directly at ${data.email}. You can also find more of my awesome work at ${data.gitHubUserName}`;\n\n}", "title": "" }, { "docid": "ad20e6bbb19de2275ce2939a8ba37388", "score": "0.7982977", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n \n<a href=\"https://img.shields.io/badge/License-${data.license[0]}-brightgreen\"><img src=\"https://img.shields.io/badge/License-${data.license[0]}-brightgreen\"></a>\n## Table of Contents\n- [Description](#description)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contribution](#contribution)\n- [Test Instructions](#test-instructions)\n- [Contact Information](#contact-information)\n### Description\n${data.description}\n### Installation\n${data.installation}\n### Usage\n${data.usage}\n### Contribution\n${data.contribution}\n### Test-Instructions\n${data.tests}\n### Contact-Information\n[Github Profile](https://github.com/${data.username})\n${data.email}\n\n`;\n}", "title": "" }, { "docid": "ed6fab2b1d8469386351a6fbbcd5f5be", "score": "0.79796064", "text": "function generateMarkdown(data) {\n const [badge] = renderLicenseBadge(data.license);\n const [licenseSection, content] = renderLicenseSection(data.license);\n // copied markdown code from my skeleton ReadME then made adjustments\n return `# ${data.title}\n# \n## Table of Contents:\n\n*[Description](#Description: )\n\n*[Installation](#Installation: )\n\n*[Usage](#Usage: )\n\n*[License](#License: )\n\n*[Contributing](#Contributing: )\n\n*[Tests](#Tests: )\n\n*[Questions](#Questions: )\n \n#\n## Description:\n${data.description}\n\n${badge}\n \n#\n## Installation:\n${data.installation}\n \n#\n## Usage:\n${data.usage}\n \n#\n## License:\n${data.license}\n\n${badge}\n \n#\n## Contributing:\n${data.contributing}\n \n#\n## Tests:\n${data.tests}\n \n#\n## Questions:\nIf you have any questions about the project you can contact me via email or GitHub\n \nEmail: ${data.email}\n \nGitHub Profile: ${data.username}\n `;\n}", "title": "" }, { "docid": "597649ee1c28d06e473ff72d6bf6af65", "score": "0.7976742", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n## Description\n ${data.description}\n \n## Table of Contents\n ${installConfirm(data.installation)}\n * [Usage](#usage)\n * [Contributing](#contributers)\n * [Tests](#tests)\n ${renderLicenseSection(data.licenses)}\n \n${generateInstallation(data.installation)} \n\n## Usage\n ${data.usage}\n\n## Credits\n This application was developed by: ${data.contributors}\n\n GitHub: [${data.github}](https://github.com/${data.github})\n\n Email: [${data.email}](${data.email})\n\n## Licenses\n This application is under:\n\n ${renderLicenseBadge(data.licenses)}\n\n ![badge](https://img.shields.io/badge/license-${data.licenses}-blue);\n \n ${renderLicenseLink(data.licenses)}\n\n${testsConfirm(data.tests)}\n ${generateTests(data.tests)}\n\n`;\n}", "title": "" }, { "docid": "0038dbc4b8800d76ffc4a2be3c6a7dfb", "score": "0.7966401", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n## Description\n # ${data.description}\n## Content\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n## Installation \n # ${data.installation}\n## Usage\n # ${data.usage}\n## Tests\n # ${data.tests}\n## Username\n # ${data.username}\n## License\n # ${data.license}\n ${renderLicenseBadge(data.license)}\n`;\n}", "title": "" }, { "docid": "17b567e8b619e06581fc3c4736ed6030", "score": "0.79545224", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ![license](https://img.shields.io/badge/License-${data.license}-green.svg)\n\n ## Description\n\n ${data.description}\n\n ## Table of Contents\n - [Installation](#installation)\n - [Usage](#usage)\n - [License](#license)\n - [Contributing](#contributing)\n - [Credits](#credits)\n - [Tests](#tests)\n - [Questions](#questions)\n\n ## Installation\n\n ${data.install}\n\n ## Usage\n\n ${data.usage} \n\n ## License\n\n This application is licensed under ${renderLicenseLink(data.license)}\n \n \n\n ## Contributors\n\n ${data.credits}\n\n\n ## Tests\n\n ${data.testing}\n\n\n ## Questions\n\n If you have any questions about this project, please feel free to contact me at ${\n data.email\n } or to see more of my work https://github.com/${data.github}/\n \n\n`;\n}", "title": "" }, { "docid": "56231c0c183c057537a2a51f1fc5be8f", "score": "0.79331774", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n## Table of Contents\n[Description](#description)\n[Installation](#installation)\n[Usage](#usage)\n[Contribution](#contribution)\n[Testing](#testing)\n[Licensing](#licensing)\n[Questions](#questions)\n\n##Description:\n${data.description}\n\n##Installation:\n${data.installation}\n\n##Usage:\n${data.usage}\n\n##Contribution:\n${data.contribution}\n\n##Licensing\n${data.license}\n\n##Testing:\n${data.testing}\n\n##Questions:\nUnsure about something? Feel free to contact me through github or my email listed here:\n Github: [${data.githubUN}](https://github.com/${data.githubUN})\n Email: ${data.email}\n`;\n}", "title": "" }, { "docid": "ffb5fc95d1e956a9773a80b17269604d", "score": "0.7931565", "text": "function generateMarkdown(data) {\n\n return `# Project: ${data.title} ![License Badge](${renderLicenseBadge(data.license)})\n \n\n \n## Description\n***\n\n ${data.description}\n\n\n\n## Table of Contents\n*** \n\n - [Installation](#installation)\n - [Usage](#usage)\n - [How to Contribute](#How)\n - [Tests](#Tests)\n - [Questions](#Questions)\n - [License](#license)\n\n \n \n## Installation\n***\n\nThe installation can be completed by following these instructions:\n\n ${renderInstallation(data)} \n \n\n\n## Usage\n***\n\n ${renderUsage(data)} \n \n\n## How to Contribute\n***\n\n Developers who are interested in contributing ideas for this application must agree to follow and comply with the Contributor Covetnant: Code of Conduct. The Contributor Covenant Code of Conduct can be found in the following address:\n\n [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md/)\n\n\n\n## Tests\n***\n \n ${renderTest(data)}\n\n\n## Questions\n***\n \n You can find additional projects on my github page: https://github.com/${data.username}.\n\n If you have any questions please contact me at my E-Mail address: ${data.email}.\n\n## License\n***\n\nCopyright (c) ${getYear()} ${data.username}.\n\n${renderLicenseSection(data.license)}\n\n`;}", "title": "" }, { "docid": "0df6f84a6badc13bfcf7b70cabbdc481", "score": "0.79289496", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n ${renderLicenseBadge(data.license)}\n \n ## Table of Contents\n * [Description](#description)\n * [Installation](#install)\n * [Usage](#usage)\n * [License](#license)\n * [Contributors](#contributors)\n * [Tests](#test)\n * [Questions](#questions)\n \n \n ## Description <a name=\"description\"></a>\n ${data.description}\n \n ## Installation <a name=\"install\"></a>\n ${data.installation}\n\n ## Usage <a name=\"usage\"></a>\n ${data.usage}\n\n ## License <a name=\"license\"></a>\n ${renderLicenseSection(data.license)}\n\n ## Contributors <a name=\"contributors\"></a>\n ${data.installation}\n\n ## Tests <a name=\"test\"></a>\n ${data.test}\n\n ## Questions <a name=\"questions\"></a>\n Please direct any questions to <https://github.com/${data.github}> or email me at <${data.email}>\n`;\n}", "title": "" }, { "docid": "21152ef622ce90c3aac55d21078f7e27", "score": "0.792764", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n # Description\n ${Description}\n #Table of Contents\n *[Installation](#Installation)\n *[Usage](#Usage)\n *[Credits](#Credits)\n *[License](#License)\n #Installation\n Provide a step-by-step description of how to get the development environment running.${Installation}\n #Instruction\n ${Instruction}\n #Usage\n Provide instructions and examples for use. ${Usage}\n #Contribution\n If you created an application or package and would like other developers to contribute it, you will want to add guidelines for how to do so. ${Contribution}\n #Credits\n List your collaborators, if any, with links to their GitHub profiles.${Credits}\n #License\n This lets other developers know what they can and cannot do with your project. ${License}\n #Tests\n Provide examples on how to run them.${Test}\n #Questions\n ${Question}\n\n #Contact\n *GitHub:\n ${Github}\n *E-mail:\n ${Email}\n`;\n}", "title": "" }, { "docid": "da565f090e578d4a30d6d19b83a0db2e", "score": "0.79241514", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n ## Description\n ${data.description}\n ## Installation\n ${data.installation}\n \n ## Table of contntent \n * [Installation](#installation)\n* [Usage](#usage)\n* [Contributors](#contribution)\n* [License](#license)\n\n## Usage \n${data.usage}\n## Contributors\n${data.contribution}\n## License\n${renderLicenseBadge(data.licenses)}\n\n## Github\nContact me through Github at [${data.github}](https://github.com/${data.github}/) or by email through ${data.email}.`;\n}", "title": "" }, { "docid": "8e91d79b55533f7bbda7aa758c115cc4", "score": "0.7923097", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n \n### Description ###\n${data.description}\n\n### Table of Contents\n${data.contents}\n\n### Installation ###\n\n${data.installation}\n\n## usage ##\n\n${data.usage}\n\n## License ##\n\n${data.license}\n\n## Test Instructions\n \n${data.tests}\n\n## Github ##\n[Github Link](https://github.com/${data.username})\nfor more information, contact me at ${data.email}\n\n`;\n\n\n}", "title": "" }, { "docid": "96d4d5625357be15a3ac8e6bf9d946d0", "score": "0.79155314", "text": "function generateMarkdown(data) {\n const year = new Date().getFullYear();\n const name = data.fullName;\n const badge = licenseObj[data.license[0]].badge;\n let licenseText = licenseObj[data.license[0]].licenseText; \n licenseText = licenseText.replace(\"<YEAR>\", year);\n licenseText = licenseText.replace(\"<OWNER>\", name);\n \n return `# ${data.title}\n\n${badge}\n\n## Description\n\n${data.description}\n\n![${data.title}](./images/readme.png)\n\n## Table of Contents\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Installation\n\n${data.installation}\n\n## Usage\n\n${data.usage}\n\n## License\n\n${licenseText}\n\n## Contributing\n\n${data.contributing}\n\n## Tests\n\n${data.testing}\n\n## Questions\n\nGithub Profile for ${data.fullName}:\nhttps://github.com/${data.githubName}\n\nFeel free to contact me with any questions:\n${data.email}\n\n`;\n}", "title": "" }, { "docid": "98f38e7287b965fe9776dc7702142258", "score": "0.7904667", "text": "function generateMarkdown(data) {\n return(`## Project Title\n ${data.title}\n \n ${projectURL(data.github, data.title)}\n\n ${renderLicenseBadge(data.license, data.github, data.title)}\n\n ## Table of Contents\n\n- [Description](#description)\n- [Installation](#installation)\n- [Usage](#usage)\n${licenseToc(data.license)}\n- [Contirbuting](#collaborators)\n- [Deployed App](#deployment)\n- [GitHub](#github)\n- [Tests](#tests)\n- [Questions](#questions)\n\n ## Description\n\n ${data.description}\n\n ## Installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ${renderLicenseSection(data.license)}\n\n ## Test\n\n ${data.test}\n\n ## Deployed App\n\n ${data.deployment}\n\n ## Collaborators\n\n ${data.contributing}\n\n ## Questions\n \n Find me on GitHub: [${data.github}](https://github.com/${data.github})\n \n Email me with any questions: ${data.email} \n\n`);\n}", "title": "" }, { "docid": "7a319a99fed3639dc9410efb39306693", "score": "0.79033035", "text": "function generateMarkdown(data) {\n return `## ${data.title} ${renderLicenseBadge(data.license)}\n\n\n## Description:\n\n${data.description}\n\n## Table of Contents\n\n*[Installation](#installation)\n\n*[Usage](#usage)\n\n*[Testing](#testing)\n\n${renderLicenseLink(data.license)}\n\n*[Contribution](#contribution)\n\n*[Questions](#questions)\n\n## Installation\n\n${data.instructions}\n\n## Usage\n\n${data.usage}\n\n## Testing\n\n${data.testing}\n\n${renderLicenseSection(data.license)}\n\n\n## Contribution\n\n${data.contribution}\n\n\n## Questions\n\nIf you have any questions about this project you can contact me at ${data.email}.\nCheck out my portfolio of work here: [${data.username}](https://github.com/${data.username})\n`;\n}", "title": "" }, { "docid": "0c86436e992d8095733d7afb2f5e01d8", "score": "0.78997594", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n \n ${addBadge(data.license)}\n\n ## Description\n\n ${data.description}\n\n ## Table of Contents\n\n * [Installation](#installation)\n \n * [Usage](#usage)\n\n * [License](#license)\n\n * [Contributing](#contributing)\n \n * [Tests](#tests)\n\n * [Questions](#questions)\n \n ## Installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ## License\n\n ${checkLicense(data.license)}\n\n ## Contributing\n\n ${data.contributing}\n\n ## Tests\n\n ${data.test}\n\n ## Questions\n\n Feel free to reach out to me at ${data.email} with any questions.\n\n More of my work can be seen here [github/${data.github}](https://github.com/${data.github}/).\n`;\n}", "title": "" }, { "docid": "e28ba8f16349ffadd67e7249335ec2f9", "score": "0.7899433", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ## Description\n\n * ${data.description}\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 ## Installation\n \n * ${data.installation}\n\n ## Usage\n\n * ${data.usage}\n\n ## License\n \n * ${data.license}\n\n ## Contributing\n\n * ${data.contributing}\n\n ## Tests\n\n * ${data.tests}\n\n ## Questions\n\n * GitHub profile name [${data.github}](https://github.com/${data.github})\n\n * E-mail ${data.email} for additional questions\n`;\n}", "title": "" }, { "docid": "2755c4a90d5b8157c88e3ba10cefeb85", "score": "0.7895593", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n Created by:\n ## ${data.github} | ${data.email}\n # Table of Contents\n 1. [Description](#description)\n 2. [Installation](#installation)\n 3. [Contributors](#contributors) \n 4. [How to test](#testing) \n # Description\n ${data.description}\n # Installation:\n ${data.installation}\n # Contributors:\n ${data.contributors}\n # Testing:\n ${data.test}\n ## License:\n ${data.license}\n ${renderLicenseBadge(data.license)}\n \n`;\n}", "title": "" }, { "docid": "86f1195dcd4423647ab93602b58faa67", "score": "0.78938365", "text": "function generateMarkdown(data) {\n return `# ${data.Title}\n \n ## Description\n\n ${data.Description}\n\n ## GitHub\n\n ${data.GitHub}\n\n ## Email\n\n ${data.Email}\n\n ## Project URL\n\n ${data.URL}\n\n\n ## Table of Contents:\n\n * [Installation](#installation)\n\n * [Usage](#usage)\n\n * [License](#license)\n\n * [Contributing](#contributing)\n\n * [Tests](#tests)\n\n * [Questions](#questions)\n \n ## Installation\n\n To install necessary dependencies, run the following command:\n \\`\\`\\`\n ${data.Dependencies}\n \\`\\`\\`\n\n ## Usage\n\n \\`\\`\\`\n ${data.Using}\n \\`\\`\\`\n\n ## License\n\n This project is licensed under:\n\n \\`\\`\\` \n ${data.Licenses}\n \\`\\`\\`\n \n ${selectBadge(data.Licenses)}\n\n ## Contributing\n\n \\`\\`\\`\n ${data.Contributing}\n \\`\\`\\`\n\n ## Tests\n\n To run tests, run the following command:\n \\`\\`\\`\n ${data.Tests}\n \\`\\`\\`\n \n ## Questions\n\n For any questions regarding this application, please contact ${data.GitHub} at ${data.Email}.\n\n `;\n}", "title": "" }, { "docid": "b18da3eac57f692cfa3f01ac61fb7f2d", "score": "0.7889206", "text": "function generateMarkdown(data) {\n return `# ${data.Title}\n https://github.com/${data.Username}/${data.Title}\n # Description\n ${data.Description}\n # Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#Contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n #Installation\n The following necessary dependencies must be installed to run the application.\n # Usage\n In order to use this app, ${data.Usage}\n # License\n This project is licensed under the ${data.License} license.\n\n #Contributing\n Contributors: ${data.Contributing}\n # Tests\n The following is needed to run the test: ${data.Tests}\n # Questions\n If you have any questions about the repo, open an issue or content ${data.Username} directly at : ${data.Email}.\n`;\n}", "title": "" }, { "docid": "07ce3910b8913851ca05a80b66f56b46", "score": "0.7872688", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n \n ${badge}\n\n ## Table Of Contents\n* [Installation](#Installation)\n* [Description](#description)\n* [Usage](#usage)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [License](#license)\n* [Questions](#questions)\n\n\n\n## Description\n${data.description}\n\n## Installation\n${data.installation}\n\n## Usage \n\n${data.usage}\n\n## Contributing\n${data.contributing}\n\n## Tests\n${data.tests}\n\n## License \n[${data.license}](${link})\n\n## Questions? \nPlease contact via email at <${data.email}> or via github at <http://www.github.com/${data.github}>\n\n##\n`;\n}", "title": "" }, { "docid": "501733e2ca6dbd9c802700dcbf602113", "score": "0.7868553", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n${badge(data.license)}\n## Description\n${data.description}\n\n## Table of Contents\n* [Installation](#installation)\n${licenseLink(data.license)}\n* [Tests](#tests)\n* [Usage](#usage)\n* [Contribute](#contribute)\n* [Contact](#contact)\n\n## Installation\n${data.install}\n\n${licenseSection(data.license)}\n\n## Tests\nTo run tests, run this command ${data.test}\n\n## Usage\n${data.usage}\n\n## Contribute\n${data.contribute}\n\n## Contact\nIf you have an questions email me at ${data.email}. \nYou can also find me at my LinkedIn: ${data.linkedin}.\nFor more repos you can find me at: [${data.github}](https://github.com/${data.github})\n`;\n}", "title": "" }, { "docid": "bfd1601f32bbde80829d1ab593e0a531", "score": "0.7862455", "text": "function generateMarkdown(data) {\n const badge = renderLicenseBadge(data.license);\n return `\n # ${data.titleOfProject}\n\n ## Description\n ${data.description}\n\n ## Table of Contents\n - [Installation](#installation)\n - [Usage](#usage)\n - [License](#license)\n - [Credits](#credits)\n - [Tests](#tests)\n - [Contact](#contact)\n - [Github](#github)\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ## License\n ${data.license}\n Copyright (c) [${new Date().getFullYear()}]\n ${badge}\n ${renderLicenseLink(data.license)}\n\n ## Credits\n ${data.contributed}\n\n ## Tests\n ${data.tests}\n\n ## Contact\n ${data.email}\n\n ## Github\n ${data.github}\n\n ## How to Contribute\nIf you created an application or package and would like other developers to contribute it, you can include guidelines for how to do so. The [Contributor Covenant](https://www.contributor-covenant.org/) is an industry standard, but you can always write your own if you'd prefer.\n\n`;\n}", "title": "" }, { "docid": "df8e8c4a474217d4379de56601659955", "score": "0.7854346", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n![${licenseInfo[data.lic].name}](https://img.shields.io/badge/license-${data.lic.replace(/-/g, \"%20\")}-green)\n\n## Table of Contents\n 1. [Description](#Description)\n 2. [Installation](#Installation)\n 3. [Usage](#Usage)\n 4. [Contributing](#Contributing)\n 5. [Tests](#Tests)\n 6. [License](#License)\n 7. [Questions](#Questions)\n\n## Description\n\n${data.desc}\n\n## Installation\n\n\\`\\`\\`\n${data.install}\n\\`\\`\\`\n\n## Usage\n\n\\`\\`\\`\n${data.usage}\n\\`\\`\\`\n\n## Contributing\n\n${data.contrib}\n\n## Tests\n\n\\`\\`\\`\n${data.test}\n\\`\\`\\`\n\n## License\n\n${licenseInfo[data.lic].url ? `[${licenseInfo[data.lic].name}](${licenseInfo[data.lic].url})` : licenseInfo[data.lic].name}\n\n## Questions\n\nGitHub: [${data.github}](https://github.com/${data.github})\n\nE-mail: [${data.email}](mailto:${data.email})\n`;\n}", "title": "" }, { "docid": "11391cf9aa013df8c087af09b0b1075a", "score": "0.7853064", "text": "function generateMarkdown(data) {\n return `\n# ${data.title}\n\n${errorHandlingBadge(data.license)}\n\n## Description\n${data.description}\n\n## Table of Contents\n* [Installation](#installation)\n${usageLink(data.usage)}\n${contributingLink(data.contributing)}\n${licenseLink(data.license)}\n* [Tests](#tests)\n* [Questions](#questions)\n\n${errorHandlingInstallation(data.installation)}\n\n${usageText(data.usage)}\n\n${contributingText(data.contributing)}\n\n${licenseText(data.license)}\n\n## Tests\nTo run tests, run the following command: \n${data.tests}\n\n## Questions\nIf you have any questions about the repo, open an issue or contact me directly at ${data.email}.\nYou can find more of my work at github.com/${data.username}.\n`;\n}", "title": "" }, { "docid": "8fa83f91b4a0b57c62226f493e0352ba", "score": "0.78441536", "text": "function generateMarkdown(data) {\n return `# ${data.projectTitle}\n\n ${renderLicenseBadge(data.softwareLicense)}\n \n ## Table of Contents\n \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 \n ${data.projectDescription}\n\n ## Installation\n \n ${data.install}\n \n ## Usage\n \n ${data.use}\n \n ## License\n \n This project uses the '${renderLicenseSection(data.softwareLicense)}' license. \n \n More information can be found here: ${renderLicenseLink(data.softwareLicense)}\n \n ## Contributing\n \n ${data.contribute}\n \n ## Tests\n \n ${data.tests}\n \n ## Questions\n \n Link to my Github: https://github.com/${data.username}\n\n Please send any questions here: ${data.email}\n `;\n}", "title": "" }, { "docid": "75ba06938dac5ce6fc655db2d0dc5109", "score": "0.78338385", "text": "function generateMarkdown(data) {\n return `\n# ${data.title}\n${renderLicenseBadge(data.license)}\n\n## Table of Contents:\n[Description](#Description)\\n\n[Installation](#Installation)\\n\n[Usage information](#Usage-Information)\\n\n[Contributors](#Contributors)\\n\n[Test Instructions](#Test-Instructions)\\n\n[Questions](#Questions)\\n\n\n## Description\n\n${data.Description}\n\n## Installation \n\n${data.Installation}\n\n## Usage Information\n\n${data.Usage}\n\n## Contributing\n\n${data.Contribution}\n\n## Test Instructions \n\n${data.Tests}\n\n## License\n${renderLicenseSection(data.license)}\n\n## Questions\n\nGithub : https://github.com/${data.questions}\n\nAdditional questions? You can reach me at:\n\n${data.Email}\n\n\n\n\n`;\n}", "title": "" }, { "docid": "9d9b7ad1670707ed0ec008539627dc25", "score": "0.78313273", "text": "function generateMarkdown(data) {\n {\n return `# ${data.title}\nhttps://github.com/${data.username}\n*E-mail: ${data.email}\n# Description\n${data.description}\n## Table of Contents\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n# Installation\n* The following necessary dependencies must be installed to run the application \n${data.install}\n# Usage\n*In order to use this app, \n${data.usage}\n# License\nThis project is licensed under the ${data.license} license. \n![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)\n# Contributing\nContributors: \n${data.contributors}\n# Tests \nThe following is needed to run the test: \n${data.tests}\n# Questions\nIf you have any questions about the repo, open an issue or contact \n \n \n `;\n }\n}", "title": "" }, { "docid": "69c390ea59b7f216914c9eadc20724d5", "score": "0.7825887", "text": "function generateMarkdown(data) {\n \n return `# ${data.title}\n${renderLicenseBadge(data.license)}\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## Description\n ${data.description}\n## Installation\n ${data.installation}\n## Usage\n ${data.usage}\n## License\n ${data.license}\n ${renderLicenseLink(data.license)}\n \n## Contributing\n ${data.contributing}\n \n## Tests\n ${data.tests}\n## Questions\n If you have any questions about the repo, please open an issue in my GitHub at ${data.userName} or email me at ${data.email}.\n ${'Generated with ❤️ by Rabeea Jahangir'}\n`;\n}", "title": "" }, { "docid": "dc77fc90b962547272854e66e5daf53d", "score": "0.7820439", "text": "function generateMarkdown(data) {\n return `# ${data.Title}\n \n ${renderLicenseBadge(data.license)}\n \n ## Description\n \n ${data.Description}\n\n ## Table of Contents\n \n \n -[Installation](#installation)\n -[Usage](#usage)\n -${renderLicenseLink(data.license)}\n -[Credits](#credits)\n -[Test](#test)\n -[Email](#email)\n -[GithubUsername](#github-username)\n \n ##Installation\n \n \n Here is what you need to run the appliction ${data.Installation}\n\n ## Usage\n \n \n To use the application you will need ${data.Usage}\n\n \n \n ${renderLicenseSection(data.license)}\n \n ## Credits\n \n Contributors: ${data.Contributing}\n\n ## Tests\n \n \n Here is the command need to run the test ${data.Tests}\n\n ## Email\n \n \n if have any question plz Email anytime ${data.Email}\n\n ## Github Username\n \n \n https://github.com/${data.Username}\n`;\n}", "title": "" }, { "docid": "ce4628c413b1e7091c297eac7612cb4e", "score": "0.78150105", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n [${renderLicenseBadge(data.license)}](${renderLicenseLink(data.license)})\n\n## Contact\n Email: ${data.email} \n Github: [${data.github}](http://github.com/${data.github})\n \n## Table of Contents\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [GuideLines](#guideLines)\n * [Test](#test)\n \n## Description\n ${data.description}\n \n## Installation\n ${data.installation}\n \n## Usage Information\n ${data.usage}\n\n## License\n${renderLicenseSection(data.license)}\n\n## Contribution guidelines\n ${data.guidelines}\n\n## Test Instructions\n ${data.test} \n## Walk through Video\n Uses the [Inquirer package](https://drive.google.com/file/d/1YnK6js6nZa2f-Sy14vo2SeoEU4G369Pj/view?usp=sharing).\n`;\n\n}", "title": "" }, { "docid": "0463425de002db3d81869c8805212b11", "score": "0.78084284", "text": "function generateMarkdown(data) {\n return `# ${data.titlename}\n\n ${renderLicenseBadge(data.license)}\n\n ## Description \n\n ${data.projectDesc}\n\n ${confirmDeploy(data)}\n\n ## Table of Contents\n\n * [Installation](#installation)\n * [Usage](#usage)\n * [Credits](#credits)\n * [License](#license)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n \n ## Installation\n \n ${data.installSteps}\n \n ## Usage\n\n ${data.usage}\n ${confirmScreenshot(data)}\n\n ## Credits\n\n ${data.credits}\n\n ${renderLicenseSection(data.license)}\n\n ## Contributing\n\n ${data.contributer}\n\n ## Tests\n\n ${data.test}\n\n ## Questions\n\n ${data.contact}\n\n ${data.email}\n\n [https://github.com/${data.username}/${data.reponame}](https://github.com/${data.username}/${data.reponame})\n`;\n}", "title": "" }, { "docid": "551f15391e6588c45144838292c387ef", "score": "0.78053266", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n https://github.com/${data.username}/${data.directoryName}\n\n ## Description\n ${data.description}\n ${renderContributorsSection(data)}\n ## Table of Contents \n * [Methods](#methods)${includeInstallationInTableOfContents(data)}${includeLicenseInTableOfContents(data)}${includeBadgeInTableOfContents(data)} \n * [Usage](#usage)${includeSpecialInstructionInTableOfContents(data)}\n * [Technologies Used](#technologies)\n * [Repository URL](#website)\n * [Questions](#questions)\n \n ## Methods\n The following methods were used to run the application properly: **${data.methods}**.\n ${renderInstallationSection(data)}${renderLicenseSection(data)}${renderLicenseBadge(data)}\n ## Usage\n In order to use this app, **${data.usage}**.\n ${renderSpecialInstructionSection(data)}\n ## Technologies \n The following technologies being used: **${data.technologies}**.\n ## Website\n https://github.com/${data.username}/${data.directoryName} \n ## Contribution\n Made with ❤️ by ${data.name}.\n ## Questions\n If you have any questions about the repo, open an issue or contact **${data.username}** directly at : ${data.email}\n`;\n}", "title": "" }, { "docid": "4a02995c1560e56fbdfa1095bd6acb51", "score": "0.7802882", "text": "function generateMarkdown(data) {\n return `# ${data.title}\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 ${renderLicenseLink(data.license)}\n \n * [Contributing](#contributing)\n\n * [Tests](#tests)\n\n * [Questions](#questions)\n\n ## Installation \n\n Run the following npm command using git to install repo dependencies:\n\n \\`\\`\\`\n ${data.installation}\n \\`\\`\\`\n\n ## Usage\n\n ${data.usage}\n\n ${renderLicenseSection(data.license)}\n\n ## Contributing \n\n ${data.contributing}\n\n ## Tests\n\n To run tests, run the following command:\n\n \\`\\`\\`\n ${data.test}\n \\`\\`\\`\n\n ## Questions \n\n Questions? Shoot me a messsage at ${data.email}. \n\n Find all my work here [${data.github}](https://github.com/${data.github}/)!\n \n`;\n}", "title": "" }, { "docid": "b39db6351a7e208f191c7200b2f2af6a", "score": "0.7797689", "text": "function generateMarkdown(data) {\n if (data.license === 'MIT') {\n license = \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\"\n } else if (data.license === 'APACHE 2.0') {\n license = \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\"\n } else if (data.license === 'GPL 3.0') {\n license = \"[![License: GPL v3](https://img.shields.io/badge/License-GNU-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\"\n } else if (data.license === 'BSD 3') {\n license = \"[![License](https://img.shields.io/badge/License-BSD-orange.svg)](https://opensource.org/licenses/BSD-3-Clause)\"\n }\n return `# ${data.title}\n \n ${license}\n\n ## Table of Contents \\n\n 1. [Description](#description) \\n\n 2. [Installation](#installation-guidelines) \\n\n 3. [Usage](#usage) \\n\n 4. [License](#license) \\n\n 5. [Contribution](#contributing) \\n\n 6. [Tests](#tests) \\n\n 7. [Question](#questions) \\n\n\n ## Description \\n\n ${data.description} \\n\n \n ## Installation guidelines \\n\n ${data.installation} \\n\n\n ## Usage \\n\n ${data.usage}\n\n ## License \\n\n ${data.license}\n\n ## Contributing \\n\n ${data.contributing}\n\n ## Tests \\n\n ${data.tests}\n\n ## Questions \\n\n Visit my Github www.github.com/${data.github} \\n\n Email me with additional questions at ${data.email}\n `;\n}", "title": "" }, { "docid": "30da2a12580499d3533149a758bfcdc7", "score": "0.7795219", "text": "function generateMarkdown(data) {\n let output = `# TITLE: ${data.title}\\n`;\n output += `## DESCRIPTION:${data.description}\\n\\n\\n`;\n output += `## TABLE OF CONTENTS: \n* [github](#GITHUB)\n* [email](#EMAIL)\n* [LICENSE](#LICENSE)\\n\\n\\n`;\n output += `## GITHUB: ${data.github}\\n\\n\\n`;\n output += `## EMAIL: ${data.email}\\n\\n\\n`;\n output += `## LICENSE: ${data.license}\\n\\n\\n`;\n output += ` ![${data.license} License](https://img.shields.io/badge/License-${data.license}-Green)\\n\\n\\n`;\n output += `## INSTALLATION: ${data.installation}\\n\\n\\n`;\n output += `## TEST: ${data.test}\\n\\n\\n`;\n output += `## USAGE: ${data.usage}\\n\\n\\n`;\n\n output += `## CONTRIBUTING: ${data.contributing}`;\n return output;\n}", "title": "" }, { "docid": "e8a9873250dae9f684732b07d3dd65bb", "score": "0.7791897", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n ## ${'Description \\n' +data.description}\n ## Table of Contents \\n\n * [Installation](#installation)\n * [usage](#usage)\n ${renderLicenseLink(data.license)}\n * [contributors](#contributors)\n * [Test](#test)\n * [Contact](#contact)\n # Installation\n To run the installation, use the following code:\n ${data.install}\n # usage\n ${data.usage}\n ${renderLicenseSection(data.license)}\n ${renderLicenseBadge(data.license)}\n \n # Contributors\n ${data.contributors}\n # Test\n ${data.test}\n # Contact\n Moving forward, if you have questions or concerns feel free to contact me at the following given communcations: \\n\n\n GitHub: \\n\n ${data.username} \\n\n Email \\n\n ${data.email} \\n\n\n \n \n\n \n`;\n}", "title": "" }, { "docid": "a629313d64657e958fe7352ddd93947c", "score": "0.7785189", "text": "function generateMarkdown(data) {\n const { title, github, repository, license } = data;\n let readmeSection = '';\n const sectionArr = [\n {\n header: 'Installation',\n content: renderInstallation(data.installation)\n },\n {\n header: 'Usage',\n content: renderUsage(data.usage)\n },\n {\n header: 'Technologies Used',\n content: renderTechnologiesUsed(data.technologiesu)\n },\n {\n header: 'Contributing',\n content: data.contributing\n },\n {\n header: 'Tests',\n content: renderTests(data.tests)\n },\n {\n header: 'License',\n content: renderLicenseSection(license)\n },\n {\n header: 'Questions',\n content: renderQuestions(data.questions, github, repository)\n },\n {\n header: 'Credits',\n content: createCredits(data.credits)\n }\n ];\n\n sectionArr.forEach((sectionElement) => {\n if (sectionElement.content) {\n readmeSection += `## ${sectionElement.header}\n${sectionElement.content}\n`;\n }\n });\n\n return `# ${title}\n[![Issues](https://img.shields.io/github/issues/${github}/${repository})](https://github.com/${github}/${repository}/issues) \n[![Issues](https://img.shields.io/github/contributors/${github}/${repository})](https://github.com/${github}/${repository}/graphs/contributors)\n${renderLicenseBadge(license)}\n## Description\n${renderDescription(data.description, data.link)}\n## Contents\n${renderTableOfContents(sectionArr)}\n${readmeSection}\n`;\n}", "title": "" }, { "docid": "dc5b54e04102a0762c02eda44160465f", "score": "0.77849287", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n \n \n\n\n## Table of Contents\n${renderLicenseLink(data.license)}\n* [installation](#installation)\n* [description](#description)\n* [usage](#usage)\n* [contribution](#contribution)\n\n${renderLicenseSection(data.license)}\n\n## installation\n\\`\\`\\`\n${data.installation}\n\\`\\`\\`\n## description \\n ${data.description}\n\n## usage \\n ${data.usage}\n\n## contribution\\n ${data.contribution}\n\n<small><i>If you have anyquestions vist my github<a href='https://github.com/${data.userName}'></a> or email me at ${data.eMail} </i></small>\n`;\n}", "title": "" }, { "docid": "0482a890c4da4dd29c638967ee90e6af", "score": "0.7783371", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n## ${data.description}\n${renderLicenseBadge(data.licenses)} \n\n# Table of Contents\n* [Installation](#installation)\n* [Usage](#usage)\n* [Contribute](#contribute)\n* [Tests](#tests)\n* [Contact Info](#questions)\n* [License](#license)\n\n# Installation\nTo install ${data.title}, follow the instructions below:\n\n${data.installation}\n\n# Usage\nTo use ${data.title}, follow the steps below:\n\n${data.usage}\n\n# Contribute\nto contribute to ${data.title}, follow the instructions below:\n${data.contributing}\n\n# Tests\nBelow are sample tests created for ${data.title}:\n\n${data.tests}\n\n# Questions\nPlease contact me at my github [${data.github}](https://github.com/${\n data.github\n }) or send me an email @ ${data.email} with any questions.\n\n# License\nThis project uses the following license [${data.licenses}](${renderLicenseLink(data.licenses)})\n`;\n}", "title": "" }, { "docid": "9bb4a26969879d42138c84f641f74821", "score": "0.7781037", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n \n # ${data.title}\n \n ## Contents\n \n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n ${renderLicenseTOC(data.license)}\n * [Contributions](#contributions)\n * [Tests](#tests)\n * [Questions](#questions)\n \n ## [Description](#Contents)\n \n ${data.description}\n \n ## [Installation](#Contents)\n \n ${data.installation}\n \n ## [Usage](#Contents)\n \n ${data.usage}\n \n For more information on Markdown syntax and how to add screenshots, visit the following website:\n [Markdown Guide](https://www.markdownguide.org/)\n \n ${renderLicenseSection(data.license)}\n \n ## [Contributions](#Contents)\n \n ${renderContribute(data.confirmContribute, data.contribution)}\n \n ## [Tests](#Contents)\n \n ${data.test}\n \n ## [Questions](#Contents)\n \n You can contact me by clicking the following links!\n \n [Email: ${data.email}](mailto:${data.email})\n \n [GitHub](https://github.com/${data.username})\n `;\n }", "title": "" }, { "docid": "d00ed21ed28ec3c6bfa986d5aa985888", "score": "0.7777782", "text": "function generateMarkdown(data) {\n licenseSection = renderLicenseSection(data,data.license);\n\n return `# ${data.title}\n\n## Table of Contents\n\n- [Description](#description)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n- [Tests](#tests)\n- [Questions](#questions)\n\n## Description\n\n${data.description}\n\n- Motivation: ${data.motivation}\n- Problem Solved: ${data.problem}\n- Learnings: ${data.learn}\n\n## Installation\n\n${data.installation}\n\n## Usage\n\n${data.usage}\n\n## Contributing\n\n${data.credits}\n\n${licenseSection}\n\n## Tests\n${data.tests}\n\n## Questions\n\nIf you have any questions, please contact me on GitHub at https://github.com/${data.questions}\n`;\n}", "title": "" }, { "docid": "d100111111e1690c118836b56cb7ccbb", "score": "0.77773917", "text": "function generateMarkdown(data) {\n const { title, github, repo, license} =data;\n let readmeContents = '';\n const sectionArr = [\n {\n header: 'Installation',\n content: createInstallation(data.installation)\n },\n {\n header: 'Usage',\n content: createUsage(data.usage)\n },\n {\n header: 'Screenshots',\n content: createScreenshots(data.screenshots)\n },\n {\n header: 'Built With',\n content: createBuiltWith(data['built With'])\n },\n {\n header :'License',\n content:createLicense(license)\n },\n {\n header:'Contributing',\n content: data.contributing\n },\n {\n header:'Tests',\n content: createTest(data.tests)\n },\n {\n header: 'Questions',\n content: createQuestions(data.questions, github, repo)\n },\n {\n header : 'Credits',\n content: createCredits(data.credits)\n }\n \n ];\n\n sectionArr.forEach((sectionItem)=> {\n if(sectionItem.content && sectionItem.header === 'Screenshots') {\n readmeContents +=`### ${sectionItem.header}\n ${sectionItem.content}`;\n }\n else if(sectionItem.content) {\n readmeContents +=`## ${sectionItem.header}\n ${sectionItem.content}`;\n }\n\n });\n\n\n return `# ${title}\n [![Issues](https://img.shields.io/github/issues/${github}/${\n repo\n })](https://github.com/${github}/${\n repo\n }/issues) [![Issues](https://img.shields.io/github/contributors/${\n github\n }/${repo})](https://github.com/${github.com}/${github}/${\n repo\n }/graphs/contributors) ${renderLicenseBadge(license)}\n ## Description\n ${createDescription(title, data.description, data.link)}\n ## Contents\n ${createTableOfContents(sectionArr)}\n ${readmeContents}`;\n}", "title": "" }, { "docid": "534d059f110ea90d5b8ee41a3e49a2d6", "score": "0.77721393", "text": "function generateMarkdown(data) {\n return `# ${data.title} ${licenses[data.license][0]}\n ${data.description}\n # Table of Contents\n 1. [Installation](#installation)\n 2. [Usage](#usage)\n 3. [License](#license)\n 4. [Contribution Guidelines](#contribution-guidelines)\n 5. [Test](#test)\n 6. [Questions](#questions)\n## Installation\nTo install please use: \n\\`${data.install}\\`\n## Usage\nTo use do next: \n\\`${data.usage}\\`\n## License\n${licenses[data.license][1]}\n## Contribution Guidelines \n${data.contribute}\n## Test\nTo test use:\n\\` ${data.test}\\`\n## Questions\nFor questionts please contact [me](https://github.com/${data.github}) at ${data.email}\n \n\n`;\n}", "title": "" }, { "docid": "efbf02183f9f934c12f90e40da57283a", "score": "0.776258", "text": "function generateMarkdown(data) {\r\n return `# ${data.title}\r\n\r\n ## Table of Contents\r\n 1. [ Application Description. ](#application)\r\n 2. [ Installation. ](#installation)\r\n 2. [ Usage. ](#usage)\r\n 3. [ Contributing. ](#contribution)\r\n 4. [ Test. ](#test)\r\n 5. [ Questions. ](#questions)\r\n 6. [ The other stuff: License & Badges. ](#license)\r\n \r\n \r\n <a name=\"application\"></a>\r\n ## Application Description.\r\n \r\n ${data.description}.\r\n <a name=\"installation\"></a>\r\n ## Installation.\r\n \r\n ${data.installation}.\r\n \r\n <a name=\"usage\"></a>\r\n ## Usage\r\n \r\n ${data.usage}.\r\n \r\n <a name=\"contribution\"></a>\r\n ## Contributing\r\n \r\n ${data.contribution}.\r\n \r\n <a name=\"test\"></a>\r\n ## Test\r\n \r\n ${data.test}.\r\n \r\n <a name=\"questions\"></a>\r\n ## Questions\r\n \r\n If you have any questions, feel free to contact at ${data.email}. Don't forget to check my GitHub profile: ${data.github}.\r\n\r\n (https://github.com/${data.github}/${data.title})\r\n \r\n ${renderLicenseSection(data.license)}.\r\n \r\n `;\r\n}", "title": "" }, { "docid": "f60311e212af1fbf367daf504f6ec26b", "score": "0.77579737", "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 * [Contributions](#contributions)\n * [License](#license)\n * [License Link](#licenseLink)\n * [Tests](#tests)\n * [Questions](#questions)\n\n ## Description\n\n ${data.description}\n\n ## Installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ## Contributions\n\n ${data.contributions}\n\n ## License\n\n ${data.license}\n\n ## LicenseLink\n\n ${renderLicenseLink(data.license)}\n\n ## Tests \n \n ${data.testInstructions}\n\n ## Questions\n\n Visit https://github.com/${data.github} to see a list of my repositories.\n Email me at ${data.email}\n\n\n`;\n}", "title": "" }, { "docid": "fe7bc8458ee9a5d090d014ed65ec1b24", "score": "0.7751657", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n${renderLicenseBadge(data.license)}\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\n${data.installation}\n\n## Usage\n${data.usage}\n\n## License\n${renderLicenseSection(data.license)}\n\n## Contributing\n${data.contributing}\n\n## Tests\n${data.test}\n\n## Questions\n${data.github}\n[Github Profile](https://github.com/${data.github})\n${data.email}\n`;\n}", "title": "" }, { "docid": "ff9611b1c15182a192b7eae5320cd051", "score": "0.7751201", "text": "function generateMarkdown(data) {\n return `# ${data.name}\n## Description\n${data.description}\n\n## Table of Contents\n${contentInstallation(data.installation)}\n* [License](#license)\n${contentContributing(data.contributing)}\n${contentTests(data.tests)}\n* [Questions](#questions)\n\n${installation(data.installation)}\n\n## License\n* ${data.license}\n\n${contributing(data.contributing)}\n${tests(data.tests)}\n\n## Questions\nCreated by: [GitHub](https//:github.com/${data.github})\n${email(data.email)}\n\n`;\n}", "title": "" }, { "docid": "6fc12fe13222a87f6f86feb354344dee", "score": "0.7747954", "text": "function generateMarkdown(data) {\n return `\n # ${data.projectTitle}\n ${renderLicenseBadge(data)}\n \n ## Description\n --- \n ${data.projectDescription}\n \n ## Table of Contents\n ---\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contribution](#contribution)\n * [License](#license)\n * [Test](#test)\n * [Questions](#questions)\n \n ## Installation\n ---\n ${data.installation}\n \n ## Usage\n ---\n ${data.usage}\n \n ## Contribution\n ---\n ${data.contribution}\n ${renderLicenseSection(data)}\n ---\n ## Test\n ---\n ${data.test}\n \n ## Questions\n ---\n My other work can be found at <a href=\"https://github.com/${\n data.github\n }\" title=\"github profile\" target = \"blank\">${\n data.github\n}</a>. If you have any additional questions, you can email me at [${\n data.email\n}](mailto:${data.email}).\n \n `;\n}", "title": "" }, { "docid": "41ef79ee43154046533148b10fc8f7bb", "score": "0.77367777", "text": "function generateMarkdown(data) {\n return `# ${data.projectName}\n${renderLicenseBadge(data.projectLicense)}\n## Description\n${data.projectDescription}\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\n\\`\\`\\`\n${data.projectInstall.trim()}\n\\`\\`\\`\n\n## Usage\n\\`\\`\\`\n${data.projectUsage}\n\\`\\`\\`\n\n## License\n${renderLicenseLink(data.projectLicense)}\n\n## Contributing\n${data.projectContrib}\n\n## Tests\n\\`\\`\\`\n${data.projectTesting}\n\\`\\`\\`\n\n## Questions\nIf you have any questions you can reach out to me on [Github](https://github.com/${data.username}) or shoot me an [email](mailto:${data.email}).\n`;\n}", "title": "" }, { "docid": "1fd60d97be84a7989ebc7c293afb254a", "score": "0.7735981", "text": "function generateMarkdown(data) {\n\n const badge = renderLicenseBadge(data.license);\n\n return `\n \n # ${data.title}\n ---\n ${badge}\n\n ## <a name='description'></a> Description\n \n ${data.description}\n\n ## Table of Contents\n \n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contributing](#contributing)\n * [License](#license)\n\n ## <a name='installation'></a> Installation\n \n ${data.installation}\n\n ## <a name='usage'></a> Usage\n \n ${data.usage}\n\n ## <a name='license'></a> License\n \n This project is under the ${data.license} license.\n \n ## <a name='contributing'></a> Contributing\n \n ${data.contributing}\n\n ## Tests\n \n ${data.test}\n\n ## Questions\n \n [${data.github}](https://github.com/${data.github})\n If you have any questions find me here,\n ${data.email}`; \n}", "title": "" }, { "docid": "0143c8f1343a7c04bd8266cbe5351685", "score": "0.77303225", "text": "function generateMarkdown(data,) {\n let licenseBadge = renderLicenseBadge(data.license)\n return `# ${data.title}\n\n ## Table of Contents \n* [Description](#description)\n* [License](#license)\n* [Installation](#installation)\n* [Test](#test)\n* [Contact](#contact)\n\n## Description\n${data.description}\n\n## License \n${licenseBadge}\n\n\n## Installation \n\\`\\`\\`\n${data.installation}\n\\`\\`\\`\n## Test \nTo run test, run the follwing command:\n\\`\\`\\`\n${data.test}\n\\`\\`\\`\n## contact\nemail ${data.email}\ngithub ${data.github}\n\n`;\n}", "title": "" }, { "docid": "8bd52a3acac751acd686d58721a0ca44", "score": "0.772846", "text": "function generateMarkdown(data) {\n\n let fileContent =\n `# ${data.projTitle}\n ${renderLicenseBadge(data.licenses)}\n ## Description\n ${data.projDesc}\n \n * [Installation](#installation)\n * [Usage](#usage)\n * [Licenses](#licenses)\n * [Tests](#tests)\n * [Credits](#credits)\n * [Contributing](#contributing)\n \n ${generateInstall(data.installation)}\n ${generateUsage(data.usage)}\n ${renderLicenseSection(data.licenses)}\n ${renderLicenseLink(data.licenses)}\n ${generateTests(data.tests)}\n ${generateCredits(data.credits)}\n ${generateContrib(data.contribution)}\n ## Questions\n If you have any questions, or comments, regarding this repository please use the following contact information:\n * ${data.name} \n * ${data.github}(https://github.com/${data.github})\n * ${data.email}\n`;\n\n return fileContent;\n}", "title": "" }, { "docid": "8cd1f4450ec06a7ea0461c0895688e29", "score": "0.77229536", "text": "function generateMarkdown(data) {\n return `## ${data.userTitle}\n\n## Description\n${data.userDescription}\n\n![${data.userTitle}](./assets/images/demo.gif?raw=true)\n\n## Table of Contents\n \n* [Installation](#installation)\n* [Usage](#usage)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Contact](#contact)\n* [License](#license)\n \n## Installation\n${data.userInstallation}\n\n## Usage\n${data.userUsage}\n\n## Contributing\n${data.userContribution}\n\n## Tests\n${data.userTest}\n\n## Contact\nPlease contact ${data.name} for any additional information\nGithub Username: ${data.userName}\nEmail: ${data.userEmail}\n\n## License\n${data.userLicense}\n\n## Badge`;\n}", "title": "" }, { "docid": "962c82c12956b28d3ac2c00e241655fa", "score": "0.7717848", "text": "function generateMarkdown(answers) {\n answers.licenseBadge = licenseBadgeLinks[answers.license];\n\n return `## ${answers.titleofProject}\n\n ## Table of Contents\n - [Description](#description) <br>\n - [Installation](#installation) <br>\n - [Usage](#usage) <br>\n - [Tests](#tests) <br>\n - [Credit](#credit) <br>\n - [License](#license) <br>\n - [Questions](#questions)\n\n ${answers.licenseBadge}\n\n ## Description\n 🔍 ${answers.description}\n\n ## Installation\n 💾 ${answers.installation}\n\n ## Usage\n 💻 ${answers.usage}\n\n ## Tests\n ✏️ ${answers.tests}\n\n ## Credit\n 👪 ${answers.credits}\n\n ## License\n 🗃️ This project is covered under the ${answers.license} license.\n\n ## Questions\n 🙋 Questions? Please contact me at the links below:\n\n 📧Email: [${answers.email}](mailto:${answers.email})\n \n \n 🔗GitHub Link: [${answers.github}](https://github.com/${answers.github}) \n\n`;\n}", "title": "" }, { "docid": "4f86ce3c55dd5ddad455b60944d6a59d", "score": "0.7712323", "text": "function generateMarkdown(data) {\n return `\n # ${data.Title}\n\n ## Table of Contents\n *[Description]\n *[Installation]\n *[Usage]\n *[Contributing]\n *[Tests]\n *[Licenses]\n *[Questions] \n\n ##Description\n ${data.Description}\n console.log(${data.Description})\n ##Installation Instructions\n ${data.Installation}\n\n ##Usage Information\n ${data.Usage}\n\n ##Contribution-Guidelines\n ${data.Contribution}\n\n ##Test-Instructions\n ${data.Test}\n\n ##Licenses\n ${data.Licenses}\n\n ##Questions\n If you have additional questions, you can contact me at one of the following places:\n\n GitHub-Username:[${data.GitHub}](https://github.com/SWEFuture20)\n Email-Address:[${data.Email}](https://github.com/SWEFuture20)\n \n`;\n}", "title": "" }, { "docid": "f7b98ac1b6fb82f1db3c9483f8188ef0", "score": "0.771075", "text": "function generateMarkdown(data) {\n return `\n ${renderLicenseBadge(data.license)}\n # ${data.projectTitle}\n ## Table of Contents \n * [Project Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contributors](#contributors)\n * [Tests](#tests)\n * ${renderLicenseLink(data.license)}\n * [Questions](#questions)\n\n ## Project Description\n ${data.description}\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n \n ## Contributors\n ${data.contributors}\n \n ## Tests\n ${data.tests}\n \n ${renderLicenseSection(data.license)} \n\n ## Questions\n If you have any questions, please feel free to contact the owner of this repository. Their contact info is listed below:\n\n ### \n GitHub Username: ${data.githubName} \\n\n GitHub Repository: https://github.com/${data.githubName} \\n\n Email Address: ${data.emailAddress}\n`;\n}", "title": "" }, { "docid": "89e1507674dfdc1f448227784f4909e1", "score": "0.77102166", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n \n ## Table of Contents:\n - [Description](#description)\n - [Technologies](#technologies)\n - [Installation](#installation)\n - [Usage](#usage)\n - [Contributing](#contributing)\n - [Questions](#questions)\n - [License](#license)\n\n ## Description\n ${data.description}\n\n ## Technologies\n This website is created with Visual Studio Code using ${data.languages}. Project repo created here in Github.\n\n ## Installation\n ${data.install}\n\n ## Usage\n ${data.usage}\n\n ## Contributing\n ${data.contribute}\n\n ## Questions\n To reach me for additional questions:\\n\n Github username: ${data.username} \\n\n Github link: [https://github.com/${data.username}](https://github.com/${data.username}) \\n\n Email me at [${data.email}](mailto:${data.email})\n\n ## License\n ${renderLicenseSection(data.license)} \\n\n\n Licensed under the ${renderLicenseLink(data.license)} license.\n\n`;\n}", "title": "" }, { "docid": "5c2ad96137bc156d464f159486d730bc", "score": "0.77078885", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n${renderLicenseBadge(data.license)}\n\n## Description\n\n${renderDescriptionSection(data.description1, data.description2, data.description3, data.description4,)}\n\n## Table of Contents \n\n - [Installation](#installation)\n - [Usage](#usage)\n - [Contribution](#contribution)\n - [License](#license)\n - [Tests](#tests)\n - [Questions](#questions)\n\n## Installation\n\n${renderInstallationSection(data.installation)}\n\n## Usage\n\n${renderUsageSection(data.usage)}\n\n## Contribution\n\n${renderContributionSection(data.contributions)}\n\n## License\n\n${renderLicenseSection(data.license)}\n\n## Tests\n\n${renderTestSection(data.test)}\n\n## Questions\n\n - ${renderGithubSection(data.github)}\n - ${renderEmailSection(data.email)}\n`;\n}", "title": "" }, { "docid": "a002bd17a7ce309f322f2cfa31cd9c14", "score": "0.7705353", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ${data.description}\n\n ## Installation Instructions\n\n ${data.install}\n\n ## Usage Info\n\n ${data.usage}\n\n ## How to Contribute\n\n ${data.cont}\n\n ## Testing Instructions\n\n ${data.test}\n\n ## Questions\n\n Contact me at my GitHub: github.com/${data.github} \n or by email: ${data.email}\n\n ${renderLicenseSection(data.license)}\n`;\n}", "title": "" }, { "docid": "12a05635c9006279b48de25e363fe6bf", "score": "0.7703464", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n\n ## Description\n ${data.description}\n\n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n ${renderLicenseToCSection(data.license)}\n ${renderContributingToCSection(data.contribution)}\n * [Tests](#tests)\n * [Questions](#questions)\n\n ## Installation\n To install the application, follow these instructions:\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ${renderLicenseSection(data.license)}\n\n ${renderContributingSection(data.contribution)}\n\n ## Tests\n To run tests, follow these instructions:\n ${data.tests}\n\n ## Questions\n\n If you have any questions you may reach me at:\n\n\n Email: ${data.email}\n\n\n Github: [${data.github}](https://github.com/${data.github}/)\n\n`;\n}", "title": "" }, { "docid": "ecdc8605598952fba75afdfbb3675f27", "score": "0.76977634", "text": "function generateMarkdown(data) {\n console.log(data);\n return `# ${data.name}\n\n ## Description\n ${data.description}\n\n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [Deployed](#deployed)\n * [Credits](#credits)\n * [License](#license)\n * [Features](#features)\n * [Contributing](#contributing)\n\n\n ## Installation\n ${data.installation}\n\n ## Usage \n ${data.usage}\n This is a preview of how the Web application Looks Like: \n ![password generator demo](\"relative path\")\n\n ## Deployed Application \n The link to the published application can be accessed on the following link: \n (${data.deployed}).\n\n ## Credits\n ${data.credits}\n\n ## License\n Licensed under the MIT license.\n\n ## Badges\n ${data.badges}\n\n ## Features\n ${data.features}\n\n ## Contributing\n ${data.contributing}\n\n ## Tests\n <p>${data.tests}</p>\n\n ## Questions\n ${data.questions}\n\n - - -\n Copyright &copy; 2020 Maria Ocampo. All Rights Reserved.\n`;}", "title": "" }, { "docid": "00360708bc628f3c3285cada827adf02", "score": "0.7697693", "text": "function generateMarkdown(data) {\nlet badge = renderLicenseBadge(data.license);\nlet link = renderLicenseLink(data.license);\n return `# ${data.title}\n\n## Description\n${data.description} \n${badge}\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\n${data.installation}\n\n\n## Usage\n${data.usage}\n\n## License\nThis project is licensed under the following: \n* ${data.license}\n\nYou can view this lincese at:\n * ${link}\n\n## Tests\n${data.tests}\n\n## Contributing \n${data.contributing}\n\n## Questions? \n[Github Profile](https://www.github.com/${data.github})\n\n${data.email}\n\n`;\n}", "title": "" }, { "docid": "a2d7ea7b992a68768e145239a52c1372", "score": "0.7697343", "text": "function generateMarkdown(data) {\n\n// url for licenses and badges\ndata.licenseBadgeLinks = renderLicenseBadgeLinks[data.license];\n\n// content returned from user's input\n return `# ${data.title}\n\n## Description \n${data.description}\n\n## Table of Contents \n\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Badges](#badges)\n* [Contributing](#contributing)\n* [Tests](#test)\n* [Questions](#questions)\n\n## Installation\n\nWhat are the steps required to install your project?\n\n\\`\n${data.installation}\n\\`\n\n## Usage\n\n${data.usage}\n\n## License\n\nThis repository is under the licenses of ${data.license}\n\n${data.license}\n\n## Badges\n\n${data.licenseBadgeLinks}\n\n## Contributing\n\n${data.contributing}\n\n## Tests\n\nTo run a test, use the following:\n\n \\`\n${data.test}\n\\`\n\n## Questions\n\nQuestions about this repository, please contact me at [${data.email}](mailto:${data.email}). View more of my work in GitHub at [${data.github}](https://github.com/${data.github})\n`;\n}", "title": "" }, { "docid": "3cfc049d19195fc10ae6538589b022c4", "score": "0.7695427", "text": "function generateMarkdown(data) {\n return ` # ${data.title}\n\n ---\n\n ## Description\n\n ${data.description}\n\n ## Goals\n 1. Building off of Node CLI, a HTML page is generated displaying a team profile with respective profile information\n 2. Using dependecies such as inquirer and jest to run and provide tests to ensure the application executes correctly\n 3. Prompt the user with questions that build each profile and adds team members\n 4. Create classes for each member that inherit from one parent class of employee\n 5. A screenshot and link are provided to preview the application\n\n ## Technology Used\n\n * Node JS\n * Jest\n * Inquirer\n * Javascript\n\n ## Table of Contents\n\n [Installation](#installation)<br>\n [Usage](#usage)<br>\n [Contributions](#contributions)<br>\n [Description](#description)<br>\n\n ## Installation\n \n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ## Contributions\n\n ${data.contributions}\n\n ## Testing\n\n ${data.tests}\n\n ## License\n \n [![License: ${data.license}](https://img.shields.io/badge/License-${data.license}-blue.svg)](https://opensource.org/licenses/MIT)<br>\n For more information use the link provided.\n\n ## Contact For Questions\n\n Github: [${data.github}](https://github.com/jkeopangna/readMeGenerator)<br>\n Email: [${data.email}](https://gmail.com)`\n\n \n}", "title": "" }, { "docid": "a9e7f0e76a232a025af7dc7dfd83befc", "score": "0.7693717", "text": "function generateMarkdown(data) {\n var data = `\n # ${data.title}\n ![](https://img.shields.io/badge/license-${data.license}-blue.svg)\n ## Table of Contents\n ### <a href='#description'>Description</a>\n ### <a href='#installation'>Installation</a>\n ### <a href='#usage'>Usage</a>\n ### <a href='#license'>License</a>\n ${includeSection(data.contribute, \"### <a href='#contribute'>Contributions</a>\")}\n ${includeSection(data.tests, \"### <a href='#tests'>Tests</a>\")}\n ### <a href='#questions'>Questions</a>\n ## Description\n * ${data.description}\n ## Installation\n * ${data.installation}\n ## Usage\n * ${data.usage}\n ## License\n * ${data.license}\n ${createContribute(data.contribute)}\n ${createTests(data.tests)}\n ## Questions\n * For answers to common questions about this project please see my GitHub repository at https://github.com/${data.github} or send questions to ${data.email}. \n `;\n return data;\n}", "title": "" }, { "docid": "58d22c654f020d5c55581ef8b8212dca", "score": "0.7693384", "text": "function generateMarkdown(data) {\n let scribeToF = '## Table of Contents'\n\n if (data.installation !==''){scribeToF += '[Installation](#installation)'};\n\n if (data.instructions !==''){scribeToF += '[Instructions](#instructions)'};\n\n if (data.contributor !==''){scribeToF += '[Contributor](#contributor)'};\n\n if (data.tests !==''){scribeToF += '[Tests](#tests)'};\n\n \n console.log(data)\n \n return `# ${data.scribeToF}\n \n\n\n ![Badge for GitHub repo TL](https://img.shields.io/github/languages/top/${data.username}/${data.repoName}?style=flat&logo=appveyor), \n ![Badge for GitHub last commit](https://img.shields.io/github/last-commit/${data.username}/${data.repo}?style=flat&logo=appveyor)\n [https://img.shields.io/github/license/${data.username}/${data.repoName}]\n\n # ${data.title}\n \n ## Table of Contents\n ${data.ToC}\n \n ## Description\n\n ${data.description}\n\n \n ## Installation\n ${data.installation}\n \n \n\n ## Usage\n ${data.instructions}\n\n\n ## Contribution Guidelines\n ${data.contributor}\n\n\n ## Tests\n ${data.tests}\n\n\n ## License\n ${data.license}\n\n `;\n}", "title": "" }, { "docid": "71c0f940902acf145918628788d8dda6", "score": "0.76904076", "text": "function generateMarkdown(data) {\n\nreturn `\n# ${data.title}\n\n${renderLicenseBadge(data.license)}\n## Description\n${data.purpose}\n\n## Table of Contents\n- [Installation](#installation)\n- [Usage](#usage)\n- [Credits](#credits)\n${renderLicenseSection(data.license)}\n- [Tests](#tests)\n- [Qustions](#questions)\n\n## Installation\n${data.installation}\n\n## Usage\n${data.usage_information}\n\n## Credits\nCollaborators that helped with this project: ${data.contributors}\n\n## License\n${renderLicenseLink(data.license)}\n\n## Tests\n${data.test}\n\n## Questions\nIf you have any questions, feel free to email <${data.email}> or feel free to peruse my [Github](https://github.com/${data.github})!\n`;\n}", "title": "" }, { "docid": "21c51249c94ec4aebf5edc577f670abb", "score": "0.76889557", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n\n\n\n\n<!-- TABLE OF CONTENTS -->\n<details open=\"open\">\n<summary><h2 style=\"display: inline-block\">Table of Contents</h2></summary>\n<ol>\n<li><a href=\"#about-the-project\">About The Project</a></li>\n<li><a href=\"#project-links\">Project Links</a></li>\n<li><a href=\"#questions\">Questions</a></li>\n${renderLicenseLink(data.license)}\n</ol>\n</details>\n\n\n\n<!-- ABOUT THE PROJECT -->\n## About The Project\n\n${data.description}\n\n${data.screenShotURL}\n\n\nFeatures:\n\n${data.languages}\n\n<!-- PROJECT LINKS -->\n## Project Links\n\n${data.link}\n\n\n<!-- Questions -->\n## Questions\n\nName: ${data.name} \n\nGithub Profile Name: ${data.github}\n\nEmail: ${data.email}\n\n${data.link}\n\n<h4 class=\"text-dark\">&copy; ${new Date().getFullYear()} by ${data.name}</h4>\n\n${renderLicenseSection()}\n\n${renderLicenseBadge(data.license)}\n\n## Badges\n\n${data.badges}\n\n\n`;\n}", "title": "" }, { "docid": "da834dcaf0b82a7b10f3662d348c6a9c", "score": "0.76810247", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n# description\n${data.description}\n\n# installation\n${data.installation}\n\n# contributing\n${data.contributing}\n\n# usageInformation\n${data.usageInformation}\n\n# tests\n${data.tests}\n\n# license\n${data.license}\n\n# questions\nIf you have any questions, contact my email...\n${data.email}\n\n# githubUsername\n${data.githubUsername}\n\n`;\n}", "title": "" }, { "docid": "0041d6bf57c1bd37a42d8648dbea5112", "score": "0.7676824", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ${renderLicenseBadge(data.license)}\n\n ## Description\n\n ${data.description}\n\n ## Table of Contents\n\n * [Installation](##-installation)\n * [Usage](##-usage)\n * [License](##-license)\n * [Contributors](##-contributors)\n * [Tests](##-tests)\n * [Questions](##-questions)\n\n ## Installation\n\n To install the necessary dependencies, run the following command:\n \\`\\`\\`\n npm i\n \\`\\`\\`\n\n ## Usage\n\n ${data.usage}\n\n ## License\n\n ${renderLicenseSection(data.license)}\n\n ## Contributors\n\n ${data.contributors}\n\n ## Tests\n\n To run tests, run the following command:\n \\`\\`\\`\n npm test\n \\`\\`\\`\n\n ## Questions\n\n If you have any questions about the repo, open an issue or contact me directly at [${data.email}](mailto:${data.email}). You can find more of my work at [${data.github}](https://www.github.com/${data.github}).\n`;\n}", "title": "" }, { "docid": "2c71da3442983322edaffcbec9365adc", "score": "0.7675776", "text": "function generateMarkdown(data) {\n let badge = renderLicenseSection(data.license);\n\n return `# ${data.projectName}\n\n## Description :dizzy:\n\n![image](https://user-images.githubusercontent.com/80286982/126023845-9713ba1c-9c49-4946-9cf8-f294bc4b071c.png)\n\n${data.projectDescription}\n\n* Installation :love_letter:\n\n${data.installation}\n\n* Usage :thought_balloon:\n\n${data.usage}\n\n* Credit :sweat_drops:\n\n${data.credit}\n\n* Contributing :boom:\n\n${data.contribution}\n\n* Licenses\n\n${data.license}\n\n### Badge\n\n${badge}\n\n### Features\n\n${data.features}\n\n### Github\n\n${data.github}\n\n### email\n\n${data.email}\n### Tests\n\n${data.tests}\n`;\n\n}", "title": "" }, { "docid": "42d69fba678edf54feb847b3e52b2ccb", "score": "0.76737005", "text": "function generateMarkdown(data) {\n const license = renderLicenseSection(data.license);\n return `\n # ${data.title}\n\n [![License](https://img.shields.io/badge/License-${data.license}-blue.svg)](https://opensource.org/licenses/${data.license})\n\n ## Description\n\n ${data.desc}\n\n Link to recording of project: [Screencastify](https://drive.google.com/file/d/1A73ZPOg3VbfSpLCVQxUGCi8YeDsPCbfS/view)\n\n ## Table of Contents\n\n * [Installation](#installation) \n * [Usage](#usage) \n * [License](#license) \n * [Contributing](#contributing)\n * [Testing](#testing) \n * [Questions](#questions)\n\n ## Installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ${license}\n\n ## Contributing\n\n ${data.contributing}\n\n ## Testing\n\n ${data.testing}\n\n ## Questions\n\n If you have any questions about the projects please contact me at anyone of the ways below.\n\n Github Username: ${data.github}\n\n Github profile link: https://github.com/${data.github}\n\n Email: ${data.email}\n `;\n}", "title": "" }, { "docid": "c999fdaaf273ebad015c0a136068bbf0", "score": "0.76705074", "text": "function generateMarkdown(data) {\n if (data.install_code) {\n data.install_code = `\\`\\`\\`${data.install_code}\\`\\`\\``\n } else {\n data.install_code = ``\n }\n\n if (data.usage_code) {\n data.usage_code = `\\`\\`\\`${data.usage_code}\\`\\`\\``\n } else {\n data.usage_code = ``\n }\n\n return `# ${data.title}\n \n ${renderLicenseSection(data.license)}\n \n deployment:${data.deployedUrl} \n ## Description\n \n ${data.description}\n \n ## Table of Content\n \n [Installation Instructions](#installation-instructions) \n [Usage Information](#usage-information) \n [Contribution Guidelines](#contribution-guidelines) \n [Test Instructions](#test-instructions) \n [Questions](#questions) \n \n ## Installation-Instructions\n \n ${data.install} \n ${data.install_code}\n \n ## Usage-Information\n \n ${data.usage} \n ${data.usage_code}\n \n ## License\n \n ${data.license}\n \n ## Contribution-Guidelines\n \n ${data.contribution}\n \n ## Test-Instructions\n \n ${data.test}\n \n ## Questions\n \n GitHub Username: [@${data.github}](https://github.com/${data.github}) \n \n Reach out to me at [${data.email}](mailto:${data.email}) for questions \n `;\n}", "title": "" }, { "docid": "1cabadbba3d39558f26f29decd60bec8", "score": "0.7663309", "text": "function generateMarkdown(data) {\n return `\n \n ${grabLicense(data.license)}\n\n # ${data.title}\n ## Description\n ${data.description}\n ---\n ## Table of Contents\n\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#contributing)\n * [Test](#test)\n * [Questions](#questions)\n ---\n ## Installation\n To in stall this blah\n \\`\\`\\`\n ${data.installation}\n \\`\\`\\`\n\n ## Usage\n ${data.usage}\n\n ## License\n ${data.title} is ${data.license.name}\n\n ## Contributing\n ${data.contributing}\n\n ## Test\n\n \\`\\`\\`\n ${data.testing}\n \\`\\`\\`\n\n ## Questions\n For questions regarding this application, please email: \n ${data.email}\n\n\n\n\n`;\n}", "title": "" }, { "docid": "02947e139335422f1c7d509d31ed1310", "score": "0.7657148", "text": "function generateMarkdown(data) {\n return `# ${data.repo}\n\n ## Project Title: ${data.title}\n \n ${renderLicenseBadge(data)}\n\n ## Table of Contents:\n 1. [Description](#description) \n 1. [Installation](#installation)\n 1. [Usage](#usage)\n 1. [Tips](#tips)\n 1. [Contributing](#contributing)\n 1. [Tests](#tests)\n ${renderLicenseLink(data) !== '' ? '1. [License](#license)' : ''}\n 1. [Questions](#questions)\n \n ## Description\n ${renderList(data.description)}\n\n ## Installation\n ${renderList(data.installation)}\n\n ## Usage\n ${renderList(data.usage)}\n\n ## Contributing\n ${renderList(data.contributing)}\n\n ## Tests\n ${renderList(data.tests)}\n\n ${renderLicenseLink(data) !== '' ? '## License' : ''}\n ${renderLicenseLink(data) !== '' ? renderLicenseLink(data) : ''}\n\n ## Questions\n Github Portfolio Link: [${data.name}](https://github.com/${data.github})<br>\n Email Contact: ${data.email}\n `;\n}", "title": "" }, { "docid": "de49ee359b5f4780aba3de1df1d4c033", "score": "0.7650648", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n\n ${renderLicenseBadge(data.license)}\n\n ${data.description}\n\n ## Table of Contents \n\n * [Installation Instructions](#installation)\n * [Usage Instructions](#usage)\n * [Contribution Guidelines](#contribution-guidelines)\n * [Test Instructions](#test-instructions)\n * [Questions](#questions)\n * [License](#license)\n\n ## Installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n\n ## Contribution Guidelines\n\n ${data.contribution}\n\n ## Test Instructions\n\n ${data.tests}\n\n ## Questions\n\n If you have any questions you can reach me at:\n\n * [Github](https://github.com/${data.github})\n * [Email](mailto:${data.email})\n\n ${renderLicenseSection(data.license)}`;\n}", "title": "" }, { "docid": "388bf2dc6ecd3ece5b3f67c0ed36cccf", "score": "0.7649289", "text": "function generateMarkdown(answers) {\n renderLicenseBadge(`${answers.license}`)\n renderLicenseLink(`${answers.license}`)\n renderLicenseSection(`${answers.license}`)\n\n return `# ${answers.projTitle}\n ${badge} \n ## Table of Contents\n - [Description](#description)\n - [Installation](#installation)\n - [Usage](#usage)\n - [Contribution](#contribution)\n - [Test Instructions](#test)\n - [License](#license)\n - [Contact](#contact)\n## Description\n${answers.description}\n\n## Installation \n${answers.installation}\n\n## Usage\n${answers.usage}\n\n## Contribution\n${answers.contribution}\n\n## Test\n${answers.test}\n\n## License\n${link} \n${licenseTxt}\n\n## Contact\nQuestions? Comments? Contact me here: \n@${answers.username} \n${answers.email}\n`;\n}", "title": "" }, { "docid": "2511145c1dc710764805b846ac889179", "score": "0.76413286", "text": "function generateReadme(answers) {\n return `\n<h1 align=\"center\">${answers.projectTitle}</h1>\n \n![badge](https://img.shields.io/badge/license-${answers.license}-orange)<br />\n\n<br />\n\n## Table of Contents\n- [Description](#description)\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n- [Contribution](#contribution)\n- [Tests](#tests)\n- [Questions](#questions)\n\n\n## Description \n📋 ${answers.description}\n\n<br />\n<br />\n\n## Installation \n📁 ${answers.installation}\n\n<br />\n<br />\n\n## Usage\n💻 ${answers.usage}\n\n<br />\n<br />\n\n## License\n![badge](https://img.shields.io/badge/license-${answers.license}-orange)\n<br />\nThis application is covered by the ${answers.license} license. \n\n<br />\n<br />\n\n## contribution\n👥 ${answers.contributors}\n\n<br />\n<br />\n\n## Tests\n✔️ ${answers.tests}\n\n<br />\n<br />\n\n## Questions \n\n❔${answers.questions}\n\n<br />\n<br />\n\n📍 Find me on GitHub: [${answers.username}](https://github.com/${answers.username})\n\n<br />\n\n📧 Email me with any questions: ${answers.email}\n\n<br />\n<br />\n\n### Created by Rachel McGrath [README-generator](https://github.com/rmwillow/ReadME-Generator-)\n `;\n}", "title": "" }, { "docid": "188412df2d6d22549266a10860445532", "score": "0.7640755", "text": "function generateMarkdown(data) {\n return `\n # ${data.title}\n\n ${renderLicenseBadge(data.license)}\n ## Description\n ${data.description}\n\n ***\n ## Table of Contents\n - [Description](#description)\n - [Installation](#installation)\n - [Usage](#usage)\n - [Contribution](#contribution)\n - [Tests](#tests)\n - [License](#license)\n - [GitHub](#github)\n - [Questions](#questions)\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n ***\n\n ## Contribution\n ${data.contribution}\n\n ## Tests\n ${data.tests}\n\n ${renderLicenseSection(data.license)}\n\n ***\n\n ## GitHub\n Check out my repository and other projects at my [GitHub](https://github.com/${data.github})!\n\n ## Questions\n For any questions or comments feel free to email me at ${data.email}.\n\n`;\n}", "title": "" }, { "docid": "70d0e7d25636cd701f8e70fc93c3ff96", "score": "0.7635854", "text": "function generateMarkdown(data) {\n return `# ${data.project} ${renderLicenseBadge(data.license)}\n By ${data.name}\n\n## Description\n${data.description}\n\n## Table of Contents\n${installation(data.installation)}\n${usage(data.usage)}\n${renderLicenseLink(data.license)}\n${cont(data.contribution)}\n${test(data.tests)}\n${git(data.github)}\n${quest(data.questions)}\n${link(data.link)}\n\n## Installation\n${data.installation}\n\n## Usage\n${data.usage}\n\n${renderLicenseSection(data.license)}\n\n## Contributing\n${data.contributing}\n\n## Tests\n${data.tests}\n\n### Github\nVisit my Github Profile at https://github.com/${data.github}\n\n### Questions \nEmail me at ${data.email}\n\n### Application Link\n${data.link}\n`;\n}", "title": "" }, { "docid": "3b0295a3130c80256c676a40ba93b06b", "score": "0.7631401", "text": "function generateMarkdown(data) {\n \n \n return (`# ${data.projectName}\n\n ${renderLicenseBadge(data.license)}\n ## Description \n\n ${data.description}\n ## Table of Contents \n\n* [Installation](#installation)\n* [Usage](#usage)\n${renderLicenseLink(data.license)}\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n\n\n## Installation\n\nTo install necessary dependencies, run the following command:\n\n\\`\\`\\`\n${data.dependencies}\n\\`\\`\\`\n\n## Usage \n\n${data.usage}\n\n\n${renderLicenseSection(data.license)}\n\n## Contributing \n\n${data.contribute}\n\n## Tests\n\nTo run tests, run the following command:\n\\`\\`\\`\n${data.tests}\n\\`\\`\\`\n## Questions \n\nGitHub Username: ${data.username}\nGitHub Profile Link: https://github.com/${data.username}\nEmail: ${data.email}\nIf you have any additional 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}.\n\n`);\n\n}", "title": "" }, { "docid": "b5e55218837a869dacd0e1c34a3271d5", "score": "0.7626049", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data)}\n ## Description: \n ${data.description}\n ## Table of Contents: \n * [Installation Instruction](#Installation-Instructions)\n * [Usage Information](#Usage-Information)\n * [Contribution Guidelines](#Contribution-Guidelines)\n * [Test](#Test)\n * [License](#License)\n * [Questions](#Questions)\n ## Installation Instructions: \n ${data.installation}\n ## Usage Information: \n ${data.usage}\n ## Contribution Guidelines:\n ${data.contributing}\n ## Test:\n ${data.test}\n ## License:\n ${data.license}\n ${renderLicenseLink(data)}\n ${renderLicenseSection(data)}\n ## Questions: \n Contact me @ GitHub: https://github.com/${data.github} and/or Email: ${data.email}`\n}", "title": "" }, { "docid": "b55e3eeefaee1155bbb66fa6c334abcf", "score": "0.76251775", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n \n ## Badges\n ${renderLicenseBadge(data.license)}\n \n ## Table of Contents\n * [License](#license)\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions?](#questions)\n \n ## License\n ${renderLicenseSection(data.license)}\n ${renderLicenseLink(data.license)}\n \n ## Description\n ${data.description}\n \n ## Installation\n ${data.install}\n \n ## Usage\n ${data.usage}\n \n ## Contributing\n ${data.contributing}\n \n ## Tests\n ${data.testing}\n \n ## Questions?\n ### Reach me here: \n [${data.username}](https://github.com/${data.username}) \n ${data.email}`;\n}", "title": "" }, { "docid": "ed8402dc71cfaa2da6c2f7ab2a9c325a", "score": "0.76216114", "text": "function generateMarkdown(data) {\n return `# ${data.title}\n ## Badges\n ${renderLicenseBadge(data.license)}\n\n ## Table of Contents\n * [License](#license)\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [How to Contribute](#how-to-contribute)\n * [Tests](#tests)\n * [Questions?](#questions)\n\n ## License\n ${renderLicenseSection(data.license)}\n ${renderLicenseLink(data.license)}\n\n ## Description\n ${data.description}\n\n ## Installation\n ${data.install}\n\n ## Usage\n ${data.usage}\n\n ## How to Contribute\n [Contributor Covenant](https://www.contributor-covenant.org/) \n ${data.contributing}\n\n ## Tests\n ${data.testing}\n\n ## Questions?\n ### Reach me here: \n [${data.username}](https://github.com/${data.username}) \n ${data.email}`;\n}", "title": "" }, { "docid": "8ee269fc43e560d656c5c2812b75f481", "score": "0.7618561", "text": "function generateMarkdown(answers) {\n return `\n # ${answers.title} \n # ![Git Hub license](https://img.shields.io/badge/License-${answers.license}-blue.svg)\n\n ## TABLE OF CONTENTS\n - [DESCRIPTION](#DESCRIPTION) \n - [LICENSE](#LICENSE) \n - [INSTALLATION](#INSTALLATION) \n - [TESTS](#TESTS) \n - [QUESTIONS](#QUESTIONS) \n - [CONTRIBUTIONS](#CONTRIBUTIONS)\n\n ## DESCRIPTION\n ${answers.description}\n\n ## LICENSE\n ${answers.license}\n \n ## INSTALLATION\n ${answers.installation}\n \n ## TESTING\n ${answers.tests}\n \n ## QUESTIONS\n ${answers.question} \n My GitHub username is *${answers.username}* & my profile can be found [here](https://github.com/${answers.username}) \n \n ## CONTRIBUTIONS\n ${answers.contribute} \n I can be reached at ${answers.email} if you have any other questions about this repository.\n `;\n\n}", "title": "" }, { "docid": "7b6de35c99bd0984a98fdca52b2684ab", "score": "0.76184815", "text": "function generateMarkdown(data) {\n\n // Evaluate value of data.license and apply appropriate url value for badge variable and set value of text variale to corresponding license text file variable\n if (data.license === \"Apache License 2.0\") {\n badge = \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\";\n text = apache;\n } else if (data.license === \"GNU General Public License v3.0\") {\n badge = \"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\";\n text = gnu;\n } else if (data.license === \"MIT License\") {\n badge = \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n text = mit;\n } else {\n badge = \"[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)\";\n text = isc;\n }\n\n return `# ${data.title} ${badge}\n\n ## Description\n \n ${data.description}\n\n ## Table of Contents\n\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [Licnese](#license)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n\n ## Installation\n\n ${data.installation}\n\n ## Usage\n\n ${data.usage}\n \n ## License\n \n ${text}\n \n ## Contributing\n \n ${data.contributing}\n \n ## Tests\n \n ${data.tests}\n \n ## Questions\n \n ${data.questions} <br>\n <br>\n GitHub: https://github.com/${data.username} \\t Email: ${data.email}\n\n`;\n}", "title": "" }, { "docid": "cbb505e5dc54dc5e1b3914fcdd585252", "score": "0.7616659", "text": "function generateReadme(response) {\n return `\n# ${response.title}\n\n# Table of Contents\n\n-[Description](#description)\n\n-[Installation](#installation)\n\n-[Usage](#usage)\n\n-[Contribution](#contribution)\n\n-[Tests](#testing)\n\n-[License](#license)\n\n-[Questions](#questions)\n\n## Description:\n[![License](https://img.shields.io/badge/License-${response.license}-purple.svg)](https://opensource.org/licenses/${response.license})\n\n${response.description}\n## Installation:\n${response.installation}\n## Usage:\n${response.usage}\n## Contributing:\n${response.contribution}\n## Tests:\n${response.testing}\n## License:\nThis program is covered under the ${response.license} license.\n- [${response.license} License Documentation](https://opensource.org/licenses/${response.license})\n## Questions:\nQuestions? Find me on GitHub:\nhttps://github.com/${response.gitHub}\n\nor email me at:\n${response.email}\n`;\n}", "title": "" } ]
53b8622b6a8b384f5f1c49d7bd976b7b
Method that checks that the browser supports the HTML5 File API
[ { "docid": "9fe42e4bacebbdcb21b869e89c28cc55", "score": "0.7259415", "text": "function browserSupportFileUpload() {\n let isCompatible = false;\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n isCompatible = true;\n }\n return isCompatible;\n }", "title": "" } ]
[ { "docid": "12c1110bbc1fb10e8f59f7a6a440db1a", "score": "0.8662003", "text": "function supports_html5_fileapi()\n{\n return (window.File && window.FileReader && window.FileList && window.Blob);\n}", "title": "" }, { "docid": "ac822e307cebca6c0ca9e6756a2c47c1", "score": "0.7979273", "text": "function supportFileAPI() {\n var fi = document.createElement('INPUT');\n fi.type = 'file';\n return 'files' in fi;\n }", "title": "" }, { "docid": "c30773ff70e368372be9f6d5933b7f7e", "score": "0.79661065", "text": "function supportFileAPI() {\n\t\tvar fi = document.createElement('INPUT');\n\t\tfi.type = 'file';\n\t\treturn 'files' in fi;\n\t}", "title": "" }, { "docid": "8fa58144ff9029fc16345a9b44c7f2bc", "score": "0.7906626", "text": "function supportFileAPI() {\n\t\t\t\tvar fi = document.createElement('INPUT');\n\t\t\t\tfi.type = 'file';\n\t\t\t\treturn 'files' in fi;\n\t\t\t}", "title": "" }, { "docid": "45554448ddbb7015882deb27ba56af55", "score": "0.7888098", "text": "function checkOfFileAPI(){ //https://www.html5rocks.com/en/tutorials/file/dndfiles/\n //Check for the various File API support.\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n //Great success! All the File APIs are supported.\n } else {\n alert('The File APIs are not fully supported in this browser.');\n }\n}", "title": "" }, { "docid": "d507755ec6ee62659a28775ae86ce67d", "score": "0.7701041", "text": "function checkFileAPI() {\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n reader = new FileReader();\n return true; \n } else {\n alert('The File APIs are not fully supported by your browser. Fallback required.');\n return false;\n }\n }", "title": "" }, { "docid": "146f86c71feed463260bcf3aa5081483", "score": "0.76273346", "text": "function checkFileAPI() {\n 'use strict';\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n reader = new FileReader();\n return true;\n } else {\n alert('The File APIs are not fully supported by your browser. Fallback required.');\n return false;\n }\n }", "title": "" }, { "docid": "5a67b6f1209e7b32389e7a5649d543df", "score": "0.7600253", "text": "function is_support_html5_uploader() {\n if (window.File && window.FileList && window.Blob && (window.FileReader || window.FormData)) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "9a1fd11e9478caa40016505cb16cafb7", "score": "0.7589001", "text": "function checkFileAPI() {\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n reader = new FileReader();\n return true;\n } else {\n alert('The File APIs are not fully supported by your browser. Fallback required.');\n return false;\n }\n}", "title": "" }, { "docid": "9a1fd11e9478caa40016505cb16cafb7", "score": "0.7589001", "text": "function checkFileAPI() {\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n reader = new FileReader();\n return true;\n } else {\n alert('The File APIs are not fully supported by your browser. Fallback required.');\n return false;\n }\n}", "title": "" }, { "docid": "9a1fd11e9478caa40016505cb16cafb7", "score": "0.7589001", "text": "function checkFileAPI() {\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n reader = new FileReader();\n return true;\n } else {\n alert('The File APIs are not fully supported by your browser. Fallback required.');\n return false;\n }\n}", "title": "" }, { "docid": "0e06d6d541fb28e83d16a6dbc7dee38a", "score": "0.75390756", "text": "function checkFileAPI() {\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n reader = new FileReader();\n return true; \n } else {\n alert('The File APIs are not fully supported by your browser. Fallback required.');\n return false;\n }\n}", "title": "" }, { "docid": "70a91c73e19334e0a506ac5bd4840e33", "score": "0.7477905", "text": "function browserSupportFileUpload() \n\t{\n\t\tj = 0;\n\t var isCompatible = false;\n\t \n\t if (window.File && window.FileReader && window.FileList && window.Blob) \n\t {\n\t \tisCompatible = true;\n\t }\n\n\t return isCompatible;\n\t}", "title": "" }, { "docid": "48d49fdd7d3310632726d59f4556989d", "score": "0.7465465", "text": "function browserSupportFileUpload() {\n var isCompatible = false;\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n isCompatible = true;\n }\n return isCompatible;\n }", "title": "" }, { "docid": "d91a77b7ce43ee076024f94886a4f745", "score": "0.74411637", "text": "function browserSupportFileUpload() {\n var isCompatible = false;\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n isCompatible = true;\n }\n return isCompatible;\n }", "title": "" }, { "docid": "d91a77b7ce43ee076024f94886a4f745", "score": "0.74411637", "text": "function browserSupportFileUpload() {\n var isCompatible = false;\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n isCompatible = true;\n }\n return isCompatible;\n }", "title": "" }, { "docid": "51d6c71c8a5e46fadd59ce1e73f42539", "score": "0.74221486", "text": "function browserSupportFileUpload() {\n var isCompatible = false;\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n isCompatible = true;\n }\n return isCompatible;\n}", "title": "" }, { "docid": "63058b3bdc1533ee1875a28e955411d7", "score": "0.73828226", "text": "function browserSupportFileUpload() {\n\tlet isCompatible = false;\n\t\n\tif (window.File && window.FileReader && window.FileList && window.Blob) isCompatible = true;\n\t\n\treturn isCompatible;\n}", "title": "" }, { "docid": "25414587f66746224193ebe45a98ead0", "score": "0.73308337", "text": "function isSupported() {\n if (window.File && window.FileList && window.FileReader && window.Blob) {\n //window.alert('File APIs supported!');\n } else {\n window.alert('CourseCal is not supported in this browser :(');\n }\n}", "title": "" }, { "docid": "d69cab87e04083c1654434baf993b3b6", "score": "0.72938484", "text": "function browserSupportFileUpload() {\n let isCompatible = false;\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n isCompatible = true;\n }\n return isCompatible;\n }", "title": "" }, { "docid": "c55dbc2023fe6a3d53c00e7227c2bdc2", "score": "0.65813243", "text": "isSupported(source) {\n const isFileReaderSupported = window.File && window.FileReader && window.Blob;\n const file = Array.isArray(source) ? source[0] : source;\n\n return (\n isFileReaderSupported && file instanceof window.File\n );\n }", "title": "" }, { "docid": "0c5fc4bd48b85e462a7e13a4ae104242", "score": "0.65249264", "text": "function _check_filesaver() {\n try {\n var isFileSaverSupported = !!new Blob()\n } catch (e) {\n alert('Blob not supported')\n }\n}", "title": "" }, { "docid": "94c67164a41b86672d603b667d649c4e", "score": "0.6412599", "text": "function browserValid() {\n if (typeof FileReader === \"undefined\") {\n // Can't load files\n $(\"#fileLoad\").parent().addClass(\"ui-state-disabled\");\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "e663f5481a0d18c92e07bfc006cc6047", "score": "0.6312279", "text": "function checkStorageSupport() {\n\t\t// sessionStorage and localStorage\n\t\t// Check for the various File API support.\n\t\t/*\n\t\tif (!window.sessionStorage || !window.localStorage || !window.File || !window.FileReader || !window.FileList || !window.Blob) {\n\t\t\ttrjs.log.boxalert('Your browser is ' + trjs.data.currentBrowserName + ' version ' + trjs.data.currentFullVersion + '<br/>You need to update your browser to run Transcriber.js');\n\t\t\twindow.location.href = \"needupdatebrowser.html\";\n\t\t}\n\t\t*/\n\t}", "title": "" }, { "docid": "c6c062bb792be8abfc8a705627841f45", "score": "0.6274504", "text": "function fileIsSupported(file) {\n\t\tvar supportedFileTypes = ['image/jpeg', 'image/png'];\n\t\treturn supportedFileTypes.indexOf(file.type) >= 0 ? true : false;\n\t}", "title": "" }, { "docid": "9d4b78a0619f4249bb93f5f0948c3855", "score": "0.62264454", "text": "function supportAjaxUploadWithProgress() {\n\treturn supportFileAPI() && supportAjaxUploadProgressEvents() && supportFormData();\n\n\t// Is the File API supported?\n\tfunction supportFileAPI() {\n\t\tvar fi = document.createElement('INPUT');\n\t\tfi.type = 'file';\n\t\treturn 'files' in fi;\n\t};\n\n\t// Are progress events supported?\n\tfunction supportAjaxUploadProgressEvents() {\n\t\tvar xhr = new XMLHttpRequest();\n\t\treturn !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));\n\t};\n\n\t// Is FormData supported?\n\tfunction supportFormData() {\n\t\treturn !! window.FormData;\n\t}\n}", "title": "" }, { "docid": "e4df793b9e8513427772dac02a28c8a2", "score": "0.6159822", "text": "function isXHR2WithBlobSupported() {\r\n if (!window.hasOwnProperty('ProgressEvent') || !window.hasOwnProperty('FormData')) {\r\n return false;\r\n }\r\n let xhr = new XMLHttpRequest();\r\n if (typeof xhr.responseType === 'string') {\r\n try {\r\n xhr.responseType = 'blob';\r\n return xhr.responseType === 'blob';\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "dd7a13e2a6f950670a3cbf9214ca4cdf", "score": "0.6103203", "text": "function checkFileReaderSyncSupport() {\n var worker = makeWorker(syncDetectionScript);\n if (worker) {\n worker.onmessage =function(e) {\n FileReaderSyncSupport = e.data;\n };\n worker.postMessage({});\n }\n }", "title": "" }, { "docid": "03857cb51cc286678c02aa545d6d67bc", "score": "0.596946", "text": "function fileExists(dropZone) {\n return window.File && window.FileList && window.FileReader && dropZone;\n}", "title": "" }, { "docid": "4f0823b91b623a67593e25981e40469f", "score": "0.59587616", "text": "function browse(evt) {\n evt.preventDefault();\n if (!browserSupportFileUpload()) {\n alert('The File APIs are not fully supported in this browser!');\n } else {\n file = evt.target.files[0];\n } \n}", "title": "" }, { "docid": "cce43985bd6e8c4cd9a07dca002aa97d", "score": "0.5941793", "text": "function isSupported$1() {\n var options = {\n getUserMedia: true\n };\n\n return error.isValid(options);\n}", "title": "" }, { "docid": "6d2d3f6323a42353d382bc43083aac45", "score": "0.59174836", "text": "function supports_html5_storage() {\n\ttry {\n\t\treturn 'localStorage' in window && window['localStorage'] !== null;\n\t} catch (e) {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "2a9e5560b80f3e845fb645080a21434e", "score": "0.5910638", "text": "function understands_video() {\n return !!document.createElement('video')-canPlayType;\n}", "title": "" }, { "docid": "092f54fc4cda9850861273d0c9cf8b58", "score": "0.5902335", "text": "function supports_html5_storage() {\n try {\n return 'localStorage' in window && window['localStorage'] !== null;\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "d2935c058b31b9fddb1e91515f5e7f6b", "score": "0.58606917", "text": "isMp4Supported() {\n\t\treturn ( !!document.createElement( 'video' ).canPlayType( 'video/mp4; codecs=avc1.42E01E,mp4a.40.2' ) );\n\t}", "title": "" }, { "docid": "0dce749e71f4663c9b1ab65bcbaaa693", "score": "0.5852643", "text": "function detectPDFPreviewSupport() {\n showpreview = false;\n\n // Safari and Chrome have application/pdf in navigator.mimeTypes\n if (navigator.mimeTypes['application/pdf'] != undefined) { showpreview = true; }\n\n // Firefox desktop uses pdf.js, but not mobile or tablet\n if (navigator.userAgent.indexOf('Firefox') != -1) {\n if ((navigator.userAgent.indexOf('Mobile') == -1) && (navigator.userAgent.indexOf('Tablet') == -1)) { showpreview = true; }\n else { showpreview = false; } // have to reset it, as FF Mobile application/pdf listed, but not supported (wtf?)\n }\n}", "title": "" }, { "docid": "08808aa8a0068ed4679583b98f26042d", "score": "0.58490765", "text": "function supports_html5_storage(){\r\n try {\r\n return 'localStorage' in window && window['localStorage'] !== null;\r\n } catch (e) {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "a34acf63c1af7e70a7c36b5dd79d944b", "score": "0.5847856", "text": "function validateFileMimeType(valid_mime_types, file)\n\t{\n\n\t if (file!=undefined && file!=null) //if file is specified (would require HTML5)\n\t {\n\n\t var file_mime_type = file.type;\n\n\t if (file_mime_type!=undefined && file_mime_type!=null && file_mime_type!=\"\") //the browser could return an empty value, even if it's a legit upload\n\t {\n\n\t file_mime_type = file_mime_type.toLowerCase();\n\n\t var valid_mime_type = false;\n\n\t for (var i in valid_mime_types)\n\t {\n\n\t if (valid_mime_types[i].toLowerCase()==file_mime_type)\n\t {\n\t valid_mime_type = true;\n\t break;\n\t }\n\n\t }\n\n\t if (valid_mime_type)\n\t {\n\t return true;\n\t }\n\t else\n\t {\n\t return false;\n\t }\n\n\t }\n\n\t }\n\n\treturn true; //we can only check the mime-type if the browser has the HTML5 File API, so if that fails, it may be a valid upload for all we know\n\n\t}", "title": "" }, { "docid": "8742a5e692a1df346a827b3cd01a737a", "score": "0.5823646", "text": "function supports_video() {\n\treturn !!document.createElement('video').canPlayType;\n}", "title": "" }, { "docid": "575421b68b69adae9ed8566c483716aa", "score": "0.58149517", "text": "function validateFileExtension(valid_exts, file)\n\t{\n\n\t if (file!=undefined && file!=null) //if file is specified (would require HTML5)\n\t {\n\n\t var file_name = file.name;\n\n\t if (file_name!=undefined && file_name!=null && file_name!=\"\") //the browser could return an empty value, even if it's a legit upload\n\t {\n\n\t var file_ext = getFileExtension(file_name).toLowerCase();\n\n\t if (file_ext!=\"\") //extension exists\n\t {\n\n\t var valid_ext = false;\n\n\t for (var i in valid_exts)\n\t {\n\n\t if (valid_exts[i].toLowerCase()==file_ext)\n\t {\n\t valid_ext = true;\n\t break;\n\t }\n\n\t }\n\n\t if (valid_ext)\n\t {\n\t return true;\n\t }\n\t else\n\t {\n\t return false;\n\t }\n\n\t }\n\t else\n\t {\n\t return false;\n\t }\n\n\t }\n\n\t }\n\n\t//if the HTML5 check fails, fallback to the old-school way (won't support multiple file uploads)\n\n\t if (typeof DOM_file==\"object\" && DOM_file!==null)\n\t {\n\n\t var DOM_file_name = DOM_file.value;\n\n\t if (DOM_file_name!=\"\")\n\t {\n\n\t var file_ext = getFileExtension(DOM_file_name).toLowerCase();\n\n\t if (file_ext!=\"\")\n\t {\n\n\t var valid_ext = false;\n\n\t for (var i in valid_exts)\n\t {\n\n\t if (valid_exts[i].toLowerCase()==file_ext)\n\t {\n\t valid_ext = true;\n\t break;\n\t }\n\n\t }\n\n\t if (valid_ext)\n\t {\n\t return true;\n\t }\n\n\t }\n\n\t }\n\n\t }\n\t else\n\t {\n\t return true; //we can't check DOM_file or file, so assume it's valid (could occur during a drag-n-drop operation where we are only given the file, but perhaps the browser won't give us a filename)\n\t }\n\n\treturn false;\n\n\t}", "title": "" }, { "docid": "c66aeba2b569a4b2e4c0f861c4a25933", "score": "0.57538146", "text": "function beforeSubmit(){\n //check whether browser fully supports all File API\n if (window.File && window.FileReader && window.FileList && window.Blob)\n\t{\n\n\t\tif( !$(thefield).val()) //check empty input filed\n\t\t{\n\t\t\t$(\"#output\").html(\"Are you kidding me?\");\n\t\t\treturn false\n\t\t}\n\t\t//$('#submit-btn').hide(); //hide submit button\n\t\t$('#loading-img').show(); //hide submit button\n\t\t$(\"#output\").html(\"\");\n\t}\n\telse\n\t{\n\t\t//Output error to older unsupported browsers that doesn't support HTML5 File API\n\t\t$(\"#output\").html(\"Please upgrade your browser, because your current browser lacks some new features we need!\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "2e320f7cb6f2310433664ec75e999759", "score": "0.5709418", "text": "function isSupported() {\n var features = [\n 'localStorage',\n 'Audio',\n 'Blob',\n 'Promise',\n 'URL',\n ];\n return features.every(function(feature) {\n return feature in window;\n });\n }", "title": "" }, { "docid": "a8e86352a985e232e6375cb1bfceaa43", "score": "0.5703529", "text": "function checkBrowserCompatibility() {\n return typeof(Storage) !== \"undefined\";\n}", "title": "" }, { "docid": "02135679b515c5694ad404790597f4cd", "score": "0.56996757", "text": "function supportAjaxUploadProgressEvents() {\n\t\tvar xhr = new XMLHttpRequest();\n\t\treturn !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));\n\t}", "title": "" }, { "docid": "896889fd94720392b97a20ba6684a106", "score": "0.56936437", "text": "function isSupported() {\n return error.isValid();\n}", "title": "" }, { "docid": "1ee317e924ecc072621fb0a08195db76", "score": "0.5678037", "text": "function supportAjaxUploadProgressEvents() {\n var xhr = new XMLHttpRequest();\n return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));\n }", "title": "" }, { "docid": "cad3bfdea40be6344aa98c028dcce85f", "score": "0.5664996", "text": "function ieCheckFileUpload() {\n if(!Ext.isIE) return true; // If not IE, return true;\n \n if( event.keyCode == 8 ) {\n return false;\n }\n return true; \n}", "title": "" }, { "docid": "cad3bfdea40be6344aa98c028dcce85f", "score": "0.5664996", "text": "function ieCheckFileUpload() {\n if(!Ext.isIE) return true; // If not IE, return true;\n \n if( event.keyCode == 8 ) {\n return false;\n }\n return true; \n}", "title": "" }, { "docid": "f4b2c441498caa775624138d25c80c8a", "score": "0.5616638", "text": "function validateFileSize(max_size, file)\n\t{\n\n\t if (file!=undefined && file!=null) //if file is specified (would require HTML5)\n\t {\n\n\t var file_size = file.size;\n\n\t if (file_size!=undefined && file_size!=null && file_size!=\"\" && isInt(file_size)) //the browser could return an empty value, even if it's a legit upload\n\t {\n\n\t if (file_size <= max_size) //must be less than or equal to max_size (in bytes)\n\t {\n\t return true;\n\t }\n\t else\n\t {\n\t return false;\n\t }\n\n\t }\n\n\t }\n\n\treturn true; //we can only check the file size if the browser has the HTML5 File API, so if that fails, it may be a valid upload for all we know\n\n\t}", "title": "" }, { "docid": "be263e40f1fb41e5a65cd101df1fc16b", "score": "0.5602087", "text": "function isFileInputNode(tag, attrs) {\n return isHTMLTag(tag) && attrs.type === 'file';\n}", "title": "" }, { "docid": "be263e40f1fb41e5a65cd101df1fc16b", "score": "0.5602087", "text": "function isFileInputNode(tag, attrs) {\n return isHTMLTag(tag) && attrs.type === 'file';\n}", "title": "" }, { "docid": "be263e40f1fb41e5a65cd101df1fc16b", "score": "0.5602087", "text": "function isFileInputNode(tag, attrs) {\n return isHTMLTag(tag) && attrs.type === 'file';\n}", "title": "" }, { "docid": "6d982b12480219e658ebaad7e4d96317", "score": "0.56000847", "text": "function verifyFileType() {\n if (file !== undefined) {\n filePath.val(file.path);\n validFile = verifyFileTypeByMime();\n fileTypeError = !validFile;\n if (validFile) {\n fileTypeErrorEl.hide();\n }\n else {\n fileTypeErrorEl.show();\n }\n setFileError();\n }\n else {\n fileTypeErrorEl.hide();\n }\n}", "title": "" }, { "docid": "830a6ce2cf14aecdacc93f550b1ad94b", "score": "0.55992633", "text": "function supportAjaxUploadProgressEvents() {\n\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\treturn !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));\n\t\t\t}", "title": "" }, { "docid": "3530ca6c905fcc14a3d48ace214b1d4a", "score": "0.55239266", "text": "function isSupported() { return typeof localStorage !== \"undefined\"; }", "title": "" }, { "docid": "289b970d19e38a7e5c74f0a0e796d5a3", "score": "0.5501462", "text": "function testIfValidFileType(url) {\n\treturn new Promise((resolve) => {\n\t\tif (!url) return resolve(false);\n\t\telse if (url.startsWith('https')) https.get(url, callback);\n\t\telse if (url.startsWith('http')) http.get(url, callback);\n\t\telse return resolve(false);\n\n\t\tfunction callback(response) {\n\t\t\tif (response.statusCode !== 200) return resolve(false);\n\n\t\t\tlet totalBytes = 0;\n\t\t\tlet chunkArray = [];\n\n\t\t\tresponse.on('data', (chunk) => {\n\t\t\t\ttotalBytes += chunk.length;\n\t\t\t\tchunkArray.push(chunk);\n\n\t\t\t\tif (totalBytes >= fileType.minimumBytes) {\n\t\t\t\t\tconst section = Buffer.concat(chunkArray);\n\t\t\t\t\tresponse.destroy();\n\n\t\t\t\t\tconst type = fileType(section);\n\t\t\t\t\treturn resolve(supportedFileTypes.includes(type.ext));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "f4bf3acffa69f76da093e962c9ee8817", "score": "0.55008405", "text": "function validateFormFieldsForFileType(htmlFileElement){\r\n \tif(htmlFileElement == null){\r\n \t\treturn false;\r\n \t}\r\n \ttry{\r\n\tif (htmlFileElement.type == 'file') {\r\n\t\tvar fileName = htmlFileElement.value;\r\n\t\tvar fieldName = htmlFileElement.name;\r\n\t\t\r\n\t\tif (trim(fileName).toString() == '') {//blank field\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn checkFileExtension(fieldName,fileName);\r\n\t\t}\r\n\t }\r\n \t}\r\n \tcatch(err){\r\n \t\t\r\n \t}\r\n\t return false; //wrong file type\r\n }", "title": "" }, { "docid": "809e3b701f7832d756e18c757b71b5b5", "score": "0.550047", "text": "function hasSupport(){\n\t\t\treturn !!(navigator.getUserMedia || navigator.webkitGetUserMedia ||\n\t\t\t\tnavigator.mozGetUserMedia || navigator.msGetUserMedia);\n\t\t}", "title": "" }, { "docid": "dd9273aa9a94d1c22b614c786707bf9e", "score": "0.549261", "text": "function shouldUseChangeEvent(elem){return elem.nodeName === 'SELECT' || elem.nodeName === 'INPUT' && elem.type === 'file';}", "title": "" }, { "docid": "1d1e7637d80683d740face9c81301472", "score": "0.5478981", "text": "function supportsUploadProgress(userAgent) {\n // Allow passing in userAgent for tests\n if (userAgent == null && typeof navigator !== 'undefined') {\n // eslint-disable-next-line no-param-reassign\n userAgent = navigator.userAgent;\n } // Assume it works because basically everything supports progress events.\n\n\n if (!userAgent) return true;\n const m = /Edge\\/(\\d+\\.\\d+)/.exec(userAgent);\n if (!m) return true;\n const edgeVersion = m[1];\n let [major, minor] = edgeVersion.split('.');\n major = parseInt(major, 10);\n minor = parseInt(minor, 10); // Worked before:\n // Edge 40.15063.0.0\n // Microsoft EdgeHTML 15.15063\n\n if (major < 15 || major === 15 && minor < 15063) {\n return true;\n } // Fixed in:\n // Microsoft EdgeHTML 18.18218\n\n\n if (major > 18 || major === 18 && minor >= 18218) {\n return true;\n } // other versions don't work.\n\n\n return false;\n}", "title": "" }, { "docid": "d3db297c7ab386efc6cf3dd17486a917", "score": "0.54724014", "text": "function validateFileFormat() {\n let files = document.getElementById(\"files\").files;\n let val = true;\n for (let i = 0; i < files.length; i++) {\n let fileInput = files[i];\n let fileType = fileInput.name;\n let allowedExtensions = /(\\.mp4|\\.mov)$/i;\n if (!allowedExtensions.exec(fileType)) {\n val = false;\n break;\n }\n }\n return val;\n}", "title": "" }, { "docid": "a38cd16dfd1ec3e76d1cb1f8adfd0f40", "score": "0.54464334", "text": "canLoad(url) {\n return url.startsWith('file:///');\n }", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "dcd071ffe658489b58f4584371d6e19c", "score": "0.5423505", "text": "function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}", "title": "" }, { "docid": "d3259e8fd69c250d07940b1678ab239d", "score": "0.54223025", "text": "function checkFileType(){\r\n var fileInput = document.getElementById('file-ip-1');\r\n \r\n var filePath = fileInput.value;\r\n\r\n // Allowing file type\r\n var allowedExtensions = /(\\.jpg|\\.png)$/i;\r\n \r\n if (!allowedExtensions.exec(filePath)) {\r\n alert('Invalid file type. Only .jpg & .png images are allowed.');\r\n fileInput.value = '';\r\n return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "ab32cd0a36977f3c622b7dd2f005541f", "score": "0.54112285", "text": "function allowedFileMIMEType(file)\r\n{\r\n var f = file;\r\n if (f.type.match('image.*') || f.type.match('audio.*') || f.type.match('application.*') || f.type.match('multipart.*'))\r\n return false;\r\n return true;\r\n}", "title": "" }, { "docid": "fde2714c2c8a7c57b8fcfc275e8d7a5d", "score": "0.5402197", "text": "isSafe(mimetype) {\n return false;\n }", "title": "" }, { "docid": "9852583bfe6af5afed39547f0e61fc61", "score": "0.53987455", "text": "function checkMediaCaptureSupport() {\n\t\tif(typeof window.FileReader === 'undefined') {\n\t\t\tshowUI(document.getElementById('warningMediaCapture'));\n\t\t\tdocument.querySelector('.camera').classList.add('no-support'); //disable the button\n\t\t}\n\t}", "title": "" }, { "docid": "28e8f108dfc9f7bad5963226fbacd02a", "score": "0.539768", "text": "static supportsXmlHttp() {\n return typeof XMLHttpRequest === 'function';\n }", "title": "" }, { "docid": "74c634a7c9e3b4bce0e053e0895aa07a", "score": "0.53745914", "text": "function beforeSubmit(){\n //check whether browser fully supports all File API\n if (window.File && window.FileReader && window.FileList && window.Blob)\n\t{\n\t\t\n\t\tfileName = jQuery('#FileInput')[0].files[0].name;\n\t\tif( !jQuery('#FileInput').val()) //check empty input filed\n\t\t{\n\t\t\talert(\"Are you kidding me?\");\n\t\t\treturn false\n\t\t}\n\t\t\n\t\tvar fsize = jQuery('#FileInput')[0].files[0].size; //get file size\n\t\tvar ftype = jQuery('#FileInput')[0].files[0].type; // get file type\n\t\t\n\n\t\t//allow file types \n\t\tswitch(ftype)\n {\n case 'image/png': \n\t\t\tcase 'image/gif': \n\t\t\tcase 'image/jpeg': \n\t\t\tcase 'image/pjpeg':\n\t\t\tcase 'text/plain':\n\t\t\tcase 'text/html':\n\t\t\tcase 'application/x-zip-compressed':\n\t\t\tcase 'application/pdf':\n\t\t\tcase 'application/msword':\n\t\t\tcase 'application/vnd.ms-excel':\n\t\t\tcase 'video/mp4':\n break;\n default:\n alert(\"<b>\"+ftype+\"</b> Данный тип файла не поддерживается!\");\n\t\t\t\treturn false\n }\n\t\t\n\t\t//Allowed file size is less than 5 MB (1048576)\n\t\tif(fsize>5242880) \n\t\t{\n\t\t\talert(\"<b>\"+bytesToSize(fsize) +\"</b> Файл превышает допустимые размеры! <br />Файл не должен превышать 5 MB.\");\n\t\t\treturn false\n\t\t}\n\t\t\t\t\n\t\tjQuery('#submit-btn').hide(); //hide submit button\n\t\tjQuery('#loading-img').show(); //hide submit button\n\t\tjQuery(\"#output\").html(\"\"); \n\t}\n\telse\n\t{\n\t\t//Output error to older unsupported browsers that doesn't support HTML5 File API\n\t\talert(\"Please upgrade your browser, because your current browser lacks some new features we need!\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "4cb33200fabcbb75c9def05f02be6c0f", "score": "0.53720343", "text": "function is_mp3_supported()\n{\n // Reference 1\n var audio_element = document.createElement('audio');\n return !!(audio_element.canPlayType && audio_element.canPlayType('audio/mpeg;').replace(/no/, ''));\n}", "title": "" }, { "docid": "6ebebe9c35a79e5bb11ade9ec1b4d6dc", "score": "0.53587866", "text": "function multivioSupported() {\n if ($.browser.msie && parseInt($.browser.version, 10) < 7) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "a492924af1211cbede635eed82afd390", "score": "0.53507376", "text": "function fileAccepted(file, accept) {\n return file.type === 'application/x-moz-file' || __WEBPACK_IMPORTED_MODULE_0_attr_accept___default()(file, accept);\n}", "title": "" }, { "docid": "a492924af1211cbede635eed82afd390", "score": "0.53507376", "text": "function fileAccepted(file, accept) {\n return file.type === 'application/x-moz-file' || __WEBPACK_IMPORTED_MODULE_0_attr_accept___default()(file, accept);\n}", "title": "" }, { "docid": "a492924af1211cbede635eed82afd390", "score": "0.53507376", "text": "function fileAccepted(file, accept) {\n return file.type === 'application/x-moz-file' || __WEBPACK_IMPORTED_MODULE_0_attr_accept___default()(file, accept);\n}", "title": "" }, { "docid": "20be078a0942339e1620485397e30036", "score": "0.53493834", "text": "function shouldUseChangeEvent(elem) {\n var nodeName = elem.nodeName && elem.nodeName.toLowerCase();return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n }", "title": "" }, { "docid": "22f473e54834927406bf24775c17e058", "score": "0.53311324", "text": "function supportsHtmlStorage()\n{\n try\n {\n return 'localStorage' in window && window['localStorage'] !== null;\n }\n catch(e)\n {\n return false;\n }\n}", "title": "" }, { "docid": "06c536e2ab0536764f5429ea71d08b8b", "score": "0.5328091", "text": "static get isSupported() {\r\n throw new Error('Not implemented.');\r\n }", "title": "" }, { "docid": "03f5306a8257b880182a3e60acedfa9b", "score": "0.5310803", "text": "function verifyBrowser(){\r\n var returnedValue = true;\r\n BrowserDetect.init();\r\n var browser = BrowserDetect.browser;\r\n var addressBar = window.location.href;\r\n if (browser == 'Chrome' && addressBar.indexOf('file://') === 0){\r\n returnedValue = false;\r\n }\r\n \r\n return returnedValue;\r\n}", "title": "" }, { "docid": "84dbb0a3fdc434a0fecf3440e2b7c286", "score": "0.53007853", "text": "function validateUpload(selection){\n\n // It does nothing when the selection is empty\n if(!selection || selection.length === 0) return false;\n\n // Alerts and stops when the file doesn't have the right extension\n var extension = getExtension(selection);\n if(!checkExtension(extension)){\n showFeedback(\"danger\", EXT_SUPPORT_FEEDBACK);\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "1246f15d91e5a609badafd32cbef3377", "score": "0.5300158", "text": "function shouldUseChangeEvent(elem) {\n\t var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n\t return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n\t}", "title": "" }, { "docid": "1246f15d91e5a609badafd32cbef3377", "score": "0.5300158", "text": "function shouldUseChangeEvent(elem) {\n\t var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n\t return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n\t}", "title": "" }, { "docid": "1246f15d91e5a609badafd32cbef3377", "score": "0.5300158", "text": "function shouldUseChangeEvent(elem) {\n\t var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n\t return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n\t}", "title": "" }, { "docid": "1246f15d91e5a609badafd32cbef3377", "score": "0.5300158", "text": "function shouldUseChangeEvent(elem) {\n\t var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n\t return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n\t}", "title": "" } ]
bfefacab37db3341e1994a0fec9cc599
Read and store the height of line widgets associated with the given line.
[ { "docid": "0a42b992fc2f610bded6c4b733602946", "score": "0.79090255", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode\n if (parent) { w.height = parent.offsetHeight }\n } }\n}", "title": "" } ]
[ { "docid": "b800f69b3cb41d8b4ad426c4a2beaef9", "score": "0.80075556", "text": "function updateWidgetHeight(line) {\r\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\r\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.7958666", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.7958666", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.7958666", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.7958666", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.7958666", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.7958666", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.7958666", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.7958666", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.7958666", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.7958666", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "c49a9685b59bfe6021b4e4c37469b31e", "score": "0.79309785", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}", "title": "" }, { "docid": "5455678b48b0b018d28d0a8dd79d6490", "score": "0.7927457", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "title": "" }, { "docid": "5455678b48b0b018d28d0a8dd79d6490", "score": "0.7927457", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "title": "" }, { "docid": "5455678b48b0b018d28d0a8dd79d6490", "score": "0.7927457", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "title": "" }, { "docid": "5455678b48b0b018d28d0a8dd79d6490", "score": "0.7927457", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "title": "" }, { "docid": "5455678b48b0b018d28d0a8dd79d6490", "score": "0.7927457", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "title": "" }, { "docid": "bbf259522ef8198db20a1acfd0caf329", "score": "0.79126006", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "title": "" }, { "docid": "bbf259522ef8198db20a1acfd0caf329", "score": "0.79126006", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "title": "" }, { "docid": "bbf259522ef8198db20a1acfd0caf329", "score": "0.79126006", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "title": "" }, { "docid": "bbf259522ef8198db20a1acfd0caf329", "score": "0.79126006", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "title": "" }, { "docid": "2a4f4e619c2e361fea4c89c6399ca583", "score": "0.790527", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.offsetHeight;\n\t }", "title": "" }, { "docid": "02bd47d7351a668477037444c988214f", "score": "0.7898249", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "title": "" }, { "docid": "02bd47d7351a668477037444c988214f", "score": "0.7898249", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.7864016", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.7864016", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.7864016", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.7864016", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.7864016", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.7864016", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "140c6506ce9e5da191cf17fac6ca62d3", "score": "0.78577846", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "title": "" }, { "docid": "140c6506ce9e5da191cf17fac6ca62d3", "score": "0.78577846", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "title": "" }, { "docid": "9b8ef184dd769ae0b1138025ef9f550f", "score": "0.7827424", "text": "function updateWidgetHeight(line) {\n if (line.widgets) {\n for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i],\n parent = w.node.parentNode;\n if (parent) {\n w.height = parent.offsetHeight;\n }\n }\n }\n }", "title": "" }, { "docid": "a0eab3b9b4d62bac7981e43a509b078e", "score": "0.78252107", "text": "function updateWidgetHeight(line) {\n\t\t\t\tif (line.widgets) {\n\t\t\t\t\tfor (var i = 0; i < line.widgets.length; ++i) {\n\t\t\t\t\t\tvar w = line.widgets[i], parent = w.node.parentNode;\n\t\t\t\t\t\tif (parent) { w.height = parent.offsetHeight; }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "9968685cae49717ae88b720b37eef376", "score": "0.77991784", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n\t var w = line.widgets[i], parent = w.node.parentNode;\n\t if (parent) { w.height = parent.offsetHeight; }\n\t } }\n\t }", "title": "" }, { "docid": "f4ca239f395f64a8a5a5c0313805d883", "score": "0.77859163", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n\t { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n\t}", "title": "" }, { "docid": "122fb43991d7aafea574dec0d94e7924", "score": "0.77697754", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n\t var w = line.widgets[i], parent = w.node.parentNode;\n\t if (parent) { w.height = parent.offsetHeight; }\n\t } }\n\t}", "title": "" }, { "docid": "122fb43991d7aafea574dec0d94e7924", "score": "0.77697754", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n\t var w = line.widgets[i], parent = w.node.parentNode;\n\t if (parent) { w.height = parent.offsetHeight; }\n\t } }\n\t}", "title": "" }, { "docid": "a5390760cc580e6f7077f4a013545c8b", "score": "0.7147942", "text": "function _heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0,\n chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) {\n break;\n } else {\n h += line.height;\n }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) {\n break;\n } else {\n h += cur.height;\n }\n }\n }\n return h;\n }", "title": "" }, { "docid": "26e035fd68289033fe9658c6103b1a83", "score": "0.71418595", "text": "function updateLineHeight(line,height){var diff=height-line.height;if(diff){for(var n=line;n;n=n.parent){n.height+=diff;}}}// Given a line object, find its line number by walking up through", "title": "" }, { "docid": "f1f365f849aba257bb61b8e34f5016c0", "score": "0.71302956", "text": "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\r\n }", "title": "" }, { "docid": "eeb886da73e0dcb3d22ff45ae7b78fe7", "score": "0.71261245", "text": "function heightAtLine(lineObj) {\n\t\t\t\tlineObj = visualLine(lineObj);\n\n\t\t\t\tvar h = 0, chunk = lineObj.parent;\n\t\t\t\tfor (var i = 0; i < chunk.lines.length; ++i) {\n\t\t\t\t\tvar line = chunk.lines[i];\n\t\t\t\t\tif (line == lineObj) { break }\n\t\t\t\t\telse { h += line.height; }\n\t\t\t\t}\n\t\t\t\tfor (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t\t\t\tfor (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t\t\t\t\t\tvar cur = p.children[i$1];\n\t\t\t\t\t\tif (cur == chunk) { break }\n\t\t\t\t\t\telse { h += cur.height; }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn h\n\t\t\t}", "title": "" }, { "docid": "f7f0d92ba62dccf333972c68cbfcb148", "score": "0.7110384", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "title": "" }, { "docid": "ea706841f3c9e606fb57031fff3a64bf", "score": "0.7094156", "text": "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) { break }\n\t else { h += line.height; }\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t var cur = p.children[i$1];\n\t if (cur == chunk) { break }\n\t else { h += cur.height; }\n\t }\n\t }\n\t return h\n\t }", "title": "" }, { "docid": "c19286a59a31f160bc7c1700070a0036", "score": "0.7072095", "text": "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "title": "" }, { "docid": "c19286a59a31f160bc7c1700070a0036", "score": "0.7072095", "text": "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "title": "" }, { "docid": "c19286a59a31f160bc7c1700070a0036", "score": "0.7072095", "text": "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "title": "" }, { "docid": "1852fec8ae34ba39abbf90fead51c039", "score": "0.7058242", "text": "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\r\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i = 0; i < p.children.length; ++i) {\r\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\r\n }\r\n }\n return h;\r\n }", "title": "" }, { "docid": "51aa0d91f89c87ad25b792a04d034743", "score": "0.70517904", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "title": "" }, { "docid": "51aa0d91f89c87ad25b792a04d034743", "score": "0.70517904", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "title": "" }, { "docid": "51aa0d91f89c87ad25b792a04d034743", "score": "0.70517904", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "title": "" }, { "docid": "51aa0d91f89c87ad25b792a04d034743", "score": "0.70517904", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "title": "" }, { "docid": "51aa0d91f89c87ad25b792a04d034743", "score": "0.70517904", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "title": "" }, { "docid": "51aa0d91f89c87ad25b792a04d034743", "score": "0.70517904", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.7039327", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "eb2c198da859e5c05f52c3dc07a6d40b", "score": "0.7038672", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "title": "" }, { "docid": "f0f6e3e9ef71f920660c0ae7c9568c22", "score": "0.7036168", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n }", "title": "" }, { "docid": "1a6092988d81a570819f2d6cd0c2db2f", "score": "0.7020627", "text": "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "title": "" }, { "docid": "1a6092988d81a570819f2d6cd0c2db2f", "score": "0.7020627", "text": "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "title": "" }, { "docid": "1a6092988d81a570819f2d6cd0c2db2f", "score": "0.7020627", "text": "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "title": "" }, { "docid": "7ea91dc08df8ccf8ecddd560249c1fbc", "score": "0.7017702", "text": "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\t\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) { break }\n\t else { h += line.height; }\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t var cur = p.children[i$1];\n\t if (cur == chunk) { break }\n\t else { h += cur.height; }\n\t }\n\t }\n\t return h\n\t}", "title": "" }, { "docid": "7ea91dc08df8ccf8ecddd560249c1fbc", "score": "0.7017702", "text": "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\t\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) { break }\n\t else { h += line.height; }\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t var cur = p.children[i$1];\n\t if (cur == chunk) { break }\n\t else { h += cur.height; }\n\t }\n\t }\n\t return h\n\t}", "title": "" }, { "docid": "671cbec4fd5703da7e97b4188c291c3b", "score": "0.7014953", "text": "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) { break }\n\t else { h += line.height; }\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t var cur = p.children[i$1];\n\t if (cur == chunk) { break }\n\t else { h += cur.height; }\n\t }\n\t }\n\t return h\n\t}", "title": "" }, { "docid": "cf87b1e5805fd492ef6f01eb9d712b2d", "score": "0.70132506", "text": "determineLineHeights() {\n for (let k = 0; k < this.lines.length; k++) {\n const line = this.lines[k];\n\n // Looking for max height of blocks in line\n let height = 0;\n\n if (line.blocks !== undefined) {\n // Can happen if text contains e.g. '\\n '\n for (let l = 0; l < line.blocks.length; l++) {\n const block = line.blocks[l];\n\n if (height < block.height) {\n height = block.height;\n }\n }\n }\n\n line.height = height;\n }\n }", "title": "" }, { "docid": "e5f1c9a0282d6805af1dba80ae137a67", "score": "0.70109457", "text": "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.7003622", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.7003622", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.7003622", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.7003622", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.7003622", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.7003622", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "b824facb5ceb05f5a3343d70020c22d7", "score": "0.6977309", "text": "function updateLineHeight(line, height) {\n\t\t\t\tvar diff = height - line.height;\n\t\t\t\tif (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t\t\t}", "title": "" }, { "docid": "107be2bf32610cff49e6dadeade90c1b", "score": "0.6973182", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "title": "" }, { "docid": "107be2bf32610cff49e6dadeade90c1b", "score": "0.6973182", "text": "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "title": "" } ]
d3bd932a653d4e14c6dc4c1241220e7b
.dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, backported and transplited with Babel, with backwardscompat fixes Copyright Joyent, Inc. and other Node contributors. 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. 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. resolves . and .. elements in a path array with directory names there must be no slashes, empty elements, or device names (c:\) in the array (so also no leading and trailing slashes it does not distinguish relative and absolute paths)
[ { "docid": "a4066c37ae4262eaeebb866479c680c5", "score": "0.0", "text": "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}", "title": "" } ]
[ { "docid": "5832f8c86fb0d4216fa538817004ecc6", "score": "0.6272461", "text": "function basename(filename,ext){return path__WEBPACK_IMPORTED_MODULE_0___default.a.basename(filename.replace(/^[a-zA-Z]:/,'').replace(/\\\\/g,'/'),ext);}", "title": "" }, { "docid": "add373005c0c9b270a75a648fb011621", "score": "0.6246232", "text": "function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}// Split a filename into [root, dir, basename, ext], unix version", "title": "" }, { "docid": "add373005c0c9b270a75a648fb011621", "score": "0.6246232", "text": "function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}// Split a filename into [root, dir, basename, ext], unix version", "title": "" }, { "docid": "add373005c0c9b270a75a648fb011621", "score": "0.6246232", "text": "function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}// Split a filename into [root, dir, basename, ext], unix version", "title": "" }, { "docid": "add373005c0c9b270a75a648fb011621", "score": "0.6246232", "text": "function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}// Split a filename into [root, dir, basename, ext], unix version", "title": "" }, { "docid": "add373005c0c9b270a75a648fb011621", "score": "0.6246232", "text": "function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}// Split a filename into [root, dir, basename, ext], unix version", "title": "" }, { "docid": "21a4960eb30778322c5de3f8182da329", "score": "0.62140876", "text": "function normalizeArray(parts,allowAboveRoot){ // if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}} // if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;} // Split a filename into [root, dir, basename, ext], unix version", "title": "" }, { "docid": "2a704781db95d095c18a7b0476df968a", "score": "0.60049915", "text": "function dirname() {\n return path_1.default.dirname(url_1.fileURLToPath(import.meta.url));\n}", "title": "" }, { "docid": "2a181028c36f5929e3610f4623aa5f49", "score": "0.599197", "text": "function extractFilename(path) {\n if (path[path.length - 1] === '/') {\n return path;\n }\n else {\n return _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.PathExt.basename(path);\n }\n}", "title": "" }, { "docid": "b00a4e9a1ea78ee3218e591b477d7e39", "score": "0.59835964", "text": "function getDirname () {\n\t// replaces backwards slashes with forward slashes (Windows patch)\n\treturn __dirname.replace(/\\\\/g, '/')\n}", "title": "" }, { "docid": "045f50266a48ecd09f1467ba734fe559", "score": "0.5959031", "text": "function _getDirectoryName(p) {\n // short-circuit if empty\n if (!p) {\n return '';\n }\n // normalize separators\n p = _normalizeSeparators(p);\n // on Windows, the goal of this function is to match the behavior of\n // [System.IO.Path]::GetDirectoryName(), e.g.\n // C:/ =>\n // C:/hello => C:\\\n // C:/hello/ => C:\\hello\n // C:/hello/world => C:\\hello\n // C:/hello/world/ => C:\\hello\\world\n // C: =>\n // C:hello => C:\n // C:hello/ => C:hello\n // / =>\n // /hello => \\\n // /hello/ => \\hello\n // //hello =>\n // //hello/ =>\n // //hello/world =>\n // //hello/world/ => \\\\hello\\world\n //\n // unfortunately, path.dirname() can't simply be used. for example, on Windows\n // it yields different results from Path.GetDirectoryName:\n // C:/ => C:/\n // C:/hello => C:/\n // C:/hello/ => C:/\n // C:/hello/world => C:/hello\n // C:/hello/world/ => C:/hello\n // C: => C:\n // C:hello => C:\n // C:hello/ => C:\n // / => /\n // /hello => /\n // /hello/ => /\n // //hello => /\n // //hello/ => /\n // //hello/world => //hello/world\n // //hello/world/ => //hello/world/\n // //hello/world/again => //hello/world/\n // //hello/world/again/ => //hello/world/\n // //hello/world/again/again => //hello/world/again\n // //hello/world/again/again/ => //hello/world/again\n if (process.platform == 'win32') {\n if (/^[A-Z]:\\\\?[^\\\\]+$/i.test(p)) { // e.g. C:\\hello or C:hello\n return p.charAt(2) == '\\\\' ? p.substring(0, 3) : p.substring(0, 2);\n }\n else if (/^[A-Z]:\\\\?$/i.test(p)) { // e.g. C:\\ or C:\n return '';\n }\n var lastSlashIndex = p.lastIndexOf('\\\\');\n if (lastSlashIndex < 0) { // file name only\n return '';\n }\n else if (p == '\\\\') { // relative root\n return '';\n }\n else if (lastSlashIndex == 0) { // e.g. \\\\hello\n return '\\\\';\n }\n else if (/^\\\\\\\\[^\\\\]+(\\\\[^\\\\]*)?$/.test(p)) { // UNC root, e.g. \\\\hello or \\\\hello\\ or \\\\hello\\world\n return '';\n }\n return p.substring(0, lastSlashIndex); // e.g. hello\\world => hello or hello\\world\\ => hello\\world\n // note, this means trailing slashes for non-root directories\n // (i.e. not C:\\, \\, or \\\\unc\\) will simply be removed.\n }\n // OSX/Linux\n if (p.indexOf('/') < 0) { // file name only\n return '';\n }\n else if (p == '/') {\n return '';\n }\n else if (_endsWith(p, '/')) {\n return p.substring(0, p.length - 1);\n }\n return path.dirname(p);\n}", "title": "" }, { "docid": "7e4d7016ac937b3d763505177fba35af", "score": "0.5946403", "text": "function getPathName(a){\n var a = a.toString().substring(a.toString().indexOf(\"/\")+1, a.toString().lastIndexOf(\"/\")).replace(/\\\\\\//g,\"/\").replace(\"\\\\.\",\".\");\n return a.substring(0,a.toString().lastIndexOf(\"/\"))\n }", "title": "" }, { "docid": "46a113d4066eac6aa19dd8da4cb72fb6", "score": "0.59053516", "text": "function basename(p) {\n const name = path.basename(p);\n const ext = path.extname(p);\n if (name.startsWith('index.')) return path.dirname(p).split(path.sep).pop() + ext;\n return name;\n}", "title": "" }, { "docid": "665f442400ef2bfe9fa9a40ebe907205", "score": "0.58964515", "text": "function dirname(path) {\n return path.replace(/\\\\/g, '/').replace(/\\/[^\\/]*$/, '');;\n}", "title": "" }, { "docid": "ba938be809957cc2a3a934fc27668bdc", "score": "0.5885266", "text": "function win32SplitPath(filename){// Separate device+slash from tail\nvar result=splitDeviceRe.exec(filename),device=(result[1]||'')+(result[2]||''),tail=result[3]||'';// Split the tail into dir, basename and extension\nvar result2=splitTailRe.exec(tail),dir=result2[1],basename=result2[2],ext=result2[3];return[device,dir,basename,ext];}", "title": "" }, { "docid": "3759020eace99575b3d5a4e313663f2b", "score": "0.58656305", "text": "function Ie(e){if('string'!=typeof e)throw new TypeError('Path must be a string. Received '+e)}// Resolves . and .. elements in a path with directory names", "title": "" }, { "docid": "f9ffdd1f17592eb6731df9292e4a2389", "score": "0.5851059", "text": "function splitPath(filename) {\n return /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(filename).slice(1)\n }", "title": "" }, { "docid": "da2e8ce521b90982aa390a3dc7709782", "score": "0.5789443", "text": "function dirname(path) {\n\t return posix.dirname(path);\n\t }", "title": "" }, { "docid": "6cc2c82bd57e14428c99be7f744f61ba", "score": "0.5782002", "text": "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "title": "" }, { "docid": "6cc2c82bd57e14428c99be7f744f61ba", "score": "0.5782002", "text": "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "title": "" }, { "docid": "852c76cd10c94ec8129b2afeb0b74e98", "score": "0.5729343", "text": "function parseFilenameFromPath(fullPath){\n var filename = \"\";\n if (fullPath != \"\"){\n var i=(fullPath.length -1);\n for (i; i>=0; i--){\n var charValue = fullPath[i];\n if (charValue == \"\\\\\" || charValue == \"/\"){\n return filename;\n }else {\n filename = charValue + filename;\n }\n }\n }\n}", "title": "" }, { "docid": "ef1a8f017276f560e03151eed461f463", "score": "0.57269496", "text": "function get_filename(filename_with_path) {\n // console.log(filename_with_path)\n // convert backslash to slash\n filename_with_path = filename_with_path.replace(/\\\\/g, '/')\n // console.log(filename_with_path)\n let startpos_slash = filename_with_path.lastIndexOf('/')\n let filename_with_ext = filename_with_path.substr(startpos_slash + 1)\n let startpos_dot = filename_with_ext.lastIndexOf('.')\n let path = filename_with_path.substring(0, startpos_slash)\n let name = filename_with_ext.substring(0, startpos_dot)\n let ext = filename_with_ext.substr(startpos_dot + 1)\n return { path: path, name: name, ext: ext }\n}", "title": "" }, { "docid": "a13147538c508efc8e6a3dc0d447ef01", "score": "0.57237226", "text": "subpaths(dir) {\n let {join: joinPath} = require(\"path\");\n let paths = [];\n let path = isAbsolutePath(dir) ? \"/\" : \"\";\n for (let p of dir.split(/\\/+/)) {\n path = joinPath(path, p);\n paths.push(path);\n }\n return paths;\n }", "title": "" }, { "docid": "ae4868f14332588f740905ab05b77ac9", "score": "0.57191235", "text": "normalizePath(fn) {\n return fn.replace(/\\\\/g,'/');\n }", "title": "" }, { "docid": "a30cdff350a041ae14638a6f5cbd9809", "score": "0.57180494", "text": "function dirName () {\n return __dirname\n}", "title": "" }, { "docid": "4d7afacef9eea71de15a3e6335919590", "score": "0.57158554", "text": "basename(file) {\n if (file.type === \"directory\") {\n return file.name;\n }\n return splitext(file.name).basename;\n }", "title": "" }, { "docid": "dca707663e2a7e6b7ceefe795982ab83", "score": "0.5705924", "text": "function win32SplitPath(filename) {\r\n\t // Separate device+slash from tail\r\n\t var result = splitDeviceRe.exec(filename),\r\n\t device = (result[1] || '') + (result[2] || ''),\r\n\t tail = result[3] || '';\r\n\t // Split the tail into dir, basename and extension\r\n\t var result2 = splitTailRe.exec(tail),\r\n\t dir = result2[1],\r\n\t basename = result2[2],\r\n\t ext = result2[3];\r\n\t return [device, dir, basename, ext];\r\n\t}", "title": "" }, { "docid": "72100169a3bd5031900ed3a3eeb0c332", "score": "0.5673334", "text": "function DirName(s) {\n elements = s.split('/')\n elements.pop()\n return elements.join('/')\n}", "title": "" }, { "docid": "dc2f99de2c672322aade25f17e07447e", "score": "0.5672957", "text": "function win32SplitPath(filename) {\n\t // Separate device+slash from tail\n\t var result = splitDeviceRe.exec(filename),\n\t device = (result[1] || '') + (result[2] || ''),\n\t tail = result[3] || '';\n\t // Split the tail into dir, basename and extension\n\t var result2 = splitTailRe.exec(tail),\n\t dir = result2[1],\n\t basename = result2[2],\n\t ext = result2[3];\n\t return [device, dir, basename, ext];\n\t}", "title": "" }, { "docid": "dbdff0056e06769a9749ec74b4af773f", "score": "0.5660161", "text": "function basenamedir(path) {\n var comps = path.split('/');\n comps = comps.filter(function(c) { return c !== ''; });\n if (comps.length === 0 || (comps.length === 1 && comps[0] === '')) {\n return '/';\n } else {\n return comps[comps.length - 1];\n }\n}", "title": "" }, { "docid": "b5f86442f4d1eea14c69c08de360e7d2", "score": "0.56553113", "text": "function dirname(path) {\n\t\t\t\t\t\t\treturn path.match(DIRNAME_RE)[0];\n\t\t\t\t\t\t}", "title": "" }, { "docid": "6bf61b7e755ec687023d6c791bd99d59", "score": "0.5633573", "text": "function absPath(str) {\n\tlet arr = str.split(\"/\");\n\tlet i = arr.indexOf(\"..\");\n\twhile (i !== -1) {\n\t\tarr.splice(i - 1, 2);\n\t\ti = arr.indexOf(\"..\");\n\t}\n\n\tlet j = arr.indexOf(\".\");\n\twhile (j !== -1) {\n\t\tarr.splice(j, 1);\n\t\tj = arr.indexOf(\".\");\n\t}\n\treturn arr.join(\"/\");\n}", "title": "" }, { "docid": "2f4d558befba0c8ce657f58e984d2785", "score": "0.56271136", "text": "function getFilename(path) {\n\t// let dummy = path.split('/');\n\t// return dummy[dummy.length-1];\n\n\treturn path.substring(path.lastIndexOf(\"/\"))\n\n}", "title": "" }, { "docid": "7f8a936b9f4c6d7b7eb6c9351998e95d", "score": "0.56256807", "text": "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n } // if the path is allowed to go above the root, restore leading ..s\n\n\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n} // Split a filename into [root, dir, basename, ext], unix version", "title": "" }, { "docid": "7f8a936b9f4c6d7b7eb6c9351998e95d", "score": "0.56256807", "text": "function normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n } // if the path is allowed to go above the root, restore leading ..s\n\n\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n} // Split a filename into [root, dir, basename, ext], unix version", "title": "" }, { "docid": "b53c1e97be3a5b7d59fa1eec92608a15", "score": "0.56193817", "text": "static getFilename(path) {\n let name = basename(path);\n return name.split(\".\")[0];\n }", "title": "" }, { "docid": "29215202c4b5068588a9772bf0aa2af5", "score": "0.55902034", "text": "function win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}", "title": "" }, { "docid": "29215202c4b5068588a9772bf0aa2af5", "score": "0.55902034", "text": "function win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}", "title": "" }, { "docid": "29215202c4b5068588a9772bf0aa2af5", "score": "0.55902034", "text": "function win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}", "title": "" }, { "docid": "29215202c4b5068588a9772bf0aa2af5", "score": "0.55902034", "text": "function win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}", "title": "" }, { "docid": "29215202c4b5068588a9772bf0aa2af5", "score": "0.55902034", "text": "function win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}", "title": "" }, { "docid": "29215202c4b5068588a9772bf0aa2af5", "score": "0.55902034", "text": "function win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}", "title": "" }, { "docid": "29215202c4b5068588a9772bf0aa2af5", "score": "0.55902034", "text": "function win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}", "title": "" }, { "docid": "29215202c4b5068588a9772bf0aa2af5", "score": "0.55902034", "text": "function win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}", "title": "" }, { "docid": "29215202c4b5068588a9772bf0aa2af5", "score": "0.55902034", "text": "function win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}", "title": "" }, { "docid": "29215202c4b5068588a9772bf0aa2af5", "score": "0.55902034", "text": "function win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}", "title": "" }, { "docid": "7fc4ef18930de816bdfca714c7726d88", "score": "0.5572241", "text": "get filename() {\n return this.fullPath.split(\"/\").splice(-1).join()\n }", "title": "" }, { "docid": "5fed873404355cf5544f6a9e72383772", "score": "0.55632883", "text": "function basename(path){\n return path.replace(/\\\\/g,'/').replace( /.*\\//, '' );\n}", "title": "" }, { "docid": "16b6cd312eaceca72745b6d4e7ad55f3", "score": "0.5553508", "text": "function pathsplit(path) {\n var comps = pathnorm(path).split('/');\n\n if (comps[0] === '' && comps.length === 1) {\n return ['', ''];\n }\n var file = comps.pop();\n if (comps.length === 0) {\n return ['', file];\n }\n if (comps[0] === '') {\n comps[0] = '/';\n }\n return [pathjoin(comps), file];\n}", "title": "" }, { "docid": "d147b5ad314102bceac0e2cf15eda8cd", "score": "0.55318373", "text": "nameWithoutExt(path) {\n\t\t\tif (path.includes(\".\")) {\n\t\t\t\treturn public.name(path).split(\".\").slice(0, -1).join(\".\");\n\t\t\t}\n\n\t\t\treturn public.name(path);\n\t\t}", "title": "" }, { "docid": "c1e68f4c46f58d36c47605a5aac9014c", "score": "0.5517916", "text": "function extname(path) {\n\t return posix.extname(path);\n\t }", "title": "" }, { "docid": "0ffdd85f51f00395d60493df4d8ceeca", "score": "0.54985666", "text": "get extensionDir() {\n return path.join(__dirname, '..', 'extension');\n }", "title": "" }, { "docid": "a3fc2daf3e815ff1f9aa81f09cdabca7", "score": "0.5492901", "text": "function dirname (uri) {\n var m = uri.match(REGEX_DIR_MATCHER);\n\n // abc/def -> abc\n // abc -> abc // which is different with `path.dirname` of node.js\n // abc/ -> abc\n return m ? m[0] : uri;\n}", "title": "" }, { "docid": "cd2799ae897253737ff9ad12462190e3", "score": "0.5488504", "text": "function __getFilename(path) {\n\treturn require(\"path\").resolve(__dirname + \"/\" + path);\n}", "title": "" }, { "docid": "cd2799ae897253737ff9ad12462190e3", "score": "0.5488504", "text": "function __getFilename(path) {\n\treturn require(\"path\").resolve(__dirname + \"/\" + path);\n}", "title": "" }, { "docid": "cd2799ae897253737ff9ad12462190e3", "score": "0.5488504", "text": "function __getFilename(path) {\n\treturn require(\"path\").resolve(__dirname + \"/\" + path);\n}", "title": "" }, { "docid": "b1bc491dbc88b3143ed9ed5c58341a01", "score": "0.5467724", "text": "function dirname(path) {\n return path.match(DIRNAME_RE)[0];\n }", "title": "" }, { "docid": "3250d3e8b7d57318409484db520f83e3", "score": "0.54468095", "text": "function dirname(path) {\n return path.match(DIRNAME_RE)[0]\n}", "title": "" }, { "docid": "3250d3e8b7d57318409484db520f83e3", "score": "0.54468095", "text": "function dirname(path) {\n return path.match(DIRNAME_RE)[0]\n}", "title": "" }, { "docid": "c373d6c0e000a0d011fe88540a6baf0d", "score": "0.542863", "text": "function extname (path) {\n var index = path.lastIndexOf(\".\");\n return index < 0 ? \"\" : path.substring(index);\n }", "title": "" }, { "docid": "049730b1d6b60d18caa6697910f488ee", "score": "0.54267406", "text": "function getCurrentDirectoryName(){\n\tvar fullPath = __dirname; \n\tvar path = fullPath.split('/'); \n\tvar cwd = path[path.length-1]; \n\tconsole.log(cwd);\n}", "title": "" }, { "docid": "64316b4b5fe8fca145e0ecae91f36648", "score": "0.5411632", "text": "function basename(path) {\n return path.replace(/\\\\/g, '/').split('/').pop();\n}", "title": "" }, { "docid": "0fe9b3471e439e4342da6bb8482c523c", "score": "0.54105085", "text": "function extractFile(str) {\n let file = str.split('\\\\').pop();\n let tuple = file.split('.');\n if (tuple.length == 2) {\n console.log(`File name: ${tuple[0]}`);\n console.log(`File extension: ${tuple[1]}`);\n } else {\n let fileExt = tuple.pop();\n console.log(`File name: ${tuple.join('.')}`);\n console.log(`File extension: ${fileExt}`);\n }\n}", "title": "" }, { "docid": "eefd5a4ec2dc92e8a351555ebe08d8e3", "score": "0.5400189", "text": "function __getDirname(path) {\n\treturn require(\"path\").resolve(__dirname + \"/\" + path + \"/../\");\n}", "title": "" }, { "docid": "eefd5a4ec2dc92e8a351555ebe08d8e3", "score": "0.5400189", "text": "function __getDirname(path) {\n\treturn require(\"path\").resolve(__dirname + \"/\" + path + \"/../\");\n}", "title": "" }, { "docid": "eefd5a4ec2dc92e8a351555ebe08d8e3", "score": "0.5400189", "text": "function __getDirname(path) {\n\treturn require(\"path\").resolve(__dirname + \"/\" + path + \"/../\");\n}", "title": "" }, { "docid": "5439d4d66df5ba050496a4b43ec44334", "score": "0.5398337", "text": "function dirname(resource) {\r\n if (resource.path.length === 0) {\r\n return resource;\r\n }\r\n if (resource.scheme === network_1.Schemas.file) {\r\n return uri_1.URI.file(paths.dirname(originalFSPath(resource)));\r\n }\r\n let dirname = paths.posix.dirname(resource.path);\r\n if (resource.authority && dirname.length && dirname.charCodeAt(0) !== 47 /* Slash */) {\r\n console.error(`dirname(\"${resource.toString})) resulted in a relative path`);\r\n dirname = '/'; // If a URI contains an authority component, then the path component must either be empty or begin with a CharCode.Slash (\"/\") character\r\n }\r\n return resource.with({\r\n path: dirname\r\n });\r\n }", "title": "" }, { "docid": "4739912431556085c691583c5b6bba7c", "score": "0.53801316", "text": "function getFileName(path) {\r\n for(var i=0;i<path.length;i++) {\r\n var tmp = path[i];\r\n tmp = tmp.split('.');\r\n } \r\n return tmp[0];\r\n}", "title": "" }, { "docid": "70a161f3e85080c4bd502567aaf40f1f", "score": "0.5371531", "text": "function normPath ( path ) {\n // only \".\" or ending in a slash\n // does it not contain a \"*\" or known js extension\n // ... append .js glob syntax\n if ( /(^\\.$|\\/$)/.test( path ) || !/(\\*|\\.(es6?|mjs|jsx?))/.test( path ) ) {\n return `${ path }/**/*.js`;\n }\n return path;\n}", "title": "" }, { "docid": "b505de114528ab2754cb0a7e87693fda", "score": "0.5371235", "text": "function dirname(url) {\n const slashIndex = url && url.lastIndexOf('/');\n return slashIndex >= 0 ? url.substr(0, slashIndex) : '';\n}", "title": "" }, { "docid": "5ed935389a3d34bcee90819e9363490f", "score": "0.5366695", "text": "function getFileNames(dir) {\n return readdir.sync(dir, { deep: true })\n .map(item => `.${path.posix.sep}${path.posix.join(dir, path.posix.format(path.parse(item)))}`) //normalize paths\n .filter(item => !fs.statSync(item).isDirectory() && /.js$/.test(item)) //filter out directories\n .map(file => ({ name: path.basename(file, '.js'), path: file }))\n}", "title": "" }, { "docid": "f5292a639d321ee1a4b5a15f986e5c46", "score": "0.5365644", "text": "function get_file_name_from_path(fullPath) {\n if (fullPath) {\n var startIndex = (fullPath.indexOf('\\\\') >= 0 ? fullPath.lastIndexOf('\\\\') : fullPath.lastIndexOf('/'));\n var filename = fullPath.substring(startIndex);\n if (filename.indexOf('\\\\') === 0 || filename.indexOf('/') === 0) {\n filename = filename.substring(1);\n }\n return filename;\n }\n return \"\";\n}", "title": "" }, { "docid": "3754e4e2ebefc28f64900b8986313cdc", "score": "0.53514564", "text": "function sanitizePath(p, n) {\n if (!n)\n return null; // weird bug solved stopping from optimizing :-)\n var prefix = !p.startsWith('.') ? '.' + path.sep : '';\n var pathComplete = prefix + path.join(p, n);\n // on windows* change the slashes to '/' for cross-platform compatibility\n if (path.sep === '\\\\') {\n pathComplete = pathComplete.replace(/\\\\/g, '/');\n }\n return pathComplete;\n}", "title": "" }, { "docid": "33b6e18f7cc912fc7074f7391007eefa", "score": "0.5326894", "text": "function a(e){var n=e,a=r(e);if(a){if(!a.path)return e;n=a.path}for(var i,u=t.isAbsolute(n),l=n.split(/\\/+/),s=0,c=l.length-1;c>=0;c--)i=l[c],\".\"===i?l.splice(c,1):\"..\"===i?s++:s>0&&(\"\"===i?(\n// The first part is blank if the path is absolute. Trying to go\n// above the root is a no-op. Therefore we can remove all '..' parts\n// directly after the root.\nl.splice(c+1,s),s=0):(l.splice(c,2),s--));return n=l.join(\"/\"),\"\"===n&&(n=u?\"/\":\".\"),a?(a.path=n,o(a)):n}", "title": "" }, { "docid": "80655f0fd137a5dd90801ad5d30bbffa", "score": "0.53200316", "text": "parsePath() {\n let outputSegments = path.parse(this.file);\n\n return {\n path: this.file,\n pathWithoutExt: path.join(outputSegments.dir, `${outputSegments.name}`),\n hashedPath: path.join(outputSegments.dir, `${outputSegments.name}.[hash]${outputSegments.ext}`),\n base: outputSegments.dir,\n file: outputSegments.base,\n fileWithDir: path.join(outputSegments.dir.split('/').pop(), outputSegments.base),\n hashedFile: `${outputSegments.name}.[hash]${outputSegments.ext}`,\n name: outputSegments.name,\n isDir: ! outputSegments.ext,\n ext: outputSegments.ext\n };\n }", "title": "" }, { "docid": "faf53465642448250e570b28dbc15f9a", "score": "0.53172374", "text": "function path(p){ //\n\t\tif(!p) return ''\n\t\tp = p.replace(/\\.\\//g, '')\n\t\tvar b = p.match(/([\\s\\S]*)\\/[^\\/]*$/)\n\t\treturn b ? b[1] : ''\n\t}", "title": "" }, { "docid": "99f3ff17a4934bf322e8dc1de951fc3a", "score": "0.5308135", "text": "function normalizePath(url) {\n const { relativePath } = url;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (relativePath) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n }", "title": "" }, { "docid": "3fb1d1d58cbf15cf8c72d65a3cb33087", "score": "0.5300927", "text": "function extname(path) {\n\t var match = (/\\.(\\w+)$/).exec(path);\n\t if (match !== null) {\n\t return nullable_to_opt(caml_array_get(match, 0));\n\t }\n\t \n\t}", "title": "" }, { "docid": "eb3d070b1b539fb9376fd154d38b2135", "score": "0.52974004", "text": "function _default(baseDir, fileNameWithoutExtname) {\n let i = 0;\n\n while (i < JS_EXTNAMES.length) {\n const extname = JS_EXTNAMES[i];\n const absFilePath = fileNameWithoutExtname ? (0, _path().join)(baseDir, `${fileNameWithoutExtname}${extname}`) : `${baseDir}${extname}`;\n\n if ((0, _fs().existsSync)(absFilePath)) {\n return absFilePath;\n }\n\n i += 1;\n }\n\n return null;\n}", "title": "" }, { "docid": "2b10e301c88c41ebd82737ed4f1bc40d", "score": "0.52850187", "text": "getShortPath() {\n const paths = path.parse(this._path);\n let delimiter = '/';\n\n if (paths.dir.indexOf(delimiter) < 0) {\n delimiter = `\\\\`;\n }\n //root: ubicacion inicial de una URL\n //y path.name que es la ultima carpeta\n return `${paths.root}...${delimiter}${paths.name}`;\n }", "title": "" }, { "docid": "4d36ae28b8c4c9007bcf684d7d5e3ece", "score": "0.5277194", "text": "function filename() {\n return path_1.default.basename(process.argv[1]);\n}", "title": "" }, { "docid": "548622e1b461fdbac6cd9f80d7fb481f", "score": "0.52754074", "text": "function extractFileExtenstion(filename){\n return (/[.]/.exec(filename)) ? '.' + (/[^.]+$/.exec(filename)[0]) : \"\";\n }", "title": "" }, { "docid": "1dd2bdae6096625e6a350b530d7d3ca3", "score": "0.526977", "text": "function get_file_name(file) {\n\t//remove extension\n\tlet file_name = file.includes(\".\") ? file.substr(0, file.lastIndexOf(\".\")) : file;\n\t\n\t//remove sub-folders\n\tif (file_name.includes(\"/\")) {\n\t\tlet last_slash_index = file.lastIndexOf(\".\");\n\t\tfile_name = file.substr(last_slash_index, file_name.length - last_slash_index);\n\t}\n\t\n\treturn file_name;\n}", "title": "" }, { "docid": "e6602aeac4822b539250be2784f31e82", "score": "0.5269016", "text": "function getFileNameFromPath(path) {\n var index = path.lastIndexOf('/');\n var extIndex = path.lastIndexOf('.');\n return path.substring(index, extIndex);\n }", "title": "" }, { "docid": "9231f525a758c736c90324c5c3cdba96", "score": "0.5266022", "text": "function dirname(path) {\n return path.match(DIRNAME_RE)[0]\n }", "title": "" }, { "docid": "aab07f05da4b4f5d57f387150ec3d2c7", "score": "0.5262701", "text": "function getFileType(fname){\n\nreturn fname.substr((~-fname.lastIndexOf(\".\") >>> 0) + 2);\n}", "title": "" }, { "docid": "d6edd5f2c53d958a5928a0a1cbf1ba00", "score": "0.52615833", "text": "function normalizeArray(parts,allowAboveRoot){// if the path tries to go above the root, `up` ends up > 0\nvar up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==='.'){parts.splice(i,1);}else if(last==='..'){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}// if the path is allowed to go above the root, restore leading ..s\nif(allowAboveRoot){for(;up--;up){parts.unshift('..');}}return parts;}// path.resolve([from ...], to)", "title": "" }, { "docid": "7f7d2d8ad46dd0025536af746a885866", "score": "0.52579236", "text": "function getFileNameFromPath(path) {\n var index = path.lastIndexOf('/');\n var extIndex = path.lastIndexOf('.');\n return path.substring(index , extIndex);\n }", "title": "" }, { "docid": "7a01f39966462f56cdfae5c6760c1203", "score": "0.5254833", "text": "fixExt(path) {\n\t\t\tif (path.includes(\".\")) {\n\t\t\t\treturn public.nameWithoutExt(path) + \".\" + public.ext(path).toLowerCase();\n\t\t\t}\n\t\t\t\n\t\t\treturn path;\n\t\t}", "title": "" }, { "docid": "59a38155cdb1ea1c4a54a6b182b34863", "score": "0.5242377", "text": "function fileName(path){\n\treturn path.split('\\\\').pop().split('/').pop();\n}", "title": "" }, { "docid": "691b358eccc92bdc51b0f39a53bc111b", "score": "0.5241289", "text": "function normalize_filename(new_file_name) {\n /************************************************************************\n * Note: new_file_name may include device identifiers and may be preceded\n * by the full path to the file on the user's local system.\n * Examples:\n * C:\\\\data\\\\folder\\\\file.txt // '\\' is a special char in JS\n * D:/data/school/program.py\n * /home/user/Documents/Class.java\n * core.c\n ***********************************************************************/\n // Unify path separator\n new_file_name = new_file_name.replace(/\\\\/g, \"/\");\n slash = new_file_name.lastIndexOf(\"/\");\n if (slash != -1) {\n // Absolute path given, strip off preceding parts\n new_file_name = new_file_name.substring(slash + 1);\n }\n return new_file_name;\n}", "title": "" }, { "docid": "dbc7d248bf9d70f52ce0b9793632e671", "score": "0.52349377", "text": "function getDirName ()\n{\n return __dirname; //eg __dirname:c:\\utd\\141213UtdV6\\app\\controllers where js is rnning from\n // let'cs see what's on the client side\n}", "title": "" }, { "docid": "0e433b8e08b1c22a9fa04d6e4c93b05e", "score": "0.52305055", "text": "function u(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");for(\n// It is possible for the path to be above the root. In this case, simply\n// checking whether the root is a prefix of the path won't work. Instead, we\n// need to remove components from the root one by one, until either we find\n// a prefix that fits, or we run out of components to remove.\nvar n=0;0!==t.indexOf(e+\"/\");){var r=e.lastIndexOf(\"/\");if(r<0)return t;if(\n// If the only part of the root that is left is the scheme (i.e. http://,\n// file:///, etc.), one or more slashes (/), or simply nothing at all, we\n// have exhausted all components, so the path is not relative to the root.\ne=e.slice(0,r),e.match(/^([^\\/]+:\\/)?\\/*$/))return t;++n}\n// Make sure we add a \"../\" for each component we removed from the root.\nreturn Array(n+1).join(\"../\")+t.substr(e.length+1)}", "title": "" }, { "docid": "18882703023b6b0f28c582589f7fbf7b", "score": "0.5228076", "text": "function getDir(file) {\n return nodePath.dirname(file);\n}", "title": "" }, { "docid": "843bfc8242d8db41d00ded55d9fe6486", "score": "0.5225064", "text": "function v_basename(url)\n{\n //return ((url=/(([^\\/\\\\\\.#\\? ]+)(\\.\\w+)*)([?#].+)?$/.exec(url))!= null)? url[2]: '';\n return url.replace(/\\\\/g,'/').replace( /.*\\//, '' );\n}", "title": "" }, { "docid": "3fb6f54c421454a4aa627228439de6b3", "score": "0.5224634", "text": "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "title": "" }, { "docid": "3fb6f54c421454a4aa627228439de6b3", "score": "0.5224634", "text": "function normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}", "title": "" }, { "docid": "fe76c0d60f3ccb399c804f8c61f375f1", "score": "0.5223282", "text": "function getFolderFromFilename(fullFilename: string): string {\n const filenameParts = fullFilename.split('/')\n // console.log(filenameParts)\n return filenameParts.slice(0, filenameParts.length - 1).join('/')\n}", "title": "" }, { "docid": "190ee1b2b490cb5a66f9854e4722b23b", "score": "0.5219262", "text": "function splitName(fullPath) {\n const p = fullPath.indexOf('/') !== -1 ? path_1.posix : path_1.win32;\n const name = p.basename(fullPath);\n const parentPath = p.dirname(fullPath);\n if (name.length) {\n return { name, parentPath };\n }\n // only the root segment\n return { name: parentPath, parentPath: '' };\n }", "title": "" }, { "docid": "e714081c426c1d5bdd63cefb7309f26a", "score": "0.5216257", "text": "function normalizePath(path) {\n if (path instanceof Array) {\n return path;\n }\n if (typeof(path) == \"number\") {\n return [path];\n }\n // if (typeof(path) == \"string\") {\n // path = path.split(\".\");\n // var out = [];\n // for (var i=0; i<path.length; i++) {\n // var part = path[i];\n // if (String(parseInt(part, 10)) == part) {\n // out.push(parseInt(part, 10));\n // } else {\n // out.push(part);\n // }\n // }\n // return out;\n // }\n }", "title": "" }, { "docid": "d44909bae20c0b5ffc06a02f308e9813", "score": "0.52052325", "text": "function e(a,b,c){/*\n Matches paths for file protocol on windows,\n such as /C:/foo/bar, and captures only /foo/bar.\n */\nvar d,e=/^\\/[A-Z]:(\\/.*)/;\n// The input URL intentionally contains a first path segment that ends with a colon.\n//Get the relative path from the input URL.\n// The input URL intentionally contains a first path segment that ends with a colon.\nreturn 0===b.indexOf(c)&&(b=b.replace(c,\"\")),e.exec(b)?a:(d=e.exec(a),d?d[1]:a)}", "title": "" } ]
b64dd65ab9046f1ffcfd92278a199b78
date from iso format or fallback
[ { "docid": "38ae72a9fa69d467abd50d82c1c4ca49", "score": "0.0", "text": "function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n}", "title": "" } ]
[ { "docid": "51b002ea6eb7b76c81e1d767259091cc", "score": "0.653678", "text": "function iso8601toDate( str ){\n if( str == null || str.length < 8 || str.length > 10 ) {\n return \"too long or short\";\n }\n parts = str.split(\"-\");\n if( parts.length != 3 ) { return \"bad split, use -\"; }\n yearPart = parts[0], monthPart = parts[1], dayPart = parts[2];\n\n year = parseInt(yearPart);\n if( isNaN(year) ) { return \"year not a number\"; }\n month = parseInt(monthPart);\n if( isNaN(month) ) { return \"month not a number\"; }\n day = parseInt(dayPart);\n if( isNaN(day) ) { return \"day not a number\"; }\n\n if( month > 12 || month < 1 ) {return \"month bad\"; }\n if( day > 31 || day < 1 ) {return \"day bad\"; } //could be better\n month = month - 1; //months are jan=0, feb=1, etc\n return new Date(year, month, day); //do we need a try/catch here?\n}", "title": "" }, { "docid": "a18f12119038c4dd984caec38360fc5c", "score": "0.6508413", "text": "function makeDateFromString(config) {\n\t var i,\n\t string = config._i,\n\t match = isoRegex.exec(string);\n\t\n\t if (match) {\n\t config._pf.iso = true;\n\t for (i = 4; i > 0; i--) {\n\t if (match[i]) {\n\t // match[5] should be \"T\" or undefined\n\t config._f = isoDates[i - 1] + (match[6] || \" \");\n\t break;\n\t }\n\t }\n\t for (i = 0; i < 4; i++) {\n\t if (isoTimes[i][1].exec(string)) {\n\t config._f += isoTimes[i][0];\n\t break;\n\t }\n\t }\n\t if (parseTokenTimezone.exec(string)) {\n\t config._f += \"Z\";\n\t }\n\t makeDateFromStringAndFormat(config);\n\t }\n\t else {\n\t config._d = new Date(string);\n\t }\n\t }", "title": "" }, { "docid": "cea41cfa7ff8fac8746a9a986831afb9", "score": "0.64950144", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "9c82d9d6515d6c5764f2b3a47dc85377", "score": "0.64892405", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "81fa4f6971aa8aabeb853b08a9ab2500", "score": "0.64316744", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "81fa4f6971aa8aabeb853b08a9ab2500", "score": "0.64316744", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "0d52c25baf6042bdbf90fe04d9a1461b", "score": "0.64103484", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "477b01d827e8092434ff5f7bea57ac4d", "score": "0.6407205", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "477b01d827e8092434ff5f7bea57ac4d", "score": "0.6407205", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "c6ae0b625d7374328f40da9261259f7a", "score": "0.64045346", "text": "function makeDateFromString(config) {\n parseISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "a7e31dc19e42a5fe08228be7eee8d37e", "score": "0.640296", "text": "convert_date(date){\n \n var default_tz = timezone_default; // server timezone\n \n if(typeof(date) == 'undefined' || date == null)\n return null;\n\n if(moment(date,\"dddd LL\").isValid())\n return moment(date, \"dddd LL\").tz(default_tz).locale('en').format('YYYY-MM-DD');\n return null; \n }", "title": "" }, { "docid": "927590e669fd1651e6296050dcdeadc2", "score": "0.63981855", "text": "function convertDate (date, opt) {\n const cDate = new Date(date)\n const localD = cDate.toLocaleDateString('sv')\n const localT = cDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) // cDate.toLocaleTimeString('sv')\n const local = cDate.toLocaleString('sv')\n const iso = cDate.toISOString()\n if (opt === 'dt') {\n return (`${localD} ${localT}`)\n } if (opt === 'd') {\n return (localD)\n } if (opt === 'i') {\n return (iso)\n } else {\n return (local)\n }\n}", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.63675845", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.63675845", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.63675845", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.63675845", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "c579f549e0de182f0fa3c81cd78cae45", "score": "0.63553876", "text": "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n const ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "c579f549e0de182f0fa3c81cd78cae45", "score": "0.63553876", "text": "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n const ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "91fbe02df2c7ab7efe9a2c79475dd58f", "score": "0.63548034", "text": "function parseISO (string) {\n // Date.parse() doesn't handle yyyy-mm-ddThh, so make fudge that one\n const onlyHours = /^\\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d$/.test(string)\n if (onlyHours) string = `${string}:00`\n\n const unixEpoch = Date.parse(string)\n if (isNaN(unixEpoch)) return null\n return new Date(unixEpoch)\n}", "title": "" }, { "docid": "6b87fedad606458fe559dc357538fb69", "score": "0.6328774", "text": "function dateFromISO8601(isostr) {\n var parts = isostr.match(/\\d+/g);\n return new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]).toString().split(\":00\")[0];\n}", "title": "" }, { "docid": "84d99e365bda3cb11491599f0a30d0c1", "score": "0.6321114", "text": "function isoDate(date) {\n return date.getFullYear() + \"-\" +\n zeroPad(date.getMonth() + 1) + \"-\" +\n zeroPad(date.getDate());\n }", "title": "" }, { "docid": "edb2d3e61c8f869ce69dd787e86dbacc", "score": "0.6300483", "text": "function parseISODate(str) {\n\treturn new Date(\n\t\tstr.substring(0,4), // year\n\t\tparseInt(str.substring(5,7)) - 1, // month index\n\t\tstr.substring(8,10) // day\n\t);\n}", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.6296922", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.6296922", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.6296922", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62956905", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "a3e4d155a196f13ac23904c45a6b0f37", "score": "0.6276584", "text": "function convertToDate(d) {\n date_str = \"\"\n d_index = 0\n delimter = {4: \"-\", 6: \"-\", 8: \" \", 10: \":\", 12: \":\", 14: \" GMT\"};\n filler = {4: \"01\", 6: \"01\", 8: \"00\", 10: \"00\", 12: \"00\"};\n\n // if date is a valid string\n if (isNaN(+d)) {\n date = new Date(d);\n if (!isNaN(date.valueOf())) {\n return date;\n }\n else {\n return null;\n }\n }\n if (d.length < 4 || d.length % 2 != 0 || d.length > 14) {\n return null;\n }\n \n // checking if year is within the range of typical archive holdings\n year = d.substring(0, 4);\n if (+year < startYear || +year > new Date().getUTCFullYear()) {\n return null;\n }\n\n d_index += 4;\n date_str = year + delimter[d_index];\n while (d_index < 14) {\n d_ss = d.substring(d_index, d_index+2);\n date_str += (d_ss == \"\") ? filler[d_index] : d_ss;\n d_index += 2;\n date_str += delimter[d_index];\n }\n date = new Date(date_str);\n if (!isNaN(date.valueOf())) {\n return date;\n }\n return null;\n}", "title": "" }, { "docid": "c050272c7bc4f4a8a2fb38363ac0c207", "score": "0.6270844", "text": "function getISODate(date) {\n let isoDate = '';\n let d = new Date(date);\n\n // If date is valid get ISO format\n if (!isNaN( d.getTime())) {\n isoDate = d.toISOString().substring(0,10);\n }\n \n return isoDate;\n }", "title": "" }, { "docid": "f6b52b1b0de8cd7927e238f7d0b5f66a", "score": "0.6266161", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "f4a8293e2556ac8c1c1c7824ef2689dc", "score": "0.62221026", "text": "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "title": "" }, { "docid": "f4a8293e2556ac8c1c1c7824ef2689dc", "score": "0.62221026", "text": "deserialize(value) {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }", "title": "" }, { "docid": "0864a533f6e4d917bd1c997d4e7aca60", "score": "0.61963737", "text": "function parseDate(value) {\n if (!value || value instanceof Date) return value\n\n return parseISO(value)\n}", "title": "" }, { "docid": "78c330a8f60fda9957f7e3c71d63fe47", "score": "0.6190446", "text": "parseISOString(s) {\n var b = s.split(/\\D+/)\n return new Date(Date.UTC(b[0], --b[1], b[2], b[3], b[4], b[5], b[6]))\n }", "title": "" }, { "docid": "ae6fb96797f53fb5ca4642b5b82cec88", "score": "0.61712116", "text": "function parseDate(date) {\n if( date && typeof(date) == \"string\" ) {\n return new Date(date);\n } else {\n return date;\n }\n }", "title": "" }, { "docid": "e63f857430f78c0c39018a2b0def3845", "score": "0.6168758", "text": "function get_d3_date_from_iso_datetime(date_string)\n{\n var date_and_time = date_string.split('T');\n var timeParser = d3.timeParse(\"%Y-%m-%d\");\n return timeParser(date_and_time[0]);\n}", "title": "" }, { "docid": "13b38a00f1dbd76e3bc9d64468054f0c", "score": "0.6166754", "text": "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "13b38a00f1dbd76e3bc9d64468054f0c", "score": "0.6166754", "text": "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "13b38a00f1dbd76e3bc9d64468054f0c", "score": "0.6166754", "text": "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "13b38a00f1dbd76e3bc9d64468054f0c", "score": "0.6166754", "text": "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "a33ed7b36fdc4a86ec056bbdaf3503e7", "score": "0.61584586", "text": "function makeDateFormatPredictable (string) {\n return string.replace(/(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2})\\.\\d{3}Z/g, '$1Z')\n}", "title": "" }, { "docid": "be1c687450a7f8b5e011294580d88696", "score": "0.61532605", "text": "function parseISOStringToDate(isoDate) {\n let isoDateWithoutTimezone = isoDate.substring(0, isoDate.length - 1);\n return new Date(isoDateWithoutTimezone + TIMEZONE_CORRECTION);\n}", "title": "" }, { "docid": "b47c2735c3429c23771261c14de0a7ee", "score": "0.6137323", "text": "_convertToIso(dateString) {\r\n // 01.29.2018 or 01/29/2018 => 2018-01-29\r\n let result = dateString.replace(/\\b((?:0[1-9])|(?:1[0-2]))[\\./-]((?:0[1-9])|(?:[1-2][0-9])|(?:3[0-1]))[\\./-](\\d{4})/g, '$3-$1-$2');\r\n // 29.01.2018 or 29/01/2018 => 2018-01-29\r\n result = dateString.replace(/\\b((?:0[1-9])|(?:[1-2][0-9])|(?:3[0-1]))[\\./-]((?:0[1-9])|(?:1[0-2]))[\\./-](\\d{4})/g, '$3-$2-$1');\r\n // 09:29:02,258 => 09:29:02.258\r\n result = result.replace(',', '.');\r\n return result;\r\n }", "title": "" }, { "docid": "a0ebf23ad8de74de833c51923b18d7eb", "score": "0.61215746", "text": "function strtodate(date)\n{\n\ttry{\n\t\tvar dateArr = date.split(\"/\");\n\t\tif (dateArr.length == 3)\n\t\t{\n\t\t\tvar ret = new Date();\n\t\t\tret.setFullYear(dateArr[2], dateArr[1]-1, dateArr[0]);\n\t\t}\n\t\telse {\n\t\t\treturn ret = false;\n\t\t}\n\t}\n\tcatch(err)\n\t{\n\t\tret = false;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "3f93ffe564770ecdc9f7b8baa43a435a", "score": "0.61188406", "text": "function configFromISO(config) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__utils_type_checks__[\"i\" /* isString */])(config._i)) {\n return config;\n }\n var input = config._i;\n var match = extendedIsoRegex.exec(input) || basicIsoRegex.exec(input);\n var allowTime;\n var dateFormat;\n var timeFormat;\n var tzFormat;\n if (!match) {\n config._isValid = false;\n return config;\n }\n // getParsingFlags(config).iso = true;\n var i;\n var l;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return config;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return config;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return config;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n }\n else {\n config._isValid = false;\n return config;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n return Object(__WEBPACK_IMPORTED_MODULE_2__from_string_and_format__[\"a\" /* configFromStringAndFormat */])(config);\n}", "title": "" }, { "docid": "aa6ce9ba2f7f7bb7acb93e18b1323a39", "score": "0.61156076", "text": "date(value, options) {\n return (value instanceof Date && !isNaN(value)) || Date.parse(value)\n }", "title": "" }, { "docid": "896808c0244a05361ac14cf15df32744", "score": "0.61058867", "text": "function parseISO(config) {\n var i, l, string = config._i, match = isoRegex.exec(string);\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.6103642", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "706d19ba3c02566ad61eb73c2e501b5c", "score": "0.60494083", "text": "createDateStr(str) {\n if (str.length == 10) {\n if (/^(\\d{4})(-)(\\d{2})(-)(\\d{2})$/.test(str)) { // Test for 'YYYY-MM-DD'\n return str;\n } else if (/^(\\d{4})(\\/)(\\d{2})(\\/)(\\d{2})$/.test(str)) { // TEST for 'YYYY/MM/DD'\n return str.replace(/\\//g, '-');\n } else if (/^(\\d{4})(\\s)(\\d{2})(\\s)(\\d{2})$/.test(str)) { // Test for 'YYYY MM DD'\n return str.replace(/\\s/g, '-');\n }\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "bd425a2e0127bbe97f2064657550c28a", "score": "0.60265374", "text": "function configFromISO(config){var i,l,string=config._i,match=extendedIsoRegex.exec(string)||basicIsoRegex.exec(string),allowTime,dateFormat,timeFormat,tzFormat;if(match){getParsingFlags(config).iso=true;for(i=0,l=isoDates.length;i<l;i++){if(isoDates[i][1].exec(match[1])){dateFormat=isoDates[i][0];allowTime=isoDates[i][2]!==false;break;}}if(dateFormat==null){config._isValid=false;return;}if(match[3]){for(i=0,l=isoTimes.length;i<l;i++){if(isoTimes[i][1].exec(match[3])){// match[2] should be 'T' or space\ntimeFormat=(match[2]||' ')+isoTimes[i][0];break;}}if(timeFormat==null){config._isValid=false;return;}}if(!allowTime&&timeFormat!=null){config._isValid=false;return;}if(match[4]){if(tzRegex.exec(match[4])){tzFormat='Z';}else{config._isValid=false;return;}}config._f=dateFormat+(timeFormat||'')+(tzFormat||'');configFromStringAndFormat(config);}else{config._isValid=false;}}// date from iso format or fallback", "title": "" }, { "docid": "c7304281f884b12105d31fc1e0b2d6e5", "score": "0.60187024", "text": "function str2date(date) {\n\tvar ch = '' + date.charAt(0);\n\tif ( ch < '0' || ch > '9') return new Date( 10000, 0, 1 );\n\treturn new Date(SQL_DATE_FORMAT.parse(date).getTime());\n}", "title": "" }, { "docid": "98ad371bd33c9a838b867b195a102696", "score": "0.60096854", "text": "function _dateCoerce(obj) {\n return obj.toISOString();\n}", "title": "" }, { "docid": "b8549a2736e633c589f2da9e83436690", "score": "0.6009676", "text": "function configFromISO(config){var i,l,string=config._i,match=extendedIsoRegex.exec(string)||basicIsoRegex.exec(string),allowTime,dateFormat,timeFormat,tzFormat;if(match){getParsingFlags(config).iso=true;for(i=0,l=isoDates.length;i<l;i++){if(isoDates[i][1].exec(match[1])){dateFormat=isoDates[i][0];allowTime=isoDates[i][2]!==false;break;}}if(dateFormat==null){config._isValid=false;return;}if(match[3]){for(i=0,l=isoTimes.length;i<l;i++){if(isoTimes[i][1].exec(match[3])){// match[2] should be 'T' or space\n\ttimeFormat=(match[2]||' ')+isoTimes[i][0];break;}}if(timeFormat==null){config._isValid=false;return;}}if(!allowTime&&timeFormat!=null){config._isValid=false;return;}if(match[4]){if(tzRegex.exec(match[4])){tzFormat='Z';}else{config._isValid=false;return;}}config._f=dateFormat+(timeFormat||'')+(tzFormat||'');configFromStringAndFormat(config);}else{config._isValid=false;}}// date from iso format or fallback", "title": "" }, { "docid": "e2ab8feb6f53cb56c7c6fab03bda9dfd", "score": "0.5999066", "text": "function parseISODate(str) {\n if (str == null || str == \"\") {\n return null;\n }\n\n var tokens = str.split(\"-\");\n var monthToken = tokens[1];\n var m = (monthToken.charAt(0) == \"0\")\n ? parseInt(monthToken.charAt(1))\n : parseInt(monthToken);\n\n var dayToken = tokens[2];\n var d = (dayToken.charAt(0) == \"0\")\n ? parseInt(dayToken.charAt(1))\n : parseInt(dayToken);\n\n var d1 = new Date();\n d1.setFullYear(parseInt(tokens[0]), (m - 1), d);\n d1.setHours(0, 0, 0, 0);\n\n return d1;\n}", "title": "" }, { "docid": "f29dc47349e86f2f95307fa09cd3d943", "score": "0.5989161", "text": "function ISO_2022() {}", "title": "" }, { "docid": "f29dc47349e86f2f95307fa09cd3d943", "score": "0.5989161", "text": "function ISO_2022() {}", "title": "" }, { "docid": "e2ba99139f113ec36cbadba6a02e3e76", "score": "0.5985125", "text": "function parseISODate(dateString) {\n if (typeof dateString === 'string') {\n var _dateString$split = dateString.split('-', 3),\n _dateString$split2 = _slicedToArray(_dateString$split, 3),\n year = _dateString$split2[0],\n month = _dateString$split2[1],\n day = _dateString$split2[2];\n\n return {\n month: month,\n day: day,\n year: year\n };\n }\n return {\n month: '',\n day: '',\n year: ''\n };\n}", "title": "" }, { "docid": "6dda42aa63704580aaa1899cd20192b1", "score": "0.59848607", "text": "function buildISOLocalDate (date) {\n\tvar out;\n\tif (date.year !== undefined) {\n\t\tout = date.year;\n\t}\n\tif (date.month !== undefined) {\n\t\tout += '-' + pad(date.month + 1);\n\t}\n\tif (date.day !== undefined) {\n\t\tout += '-' + pad(date.day);\n\t}\n\tif (date.hour !== undefined) {\n\t\tout += 'T' + pad(date.hour);\n\t}\n\tif (date.minute !== undefined) {\n\t\tout += ':' + pad(date.minute);\n\t}\n\tif (date.second !== undefined) {\n\t\tout += ':' + pad(date.second);\n\t}\n\treturn out;\n\n\tfunction pad(number) {\n\t\tif (number < 10) {\n\t\t\treturn '0' + number;\n\t\t}\n\t\treturn number;\n\t}\n\n}", "title": "" }, { "docid": "360ae57849b2261dbe76ecf088cdf7ac", "score": "0.5979461", "text": "function iso8601Decoder(isoStr) {\n return Date.parse(isoStr);\n }", "title": "" }, { "docid": "e41e97b04f4ed14e4c220c197546db82", "score": "0.5976474", "text": "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "title": "" } ]
07982f60b4da20aa00335db0497c96aa
todo isaac: Do work to turn html/rtf into a content fragment.
[ { "docid": "0ae9cc942d7feb6d5431422e5ed9ab75", "score": "0.0", "text": "function readFile(file, callback) {\n if (!global.FileReader || file.type && !(file.type in TEXT_TYPES)) {\n callback('');\n return;\n }\n\n if (file.type === '') {\n var _contents = ''; // Special-case text clippings, which have an empty type but include\n // `.textClipping` in the file name. `readAsText` results in an empty\n // string for text clippings, so we force the file name to serve\n // as the text value for the file.\n\n if (TEXT_CLIPPING_REGEX.test(file.name)) {\n _contents = file.name.replace(TEXT_CLIPPING_REGEX, '');\n }\n\n callback(_contents);\n return;\n }\n\n var reader = new FileReader();\n\n reader.onload = function () {\n var result = reader.result;\n !(typeof result === 'string') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'We should be calling \"FileReader.readAsText\" which returns a string') : invariant(false) : void 0;\n callback(result);\n };\n\n reader.onerror = function () {\n callback('');\n };\n\n reader.readAsText(file);\n}", "title": "" } ]
[ { "docid": "ac4d73d599b96a72296447f3a611ad6b", "score": "0.63892674", "text": "function richTextSetContent(content)\n{\n richTextField.document.getElementsByTagName(\"body\")[0].innerHTML = content;\n}", "title": "" }, { "docid": "f171dea31e8e0d620e5429c32ac1a8e3", "score": "0.62077904", "text": "getHTML() {\r\n return getHTMLFromFragment(this.state.doc, this.schema);\r\n }", "title": "" }, { "docid": "d3466d2367c7437c43e57e5d810d9cb4", "score": "0.6202567", "text": "function textContent(text) {\n text[that._html ? \"html\" : \"text\"](function (t) {\n return Object(_trim__WEBPACK_IMPORTED_MODULE_10__[\"trimRight\"])(t).replace(/&([^\\;&]*)/g, function (str, a) {\n return a === \"amp\" ? str : \"&amp;\".concat(a);\n }) // replaces all non-HTML ampersands with escaped entity\n .replace(/<([^A-z^/]+)/g, function (str, a) {\n return \"&lt;\".concat(a);\n }).replace(/<$/g, \"&lt;\") // replaces all non-HTML left angle brackets with escaped entity\n .replace(/(<[^>^\\/]+>)([^<^>]+)$/g, function (str, a, b) {\n return \"\".concat(a).concat(b).concat(a.replace(\"<\", \"</\"));\n }) // ands end tag to lines before mid-HTML break\n .replace(/^([^<^>]+)(<\\/[^>]+>)/g, function (str, a, b) {\n return \"\".concat(b.replace(\"</\", \"<\")).concat(a).concat(b);\n }) // ands start tag to lines after mid-HTML break\n .replace(/<([A-z]+)[^>]*>([^<^>]+)<\\/[^>]+>/g, function (str, a, b) {\n var tag = that._html[a] ? \"<tspan style=\\\"\".concat(that._html[a], \"\\\">\") : \"\";\n return \"\".concat(tag.length ? tag : \"\").concat(b).concat(tag.length ? \"</tspan>\" : \"\");\n });\n });\n }", "title": "" }, { "docid": "dbfa7e65410cdf570ff0c6e24f0a56b3", "score": "0.5991795", "text": "function makeContent (c) {\n return makeNode('content',c);\n }", "title": "" }, { "docid": "1ab7015e67a5d38c89b6989d005aa565", "score": "0.5989624", "text": "function updateXMLWithHTMLContent(strObjectId) {\n\n var editorDivID = strObjectId.replace(/\\./g, '');\n\n var RTFRowObject = getElement(\"object\");\n RTFRowObject.setAttribute(\"rowId\", dataObjectRTFDict[strObjectId + '_id']);\n RTFRowObject\n .setAttribute(\"objectId\", dataObjectRTFDict[strObjectId + '_o']);\n RTFRowObject.setAttribute(\"relId\", dataObjectRTFDict[strObjectId + '_r']);\n RTFRowObject.setAttribute(\"parentId\", dataObjectRTFDict[strObjectId + '_p']);\n RTFRowObject.setAttribute(\"markup\", \"changed\");\n RTFRowObject.setAttribute(\"level\", \"1\");\n\n var RTFColumn = getElement(\"column\");\n RTFColumn.setAttribute(\"name\", \"RichTextContent\");\n RTFColumn.setAttribute(\"isRichTextColumnRMT\", \"true\");\n RTFColumn.setAttribute(\"edited\", \"true\");\n var encodedDataToSend = CKControlsDict['CKEDITOR_html_' + editorDivID];\n\n //EditInWord\n var ooxml = CKControlsDict['CKEDITOR_ooxml_' + editorDivID];\n if(richEditor.getPreferredEditor() == \"Word\" && !richEditor.isMobile()) {\n \tencodedDataToSend = ooxml; \n }\n else{\n\t // Always encode in base64 in order to bypass the default input filtering\n\t // We have our own input filtering on the server side\n\t var UTF8Input = strToUTF8Arr(encodedDataToSend);\n\t encodedDataToSend = base64EncArr(UTF8Input);\n }\n\n //JX5 content text is not correctly formatted\n var domElement = document.createElement(\"div\");\n domElement.innerHTML = CKControlsDict['CKEDITOR_html_' + editorDivID];\n var cText = domElement.textContent || domElement.innerText || CKControlsDict['CKEDITOR_text_' + editorDivID];\n \n var UTF8InputContentText = strToUTF8Arr(cText);\n encodedDataToSendContentText = base64EncArr(UTF8InputContentText);\n //\n \n //IR-556378-3DEXPERIENCER2018x: encode whole string with base64 to bypass default input filtering and use our own input filtering\n var allText = serverURLWithRoot + ((richEditor.getPreferredEditor() == \"Word\" && !richEditor.isMobile()) ? \"|ooxml|\" : \"|html|\") + encodedDataToSend + \"|\" + //EditInWord\n\tencodedDataToSendContentText;\n var contentText = oXML.createTextNode(base64EncArr(strToUTF8Arr(allText)));\n RTFColumn.appendChild(contentText);\n\n RTFRowObject.appendChild(RTFColumn);\n postDataXML.firstChild.appendChild(RTFRowObject);\n\n var rowToUpdate = emxUICore.selectSingleNode(oXML, \"/mxRoot/rows//r[@id='\" + dataObjectRTFDict[\n strObjectId + '_id'] + \"']\");\n rowToUpdate.setAttribute('status', 'changed');\n\n var rowChildList = rowToUpdate.childNodes;\n var nbColumns = 0;\n\n for (nbColumns = 0; nbColumns < colMap['columns'].length; nbColumns++) {\n if (colMap['columns'][nbColumns].settings['isRichTextColumnRMT'] == 'true') {\n break;\n }\n }\n\n rowChildList[nbColumns].appendChild(oXML.createTextNode(' '));\n rowChildList[nbColumns].setAttribute('edited', 'true');\n rowChildList[nbColumns].setAttribute('d', ' ');\n rowChildList[nbColumns].setAttribute('newA', ' ');\n}", "title": "" }, { "docid": "1ff0bf7455f949b2c9ce46ee938757d7", "score": "0.59673125", "text": "function renderBlog() {\n let generated_html = parseWithFootnotes(editor.getValue());\n document.getElementById('rendered-content-container').innerHTML = generated_html;\n}", "title": "" }, { "docid": "7ae0a5c89ddfb9d73715cf24ac03cb69", "score": "0.5906148", "text": "function richTextGetContent()\n{\n return richTextField.document.getElementsByTagName(\"body\")[0].innerHTML;\n}", "title": "" }, { "docid": "09b8f121731b7ffae16daa1bf96aeb0f", "score": "0.582922", "text": "function getDocumentContent() {\n var doc = DocumentApp.openById(this.pdfToDoc());\n \n this.textFormattingToHtml(doc.getBody());\n}", "title": "" }, { "docid": "be5a7cdbab0925b27494c6715820a4d9", "score": "0.58181685", "text": "function textContent(text) {\n\n text\n [that._html ? \"html\" : \"text\"](function (t) { return trimRight(t)\n .replace(/(<[^>^\\/]+>)([^<^>]+)$/g, function (str, a, b) { return (\"\" + a + b + (a.replace(\"<\", \"</\"))); })\n .replace(/^([^<^>]+)(<\\/[^>]+>)/g, function (str, a, b) { return (\"\" + (b.replace(\"</\", \"<\")) + a + b); })\n .replace(/<([A-z]+)[^>]*>([^<^>]+)<\\/[^>]+>/g, function (str, a, b) {\n var tag = tagLookup[a] ? (\"<tspan style=\\\"\" + (tagLookup[a]) + \"\\\">\") : \"\";\n return (\"\" + (tag.length ? tag : \"\") + b + (tag.length ? \"</tspan>\" : \"\"));\n }); }\n );\n\n }", "title": "" }, { "docid": "7ba94502a64b4e7d9369465791edc750", "score": "0.5810098", "text": "function parseContent(window,input){function nextToken(){// Check for end-of-string.\n\tif(!input){return null;}// Consume 'n' characters from the input.\n\tfunction consume(result){input=input.substr(result.length);return result;}var m=input.match(/^([^<]*)(<[^>]+>?)?/);// If there is some text before the next tag, return it, otherwise return\n\t// the tag.\n\treturn consume(m[1]?m[1]:m[2]);}// Unescape a string 's'.\n\tfunction unescape1(e){return ESCAPE[e];}function unescape(s){while(m=s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/)){s=s.replace(m[0],unescape1);}return s;}function shouldAdd(current,element){return!NEEDS_PARENT[element.localName]||NEEDS_PARENT[element.localName]===current.localName;}// Create an element for this tag.\n\tfunction createElement(type,annotation){var tagName=TAG_NAME[type];if(!tagName){return null;}var element=window.document.createElement(tagName);// element.localName = tagName;\n\tvar name=TAG_ANNOTATION[type];if(name&&annotation){element[name]=annotation.trim();}return element;}var rootDiv=window.document.createElement(\"div\"),current=rootDiv,t,tagStack=[];while((t=nextToken())!==null){if(t[0]==='<'){if(t[1]===\"/\"){// If the closing tag matches, move back up to the parent node.\n\tif(tagStack.length&&tagStack[tagStack.length-1]===t.substr(2).replace(\">\",\"\")){tagStack.pop();current=current.parentNode;}// Otherwise just ignore the end tag.\n\tcontinue;}var ts=parseTimeStamp(t.substr(1,t.length-2));var node;if(ts){// Timestamps are lead nodes as well.\n\tnode=window.document.createProcessingInstruction(\"timestamp\",ts);current.appendChild(node);continue;}var m=t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);// If we can't parse the tag, skip to the next tag.\n\tif(!m){continue;}// Try to construct an element, and ignore the tag if we couldn't.\n\tnode=createElement(m[1],m[3]);if(!node){continue;}// Determine if the tag should be added based on the context of where it\n\t// is placed in the cuetext.\n\tif(!shouldAdd(current,node)){continue;}// Set the class list (as a list of classes, separated by space).\n\tif(m[2]){node.className=m[2].substr(1).replace('.',' ');}// Append the node to the current node, and enter the scope of the new\n\t// node.\n\ttagStack.push(m[1]);current.appendChild(node);current=node;continue;}// Text nodes are leaf nodes.\n\tcurrent.appendChild(window.document.createTextNode(unescape(t)));}return rootDiv;}// This is a list of all the Unicode characters that have a strong", "title": "" }, { "docid": "c99d3fd3a435f68986833873f07b27a6", "score": "0.5808775", "text": "viewContents(){\n const markdownInstruction = this.state.content;\n const rawHtml = <div id=\"rawHtml\" className=\"language-html\">\n <ReactCommonmark source={markdownInstruction} />\n </div>\n return <Segment style={{overflow: 'auto',minHeight:500,maxHeight:330,maxWidth:1000,minWidth:150 }}>\n {rawHtml}\n </Segment>\n }", "title": "" }, { "docid": "66f064b0b82e9237d911448a9ece4f67", "score": "0.5803121", "text": "function customHTML2Content(HTML, contentState) {\n var tempDoc = new DOMParser().parseFromString(HTML, 'text/html');\n // replace all <img /> with <blockquote /> elements\n (0, _toArray2[\"default\"])(tempDoc.querySelectorAll('img')).forEach(imgReplacer);\n // use DraftJS converter to do initial conversion. I don't provide DOMBuilder and\n // blockRenderMap arguments here since it should fall back to its default ones, which are fine\n\n var _convertFromHTML = (0, _draftJs.convertFromHTML)(tempDoc.body.innerHTML),\n contentBlocks = _convertFromHTML.contentBlocks;\n // now replace <blockquote /> ContentBlocks with 'atomic' ones\n\n\n contentBlocks = contentBlocks.reduce(function (contentBlocks, block) {\n if (block.getType() !== 'blockquote') {\n return contentBlocks.concat(block);\n }\n var image = JSON.parse(block.getText());\n contentState.createEntity('IMAGE-ENTITY', 'IMMUTABLE', image);\n var entityKey = contentState.getLastCreatedEntityKey();\n var charData = _draftJs.CharacterMetadata.create({ entity: entityKey });\n // const blockSpec = Object.assign({ type: 'atomic', text: ' ' }, { entityData })\n // const atomicBlock = createContentBlock(blockSpec)\n // const spacerBlock = createContentBlock({});\n var fragmentArray = [new _draftJs.ContentBlock({\n key: (0, _draftJs.genKey)(),\n type: 'image-block',\n text: ' ',\n characterList: (0, _immutable.List)((0, _immutable.Repeat)(charData, charData.count()))\n }), new _draftJs.ContentBlock({\n key: (0, _draftJs.genKey)(),\n type: 'unstyled',\n text: '',\n characterList: (0, _immutable.List)()\n })];\n return contentBlocks.concat(fragmentArray);\n }, []);\n // console.log('>> customHTML2Content contentBlocks', contentBlocks);\n tempDoc = null;\n return _draftJs.BlockMapBuilder.createFromArray(contentBlocks);\n}", "title": "" }, { "docid": "5e57d9221a93c57e3cf27be2c01a5257", "score": "0.57648003", "text": "function formatAsHtml(content){\n\tvar output = \n\t\"<!DOCTYPE html>\\n\" + \n\t\"<html>\\n\" + \n\t\"<head>\\n\" +\n \"<meta charset=\\\"UTF-8\\\">\\n\" +\n \"<title>My Chit Chat</title>\\n\" +\n \"</head>\\n\" +\n \"<body>\\n\" +\n content + \"\\n\" +\n \"</body>\\n\" +\n \"</html>\";\n return output;\n}//end function formatAsHtml", "title": "" }, { "docid": "1e075c7d59181a0f571b32d977ccd12c", "score": "0.5709032", "text": "replaceWholeText(content) {\n throw new Error(\"This DOM method is not implemented.\" + this.debugInfo());\n }", "title": "" }, { "docid": "e19a51bcbcb23f5afce204d3eddc9544", "score": "0.570795", "text": "function displayContent(param) {\n\t\tif (!param) { param = {}; }\n\t\t// Take the params values\n\t\tvar content = (param.hasOwnProperty('content')) ? param.content : '';\n\t\tvar mimetype = (param.hasOwnProperty('mimetype')) ? param.mimetype : 'application/xhtml+xml';\n\n\t\tr.$header.text(r.Book.title); // TODO Do not polute the reader object.\n\n\t\t// Parse the content according its mime-type and apply all filters attached to display content\n\t\tvar result = r.parse(content, mimetype, param);\n\t\tr.Navigation.setChapterHead(result.$head);\n\t\tvar promise = r.preferences.publisherStyles.value ? r.addPublisherStyles() : $.Deferred().resolve().promise();\n\n\t\treturn promise.then(function(){\n\n\t\t\tcontent = r.Filters.applyFilters(r.Filters.HOOKS.BEFORE_CHAPTER_DISPLAY, result.$body);\n\t\t\tr.$reader.html(content);\n\n\t\t\tr.Filters.applyFilters(r.Filters.HOOKS.AFTER_CHAPTER_DISPLAY);\n\n\t\t\t// Add all bookmarks for this chapter.\n\t\t\tvar bookmarks = r.Bookmarks.getBookmarks()[r.Navigation.getChapter()];\n\t\t\tif(bookmarks){\n\t\t\t\t$.each(bookmarks, function(index, bookmark){\n\t\t\t\t\t// Ignore bookmarks not part of the current chapter part:\n\t\t\t\t\tif (bookmark && r.Navigation.isCFIInCurrentChapterPart(bookmark)) {\n\t\t\t\t\t\tr.CFI.setBookmarkCFI(bookmark);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Add all highlights for this chapter\n\t\t\tvar highlights = r.Highlights.getHighlights()[r.Navigation.getChapter()];\n\t\t\tif(highlights){\n\t\t\t\t$.each(highlights, function(index, highlight){\n\t\t\t\t\t// Ignore bookmarks not part of the current chapter part:\n\t\t\t\t\tif (highlight && r.Navigation.isCFIInCurrentChapterPart(highlight)) {\n\t\t\t\t\t\tr.CFI.setHighlightCFI(highlight);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "2d2458d37432a99da33f043242e04fde", "score": "0.57001233", "text": "markup(domStr,isFragment=true){\n\t\tconst _ = this;\n\t\tlet\n\t\t\tfragment = document.createDocumentFragment(),\n\t\t\tparser= new DOMParser().parseFromString(domStr,'text/html');\n\t\tif(isFragment){\n\t\t\tfragment.append(...parser.body.children);\n\t\t\treturn fragment;\n\t\t}\n\n\t\treturn [...parser.body.children];\n\t}", "title": "" }, { "docid": "3b4c0fb582e5a38d122b97f55b9827ac", "score": "0.569497", "text": "function snapBody() {\n const fullHtml = document.querySelector('#fullHTML').value;\n const secondLine = fullHtml.search(/[\\r\\n]/);\n const content = fullHtml.slice(secondLine).replace(/<p>/g, '<p class=\"designer-normal\">').replace(/<hr>/g, '').trim();\n const timeStamp = formatTimeAndDate('1717');\n const foot = `\\n<p class=\"designer-normal\" style=\"text-align: center; font-family:Avenir; font-size: 10pt;\">${timeStamp[0]}<br>\\nHow helpful was this Snap? <a href=https://docs.google.com/forms/d/e/1FAIpQLSfpjeLDtCcPMjTsll4biJO0JaKdbEjhRMM3dFnZc8dwPeodbw/viewform target=\"_blank\">Tell us here!</a>\\n<br>`;\n const body = content + foot;\n return body\n}", "title": "" }, { "docid": "c920d1f9531d868c5a7e559bbd7607ca", "score": "0.5693067", "text": "function rxGetEphoxBodyContent(doc)\r\n{\r\n var lDoc = doc.toLowerCase();\r\n var sBodyPos = lDoc.indexOf(\"<body\");\r\n if(sBodyPos == -1)\r\n\t return doc;\r\n var eBodyPos = lDoc.indexOf(\">\", sBodyPos + 5);\r\n if(eBodyPos == -1) \r\n\t return doc;\r\n var cBodyPos = lDoc.lastIndexOf(\"</body>\");\r\n if(cBodyPos == -1)\r\n\t return doc;\r\n return doc.substring(eBodyPos + 1, cBodyPos);\r\n}", "title": "" }, { "docid": "32ac13d21d8086c89c8444285e35ff26", "score": "0.56747615", "text": "renderContent() { }", "title": "" }, { "docid": "4aee26027597a9b7f817186ddaa07cd9", "score": "0.5671722", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]*>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n function unescape(s) {\n TEXTAREA_ELEMENT.innerHTML = s;\n s = TEXTAREA_ELEMENT.textContent;\n TEXTAREA_ELEMENT.textContent = \"\";\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n var classes = m[2].split('.');\n\n classes.forEach(function(cl) {\n var bgColor = /^bg_/.test(cl);\n // slice out `bg_` if it's a background color\n var colorName = bgColor ? cl.slice(3) : cl;\n\n if (DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)) {\n var propName = bgColor ? 'background-color' : 'color';\n var propValue = DEFAULT_COLOR_CLASS[colorName];\n\n node.style[propName] = propValue;\n }\n });\n\n node.className = classes.join(' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}", "title": "" }, { "docid": "72d46e6ac7d2142b5642a5adf9f80d52", "score": "0.5669256", "text": "function parseContent(uri, data, type) {\n return new Promise((resolve, reject) => {\n let content = fm(data);\n let html;\n switch(type) {\n case 'md':\n html = marked(content.body);\n break;\n case 'jade':\n html = jade.render(content.body, null, ' ');\n break;\n default:\n reject('invalid type');\n }\n resolve(Object.assign({path: uri, content: html}, content.attributes));\n });\n}", "title": "" }, { "docid": "6940b820875fb0497e7fc4d7cbff1251", "score": "0.5665019", "text": "function setRichTextContent() {\n\tif(preferredEditor==\"Word\" && fromCreateForm){ //EditInWord\n window.objectCreationType = \"ooxml\"; //\"html!docx\";\n window.objectCreationObjectId = \"\";\n window.objectCreationContentData = CKControlsDict['CKEDITOR_ooxml_'];\n window.objectCreationContentText = \"\";\n window.serverURLWithRoot = serverURLWithRoot;\n window.objectCreationCsrfParams = csrfParams;\n return;\n// clear rich text if creation is a success\n// if(preferredEditor==\"Word\"){\n// \tCKControlsDict['CKEDITOR_ooxml_'] = '';\n// \tjQuery('#NewRichTextEditor').html('');\n// }\n\t}\n\tif(preferredEditor==\"Word\"){\n\t\tformatToSave = \"ooxml\"; //\"html!docx\";\n\t}\n\n var formName = 'editDataForm';\n if (fromCreateForm)\n formName = 'emxCreateForm';\n\n var objectId = '';\n var savedFormat = '';\n var richText = '';\n var contentText = '';\n\n if (formatToSave == HTML_FORMAT) {\n richText = CKEDITOR.instances['CKEDITOR_' + editorDivIDCK].getData();\n\n //Test Case Description in mandatory field.\n if(richText == \"\" && isTextCaseDescriptionXHTML())\n {\n \talert(\"Must enter valid value of Description.\");\n \treturn false;\n }\n //JX5 content text is not correctly formatted\n var temp = document.createElement(\"div\");\n temp.innerHTML = richText;\n \t//++VMA10 added for IR-689358-3DEXPERIENCER2019\n textData = temp.innerHTML;\n textData = temp.textContent || temp.innerText;\n for (var i = 0; i < temp.childNodes.length; i++) {\n \tvar tag = temp.childNodes[i];\n \tif(tag.tagName==\"TABLE\")\n\t\t\t{\n\t\t\t\tif(tag.align==\"center\")\n\t\t\t\t{\n\t\t\t\t\ttag.style.margin = \"auto\";\n\t\t\t\t}\n\t\t\t}\n }\n /*temp.childNodes.\n forEach(\n\t \t\tfunction(tag)\n\t \t\t{\n\t \t\t\tif(tag.tagName==\"TABLE\")\n\t \t\t\t{\n\t \t\t\t\tif(tag.align==\"center\")\n\t \t\t\t\t{\n\t \t\t\t\t\ttag.style.margin = \"auto\";\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n \t\t)*/\n richText = temp.innerHTML\n \n\t//--VMA10\n \n // Always encode in base64 in order to bypass the default input filtering\n // We have our own input filtering on the server side\n var UTF8Input = strToUTF8Arr(richText);\n richText = base64EncArr(UTF8Input);\n\n savedFormat = HTML_FORMAT;\n }\n\n if(preferredEditor!=\"Word\") { //EditInWord\n var UTF8InputContentText = strToUTF8Arr(textData);\n contentText = base64EncArr(UTF8InputContentText);\n }\n\n // > 4 MO\n if (checkMaxSize(richText, false) == false)\n return false;\n \n if (!fromCreateForm) {\n // Get the object ID, clean the input field, and clear the editor\n //objectId = jQuery('#NewRichTextEditorPLC').attr('onload').split('\"')[3];\n\n \tobjectId = objId;\n \tif(preferredEditor==\"Word\"){//EditInWord\n \t\trichText = CKControlsDict['CKEDITOR_ooxml_'];\n \t}\n else if (typeof CKEDITOR != 'undefined') {\n CKEDITOR.instances['CKEDITOR_' + editorDivIDCK].setData('');\n jQuery(document.forms[formName]).find(idDivEditorTextArea).val('');\n }\n\n var data = new FormData();\n data.append('type', formatToSave);\n data.append('objectId', objectId);\n data.append('contentText', contentText);\n data.append('contentData', richText);\n\n jQuery.ajax({\n type: 'POST',\n cache: false,\n contentType: false,\n processData: false,\n url: richEditRestPath + \"setRichContent\" + \"?\" + csrfParams,\n data: data,\n complete: function(data) {\n \t// In case we have a RCO inside\n\t \tsyncRCOContent();\n\t \tif(preferredEditor==\"Word\"){//EditInWord\n\t \t\trequire(['DS/RichEditor/RichEditor'], function(RichEditor){\n\t \t\t\tvar richEditor = new RichEditor();\n\t \t\t\trichEditor.cleanup(objectId);\n\t \t\t});\n\t \t}\n },\n error: function(xhr, status, error){\n \tvar message = typeof xhr.responseText == 'string' ? JSON.parse(xhr.responseText).status : xhr.responseText; \n \talert(error + \":\" + message);\n },\n dataType: 'text',\n async: false\n });\n } else {\n window.objectCreationType = formatToSave;\n window.objectCreationObjectId = objectId;\n window.objectCreationContentData = richText;\n window.objectCreationContentText = contentText;\n window.objectCreationCsrfParams = csrfParams;\n\n // CKEDITOR.instances['CKEDITOR_'].setData('');\n jQuery(document.forms[formName]).find(idDivEditorTextArea).val('');\n }\n}", "title": "" }, { "docid": "d9f9b9dc9091a81424e68c6fffd31519", "score": "0.5624094", "text": "function get_body(content) {\n var x = content.indexOf(\"<main\");\n x = content.indexOf(\">\", x);\n var y = content.lastIndexOf(\"</main>\");\n return content.slice(x + 1, y);\n}", "title": "" }, { "docid": "660f69b10b1a5e88432b0872096cb2e4", "score": "0.56225145", "text": "function getbodycontent()\n{\n}", "title": "" }, { "docid": "da78e0e6fc7741b3d374f0c6b6702d6d", "score": "0.5573299", "text": "function convert_text(text_elem, doc)\n{\n // Get a list of character indices at which distinct formatting changes occur.\n var format_indices = text_elem.getTextAttributeIndices();\n var text = text_elem.getText();\n var text_len = text.length;\n var linkified_formatted_text = '';\n\n // Tags\n var bold_open_tag = '**', bold_close_tag = '**';\n var ital_open_tag = '_', ital_close_tag = '_';\n var del_open_tag = '_', del_close_tag = '_';\n var code_open_tag = '`', code_close_tag = '`';\n if (doc.format == 'html')\n {\n bold_open_tag = '<b>', bold_close_tag = '</b>';\n ital_open_tag = '<i>', ital_close_tag = '</i>';\n del_open_tag = '<del>', del_close_tag = '</del>';\n code_open_tag = '<code>', code_close_tag = '</code>';\n }\n\n var num_segments = format_indices.length;\n for (var i = 0; i < num_segments; ++i)\n {\n var formatted_text = '';\n\n // Get the current formatted chunk.\n var index = format_indices[i];\n\n // Get the formatting for this chunk.\n var is_bold = text_elem.isBold(index);\n var is_ital = text_elem.isItalic(index);\n var is_del = text_elem.isStrikethrough(index);\n var link_url = text_elem.getLinkUrl(index);\n var is_link = (link_url != null);\n\n // We ignore fonts except for monospace fonts, which indicate code markup.\n var is_code = (text_elem.getFontFamily(index) in monospace_fonts);\n\n // Check the previous chunk to see if its formatting is identical to \n // this one, in which case we skip the opening format tag.\n var skip_bold_tag = false, skip_ital_tag = false, skip_del_tag = false,\n skip_code_tag = false;\n if (i > 0)\n {\n var prev_index = format_indices[i-1];\n var was_bold = text_elem.isBold(prev_index);\n var was_ital = text_elem.isItalic(prev_index);\n var was_del = text_elem.isStrikethrough(prev_index);\n var was_code = (text_elem.getFontFamily(prev_index) == 'Courier New');\n skip_bold_tag = (was_bold == is_bold);\n skip_ital_tag = (was_ital == is_ital);\n skip_del_tag = (was_del == is_del);\n skip_code_tag = (was_code == is_code);\n }\n\n // Add the opening tag.\n if (is_bold && !skip_bold_tag)\n formatted_text += bold_open_tag;\n if (is_ital && !skip_ital_tag)\n formatted_text += ital_open_tag;\n if (is_del && !skip_del_tag)\n formatted_text += del_open_tag;\n if (is_code && !skip_code_tag)\n formatted_text += code_open_tag;\n \n // Here's the chunk itself.\n var next_index = text_len;\n if (i < num_segments-1)\n next_index = format_indices[i+1];\n var chunk = text_elem.getText().substring(index, next_index);\n\n // If the chunk ends in whitespace, we save the whitespace for after the closers.\n // Evidently, Google App Script doesn't deal in Javascript Strings, cuz trimEnd() doesn't\n // work. :-( So we have to do this the stupid way.\n var j = chunk.length-1;\n while (chunk.charAt(j) == ' ')\n --j;\n formatted_text += chunk.substring(0, j+1);\n var ws = chunk.substring(j+1, chunk.length);\n\n // Check the next chunk to see if its formatting is identical to \n // this one, in which case we skip the closing format tag.\n skip_bold_tag = false; \n skip_ital_tag = false; \n skip_del_tag = false;\n if (i < (num_segments-1))\n {\n var next_index = format_indices[i+1];\n var will_bold = text_elem.isBold(next_index);\n var will_ital = text_elem.isItalic(next_index);\n var will_del = text_elem.isStrikethrough(next_index);\n skip_bold_tag = (will_bold == is_bold);\n skip_ital_tag = (will_ital == is_ital);\n skip_del_tag = (will_del == is_del);\n }\n\n // Close those tags.\n if (is_bold && !skip_bold_tag)\n formatted_text += bold_close_tag;\n if (is_ital && !skip_ital_tag)\n formatted_text += ital_close_tag;\n if (is_del && !skip_del_tag)\n formatted_text += del_close_tag;\n if (is_code)\n formatted_text += code_close_tag;\n\n // Re-add any whitespace.\n formatted_text += ws;\n\n // If this was a link, linkify it and add it to our final text.\n if (is_link)\n {\n if (doc.format == 'md')\n linkified_formatted_text += '[' + formatted_text + '](' + link_url + ')';\n else\n linkified_formatted_text += '<a href=\"' + link_url + '\">' + formatted_text + '</a>';\n }\n else\n linkified_formatted_text += formatted_text;\n }\n\n // Emit the text of the paragraph.\n doc.text += linkified_formatted_text;\n}", "title": "" }, { "docid": "f30cd74585e8fc08fb790ce1c510c0a1", "score": "0.5562517", "text": "function format_to_edit( $content, $richedit = false ) {\n $content = apply_filters( 'format_to_edit', $content );\n if ( ! $richedit )\n $content = esc_textarea( $content );\n return $content;\n }", "title": "" }, { "docid": "715fabf87c8d102a5539de8ccdca6027", "score": "0.55516976", "text": "function fragment(html) {\n var args = arguments\n , div = document.createElement('div')\n , i = 1;\n\n div.innerHTML = html.replace(/%([se])/g, function(_, type){\n switch (type) {\n case 's': return String(args[i++]);\n case 'e': return escape(args[i++]);\n }\n });\n\n return div.firstChild;\n}", "title": "" }, { "docid": "715fabf87c8d102a5539de8ccdca6027", "score": "0.55516976", "text": "function fragment(html) {\n var args = arguments\n , div = document.createElement('div')\n , i = 1;\n\n div.innerHTML = html.replace(/%([se])/g, function(_, type){\n switch (type) {\n case 's': return String(args[i++]);\n case 'e': return escape(args[i++]);\n }\n });\n\n return div.firstChild;\n}", "title": "" }, { "docid": "a98292f897e6663013f70cf77164612d", "score": "0.55375415", "text": "function fragment(htmlStr) {\n\tvar frag = document.createDocumentFragment();\n\tvar temp = document.createElement('div');\n\ttemp.innerHTML = htmlStr;\n\twhile (temp.firstChild) {\n\t\tfrag.appendChild(temp.firstChild);\n\t}\n\treturn frag;\n}", "title": "" }, { "docid": "48dcc7ebcd54a51733ae857fc3a4f7c4", "score": "0.5530558", "text": "function htmlEditorChanged(trumbowyg) {\n let text = trumbowyg.val();\n\n let template = $('textarea#html-template').val();\n\n let webview = template.replace('{{ CONTENT }}', text);\n\n let row = trumbowyg.closest('.row');\n\n let iframe = row.find('.html-preview .content iframe')[0].contentWindow.document;\n\n iframe.open();\n iframe.close();\n\n $('body', iframe).html(webview);\n}", "title": "" }, { "docid": "97529a8bc30789d57b44f66f293b6e4d", "score": "0.5517029", "text": "provideTextDocumentContent(uri) {\n // URI needs to be encoded as a component for proper inclusion in a url\n let encodedUri = encodeURIComponent(uri);\n console.log(`${localWebService_1.default.getEndpointUri(Interfaces.ContentType.Root)}?uri=${encodedUri}`);\n // Fix for issue #669 \"Results Panel not Refreshing Automatically\" - always include a unique time\n // so that the content returned is different. Otherwise VSCode will not refresh the document since it\n // thinks that there is nothing to be updated.\n let timeNow = new Date().getTime();\n return `\n <html>\n <head>\n <script type=\"text/javascript\">\n window.onload = function(event) {\n console.log('reloaded results window at time ${timeNow}ms');\n var doc = document.documentElement;\n var styles = window.getComputedStyle(doc);\n var backgroundcolor = styles.getPropertyValue('--background-color');\n var color = styles.getPropertyValue('--color');\n var theme = document.body.className;\n var url = \"${localWebService_1.default.getEndpointUri(Interfaces.ContentType.Root)}?\" +\n \"uri=${encodedUri}\" +\n \"&theme=\" + theme +\n \"&backgroundcolor=\" + backgroundcolor +\n \"&color=\" + color;\n document.getElementById('frame').src = url;\n };\n </script>\n </head>\n <body style=\"margin: 0; padding: 0; height: 100%; overflow: hidden;\">\n <iframe id=\"frame\" width=\"100%\" height=\"100%\" frameborder=\"0\" style=\"position:absolute; left: 0; right: 0; bottom: 0; top: 0px;\"/>\n </body>\n </html>`;\n }", "title": "" }, { "docid": "33a47d995f2b3cb1e9c6dfabed72608f", "score": "0.5511528", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]*>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}", "title": "" }, { "docid": "33a47d995f2b3cb1e9c6dfabed72608f", "score": "0.5511528", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]*>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}", "title": "" }, { "docid": "33a47d995f2b3cb1e9c6dfabed72608f", "score": "0.5511528", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]*>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}", "title": "" }, { "docid": "33a47d995f2b3cb1e9c6dfabed72608f", "score": "0.5511528", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]*>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}", "title": "" }, { "docid": "fa887fdcae5194a6cde86fdc69508b8e", "score": "0.5500152", "text": "function parseContent(content){\n\t\t// parse links\n\t\t//var exp = /(\\b(https?|ftp|file):\\/\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*[-A-Z0-9+&@#\\/%=~_|])/ig;\n\t\t//content = content.replace(exp,\"<a href='$1'>$1</a>\");\n\t\t\t\n\t\t// add html p tags\n\t\t/*content = '<p>'+content;\n\t\tcontent = content.replace(/\\n/g, '</p><p>');\n\t\tcontent += '</p>';*/\n\t\tjQuery.ajaxSetup({async:false});\n\t\tjQuery.post(\"<?php echo get_template_directory_uri(); ?>/echowp.php\",\"postcontent=\"+content,function(data){\n\t\t\tcontent=data;\n\t\t});\n\t\tjQuery.ajaxSetup({async:true});\n\t\treturn content;\n\t\t\t\n\t}", "title": "" }, { "docid": "c21751eddbfeb5fb0ba9f24e81b6eb18", "score": "0.5489859", "text": "function getHTMLEscapeValue(content) {\t\n\t\tvar tempDiv = $(\"<div></div>\");\n\t\t$(tempDiv).html(content);\n\t\t$(\"body\").append(tempDiv);\n\t\tcontent = $(tempDiv).html();\n\t\t$(tempDiv).remove();\t\n\t\treturn content;\n\t}", "title": "" }, { "docid": "ae86020e66e43a0b51ea4c8821c9ad89", "score": "0.5489767", "text": "function render(content, data) {\n return new Promise((resolve, reject) => {\n fs.readFile(`${__dirname}/../src/assets/templates/index.html`,\n {'encoding': 'utf8'}, (err, layout) => {\n if (err) {\n return reject(err);\n }\n const html = layout.replace('{{{body}}}', content).replace('{{{data}}}', encodeHTML(JSON.stringify(data)));\n resolve(html);\n });\n });\n}", "title": "" }, { "docid": "bf270503fd7cec60582bf11de3850e49", "score": "0.54759544", "text": "function renderEditorText() {\n const text = document.getElementById('editor_view').value;\n // console.log('>> editor_view text:', text)\n const entry = nginw.transformText(text);\n renderWindow.document.querySelector('#feed').innerHTML = nginw.renderFeed(entry);\n renderWindow.document.querySelector('#render_view').innerHTML = nginw.renderArticle(entry);\n document.querySelector('#bodyWordCount').innerHTML = entry.wordCount.toString();\n document.querySelector('#headingsCount').innerHTML = entry.headingsCount.toString();\n}", "title": "" }, { "docid": "f95fc48c96650b94617dcb096769e9ee", "score": "0.54675835", "text": "function getContent(){\n $.ajax({\n url: \"content.md\",\n success: function (resp) {\n buildContent(converter.makeHtml(resp));\n },\n error: function(e) {\n console.log(e);\n }\n });\n}", "title": "" }, { "docid": "8a7a55ad47ae85563a49f467b86cb52d", "score": "0.54663235", "text": "setPageContent(htmlContent){\r\n document.getElementById(\"content\").innerHTML = htmlContent;\r\n }", "title": "" }, { "docid": "12c3b3867ecc60f3fd27c7557dfab3f2", "score": "0.54647774", "text": "function renderContent(template, content, location, newFeed) {\n let html = document.getElementById(template).innerHTML;\n if (newFeed) {\n document.getElementById(location).innerHTML = \"\";\n }\n document.getElementById(location).innerHTML += Mustache.render(html, content);\n}", "title": "" }, { "docid": "fe3833dabf850f30b07c1e26bf53d380", "score": "0.54641145", "text": "function gotContent(data) {\n var page = data.query.pages;\n // The content is in the page's ID #, but we don't actually know the ID number\n // But it always comes first, this is a goofy way to get it\n var id = Object.keys(page)[0];\n // Look at the actual content\n var txt = page[id].revisions[0]['*'];\n // Show in on the HTML page\n createP(txt);\n}", "title": "" }, { "docid": "237cb9dea7065d639d8ae96c98e7ee33", "score": "0.5450528", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]+>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}", "title": "" }, { "docid": "237cb9dea7065d639d8ae96c98e7ee33", "score": "0.5450528", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]+>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}", "title": "" }, { "docid": "baf5b5cff95426f361569de586f1cb24", "score": "0.5435402", "text": "function dynamiccontentNS6(elementid,content){\n\tif (document.getElementById && !document.all){\n\t\trng = document.createRange();\n\t\tel = document.getElementById(elementid);\n\t\trng.setStartBefore(el);\n\t\thtmlFrag = rng.createContextualFragment(content);\n\twhile (el.hasChildNodes())\n\t\tel.removeChild(el.lastChild);\n\t\tel.appendChild(htmlFrag);\n\t}\n}", "title": "" }, { "docid": "035c0ec1c253006cf1b096e32eca1348", "score": "0.5419725", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]+>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n }", "title": "" }, { "docid": "035c0ec1c253006cf1b096e32eca1348", "score": "0.5419725", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]+>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n }", "title": "" }, { "docid": "035c0ec1c253006cf1b096e32eca1348", "score": "0.5419725", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]+>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n }", "title": "" }, { "docid": "035c0ec1c253006cf1b096e32eca1348", "score": "0.5419725", "text": "function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]+>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n }", "title": "" }, { "docid": "08fa63af9072c10210ce990ecadafba3", "score": "0.54180706", "text": "function createDocFrag(htmlString) {\n var docFrag = document.createDocumentFragment();\n var elem = document.createElement('div');\n elem.innerHTML = htmlString;\n docFrag.appendChild(elem);\n return docFrag;\n}", "title": "" }, { "docid": "6bbf6a22e472c9adff70862ff9163572", "score": "0.54053646", "text": "function previewWrite(quill){\n var previewTitle = $(\"#previewTitle\").val();\n var previewContent = quill.getContents();\n var quillHtml = quill.root.innerHTML.trim();\n var quillHtml = quillHtml.replace(\"#\",\"No.\");\n $.ajax({\n type: \"POST\",\n url: \"php/savePreview.php\",\n data: {previewTitle:previewTitle,previewContent:quillHtml},\n success: function(data) {\n console.log(data);\n window.open('writePreview.html', '_top');\n }\n });\n}", "title": "" }, { "docid": "2fe3c1468567a36f03d214f9a42af92a", "score": "0.5403981", "text": "getFormTemplateContent(){\n\n\t\tconst template = document.getElementById('modal-document-form');\n\t\tlet content = document.importNode(template.content, true);\n\t\treturn content;\n\t}", "title": "" }, { "docid": "b0fec07c4806a9c90b231b174abeb16a", "score": "0.54024667", "text": "function insertHTML(html, content) {\n // If index puts us inside a closing html tag, append a space and\n // move to the inside of the tag.\n var addSpace = false;\n if (html.substr(Drupal.file_embedInsertIndex-1, 1) == '<' && html.substr(Drupal.file_embedInsertIndex).match(/^\\/\\w+\\>/)) {\n Drupal.file_embedInsertIndex -= 1;\n addSpace = true;\n }\n\n // Build up our new string.\n return html.slice(0, Drupal.file_embedInsertIndex) + (addSpace ? ' ' : '') + content + html.slice(html.slice(0, Drupal.file_embedInsertIndex).length);\n }", "title": "" }, { "docid": "1ca82809caf83255b3f00940c8c33941", "score": "0.5401581", "text": "function render(content)\n{\n document.getElementById('feeds').innerHTML = content;\n}", "title": "" }, { "docid": "659ead6a7afe5cc4afabfc26894b8b7c", "score": "0.54000944", "text": "function getHTML()\r\n{\r\n\ttxthtml().value=\"\";\r\n\ttxthtml().value=editor().innerHTML;\r\n}", "title": "" }, { "docid": "5892a3510d1d7466016031ac9bbf49a0", "score": "0.53932464", "text": "function displayhtml()\n{\n //set textContent of pre tag to the innerHTML of editable div. textContent can take any form of text and display it as it is without browser interpreting it. It also preserves white space and new line characters.\n document.getElementsByClassName(\"htmloutput\")[0].textContent = document.getElementsByClassName(\"editor\")[0].innerHTML;\n}", "title": "" }, { "docid": "ad6eda8cebaef5ad58d83d897e3d0c52", "score": "0.53815746", "text": "solutionContent(){\n this.iFrameUserContent = \"<style>\" + this.textAreaPracticeCss + \"</style>\" + this.textAreaPracticeHtml;\n\n this.textAreaPracticeCss =\n this.$el.children[1].innerHTML\n .split(\"</span>\")[0]\n .replace(\"<span>\", \"\")\n .replace(/\\s[^\\S]/g, \"\")\n .replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\")\n .replace(/(\\*\\/)[^\\}]/g, \"$1\\n\")\n .replace(/(\\/\\*)/g, \"\\n\\n$1\")\n .replace(/(\\{)\\s(\\w+)/g, \"$1\\n $2\")\n .replace(/(;)\\s(\\w+)/g, \"$1\\n $2\")\n .replace(/(;)\\s(\\})/g, \"$1\\n$2\")\n .replace(/(\\})\\s?(\\S)/g, \"$1\\n\\n$2\")\n .trim();\n\n this.textAreaPracticeHtml =\n this.$el.children[1].innerHTML\n .split(\"</span>\")[1]\n .replace(/(\\s){2,}/gm, \" \")\n .replace(/(<\\/?\\w+>)/g, \"\\n$1\")\n .replace(/>\\s?</g,\">\\n<\")\n .replace(/(>)\\s?(\\w+)/g,\"$1\\n $2\")\n .replace(/(<\\w+>)\\s?(\\w+)/g, \"$1\\n $2\")\n .trim();\n }", "title": "" }, { "docid": "11d4be5071939c4bbd4af1dd7a872d0f", "score": "0.536706", "text": "function fillBlogContent(content_id, text, flag=false) {\r\n document.getElementById(content_id).innerHTML = replaceBadSymbols(text, flag);\r\n addContentBoxStyle(content_id);\r\n}", "title": "" }, { "docid": "2795133e046d166b86d0ea09a39cd742", "score": "0.53650904", "text": "function bxe_insertContent_async(node,replaceNode, options,selNode) {\n\tvar docfrag;\n\tif (typeof node == \"string\") {\n docfrag = node.convertToXML();\n\t\t\n\t} else {\n\t\tdocfrag = node;\n\t}\n\tvar oldStyleInsertion = false;\n\ttry {\n\tif (replaceNode == BXE_SELECTION) {\n\t\t//FIXME 2.0 doesn't work yet\n\t\t\n\t\tvar sel = window.getSelection();\n\t\t;\n\t\t//var _node = _currentNode.prepareForInsert();\n\t\tif (options & BXE_SPLIT_IF_INLINE) {\n\t\t\tvar _currentNode = docfrag.lastChild\n\t\t\twhile (_currentNode && _currentNode.nodeType == 3) {\n\t\t\t\t_currentNode = _currentNode.previousSibling;\n\t\t\t}\n\t\t\tif (!_currentNode) {\n\t\t\t\t_currentNode = docfrag.lastChild;\n\t\t\t}\n\t\t\tif (selNode) {\n\t\t\t\tvar selCheck = selNode;\n\t\t\t} else {\n\t\t\t\tvar selCheck = sel;\n\t\t\t}\n\t\t\tif (!bxe_checkIsAllowedChild(_currentNode.namespaceURI,_currentNode.localName,selCheck, true)) {\n\t\t\t\tvar cssr = sel.getEditableRange();\n\n\t\t\t\tif (selNode) {\n\t\t\t\t\tvar lala = selNode;\n\t\t\t\t} else {\n\t\t\t\t\tvar lala = sel.anchorNode.parentNode.XMLNode._node;\n\t\t\t\t}\n\t\t\t\t//lala.split(_position);\n\t\t\t\tvar fC = docfrag.firstChild;\n\t\t\t lala.parentNode.insertBefore(docfrag,lala.nextSibling);\n\t\t\t\tvar par = lala.parentNode;\n\t\t\t\tvar sel = window.getSelection();\n\t\t\t\tvar cssr = sel.getEditableRange();\n\t\t\t\t// shouldn't have big consequences, it just doesn't delete selected text, not sure, if that is used anywhere anyway\n\t\t\t\t/* if(!cssr.collapsed) {\n\t\t\t\t\tbxe_deleteEventKey(sel, false,false,false);\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\tpar.XMLNode.isNodeValid(true,2,true);\n\t\t\t\tif (fC) {\n\t\t\t\t\tif (fC.firstChild) {\n\t\t\t\t\t\tsel.collapse(fC.firstChild,0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\n\t\t\t\tbxe_Transform();\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t\tsel.insertNodeRaw(docfrag);\n\t\tbxe_Transform();\n\t\treturn ;\n\t} else if (replaceNode) {\n\t\t\n\t\t//var newNode = docfrag.firstChild.init();\n\t\tnewNode = docfrag.firstChild;\n\t\treplaceNode._node.parentNode.replaceChild(newNode,replaceNode._node);\n\t\t//newNode._node.updateXMLNode();\n\t\t//debug(\"valid? : \" + newNode.getXMLNode().isNodeValid());\n\t\tbxe_Transform(false,false,replaceNode.parentNode);\n\t} else {\n\t\t//FIXME 2.0\n\t\t//docfrag.firstChild.init();\n\t\tvar sel= window.getSelection();\n\t\tvar cssr =sel.getEditableRange();\n\t\teDOMEventCall(\"appendNode\",document,{\"appendToNode\":cssr.startContainer.parentNode.XMLNode, \"node\": docfrag.firstChild})\n\t}\n\t\t} catch(e) {\n\t\tbxe_catch_alert(e);\n\t}\n}", "title": "" }, { "docid": "eb27b3f5e61206bcdc29ad01b957b094", "score": "0.53522736", "text": "function ccontent() {\n return wrap('ccontent', or(ctext, quotedPair, comment)());\n }", "title": "" }, { "docid": "5932fac6e44208a857ce2d0d55d12605", "score": "0.53508985", "text": "function escapeGDocs(content) {\n var ltRegExp = new RegExp(String.fromCharCode(171), \"g\");\n var gtRegExp = new RegExp(String.fromCharCode(187), \"g\");\n content = content.replace(ltRegExp, \"<\");\n content = content.replace(gtRegExp, \">\");\n return content;\n}", "title": "" }, { "docid": "5932fac6e44208a857ce2d0d55d12605", "score": "0.53508985", "text": "function escapeGDocs(content) {\n var ltRegExp = new RegExp(String.fromCharCode(171), \"g\");\n var gtRegExp = new RegExp(String.fromCharCode(187), \"g\");\n content = content.replace(ltRegExp, \"<\");\n content = content.replace(gtRegExp, \">\");\n return content;\n}", "title": "" }, { "docid": "14c6ff4bca6b05f4ca4c05e9bba7125d", "score": "0.53505814", "text": "get contentXml(){\n\t\treturn new XML($req.contentText)\n\t}", "title": "" }, { "docid": "e98b5c4c84c1e3a0de970172fdd404a3", "score": "0.5344584", "text": "function viewPartialSourceForFragment(node, context)\n{\n gTargetNode = node;\n if (gTargetNode && gTargetNode.nodeType == Node.TEXT_NODE)\n gTargetNode = gTargetNode.parentNode;\n\n // walk up the tree to the top-level element (e.g., <math>, <svg>)\n var topTag;\n if (context == 'mathml')\n topTag = 'math';\n else\n throw 'not reached';\n var topNode = gTargetNode;\n while (topNode && topNode.localName != topTag)\n topNode = topNode.parentNode;\n if (!topNode)\n return;\n\n // serialize\n var title = gViewSourceBundle.getString(\"viewMathMLSourceTitle\");\n var wrapClass = gWrapLongLines ? ' class=\"wrap\"' : '';\n var source =\n '<!DOCTYPE html>'\n + '<html>'\n + '<head><title>' + title + '</title>'\n + '<link rel=\"stylesheet\" type=\"text/css\" href=\"' + gViewSourceCSS + '\">'\n + '<style type=\"text/css\">'\n + '#target { border: dashed 1px; background-color: lightyellow; }'\n + '</style>'\n + '</head>'\n + '<body id=\"viewsource\"' + wrapClass\n + ' onload=\"document.title=\\''+title+'\\';document.getElementById(\\'target\\').scrollIntoView(true)\">'\n + '<pre>'\n + getOuterMarkup(topNode, 0)\n + '</pre></body></html>'\n ; // end\n\n // display\n gBrowser.loadURI(\"data:text/html;charset=utf-8,\" + encodeURIComponent(source));\n}", "title": "" }, { "docid": "b2583161f979d03b4687c90acd914293", "score": "0.53400093", "text": "function createMarkup() {\n return {\n __html: body\n };\n }", "title": "" }, { "docid": "4184e050f0b881afec6357833a9c6932", "score": "0.533757", "text": "function wysiwygUpdate(wysiwyg) {\n\t\tvar node = xmlToHTML(wysiwyg.textarea.value);\n\t\t\n\t\t// Translate again because it has to be checked\n\t\tnode = xmlToHTML(htmlToXML(node));\n\t\t\n\t\twysiwyg.control.contentWindow.document.body.innerHTML = node.innerHTML;\n\n\t\t// Empty documents would otherwise cause linebreaks on pressing enter \t\t\n\t\tif (node.innerHTML == '')\n\t\t\twysiwyg.control.contentWindow.document.execCommand('formatblock', false, '<P>');\n\t}", "title": "" }, { "docid": "fe6868d943b27c1e9275c5870efa5912", "score": "0.5333762", "text": "function getRevision_td4Content(rc){\n var state = rc.state;\n var sizediff = rc.newlen - rc.oldlen;\n var td4Text = \"\";\n var tagstart = ( (sizediff > 500 || sizediff < -500) ? 'span style=\"font-weight:bold\" ' : 'small');\n var tagend = ( (sizediff > 500 || sizediff < -500) ? 'span' : 'small');\n var txtdiff = \"\";\n if (sizediff < 0)\n txtdiff = '<'+tagstart+' class=\"mw-plusminus-neg\" >'+sizediff+'</'+tagend+'>';\n else if (sizediff == 0)\n txtdiff = '<'+tagstart+' class=\"mw-plusminus-null\" >='+sizediff+'</'+tagend+'>';\n else\n txtdiff = '<'+tagstart+' class=\"mw-plusminus-pos\" >+'+sizediff+'</'+tagend+'>';\n td4Text += txtdiff;\n return td4Text;\n}", "title": "" }, { "docid": "6761e1b045a3390ee8cbb3b79fa4c5b7", "score": "0.5329383", "text": "get fragment() {\n const template = document.createElement(\"template\")\n template.innerHTML = this.string\n return this.place_values(template.content.cloneNode(true))\n }", "title": "" }, { "docid": "07b4f5ba4f4380892fce6074e7ca4613", "score": "0.5325474", "text": "function wireContent(type) {\n var adopter, content, container, fragment, render, setup, template;\n\n function before(document) {\n fragment = document.createDocumentFragment();\n container = type === 'svg' ? document.createElementNS(SVG_NAMESPACE, 'svg') : fragment;\n render = hyperHTML.bind(container);\n }\n\n function after() {\n if (setup) {\n setup = false;\n if (type === 'svg') {\n appendNodes(fragment, slice.call(container.childNodes));\n }\n content = createContent(fragment);\n }\n return content;\n }\n\n return type === 'adopt' ? function adopt(statics) {\n var args = arguments;\n if (FF) statics = unique(statics);\n if (template !== statics) {\n setup = true;\n template = statics;\n adopter = function adopter(parentNode, children, i) {\n if (setup) {\n if (i < children.length) {\n container = children[i];\n fragment = {\n ownerDocument: container.ownerDocument,\n childNodes: [container],\n children: [container]\n };\n render = hyperHTML.adopt(fragment);\n } else {\n if (OWNER_SVG_ELEMENT in parentNode) type = 'svg';\n before(parentNode.ownerDocument);\n }\n }\n render.apply(null, args);\n return after();\n };\n }\n return adopter;\n } : function update(statics) {\n if (FF) statics = unique(statics);\n if (template !== statics) {\n setup = true;\n template = statics;\n before(hyperHTML.document);\n }\n render.apply(null, arguments);\n return after();\n };\n }", "title": "" }, { "docid": "97769ea9db74bec98c7371d9dc986764", "score": "0.5321574", "text": "function addnNewContentBody(content) {\n\n\tlet conteudo1 = document.getElementById(\"content\").innerHTML;\n\tlet conteudo2 = content;\n\tconteudo1 = conteudo1 + conteudo2;\n\tdocument.getElementById(\"content\").innerHTML = conteudo1;\n\n\twindow.scrollTo(0,document.body.scrollHeight);\n\n\tcontentEditable(\"true\");\n\tsetElementsToEdit();\n\n}", "title": "" }, { "docid": "818717c8422d73b5250c6e035ff569c2", "score": "0.5318573", "text": "function AllContentToWord(id) {\r\n id.style.border = 0;\r\n ExcelSheet = new ActiveXObject(\"Word.Application\");\r\n ExcelSheet.Application.Visible = true;\r\n var mydoc = ExcelSheet.Documents.Add(\"\", 0, 1);\r\n myRange = mydoc.Range(0, 1);\r\n var sel = id.document.body.createTextRange();\r\n sel.select();\r\n id.document.execCommand(\"Copy\");\r\n sel.moveEnd(\"character\");\r\n myRange.Paste();\r\n location.reload();\r\n ExcelSheet.ActiveWindow.ActivePane.View.Type = 9;\r\n}", "title": "" }, { "docid": "df5a9aa49988c4dd15b3cf3a9e7d27bf", "score": "0.5316203", "text": "function saveHTML() {\n\t\t// Run the template.\n\t\tvar activeLayout = getActiveLayout();\n\t\tactiveLayout.designTime = false;\n\t\tvar renderer = new ds.ArticleRenderer();\n\t\tvar result = renderer.renderPage(template, sampleArticle);\n\t\tactiveLayout.designTime = true;\n\n\t\t// Format the output.\n\t\tresult = result.replace(/<(\\/?)[a-zA-Z]+(?:[^>\"']+|\"[^\"]*\"|'[^']*')*>/g, function($0, $1) {\n\t\t return $1 === \"/\" ? $0+\"\\n\" : \"\\n\"+$0;\n\t\t});\n\n\t\t// Save the content to a file.\n\t\tvar uriContent = \"data:application/octet-stream,\" + encodeURIComponent(result);\n\t\twindow.open(uriContent, 'Save');\t\t\n\t}", "title": "" }, { "docid": "b113557eb4deb8afb528811444281d03", "score": "0.53116757", "text": "refreshview()\n {\n const editor = atom.workspace.getActiveTextEditor();\n\n var ext = path.extname( editor.getPath() );\n console.log( ext )\n var text = editor.getText();\n var index;\n var html = \"\";\n var firstrun = true;\n\n var converter = new showdown.Converter(\n {\n tables: true,\n tasklists: true,\n emoji: true,\n underline: true,\n ghMentions: true,\n strikethrough: true\n } );\n\n var openingcomment = \"/*\";\n var closingcomment = \"*/\";\n var openingmarkdown = \"!md\"\n var langs = [ \"js\", \"php\", \"c\", \"c++\", \"sql\", \"lua\" ];\n\n switch( ext )\n {\n case \".md\":\n {\n html += converter.makeHtml( text );\n text = \"\";\n break;\n }\n case \".lua\":\n {\n openingcomment = \"--[[\";\n closingcomment = \"]]\";\n break;\n }\n case \".sql\":\n {\n /* sql does not like the ! */\n openingmarkdown = \"md\";\n }\n default:\n {\n // Attempt auto detect.\n if( -1 != text.indexOf( openingcomment + \"/*\" ) )\n {\n // Stays as default.\n }\n else if( -1 != text.indexOf( openingcomment + \"--[[\" ) )\n {\n openingcomment = \"--[[\";\n closingcomment = \"]]\";\n }\n break;\n }\n }\n\n while( -1 != ( index = text.indexOf( openingcomment + openingmarkdown ) ) )\n {\n if ( 0 != index && !firstrun )\n {\n var code = text.substring( 0, index );\n var h = highlight.highlightAuto( code, langs );\n html += \"<pre class='flip'><code>\" + h.value + \"</code></pre>\"\n }\n firstrun = false;\n\n text = text.substring( index + openingcomment.length + 3, text.length );\n index = text.indexOf( closingcomment );\n if( -1 == index )\n {\n index = text.length;\n }\n\n commenttext = text.substring( 0, index );\n text = text.substring( index + closingcomment.length, text.length );\n\n var code = text.substring( index + closingcomment.length + 1, text.length );\n\n html += converter.makeHtml( commenttext );\n }\n\n if ( 0 != text.length )\n {\n var h = highlight.highlightAuto( text, langs );\n html += \"<pre class='flip'><code>\" + h.value + \"</code></pre>\"\n }\n\n this.ele.innerHTML = html;\n }", "title": "" }, { "docid": "b8ad3dfda55070071ef961f48bfca904", "score": "0.53094816", "text": "function DocumentFragment() { // is this save??\n return document.createDocumentFragment();\n}", "title": "" }, { "docid": "6ae5c58bcebb5897f4eb6b6f2c5e62b2", "score": "0.53081065", "text": "function insertContent(wysiwyg, content) {\n\t\tvar textarea = wysiwyg.textarea;\n\t\tvar control = wysiwyg.control;\n\t\t\n\t\t// IE\n\t\tif (document.selection) { \n\t\t\tcontrol.focus();\n\t\t\tsel = document.selection.createRange();\n\t\t\tsel.text = content;\n\t\t} else { // Mozilla \n\t\t\tvar sel = control.contentWindow.getSelection();\n\t\t\tvar range = sel.getRangeAt(0);\n\t\t\tsel.removeAllRanges();\n\t\t\trange.deleteContents();\n\t\t\tvar oldContent = control.contentWindow.document.body.innerHTML;\n\t\t\tvar inTag = false;\n\t\t\tvar insertPos = 0;\n\t\t\tfor (var i = 0, pos = 0; i < oldContent.length; i++) {\n\t\t\t\tvar aChar = oldContent.substr(i, 1);\n\t\t\t\tif (aChar == \"<\") {\n\t\t\t\t\tinTag = true;\n\t\t\t\t}\n\t\t\t\tif (!inTag) {\n\t\t\t\t\tpos++;\n\t\t\t\t\tif (pos == range.startOffset) {\n\t\t\t\t\tinsertPos = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (aChar == \">\") {\n\t\t\t\tinTag = false;\n\t\t\t}\n\t\t}\n\t\tcontrol.contentWindow.document.body.innerHTML = oldContent.substr(0, insertPos) + content + oldContent.substr(insertPos, oldContent.length);\n\t\t}\n\t\ttextareaUpdate(wysiwyg);\n\t}", "title": "" }, { "docid": "692b86fe826c4c2c2840d6f85fb4ac0a", "score": "0.53074145", "text": "createContent(e, childContent) {\n var content = '';\n\n var className = e.attr?.class? `class='${e.attr?.class}'` : '';\n var style = e.attr?.style? `style='${e.attr?.style}'` : '';\n var href = e.attr?.href? `href='${e.attr?.href}'` : (\n e.attr?.rel? `href='${e.attr?.rel}'` : '');\n var target = e.attr?.target? `target='${e.attr?.target}'` : '';\n var src = e.attr?.src? `src='${e.attr?.src}'` : '';\n var rel = e.attr?.rel? `rel='${e.attr?.rel}'` : '';\n\n switch(e.tag) {\n case 'img':\n var alt = e.attr?.alt? `alt='${e.attr?.alt}'` : '';\n var sizes = e.attr?.sizes? `sizes='${e.attr?.sizes}'` : '';\n var srcset = e.attr?.srcset? `srcset='${e.attr?.srcset}'` : '';\n content += `<${e.tag} ${className} ${style} ${href} ${target} ${src} ${alt} ${sizes} ${srcset} ${rel}></${e.tag}>`;\n break;\n default:\n content += `<${e.tag} ${className} ${style} ${href} ${target} ${src} ${rel}>${childContent}</${e.tag}>`;\n }\n return content;\n }", "title": "" }, { "docid": "97ff673815680a10df9360dafd84f62d", "score": "0.5303899", "text": "function ccontent() {\n return wrap('ccontent', or(ctext, quotedPair, comment)());\n }", "title": "" }, { "docid": "97ff673815680a10df9360dafd84f62d", "score": "0.5303899", "text": "function ccontent() {\n return wrap('ccontent', or(ctext, quotedPair, comment)());\n }", "title": "" }, { "docid": "daf47166b7a1beed9900d7866bc21772", "score": "0.5300425", "text": "function htmlToText(e){return e.replace(/<\\/div>\\n/gi,\"\").replace(/<\\/p>/gi,\"\").replace(/<\\/span>/gi,\"\").replace(/<\\/div>/gi,\"\").replace(/<\\/ul>/gi,\"\").replace(/<\\/li>/gi,\"\").replace(/<\\/strong>/gi,\"\").replace(/<\\/center>/gi,\"\").replace(/<\\/pre>/gi,\"\").replace(/<\\s*p[^>]*>/gi,\"\").replace(/<\\s*span[^>]*>/gi,\"\").replace(/<\\s*div[^>]*>/gi,\"\").replace(/<\\s*ul[^>]*>/gi,\"\").replace(/<\\s*li[^>]*>/gi,\"\").replace(/<\\s*strong[^>]*>/gi,\"\").replace(/<\\s*center[^>]*>/gi,\"\").replace(/<\\s*pre[^>]*>/gi,\"\").replace(/<hr>/gi,\"\").replace(/<div><br>/gi,\"\\n\").replace(/<div>/gi,\"\").replace(/<\\s*br[^>]*>/gi,\"\\n\").replace(/<\\s*\\/li[^>]*>/gi,\"\").replace(/<\\s*script[^>]*>[\\s\\S]*?<\\/script>/gim,\"\").replace(/<\\s*style[^>]*>[\\s\\S]*?<\\/style>/gim,\"\").replace(/<!--.*?-->/gim,\"\").replace(/<\\s*a[^>]*href=['\"](.*?)['\"][^>]*>([\\s\\S]*?)<\\/\\s*a\\s*>/gi,\"$2 ($1)\").replace(/&([^;]+);/g,decodeHtmlEntity)}", "title": "" }, { "docid": "665744d273ec3bded77480211088bdea", "score": "0.5296757", "text": "function getBody(content) \r\n{\r\n test = content.toLowerCase(); // to eliminate case sensitivity\r\n var x = test.indexOf(\"<body\");\r\n if(x == -1) return \"\";\r\n\r\n x = test.indexOf(\">\", x);\r\n if(x == -1) return \"\";\r\n\r\n var y = test.lastIndexOf(\"</body>\");\r\n if(y == -1) y = test.lastIndexOf(\"</html>\");\r\n if(y == -1) y = content.length; // If no HTML then just grab everything till end\r\n\r\n return content.slice(x + 1, y); \r\n}", "title": "" }, { "docid": "db009afd9af6e84acd2506d5f3c6d141", "score": "0.52926344", "text": "render(sel) {\n var fragment = this.fragment;\n var html = cobalt.html.render(fragment);\n this.container.innerHTML = html+\"\\n\";// extra \\n is to give the browser room for a cursor\n if (sel) {\n var editor = this;\n editor.selection.set(editor, sel.range, sel.cursor);\n if (editor.debug) {\n editor.debug.innerText = '['+sel.range.start+','+sel.range.end+\"]\\n\"+fragment;\n }\n }\n }", "title": "" }, { "docid": "ced5a612ecf7836b6379c04783cadb12", "score": "0.52828646", "text": "getPreContent() {}", "title": "" }, { "docid": "8f398e1c35c134021e1dcaf3db16e4a9", "score": "0.5281398", "text": "function createHTMLFragment(node, html) {\n var fragment;\n var document = node.ownerDocument;\n var container = document.createElement('template');\n var hasContent = 'content' in container;\n var needsTableWrap = false;\n if (!hasContent) {\n // DO NOT MOVE THE FOLLOWING LINE ELSEWHERE\n fragment = document.createDocumentFragment();\n // (a jsdom + nodejs tests coverage gotcha)\n\n // el.innerHTML = '<td></td>'; is not possible\n // if the content is a partial internal table content\n // it needs to be wrapped around once injected.\n // HTMLTemplateElement does not suffer this issue.\n needsTableWrap = /^[^\\S]*?<(t(?:head|body|foot|r|d|h))/i.test(html);\n }\n if (needsTableWrap) {\n // secure the RegExp.$1 result ASAP to avoid issues\n // in case a non-browser DOM library uses RegExp internally\n // when HTML content is injected (basicHTML / jsdom / others...)\n var selector = RegExp.$1;\n container.innerHTML = '<table>' + html + '</table>';\n appendNodes(fragment, slice.call(container.querySelectorAll(selector)));\n } else {\n container.innerHTML = html;\n if (hasContent) {\n fragment = container.content;\n } else {\n appendNodes(fragment, slice.call(container.childNodes));\n }\n }\n return fragment;\n }", "title": "" }, { "docid": "c8e4f3c6972446402ea47dde4c27450b", "score": "0.5267976", "text": "function outer(node, content) {\n return node.cloneNode(false).outerHTML.replace('><', '>' + content + '<');\n }", "title": "" }, { "docid": "0d542f0aa8a44b22ebc250eeabacd963", "score": "0.52635515", "text": "function setbodycontent()\n{\n\treturn true;\n}", "title": "" }, { "docid": "6c8b5954b09a589558d2c19d70381f56", "score": "0.5251451", "text": "extractTextContent(node) { return ''; }", "title": "" }, { "docid": "389c162c9b77a029cee2712b9f8d1057", "score": "0.52465725", "text": "static wrapNodeContent (node, wrapper, startPosition, endPosition) {\n if (node.nodeType === 3) {\n wrapper.textContent = node.nodeValue.slice(startPosition, endPosition)\n const nodeArray = [\n document.createTextNode(node.nodeValue.slice(0, startPosition)), // Previous to wrapper text\n wrapper.outerHTML, // Highlighted text\n document.createTextNode(node.nodeValue.slice(endPosition, node.nodeValue.length)) // After to wrapper text\n ]\n node.parentNode.insertBefore(nodeArray[0], node)\n node.parentNode.insertBefore($(nodeArray[1])[0], node)\n node.parentNode.insertBefore(nodeArray[2], node)\n node.parentNode.removeChild(node) // Remove original node\n } else {\n wrapper.innerHTML = node.nodeValue.slice(startPosition, endPosition)\n const newStringifiedContent = node.nodeValue.slice(0, startPosition) + wrapper.outerHTML + node.nodeValue.slice(endPosition, node.nodeValue.length)\n DOMTextUtils.replaceContent(node, newStringifiedContent)\n }\n }", "title": "" }, { "docid": "27779ff6a7ec0a73ce777a101c5bf735", "score": "0.5239894", "text": "reloading() {\n return async (ctx, next) => {\n let chunks = '';\n await next();\n if (this.isContentTypeRight(ctx.type)) {\n const injectHtml = await new Promise((resolve) => {\n ctx.body.on('data', chunk => {\n chunks += chunk;\n });\n ctx.body.on('end', () => {\n let val;\n if (ctx.type === 'text/html') {\n val = chunks.replace('</head>', body => {\n return socketSctipt + body;\n });\n } else if (ctx.type === 'text/markdown') {\n const conversionHtml = converter.makeHtml(chunks);\n const markdownHtml = markdownWrapDiv.replace('markdown', conversionHtml);\n val = wrapHtml.replace('</body>', body => {\n return markdownHtml + body;\n }).replace('</head>', body => {\n return codeStyle + body;\n })\n } else {\n val = wrapHtml.replace('</body>', body => {\n return `<pre style=\"word-wrap: break-word; white-space: pre-wrap;\">${chunks}</pre>` + body;\n });\n }\n resolve(val);\n })\n })\n ctx.set('Content-Type', 'text/html; charset=utf-8');\n ctx.body = injectHtml;\n }\n }\n }", "title": "" }, { "docid": "ca7d449d54c7fea06bd726e13c4e007d", "score": "0.52234733", "text": "function getRichTextEditor(divEditor, mode, objectIDToLoad, relIdToLoad, lud, contentType) \n{\n\t//Setting Editor div variables\n\tdivTextEditor = divEditor;\n\tidDivEditor = \"#\" + divTextEditor;\n\tidDivEditorTextArea = idDivEditor + \" \" + \"textarea\";\n\t\n\tobjId = objectIDToLoad;\n formatToSave = HTML_FORMAT;\n jQuery('#loadingGifFormRMT').css(\"display\", \"none\");\n getHTMLFromObject(mode, objectIDToLoad);\n}", "title": "" }, { "docid": "e02085066f5d4d1b7e0a2b93883ad1c4", "score": "0.52201664", "text": "function ContentWriter() {\n}", "title": "" }, { "docid": "e02085066f5d4d1b7e0a2b93883ad1c4", "score": "0.52201664", "text": "function ContentWriter() {\n}", "title": "" }, { "docid": "e02085066f5d4d1b7e0a2b93883ad1c4", "score": "0.52201664", "text": "function ContentWriter() {\n}", "title": "" }, { "docid": "56c59d907cf93254740a8c9d785ff24a", "score": "0.5218437", "text": "createBuffer() {\n return document.createDocumentFragment();\n }", "title": "" }, { "docid": "3932200e3a441b0ab54a451e0ecaa406", "score": "0.5202821", "text": "createMarkup (post){\n return {__html: post }\n }", "title": "" }, { "docid": "c1f423310949ffa7a775496c9029210b", "score": "0.52025485", "text": "function showHTMLInIFrame() {\n\t document.getElementById('results').innerHTML = (\"<iframe src=\" +\n\t \"data:text/html,\" + encodeURIComponent(editor.getValue()) +\n\t \t\" width='275px' height='350px' id='content'></iframe>\");\n\t }", "title": "" }, { "docid": "faad6b817b6bb5a63acf26231173273a", "score": "0.52019864", "text": "render() {\n return <React.Fragment>{this.renderContent()}</React.Fragment>;\n }", "title": "" }, { "docid": "db111bf6c878bd5bdba1f1a76c0ca9f9", "score": "0.5196821", "text": "toPreview(obj) {\n const string = obj.content || ''\n return `<div class=\"box\"><div class=\"box-content\">${string}</div></div>`\n }", "title": "" }, { "docid": "4df983d28388f70ff01edbcf8e94d0e9", "score": "0.51968044", "text": "function _renderContent() {\n\n // Define content\n var content = _selected === false ? \"\" : _found[_selected].content;\n\n // Insert content\n _$article.html(content.trim() || \"\").promise().done(function() {\n\n // Perform highlighting\n _$article.children().each(function() {\n var $el = $(this);\n if ($el.text().indexOf(_TEXT_CITE) >= 0) {\n $el.addClass(_CLASS_CITE);\n }\n });\n });\n }", "title": "" }, { "docid": "ede692cfcfef207d99e055dbb505765a", "score": "0.5188795", "text": "function setHTML()\r\n{\r\n editor().innerHTML=txthtml().value;\r\n}", "title": "" }, { "docid": "c8c68051ef4357ca32d6b44900caf5fa", "score": "0.518775", "text": "function renderContent() {\n var content = document.getElementById('content_' + selected);\n // Initialize the pane.\n if (content.id == 'content_blocks') {\n // If the workspace was changed by the XML tab, Firefox will have performed\n // an incomplete rendering due to Blockly being invisible. Rerender.\n Blockly.mainWorkspace.render();\n } else if (content.id == 'content_xml') {\n var xmlTextarea = document.getElementById('textarea_xml');\n var xmlDom = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);\n var xmlText = Blockly.Xml.domToPrettyText(xmlDom);\n xmlTextarea.value = xmlText;\n xmlTextarea.focus();\n /*} else if (content.id == 'content_javascript') {\n content.innerHTML = Blockly.Generator.workspaceToCode('JavaScript');\n } else if (content.id == 'content_dart') {\n content.innerHTML = Blockly.Generator.workspaceToCode('Dart');\n } else if (content.id == 'content_python') {\n content.innerHTML = Blockly.Generator.workspaceToCode('Python');*/\n } else if (content.id == 'content_propc') {\n //content.innerHTML = Blockly.Generator.workspaceToCode('Arduino');\n var propcTextarea = document.getElementById('textarea_propc');\n propcTextarea.value = Blockly.Generator.workspaceToCode('propc');\n propcTextarea.focus();\n }\n}", "title": "" } ]
8adc936ee0496b4efc5412fae5c0c37e
Explaination of why this search parameter is needed and why it has been designed as it has.
[ { "docid": "555684abd0fda295fb538ebce244e108", "score": "0.0", "text": "get purpose() {\n\t\treturn this.__purpose;\n\t}", "title": "" } ]
[ { "docid": "22d2b935e16e383ab7ef137c22786cce", "score": "0.6709997", "text": "function notSearchParam(key) {\n\t\t\t\t\t\t\t\treturn fromAndToState.params[key].location != \"search\";\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "3740d3a46f50da7957d6fc0060419013", "score": "0.65336186", "text": "supportsSearch() { return false; }", "title": "" }, { "docid": "13013ac116c83e621737d372563aad12", "score": "0.64387184", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "7815c131323be262c895672b67e9c3e2", "score": "0.64249593", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "e3d92c1f551dc294549461d8fb4e7824", "score": "0.64130795", "text": "function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }", "title": "" }, { "docid": "c697a125b4643aa2f29fcc30883d24be", "score": "0.6291325", "text": "function search() {}", "title": "" }, { "docid": "c2afb085c2946f7286753568a9e0d977", "score": "0.62421215", "text": "function notSearchParam(key){return fromAndToState.params[key].location != \"search\";}", "title": "" }, { "docid": "3b9d0716de7dd7a129975dbbef6b842a", "score": "0.6237104", "text": "searchParameter() {\n return this.resourceName + '_search'\n }", "title": "" }, { "docid": "56cf5a295d75ff666c556b0162244bb9", "score": "0.61442995", "text": "function notSearchParam(key){return fromAndToState.params[key].location!=\"search\";}", "title": "" }, { "docid": "94f9e4634c9469c78654b4dd526ca29f", "score": "0.60715604", "text": "search(value, search)\n\t{\n\t\treturn false;\n\t}", "title": "" }, { "docid": "17777c18e9d00de914066dbcf2a95ad6", "score": "0.59365714", "text": "function searchForListings(searchTerm) {\n \n}", "title": "" }, { "docid": "a055273737a67f94104540ba6781e490", "score": "0.59152997", "text": "search(value) {\n\t}", "title": "" }, { "docid": "d71d0ac071852e2e9ede5dd8b9b3d6e2", "score": "0.5888189", "text": "static get __resourceType() {\n\t\treturn 'SearchParameter';\n\t}", "title": "" }, { "docid": "548eb24feeac3a05689cd2b029407e97", "score": "0.58452076", "text": "function SearchWrapper() {}", "title": "" }, { "docid": "5d15cf5ab489842e31cedf2ca68db0ea", "score": "0.5808104", "text": "function getTypeAheadParams() {\n var search = clone(SEARCH_OBJECT),\n size = 3,\n i;\n\n if (arguments.length > 0) {\n if (arguments.length < 3) {\n size = arguments.length;\n }\n\n for (i = 0; i < size; i++) {\n switch (i) {\n case 0:\n if (!isNaN(arguments[i])) {\n search.limit = arguments[i];\n }\n\n break;\n\n case 1:\n if (!isNaN(arguments[i])) {\n search.offset = arguments[i];\n }\n\n break;\n\n case 2:\n search.key = arguments[i];\n break;\n }\n }\n }\n\n return search;\n }", "title": "" }, { "docid": "88d50f6c760e86bc709098987da6f9d7", "score": "0.5790758", "text": "function addSearchQueryParameter(parameters, terms) { // 1\n if (!!terms.query) { // 2\n var parameters = Telescope.utils.deepExtend(true, parameters, { // 3\n find: { // 4\n $or: [{ title: { $regex: terms.query, $options: 'i' } }, { url: { $regex: terms.query, $options: 'i' } }, { body: { $regex: terms.query, $options: 'i' } }]\n } //\n }); //\n } //\n return parameters; // 13\n} //", "title": "" }, { "docid": "1e25c331c7afe9b0d19ef251798bc455", "score": "0.5769147", "text": "function search(people) {\r\n\t\t\r\n\t}", "title": "" }, { "docid": "a9ac0d39fa2c41f88d22945d662fe898", "score": "0.5712768", "text": "searching(searchValue) {\n this.searchValue = searchValue || '';\n }", "title": "" }, { "docid": "77009bec7fe200f99605e90fbff26995", "score": "0.56957895", "text": "static search(){}", "title": "" }, { "docid": "e696de0cedb96cbc6789b8b56cafdc29", "score": "0.5694169", "text": "currentSearch() {\n return this.$route.query[this.searchParameter] || ''\n }", "title": "" }, { "docid": "7ebe96e867fdd706a46a9a11bebf2366", "score": "0.5688165", "text": "get searchThreshold() {\n return this._searchThreshold;\n }", "title": "" }, { "docid": "d6efd2752e84ab9a8f28d42909eb28d7", "score": "0.56733716", "text": "getSearchParams() {\n return this._currentSearchParams.getValue();\n }", "title": "" }, { "docid": "4738cc261cb45e3005bdfc6a92687a19", "score": "0.5631928", "text": "function normalSearch() {\n vm.defaultQueryFilters = {};\n\n if (angular.isFunction(vm.applyFilters)) vm.defaultQueryFilters = vm.applyFilters(vm.defaultQueryFilters);\n if (angular.isFunction(vm.beforeSearch) && vm.beforeSearch() === false) return false;\n\n modelService.query(vm.defaultQueryFilters).then(function (response) {\n vm.resources = response;\n\n if (angular.isFunction(vm.afterSearch)) vm.afterSearch(response);\n });\n }", "title": "" }, { "docid": "02daadac45ae94f29efd951526998d9d", "score": "0.56115633", "text": "search(){\n\n }", "title": "" }, { "docid": "79bf8b1b598ed15fbf1eebd95fbb6317", "score": "0.56052005", "text": "getSearchParameters(searchParameters) {\n return searchParameters;\n }", "title": "" }, { "docid": "38432b4dc75ee8baac1b2ef4ccd28fd1", "score": "0.5600208", "text": "generateGravsearchQuery() {\n const gravsearch = this.gravsearchGenerator.generateGravsearch(this.offset);\n if (gravsearch === false) {\n // no valid search params (application has been reloaded)\n // go to root\n this._router.navigate([''], { relativeTo: this._route });\n return;\n }\n else {\n this.searchQuery = gravsearch;\n }\n }", "title": "" }, { "docid": "e808d1f62798c66e41d54c0d2373cd81", "score": "0.5588981", "text": "getSearchParams() {\n\t \treturn this.searchParams;\n\t }", "title": "" }, { "docid": "eeb9792d19317638d85ed92619d79456", "score": "0.55627656", "text": "get searchString() {\n return this._searchString;\n }", "title": "" }, { "docid": "eeb9792d19317638d85ed92619d79456", "score": "0.55627656", "text": "get searchString() {\n return this._searchString;\n }", "title": "" }, { "docid": "dec9f7237bf4bda8d0e35c94314f2388", "score": "0.5497676", "text": "search(val) {\n if (_.isUnd(val)) val = \"\";\n var self = this;\n if (self.validateForSeach(val)) {\n // add filters inside the filters manager\n if (!val) {\n // remove filter\n self.unsetSearch();\n } else {\n self.onSearchStart(val);\n self.setSearchFilter(val);\n }\n // go to first page\n self.pagination.page = 1;\n } else {\n // value is not valid for search: remove the rule by key\n self.unsetSearch();\n }\n self.render();\n }", "title": "" }, { "docid": "a002128c7e6ce763e3e67e44da29836e", "score": "0.5427759", "text": "_listenToAdditionalParamsChange() {\n this.additionalParamsChange$.subscribe(() => {\n const { searchModel } = this.dataSource;\n const requestParams = searchModel.getRequestParams();\n const queryParams = searchModel.filtersAsQueryParams(requestParams.filters);\n Object.keys(queryParams).forEach((key) => { queryParams[key] = queryParams[key] || null; });\n // aditional params\n queryParams.orderby = this.dataSource.orderBy;\n queryParams.orderdirection = this.dataSource.orderDirection;\n queryParams.page = this.dataSource.currentPage;\n queryParams.limit = this.dataSource.pageSize;\n // If the searched text was updated, overwrite the query params and force sorting by \"score\".\n if (this.textHasChanged) {\n queryParams.orderby = '_score';\n queryParams.orderdirection = 'DESC';\n this.textHasChanged = false;\n }\n this.emitGlobal('navigate', {\n handler: 'router',\n path: [],\n queryParams,\n });\n this.facetsChange$.next();\n });\n }", "title": "" }, { "docid": "2f140e1aded4c30f3bd88f5adca53782", "score": "0.5424559", "text": "function networkOfferingGetSearchParams() {\n var moreCriteria = [];\t\n \n\tvar searchInput = $(\"#basic_search\").find(\"#search_input\").val();\t \n if (searchInput != null && searchInput.length > 0) {\t \n moreCriteria.push(\"&keyword=\"+todb(searchInput));\t \n } \n\n\tvar $advancedSearchPopup = getAdvancedSearchPopupInSearchContainer();\n\tif ($advancedSearchPopup.length > 0 && $advancedSearchPopup.css(\"display\") != \"none\" ) {\t\n var availability = $advancedSearchPopup.find(\"#adv_search_availability\").val();\t\t\t\t\n\t if (availability!=null && availability.length > 0) \n\t\t moreCriteria.push(\"&availability=\"+todb(availability));\t\n\t\t\n\t\tvar traffictype = $advancedSearchPopup.find(\"#adv_search_traffictype\").val();\t\t\t\t\n\t if (traffictype!=null && traffictype.length > 0) \n\t\t moreCriteria.push(\"&traffictype=\"+todb(traffictype));\t \n \n\t} \t\n\t\t\n\treturn moreCriteria.join(\"\"); \n}", "title": "" }, { "docid": "1412aafa583a0335deaa10e864a11dc0", "score": "0.54210645", "text": "search(query) { \n const search_url = this.url + '/search'\n if (this.valid_search_urls.indexOf(search_url) > -1) {\n this.url += '/search'\n this.addParam(`q=${query}`)\n return this\n }else{\n throw new Error(\"You cannot search in this query\") \n }\n }", "title": "" }, { "docid": "961213f9e084b3509e0b016f3db3930d", "score": "0.54157174", "text": "function handleSearchParam(urlObjSearchProperty = '') {\n // Explode at &, and sort search params order for consistent results\n // ?b=2&a=1&c= -> [a=1, b=2, c=]\n // ?a=1&c=&b=2 -> [a=1, b=2, c=]\n const pass = urlObjSearchProperty.replace(/^\\?/, '').split('&').sort();\n // Filter out empty elements\n // ?b=2&a=1&c= -> [a=1, b=2]\n // ?b=2&a=1&c -> [a=1, b=2]\n const pass2 = pass.map(e => e.split('='));\n const pass3 = pass2.filter(e => Boolean(e[1]));\n const pass4 = pass3.map(e => e.join('/'));\n const out = String('/' + pass4.join('/')).replace(/pageI?d?/i, 'page');\n return (/^\\/$/.test(out)) ? '' : out;\n}", "title": "" }, { "docid": "378dada9ad23b8f846409adf12b8733d", "score": "0.5397803", "text": "onSearchEmpty() {}", "title": "" }, { "docid": "29e228b47237401310c548524018029c", "score": "0.5384018", "text": "getSearchText() {\n\t \treturn this.searchText;\n\t }", "title": "" }, { "docid": "83c85b5fa9bc84e68ffd72116139ccaf", "score": "0.5361403", "text": "checkLocationQuery() {\n const location = new URL(window.location.href);\n if (location.searchParams.has(\"q\")) {\n const queryParam = location.searchParams.get(\"q\").trim();\n if (queryParam !== \"\") {\n // Put the query into the input field\n const searchEl = document.getElementById(\"search-query\");\n if (searchEl) {\n searchEl.value = queryParam;\n // Execute the search if the index is loaded, otherwise defer the search\n if (this.isIndexLoaded()) {\n this.search();\n } else {\n this.deferredQuery = queryParam;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "b1b428aa7ef2a78abe549c55fd7e7b93", "score": "0.53484374", "text": "function searchByAuthor(author) {\n // TODO\n}", "title": "" }, { "docid": "cae890dedf9b74b6dd6b634e8fd0d53b", "score": "0.53298783", "text": "getSearchParam(name, def) {\n return searchParam(name, this._target.href) ?? def ?? null;\n }", "title": "" }, { "docid": "dc20ecd462a187ac58a103569c55b046", "score": "0.53081137", "text": "checkTopStoriesSearchTerm(searchTerm){\n return !this.state.results[searchTerm];\n }", "title": "" }, { "docid": "bad8ef8c48d361f5c9a8bb79aed87ff9", "score": "0.5304614", "text": "function setSearched() {\n setSymbolSearchBool(true);\n }", "title": "" }, { "docid": "e209dd48c1fd958ccd4ee945dce787ae", "score": "0.5285573", "text": "_search (defaultSearchQuery, dataPage, ignoreInputText, activeOnlyChanged) {\n // before we initiate the search, let's initialise this._activeOnly if this autocompletion happens from an Entity Master\n if (this.asPartOfEntityMaster) {\n const storedActiveOnly = localStorage.getItem(localStorageKey(`${this.autocompletionType}_${this.propertyName}_activeOnly`));\n if (storedActiveOnly !== null) {\n this._activeOnly = storedActiveOnly === 'true';\n }\n }\n // cancel any other search\n this._cancelSearchByOtherEditor();\n // What is the query string?\n let inputText = ''; // default value\n if (this.multi === false) {\n // assign the actual search string\n inputText = ignoreInputText === true ? defaultSearchQuery : this._prepInput(this.decoratedInput().value) || defaultSearchQuery;\n } else {\n // The following manipulations with indexes are required in case of multi selection\n // in order to determine what part of the input text should be used for search and\n // also for later insertion of selected values (this._replaceFromIndex and this._replaceToIndex govern this).\n\n const text = this.decoratedInput().value;\n const caretPos = this.decoratedInput().selectionStart;\n const toIndex = text.indexOf(this.separator, caretPos) < 0 ? text.length : text.indexOf(this.separator, caretPos);\n const startOfText = text.substring(0, caretPos);\n const fromIndex = startOfText.lastIndexOf(this.separator) < 0 ? -1 : startOfText.lastIndexOf(this.separator); // just to make sure that it is -1\n\n this._replaceFromIndex = fromIndex; // can be negative, which requires special treatment in _done() for selecting the correction portion of the input text\n this._replaceToIndex = toIndex;\n\n // assign the actual search string\n inputText = ignoreInputText === true ? defaultSearchQuery : this._prepInput(text.substring(fromIndex + 1, toIndex).trim()) || defaultSearchQuery;\n }\n\n // prep this.searchQuery for highlighting of the matching parts in the search result\n if (!inputText) {\n this._searchQuery = \"\";\n } else {\n this._searchQuery = replaceAll('*', '%', inputText);\n }\n\n if (this._searchQuery) {\n // prepare the AJAX request based on the raw search string\n const contextHolder = this.createContextHolder(this._searchQuery, dataPage);\n if (this._activeOnly !== null) {\n contextHolder.customObject[AUTOCOMPLETE_ACTIVE_ONLY_KEY] = this._activeOnly;\n if (activeOnlyChanged) {\n contextHolder.customObject[AUTOCOMPLETE_ACTIVE_ONLY_CHANGED_KEY] = activeOnlyChanged;\n }\n }\n const serialisedSearchQuery = this.$.serialiser.serialise(contextHolder);\n this._ignoreInputText = ignoreInputText === true; // capture ignoreInputText for its use in _loadMore\n this.$.ajaxSearcher.body = JSON.stringify(serialisedSearchQuery);\n this.$.ajaxSearcher.generateRequest();\n } else if (this.result && this.result.opened) { // make sure overlay is closed if no search is performed\n this.result.close();\n this._focusInput();\n }\n }", "title": "" }, { "docid": "f72bbe8254e38eb177de5a8c764b7d95", "score": "0.5268987", "text": "onSearchStart(val) {}", "title": "" }, { "docid": "1eea4bf8b0fa7582554e30027eab865e", "score": "0.5257807", "text": "getDisplayInSearch() {\n\t \treturn this.displayInSearch;\n\t }", "title": "" }, { "docid": "e59641ca9b24bd662cd06e3e4b57fffe", "score": "0.5239468", "text": "function isUrlSearchParams(value) {\n return typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams;\n }", "title": "" }, { "docid": "d574a32c3b2fbe253b6abdc65b9433ae", "score": "0.52372026", "text": "function createSearchRequest() {\n\n\n\n}", "title": "" }, { "docid": "803832e1f4a6d015318f05b63155e962", "score": "0.5236208", "text": "_handleSearch(event) {\n var filter = event.detail.value;\n var column = event.detail.column;\n var columns = event.detail.searchFields; // console.log(columns);\n // delete any previous column and general search query\n\n this.deleteParamKeys(columns.concat(['q']), false); // update new search query param\n\n this.updateParams(column, filter);\n }", "title": "" }, { "docid": "d8f29f606d134cccc28001a1c9499495", "score": "0.52310395", "text": "function main(request, query) {\n searchThis(request, query);\n}", "title": "" }, { "docid": "41cadab34b21c46f7809720cb0d729df", "score": "0.5222913", "text": "searchKeyword(term, page){ return this.searchWrapper(term, 'keyword', {page : page ? page : 1}); }", "title": "" }, { "docid": "7f5ba42fbe96008546a1f582c3a32966", "score": "0.5218723", "text": "getSearchableOnEntry() {\n\t \treturn this.searchableOnEntry;\n\t }", "title": "" }, { "docid": "96d20aaf67ac8894792bc6064041973d", "score": "0.5216614", "text": "function handleSearchParams() {\n var searchParams = {};\n try {\n // Thanks to https://developer.mozilla.org/en-US/docs/Web/API/URLUtils/search for the following block of code\n if (win.location.search.length > 1) {\n for (var aItKey, nKeyId = 0, aCouples = win.location.search.substr(1).split(\"&\"); nKeyId < aCouples.length; nKeyId++) {\n aItKey = aCouples[nKeyId].split(\"=\");\n searchParams[decodeURIComponent(aItKey[0])] = aItKey.length > 1 ? decodeURIComponent(aItKey[1]).replace(/_/g, \" \") : \"\";\n }\n }\n } catch (err) {\n console.error('Error trying to process search parameters');\n console.error(location.search);\n return;\n }\n\n if (typeof searchParams.cat !== 'undefined') {\n // Go to the categories page\n changeTab('categories');\n if (searchParams.cat !== '') {\n // Go to the search page, but fill it with all info in the specified category\n categorySearch(searchParams.cat);\n }\n } else if (typeof searchParams.search !== 'undefined') {\n // Go to the search page\n changeTab('search');\n if (searchParams.search) {\n try {\n // Perform a search with the given parameter\n var query = decodeURIComponent(searchParams.search);\n generalSearch(query);\n doc.querySelector('.info-search-box').value = searchParams.search;\n } catch (err) {\n console.error('Error trying to search');\n console.error(searchParams.search);\n }\n }\n } else if (typeof searchParams.info !== 'undefined') {\n collapseAllItems();\n if (searchParams.info) {\n // Expand card\n try {\n var infoElement = doc.querySelector('.page-info .info-card[data-title=\"' + searchParams.info + '\"]');\n infoElement.classList.add('expanded');\n ga('send', 'event', 'Info Card', 'open-from-param', info[searchParams.info].title);\n addCardInfo(infoElement, info[searchParams.info]);\n infoElement.scrollIntoView({\n block: 'start',\n behavior: 'smooth'\n });\n try {\n if (searchParams.highlight) {\n var indicies = searchParams.highlight.split(',');\n indicies.forEach(function(index) {\n ga('send', 'event', 'Info Card Highlight', 'highlight-from-param', info[searchParams.info].title, Number.parseInt(index));\n var infoArray = infoElement.querySelectorAll('.information p');\n infoArray[index - 1].classList.add('highlighted');\n });\n }\n } catch (e) {\n console.error('Highlighting failed. ' + e);\n }\n } catch (err) {\n console.error('Failed to open card with title ' + searchParams.info + '. ' + err);\n }\n }\n } else if (typeof searchParams.element !== 'undefined') {\n // Go to the elements page\n changeTab('elements');\n if (searchParams.element) {\n // Expand the specified element\n try {\n var element = doc.querySelector('.page-elements .element-card[data-name=\"' + searchParams.element + '\"]');\n element.classList.add('expanded');\n ga('send', 'event', 'Element Card', 'open-from-param', info[searchParams.element].title);\n addResourceInfo(element, resources[searchParams.element]);\n element.scrollIntoView({\n block: 'start',\n behavior: 'smooth'\n });\n } catch (err) {\n console.error('Failed to open element with name ' + searchParams.element + '. ' + err);\n }\n }\n } else if (typeof searchParams.links !== 'undefined') {\n // Go to the links page\n changeTab('links');\n if (searchParams.links) {\n try {\n var heading = doc.querySelector('h2[data-title=\"' + searchParams.links + '\"]');\n heading.scrollIntoView({\n block: 'start',\n behavior: 'smooth'\n });\n } catch (err) {\n console.error('Failed to open element with name ' + searchParams.element + '. ' + err);\n }\n }\n } else {\n changeTab('main'); // Just go to default spot\n }\n }", "title": "" }, { "docid": "e4dbb6ce4f1e9379bf6d7838031fff30", "score": "0.5204905", "text": "function SearchResults(name, mode) {\n /*\n var: mode\n The mode the search is going to work in, such as \"HTML\" or \"FramedHTML\".\n */\n this.mode = mode;\n\n /*\n var: lastMatchCount\n The number of matches from the last run of <Search()>.\n */\n this.lastMatchCount = 0;\n\n /*\n Function: Toggle\n Toggles the visibility of the passed element ID.\n */\n this.Toggle = function(id) {\n if (this.mode == \"FramedHTML\") {\n return;\n }\n\n var parentElement = document.getElementById(id);\n\n var element = parentElement.firstChild;\n\n while (element && element != parentElement) {\n if (element.nodeName == \"DIV\" && element.className == \"ISubIndex\") {\n if (element.style.display == \"block\") {\n element.style.display = \"none\";\n } else {\n element.style.display = \"block\";\n }\n }\n\n if (element.nodeName == \"DIV\" && element.hasChildNodes()) {\n element = element.firstChild;\n } else if (element.nextSibling) {\n element = element.nextSibling;\n } else {\n do {\n element = element.parentNode;\n } while (element && element != parentElement && !element.nextSibling);\n\n if (element && element != parentElement) {\n element = element.nextSibling;\n }\n }\n }\n };\n\n /*\n Function: Search\n\n Searches for the passed string. If there is no parameter, it takes it from the URL query.\n\n Always returns true, since other documents may try to call it and that may or may not be possible.\n */\n this.Search = function(search) {\n if (!search) {\n search = window.location.search;\n search = search.substring(1); // Remove the leading ?\n search = unescape(search);\n }\n\n search = search.replace(/^ +/, \"\");\n search = search.replace(/ +$/, \"\");\n search = search.toLowerCase();\n\n if (search.match(/[^a-z0-9]/)) {\n // Just a little speedup so it doesn't have to go through the below unnecessarily.\n search = search.replace(/\\_/g, \"_und\");\n search = search.replace(/\\ +/gi, \"_spc\");\n search = search.replace(/\\~/g, \"_til\");\n search = search.replace(/\\!/g, \"_exc\");\n search = search.replace(/\\@/g, \"_att\");\n search = search.replace(/\\#/g, \"_num\");\n search = search.replace(/\\$/g, \"_dol\");\n search = search.replace(/\\%/g, \"_pct\");\n search = search.replace(/\\^/g, \"_car\");\n search = search.replace(/\\&/g, \"_amp\");\n search = search.replace(/\\*/g, \"_ast\");\n search = search.replace(/\\(/g, \"_lpa\");\n search = search.replace(/\\)/g, \"_rpa\");\n search = search.replace(/\\-/g, \"_min\");\n search = search.replace(/\\+/g, \"_plu\");\n search = search.replace(/\\=/g, \"_equ\");\n search = search.replace(/\\{/g, \"_lbc\");\n search = search.replace(/\\}/g, \"_rbc\");\n search = search.replace(/\\[/g, \"_lbk\");\n search = search.replace(/\\]/g, \"_rbk\");\n search = search.replace(/\\:/g, \"_col\");\n search = search.replace(/\\;/g, \"_sco\");\n search = search.replace(/\\\"/g, \"_quo\");\n search = search.replace(/\\'/g, \"_apo\");\n search = search.replace(/\\</g, \"_lan\");\n search = search.replace(/\\>/g, \"_ran\");\n search = search.replace(/\\,/g, \"_com\");\n search = search.replace(/\\./g, \"_per\");\n search = search.replace(/\\?/g, \"_que\");\n search = search.replace(/\\//g, \"_sla\");\n search = search.replace(/[^a-z0-9\\_]i/gi, \"_zzz\");\n }\n\n var resultRows = document.getElementsByTagName(\"div\");\n var matches = 0;\n\n var i = 0;\n while (i < resultRows.length) {\n var row = resultRows.item(i);\n\n if (row.className == \"SRResult\") {\n var rowMatchName = row.id.toLowerCase();\n rowMatchName = rowMatchName.replace(/^sr\\d*_/, \"\");\n\n if (\n search.length <= rowMatchName.length &&\n rowMatchName.substr(0, search.length) == search\n ) {\n row.style.display = \"block\";\n matches++;\n } else {\n row.style.display = \"none\";\n }\n }\n\n i++;\n }\n\n document.getElementById(\"Searching\").style.display = \"none\";\n\n if (matches == 0) {\n document.getElementById(\"NoMatches\").style.display = \"block\";\n } else {\n document.getElementById(\"NoMatches\").style.display = \"none\";\n }\n\n this.lastMatchCount = matches;\n\n return true;\n };\n}", "title": "" }, { "docid": "46ff2e242d5a45c223908d948b1b6959", "score": "0.51970524", "text": "function searchBegin() {\n\t return { type: SEARCH_BEGIN };\n\t}", "title": "" }, { "docid": "ff039cd5d8c86ec88829bfaee27ea87d", "score": "0.5196046", "text": "function searchError(err){\n console.log('Error: ' + err);\n}", "title": "" }, { "docid": "2b10ea9020326bdccb950140674bdcfe", "score": "0.51786953", "text": "Find() {}", "title": "" }, { "docid": "e04505e3e865f11307939522eaecaea7", "score": "0.5161836", "text": "getInitialQuery(searchTarget) {\n return '';\n }", "title": "" }, { "docid": "cbbe3f2815233ee6b0c56c8121587d40", "score": "0.51558065", "text": "function querySearch(queryDict) {\n type = queryDict[\"type\"];\n $('#type option[value=\"' + type + '\"]').prop('selected', true);\n //getbaseline();\n if (queryDict[\"startyear\"]) { startYear = queryDict[\"startyear\"]; }\n if (queryDict[\"endyear\"]) { endYear = queryDict[\"endyear\"]; }\n for (var search in queryDict) {\n if(search.match(/q/)) {\n term = decodeURIComponent(queryDict[search])\n dosearch(term);\n }\n }\n}", "title": "" }, { "docid": "0813fd14e864a7f3a6c50a7b76229de6", "score": "0.5154407", "text": "search() {\n // If there is no index, we don't want to search\n if (!this.isIndexLoaded()) {\n console.error(\"search(): search index has not been loaded; unable to search\");\n return;\n }\n let query = \"\";\n const searchEl = document.getElementById(\"search-query\");\n if (searchEl) {\n query = searchEl.value;\n }\n // Only trigger a search when 2 chars. at least have been provided\n if (query.length < 2) {\n console.error(\"search(): query must be at least 2 characters in length\");\n return;\n }\n // Clear the existing search results\n this.clearResults();\n // Update the status\n this.updateStatus(\"Searching...\");\n // Optional: add some fuzzyness to the string matching to help with spelling mistakes.\n // const fuzzLength = Math.round(Math.min(Math.max(query.length / 4, 1), 3));\n // const fuzzyQuery = query + '~' + fuzzLength;\n // Perform the search and display the results\n const results = this.lunrSearch(query);\n this.updateResultCount(results.length);\n this.renderResults(results, this.parseSearchTerms(query));\n this.updateStatus(\"\");\n }", "title": "" }, { "docid": "99bcc88ca941091e30afd1094a361884", "score": "0.51423144", "text": "function handleNormalSearch(query) {\n console.log(\"doing normal search with query: \" + query);\n // TODO: you should do normal search here\n}", "title": "" }, { "docid": "b4d3a12834cb2b8c60923164d8862ece", "score": "0.5139942", "text": "function conductNameOnlySearchInstead() {\r\n \r\n\t//build url\r\n\tvar filterStr = buildSearchFilter(urlParamName, null, null, null, null, null);\r\n\t\r\n\t//Remove parameters from the url so that search within works correctly. \r\n\turlParamCity = null;\r\n\turlParamAddress = null;\r\n\turlParamFdic = null;\r\n\turlParamZip = null;\r\n\turlParamState = null;\r\n\r\n\tvar sUrl = APP_SERVER_HOST_PREFIX + CONTEXT_ROOT + \"/Bank?$format=json&$inlinecount=allpages&$filter=\" + filterStr + \"&$callback=?\";\r\n\toTable.fnReloadAjax(sUrl);\r\n\tnameOnlySearch = true;\r\n}", "title": "" }, { "docid": "e7c5b053d8884a7a8445beaae3ff8520", "score": "0.51375085", "text": "function GetQueryStringParameters() {\n currentvideo = getQueryStringParam(\"v\");\n currentsrc = getQueryStringParam(\"vsrc\");\n currentpage = getQueryStringParam(\"vpage\");\n kcw_movies.search = getQueryStringParam(\"vsearch\");\n\n if (currentpage == null) currentpage = 1;\n if (kcw_movies.search == null) kcw_movies.search = \"\";\n }", "title": "" }, { "docid": "af915a65673af09d1f812b4e7e8d81c8", "score": "0.5137068", "text": "function findUnflaggedParam() {\n unflaggedOptionCount++;\n var count = 0;\n for(var j = 0; j < parser._params.length; j++){\n var param = parser._params[j];\n if(param.flags == null)\n if(param.multiple || unflaggedOptionCount == ++count)\n return param;\n }\n error('unexpectedValue', { message: 'No value expected: ' + args[i], parser: parser, index: i, value: args[i] });\n }", "title": "" }, { "docid": "2f02863104dfd30c84bd3d6611f3b9e1", "score": "0.51345026", "text": "validateForSeach (val) {\n if (!val) return false;\n var minSearchChars = this.options.minSearchChars;\n if (val.match(/^[\\s]+$/g) || (_.isNumber(minSearchChars) && val.length < minSearchChars)) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "8cd18a603a01b7e8a4cca17d4615d82c", "score": "0.51331663", "text": "function valid_search(){\n\tvar x=document.forms[\"engine\"][\"search\"].value\n\tif (x==null || x==\"\"){\n\t\talert(\"\\t\\tWARNING!\\nYou haven't searched for anything\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "4b9494f00669b38798c14c9296b87273", "score": "0.5132239", "text": "addSearchFound() { this.searchFound.value++; this.updateHitStat(this.searchFound); }", "title": "" }, { "docid": "ad6d21baa758d0f7d2984d4e8ab6bd70", "score": "0.5131612", "text": "function map_search() { }", "title": "" }, { "docid": "63a66ab09c533a503f29aaa940ffde3c", "score": "0.51198894", "text": "initializeSearchFromQueryString() {\n this.search = this.currentSearch\n }", "title": "" }, { "docid": "1197133a4022bc1715d43a2b1147ebc8", "score": "0.5112943", "text": "function staticFiltersParametricsApply()\n{\n\tsetSearchTermOntoSearchString();\n\tparametrics_doFilteredSearch();\n}", "title": "" }, { "docid": "4789b23b9f0b5a3b036254a56259b2c5", "score": "0.51116365", "text": "search(value, search)\n\t{\n\t\tif (value === null || search.value === null)\n\t\t\treturn value === search.value;\n\t\telse\n\t\t\treturn value.search(search);\n\t}", "title": "" }, { "docid": "79ccf9da10e62fd558ccbf9d7c7c4ff5", "score": "0.5110539", "text": "function getSearchParameters() {\n var paramStr = window.location.search.substr(1);\n return paramStr != null && paramStr != \"\" ? transformToAssocArray(paramStr) : {};\n}", "title": "" }, { "docid": "5b4703f2e914791e82fc2e93c1e27408", "score": "0.5109413", "text": "function setSearchTermOntoSearchString()\n{\n\tvar searchStringElement = document.getElementById('searchwithinRange');\n\tif (searchStringElement != null) \n\t{\n\t\tvar searchString = searchStringElement.value;\n\t\tvar searchwithinRangeTextElement = document.getElementById('searchwithinRangeText');\n\t\t// only do something if we have a search term and it isn't the default one.\n\t\tif (searchString.length > 0 && searchString != searchwithinRangeTextElement.value)\n\t\t{\n\t\t\tparametrics_updateSearchStringWithSeparator('updateValue', 'gensearch', \"Ntk\", \"|\");\n\t\t\tparametrics_updateSearchStringWithSeparator('updateValue', searchString, \"Ntt\", \"|\");\n\t\t\tparametrics_updateSearchStringWithSeparator('updateValue', 'mode+matchallpartial', \"Ntx\", \"|\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fe74b9577836dd9fdbaebbd5f4a3f85d", "score": "0.51087314", "text": "function Search()\n{\n\tvar index = checkIndex();\n\tvar query =\"search\";\n\tif(CheckParameter(query,index))\n\t{\n\t\tvar params = Packer(query,index);\n\t\tSendData(myxmlhttp,params);\n\t}\n\tResetInput(index);\n}", "title": "" }, { "docid": "0c707244f5379dd8671eb84a5fccf48d", "score": "0.5108119", "text": "decideIfUpdateSearch (val) {\n return val === this.searchField.value\n ? this.props.setSearch(val)\n : undefined\n }", "title": "" }, { "docid": "cd7bc650270f5f23544c27aa534125e5", "score": "0.51041114", "text": "urlParameterQuestion() {\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n if(urlParams.has('q')){\n if(urlParams.get('q') < this.test.length){\n this.currentIndex = urlParams.get('q');\n }\n }\n }", "title": "" }, { "docid": "3722ee168a6c605547d1ddd88d90a622", "score": "0.5092601", "text": "function search(what, where)\n {\n what = what.toLowerCase();\n where = where.toLowerCase();\n if (where.indexOf(what)==-1)\n return false;\n else\n return true;\n }", "title": "" }, { "docid": "971eb58c91168ab2879c6f6e6ff08a03", "score": "0.50905615", "text": "function getSearchParameters() {\n\tvar prmstr = window.location.search.substr(1);\n\treturn prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n}", "title": "" }, { "docid": "c424a43d43e2ac71f434144ebc17f0ae", "score": "0.5083165", "text": "function antiSearch(){\r\n\t\tstate = false;\r\n\t\t$(\"#y-searchResults\").trigger(\"search\", false);\r\n\t}", "title": "" }, { "docid": "33024f39d2708a2259478afc4c6c69cc", "score": "0.50644815", "text": "function getSearchQuery () {\n\n return {\n type: \"input\",\n name: \"name\",\n message: \"Movie name\"\n };\n}", "title": "" }, { "docid": "80ebc96b01888b2cc9c8a144c30c91df", "score": "0.5061098", "text": "search (state) { return state.search }", "title": "" }, { "docid": "e9c76e820fd2a010b92c483f9f295de5", "score": "0.5042887", "text": "_isSearchQuery(sort) {\n const fieldArr = Object.keys(sort);\n return fieldArr.length && fieldArr[0] === \"score\";\n }", "title": "" }, { "docid": "7d470317999613e256af0f32299fda8a", "score": "0.50336856", "text": "function useQuery() {\n return new URLSearchParams(useLocation().search);\n }", "title": "" }, { "docid": "f8b4fec594cb719bae1edec04ad13a68", "score": "0.5031949", "text": "function search(){\r\n this.dataStore = [];\r\n this.top = 0;\r\n this.srpush = srpush;\r\n this.srprints = srprints;\r\n this.srclear = srclear;\r\n this.lsearch = lsearch;\r\n this.binaryS = binaryS;\r\n // this.bsearch = bsearch;\r\n}", "title": "" }, { "docid": "911c984ee247b0d066f4bcc315dc5fa4", "score": "0.50317", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n}", "title": "" }, { "docid": "911c984ee247b0d066f4bcc315dc5fa4", "score": "0.50317", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n}", "title": "" }, { "docid": "ffcedd938dff0f05f7e1e880a38ccc9c", "score": "0.50314516", "text": "function search(params) {\n //check if AIS layer is currently being displayed\n if (!isAISLayerDisplayed()) {\n alert('AIS layer is not being displayed. Please add layer before performing search');\n return;\n }\n\n //TODO: handle searches incoming from OWF search widget, indicated by defined params object\n if (typeof params !== 'undefined') {\n //incoming search from OWF widget\n //TODO: parse parameters\n\n //TODO: pan map to requested search region\n }\n\n //clear previous search\n if ($('#clearSearch').length > 0) {\n $('#clearSearch').remove();\n }\n\n if (advancedSearchEnabled) {\n $('#search').attr('placeholder', 'Advanced search filtering enabled');\n searchTerm = $('#searchMMSI').val();\n \n //TODO: handle the other advanced search fields\n \n }\n else {\n $('#search').attr('placeholder', 'Search for Vessels (MMSI, IMO, vessel name, call sign, or destination)');\n //Grab search terms and store to global var\n searchTerm = $('#search').val();\n }\n\n //Adjust global result count\n\n //Easter Egg\n if (searchTerm.toLowerCase() == '/clippy') {\n loadClippy();\n return;\n }\n\n dataLayers.forEach( function(dataLayer) {\n if (dataLayer.layerID == 'aisLayer') {\n updateGlobalResultCount(null, dataLayer.resultCount);\n }\n });\n\n //Force update AIS data layer only, which will handle the search mode and search terms\n refreshLayers('aisLayer', null);\n\n\n //Add a search cancel button\n $('#advancedSearchToggle').before('<span id=\"clearSearch\" class=\"form-control-feedback noselect glyphicon glyphicon-remove\"></span>');\n\n //handle search cancel button\n $('#clearSearch').click( function(event) {\n $('#search').val('');\n $('#search').attr('placeholder', 'Search for Vessels (MMSI, IMO, vessel name, call sign, or destination)');\n clearSearch();\n $(this).remove();\n\n //Get regular AIS layer displayed\n refreshLayers('aisLayer', null);\n });\n\n}", "title": "" }, { "docid": "885a56e5c973195fe4144bbd26f47455", "score": "0.5029164", "text": "isQuerySearch(term) {\n // Build bang from search term if exists\n let shorthand = term.split(':')[0] + ':';\n let links = this.files\n .filter(x => x instanceof launchquery_1.LaunchQuery)\n .map(x => x.toString());\n for (let i = 0; i < links.length; i++) {\n if (links[i] == shorthand) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "a27cfb129058feb3c73cfdcba4c53ce1", "score": "0.5026375", "text": "function startSearch(options){}", "title": "" } ]
d41b97ff581eb5b907a2f9467d491118
Checks whether an element has an attribute.
[ { "docid": "98bea92e7b977e099bf36ef575468de1", "score": "0.75149155", "text": "function hasAttrib(elem, name) {\n return elem.attribs != null && Object.prototype.hasOwnProperty.call(elem.attribs, name) && elem.attribs[name] != null;\n}", "title": "" } ]
[ { "docid": "44ac0166cbe05f95605eb0312b626452", "score": "0.84899765", "text": "function hasAttribute(el, attribute) {\n return el.getAttribute(attribute) != null;\n }", "title": "" }, { "docid": "b68fadd82f7fe63a843239b155daf390", "score": "0.8174133", "text": "function hasAttr (attr){\r\n var elem = wrapper(this)[0];\r\n return ((null != elem.getAttribute(attr)) && (undefined != elem.getAttribute(attr)));\r\n }", "title": "" }, { "docid": "cd3f432248d98f3fa19e74edd06988c3", "score": "0.7755367", "text": "function hasAttribute(elem,attr) { \n var isset;\n try {\n eval(\"isset=typeof elem.\"+attr+\"!='undefined';\");\n }catch(e){\n isset=false;\n }\n return isset;\n}", "title": "" }, { "docid": "0202755caa49100f44fb8cf72c98e1ba", "score": "0.7552534", "text": "function element_has(attribute, element) {\n /**\n * An element has an attribute A if its attribute list contains A.\n */\n return element._attributeList._asArray().indexOf(attribute) !== -1;\n}", "title": "" }, { "docid": "077e3f0a0d5afc45cb59a3bddfc21517", "score": "0.7550486", "text": "function hasAttrib$1(elem, name) {\n return (elem.attribs != null &&\n Object.prototype.hasOwnProperty.call(elem.attribs, name) &&\n elem.attribs[name] != null);\n}", "title": "" }, { "docid": "e655944bfbfd2eca28a6b11b7791dc5a", "score": "0.7544662", "text": "function hasAttr(elem, find) { \n return elem.attr(find) !== undefined;\n}", "title": "" }, { "docid": "e5823173068084cc64fe8a833b6818c9", "score": "0.75228316", "text": "function hasAttrib(elem, name) {\n return (elem.attribs != null &&\n Object.prototype.hasOwnProperty.call(elem.attribs, name) &&\n elem.attribs[name] != null);\n}", "title": "" }, { "docid": "e5823173068084cc64fe8a833b6818c9", "score": "0.75228316", "text": "function hasAttrib(elem, name) {\n return (elem.attribs != null &&\n Object.prototype.hasOwnProperty.call(elem.attribs, name) &&\n elem.attribs[name] != null);\n}", "title": "" }, { "docid": "b749cdd80f2a3d8003b6ed76b20995b5", "score": "0.75039166", "text": "function hasAttr(a) { \n return function(index) { \n var attr = $(this).attr(a);\n return (typeof attr !== 'undefined' && attr !== false) ? true : false;\n };\n }", "title": "" }, { "docid": "f6cca23b6ebf096abe9f056d335d89e5", "score": "0.74775255", "text": "function hasAttrib$1(elem, name) {\n\t return (elem.attribs != null &&\n\t Object.prototype.hasOwnProperty.call(elem.attribs, name) &&\n\t elem.attribs[name] != null);\n\t}", "title": "" }, { "docid": "92a286e0e3e0334d3b989e49e02ef97e", "score": "0.74744177", "text": "function checkAttribute(element, attribute) {\n var test = document.createElement(element);\n if (attribute in test) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "ac45af6905efbfea8ea375d26bc94582", "score": "0.7407755", "text": "function hasProperty(element, name) {\n return dom.hasAttr(element, normalise(name));\n }", "title": "" }, { "docid": "1e79a22faa24bf29803969850c6f2b98", "score": "0.73204553", "text": "hasAttribute(attributeName){\n return(this.hasOwnProperty(attributeName) && this.isNotNull(this[attributeName]));\n}", "title": "" }, { "docid": "703a6b82c7c3a19ade0fe2ead45d5375", "score": "0.7173535", "text": "function elementContainsAttribute(element, attribute) {\n var elementMatch = Object(_findElementRecursive__WEBPACK_IMPORTED_MODULE_0__[\"findElementRecursive\"])(element, function (testElement) { return testElement.hasAttribute(attribute); });\n return elementMatch && elementMatch.getAttribute(attribute);\n}", "title": "" }, { "docid": "703a6b82c7c3a19ade0fe2ead45d5375", "score": "0.7173535", "text": "function elementContainsAttribute(element, attribute) {\n var elementMatch = Object(_findElementRecursive__WEBPACK_IMPORTED_MODULE_0__[\"findElementRecursive\"])(element, function (testElement) { return testElement.hasAttribute(attribute); });\n return elementMatch && elementMatch.getAttribute(attribute);\n}", "title": "" }, { "docid": "164a48d2d6d96456b724a7bc0a06abdb", "score": "0.7130186", "text": "function elementContainsAttribute(element, attribute) {\r\n var elementMatch = findElementRecursive(element, function (testElement) { return testElement.hasAttribute(attribute); });\r\n return elementMatch && elementMatch.getAttribute(attribute);\r\n}", "title": "" }, { "docid": "517a5c28e0696a0a22b39f5911e4d6e7", "score": "0.7104301", "text": "has (attribute: string): boolean {\n return this.attributes.has(attribute)\n }", "title": "" }, { "docid": "b76fd16a2fde96a143be224cc830f362", "score": "0.6939993", "text": "function elementContainsAttribute(element, attribute) {\n var elementMatch = findElementRecursive(element, function (testElement) {\n return testElement.hasAttribute(attribute);\n });\n return elementMatch && elementMatch.getAttribute(attribute);\n}", "title": "" }, { "docid": "2d8ad6c18d5b5c9e70f9dceab7512845", "score": "0.6469173", "text": "function isUndefined (attribute) {\n return (typeof (attribute) === 'undefined')\n}", "title": "" }, { "docid": "ad2e2d12592d4e603854603e0d211e6c", "score": "0.6462036", "text": "function supportsAttr(el, attr) {\n return attr in d.createElement(el);\n }", "title": "" }, { "docid": "9737ecb2e5d9d44b8d575e1b958cf748", "score": "0.64028263", "text": "function isAttributeField(field) {\n if (!field) {\n return false;\n }\n return field.startsWith(ATTRIBUTE_FIELD_PREFIX);\n }", "title": "" }, { "docid": "a8eebbaf601b625e81106ee1f05a24c6", "score": "0.6282644", "text": "attribute(name, value) {\n throw new Error(\"attribute() applies to element nodes only.\");\n }", "title": "" }, { "docid": "8051a94284b26c399f3638a560e4959d", "score": "0.62280905", "text": "function seeAttributeNode(idElement, attributeSee) {\n\n if (idElement == undefined && attributeSee == undefined) {\n console.error(`${msj.seeAttributeNode} sin parametros`);\n return false;\n }\n else if (idElement == undefined || attributeSee == undefined) {\n console.error(`${msj.seeAttributeNode} faltan parametros.`);\n return false;\n }\n else if (document.getElementById(idElement) == null) {\n console.error(`${msj.seeAttributeNode} parametro id no existe.`);\n return false;\n }\n else if (typeof(idElement, attributeSee) == 'string') {\n let element = document.getElementById(idElement);\n let attribute = element.getAttribute(attributeSee);\n\n if (attribute == null) {\n return false;\n }\n else {\n return attribute;\n }\n }\n }", "title": "" }, { "docid": "c528e4dd5a79a7966cb81afc9e1983ae", "score": "0.62105185", "text": "function isGlobalAttribute(attributeName) {\n return GLOBAL_ATTRIBUTE_SET.has(attributeName);\n}", "title": "" }, { "docid": "f41af26e12e3282813a1d22b2ec605c9", "score": "0.6200018", "text": "function hasattr(obj,attr){\n try{getattr(obj,attr);return True}\n catch(err){return False}\n}", "title": "" }, { "docid": "7efddcb484aaa43b9864b3055f134127", "score": "0.6183153", "text": "isNotKnownAttribute(attr) {\n return !(attr in this.knownAttributes);\n }", "title": "" }, { "docid": "250bdf4d40661ed149ddfc3ffa29c685", "score": "0.61741126", "text": "function isJSXAttributeOfName(attr, name) {\n return t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, { name: name });\n}", "title": "" }, { "docid": "5517db3021d17c6d36ce5552fecd12c2", "score": "0.6155887", "text": "function attribute_check(attr1, attr2, attr3) {\n var result = false;\n result = attr1 == attr2 && attr1 == attr3;\n result = result || (attr1 != attr2 && attr1 != attr3 && attr2 != attr3);\n return result;\n}", "title": "" }, { "docid": "a956ad4c54092d2ef994d32b9413af90", "score": "0.6137274", "text": "checkAttributesIn ( bal )\n {\n // console.log(\"this.expected_attributes = \",this.expected_attributes)\n for ( let attr in this.expected_attributes )\n {\n if(!this.expected_attributes.hasOwnProperty(attr)){continue}\n let val = bal.getAttribute(attr)\n if ( !val || val !== this.expected_attributes[attr] ) { return false }\n }\n return true\n }", "title": "" }, { "docid": "e0ee721eefae0462e768ea5a7289887d", "score": "0.60500073", "text": "function assert_will_be_idl_attribute(object, attribute_name, description) {\n assert_equals(typeof object, \"object\", description);\n\n assert_true(\"hasOwnProperty\" in object, description);\n\n // Do not test if |attribute_name| is not an own property because\n // |attribute_name| is in the middle of the transition to a prototype\n // chain. (http://crbug.com/43394)\n\n assert_true(attribute_name in object, description);\n}", "title": "" }, { "docid": "09ad0d222a5a078fb29ac2de1bd6c4e5", "score": "0.60455394", "text": "_hasHostAttributes(...attributes) {\n return attributes.some(attribute => this._elementRef.nativeElement.hasAttribute(attribute));\n }", "title": "" }, { "docid": "b3971fe29fec81669c9b02433c42a855", "score": "0.60225385", "text": "function getAttribute(node, attribute) {\n return checkDOM(node.getAttribute(attribute), `attribute ${attribute}`, node);\n}", "title": "" }, { "docid": "b3971fe29fec81669c9b02433c42a855", "score": "0.60225385", "text": "function getAttribute(node, attribute) {\n return checkDOM(node.getAttribute(attribute), `attribute ${attribute}`, node);\n}", "title": "" }, { "docid": "a1d3baa034b338e516756407c2fd6f6b", "score": "0.60092777", "text": "function isAttribute(copies, i) {\n return ATTRIBUTE_BEFORE.test(copies.slice(0, i).join('')) && ATTRIBUTE_AFTER.test(copies.slice(i).join(''));\n }", "title": "" }, { "docid": "69a1f089b857949f77ffc8ed89cc2d38", "score": "0.60026324", "text": "function getAttribute(el, name) {\n var value = el.getAttribute(name);\n if (!value) {\n throw new Error('Missing required attribute: ' + name);\n }\n return value;\n }", "title": "" }, { "docid": "64e93eeb56e0093d5f5f0df9e5975718", "score": "0.59974563", "text": "function hasDataSrcAttribute(el) {\n return el.dataset.src;\n}", "title": "" }, { "docid": "aef5c104f129704515d10ad597deb9fa", "score": "0.59862965", "text": "function hasStyleAttribute( tagNode )\n{\n return( tagNode.getAttribute( strStyleAttrib ) != null );\n}", "title": "" }, { "docid": "616ac30d97150cc4cacf1e807e6f7264", "score": "0.5972977", "text": "function shouldSetAttribute(name,value){if(isReservedProp(name)){return false;}if(name.length>2&&(name[0]==='o'||name[0]==='O')&&(name[1]==='n'||name[1]==='N')){return false;}if(value===null){return true;}switch(typeof value==='undefined'?'undefined':_typeof(value)){case'boolean':return shouldAttributeAcceptBooleanValue(name);case'undefined':case'number':case'string':case'object':return true;default:// function, symbol\nreturn false;}}", "title": "" }, { "docid": "3f9b4669708b4c609dcdffdf6eeab479", "score": "0.59209883", "text": "_hasHostAttributes(...attributes) {\n return attributes.some(attribute => this._getHostElement().hasAttribute(attribute));\n }", "title": "" }, { "docid": "3f9b4669708b4c609dcdffdf6eeab479", "score": "0.59209883", "text": "_hasHostAttributes(...attributes) {\n return attributes.some(attribute => this._getHostElement().hasAttribute(attribute));\n }", "title": "" }, { "docid": "ade6e95bbec3b6c36f5c5c687aa6ad58", "score": "0.5920136", "text": "getAttribute() {}", "title": "" }, { "docid": "9e3d88a860828da8e91bd3deddcafc97", "score": "0.59025043", "text": "_hasHostAttributes(...attributes) {\n return attributes.some(attribute => this._getHostElement().hasAttribute(attribute));\n }", "title": "" }, { "docid": "521b3505d26d077fd39f5490c054cb9a", "score": "0.5900668", "text": "_hasDependency(tag, opts) {\n // Get any possible dependencies for this attribute to exist\n let dependencies = opts ? opts.dependencies : [];\n // Initialize the dependency return value\n let hasDependency = false;\n // Check that dependent item exists\n // Loop through the dependencies defined\n for (let i = 0; i < dependencies.length; i += 1) {\n const slot_exists =\n dependencies[i].type === \"slot\" &&\n this.has_slots(`${tag}--${dependencies[i].id}`).length > 0;\n const attribute_exists =\n dependencies[i].type === \"attribute\" &&\n this.getAttribute(`${prefix}${dependencies[i].id}`);\n // If the type is slot, check that it exists OR\n // if the type is an attribute, check if the attribute is defined\n if (slot_exists || attribute_exists) {\n // If the slot does exist, add the attribute with the default value\n hasDependency = true;\n // Exit the loop\n break;\n }\n }\n // Return a boolean if the dependency exists\n return hasDependency;\n }", "title": "" }, { "docid": "e4ec592117acd6cfed83b5ff897811b2", "score": "0.58745867", "text": "attr(element, attr) {\n _each(attr, function (value, key) {\n if (typeof value !== 'undefined') {\n element.setAttribute(key, value);\n }\n });\n }", "title": "" }, { "docid": "2b663c29e43144f92dc87d9a53809a55", "score": "0.58739525", "text": "function hasAriaLabel(element) {\n var node = angular.element(element)[0] || element;\n\n /* Check if compatible node type (ie: not HTML Document node) */\n if (!node.hasAttribute) {\n return false;\n }\n\n /* Check label or description attributes */\n return node.hasAttribute('aria-label') || node.hasAttribute('aria-labelledby') || node.hasAttribute('aria-describedby');\n }", "title": "" }, { "docid": "2b663c29e43144f92dc87d9a53809a55", "score": "0.58739525", "text": "function hasAriaLabel(element) {\n var node = angular.element(element)[0] || element;\n\n /* Check if compatible node type (ie: not HTML Document node) */\n if (!node.hasAttribute) {\n return false;\n }\n\n /* Check label or description attributes */\n return node.hasAttribute('aria-label') || node.hasAttribute('aria-labelledby') || node.hasAttribute('aria-describedby');\n }", "title": "" }, { "docid": "2b663c29e43144f92dc87d9a53809a55", "score": "0.58739525", "text": "function hasAriaLabel(element) {\n var node = angular.element(element)[0] || element;\n\n /* Check if compatible node type (ie: not HTML Document node) */\n if (!node.hasAttribute) {\n return false;\n }\n\n /* Check label or description attributes */\n return node.hasAttribute('aria-label') || node.hasAttribute('aria-labelledby') || node.hasAttribute('aria-describedby');\n }", "title": "" }, { "docid": "56ed33a24fd9e1293ef7c467fe64b795", "score": "0.5832213", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (\n name.length > 2 &&\n (name[0] === 'o' || name[0] === 'O') &&\n (name[1] === 'n' || name[1] === 'N')\n ) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n }", "title": "" }, { "docid": "9a454c23e8537a020a71a3da59116cee", "score": "0.58225256", "text": "function isStandardAttribute(name) {\n return /^(get|set|value|writable|enumerable|configurable)$/.test(name);\n}", "title": "" }, { "docid": "fcac02c0f65a5e16b2ca13ac293f953a", "score": "0.58161396", "text": "function validatePresence(attr, conf, err, done){\n /*jshint validthis:true */\n if (blank(this[attr])) {\n err();\n }\n done();\n}", "title": "" }, { "docid": "dd7161a093340e5090143248f666e068", "score": "0.5786389", "text": "function expectAttribute(element, attrName, defaultValue) {\n\n var node = element[0];\n if (!node.hasAttribute(attrName)) {\n var hasDefault = angular.isDefined(defaultValue);\n\n if (hasDefault) {\n defaultValue = String(defaultValue).trim();\n // $log.warn(messageTemplate + ' ' + defaultValueTemplate,\n // attrName, getTagString(node), attrName, defaultValue);\n element.attr(attrName, defaultValue);\n } else {\n // $log.warn(messageTemplate, attrName, getTagString(node));\n }\n }\n }", "title": "" }, { "docid": "adaef6ef2fe7d11f11fac805ad832b86", "score": "0.5780317", "text": "get elementAttr() {\n return this._getOption('elementAttr');\n }", "title": "" }, { "docid": "77bffe408797d86ec5adce5feccdda82", "score": "0.5773564", "text": "function validateAttrName(attrName, regxAttrName) {\n // const validAttrRegxp = new RegExp(regxAttrName);\n return util.doesMatch(attrName, regxAttrName);\n}", "title": "" }, { "docid": "4afb5e85ee25319a88f5026859f3f600", "score": "0.57529765", "text": "function checkForAttr (attr) {\n if (!attr) return '';\n\n attr = attr.replace(/[\\[\\]\\'\\\"]/gm,'');\n\n if (~attr.indexOf('\\.')) { attr = `class=${attr.substr(1)}` } // attr 'class' founded\n else if (~attr.indexOf('\\#')) { attr = `id=${attr.substr(1)}` } // attr 'id' founded\n if (~attr.indexOf('\\*')) { attr = attr.replace('\\*','') } // attr 'includes' founded\n\n let attribute = attr.match(/[^=]+=/gm)[0].replace('=','');\n let value = attr.match(/={1}[\\w-_]+/gm)[0].replace('=','');\n\n if (~attribute.indexOf('\\^')) { \n attribute = attribute.replace('\\^','');\n return new RegExp( `${attribute}{1}\\\\s?=\\\\s?(\\\\'|\\\\\"){1}` + value + `{1}[^\\\\'\\\\\"]*(\\\\'|\\\\\")`, 'gm' );\n } // attr 'start from' founded \n if (~attribute.indexOf('\\$')) { \n attribute = attribute.replace('\\$','');\n return new RegExp( `${attribute}{1}\\\\s?=\\\\s?(\\\\'|\\\\\"){1}[^\\\\'\\\\\"]*` + value + `(\\\\'|\\\\\")`, 'gm' );\n } // attr 'end with' founded\n else {\n return new RegExp( `${attribute}{1}\\\\s?=\\\\s?(\\\\'|\\\\\"){1}[^\\\\'\\\\\"]*` + value + `{1}[^\\\\'\\\\\"]*(\\\\'|\\\\\")`, 'gm' );\n }\n \n} // creating RegExp to find attr inside tag", "title": "" }, { "docid": "cb2936635d1ddb43a05704837a48f424", "score": "0.57528156", "text": "function isValidAttributeName(name) {\n if (typeof name !== 'string') {\n throw new Error('invalid attribute name');\n }\n return /^[A-Z0-9\\-]+$/i.test(name);\n }", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "01fcd9e9b1d80e0edfc2a6f5b4da549c", "score": "0.5712838", "text": "function shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}", "title": "" }, { "docid": "e9c0e7a3de5759f8ead07b4f0cbdff66", "score": "0.57117766", "text": "function attr( node, attribute, value ) {\n if (value) node.setAttribute( attribute, value );\n else return node && node.getAttribute && node.getAttribute(attribute);\n}", "title": "" }, { "docid": "8ca08fdffefe97b547500f3544c540e2", "score": "0.5691453", "text": "function testAttributes(elem) {\n let attrib = elem.getAttribute(\"attribute\")\n || elem.tagName.replace(\"outcome\",\"normal\");\n let outcomeIdentifier = elem.getAttribute(\"outcomeIdentifier\");\n let weightIdentifier = elem.getAttribute(\"weightIdentifier\");\n let includeNulls = elem.getAttribute(\"includeNulls\")===\"true\";\n let filters = getVariableFilters(elem);\n return [...QTI.ROOT.querySelectorAll(\"assessmentItem\")]\n .filter(item=>filterItem(item, filters))\n .map(i=>declAttribute(i,attrib,outcomeIdentifier)) // weightIdentifier\n .filter(v=>includeNulls || v!=null);\n}", "title": "" }, { "docid": "6ec12be9cd1e8bd73ce56e2973392308", "score": "0.5678596", "text": "function getAttributeValue$1(elem, name) {\n\t var _a;\n\t return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];\n\t}", "title": "" }, { "docid": "69b5807fe6344d6bebfe39ae7c89d918", "score": "0.5676008", "text": "function ostk_areAttributesValid(atts){\n\tvar error = null;\n\tvar type = atts.type;\n\tvar required_attributes = null;\n\tvar optional_attributes = null;\n\n\tif(!type){\n\t\terror = 'Type attribute is required';\n\t}\n\n\tif(!error){\n\t\tvar keys = ostk_getKeyList(atts);\n\t\tvar item = ostk_patterns[type];\n\t\tif(!item){\n\t \terror = 'Invalid type attribute';\n\t\t}else{\n\t\t\trequired_attributes = item.required_attributes;\n\t\t\toptional_attributes = item.optional_attributes;\n\t\t}\n\t}\n\n\t//Fail if missing any required attributes\n\tif(!error){\n\t\tvar missingRequiredAtts = ostk_lookForMissingRequiredAttributes(atts, required_attributes);\n\t\tif(missingRequiredAtts.length > 0){\n\t\t\terror = 'Missing required attributes: ' + ostk_array_to_list_string(missingRequiredAtts, '&');\n\t\t}\n\t}\n\n\t//Fail if using undefined attributes, null values, or a value that is not an option\n\tif(!error){\n\t\tvar invalidExtraAtts = ostk_lookForInvalidAtts(atts, required_attributes, optional_attributes);\n\t\tif(invalidExtraAtts.length > 0){\n\t\t\terror = 'The following are not valid attributes: ' + ostk_array_to_list_string(invalidExtraAtts, '&');\n\t\t}\n\t}\n\n\tif(error){\n\t\treturn error;\n\t}else{\n\t\treturn true;\n\t}\n\n}", "title": "" }, { "docid": "e577d2ac200b9f37e0a52b52369c2872", "score": "0.56745654", "text": "function hasClassAttribute( tagNode )\n{\n return( tagNode.getAttribute( strClassAttrib ) != null );\n}", "title": "" }, { "docid": "e0f6fa78e510144e7f6d6089ce79e4aa", "score": "0.5672479", "text": "function checkForProperty(argument, property) {\n var idProperties = Object.getOwnPropertyDescriptor(argument, property)\n // I'm not sure if this is a good idea, but whatever\n if (idProperties !== undefined && 'get' in idProperties && typeof idProperties['get'] === 'function') {\n return true\n }\n return false\n }", "title": "" }, { "docid": "2b02d5af119435669112e8a2ff5d9a0f", "score": "0.5667207", "text": "function getElementAttr(element, attribute) {\n val = $(element).attr(attribute);\n return (val != null && $.trim(val) != '') ? $.trim(val) : null;\n }", "title": "" }, { "docid": "5cbb807209505578b943793cb0f9222a", "score": "0.56629956", "text": "function isRequired( input ){\n var attr = $(input).attr('required');\n if(typeof attr === 'undefined' || attr === false){\n return false;\n }else{\n return true;\n }\n }", "title": "" }, { "docid": "423a31c81ffe7d081213be41825e9929", "score": "0.5658544", "text": "function shouldSetAttribute(name, value) {\n\t if (isReservedProp(name)) {\n\t return false;\n\t }\n\t if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n\t return false;\n\t }\n\t if (value === null) {\n\t return true;\n\t }\n\t switch (typeof value) {\n\t case 'boolean':\n\t return shouldAttributeAcceptBooleanValue(name);\n\t case 'undefined':\n\t case 'number':\n\t case 'string':\n\t case 'object':\n\t return true;\n\t default:\n\t // function, symbol\n\t return false;\n\t }\n\t}", "title": "" }, { "docid": "423a31c81ffe7d081213be41825e9929", "score": "0.5658544", "text": "function shouldSetAttribute(name, value) {\n\t if (isReservedProp(name)) {\n\t return false;\n\t }\n\t if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n\t return false;\n\t }\n\t if (value === null) {\n\t return true;\n\t }\n\t switch (typeof value) {\n\t case 'boolean':\n\t return shouldAttributeAcceptBooleanValue(name);\n\t case 'undefined':\n\t case 'number':\n\t case 'string':\n\t case 'object':\n\t return true;\n\t default:\n\t // function, symbol\n\t return false;\n\t }\n\t}", "title": "" }, { "docid": "2ef4125546615ca14e91d5e6b6e528d2", "score": "0.56249934", "text": "has( tag ) {\n //TODO: should be able to specify attributes and attribute values as well\n return this.tagName === tag.split(/\\s/)[0];\n }", "title": "" }, { "docid": "44879dd6cb9617a1758ca723d8adadec", "score": "0.5622341", "text": "function getAttributeValue(elem, name) {\n var _a;\n return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];\n}", "title": "" }, { "docid": "44879dd6cb9617a1758ca723d8adadec", "score": "0.5622341", "text": "function getAttributeValue(elem, name) {\n var _a;\n return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];\n}", "title": "" }, { "docid": "8e1c9ce55a83420c3dc49eec06ba2d9f", "score": "0.5600168", "text": "get attribute() {}", "title": "" }, { "docid": "11694218338708b299002ffe91aca99d", "score": "0.5599496", "text": "function isAttrEphemeral(elem, attrName, attrMap, attrRxs) {\n\t\tvar mapped = attrMap[attrName];\n\t\tif (mapped) {\n\t\t\t// The attrMap may either contain boolean true or an array of element names.\n\t\t\tif (true === mapped) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (-1 !== Arrays.indexOf(mapped, elem.nodeName)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn Misc.anyRx(attrRxs, attrName);\n\t}", "title": "" }, { "docid": "954a8632ba96aaca18aaa598e7addc31", "score": "0.5597487", "text": "getAttribute(name) {\n return this.doc.getAttribute(name) || '';\n }", "title": "" }, { "docid": "331cf04755636e76fcea887284729959", "score": "0.55939734", "text": "function attr (element, name, value) {\n if (Object(_lang__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(name)) {\n for (var key in name) {\n attr(element, key, name[key]);\n }\n return\n }\n if (Object(_lang__WEBPACK_IMPORTED_MODULE_0__[\"isUndefined\"])(value)) {\n element = Object(_lang__WEBPACK_IMPORTED_MODULE_0__[\"toNode\"])(element);\n return element && element.getAttribute(name)\n } else {\n Object(_lang__WEBPACK_IMPORTED_MODULE_0__[\"toNodes\"])(element).forEach(function (element) {\n if (Object(_lang__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(value)) {\n value = value.call(element, attr(element, name));\n }\n if (value === null) {\n removeAttr(element, name);\n } else {\n element.setAttribute(name, value);\n }\n });\n }\n}", "title": "" }, { "docid": "e664ba0c2e770fa5b841075b30b9551b", "score": "0.5593609", "text": "function attr (input, args, meta) { return (input[0] || input).attribs[args] }", "title": "" }, { "docid": "f8df059f6bcead85c4b486ae7bd650ab", "score": "0.5591542", "text": "function getAttributeValue$1(elem, name) {\n var _a;\n return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];\n}", "title": "" }, { "docid": "61a908c54b15187d9b836b6b45962b90", "score": "0.5582818", "text": "function getAttributeValue(elem, name) {\n var _a;\n\n return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];\n}", "title": "" }, { "docid": "6d55fff748e6ac7364e2c48afff61598", "score": "0.55788326", "text": "static checkAttributes(rawResult) {\n if (!(rawResult instanceof Object)) {\n throw new Error('Result Data should be an object');\n }\n\n const expectedElements = [\n constants.ON_PEP_LIST_ATTR,\n constants.ON_FRAUD_LIST_ATTR,\n constants.ON_WATCH_LIST_ATTR,\n ];\n\n for (let x = 0; x < expectedElements.length; x += 1) {\n const attr = expectedElements[x];\n if (!hasProperty(rawResult, attr)) {\n throw new Error(`Missing attribute in the result ${attr}`);\n }\n }\n }", "title": "" }, { "docid": "1d1651c6b522f60129d296d552606f64", "score": "0.55513537", "text": "isNotListAttribute(attr) {\n return !(attr in this.listAttributes);\n }", "title": "" } ]
60d9c26991346a677e3143ccf97bbefc
Gets the collection of languages used in a server farm.
[ { "docid": "b9353cd121cd8cec06560bc0bad05b21", "score": "0.66661614", "text": "get installedLanguages() {\r\n return new InstalledLanguages(this);\r\n }", "title": "" } ]
[ { "docid": "a75103f4230293c8a207f815dd621b18", "score": "0.7437668", "text": "function listLanguages() {\n return high.listLanguages()\n}", "title": "" }, { "docid": "bc43806d3318296f5b2cac23e709b08b", "score": "0.72047627", "text": "function $380d7edc2604b455$var$listLanguages() {\n return $03b62e45aee69014$exports.listLanguages();\n}", "title": "" }, { "docid": "2cdefd7c231052d50e6c5d555538f8e0", "score": "0.7200054", "text": "get languages() {\n\t\t\treturn this.dictionary ? Object.keys(this.dictionary) : [];\n\t\t}", "title": "" }, { "docid": "ad4b8f5060b73c67819c1749a3f82750", "score": "0.6954405", "text": "function listLanguages() {\n return languageNames.concat()\n}", "title": "" }, { "docid": "5c5b3873086b9d40e3984cfd8ddb260e", "score": "0.6865063", "text": "get globalInstalledLanguages() {\r\n return new InstalledLanguages(this, \"globalinstalledlanguages\");\r\n }", "title": "" }, { "docid": "2dbf0fccc3f8e9f148230c9da44e935f", "score": "0.68297637", "text": "function getAllLanguages (db = connection) {\n return db('languages')\n}", "title": "" }, { "docid": "f3df51c0ea11a8d6682895a763211637", "score": "0.669052", "text": "getAvailableLanguages() {\n if (!this.availableLanguages) {\n this.availableLanguages = [];\n for (let language in this.props) {\n this.availableLanguages.push(language);\n }\n }\n return this.availableLanguages;\n }", "title": "" }, { "docid": "a2b26eca579c3b93e8a1983df2d00bea", "score": "0.6655659", "text": "getValidLanguages() {\n return validLanguages.slice();\n }", "title": "" }, { "docid": "a2b26eca579c3b93e8a1983df2d00bea", "score": "0.6655659", "text": "getValidLanguages() {\n return validLanguages.slice();\n }", "title": "" }, { "docid": "c9f51b47fbab98e218a715ccb781a940", "score": "0.6634938", "text": "function listLanguages() {\n return new Promise((resolve, reject) => {\n translate\n .getLanguages()\n .then((results) => {\n [languages] = results;\n const randomNumber = getRandomInt(languages.length);\n target = languages[randomNumber].code;\n detectAndTranslateLanguages().then((response) => {\n translatedText = response;\n resolve(languages[randomNumber].name);\n });\n })\n .catch((err) => {\n console.error('ERROR:', err);\n reject();\n });\n });\n}", "title": "" }, { "docid": "aa4639b75d01b75095da8010aaaadf24", "score": "0.66012716", "text": "function GetLanguages() {\n\treturn axios\n\t\t.get(\n\t\t\t\"https://api.cognitive.microsofttranslator.com/languages?api-version=3.0&scope=translation\"\n\t\t)\n\t\t.then(res => {\n\t\t\tconst response = res.data.translation;\n\t\t\treturn Object.keys(response).map(lang => ({\n\t\t\t\tcode: lang,\n\t\t\t\tname: response[lang].name,\n\t\t\t\tnative: response[lang].nativeName\n\t\t\t}));\n\t\t});\n}", "title": "" }, { "docid": "ef4d448dd994f7a9289dfd30222ea7c4", "score": "0.6564128", "text": "function listLanguages() {\n return hljs.listLanguages();\n}", "title": "" }, { "docid": "3463c44c0b0f45be68c168b8b6f0dffd", "score": "0.64883393", "text": "function getAvailableLanguages(){\n\tvar signlanguage = new Array();\n\n\t// TODO: Get dynamically\n\t//\n\tsignlanguage[0] = \"american sign language\";\n\tsignlanguage[1] = \"german sign language\";\n\tsignlanguage[2] = \"international sign language\";\n\treturn signlanguage;\n}", "title": "" }, { "docid": "b799f8bbc2c828806874882877f40573", "score": "0.6342914", "text": "getLanguage() {\n return this.http.get(this.url + '/cesco/getlanguages');\n }", "title": "" }, { "docid": "0553b60ad3869ea203cc703e98fc8e0d", "score": "0.6341108", "text": "function getSupportedLanguagesArray() {\n var langArray = []\n for (let langtag in Config.Languages) {\n langArray.push(Config.Languages[langtag])\n }\n\n return langArray\n}", "title": "" }, { "docid": "c1990d672b64c8595b19b91fa9d4bd7e", "score": "0.6162124", "text": "function ls() {\n return _(fs.readdirSync(LANGUAGES)).filter(function(name) {\n var candidate = path.join(LANGUAGES, name);\n return fs.statSync(candidate).isDirectory();\n });\n}", "title": "" }, { "docid": "aff00a7da44dfa772df2b0edc958fb6b", "score": "0.61486614", "text": "async listI18nLanguagesOpts() {\n const youtube = await this.youtube();\n const languages = (await youtube.i18nLanguages.list({\n part: \"snippet\",\n })).data.items;\n const opts = languages.map((language) => ({\n label: language.snippet.name,\n value: language.id,\n }));\n return opts;\n }", "title": "" }, { "docid": "d883ad4a7e94fd50865c1b8e4d44a31b", "score": "0.590443", "text": "function getCachedLanguages() {\n\t var storage = JSON.parse(localStorage.getItem(STORAGE_KEY));\n\t if (!storage || storage.version !== config.version) {\n\t storage = {\n\t version: config.version\n\t };\n\t }\n\t return storage;\n\t }", "title": "" }, { "docid": "6166809841310a43fed32be2cfcf359d", "score": "0.58719784", "text": "getUserList() {\n return this.http.get(this.url + '/cesco/getlanguages', this.httpOptions);\n }", "title": "" }, { "docid": "654fd399d4816762ef3fb44cc380b5be", "score": "0.5871542", "text": "function getEnglishVoices() {\n englishVoices = [];\n speechSynthesis.getVoices().forEach(function (voice) {\n if (voice.lang.includes(\"en\")) {\n englishVoices.push(voice);\n }\n });\n return englishVoices;\n}", "title": "" }, { "docid": "1f4c443c6b89a411e934df303276314c", "score": "0.5843119", "text": "function getSysLanaugaes() {\n\n\t$.ajax( {\n\t\ttype : \"GET\",\n\t\turl : \"list_languages.do\",\n\t\tdata : {},\n\t\tdatatype : \"json\",\n\t\tsuccess : function(msg, textstatus) {\n\n\t\t\tsys_languages = msg;\n\t\t\taddLanguage();\n\n\t\t}//success~\n\t});//ajax~\n\n}", "title": "" }, { "docid": "c92cf93282732fd1bce3335d16c6af11", "score": "0.5706014", "text": "function getHljsLanguages() {\n return [\n { name: 'typescript', func: function () { return Promise.resolve().then(function () { return __webpack_require__(/*! highlight.js/lib/languages/typescript */ \"./node_modules/highlight.js/lib/languages/typescript.js\"); }); } },\n { name: 'scss', func: function () { return Promise.resolve().then(function () { return __webpack_require__(/*! highlight.js/lib/languages/scss */ \"./node_modules/highlight.js/lib/languages/scss.js\"); }); } },\n { name: 'xml', func: function () { return Promise.resolve().then(function () { return __webpack_require__(/*! highlight.js/lib/languages/xml */ \"./node_modules/highlight.js/lib/languages/xml.js\"); }); } }\n ];\n}", "title": "" }, { "docid": "858e60ddf1adce351bc91c4887830277", "score": "0.5697652", "text": "function getSupportedLanguages() {\n window.plugins.speechrecognizer.getSupportedLanguages(function(languages){\n // display the json array\n alert(languages);\n }, function(error){\n alert(\"Could not retrieve the supported languages : \" + error);\n });\n}", "title": "" }, { "docid": "17e5ac8f29ce2afbc92e958eec4e92e1", "score": "0.5667361", "text": "function getDropDownStrings(){\n\tlet ret=dropDownStrings['en']\n\tlet lang = document.documentElement.lang.split('-')[0]||'en'\n\tif( lang!='en' && !!dropDownStrings[lang] ){\n\t\tfor(let [k,v] of Object.entries(dropDownStrings[ lang ])){\n\t\t\tret[k]=v\n\t\t}\n\t}\n\twrite2log('Using drop down strings for ' + lang )\n\treturn ret\n}", "title": "" }, { "docid": "9d9cc6d50672830ca4fd7090c4e86c77", "score": "0.56377006", "text": "function getAppState() {\n return TranslationsStore.getStrings();\n}", "title": "" }, { "docid": "9d9cc6d50672830ca4fd7090c4e86c77", "score": "0.56377006", "text": "function getAppState() {\n return TranslationsStore.getStrings();\n}", "title": "" }, { "docid": "9d9cc6d50672830ca4fd7090c4e86c77", "score": "0.56377006", "text": "function getAppState() {\n return TranslationsStore.getStrings();\n}", "title": "" }, { "docid": "9d9cc6d50672830ca4fd7090c4e86c77", "score": "0.56377006", "text": "function getAppState() {\n return TranslationsStore.getStrings();\n}", "title": "" }, { "docid": "9d9cc6d50672830ca4fd7090c4e86c77", "score": "0.56377006", "text": "function getAppState() {\n return TranslationsStore.getStrings();\n}", "title": "" }, { "docid": "9d9cc6d50672830ca4fd7090c4e86c77", "score": "0.56377006", "text": "function getAppState() {\n return TranslationsStore.getStrings();\n}", "title": "" }, { "docid": "9d9cc6d50672830ca4fd7090c4e86c77", "score": "0.56377006", "text": "function getAppState() {\n return TranslationsStore.getStrings();\n}", "title": "" }, { "docid": "1c6d36a0c2ac67c3613ed37efbccfb0a", "score": "0.5603558", "text": "function _getLanguageFiles() {\n const languages = {};\n const dirpath = path.join(__dirname, '../src/locales');\n const directories = _getDirectories(dirpath);\n\n if (directories.length === 1) {\n languages[''] = {};\n const lang = directories[0];\n fs.readdirSync(`${dirpath}/${lang}`).forEach((file) => {\n const page = file.slice(0, -5);\n const content = fs.readFileSync(`${dirpath}/${lang}/${file}`, 'utf8');\n languages[''][page] = JSON.parse(content);\n languages[''][page].base_lang = lang;\n languages[''][page].base_country = lang.slice(-2);\n });\n } else {\n directories.forEach((lang) => {\n languages[lang] = {};\n fs.readdirSync(`${dirpath}/${lang}`).forEach((file) => {\n const page = file.slice(0, -5);\n const content = fs.readFileSync(`${dirpath}/${lang}/${file}`, 'utf8');\n languages[lang][page] = JSON.parse(content);\n languages[lang][page].base_lang = lang;\n languages[lang][page].base_country = lang.slice(-2);\n languages[lang][page].base_languages = directories;\n languages[lang][page].base_lang_default = defaultLang;\n });\n });\n }\n\n return languages;\n}", "title": "" }, { "docid": "d31a60ae5aa0a01023452fbf83faa7ff", "score": "0.5597849", "text": "userLanguages(username) {\n return this.repositories(username)\n .then(repos => Promise.all(repos.map(repo => this.languages(repo.full_name))));\n }", "title": "" }, { "docid": "08a27069a917c8822db4c96eb9ad34db", "score": "0.55788124", "text": "get language() { return 'all'; }", "title": "" }, { "docid": "64aa64c353bd6a54fe131546ef812ebb", "score": "0.55316216", "text": "get automaticallyIdentifyLanguages() {\n return this._automaticallyIdentifyLanguages;\n }", "title": "" }, { "docid": "4de734afa724b728f025b10e9724b16c", "score": "0.5527265", "text": "getAll() {\n if (!this.isInitialized) {\n this.initialize();\n }\n\n return this.translationList;\n }", "title": "" }, { "docid": "eba144b639b61159ec5ce7b5ccb83085", "score": "0.5517565", "text": "languages(repository) {\n return this.request(`/repos/${repository}/languages`);\n }", "title": "" }, { "docid": "e5e750b0ebcc09134553fa3b823a46f6", "score": "0.5502719", "text": "async function getTranslations () {\n\treturn {\n\t\t'en-US': {\n\t\t\t'HOME.HELLO': 'Welcome home!',\n\t\t\t'PAGE1.HELLO': 'Hello from Page1',\n\t\t\t'PAGE2.HELLO': 'Hello from Page2',\n\t\t\t'NOT-FOUND': 'couldnt find it!',\n\t\t\t'BANNER': 'Hello world',\n\t\t\t'LINK.HOME': 'Home',\n\t\t\t'LINK.PAGE-1': 'Page 1',\n\t\t\t'LINK.PAGE-2': 'Page 2'\n\t\t}\n\t}\n}", "title": "" }, { "docid": "142b16a355141417016bb1652f15ecfa", "score": "0.5479465", "text": "function getLanguage() {\n var $langMap = {\n en: {\n path: 'English',\n mods: {\n sLengthMenu: 'Display _MENU_ courses',\n sInfo: 'Showing _START_ to _END_ of _TOTAL_ courses'\n }\n },\n da: {\n path: 'Danish',\n mods: {\n sLengthMenu: 'Vis _MENU_ kurser',\n sInfo: 'Viser _START_ til _END_ af _TOTAL_ kurser',\n sInfoEmpty: 'Viser 0 til 0 af 0 kurser'\n }\n }\n };\n var $lang = $('html').attr('lang');\n if (!$langMap[$lang]) {\n $lang = 'en';\n }\n var $result = null;\n var path = '//cdn.datatables.net/plug-ins/1.10.13/i18n/';\n $.ajax({\n async: false,\n url: path + $langMap[$lang].path + '.json',\n success: function(obj) {\n $result = $.extend({}, obj, $langMap[$lang].mods);\n }\n });\n return $result;\n }", "title": "" }, { "docid": "6542f3f135fc9fab064af45c11496f1f", "score": "0.545208", "text": "function addLanguages() {}", "title": "" }, { "docid": "a83f4b78a7f788043808dcfb6ace3b1f", "score": "0.54172784", "text": "function get_language() {\r\n return _lang_code;\r\n }", "title": "" }, { "docid": "5d667db9a0246c5a4b2833cfdffeda01", "score": "0.5399262", "text": "function getTranslations() {\r\n return translations;\r\n }", "title": "" }, { "docid": "a06baadab0b65dc83cf67fbd19c3b320", "score": "0.5339498", "text": "function getStrings(){\n\t\t//console.log('getString', lang, str, translations[lang][str])\n\t\tlet lang=document.documentElement.lang.split('-')[0]||'en' \n\t\tif(!translations[lang]) lang='en'\n\t\treturn translations[lang]\n\t}", "title": "" }, { "docid": "69f92c90b33588539ba8dca96957b87a", "score": "0.53208274", "text": "function getLanguageStats (repo) {\n var repoLanguages = repo.url + '/languages'\n return get(repoLanguages).then(function (res) {\n return res.data;\n });\n }", "title": "" }, { "docid": "65c0e7c36ab412ef8dc842b493ae3681", "score": "0.52793217", "text": "function LanguagesResponse() {\n _classCallCheck(this, LanguagesResponse);\n\n LanguagesResponse.initialize(this);\n }", "title": "" }, { "docid": "9acd7bd160323a3c4c8c2e6c6e3ed1ad", "score": "0.5277145", "text": "function getAllCulturesAlphabetically() {\r\n var cultures = [];\r\n var culture;\r\n \r\n for ( var languageCode in Globalize.cultures) {\r\n culture = Globalize.cultures[languageCode];\r\n if (languageCode != \"default\") {\r\n cultures.push(culture);\r\n }\r\n }\r\n\r\n function sortAlphabetically(a, b) {\r\n var al = a.language;\r\n var bl = b.language;\r\n return al < bl ? -1 : (al > bl ? 1 : 0);\r\n }\r\n cultures.sort(sortAlphabetically);\r\n return cultures;\r\n }", "title": "" }, { "docid": "568a68457a8cb8527f6564cd1f7e9ac3", "score": "0.52632934", "text": "get language() {\n return this._data.language;\n }", "title": "" }, { "docid": "662e4313b5b50af1ae0e05604a8299ef", "score": "0.5260744", "text": "function loadLangs() \n{\n\tif (jsonObject.phraseArray.length)\n\t{\n\t\tchrome.storage.sync.get({\n\t\t\tfrom: 'en',\n\t\t\tto: 'es',\n\t\t}, function(items) {\n\t\t\tjsonObject.fromLang = items.from;\n\t\t\tjsonObject.toLang = items.to;\n\t\t\tgetTranslation();\n\t\t});\n\t}\n}", "title": "" }, { "docid": "649757afbda4755ee02d8134d3738d71", "score": "0.5254529", "text": "getOCRSupportedLanguagesAsync() {\n return __awaiter(this, void 0, void 0, function* () {\n const url = `${app_config_1.CopyleaksConfig.API_SERVER_URI}/v3/miscellaneous/ocr-languages-list`;\n const headers = {\n 'Content-Type': 'application/json',\n 'User-Agent': app_config_1.CopyleaksConfig.USER_AGENT,\n };\n const response = yield axios_1.default.get(url, { headers });\n if ((0, utils_1.isSuccessStatusCode)(response.status))\n return response.data;\n else if ((0, utils_1.isUnderMaintenanceResponse)(response.status)) {\n throw new exceptions_1.UnderMaintenanceException();\n }\n else if ((0, utils_1.isRateLimitResponse)(response.status)) {\n throw new exceptions_1.RateLimitException();\n }\n else {\n throw new exceptions_1.CommandException(response);\n }\n });\n }", "title": "" }, { "docid": "7863ac0bb9bd25600fad7c1e009a0c1b", "score": "0.5251076", "text": "function fetchLanguage() {\n App.app.generateMap();\n App.manifest.generateMap();\n\n // Load in the closest language to what the browser wants.\n var lang = navigator.language.substr(0, 2);\n\n if (!App.manifest.map[lang]) {\n lang = Object.keys(App.manifest.map)[0];\n }\n\n if (lang) {\n App.language = new StormLanguage({lang: App.manifest.map[lang]});\n return App.language.fetch();\n }\n\n // No lang - running remotely.\n return $.when();\n}", "title": "" }, { "docid": "9f11e2870dfa9cfafef567a805fb5756", "score": "0.5250515", "text": "function createLanguagesMock() {\n return [\n {\n 'code': 'de',\n 'name': 'Deutsch'\n },\n {\n 'code': 'en',\n 'name': 'English'\n }\n ]\n}", "title": "" }, { "docid": "2d8cbc755dd8139f8dffafa770e5f312", "score": "0.52498347", "text": "function getLanguage() {\n return 'en-us';\n}", "title": "" }, { "docid": "39450e46066d96ba8560c24ddcedb163", "score": "0.5247108", "text": "function getLocal() {\n// navigator.language : Netscape & Firefox\n// navigator.userLanguage : Internet Explorer\n var lang = navigator.language || navigator.userLanguage;\n return lang;\n}", "title": "" }, { "docid": "c08efeaddd2ee40cd152b3acf4220f72", "score": "0.52440774", "text": "get languageService() {\r\n if (this._languageService == null)\r\n throw this.getToolRequiredError(\"language service\");\r\n return this._languageService;\r\n }", "title": "" }, { "docid": "8c4312e6cd04c64a7b54ea5f3a76db2b", "score": "0.5234315", "text": "function findLanguage() {\n const tag = [\n ...document.getElementsByClassName(\n 'ant-select-selection-selected-value',\n ),\n ];\n if (tag && tag.length > 0) {\n for (let i = 0; i < tag.length; i += 1) {\n const elem = tag[i].textContent;\n if (elem !== undefined && languages[elem] !== undefined) {\n return languages[elem]; // should generate respective file extension\n }\n }\n }\n return null;\n}", "title": "" }, { "docid": "78b914b50ebac9988f97c68c54877ba2", "score": "0.521106", "text": "getRessources(app) {\n var localization = navigator.language;\n if (localization == \"fr\" || localization == \"fr-FR\") {\n Utilitary.getXHR(\"ressources/ressources_fr-FR.json\", (ressource) => { this.loadMessages(ressource, app); }, Utilitary.errorCallBack);\n }\n else {\n Utilitary.getXHR(\"ressources/ressources_en-EN.json\", (ressource) => { this.loadMessages(ressource, app); }, Utilitary.errorCallBack);\n }\n }", "title": "" }, { "docid": "e755fb3c67936fce3ae0cd7d7c75fff5", "score": "0.52091354", "text": "function findLanguage() {\n const tag = [\n ...document.getElementsByClassName(\n 'ant-select-selection-selected-value',\n ),\n ...document.getElementsByClassName(\n 'Select-value-label',\n )\n ];\n if (tag && tag.length > 0) {\n for (let i = 0; i < tag.length; i += 1) {\n const elem = tag[i].textContent;\n if (elem !== undefined && languages[elem] !== undefined) {\n return languages[elem]; // should generate respective file extension\n }\n }\n }\n return null;\n}", "title": "" }, { "docid": "cf5f443fcfc9a03981fbc9facd37afa3", "score": "0.5190413", "text": "function getV18Translations () {\n\t\tvar useUrl = IBM.common.config.dataUrl + IBM.common.meta.page.pageInfo.ibm.cpi + \".js\";\n\n\t\t$.ajax({\n\t\t\t\turl: useUrl,\n\t\t\t\tdataType: \"script\",\n\t\t\t\tcache: true\n\t\t\t}).done(function () {\n\t\t\t\ttranslations.v18.ready = true;\n\t\t\t}).fail(function (message) {\n\t\t\t\tconsole.error('Error while loading main v18 translation file', message);\n\t\t\t\ttranslations.v18.ready = true;\n\t\t\t\tmyEvents.publish(\"error\");\n\t\t\t});\n\t}", "title": "" }, { "docid": "5f516db62f48fd47551b5bb12017356b", "score": "0.51895714", "text": "function getlabelStrings() {\n const strings = {};\n for (let lang of config.lang) {\n strings[lang] = require(`../../public/locales/${lang}.json`);\n }\n return strings;\n}", "title": "" }, { "docid": "81a5a377de5294475c023b6316c29d60", "score": "0.5186597", "text": "trainLanguages() {\n\t\tlet self=this;\n\t\treturn Q.all(this.languages.map((language)=>{\n\t\t\treturn self.trainLanguage(language);\n\t\t}));\n\t}", "title": "" }, { "docid": "f08f9a6326704473b92d1d6648f1ba35", "score": "0.51767933", "text": "function _parseLanguages(app) {\n var fs = require('fs'),\n languagesPath = process.cwd() + '/languages/',\n languagesFiles = null;\n\n try {\n languagesFiles = fs.readdirSync(languagesPath);\n }\n catch (err) {\n app.logger.warn(err.message + '. Fix language directory. Exiting.');\n process.exit(1);\n }\n\n languagesFiles = _.filter(languagesFiles, function (obj) {\n return _.isString(obj) &&\n obj.length >= 6 &&\n obj.slice(-5) === '.json';\n });\n\n languagesFiles.forEach(function (language) {\n try {\n languages[language.substring(0, 2)] = //only interested in 'en', 'se' et cetera\n JSON.parse(fs.readFileSync(languagesPath + '/' + language, 'utf8'));\n navbars[language.substring(0, 2)] = navbars[language.substring(0, 2)] || {};\n }\n catch (err) {\n app.logger.warn(err.message + '. Language ' + language + ' not installed');\n }\n });\n}", "title": "" }, { "docid": "0f008c818063b3e342efdfc95769f18c", "score": "0.51699555", "text": "getLanguageSync() {\n return this._language;\n }", "title": "" }, { "docid": "c926134cb8ea6a83b92b7b846be4fea9", "score": "0.5148596", "text": "function get_page_lang() {\r\n //== Language forced by user option\r\n if(FORCE_LANGUAGE) { return FORCE_LANGUAGE.toLowerCase(); }\r\n var forceLng=getValue('FORCE_LANGUAGE');\r\n if(forceLng) { return forceLng.toLowerCase(); }\r\n\r\n //== Use browser language when youtube don't support it...\r\n var lang=window.navigator.language.substr(0,2).toLowerCase();\r\n if(lang==\"ar\") { return lang; } // Arabic (ar)\r\n\r\n //== via URL or ytc\r\n lang=window.location.search.match(/[?&]hl=([^(\\&|$)]*)/i);\r\n if(lang) { lang=lang[1]; } else { lang=gvar.ytc_LANGUAGE; }\r\n if(lang) {\r\n lang=lang.replace(/\\-/,\"_\").toLowerCase();\r\n if(LANGUAGE_TEXT[lang]) { GM_setValue(\"Youtube_Enhancer_Locale_Setting\",lang); return lang; }\r\n lang=lang.substr(0,2);\r\n if(LANGUAGE_TEXT[lang]) { GM_setValue(\"Youtube_Enhancer_Locale_Setting\",lang); return lang; }\r\n }\r\n\r\n //== via old watch page setting\r\n return GM_getValue(\"Youtube_Enhancer_Locale_Setting\",\"www\");\r\n}", "title": "" }, { "docid": "bbe190fca2bfb816242405ee41aaff3f", "score": "0.51444423", "text": "static get localizeNamespaces() {}", "title": "" }, { "docid": "c1dde0fc54d04e95684b7cd741108ede", "score": "0.5138554", "text": "function camelLanguageSettings(nodeName) {\n return Camel._apacheCamelModel.languages[nodeName];\n }", "title": "" }, { "docid": "2cf89c464e4f1893ee19c5074956fce1", "score": "0.5130991", "text": "get language() {\n\t\treturn this.__language;\n\t}", "title": "" }, { "docid": "2cf89c464e4f1893ee19c5074956fce1", "score": "0.5130991", "text": "get language() {\n\t\treturn this.__language;\n\t}", "title": "" }, { "docid": "01e4bba6b666d839fc08f3c0602f4c34", "score": "0.5119176", "text": "function getLanguagePref() {\n\n // check localStorage for previously-set pref\n let lang = localStorage.lang;\n\n // check window.navigator\n if ( !lang ) lang = navigator.languages ?\n navigator.languages[ 0 ] : (navigator.language || navigator.userLanguage);\n\n // if lang not present in stringsConfig.json, skip it\n if ( lang && !getActiveLanguages().find( f => f.lang === lang ) ) lang = null;\n\n // default to 'en'\n if ( !lang ) lang = 'en';\n\n // only support major languages\n lang = lang.slice( 0, 2 );\n\n return lang;\n\n }", "title": "" }, { "docid": "548286656de1e4216e972696f8844a76", "score": "0.5112719", "text": "function getSourceLangResourceFiles() {\n var resources = [];\n grunt.file.recurse(SOURCE_LANG_STRINGS_PATH, function(abspath, rootdir, subdir, filename) { \n if (filename.match(/\\.resjson$/)) {\n resources.push(filename);\n }\n });\n return resources;\n }", "title": "" }, { "docid": "302a7a4889a7b43a53f41cb6f8e0efad", "score": "0.5106307", "text": "function getI18NTranslators(path){\n\tvar \n\t\tlocales = {},\n\t\tfiles = fs.readdirSync(path),\n\t\ti18nFiles = _.filter(files, function(f){\n\t\t\treturn RE_I18N_FILENAME.test(f);\n\t\t});\n\n\t_.each(i18nFiles, function(jsonFile){\n\t\tvar locale, d = loadI18NFile( path + '/' + jsonFile);\n\t\tif( d !== null ){\n\t\t\tlocale = jsonFile.match( RE_I18N_FILENAME )[1];\n\t\t\tlog.debug('Locale ' + locale + ' loaded.');\n\t\t\tlocales[locale.toLowerCase()] = d;\n\t\t}\n\t});\n\treturn locales;\n}", "title": "" }, { "docid": "fd038f9546c2c50e7bf1e88801ef2cd1", "score": "0.510176", "text": "function fetchAdditionalLanguageFiles() {\n const additionalFiles = paths.silkConfig.additionalLanguageFolder\n ? paths.silkConfig.additionalLanguageFolder\n : process.env.ADDITIONAL_LANGUAGE_FILES;\n if (additionalFiles) {\n const additional = additionalFiles.replace(/\\/$/, \"\");\n return fs.readdirSync(additional).map((file) => `${additional}/${file}`);\n } else {\n return [];\n }\n}", "title": "" }, { "docid": "b57a1fca5d833a525b7fa1b3eb39f92c", "score": "0.5082395", "text": "function installLanguages(app) {\n _parseLanguages(app);\n\n app.use(function (req, res, next) {\n req.session.language = req.session.language || app.config.site.defaultLanguage;\n res.locals.language = req.session.language;\n\n if (_.isObject(languages[res.locals.language])) {\n res.locals.lang = languages[res.locals.language][req.path.slice(1)]; //remove prefix /\n next();\n }\n else {\n req.session.language = app.config.site.defaultLanguage;\n res.send('<h1>No language support yet :('); //TODO: well...\n }\n });\n\n navBarOrder = app.config.site.navbarOrder;\n app.use(_navBarList);\n app.use(_alert);\n\n app.logger.info('Internationalization setup.');\n\n}", "title": "" }, { "docid": "a22b5cd6103d28d9645453f9fb0aa107", "score": "0.50816995", "text": "function hideTheOtherLanguages(preferredLangsFromServer) {\r\n\r\n preferredLanguages = preferredLangsFromServer;\r\n \r\n if (preferredLanguages == null || preferredLanguages == undefined) {\r\n\r\n // if we do not have the information, do nothing --- no personalization\r\n \r\n } else {\r\n \r\n // hide languages that are not favorite ones\r\n\r\n var languagesList = document.getElementById('p-lang')\r\n var languageElemsList = document.evaluate('/html/body/div[4]/div[2]/div[@id=\"p-lang\"]/div/ul', document.body, null, XPathResult.ANY_TYPE, null).iterateNext()\r\n // EN: /html/body/div[4]/div[2]/div[6]/div/ul\r\n // FR: /html/body/div[4]/div[2]/div[6]/div/ul\r\n // ES: /html/body/div[4]/div[2]/div[5]/div/ul\r\n // TODO replace with relative expression --> ('/div[id=p-lang]/ul/li[1]') ?\r\n\r\n var languageElems = languageElemsList.getElementsByTagName('li');\r\n\r\n // iterate through language links on website\r\n for (var i = 0; i < languageElems.length; ++i) {\r\n\r\n var lang = languageElems[i].children[0].getAttribute('lang')\r\n\r\n // if the current one is not a favorite one, hide it\r\n if (!isPreferredLanguage(lang)) {\r\n languageElems[i].style.display = 'none'\r\n }\r\n }\r\n\r\n // add a button to show all languages\r\n\r\n buttonElement = document.createElement('input');\r\n buttonElement.setAttribute('type', 'button');\r\n buttonElement.setAttribute('value', 'more');\r\n buttonElement.setAttribute('name', 'showMoreButton');\r\n buttonElement.onclick = showMoreButtonClicked;\r\n languageElemsList.appendChild(buttonElement);\r\n }\r\n}", "title": "" }, { "docid": "db225daa978aeb58777b2ac8c0deacc4", "score": "0.5073479", "text": "get language() {\n\t\t\treturn this._language;\n\t\t}", "title": "" }, { "docid": "42ed6c9900da40d8e764a1690de4deb9", "score": "0.5061655", "text": "function preferredLanguages(accept,provided){// RFC 2616 sec 14.4: no header = *\nvar accepts=parseAcceptLanguage(accept===undefined?'*':accept||'');if(!provided){// sorted list of all languages\nreturn accepts.filter(isQuality).sort(compareSpecs).map(getFullLanguage);}var priorities=provided.map(function getPriority(type,index){return getLanguagePriority(type,accepts,index);});// sorted list of accepted languages\nreturn priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority){return provided[priorities.indexOf(priority)];});}", "title": "" }, { "docid": "c06375e8b8282c354943f61ff2cd4dd4", "score": "0.5057638", "text": "function getBrowserLocales(options = {}) {\n const defaultOptions = {\n languageCodeOnly: false\n }\n const opt = {\n ...defaultOptions,\n ...options\n }\n const browserLocales = navigator.languages === undefined ? [navigator.language] : navigator.languages\n if (!browserLocales) {\n return undefined\n }\n return browserLocales.map((locale) => {\n const trimmedLocale = locale.trim()\n return opt.languageCodeOnly ? trimmedLocale.split(/-|_/)[0] : trimmedLocale\n })\n}", "title": "" }, { "docid": "61727b145526ba0216bf31d132188144", "score": "0.50503576", "text": "function getNLSConfiguration() {\n\tvar locale = undefined;\n\tvar localeOpts = '--locale';\n\tfor (var i = 0; i < process.argv.length; i++) {\n\t\tvar arg = process.argv[i];\n\t\tif (arg.slice(0, localeOpts.length) == localeOpts) {\n\t\t\tvar segments = arg.split('=');\n\t\t\tlocale = segments[1];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (locale === 'pseudo') {\n\t\treturn { availableLanguages: {}, pseudo: true }\n\t}\n\tif (process.env.VSCODE_DEV) {\n\t\treturn { availableLanguages: {} };\n\t}\n\t// We have a built version so we have extracted nls file. Try to find\n\t// the right file to use.\n\tlocale = locale || app.getLocale();\n\twhile (locale) {\n\t\tvar candidate = path.join(__dirname, 'main.nls.') + locale + '.js';\n\t\tif (fs.existsSync(candidate)) {\n\t\t\treturn { availableLanguages: { '*': locale } };\n\t\t} else {\n\t\t\tvar index = locale.lastIndexOf('-');\n\t\t\tif (index > 0) {\n\t\t\t\tlocale = locale.substring(0, index);\n\t\t\t} else {\n\t\t\t\tlocale = null;\n\t\t\t}\n\t\t}\n\t}\n\treturn { availableLanguages: {} };\n}", "title": "" }, { "docid": "92a4a29adddd1c6348125df5e39d1ee2", "score": "0.5046031", "text": "get language () {\n\t\treturn this._language;\n\t}", "title": "" }, { "docid": "0759c10680cb50f898751a3e0f06987f", "score": "0.5041817", "text": "getTranslations () {\n return this._node.translations.map(id => {\n return this._api.getModelById(id)\n })\n }", "title": "" }, { "docid": "e1fcecb27ed7749303433e7fb768436b", "score": "0.50393337", "text": "get visibleEngines()\n {\n return this._bss.getVisibleEngines({});\n }", "title": "" }, { "docid": "3b77538ffd6e8fbece697204dee6d8d7", "score": "0.503517", "text": "getTranslatedMessages() {\n\t\tif (!_.isObject(this.props.messages)) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (this.props.messages[this.props.lang]) {\n\t\t\treturn this.props.messages[this.props.lang];\n\t\t}\n\n\t\treturn this.props.messages['ENG'];\n\t}", "title": "" }, { "docid": "d043366634cb39aed3e8ec393691cc5c", "score": "0.50330245", "text": "function ls_getLanguage() {\n var language = '';\n \n // Priority:\n // 1. Cookie\n // 2. Browser autodetection\n \n // grab according to cookie\n language = ls_getCookieLanguage();\n \n // grab according to browser if none defined\n if (!language) {\n language = ls_getBrowserLanguage();\n }\n \n // inflexible: can't accept multiple languages\n \n // remove dialect/region code, leaving only the ISO 639 code\n var length;\n // possible bug: supposedly the language string could be en_US\n // switch to regexps when we get the chance\n if ((length = language.indexOf('-')) !== -1) {\n language = language.substr(0, length);\n }\n return language;\n}", "title": "" }, { "docid": "c14e630b0f23e87c6cbf8839bef815fd", "score": "0.5010274", "text": "getLikelyLocaleForLanguage(language) {\n var _this5 = this;\n\n return _asyncToGenerator(function* () {\n let lang = language.toLowerCase();\n if (!_this5.likelyLocaleTable) _this5.likelyLocaleTable = yield _this5.buildLikelyLocaleTable();\n\n if (_this5.likelyLocaleTable[lang]) return _this5.likelyLocaleTable[lang];\n _this5.fallbackLocaleTable = _this5.fallbackLocaleTable || require('./fallback-locales');\n\n return _this5.fallbackLocaleTable[lang];\n })();\n }", "title": "" }, { "docid": "7ee9354cecdc161e4b85475aee6b00b2", "score": "0.5007775", "text": "function loadLanguages(languages) {\n const languageSelect = $(ids.language);\n var languageOptions = languages.map(toOption);\n\n languageSelect.append(languageOptions);\n}", "title": "" }, { "docid": "065005bc91c4e54d47b59f4a8297421c", "score": "0.50072587", "text": "get contentLanguage() {\n return this.originalResponse.contentLanguage;\n }", "title": "" }, { "docid": "065005bc91c4e54d47b59f4a8297421c", "score": "0.50072587", "text": "get contentLanguage() {\n return this.originalResponse.contentLanguage;\n }", "title": "" }, { "docid": "065005bc91c4e54d47b59f4a8297421c", "score": "0.50072587", "text": "get contentLanguage() {\n return this.originalResponse.contentLanguage;\n }", "title": "" }, { "docid": "065005bc91c4e54d47b59f4a8297421c", "score": "0.50072587", "text": "get contentLanguage() {\n return this.originalResponse.contentLanguage;\n }", "title": "" }, { "docid": "2940ad2b81a1b2b254504368f80ab860", "score": "0.499535", "text": "function LangMap() {}", "title": "" }, { "docid": "2940ad2b81a1b2b254504368f80ab860", "score": "0.499535", "text": "function LangMap() {}", "title": "" }, { "docid": "380970dea1db88c6c37a3fe5fa2dbb74", "score": "0.49919674", "text": "getFallbacks(langKey) {\n let fallbacks = ['en'];\n switch (langKey) {\n case 'pt':\n fallbacks.unshift('pt-PT');\n break;\n case 'pt-PT':\n fallbacks.unshift('pt');\n break;\n // no default\n }\n return fallbacks;\n }", "title": "" }, { "docid": "e91b2ef5c3ac67faa19543c586d56825", "score": "0.49901977", "text": "getLanguage() {\n return this.language;\n }", "title": "" }, { "docid": "44448c384dc7d9c1f0aee338e7b41a7b", "score": "0.49854848", "text": "getBetaBuildLocalizations(limit = 28) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield this.client.get(`${this.apiEndPoint}/iris/v1/betaBuildLocalizations?filter%5Bbuild%5D=${this.buildId}&limit=${limit}`);\n return response.data.data;\n });\n }", "title": "" }, { "docid": "b911352efa9bcf30f89cdb7a611d2b91", "score": "0.49742582", "text": "function setScpLanguage () {\n\t//PDN 12/03/15 DO NOT test for LanguageP to skip function as breaks selected langauge\n\t//if (sessionScope.LanguageP == \"\" || sessionScope.LanguageP == null) {\n\t/* 11/04/2016 changes made - changes are marked with //11-04-2016 after code\n\t * made browserLocale all lower case\n\t * \n\t*/\n\t//println(\"=+=+=+=+=+=+=\");\n\t\tdBar.info(\"session.getServerName = \" + session.getServerName());\n\t\tvar languageDefault = \"eme-en\";\n\t\tvar languageSel = new String(\"initialze as String object then set to null string\");\n\t\tvar languageSel = \"\";\n\t\t\n\t\tif (cookie.containsKey(\"languagePref\")) {\n\t\t\tlanguageSel = cookie.get(\"languagePref\").getValue();\n\t\t\tdBar.info(\"languageSel = \" + languageSel);\n\t\t};\n\t\tvar browserLocale = context.getLocaleString().toLowerCase(); //11-04-2016\n\t\tdBar.info(\"***** context.getLocaleString() : \"+ browserLocale);\n\t\t//println(\"browserLocale: \"+browserLocale);\n\t\t\n\t\t//var languageLocal = new String(\"americas-en\");\n\t\tvar languageLocal = new String(\"eme-intl\");\n\t \n\t\tswitch (browserLocale) {\n\t\t\tcase \"en_us\": //11-04-2016\n\t\t\tcase \"en_ca\": //11-04-2016\n\t\t\tcase \"fr_ca\": //11-04-2016\n\t\t\tcase \"es_ca\": //11-04-2016\n\t\t\tcase \"es_bo\": //11-04-2016\n\t\t\tcase \"es_cl\": //11-04-2016\n\t\t\tcase \"es_co\": //11-04-2016\n\t\t\tcase \"es_cr\": //11-04-2016\n\t\t\tcase \"es_do\": //11-04-2016\n\t\t\tcase \"es_ec\": //11-04-2016\n\t\t\tcase \"es_sv\": //11-04-2016\n\t\t\tcase \"es_gt\": //11-04-2016\n\t\t\tcase \"es_hn\": //11-04-2016\n\t\t\tcase \"es_mx\": //11-04-2016\n\t\t\tcase \"es_ni\": //11-04-2016\n\t\t\tcase \"es_pa\": //11-04-2016\n\t\t\tcase \"es_py\": //11-04-2016\n\t\t\tcase \"es_pe\": //11-04-2016\n\t\t\tcase \"es_uy\": //11-04-2016\n\t\t\tcase \"es_ve\": //11-04-2016\n\t\t\t\tlanguageLocal = \"americas-en\"; \n\t\t\t\tbreak;\n\t\t\tcase \"de\":\n\t\t\tcase \"de_de\": //11-04-2016\n\t\t\tcase \"de_at\": //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-de\";\t\n\t\t\t\tbreak;\n\t\t\tcase \"en_gb\": //11-04-2016\n\t\t\tcase \"en_ie\": // English (Ireland) //11-04-2016\n\t\t\tcase \"ga_ie\": // Irish //11-04-2016\n\t\t\tcase \"ga\": // Irish\n\t\t\tcase \"gd\": // Scots Gaelic\n\t\t\t\tlanguageLocal = \"eme-en\";\n\t\t\t\tbreak;\n\t\t\tcase \"es\":\n\t\t\tcase \"ca_es\": // Catalan //11-04-2016\n\t\t\tcase \"es_es\": // Spain //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-es\";\t\n\t\t\t\tbreak;\n\t\t\tcase \"fi\":\n\t\t\tcase \"fi_fi\": // Finland //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-fi\";\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"fr\":\n\t\t\tcase \"fr_fr\": // France //11-04-2016\n\t\t\tcase \"fr_be\": // Belgium //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-fr\";\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"it\":\n\t\t\tcase \"it_it\": //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-it\";\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"nl\":\n\t\t\tcase \"nl_nl\": //11-04-2016\n\t\t\tcase \"nl_be\": //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-nl\";\t\n\t\t\t\tbreak;\n\t\t\tcase \"sv\":\n\t\t\tcase \"sv_se\": // Sweden //11-04-2016\n\t\t\t\tlanguageLocal = \"eme-se\";\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"zh\":\n\t\t\tcase \"zh-hh\":\n\t\t\tcase \"zh-cn\":\n\t\t\tcase \"zh-sg\":\n\t\t\tcase \"zh-tw\":\n\t\t\tcase \"zh_hh\":\n\t\t\tcase \"zh_cn\":\n\t\t\tcase \"zh_sg\":\n\t\t\tcase \"zh_tw\":\n\t\t\tcase \"ko\":\n\t\t\tcase \"ko-kp\":\n\t\t\tcase \"ko-kr\":\n\t\t\tcase \"ko_kp\":\n\t\t\tcase \"ko_kr\":\n\t\t\tcase \"au\":\n\t\t\tcase \"en-au\":\n\t\t\tcase \"en_au\":\n\t\t\tcase \"ja\":\n\t\t\t\tlanguageLocal = \"eme-intl\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//dBar.info(\"case default\");\n\t\t\t\tlanguageLocal = \"eme-intl\";\t\n\t\t};\n\t\t\n\t\tdBar.info(\"languageLocal = \" + languageLocal);\n\t\t\t\n\t\tvar langURL = languageLocal.replace(\"-\",\"/\") + \"/\" ;\n\t\tdBar.info(\"langURL = \" + langURL);\n\t\n\t\tif (!!languageSel) {\n\t\t\t\tsessionScope.LanguageP = languageSel ;\n\t\t\t\tsessionScope.LanguageURL = languageSel.replace(\"-\",\"/\") + \"/\" ;\n\t\t\t\tsessionScope.isBrowserLocaleSupported = true ;\t\n\t\t\t} else if (languageLocal != \"eme-intl\"){\n\t\t\t\tsessionScope.LanguageP = languageLocal ;\n\t\t\t\tsessionScope.LanguageURL = langURL ;\n\t\t\t\tsessionScope.isBrowserLocaleSupported = true ;\t\n\t\t\t} else if (languageLocal == \"eme-intl\"){\n\t\t\t\tsessionScope.LanguageP = \"eme-en\";\n\t\t\t\tsessionScope.LanguageURL = \"eme/en/\" ;\t\n\t\t\t\tsessionScope.isBrowserLocaleSupported = false ;\t\n\t\t\t\treturn facesContext.getExternalContext().redirect(\"/international\");\n\t\t\t} else {\n\t\t\t\t// should never get here\n\t\t\t\tsessionScope.LanguageP = \"americas-en\";\n\t\t\t\tsessionScope.LanguageURL = \"americas/en/\" ;\t\t\t\n\t\t};\n\t\n\t\tdBar.info(\"sessionScope.LanguageP = \" + sessionScope.LanguageP);\n\t\tdBar.info(\"sessionScope.LanguageURL = \" + sessionScope.LanguageURL);\n\n\t\t//println(\"=+=+=+=+=+=+=\");\n\t//};\n\t//dBar.info(\"SKIPPED function, sessionScope.LanguageP = \" + sessionScope.LanguageP);\n\t//dBar.info(\"sessionScope.LanguageURL = \" + sessionScope.LanguageURL);\n}", "title": "" }, { "docid": "d413f4f6edbdaafe713bbe0182eb1b59", "score": "0.4969409", "text": "function listBetaAppLocalizations(api, query) {\n return api_1.GET(api, `/betaAppLocalizations`, { query })\n}", "title": "" }, { "docid": "851f4ba1c3bcc59cfab38d9f0ecfc49b", "score": "0.49627298", "text": "function getTranslationCodes() {\n var translationCodes = [];\n grunt.file.recurse(STRINGS_PATH, function(abspath, rootdir, subdir, filename) {\n // treat any non-empty directories that can be mapped to a Transifex language code\n // as translation directories\n if (subdir && mapToTxLangCode(subdir) && TX_SOURCE_LANGUAGE !== mapToTxLangCode(subdir)) {\n translationCodes.push(subdir);\n }\n });\n return _.uniq(translationCodes);\n }", "title": "" }, { "docid": "d90e0aaf68de6ea6ed09834870a3b37e", "score": "0.49412274", "text": "checkLang() {\n return this.langArr\n }", "title": "" }, { "docid": "e5770a93690bfcd10e74c4534f8fe1bc", "score": "0.49246037", "text": "function get_language(langue){\r\n\t// Langue par défaut : Anglais\r\n\tadd_log(3, \"get_language() > Début.\");\r\n\tswitch(langue_serveur) { \r\n\t\tcase \"fr\": // French\r\n\t\t\t// Les batiments :\r\n\t\t\tlangue_batiments['1'] = \"Bûcheron\";\r\n\t\t\tlangue_batiments['2'] = \"Carrière d'argile\";\r\n\t\t\tlangue_batiments['3'] = \"Mine de fer\";\r\n\t\t\tlangue_batiments['4'] = \"Ferme\";\r\n\t\t\tlangue_batiments['5'] = \"Scierie\";\r\n\t\t\tlangue_batiments['6'] = \"Usine de poteries\";\r\n\t\t\tlangue_batiments['7'] = \"Fonderie\";\r\n\t\t\tlangue_batiments['8'] = \"Moulin\";\r\n\t\t\tlangue_batiments['9'] = \"Boulangerie\";\r\n\t\t\tlangue_batiments['10'] = \"Dépôt de ressources\";\r\n\t\t\tlangue_batiments['11'] = \"Silo de céréales\";\r\n\t\t\tlangue_batiments['12'] = \"Armurerie\";\r\n\t\t\tlangue_batiments['13'] = \"Forge\";\r\n\t\t\tlangue_batiments['14'] = \"Place du tournoi\";\r\n\t\t\tlangue_batiments['15'] = \"Bâtiment principal\";\r\n\t\t\tlangue_batiments['16'] = \"Place de rassemblement\";\r\n\t\t\tlangue_batiments['17'] = \"Place du Marché\";\r\n\t\t\tlangue_batiments['18'] = \"Ambassade\";\r\n\t\t\tlangue_batiments['19'] = \"Caserne\";\r\n\t\t\tlangue_batiments['20'] = \"Écurie\";\r\n\t\t\tlangue_batiments['21'] = \"Atelier\";\r\n\t\t\tlangue_batiments['22'] = \"Académie\";\r\n\t\t\tlangue_batiments['23'] = \"Cachette\";\r\n\t\t\tlangue_batiments['24'] = \"Hôtel de ville\";\r\n\t\t\tlangue_batiments['25'] = \"Résidence\";\r\n\t\t\tlangue_batiments['26'] = \"Palais\";\r\n\t\t\tlangue_batiments['27'] = \"Chambre aux trésors\";\r\n\t\t\tlangue_batiments['28'] = \"Comptoir de commerce\";\r\n\t\t\tlangue_batiments['29'] = \"Grande caserne\";\r\n\t\t\tlangue_batiments['30'] = \"Grande écurie\";\r\n\t\t\tlangue_batiments['31'] = \"Mur d'enceinte\";\r\n\t\t\tlangue_batiments['32'] = \"Mur de terre\";\r\n\t\t\tlangue_batiments['33'] = \"Palissade\";\r\n\t\t\tlangue_batiments['34'] = \"Tailleur de pierre\";\r\n\t\t\tlangue_batiments['35'] = \"Brasserie\";\r\n\t\t\tlangue_batiments['36'] = \"Fabricant de pièges\";\r\n\t\t\tlangue_batiments['37'] = \"Manoir du héros\";\r\n\t\t\tlangue_batiments['38'] = \"Grand dépôt\";\r\n\t\t\tlangue_batiments['39'] = \"Grand silo\";\r\n\t\t\tlangue_batiments['40'] = \"Merveille du monde\";\r\n\t\t\tlangue_batiments['41'] = \"Abreuvoir\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_ressources['lumber'] = \"Bois\";\r\n\t\t\tlangue_ressources['clay'] = \"Argile\";\r\n\t\t\tlangue_ressources['iron'] = \"Fer\";\r\n\t\t\tlangue_ressources['crop'] = \"Céréales\";\r\n\t\t\t// Taches\r\n\t\t\tlangue_textes['build'] = \"Construire le bâtiment\";\r\n\t\t\tlangue_textes['upgrade'] = \"Augmenter\";\r\n\t\t\tlangue_textes['attack'] = \"Attaque\";\r\n\t\t\tlangue_textes['research'] = \"Rechercher\";\r\n\t\t\tlangue_textes['train'] = \"Entrainer\";\r\n\t\t\tlangue_textes['party'] = \"Fête\";\r\n\t\t\tlangue_textes['demolish'] = \"Démolir\";\r\n\t\t\tlangue_textes['send_merchants'] = \"Envoyer ressources\";\r\n\t\t\tlangue_textes['send_assistance'] = \"Envoyer une assistance\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"Ressources\";\r\n\t\t\tlangue_textes['villages'] = \"Villages\";\r\n\t\t\tlangue_textes['my_hero'] = \"Mon héro\";\r\n\t\t\tlangue_textes['task_list'] = \"Liste des tâches\";\r\n\t\t\tlangue_textes['options'] = \"Options Multi-Tools\";\r\n\t\t\tlangue_textes['options_right_side'] = \"Colonne de droite\";\r\n\t\t\tlangue_textes['replace_hero'] = \"Remplacer le cadre du héro ?\";\r\n\t\t\tlangue_textes['replace_player'] = \"Remplacer le cadre du joueur ?\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"Remplacer le cadre de l'alliance ?\";\r\n\t\t\tlangue_textes['replace_village'] = \"Remplacer le cadre des villages ?\";\r\n\t\t\tlangue_textes['defense_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ajouter le raccourci \\\"envoyer défense\\\" ?\";\r\n\t\t\tlangue_textes['merchant_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ajouter le raccourci \\\"envoyer marchand\\\" ?\";\r\n\t\t\tlangue_textes['add_resource'] = \"Ajouter le cadre des barres de ressource ?\";\r\n\t\t\tlangue_textes['position_resource'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Avant ou après les villages ?\";\r\n\t\t\tlangue_textes['no'] = \"Non\";\r\n\t\t\tlangue_textes['yes'] = \"Oui\";\r\n\t\t\tlangue_textes['before_village'] = \"Avant les villages\";\r\n\t\t\tlangue_textes['after_village'] = \"Après les villages\";\r\n\t\t\tlangue_textes['options_various'] = \"Options diverses\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"Remplacer le nom de la page ?\";\r\n\t\t\tlangue_textes['save'] = \"Sauvegarder et fermer\";\r\n\t\t\tlangue_textes['replace_logo'] = \"Remplacer le logo original ?\";\r\n\t\t\tlangue_textes['ready'] = \"Prêt\";\r\n\t\t\tlangue_textes['never'] = \"Jamais\";\r\n\t\t\tlangue_textes['required_resources'] = \"Ressources nécessaires pour améliorer\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"Afficher les ressources manquantes dans les pages de construction ?\";\r\n\t\t\tlangue_textes['infinity'] = \"Infini\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"Vous devez améliorer le dépot de ressources.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \"Vous devez améliorer le dépot de céréales.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Utiliser le planificateur ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Niveau de log ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Ajouter à la liste des constructions -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Ajouter une tâche (heure du serveur)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Planifier à :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(aaaa/mm/jj hh:mm:ss)\";\r\n\t\t\tbreak;\r\n\t\tcase \"ir\": // Persian by Mr_572\r\n\t\t\t// Buldings :\r\n\t\t\tlangue_batiments['1'] = \"هیزم شکن\";\r\n\t\t\tlangue_batiments['2'] = \"آجر سازی\";\r\n\t\t\tlangue_batiments['3'] = \"معدن آهن\";\r\n\t\t\tlangue_batiments['4'] = \"گندم زار\";\r\n\t\t\tlangue_batiments['5'] = \"چوب بری\";\r\n\t\t\tlangue_batiments['6'] = \"آجرپزی\";\r\n\t\t\tlangue_batiments['7'] = \"ذوب آهن\";\r\n\t\t\tlangue_batiments['8'] = \"آسیاب\";\r\n\t\t\tlangue_batiments['9'] = \"نانوایی\";\r\n\t\t\tlangue_batiments['10'] = \"آنبار\";\r\n\t\t\tlangue_batiments['11'] = \"آنبار غذا\";\r\n\t\t\tlangue_batiments['12'] = \"اسلحه سازی\";\r\n\t\t\tlangue_batiments['13'] = \"زره سازی\";\r\n\t\t\tlangue_batiments['14'] = \"میدان تمرین\";\r\n\t\t\tlangue_batiments['15'] = \"ساختمان اصلی\";\r\n\t\t\tlangue_batiments['16'] = \"اردوگاه\";\r\n\t\t\tlangue_batiments['17'] = \"بازار\";\r\n\t\t\tlangue_batiments['18'] = \"سفارت\";\r\n\t\t\tlangue_batiments['19'] = \"سربازخانه\";\r\n\t\t\tlangue_batiments['20'] = \"اصطبل\";\r\n\t\t\tlangue_batiments['21'] = \"کارگاه\";\r\n\t\t\tlangue_batiments['22'] = \"دارالفنون\";\r\n\t\t\tlangue_batiments['23'] = \"مخفیگاه\";\r\n\t\t\tlangue_batiments['24'] = \"تالار شهر\";\r\n\t\t\tlangue_batiments['25'] = \"اقامتگاه\";\r\n\t\t\tlangue_batiments['26'] = \"قصر\";\r\n\t\t\tlangue_batiments['27'] = \"خزانه\";\r\n\t\t\tlangue_batiments['28'] = \"تجارتخانه\";\r\n\t\t\tlangue_batiments['29'] = \"سربازخانه بزرگ\";\r\n\t\t\tlangue_batiments['30'] = \"اصطبل بزرگ\";\r\n\t\t\tlangue_batiments['31'] = \"دیوارشهر\";\r\n\t\t\tlangue_batiments['32'] = \"دیوار گلی\";\r\n\t\t\tlangue_batiments['33'] = \"پرچین\";\r\n\t\t\tlangue_batiments['34'] = \"سنگ تراشی\";\r\n\t\t\tlangue_batiments['35'] = \"قهوه خانه\";\r\n\t\t\tlangue_batiments['36'] = \"تله ساز\";\r\n\t\t\tlangue_batiments['37'] = \"عمارت قهرمان\";\r\n\t\t\tlangue_batiments['38'] = \"انبار بزرگ\";\r\n\t\t\tlangue_batiments['39'] = \"انبار غذای بزرگ\";\r\n\t\t\tlangue_batiments['40'] = \"شگفتی جهان\";\r\n\t\t\tlangue_batiments['41'] = \"آبشخور اسب\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_ressources['lumber'] = \"چوب\";\r\n\t\t\tlangue_ressources['clay'] = \"خشت\";\r\n\t\t\tlangue_ressources['iron'] = \"آهن\";\r\n\t\t\tlangue_ressources['crop'] = \"گندم\";\r\n\t\t\t// Tasks\r\n\t\t\tlangue_textes['build'] = \"ساختن\";\r\n\t\t\tlangue_textes['upgrade'] = \"ارتقاع\";\r\n\t\t\tlangue_textes['attack'] = \"حمله\";\r\n\t\t\tlangue_textes['research'] = \"تحقیق\";\r\n\t\t\tlangue_textes['train'] = \"تربیت\";\r\n\t\t\tlangue_textes['party'] = \"جشن\";\r\n\t\t\tlangue_textes['demolish'] = \"تخریب\";\r\n\t\t\tlangue_textes['send_merchants'] = \"ارسال تاجر\";\r\n\t\t\tlangue_textes['send_assistance'] = \"ارسال نیروی کمکی\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"منابع\";\r\n\t\t\tlangue_textes['villages'] = \"دهکده ها\";\r\n\t\t\tlangue_textes['my_hero'] = \"قهرمان\";\r\n\t\t\tlangue_textes['task_list'] = \"لیست وظایف\";\r\n\t\t\tlangue_textes['options'] = \"گزینه ها\";\r\n\t\t\tlangue_textes['options_right_side'] = \"ستون سمت چپ\";\r\n\t\t\tlangue_textes['replace_hero'] = \"بخش مربوط به قهرمان تغییر کند؟\";\r\n\t\t\tlangue_textes['replace_player'] = \"بخش مربوط به نام بازیکن تغییر کند؟\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"بخش مربوط به اتحاد تغییر کند؟\";\r\n\t\t\tlangue_textes['replace_village'] = \"بخش مربوط به اسامی دهکده ها تغییر کند؟\";\r\n\t\t\tlangue_textes['defense_village'] = \"Add shortcut\\\"ارسال نیروی کمکی\\\" ?\";\r\n\t\t\tlangue_textes['merchant_village'] = \"Add shortcut \\\"ارسال منابع\\\" ?\";\r\n\t\t\tlangue_textes['add_resource'] = \"قسمت نوار منابع نمایش داده شود؟\";\r\n\t\t\tlangue_textes['position_resource'] = \"قبل یا بعد از بخش مربوط به اسامی دهکده ها\";\r\n\t\t\tlangue_textes['no'] = \"خیر\";\r\n\t\t\tlangue_textes['yes'] = \"بله\";\r\n\t\t\tlangue_textes['before_village'] = \"بعد از لیست دهکده ها\";\r\n\t\t\tlangue_textes['after_village'] = \"قبل از لیست دهکده ها\";\r\n\t\t\tlangue_textes['options_various'] = \"گزینه های مختلف\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"نام صفحه تغییر پیدا کند؟\";\r\n\t\t\tlangue_textes['save'] = \"Save and close\";\r\n\t\t\tlangue_textes['replace_logo'] = \"آرم تراوین تغییر کند؟\";\r\n\t\t\tlangue_textes['ready'] = \"آماده\";\r\n\t\t\tlangue_textes['never'] = \"هرگز\";\r\n\t\t\tlangue_textes['required_resources'] = \"منابع مورد نیاز برای ارتقاع\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"نمایش منابع مورد نیاز در صفحه ساختمان؟\";\r\n\t\t\tlangue_textes['infinity'] = \"ارتقاع\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"شما دارید برای ارتقاع انبار.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \" شما دارید برای ارتقاع انبار غذا.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Use the scheduler ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Log level ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Add to build list -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Schedule task (Server time)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Schedule at :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(yyyy/mm/dd hh:mm:ss)\";\r\n\t\t\tbreak;\r\n\t\tcase \"sa\": // Arabic by Dream1\r\n\t\t// Buldings :\r\n\t\t\tlangue_batiments['1'] = \"الحطاب\";\r\n\t\t\tlangue_batiments['2'] = \"حفرة الطين\";\r\n\t\t\tlangue_batiments['3'] = \"منجم الحديد\";\r\n\t\t\tlangue_batiments['4'] = \"حقل القمح\";\r\n\t\t\tlangue_batiments['5'] = \"معمل النشار\";\r\n\t\t\tlangue_batiments['6'] = \"معمل البلوك\";\r\n\t\t\tlangue_batiments['7'] = \"مسبك الحديد\";\r\n\t\t\tlangue_batiments['8'] = \"المطاحن\";\r\n\t\t\tlangue_batiments['9'] = \"مخبز\";\r\n\t\t\tlangue_batiments['10'] = \"المخزن\";\r\n\t\t\tlangue_batiments['11'] = \"مخزن الحبوب\";\r\n\t\t\tlangue_batiments['12'] = \"الحداد\";\r\n\t\t\tlangue_batiments['13'] = \"مستودع الدروع\";\r\n\t\t\tlangue_batiments['14'] = \"ساحة البطولة\";\r\n\t\t\tlangue_batiments['15'] = \"المبنى الرئيسي\";\r\n\t\t\tlangue_batiments['16'] = \"نقطة التجمع\";\r\n\t\t\tlangue_batiments['17'] = \"السوق\";\r\n\t\t\tlangue_batiments['18'] = \"السفارة\";\r\n\t\t\tlangue_batiments['19'] = \"الثكنة\";\r\n\t\t\tlangue_batiments['20'] = \"إسطبل\";\r\n\t\t\tlangue_batiments['21'] = \"المصانع الحربية\";\r\n\t\t\tlangue_batiments['22'] = \"الأكادمية الحربية\";\r\n\t\t\tlangue_batiments['23'] = \"المخبأ\";\r\n\t\t\tlangue_batiments['24'] = \"البلدية\";\r\n\t\t\tlangue_batiments['25'] = \"السكن\";\r\n\t\t\tlangue_batiments['26'] = \"القصر\";\r\n\t\t\tlangue_batiments['27'] = \"الخزنة\";\r\n\t\t\tlangue_batiments['28'] = \"المكتب التجاري\";\r\n\t\t\tlangue_batiments['29'] = \"الثكنة الكبيرة\";\r\n\t\t\tlangue_batiments['30'] = \"الأسطبل الكبير\";\r\n\t\t\tlangue_batiments['31'] = \"حائط المدينة\";\r\n\t\t\tlangue_batiments['32'] = \"الحائط الأرضي\";\r\n\t\t\tlangue_batiments['33'] = \"الحاجز\";\r\n\t\t\tlangue_batiments['34'] = \"الحجار\";\r\n\t\t\tlangue_batiments['35'] = \"المقهى\";\r\n\t\t\tlangue_batiments['36'] = \"الصياد\";\r\n\t\t\tlangue_batiments['37'] = \"قصر الأبطال\";\r\n\t\t\tlangue_batiments['38'] = \"المخزن الكبير\";\r\n\t\t\tlangue_batiments['39'] = \"مخزن الحبوب الكبير\";\r\n\t\t\tlangue_batiments['40'] = \"أعجوبة العالم أو المعجزة\";\r\n\t\t\tlangue_batiments['41'] = \"ساقية الخيول\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_textes['build'] = \"بناء\";\r\n\t\t\tlangue_textes['upgrade'] = \"تطوير\";\r\n\t\t\tlangue_textes['attack'] = \"هجوم\";\r\n\t\t\tlangue_textes['research'] = \"بحث\";\r\n\t\t\tlangue_textes['train'] = \"قطار\";\r\n\t\t\tlangue_textes['party'] = \"حفله\";\r\n\t\t\tlangue_textes['demolish'] = \"هدم\";\r\n\t\t\tlangue_textes['send_merchants'] = \"أرسال التجار\";\r\n\t\t\tlangue_textes['send_assistance'] = \"دعم البريد الإلكتروني\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"الموارد\";\r\n\t\t\tlangue_textes['villages'] = \"القرى\";\r\n\t\t\tlangue_textes['my_hero'] = \"بطلي\";\r\n\t\t\tlangue_textes['task_list'] = \"قائمة المهام\";\r\n\t\t\tlangue_textes['options'] = \"خيارات\";\r\n\t\t\tlangue_textes['options_right_side'] = \"الخانة في الجانب الأيمن\";\r\n\t\t\tlangue_textes['replace_hero'] = \"أستبدال شكل قائمة البطل؟\";\r\n\t\t\tlangue_textes['replace_player'] = \"أستبدال شكل قائمة الاعب؟\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"أستبدال شكل قائمة التحالف؟\";\r\n\t\t\tlangue_textes['replace_village'] = \"أستبدال شكل قائمة القرى؟\";\r\n\t\t\tlangue_textes['defense_village'] = \"أضافة أختصار \\\"أرسال القوات\\\"؟\";\r\n\t\t\tlangue_textes['merchant_village'] = \"أضافة أختصار \\\"أرسال التجار أو الموارد\\\"؟\";\r\n\t\t\tlangue_textes['add_resource'] = \"أضافة قائمة الموارد؟\";\r\n\t\t\tlangue_textes['position_resource'] = \"قائمة القرى قبل أو بعد؟\";\r\n\t\t\tlangue_textes['no'] = \"لا\";\r\n\t\t\tlangue_textes['yes'] = \"نعم\";\r\n\t\t\tlangue_textes['before_village'] = \"بعد قائمة القرى\";\r\n\t\t\tlangue_textes['after_village'] = \"قبل قائمة القرى\";\r\n\t\t\tlangue_textes['options_various'] = \"خيارات أخرى\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"أستبدال أسم الصفحة؟\";\r\n\t\t\tlangue_textes['save'] = \"Save and close\";\r\n\t\t\tlangue_textes['replace_logo'] = \"أستبدال الشعار الأصلي؟\";\r\n\t\t\tlangue_textes['ready'] = \"Ready\";\r\n\t\t\tlangue_textes['never'] = \"أبداَ\";\r\n\t\t\tlangue_textes['required_resources'] = \"الموارد المطلوبة للإرتقاء الى المستوى التالي\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"أظهار كم تحتاج من الموارد للبناء؟\";\r\n\t\t\tlangue_textes['infinity'] = \"غير محدود\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"You have to upgrade wharehouse.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \"You have to upgrade granary.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Use the scheduler ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Log level ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Add to build list -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Schedule task (Server time)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Schedule at :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(yyyy/mm/dd hh:mm:ss)\";\r\n\tbreak;\r\n\t\tcase \"uk\": // English\r\n\t\tdefault:\r\n\t\t\t// Buldings :\r\n\t\t\tlangue_batiments['1'] = \"Woodcutter\";\r\n\t\t\tlangue_batiments['2'] = \"Clay Pit\";\r\n\t\t\tlangue_batiments['3'] = \"Iron Mine\";\r\n\t\t\tlangue_batiments['4'] = \"Cropland\";\r\n\t\t\tlangue_batiments['5'] = \"Sawmill\";\r\n\t\t\tlangue_batiments['6'] = \"Brickyard\";\r\n\t\t\tlangue_batiments['7'] = \"Iron Foundry\";\r\n\t\t\tlangue_batiments['8'] = \"Flour Mill\";\r\n\t\t\tlangue_batiments['9'] = \"Bakery\";\r\n\t\t\tlangue_batiments['10'] = \"Warehouse\";\r\n\t\t\tlangue_batiments['11'] = \"Granary\";\r\n\t\t\tlangue_batiments['12'] = \"Blacksmith\";\r\n\t\t\tlangue_batiments['13'] = \"Armory\";\r\n\t\t\tlangue_batiments['14'] = \"Tournament Square\";\r\n\t\t\tlangue_batiments['15'] = \"Main Building\";\r\n\t\t\tlangue_batiments['16'] = \"Rally Point\";\r\n\t\t\tlangue_batiments['17'] = \"Marketplace\";\r\n\t\t\tlangue_batiments['18'] = \"Embassy\";\r\n\t\t\tlangue_batiments['19'] = \"Barracks\";\r\n\t\t\tlangue_batiments['20'] = \"Stable\";\r\n\t\t\tlangue_batiments['21'] = \"Siege Workshop\";\r\n\t\t\tlangue_batiments['22'] = \"Academy\";\r\n\t\t\tlangue_batiments['23'] = \"Cranny\";\r\n\t\t\tlangue_batiments['24'] = \"City Hall\";\r\n\t\t\tlangue_batiments['25'] = \"Residence\";\r\n\t\t\tlangue_batiments['26'] = \"Palace\";\r\n\t\t\tlangue_batiments['27'] = \"Treasury\";\r\n\t\t\tlangue_batiments['28'] = \"Trade Office\";\r\n\t\t\tlangue_batiments['29'] = \"Great Barracks\";\r\n\t\t\tlangue_batiments['30'] = \"Great Stable\";\r\n\t\t\tlangue_batiments['31'] = \"City Wall\";\r\n\t\t\tlangue_batiments['32'] = \"Earth Wall\";\r\n\t\t\tlangue_batiments['33'] = \"Palisade\";\r\n\t\t\tlangue_batiments['34'] = \"Stonemason\";\r\n\t\t\tlangue_batiments['35'] = \"Brewery\";\r\n\t\t\tlangue_batiments['36'] = \"Trapper\";\r\n\t\t\tlangue_batiments['37'] = \"Hero's Mansion\";\r\n\t\t\tlangue_batiments['38'] = \"Great Warehouse\";\r\n\t\t\tlangue_batiments['39'] = \"Great Granary\";\r\n\t\t\tlangue_batiments['40'] = \"Wonder\";\r\n\t\t\tlangue_batiments['41'] = \"Horse Drinking Trough\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_ressources['lumber'] = \"Lumber\";\r\n\t\t\tlangue_ressources['clay'] = \"Clay\";\r\n\t\t\tlangue_ressources['iron'] = \"Iron\";\r\n\t\t\tlangue_ressources['crop'] = \"Crop\";\r\n\t\t\t// Tasks\r\n\t\t\tlangue_textes['build'] = \"Build\";\r\n\t\t\tlangue_textes['upgrade'] = \"Upgrade\";\r\n\t\t\tlangue_textes['attack'] = \"Attack\";\r\n\t\t\tlangue_textes['research'] = \"Research\";\r\n\t\t\tlangue_textes['train'] = \"Train\";\r\n\t\t\tlangue_textes['party'] = \"Party\";\r\n\t\t\tlangue_textes['demolish'] = \"Demolish\";\r\n\t\t\tlangue_textes['send_merchants'] = \"Send Merchants\";\r\n\t\t\tlangue_textes['send_assistance'] = \"Send assistance\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"Ressources\";\r\n\t\t\tlangue_textes['villages'] = \"Villages\";\r\n\t\t\tlangue_textes['my_hero'] = \"My hero\";\r\n\t\t\tlangue_textes['task_list'] = \"Task list\";\r\n\t\t\tlangue_textes['options'] = \"Multi-Tools options\";\r\n\t\t\tlangue_textes['options_right_side'] = \"Right side column\";\r\n\t\t\tlangue_textes['replace_hero'] = \"Replace hero's framework ?\";\r\n\t\t\tlangue_textes['replace_player'] = \"Replace player's framework ?\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"Replace alliance's framework ?\";\r\n\t\t\tlangue_textes['replace_village'] = \"Replace village's framework ?\";\r\n\t\t\tlangue_textes['defense_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add shortcut \\\"send defense\\\" ?\";\r\n\t\t\tlangue_textes['merchant_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add shortcut \\\"send merchant\\\" ?\";\r\n\t\t\tlangue_textes['add_resource'] = \"Add resource bars framework ?\";\r\n\t\t\tlangue_textes['position_resource'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Before or after village's framework ?\";\r\n\t\t\tlangue_textes['no'] = \"No\";\r\n\t\t\tlangue_textes['yes'] = \"Yes\";\r\n\t\t\tlangue_textes['before_village'] = \"Before village\";\r\n\t\t\tlangue_textes['after_village'] = \"After village\";\r\n\t\t\tlangue_textes['options_various'] = \"Various options\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"Replace name's page ?\";\r\n\t\t\tlangue_textes['save'] = \"Save and close\";\r\n\t\t\tlangue_textes['replace_logo'] = \"Replace original logo ?\";\r\n\t\t\tlangue_textes['ready'] = \"Ready\";\r\n\t\t\tlangue_textes['never'] = \"Never\";\r\n\t\t\tlangue_textes['required_resources'] = \"Required resources to upgrade\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"Show ressourses needed in building's pages ?\";\r\n\t\t\tlangue_textes['infinity'] = \"Infinity\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"You have to upgrade wharehouse.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \"You have to upgrade granary.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Use the scheduler ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Log level ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Add to build list -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Schedule task (Server time)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Schedule at :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(yyyy/mm/dd hh:mm:ss)\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\tadd_log(3, \"get_language() > Fin.\");\r\n\t}", "title": "" }, { "docid": "3a5031231a29cde4f33bb22da239e51e", "score": "0.4919108", "text": "function setLangs (options) {\n locale = options.locale || 'cn-ZH'\n comma = locale === 'cn-ZH' ? ',' : ','\n pattern = options.pattern || '{:param}'\n langsSet[locale] = options[locale] || langsSet[locale] || {}\n return langsSet[locale]\n }", "title": "" }, { "docid": "0ddc91e3868869e8f8d4061eabe11583", "score": "0.49186963", "text": "getBaseLanguage() {\n\tvar data = location.href.replace('https://','').split('.');\n\treturn data[0].replace('https://',''); \n }", "title": "" } ]
956804947c6667bbf54451efcddae109
Used by console to create a database based on the app, passed database URL and a custom auth implementation.
[ { "docid": "779b97c1cd5274ef972da26f2f8bc1d9", "score": "0.5419496", "text": "function initStandalone(_a) {\n var app = _a.app, url = _a.url, version = _a.version, customAuthImpl = _a.customAuthImpl, namespace = _a.namespace, _b = _a.nodeAdmin, nodeAdmin = _b === void 0 ? false : _b;\n setSDKVersion(version);\n /**\n * ComponentContainer('database-standalone') is just a placeholder that doesn't perform\n * any actual function.\n */\n var authProvider = new _firebase_component__WEBPACK_IMPORTED_MODULE_4__[\"Provider\"]('auth-internal', new _firebase_component__WEBPACK_IMPORTED_MODULE_4__[\"ComponentContainer\"]('database-standalone'));\n authProvider.setComponent(new _firebase_component__WEBPACK_IMPORTED_MODULE_4__[\"Component\"]('auth-internal', function () { return customAuthImpl; }, \"PRIVATE\" /* PRIVATE */));\n return {\n instance: RepoManager.getInstance().databaseFromApp(app, authProvider, url, nodeAdmin),\n namespace: namespace\n };\n}", "title": "" } ]
[ { "docid": "8a51a7999f70cdbd04728863ccb837db", "score": "0.70871794", "text": "function createDatabase() {\n var conn = Jdbc.getConnection(instanceUrl, root, rootPwd);\n conn.createStatement().execute('CREATE DATABASE ' + db);\n}", "title": "" }, { "docid": "5f5d933f925cad17c0b28cd3e3acc7ee", "score": "0.67484564", "text": "function DatabaseFactory() {}", "title": "" }, { "docid": "5f5d933f925cad17c0b28cd3e3acc7ee", "score": "0.67484564", "text": "function DatabaseFactory() {}", "title": "" }, { "docid": "fac52334299d7666e0cdd445ae7dec99", "score": "0.64431125", "text": "function dataBase() {\n //create the database, also handle syncing with server side database on startup\n}", "title": "" }, { "docid": "a09cb329fdf0bd2d985c2022766bed96", "score": "0.6337757", "text": "setupDatabase() {\n return this.getService('Database.js').setup();\n }", "title": "" }, { "docid": "e1ebb167b23ad6366945593dcbbff4a1", "score": "0.63208884", "text": "function create_db(name){\n\n // Create the new database if it doesn't already exist\n con.database = name;\n var sql = \"CREATE DATABASE IF NOT EXISTS \" + name;\n con.query(sql, function (err, result) {\n if (err) throw err;\n console.log(\"Database '\" + name + \"' created or already exists\");\n });\n\n // Set the new database as the active one\n con.query(\"USE \" + name, function (err, result) {\n if (err) throw err;\n console.log(\"Database '\" + name + \"' selected\");\n });\n}", "title": "" }, { "docid": "d062ddc3da5cee705d5ce94fd9f36e75", "score": "0.6268143", "text": "async function setUpEnvironment(){\n var db = new Database(testEnvironmentDB); \n await db.query('DROP TABLE AuthDatabase', []);\n await db.query('CREATE TABLE AuthDatabase(user_id varchar(255),group_id varchar(255), password varchar(255))',[]);\n db.close();\n}", "title": "" }, { "docid": "8d47b8f840811dfa9a77cc4e2e41cd80", "score": "0.6193398", "text": "function CreateDatabase(name){\n return new sqlite3.Database(name+'.db');\n }", "title": "" }, { "docid": "09b1a260677f451cd6bf47899bfd6575", "score": "0.6161944", "text": "initializeDb() {\r\n db.authenticate().then(\r\n () => {\r\n console.log('DB Connection has been established');\r\n },\r\n err => {\r\n console.error('Unable to connect to the DB:', err);\r\n }\r\n );\r\n }", "title": "" }, { "docid": "0596637fb4e80351fddb3912d1df6237", "score": "0.6161793", "text": "function CreatingDbFileImpl(database){\n\t\n\t// database path\n\tvar file = getFile(database);\n\t\n\t// calling function to create db\n\tCreateDb(database, file);\n}", "title": "" }, { "docid": "cd743949ec5195e8d45ee7151fd7bed8", "score": "0.61599797", "text": "function _createDatabase(dbConnection, dbName) {\n // Check that the given dbName is indeed a string\n if (typeof dbName !== \"string\")\n throw new TypeError(`Expected string, got '${dbName}' instead.`);\n\n // Construct query string and pass it to the connection object to query the database\n return dbConnection.query(`CREATE DATABASE IF NOT EXISTS ${dbName}`)\n .then((result) => {\n logger.log(`Created new database '${dbName}'`);\n return Promise.resolve(result);\n })\n .catch((err) => Promise.reject(new DbOperationError(`Creating database with name ${dbName} failed\\n\\n:${err.stack}`)));\n}", "title": "" }, { "docid": "24c3e949db18123e7489b8a9d38061be", "score": "0.6125337", "text": "function createDB(dbName) {\n \n userDB[dbName] = mongoose.Schema({\n name: { type: String, required: true },\n email: { type: String, required: true, unique: true },\n password: { type: String, required: true, min: 6 },\n });\n return mongoose.model(`${dbName}`,userDB[dbName]);\n}", "title": "" }, { "docid": "440d29da4e8e55aca2f1cda88285bfbb", "score": "0.61141926", "text": "function init_database(app)\n{\n\tvar options = app.get('config');\n\tif (options.dburi)\n\t{\n\t\t//database connection for guest sessions. This allows us to specify a different DB username for guest sessions\n\t\tvar guest_db = new dblib({\n\t\t\tdburi: options.guest_dburi || options.dburi,\n\t\t\tdebug: options.debug,\n\t\t\tsession_id: 'grape-guest-' + process.pid.toString(),\n\t\t\tusername: 'guest',\n\t\t\tdebug_logger: function(s) { app.get('logger').db(s); }\n\t\t});\n\n\t\tguest_db.on('error', function(err) {\n\t\t\tapp.get('logger').log('db', 'error', err);\n\t\t});\n\n\t\tguest_db.on('debug', function(msg) {\n\t\t\tapp.get('logger').log('db', 'debug', msg);\n\n\t\t});\n\t\tguest_db.on('notice', function(msg) {\n\t\t\tapp.get('logger').log('db', 'debug', 'Notice: ' + msg);\n\t\t});\n\n\t\tguest_db.on('end', function() {\n\t\t\tif (!guest_db.no_reconnect)\n\t\t\t{\n\t\t\t\tapp.get('logger').log('db', 'info', 'Guest db conn disconnected. Restarting');\n\t\t\t\tguest_db.connect();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tapp.get('logger').log('db', 'info', 'Guest db conn disconnected');\n\t\t\t}\n\t\t});\n\n\t\tapp.set('guest_db', guest_db);\n\t}\n}", "title": "" }, { "docid": "77f820acff6212cdd2a7e78b775e9baa", "score": "0.61038077", "text": "static createDatabase(settings, name) {\r\n const opts = {\r\n dialect: settings.type,\r\n host: settings.host,\r\n port: settings.port,\r\n logging: false\r\n };\r\n let tmp;\r\n let defaultDatabase;\r\n if (settings.type == 'mysql') {\r\n defaultDatabase = 'sys';\r\n }\r\n else if (settings.type == 'postgres') {\r\n defaultDatabase = 'postgres';\r\n }\r\n return new Promise((accept, reject) => {\r\n const dbName = defaultDatabase === 'sys' ? '`' + `${name}` + '`' : `\"${name}\"`;\r\n try {\r\n tmp = new sequelize_1.Sequelize(defaultDatabase, settings.username, settings.password, opts);\r\n }\r\n catch (e) {\r\n return reject(e);\r\n }\r\n return tmp.query(`CREATE DATABASE ${dbName}`).spread((results, metadata) => {\r\n return accept();\r\n }).catch(err => reject(err.message));\r\n });\r\n }", "title": "" }, { "docid": "78eca452bbd42e9139deb33104a8f1b7", "score": "0.6091574", "text": "async recreateDatabase() {\n\t\n try {\n\n // Cache the current value of YADAMU_DATABASE and remove it from this.parameters. This prevents the call to setTargetDatabase() from overriding the value of this.connectionProperties.database in createConnectionPool()\n\t\t\n \t const YADAMU_DATABASE = this.parameters.YADAMU_DATABASE;\n\t\tconst database = this.connectionProperties.database\n delete this.parameters.YADAMU_DATABASE;\n \n\t // Create a connection pool using a well known database that must exist\t \n\t this.connectionProperties.database = 'master';\n await super.initialize();\n\n\t this.parameters.YADAMU_DATABASE = YADAMU_DATABASE\n\t this.connectionProperties.database = database;\n\n let results; \n const dropDatabase = this.statementLibrary.DROP_DATABASE\n results = await this.executeSQL(dropDatabase); \n \n const createDatabase = `create database \"${this.parameters.YADAMU_DATABASE}\" COLLATE ${this.DB_COLLATION}`;\n results = await this.executeSQL(createDatabase); \n\n await this.finalize()\n\t } catch (e) {\n\t\tthis.yadamuLogger.qa([this.DATABASE_VENDOR,'recreateDatabase()'],e.message);\n\t\tthrow e\n\t }\n\t \n }", "title": "" }, { "docid": "dc40c1f6ecfbe73491d8d9013eae06dc", "score": "0.6058179", "text": "function newDatabaseUsingSecret(resources, dbImageName, dbServiceName, secretName, env, secretEnv) {\n if (resources.service(dbServiceName).length === 0) {\n // Create the database resource definitions\n return newApp(dbServiceName, dbImageName, env)\n .then((appRes) => setDeploymentEnvFromSecret(appRes, secretName, secretEnv))\n .then((appRes) => {\n const res = resources.add(appRes);\n //console.log(`Database ${dbServiceName} added`);\n return res;\n });\n } else {\n //console.log(`Database ${dbServiceName} already exists`);\n }\n return Promise.resolve(resources);\n}", "title": "" }, { "docid": "d5cefe3c6df72bc8274c2f49c9cc80ac", "score": "0.604214", "text": "function main(){\n // connect to database and initiate DAO\n var dbFile = \"./api/db/app.db\"; // database name\n const dao = new AppDAO(dbFile)\n const users = new Users(dao)\n const userSettings = new UserSettings(dao)\n const managerSettings = new ManagerSettings(dao)\n // const role = new Role(dao) // TO BE REMOVED\n // const state = new State(dao) // TO BE REMOVED\n // const weather = new Weather(dao) // TO BE REMOVED\n\n\n // Create a new database-file if not exist\n try{\n if(fs.existsSync(dbFile)){\n console.log(\"Using database: \"+path.basename(dbFile, path.extname(dbFile)));\n } else {\n // create new database file\n fs.writeFile(dbFile,\"\", function (err){\n if(err) throw err;\n console.log(\"Successfully created database \"+path.basename(dbFile, path.extname(dbFile))+\"!\");\n });\n }\n } catch(err) {\n console.error(err);\n }\n}", "title": "" }, { "docid": "13a4fbe94bc51c75e367212d7b4efc0d", "score": "0.60420465", "text": "registerDatabase() {\n this.$container.singleton('Adonis/Lucid/Database', () => {\n const config = this.$container.use('Adonis/Core/Config').get('database', {});\n const Logger = this.$container.use('Adonis/Core/Logger');\n const Profiler = this.$container.use('Adonis/Core/Profiler');\n const Emitter = this.$container.use('Adonis/Core/Event');\n return new Database_1.Database(config, Logger, Profiler, Emitter);\n });\n }", "title": "" }, { "docid": "8025377e7a4e614ab0164aa0e545b2ec", "score": "0.6035092", "text": "function initDatabase() {\n console.debug('called initDatabase()');\n\n try {\n if (!window.openDatabase) {\n alert('not supported');\n } else {\n var shortName = 'MojokertoDB';\n var version = '1.0';\n var displayName = 'DataBase Mojokerto';\n var maxSizeInBytes = 65536;\n db = openDatabase(shortName, version, displayName, maxSizeInBytes);\n createTableIfNotExists();\n }\n } catch(e) {\n if (e == 2) {\n alert('Invalid database version');\n } else {\n alert('Unknown error ' + e);\n }\n return;\n }\n}", "title": "" }, { "docid": "58440f4f36668c786172088110231a37", "score": "0.6034502", "text": "function createDb(res){\r\n nano.db.create(databaseName, function(err, body) {\r\n if (!err) {\r\n console.log(databaseName + ' created!');\r\n \r\n pfdb = nano.use(databaseName);\r\n \r\n //TODO: adjust this that it uses the design_doc dir\r\n var view = {};\r\n view.name = \"basic\"\r\n view.views = {\r\n 'all': {\r\n 'map': function(doc){\r\n if(doc._id.indexOf('fatality') === 0){\r\n emit(doc._id,doc.value);\r\n }\r\n }\r\n },\r\n 'highest_id': {\r\n 'map': function(doc){\r\n if(doc._id.indexOf('fatality') === 0){\r\n var out = parseInt(doc._id.replace('fatality_','')); \r\n emit(out,out);\r\n }\r\n },\r\n 'reduce': '_stats'\r\n }\r\n };\r\n\r\n /*\r\n view_creator.insert(view, function(body, errMsg){\r\n if (!errMsg) {\r\n \r\n createDatabaseActions.push({\r\n label: 'View',\r\n value: 'Created \"all\" and \"highest_id\" view for \"_design/basic\"'\r\n });\r\n\r\n addRecords();\r\n\r\n handleResponse(res, {\r\n 'title' : 'Success!',\r\n 'message' : 'Database is now available.',\r\n 'actions' : createDatabaseActions,\r\n 'database' : databaseName\r\n });\r\n \r\n } else {\r\n console.log(errMsg)\r\n }\r\n });\r\n */\r\n\r\n } else {\r\n \r\n createDatabaseActions.push({\r\n label: 'Error',\r\n value: err\r\n });\r\n\r\n createDatabaseActions.push({\r\n label: 'Body',\r\n value: body\r\n });\r\n\r\n handleResponse(res, {\r\n 'title' : 'Error',\r\n 'message' : 'Database was not created.',\r\n 'actions' : createDatabaseActions\r\n });\r\n }\r\n });\r\n}", "title": "" }, { "docid": "bce38cbd19ccfa89daff5d91979eea84", "score": "0.60221875", "text": "getDatabaseInstance(databaseName) {\n let databasePath = path.join(__dirname, '../DB/', databaseName); // Generating the path to the database in the project directory\n console.log('Database File Path: ', databasePath);\n return new sqlite3.Database(databasePath, function (err) { // Getting the DB instance by passing the Database file path \n if (err) console.log('Error Connecting to Database: ' + err);\n else console.log('Database connection successful!');\n });\n }", "title": "" }, { "docid": "cf6d6257f70b5e95017a3d1fad0e3e46", "score": "0.5982802", "text": "function create(db, next) {\n request({\n method: 'PUT',\n url: url + '/' + db,\n 'auth': {\n 'user': config.user,\n 'pass': config.password\n },\n json: true\n // 'headers': {\n // 'content-type': 'application/json'\n // }\n }, function(err, response) {\n var msg = '';\n var statusCode = 0;\n if (err && err.code === 'ECONNREFUSED') {\n msg = \"Could not connect to CouchDB. Please check connection\";\n statusCode = 502;\n }\n else {\n statusCode = response.statusCode;\n // If database already exist, it's not an error\n if (response.statusCode == 412) {\n msg = 'Database ' + db + ' already exist';\n err = null;\n }\n else if (response.statusCode == 201) {\n msg = 'Database ' + db + ' was created';\n }\n }\n next(err, {msg: msg, statusCode: statusCode});\n });\n }", "title": "" }, { "docid": "bf020b290f9a392fbde033601d0cf008", "score": "0.59636265", "text": "function db_init() {\n let db = new sqlite3.Database(appSettings.db_file_name, (err) => {\n if (err) {\n logger.error(`Error occurred while opening database file: ${appSettings.db_file_name}: ${err.message}`, 'init()');\n } else {\n logger.info(`Database ${appSettings.db_file_name} is open for business!`);\n // Make sure to close this database connection when Node exits\n process.on('exit', (code) => {\n logger.info(`CLOSING Database ${appSettings.db_file_name}, exit code: ${code}`);\n db.close((err) => {\n logger.error(`Error closing DB with message: ${err.message}: and code ${code}`);\n });\n });\n }\n });\n return db;\n}", "title": "" }, { "docid": "5682f95d62d26199e39d3e8f019998d1", "score": "0.5960223", "text": "function createDbTable(t,dbInfo,callback,errorCallback){t.executeSql('CREATE TABLE IF NOT EXISTS '+dbInfo.storeName+' '+'(id INTEGER PRIMARY KEY, key unique, value)',[],callback,errorCallback);}// Open the WebSQL database (automatically creates one if one didn't", "title": "" }, { "docid": "7b0c67a513527e46e99ad638e8480809", "score": "0.5957142", "text": "function DB() {\n var self = this;\n\n var params = url.parse(settings.postgre_url);\n var auth = params.auth.split(':');\n var config = {\n user: auth[0],\n password: auth[1],\n host: params.hostname,\n port: params.port,\n database: params.pathname.split('/')[1],\n max: settings.postgre_pool_connection_count,\n ssl: false,\n };\n\n self.pool = new pg.Pool(config);\n}", "title": "" }, { "docid": "53c61f49d96cb2c3fb035a8221e0d96f", "score": "0.59413743", "text": "function createDB(r, name) {\n return new Promise((resolve, reject) => {\n r.dbList().run().then((list) => {\n if (list.indexOf(name) > -1) {\n log(`Database ${name} already exist. Skipping.`);\n resolve(true);\n } else {\n log(`Database not found. Creating ${name}`);\n r.dbCreate(name).run().then(() => {\n log(`Database ${name} created.`);\n resolve(true);\n });\n }\n });\n });\n}", "title": "" }, { "docid": "90a5cbe118b0295b846154d1ff2205e3", "score": "0.5928727", "text": "function initDB()\r\n {\r\n console.log(\"initDB() is running\");\r\n /*\r\n Every user has their own Database, and it's named\r\n after their email address. Therefore, it is based on\r\n the current user logged in (isLoggedIn).\r\n This is a local scope Object, that can only be used\r\n in THIS function, as long as it's running.\r\n */\r\n var currentDB = localStorage.getItem(\"isLoggedIn\");\r\n\r\n // Then create a new database with their email\r\n db = new PouchDB(currentDB);\r\n\r\n // Return the Database Object to the Global Scope\r\n // So that we can use that Object anywere else in the app\r\n return db;\r\n }", "title": "" }, { "docid": "610e8b0f9bd9c2965e9ccd6905d928c7", "score": "0.5925828", "text": "constructor(database) {\n this.database = database;\n }", "title": "" }, { "docid": "55cba4f3b228c7c57f926a9c29545645", "score": "0.59111124", "text": "function initDB(){\n var shortName = 'UsuarioPS';\n var version = '1.0';\n var displayName = 'UsuarioPS';\n var maxSize = 65536; // Em bytes\n localDB = window.openDatabase(shortName, version, displayName, maxSize);\n}", "title": "" }, { "docid": "4647e15571688451bdd6391d44bc5799", "score": "0.5902018", "text": "function opCreateDb(dbInfo) {\n\t logger.trace('[opCreateDb]: ', dbInfo);\n\t var dbs = {};\n\t switch (dbInfo.type) {\n\t case 'MSG':\n\t dbs.msg = treo('rs_msg_db-' + dbInfo.accountGuid, _getVersionedTreoSchema(MSG_DB_VERSIONED_SCHEMA));\n\t break;\n\t case 'SIFT':\n\t if (!dbInfo.siftGuid) {\n\t throw new Error('[opCreateDb]: dbInfo.siftGuid undefined');\n\t }\n\t logger.trace('[opCreateDb]: creating SIFT db');\n\t var schema = _getTreoSchema(dbInfo.schema, true);\n\t // Add user and redsift stores to sift db.\n\t schema = schema.addStore('_user.default').addStore('_redsift');\n\t dbs.db = treo(dbInfo.siftGuid + '-' + dbInfo.accountGuid, schema);\n\t dbs.msg = treo('rs_msg_db-' + dbInfo.accountGuid, _getVersionedTreoSchema(MSG_DB_VERSIONED_SCHEMA));\n\t break;\n\t case 'SYNC':\n\t logger.trace('[opCreateDb]: creating SYNC db');\n\t dbs.db = treo('rs_sync_log-' + dbInfo.accountGuid, _getTreoSchema(SYNC_DB_SCHEMA));\n\t break;\n\t case 'CLIENT':\n\t dbs.db = treo('rs_client_db-' + dbInfo.clientName, _getTreoSchema(CLIENT_DB_SCHEMA));\n\t break;\n\t default:\n\t throw new Error('[opCreateDb]: unsupported db type: ' + dbInfo.type);\n\t }\n\t return dbs;\n\t}", "title": "" }, { "docid": "71845da1b9d8377d1b960b58e18fd428", "score": "0.58719516", "text": "function userDB() { }", "title": "" }, { "docid": "b25bfc14247dcddd5288f313dc7d8348", "score": "0.5870181", "text": "initDb() {\n\n }", "title": "" }, { "docid": "8bc2aed3f2c71a808cda4108a05baa39", "score": "0.5854461", "text": "Database() {}", "title": "" }, { "docid": "ef27a034547b89ace3a2975fccb223d2", "score": "0.58345664", "text": "function dbCreate() {\n console.info(\"Success: Database created successfully\");\n }", "title": "" }, { "docid": "76860d84ad2b6d8dbd89383e837c4e61", "score": "0.5827173", "text": "async function database(req, res, next) {\n if (!client.isConnected()) await client.connect();\n req.dbClient = client;\n req.db = client.db('UAP');\n return next();\n}", "title": "" }, { "docid": "62e1f775ebad8a3e01c1f52dbd79869f", "score": "0.5808679", "text": "constructor(authDB) {\n this.pool = mysql.createPool({\n host: process.env.DB_HOST,\n user: process.env.DB_USER,\n password: process.env.DB_PASS,\n database: \"WHAM_TEST\"\n });\n this.authDB = authDB;\n }", "title": "" }, { "docid": "5ae7dea5d27e19ec179435982d64c18a", "score": "0.58030254", "text": "function initializeDb () {\n\tif (fsExistsSync(usersDbFile)) {\n\t\tdb.users = new Datastore(usersDbFile)\n\t\tdb.users.loadDatabase()\n\t} else {\n\t\tfse.ensureFileSync(usersDbFile)\n\t\tdb.users = new Datastore(usersDbFile)\n\t\tdb.users.loadDatabase(function () {\n\t\t\t// insert default user info\n\t\t\tdb.users.insert([{username: 'admin', password: '123456'}])\n\t\t})\n\t}\n\n\tif (fsExistsSync(schemesDbFile)) {\n\t\tdb.schemes = new Datastore(schemesDbFile)\n\t\tdb.schemes.loadDatabase()\n\t} else {\n\t\tfse.ensureFileSync(schemesDbFile)\n\t\tdb.schemes = new Datastore(schemesDbFile)\n\t\tdb.schemes.loadDatabase(function () {\n\t\t\t// insert into default schemes\n\t\t\tconst schemes = [\n\t\t\t\t{\n\t\t\t\t\tid: uuid.v4(),\n\t\t\t\t\tname: \"Theme scheme1\",\n\t\t\t\t\tisCurScheme: false,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: \"http://github.com\",\n\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\twidth: 500,\n\t\t\t\t\t\t\theight: 300,\n\t\t\t\t\t\t\tzoom: 1\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: uuid.v4(),\n\t\t\t\t\tname: \"Theme scheme2\",\n\t\t\t\t\tisCurScheme: false,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: \"http://github.com\",\n\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\twidth: 500,\n\t\t\t\t\t\t\theight: 300,\n\t\t\t\t\t\t\tzoom: 1\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: uuid.v4(),\n\t\t\t\t\tname: \"Theme scheme3\",\n\t\t\t\t\tisCurScheme: false,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: \"http://github.com\",\n\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\twidth: 500,\n\t\t\t\t\t\t\theight: 300,\n\t\t\t\t\t\t\tzoom: 1\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t\tdb.schemes.insert(schemes)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "41810bda36b6b596573189d4aaf9ecf7", "score": "0.5801537", "text": "function setupDB() {\n\tlet userHistoryQuery = \"CREATE TABLE IF NOT EXISTS user_history (id INT PRIMARY KEY AUTO_INCREMENT, user_id INT NOT NULL, createdAt DATETIME DEFAULT CURRENT_TIMESTAMP, resistance INT NOT NULL, tolerance INT NOT NULL, colors VARCHAR(100) NOT NULL, descrip VARCHAR(200) NOT NULL)engine=InnoDB;\";\n\tlet usersQuery =\"CREATE TABLE IF NOT EXISTS users (id INT PRIMARY KEY AUTO_INCREMENT, createdAt DATETIME NOT NULL, username VARCHAR(120), token VARCHAR(200) NOT NULL)engine=InnoDB;\";\n\tlet sessionsQuery = \"CREATE TABLE IF NOT EXISTS sessions (id INT PRIMARY KEY AUTO_INCREMENT, createdAt DATETIME NOT NULL, user_id INT NOT NULL, token VARCHAR(200) NOT NULL)engine=InnoDB;\";\n\n\t_query(userHistoryQuery, {\n\t\tsuccess: function() {\n\t\t\tconsole.info(chalk.blue(\"*\")+\" user_history table conditionally autogenerated\");\n\t\t},\n\t\tfailure: function() {\n\t\t\tconsole.error(chalk.red(\"~\")+\" user_history was unable to be autogenerated\");\n\t\t}\n\t})\n\n\t_query(usersQuery, {\n\t\tsuccess: function() {\n\t\t\tconsole.info(chalk.blue(\"*\")+\" users table conditionally autogenerated\");\n\t\t},\n\t\tfailure: function() {\n\t\t\tconsole.error(chalk.red(\"~\")+\" users was unable to be autogenerated\");\n\t\t}\n\t})\n\n\t_query(sessionsQuery, {\n\t\tsuccess: function() {\n\t\t\tconsole.info(chalk.blue(\"*\")+\" sessions table conditionally autogenerated\");\n\t\t},\n\t\tfailure: function() {\n\t\t\tconsole.error(chalk.red(\"~\")+\" sessions was unable to be autogenerated\");\n\t\t}\n\t})\n\n}", "title": "" }, { "docid": "7a856751ab02fbef87a19c92ff1c2b48", "score": "0.5789537", "text": "function initDb () {\n\n\tlet db = Db(DB_FILE);\n\n\tdb.connect();\n\n\treturn db.init(DB_SCHEMA).then(() => {\n\t\tdb.close();\n\t}).catch((err) => {\n\t\tconsole.log(err);\n\t});\n\n}", "title": "" }, { "docid": "f35bdff5368d2fc824a3124e54b02b7d", "score": "0.578439", "text": "openDatabase(databaseName = 'db') {\n\n let database = this.databases[databaseName];\n\n if (!database) {\n database = SQLite.openDatabase(`${databaseName}.db`);\n this.databases[databaseName] = database;\n }\n return database;\n}", "title": "" }, { "docid": "7c055ab1f296be367286d8890f1a546f", "score": "0.5776699", "text": "startDB () {\n return new Promise( (resolve, reject) => {\n if ( this.config.database ) {\n this.initDB( this.config.database.filename, (err,db) => {\n if (err) return reject(err);\n else return PROM.log('core', 'Successfully created a database')\n .then( resolve )\n .catch( PROM.errorHandler ); \n } );\n } else {\n resolve();\n }\n } );\n }", "title": "" }, { "docid": "4360660cfc8a0e1959810511da2d4e2d", "score": "0.5774685", "text": "function useDb (databaseName) {\n if (connections[databaseName]) {\n return connections[databaseName]\n }\n\n if (databaseName) {\n let option = Object.assign({}, options.arango)\n option.databaseName = databaseName\n\n connections[databaseName] = new Arangojs.Database(option)\n\n return connections[databaseName]\n }\n\n connections[databaseName] = options.arango.driver\n\n return connections[databaseName]\n }", "title": "" }, { "docid": "a676ffa1091a4288c68ce1360bb98b93", "score": "0.5764642", "text": "function createSysDB(__openDatabase, success, failure) {\n function sysDbCreateError(tx, err) {\n err = (0, _DOMException.webSQLErrback)(err);\n _CFG2.default.DEBUG && console.log('Error in sysdb transaction - when creating dbVersions', err);\n failure(err);\n }\n\n if (sysdb) {\n success();\n } else {\n sysdb = __openDatabase(typeof _CFG2.default.memoryDatabase === 'string' ? _CFG2.default.memoryDatabase : _path2.default.join(typeof _CFG2.default.sysDatabaseBasePath === 'string' ? _CFG2.default.sysDatabaseBasePath : _CFG2.default.databaseBasePath || '', '__sysdb__' + (_CFG2.default.addSQLiteExtension !== false ? '.sqlite' : '')), 1, 'System Database', _CFG2.default.DEFAULT_DB_SIZE);\n sysdb.transaction(function (systx) {\n systx.executeSql('CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);', [], success, sysDbCreateError);\n }, sysDbCreateError);\n }\n}", "title": "" }, { "docid": "cbbb5d2179688fffa283bac4ccf12068", "score": "0.5745066", "text": "function db() {\n\t\tif( $window.sqlitePlugin ) {\n\t\t\treturn $window.sqlitePlugin.openDatabase({ name: dbName, location: 2 });\n\t\t} else {\n\t\t\t// Special case for development : if window.sqlitePlugin is not set\n\t\t\t// and we are on a server (http://), we use the browser's WebSQL\n\t\t\tif( $window.location.protocol == 'http:' && $window.openDatabase ) {\n\t\t\t\treturn $window.openDatabase( dbName, '1.0', dbName, 10 * 1024 * 1024 );\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "c06f7cc3b03dd529927cafaaca30eee3", "score": "0.57399106", "text": "async _createDatabase(client) {\n try {\n // check database existence\n return await client.queryAsync(`USE \\`${this._database}\\``);\n }\n catch (error) {\n if (error.code === 'ER_BAD_DB_ERROR') {\n try {\n await client.queryAsync(`CREATE DATABASE \\`${this._database}\\``);\n }\n catch (error) {\n throw MySQLAdapter.wrapError('unknown error', error);\n }\n return (await this._createDatabase(client));\n }\n else {\n const msg = error.code === 'ER_DBACCESS_DENIED_ERROR'\n ? `no access right to the database '${this._database}'`\n : 'unknown error';\n throw MySQLAdapter.wrapError(msg, error);\n }\n }\n }", "title": "" }, { "docid": "0417534c4087ca3a08ce845f705032e6", "score": "0.57205003", "text": "function createSysDB(success, failure) {\n function sysDbCreateError(tx, err) {\n err = idbModules.util.findError(arguments);\n idbModules.DEBUG && console.log(\"Error in sysdb transaction - when creating dbVersions\", err);\n failure(err);\n }\n\n if (sysdb) {\n success();\n }\n else {\n sysdb = window.openDatabase(\"__sysdb__\", 1, \"System Database\", DEFAULT_DB_SIZE);\n sysdb.transaction(function(tx) {\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS dbVersions (name VARCHAR(255), version INT);\", [], success, sysDbCreateError);\n }, sysDbCreateError);\n }\n }", "title": "" }, { "docid": "d12670fe0fd009b81e815c60fd1ea6f5", "score": "0.5705521", "text": "function setDb(url) {\n if (process.env.USERDOMAIN === 'ALTUSLAPTOP') {\n console.log(\"Local ENV\")\n const localDB = 'mongodb://localhost/todo_app_test'\n const url = process.env.DATABASEURL || localDB;\n return url;\n } else {\n console.log('hosted ENV');\n // for testing onyl console.log(process.env.DATABASEURL);\n return url = process.env.DATABASEURL;\n }\n}", "title": "" }, { "docid": "5edd915555aca96bdc0e08c4b75e8e9a", "score": "0.5703147", "text": "getDB() {\n return this.sqlite.create({\n name: 'dbXexpress.db',\n location: 'default',\n });\n }", "title": "" }, { "docid": "9b39ff7bb3a8c64ec9cd761f004ed297", "score": "0.5698461", "text": "function getDb() {\n if (database) {\n return database;\n } else {\n throw 'Database not found';\n };\n \n}", "title": "" }, { "docid": "7d8c701707a7e5b32eff3d4f11c71baf", "score": "0.5683128", "text": "async setupDB() {\n console.log('networkmanager: ' + this.networkManager + ' | ipfs: ' + this.networkManager.ipfs);\n // Create a database\n this.database = new OrbitDB(this.networkManager.ipfs);\n let db = await this.database.log('database name');\n // Add an entry to the database\n let hash = await db.add('hello world');\n // Get last 5 entries\n let latest = db.iterator({limit: 5}).collect();\n console.log(JSON.stringify(latest, null, 2))\n }", "title": "" }, { "docid": "1f9700eda0a44fba3ee84902c568288c", "score": "0.5671997", "text": "function getDatabase() {\n loadDatabase();\n return database;\n}", "title": "" }, { "docid": "93a0607e3a75446ee8b0281cf5281eac", "score": "0.5662227", "text": "get database() { throw new Error('The database is not available in tests.'); }", "title": "" }, { "docid": "2f4c7493e4e2aae88f487045a3609099", "score": "0.56573874", "text": "function createSysDB(__openDatabase, success, failure) {\n function sysDbCreateError(tx, err) {\n err = (0, _DOMException.webSQLErrback)(err || tx);\n _CFG2.default.DEBUG && console.log('Error in sysdb transaction - when creating dbVersions', err);\n failure(err);\n }\n\n if (sysdb) {\n success();\n } else {\n sysdb = __openDatabase(typeof _CFG2.default.memoryDatabase === 'string' ? _CFG2.default.memoryDatabase : _path2.default.join(typeof _CFG2.default.sysDatabaseBasePath === 'string' ? _CFG2.default.sysDatabaseBasePath : _CFG2.default.databaseBasePath || '', '__sysdb__' + (_CFG2.default.addSQLiteExtension !== false ? '.sqlite' : '')), 1, 'System Database', _CFG2.default.DEFAULT_DB_SIZE);\n sysdb.transaction(function (systx) {\n systx.executeSql('CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);', [], function (systx) {\n if (!_CFG2.default.useSQLiteIndexes) {\n success();\n return;\n }\n systx.executeSql('CREATE INDEX IF NOT EXISTS dbvname ON dbVersions(name)', [], success, sysDbCreateError);\n }, sysDbCreateError);\n }, sysDbCreateError);\n }\n}", "title": "" }, { "docid": "a24cbc06f7497e8d0602e9ea773ca1ea", "score": "0.56512415", "text": "function constructDatabase(targetDB, targetFolder) {\n // create instance of card database in memory 2MB, prevents sychronous read request and server lag.\n var database,\n cards = {};\n\n function handleQueryRow(error, row) {\n if (error) {\n //throw error;\n console.log(error); //fuck it keep moving.\n }\n cards[row.id] = row;\n }\n\n database = new sqlite3.Database(targetDB, sqlite3.OPEN_READ);\n database.on(\"open\", function () {\n console.log(\"database was opened successfully\");\n });\n database.on(\"close\", function () {\n console.log(\"database was closed successfully\");\n });\n // database.each(queryfor.statistics, {}, handleQueryRow, function () {});\n // database.end();\n\n return function (request) {\n //function used by the core to process DB\n var code = request.code;\n\n return struct({\n code: code,\n alias: cards[code].alias || 0,\n setcode: cards[code].setcode || 0,\n type: cards[code].type || 0,\n level: cards[code].level || 1,\n attribute: cards[code].attribute || 0,\n race: cards[code].race || 0,\n attack: cards[code].attack || 0,\n defence: cards[code].defense || 0\n });\n };\n}", "title": "" }, { "docid": "437b98fd514412215840d789733299f4", "score": "0.5649171", "text": "function createDevDB(req, res, next) {\n console.log('in createDB', req.body);\n console.log('dev in createDB', req.body.dev);\n var devDB = sheepDB.useDb(req.body._id + '_' + req.body.database);\n var devModel = devDB.model('label', new mongoose.Schema({\n createdBy: String\n }));\n devModel({\n createdBy: req.body.dev.userName\n }).save(function(err, results){\n if (err) res.status(409).send('error');\n Models.DB.findOne({_creator: req.body._id, name: req.body.database}, function(err, db){\n if (err) res.json({error : 'Error'});\n console.log('db', db);\n req.body.db = db;\n res.json(db);\n });\n });\n}", "title": "" }, { "docid": "a14996cf3d03ddf27d0d6153a529319e", "score": "0.5643385", "text": "function createDbUrl() {\n var url = 'mongodb://';\n if (config.mongodb.password && config.mongodb.password.length > 0) {\n url = url + config.mongodb.username + ':' + config.mongodb.password + '@';\n }\n url = url + config.mongodb.host + ':' + config.mongodb.port + '/' + config.mongodb.db;\n return url;\n}", "title": "" }, { "docid": "9b33f430007c23ebd355a3013abb7be0", "score": "0.56393385", "text": "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n } // Open the WebSQL database (automatically creates one if one didn't", "title": "" }, { "docid": "29779761bc5f56afadac774c5b860ecf", "score": "0.5632583", "text": "initDatabase() {\n const stmt_str = \"CREATE TABLE IF NOT EXISTS codes ( \" +\n \"code_hash TEXT UNIQUE, reward_type TEXT, reward_value INTEGER, \" + \n \"target_server TEXT, uses INTEGER DEFAULT 0, max_use INTEGER, expiration TEXT)\"\n\n const stmt = this._db.prepare(stmt_str)\n stmt.run()\n }", "title": "" }, { "docid": "8c76cd810b117df73dd58d7e6706569c", "score": "0.5609272", "text": "function initDatabase()\r\n\t{ \r\n\t\ttry {\r\n\t\t\tif (!window.openDatabase) // Check browser is supported SQLite or not.\r\n\t\t\t{\r\n\t\t\t\talert('Databases are not supported in this browser.');\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcreateTable(); // If supported then call Function for create table in SQLite\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (e) {\r\n\t\t\tif (e == 2) {\r\n\t\t\t\t// Version number mismatch. \r\n\t\t\t\tconsole.log(\"Invalid database version.\");\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log(\"Unknown error \" + e + \".\");\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "c922735e7d45bbab1ae8690ef8750ef9", "score": "0.5607772", "text": "function createDatabase(connection) {\n\tconsole.log (\"db_setup.createDatabase(\"+connection+\")\");\n\tdb.query(\"CREATE DATABASE `\"+database_name+\"`\", function(error, result, fields) {\n\t\tif (error==null) {\n\t\t\tconsole.log (\" Database \\\"\"+database_name+\"\\\" successfully created.\");\n\t\t} else if (error.toString().indexOf(\"ER_DB_CREATE_EXISTS\") > -1) {\n\t\t\tconsole.log (\" Database \\\"\"+database_name+\"\\\" already exists. Skipping.\");\n\t\t} else {\n\t\t\tconsole.log (\" Error creating \\\"\"+database_name+\"\\\": \"+error);\n\t\t}\n\t\tincompleteActions--;\n\t\texecNext(connection);\n\t});\n}", "title": "" }, { "docid": "e88c45cfef4528416647948f4bd9c61f", "score": "0.5590927", "text": "function createDB() {\n console.log('Creating store database...');\n\n connection.query(\n\t\t'CREATE DATABASE IF NOT EXISTS bamazon',\n\n\t\tfunction (err, res) {\n\t\t\tif (err) throw err;\n\t\t}\n\t);\n\n\tuseDatabase();\n\n\tconnection.query(\n\t\t'CREATE TABLE IF NOT EXISTS products (' +\n\t\t 'item_id INT NOT NULL AUTO_INCREMENT,' +\n\t\t 'product_name VARCHAR(32) NOT NULL,' +\n \t\t 'department_name VARCHAR(32) NOT NULL,' +\n \t\t 'price DEC(10,2) NOT NULL DEFAULT 0,' +\n \t\t 'stock_quantity INT(10) DEFAULT 0,' +\n\t\t 'PRIMARY KEY (item_id)' +\n\t ')',\n\n\t\tfunction (err, res) {\n\t\t\tif (err) throw err;\n\t\t}\n\t);\n\n\tvar values = [\n\t\t['apples', 'produce', 0.50, 25],\n\t\t['bananas', 'produce', 0.25, 48],\n\t\t['Doritos chips', 'snacks', 1.99, 18],\n\t\t['tortilla chips', 'snacks', 1.29, 20],\n\t\t['salsa', 'snacks', 1.89, 25],\n\t\t['beef filet mignon', 'meats', 15.00, 10],\n\t\t['chicken wing', 'meats', 0.59, 50],\n\t\t['milk', 'dairy', 1.68, 30],\n\t\t['parmesean cheese', 'dairy', 2.00, 22],\n\t\t['pork loin', 'meat', 8.95, 14],\n\t\t['Amy\\'s pizza', 'frozen', 9.15, 4],\n\t\t['peas', 'frozen', 2.05, 30]\n\t];\n\n\tconnection.query(\n\t\t'INSERT INTO products ' +\n\t\t'(product_name, department_name, price, stock_quantity) ' +\n\t\t'VALUES ?', [values],\n\n\t\tfunction (err, res) {\n\t\t\tif (err) throw err;\n\t\t}\n\t);\n\n\tdisplayInventory();\n}", "title": "" }, { "docid": "fc72146f9ddb832db186e96fa730804b", "score": "0.5583176", "text": "async function initDatabaseConnection() {\n await makeCache(DBURL);\n //console.log(DBURL); \n queryRunner = await makeQueryRunner(\n DBURL,\n process.env.DB_SCHEMAS,\n {\n ...options,\n readCache: `${__dirname}/postgraphile.cache`\n }\n );\n}", "title": "" }, { "docid": "2099eeec3f7fc670627c1977c442f5a7", "score": "0.5579029", "text": "function init() {\n return new Promise(\n (resolve, reject) => {\n if (!DB_FILE) return reject((() => {\n var e = new Error(\"Database file path not set (AUTHV1_DB_FILE\"\n + \").\");\n e.name = \"auth_db_missing_file_path\";\n return e;\n })());\n \n var dbFilePath = path.join(__dirname, \"../\", DB_FILE);\n \n return resolve(\n checkDBPath(dbFilePath)\n .then(openDB)\n .then(createDB)\n );\n }\n )\n}", "title": "" }, { "docid": "48176b14b999a1aa2f4ac03771b7f0bb", "score": "0.55718553", "text": "createDB() {\n let intialDB = \"[]\";\n this.fs.writeFileSync(this.filename, intialDB);\n }", "title": "" }, { "docid": "b262ae4c0d4147e88583a5cb18ff9c59", "score": "0.55608577", "text": "static initializeDatabase(){\r\n const dbPromise = idb.open('restaurant-reviews', 2, upgradeDb=>{\r\n switch(upgradeDb.oldVersion){\r\n case 0:\r\n upgradeDb.createObjectStore('restaurantsById', {keyPath: 'id'});\r\n case 1:\r\n upgradeDb.createObjectStore('reviews', {keyPath: 'name'});\r\n } \r\n });\r\n\r\n return dbPromise;\r\n }", "title": "" }, { "docid": "00c70ded60a5df5ff3ad3fd2fbbe3fe9", "score": "0.55573374", "text": "function initDB(filename) {\n if(fs.existsSync(filename)) {\n return new sqlite3.Database(filename);\n } else {\n console.log(\"Creating DB file.\");\n fs.mkdir(\"db\", function(e) {\n fs.openSync(filename, \"w\");\n });\n \n \n var dbh = new sqlite3.Database(filename); \n\n var LOCATIONS_COLUMNS = [\n \"id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL\", \n \"uuid TEXT\",\n \"device_id TEXT\",\n \"device_model TEXT\",\n \"latitude REAL\", \n \"longitude REAL\",\n \"accuracy INTEGER\", \n \"altitude REAL\",\n \"speed REAL\",\n \"heading REAL\",\n \"activity_type TEXT\",\n \"activity_confidence INTEGER\",\n \"battery_level REAL\",\n \"battery_is_charging BOOLEAN\",\n \"is_moving BOOLEAN\",\n \"geofence TEXT\",\n \"recorded_at DATETIME\",\n \"created_at DATETIME\"\n ];\n dbh.serialize(function() {\n dbh.run(\"CREATE TABLE locations (\" + LOCATIONS_COLUMNS.join(',') + \")\");\n });\n return dbh;\n }\n}", "title": "" }, { "docid": "8caa646c7ecbb183aff254472c0bd3a7", "score": "0.55487275", "text": "function prepareDatabase() {\n\tvar odb = getOpenDatabase();\n\tif (!odb) {\n\t\tdispError('Web SQL Not Supported');\n\t\treturn undefined;\n\t}\n\telse {\n\t\tvar db = odb('testDatabase', '1.0', 'A Test Database', 10*1024*1024);\n\t\tdb.transaction(function(t){\n\t\t\tt.executeSql(createSQL,[], function(t,r){}, function(t,e){\n\t\t\t\talert('create table: ' + e.message);\n\t\t\t});\t\n\t\t});\n\t\treturn db;\n\t}\n}", "title": "" }, { "docid": "ca07cc4a9a9d470f9ee22089b5e63470", "score": "0.55340075", "text": "ensureDatabase() {\n return new Promise((resolve, reject) => {\n // Set SQLite database filename based on process environment\n let dbPath = (process.env.debug) ? devDbPath : proDbPath;\n\n // Check database file exists\n fs.stat(dbPath, (err) => {\n // If there is an error, the file already exists. Nothing more to do.\n if (!err) {\n console.log(`SQLite database exists in ${dbPath}`);\n resolve();\n\n // Else the database file doesn't exist\n } else {\n console.log(`SQLite database not found, creating in ${dbPath}`);\n \n // Copy empty database file to dbPath\n fs.copy(templatePath, dbPath, (err) => {\n\n // Looks like we couldn't copy the empty database file, opps.\n if (err) {\n console.log(err);\n reject(new Error('Could not create database'));\n \n // Awesome! Database file copyed to dpPath.\n } else {\n console.log(`SQLite database created in ${dbPath}`);\n resolve();\n }\n });\n }\n });\n });\n }", "title": "" }, { "docid": "26e6d85716413c9239fc6894deb3d148", "score": "0.5532328", "text": "buildDb(){\n\t\tdao.backupDb();\n\t\tdao.dropAllTables();\n\t\tdao.createAllTables();\n\t\tthis.initValidationTables();\n\t}", "title": "" }, { "docid": "facf69a90c2a9078a1131aa92ed18a31", "score": "0.5529499", "text": "function setupDatabase( onFinish )\n{\n DEBUG_MODE && console.log( \"Entering DataAPI function: setupDatabase\" );\n getDefaultConn( function( db )\n {\n var tablePromises = [];\n for ( var i = 0; i < tableConfig.listed.length; i++ )\n {\n var tableAlias = tableConfig.listed[ i ];\n var tableName = tableConfig[ tableAlias ];\n DEBUG_MODE && console.log( \"DataAPI.setupDatabase: adding table to promises,\" , tableAlias , \"with actual name,\" , tableName );\n tablePromises.push( _createTable( db, tableName ) );\n }\n\n Promise.all( tablePromises ).then( function()\n {\n //_setupIndexes( db, onFinish );\n DEBUG_MODE && console.log( \"Exiting DataAPI function: setupDatabase with all promises resolved\" );\n onFinish();\n }, \n function(err) \n {\n // error occurred\n if ( err ) throw err;\n });\n });\n}", "title": "" }, { "docid": "5f0141d7bc91a29ea5a3682cbe0f3eb6", "score": "0.5528048", "text": "function getDb() {\n if (typeof database === 'undefined' || database === null) {\n logger.info('Starting DB after undefined');\n this.connectToDb();\n return database;\n } else {\n return database;\n }\n}", "title": "" }, { "docid": "b9075444da7854fef78fa37709942666", "score": "0.55223346", "text": "crear() {\n\t\tmysql.query(\"CREATE DATABASE `inm_azul` DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci;\", (err) => {\n\t\t\tif (!err)\n\t\t\t\tconsole.log(\"creando base de datos inm_azul\");\n\t\t\telse\n\t\t\t\t// evitar que inprima el objeto con un string vacio\n\t\t\t\tconsole.warn(\"\" + err);\n\t\t});\n\t}", "title": "" }, { "docid": "21072bf9bff040b309ec082668d3e622", "score": "0.5510142", "text": "function prepareDB(db) {\n log('Ensuring database is fine.');\n return new Promise((resolve) => {\n createDB(db, config.db.name)\n .then(() => {\n return createTable(db, config.db.name, config.db.users.name, config.db.users.indexField);\n })\n .then(() => {\n return createTable(db, config.db.name, config.db.gifs.name);\n })\n .then(() => {\n return createIndex(db, config.db.gifs.name, config.db.gifs.secondaryIndexField);\n })\n .then(() => {\n resolve(true);\n });\n });\n}", "title": "" }, { "docid": "dae17c471a5b70249459e66fd1608896", "score": "0.5502945", "text": "async function createDB(){\n client.connect(url, function (err, db) \n {\n if(err) throw err;\n console.log(\"Database created!\");\n db.close();\n });\n}", "title": "" }, { "docid": "f0ef1917328640e8d66c89877f8ff2e4", "score": "0.5500102", "text": "function repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url, nodeAdmin) {\n let dbUrl = url || app.options.databaseURL;\n\n if (dbUrl === undefined) {\n if (!app.options.projectId) {\n fatal(\"Can't determine Firebase Database URL. Be sure to include \" + ' a Project ID when calling firebase.initializeApp().');\n }\n\n log('Using default host for project ', app.options.projectId);\n dbUrl = `${app.options.projectId}-default-rtdb.firebaseio.com`;\n }\n\n let parsedUrl = parseRepoInfo(dbUrl, nodeAdmin);\n let repoInfo = parsedUrl.repoInfo;\n let isEmulator;\n let dbEmulatorHost = undefined;\n\n if (typeof process !== 'undefined') {\n dbEmulatorHost = Object({\"NODE_ENV\":\"development\",\"PUBLIC_URL\":\"\",\"WDS_SOCKET_HOST\":undefined,\"WDS_SOCKET_PATH\":undefined,\"WDS_SOCKET_PORT\":undefined,\"FAST_REFRESH\":true,\"REACT_APP_API_KEY\":\"AIzaSyByOJ50yZpIeoelHKdlQ1Ho-yUUxs8W7g4\",\"REACT_APP_AUTH_DOMAIN\":\"my-budget-app-8771a.firebaseapp.com\",\"REACT_APP_DATABASE_URL\":\"https://my-budget-app-8771a-default-rtdb.europe-west1.firebasedatabase.app\",\"REACT_APP_PROJECT_ID\":\"my-budget-app-8771a\",\"REACT_APP_STORAGE_BUCKET\":\"my-budget-app-8771a.appspot.com\",\"REACT_APP_MESSAGING_SENDERID\":\"239784903467\",\"REACT_APP_APP_ID\":\"1:239784903467:web:70aba8e327ede755d87b6e\",\"REACT_APP_MEASUREMENT_ID\":\"G-CG0CTE9NLL\"})[FIREBASE_DATABASE_EMULATOR_HOST_VAR];\n }\n\n if (dbEmulatorHost) {\n isEmulator = true;\n dbUrl = `http://${dbEmulatorHost}?ns=${repoInfo.namespace}`;\n parsedUrl = parseRepoInfo(dbUrl, nodeAdmin);\n repoInfo = parsedUrl.repoInfo;\n } else {\n isEmulator = !parsedUrl.repoInfo.secure;\n }\n\n const authTokenProvider = nodeAdmin && isEmulator ? new EmulatorTokenProvider(EmulatorTokenProvider.OWNER) : new FirebaseAuthTokenProvider(app.name, app.options, authProvider);\n validateUrl('Invalid Firebase Database URL', parsedUrl);\n\n if (!pathIsEmpty(parsedUrl.path)) {\n fatal('Database URL must point to the root of a Firebase Database ' + '(not including a child path).');\n }\n\n const repo = repoManagerCreateRepo(repoInfo, app, authTokenProvider, new AppCheckTokenProvider(app.name, appCheckProvider));\n return new Database(repo, app);\n}", "title": "" }, { "docid": "26343b0ef53acef6a435cd4921c98271", "score": "0.5499166", "text": "function createDB() {\n client.query(`\n CREATE TABLE IF NOT EXISTS users (\n user_id SERIAL PRIMARY KEY,\n sterile_username VARCHAR(255) UNIQUE,\n username VARCHAR(255) NOT NULL,\n password VARCHAR(255) NOT NULL,\n pantry VARCHAR(255),\n recipes VARCHAR(255)\n );`\n // CREATE TABLE IF NOT EXISTS pantry (\n // ingredient_id SERIAL PRIMARY KEY,\n // ingredient_name VARCHAR(255) NOT NULL\n // );\n //\n // CREATE TABLE IF NOT EXISTS recipes (\n // recipe_id SERIAL PRIMARY KEY,\n // recipe_name VARCHAR(255) NOT NULL,\n // recipe_api_id VARCHAR(255) NOT NULL\n // );\n )\n .then(console.log('user tables exist now'))\n .catch(console.error)\n//\n}", "title": "" }, { "docid": "6600f7cf7ec7ddf70e5dff5f6a5f373a", "score": "0.54980713", "text": "function initDB() {\n // Isolate this one require because it will fails test\n \n var manager = __tetanize_require('com.obscure.titouchdb').databaseManager;\n db = manager.getDatabase('request_cookie');\n }", "title": "" }, { "docid": "49112351d90ee5953a281887a38b6612", "score": "0.5484015", "text": "async function createDB(node, OrbitDB) {\n\n // TODO: error handling\n const orbitdb = await OrbitDB.createInstance(node);\n\n const options = {\n // Give write access to everyone\n accessController: {\n write: ['*'],\n },\n indexBy: 'username',\n pin: true\n };\n\n const db = await orbitdb.docs('users_db9', options);\n\n return db;\n}", "title": "" }, { "docid": "28332298d732f26970753cd4bb85a35e", "score": "0.54832107", "text": "static InstallDatabase() {\n\t\treturn super.POST(urlbase + \"installDatabase\");\n\t}", "title": "" }, { "docid": "b7c30f5e44833d938573c739f84a61c2", "score": "0.54786026", "text": "function addDB(req, res, next){\n var dev = req.body.dev;\n if (dev.database.length === 3){\n res.status(422).send('You have reached your database limit of 3');\n }\n var db = new Models.DB({\n name: req.body.database,\n _creator: dev._id\n });\n var collection = {\n name: req.body.collectionName,\n devSchema: req.body.schema\n };\n db.collections.push(collection);\n console.log('db before saved', db);\n db.save(function(err){\n if (err) res.status(409).send('Error');\n console.log('db after saved', db);\n dev.database.push(db);\n dev.save(function(err){\n req.body.db = db;\n req.body.dev = dev;\n next();\n })\n });\n}", "title": "" }, { "docid": "b24ef6e964c780643e2e8ff0717b063b", "score": "0.54780227", "text": "function initDB () {\n DB = new DBHelper({\n 'name': 'lrsdb',\n 'version': 1,\n 'title': 'Learning Record Store',\n 'size': 20 * 1024 * 1024 // 20MB LRS\n });\n\n DB.init(tableDef)\n .then(function() {\n// console.log(\"database is OK\");\n if (typeof pendingSync === \"function\") {\n pendingSync.call();\n pendingSync = null;\n }\n })\n .catch(function() {\n console.error(\"database is broken\");\n });\n }", "title": "" }, { "docid": "7427985129abe3704c8139129b209247", "score": "0.5466709", "text": "function loadDB() {\n client.query( `\n CREATE TABLE IF NOT EXISTS\n authors (\n author_id SERIAL PRIMARY KEY,\n author VARCHAR(255) UNIQUE NOT NULL,\n \"authorUrl\" VARCHAR (255)\n );`\n )\n .then( data => {\n loadAuthors( data );\n } )\n .catch( err => {\n console.error( err )\n } );\n\n client.query( `\n CREATE TABLE IF NOT EXISTS\n articles (\n article_id SERIAL PRIMARY KEY,\n author_id INTEGER NOT NULL REFERENCES authors(author_id),\n title VARCHAR(255) NOT NULL,\n category VARCHAR(20),\n \"publishedOn\" DATE,\n body TEXT NOT NULL\n );`\n )\n .then( data => {\n loadArticles( data );\n } )\n .catch( err => {\n console.error( err )\n } );\n}", "title": "" }, { "docid": "e32cb7d39b84ce1fe9c671c72508989c", "score": "0.5462928", "text": "static DATABASE_URL(url) {\r\n const port = 1337; // Change this to your server port\r\n return `http://localhost:${port}/${url}/`;\r\n }", "title": "" }, { "docid": "7449db48cb132eb9cc5ab35129d905f5", "score": "0.5455138", "text": "function Db(dbname, options) {\n\tif (!this)\n\t\treturn new Db(dbname, options);\n\n\tvar opt = DbOptParse(Db, options);\n\tvar handle = jsdb_openDatabase(dbname, opt);\n\n\tthis.name = dbname;\n\tthis.options = options;\n\tthis.setValue(handle);\n\n\tcatalog.db[dbname] = this;\n}", "title": "" }, { "docid": "52aa198a370d1c5a2d7d69e7bdcd7469", "score": "0.5449534", "text": "setUpDatabase() {\n return __awaiter(this, void 0, void 0, function* () {\n this.firebase = new firebase_1.default();\n this.mongodb = new mongoDB_1.default();\n this.headquarter.setUserDB(this.mongodb.users);\n this.sweeper.add(this.mongodb.terminateConnection);\n this.sweeper.add(this.firebase.terminateConnection);\n });\n }", "title": "" }, { "docid": "b51aefc2e2396cc3823ddabcda48ec8f", "score": "0.5449349", "text": "loadDatabase() {\n Log_1.default.info('Database :: Booting @ Master...');\n Database_1.Database.init();\n }", "title": "" }, { "docid": "ff5b95d38c4679b0826cd249093e5b98", "score": "0.54418665", "text": "function inizializzaDatabase() {\n\tconsole.log(\"Inizializzazione database\");\n\n\tif (!window.openDatabase)\n\t\tconsole.log(\"Error: can't open local database\");\n\tif (!localStorage)\n\t\tconsole.log(\"Error: localstorage not usable\");\n\ttry {\n\t\tif (!_DB) {\n\t\t\tconsole.log(\"opendatabase \" + _DB_NAME + \",\" + \"1.0\" + \",\"\n\t\t\t\t\t+ _DB_NAME + \",\" + _DB_SIZE);\n\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t}\n\t} catch (exc) {\n\t\tconsole.log('Errore database ' + exc.message);\n\t\tsetTimeout(function() {\n\t\t\ttry {\n\t\t\t\tif (window.openDatabase) {\n\t\t\t\t\t_DB = null;\n\t\t\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME,\n\t\t\t\t\t\t\t_DB_SIZE);// window.simulateDB.openDatabase(_DB_NAME,\n\t\t\t\t\t\t\t\t\t\t// \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t\t\t\t// window.location.assign('index.html');\n\t\t\t\t} else {\n\t\t\t\t\t_DBFAIL = true;\n\n\t\t\t\t\tif (!window.infodroid.isfoglioopen()) {\n\t\t\t\t\t\twindow.simulatePG.relaod();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (exc) {\n\t\t\t\tconsole.log('Errore simDB database ' + exc.message);\n\t\t\t\t_DBFAIL = true;\n\t\t\t\tif (!window.infodroid.isfoglioopen()) {\n\t\t\t\t\twindow.simulatePG.relaod();\n\t\t\t\t}\n\t\t\t}\n\t\t}, 500);\n\t}\n\tconsole.log(\"Inizializzazione database OK\");\n}", "title": "" }, { "docid": "0b6b31004ae9fc2fa6da0853c1e52620", "score": "0.5438463", "text": "function inizializzaDatabase() {\n\tconsole.log(\"Inizializzazione database\");\n\n\tif (!window.openDatabase)\n\t\tconsole.log(\"Error: can't open local database\");\n\tif (!localStorage)\n\t\tconsole.log(\"Error: localstorage not usable\");\n\ttry {\n\t\tif (!_DB) {\n\t\t\tconsole.log(\"opendatabase \" + _DB_NAME + \",\" + \"1.0\" + \",\" + _DB_NAME + \",\" + _DB_SIZE);\n\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t}\n\t} catch (exc) {\n\t\tconsole.log('Errore database ' + exc.message);\n\t\tsetTimeout(function() {\n\t\t\ttry {\n\t\t\t\tif (window.openDatabase) {\n\t\t\t\t\t_DB = null;\n\t\t\t\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t\t\t\t// window.simulateDB.openDatabase(_DB_NAME,\n\t\t\t\t\t// \"1.0\", _DB_NAME, _DB_SIZE);\n\t\t\t\t\t// window.location.assign('index.html');\n\t\t\t\t} else {\n\t\t\t\t\t_DBFAIL = true;\n\n\t\t\t\t\tif (!window.infodroid.isfoglioopen()) {\n\t\t\t\t\t\twindow.simulatePG.relaod();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (exc) {\n\t\t\t\tconsole.log('Errore simDB database ' + exc.message);\n\t\t\t\t_DBFAIL = true;\n\t\t\t\tif (!window.infodroid.isfoglioopen()) {\n\t\t\t\t\twindow.simulatePG.relaod();\n\t\t\t\t}\n\t\t\t}\n\t\t}, 500);\n\t}\n\tconsole.log(\"Inizializzazione database OK\");\n}", "title": "" }, { "docid": "473123dc64616793ee40e0059a928ebc", "score": "0.54283434", "text": "function meta_db_handler () {\n var tmp = 'harry_plotter_'+session_identifier;\n /* We need to open the meta_database then add an entry of the session id and close the database */\n const sqlite3 = require('sqlite3').verbose();\n let db = new sqlite3.Database('meta_database_harry_plotter.db', (err) => {\n if (err) {\n return console.error(err.message);\n }\n console.log('Connected to the meta_database');\n });\n var create_prepare=\"CREATE TABLE IF NOT EXISTS meta_database_harry_plotter (session_id TEXT);\";\n db.serialize(() => {\n db.run(create_prepare);\n db.run('INSERT INTO meta_database_harry_plotter(session_id) VALUES ( ? )' , (tmp));\n db.close((err) => {\n if (err) {\n return console.error(err.message);\n }\n console.log('Close the meta_database connection.');\n });\n });\n}", "title": "" }, { "docid": "68f5f072e2ead2fd40948d67d3b83bab", "score": "0.5418447", "text": "function dbConnection(){\n\n let conn = mysql.createConnection({ //anytime you connect to a database, always need these four pieces of info\n host: \"cst336db.space\",\n user: \"cst336_dbUser13\", //put my own username\n password: \"lnyufj\", //my password\n database:\"cst336_db13\" //number matches the username\n }); //createConnection\n \n \n return conn;\n\n}", "title": "" }, { "docid": "2bc4057d934488fa08cb92d306252516", "score": "0.5418133", "text": "function initDatabase() {\n \tconsole.log(\"initDatabase\");\n\n try {\n\t\t// Check browser is supported SQLite or not.\n if (!window.openDatabase) {\n alert('Databases are not supported in this browser.');\n } else {\n \t// If supported then call Function for create table in SQLite\n \trefresh();\n }\n }\n catch (e) { \n \t// Version number mismatch. \n if (e == 2) {\n console.log(\"Invalid database version.\");\n } else {\n console.log(\"Unknown error \" + e + \".\");\n }\n\n return;\n }\n}", "title": "" }, { "docid": "061186a4927960c83fb4ee5fecb3a830", "score": "0.54164445", "text": "prepareInitDB() {\n if (this.uri.schemeIs(\"file\")) {\n let fileURL = this.uri.QueryInterface(Ci.nsIFileURL);\n\n if (!fileURL) {\n throw new Components.Exception(\"Invalid file\", Cr.NS_ERROR_NOT_IMPLEMENTED);\n }\n // open the database\n this.mDB = Services.storage.openDatabase(fileURL.file);\n } else if (this.uri.schemeIs(\"moz-storage-calendar\")) {\n // New style uri, no need for migration here\n let localDB = cal.provider.getCalendarDirectory();\n localDB.append(\"local.sqlite\");\n\n if (!localDB.exists()) {\n // This can happen with a database upgrade and the \"too new schema\" situation.\n localDB.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o700);\n }\n\n this.mDB = Services.storage.openDatabase(localDB);\n } else {\n throw new Components.Exception(\"Invalid Scheme \" + this.uri.spec);\n }\n\n upgradeDB(this);\n }", "title": "" }, { "docid": "061186a4927960c83fb4ee5fecb3a830", "score": "0.54164445", "text": "prepareInitDB() {\n if (this.uri.schemeIs(\"file\")) {\n let fileURL = this.uri.QueryInterface(Ci.nsIFileURL);\n\n if (!fileURL) {\n throw new Components.Exception(\"Invalid file\", Cr.NS_ERROR_NOT_IMPLEMENTED);\n }\n // open the database\n this.mDB = Services.storage.openDatabase(fileURL.file);\n } else if (this.uri.schemeIs(\"moz-storage-calendar\")) {\n // New style uri, no need for migration here\n let localDB = cal.provider.getCalendarDirectory();\n localDB.append(\"local.sqlite\");\n\n if (!localDB.exists()) {\n // This can happen with a database upgrade and the \"too new schema\" situation.\n localDB.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o700);\n }\n\n this.mDB = Services.storage.openDatabase(localDB);\n } else {\n throw new Components.Exception(\"Invalid Scheme \" + this.uri.spec);\n }\n\n upgradeDB(this);\n }", "title": "" }, { "docid": "5256c357ef800002b2e9204cc142e053", "score": "0.5414718", "text": "function inizializzaDatabase() {\n\tconsole.log(\"Inizializzazione database\");\n\t\n\tif (!window.openDatabase)\n \tconsole.log(\"Error: can't open local database\");\n\tif (!localStorage)\n \tconsole.log(\"Error: localstorage not usable\");\n try{\n\t\t_DB = window.openDatabase(_DB_NAME, \"1.0\", _DB_NAME, _DB_SIZE);\n\t}catch(exc){\n\t\tconsole.log('Errore DB '+exc.message);\n\t}\n\tconsole.log(\"Inizializzazione database OK\");\n}", "title": "" }, { "docid": "1b06d9c2af0ad632ea0bee3be047ca56", "score": "0.5414552", "text": "async function createDb(env, {migrate = false} = {}) {\n\tconst dbConfig = getKnexFile()[env];\n\tconst dbName = dbConfig.connection.database;\n\n\tlogger.time(`Created database ${dbName}`);\n\n\tconst isPostgres = dbConfig.client === 'pg';\n\tlet knex;\n\n\t// since database may not exist, so we first create knex with no db selected\n\t// remove database name from config\n\tif (isPostgres) {\n\t\t// since postgres uses default database name as <user>, we need to set the database\n\t\tdbConfig.connection.database = 'postgres';\n\t\tknex = Knex(_reducePoolToOne(dbConfig));\n\n\t\tconst res = await knex.raw(`SELECT 1 FROM pg_database WHERE datname = '${dbName}'`);\n\t\tif (!res.rowCount) {\n\t\t\tawait knex.raw(`CREATE DATABASE \"${dbName}\"`);\n\t\t}\n\t\telse {\n\t\t\tlogger.info(`DB ${dbName} already exists`);\n\t\t}\n\t}\n\telse {\n\t\tdbConfig.connection.database = undefined;\n\t\tknex = Knex(_reducePoolToOne(dbConfig));\n\t\tawait knex.raw(`CREATE DATABASE IF NOT EXISTS \"${dbName}\"`);\n\t}\n\n\tlogger.timeEnd(`Created database ${dbName}`);\n\n\tdbConfig.connection.database = dbName;\n\tawait knex.destroy();\n\n\tif (migrate) {\n\t\tknex = getKnex();\n\t\tawait knex.migrate.latest();\n\t}\n}", "title": "" }, { "docid": "d01baaa33d5dbe00748f45582e6dbdd8", "score": "0.54086614", "text": "function createDB() {\n const createDB = window.indexedDB.open('crm', 1);\n \n createDB.onerror = function() {\n console.log('Database Error');\n };\n\n createDB.onsuccess = function() {\n DB = createDB.result;\n };\n\n createDB.onupgradeneeded = function(e) {\n const db = e.target.result;\n\n const objectStore = db.createObjectStore('crm', { keyPath: 'id', autoIncrement: true });\n\n objectStore.createIndex('name', 'name', {unique: false});\n objectStore.createIndex('email', 'email', {unique: true});\n objectStore.createIndex('phone', 'phone', {unique: false});\n objectStore.createIndex('company', 'company', {unique: false});\n objectStore.createIndex('id', 'id', {unique: true});\n\n console.log('DB ready!');\n\n };\n\n }", "title": "" }, { "docid": "a1b31b325b196d3ec368fdfa6a8be89e", "score": "0.5401337", "text": "function openDb(options={}) {\n let location;\n\n options.location = options.location || options.path || '/tmp/temp.ldb';\n if (options.clear && options.location) {\n // log.debug('openDb : delete ' + location);\n Sh.rm('-rf', options.location);\n }\n // log.debug('openDb ' + location + ' ' + JSON.stringify(options));\n\n return new Promise( resolve => {\n // log.debug('opening with ' + JSON.stringify(options) );\n LevelUp(options.location, options, (err, db) => {\n if (err) { throw err; }\n if (options.debug) {\n log.debug('opened db adapter ' + db.db.constructor.name);\n };\n return resolve(db);\n });\n });\n}", "title": "" }, { "docid": "2407a6719b1710304c2f24bba0c6a255", "score": "0.5400892", "text": "static async injectDB(connection) {\n if (restaurants) {\n return;\n }\n //if information is not already filled, then connect to restaurant db using information provided\n try {\n restaurants = await connection\n .db(process.env.RESTAURANT_REVIEWS_NS)\n //sample_restaurants has two collections,\n //we are specifically trying to access the restaurants collection\n .collection(\"restaurants\");\n } catch (error) {\n console.error(\n `Unable to establish a collection handle in restaurantsDAO: ${error}`\n );\n }\n }", "title": "" }, { "docid": "70491196225dcd2eefa9df60c3e1c4ef", "score": "0.5399457", "text": "async function createDatabase() {\n const db = await createRxDatabase(\n { name: 'categorydb', adapter: 'idb', password: '12345678',ignoreDuplicate: true }\n );\n const messagesCollection = await db.collection({\n name: \"category1\",\n schema: categorySchema\n });\n const replicationState =\n messagesCollection.sync({ remote: syncURL + dbName + '/' });\n subs.push(\n replicationState.change$.subscribe(change => {\n console.log('Replication change');\n console.dir(change)\n })\n );\n subs.push(\n replicationState.docs$.subscribe(docData => {\n console.log('replication docs');\n console.dir(docData)\n })\n );\n subs.push(\n replicationState.active$.subscribe(active => console.log(`Replication active: ${active}`))\n );\n subs.push(\n replicationState.complete$.subscribe(completed => console.log(`Replication completed: ${completed}`))\n );\n subs.push(\n replicationState.error$.subscribe(error => {\n console.log('Replication Error');\n console.dir(error)\n })\n );\n\n return db;\n }", "title": "" }, { "docid": "24ffb65e76a8d2176fed4120a9dcdab9", "score": "0.5392036", "text": "function setupDB(){\r\n\r\n var dbRequest = window.indexedDB.open(\"_pouch_troubletickets\"),\r\n dbDfd = $.Deferred();\r\n\r\n dbRequest.onsuccess = function( event ) {\r\n console.log(\"Opened DB\");\r\n db = dbRequest.result;\r\n dbDfd.resolve( db );\r\n };\r\n dbRequest.onblocked = function( event ){\r\n console.error(\"DB connection blocked\");\r\n db.close();\r\n setupDB();\r\n };\r\n dbRequest.onerror = function( event ){\r\n console.error(\"DB connection issues\");\r\n dbDfd.reject();\r\n };\r\n dbRequest.onupgradeneeded = function(){\r\n var i, cur;\r\n db = dbRequest.result;\r\n console.log(\"onupgradeneeded\");\r\n\r\n //Create non-existant tables\r\n// for(i=0; i < stores.length; i+=1){\r\n// cur = stores[i];\r\n// db.createObjectStore( cur.name, {keyPath: cur.keyPath, autoIncrement: true});\r\n// }\r\n };\r\n return dbDfd.promise();\r\n }", "title": "" } ]
be3dfe464b2051e87c5ebd41ee1a42db
Properties Gets or sets the `Left`.
[ { "docid": "f17b82357acd1e722cc0eaca55eebd5f", "score": "0.7072375", "text": "get left() {\n return this.leftPen;\n }", "title": "" } ]
[ { "docid": "65ab2e9eeeed874a191d1f2d5b64b795", "score": "0.7722194", "text": "get left() {\n return this.x;\n }", "title": "" }, { "docid": "e7ec02eb2249b731873831591cc40ac3", "score": "0.7551534", "text": "get left() {\n // origin is at top left so just return x\n return this.x;\n }", "title": "" }, { "docid": "d525b75e646941e827d7c2c5b8269bac", "score": "0.75482965", "text": "function Left(x) {\n this.isRight = false\n this.left = x\n}", "title": "" }, { "docid": "5e059ac51d74fd59a888f95033faf24e", "score": "0.754305", "text": "static set left(value) {}", "title": "" }, { "docid": "b9d46a55fb16a8f50ab35a990add0163", "score": "0.7518901", "text": "get left() {\n return this.pos.x;\n }", "title": "" }, { "docid": "84a4fbb24fa5b5dcc302860e4d1c05d3", "score": "0.7470181", "text": "get left() {\n return this.leftMargin;\n }", "title": "" }, { "docid": "cb014092464b6d170d46a550c1a0919f", "score": "0.7468861", "text": "static get left() {}", "title": "" }, { "docid": "0ef81b47cb57adb971a00651cd38d536", "score": "0.7435366", "text": "get left() {\n // origin is at top left so just return x\n return this.x\n }", "title": "" }, { "docid": "b3a9e9c38e2c41a4ccd8341d7b883030", "score": "0.7431445", "text": "get left() { return this.width > 0 ? this.x : this.x + this.width }", "title": "" }, { "docid": "86dca31160d9a3ec50bc1910d2201a05", "score": "0.73528355", "text": "get left() {\n return this.container.x;\n }", "title": "" }, { "docid": "ebb6e776b156b50a242354ee5bcdcb0f", "score": "0.73342067", "text": "get left() { return this.x; }", "title": "" }, { "docid": "db5c6a028dc897aacc6b7059edc94936", "score": "0.73187387", "text": "function TLayoutRect$SetLeft$5(Self$39, value$33) {\n Self$39.Left$11 = value$33;\n TLayoutRect$Resolve(Self$39);\n}", "title": "" }, { "docid": "ba8f5fddc9a3d54c0aa38444d9c85abc", "score": "0.719032", "text": "left() {\n return this.x;\n }", "title": "" }, { "docid": "594318c878d57a4cc3fe8fad159beb39", "score": "0.7074438", "text": "get left() {\r\n return this.size - this._cursor;\r\n }", "title": "" }, { "docid": "702b29175b06fe573f53e6e0af66308d", "score": "0.7072665", "text": "get left() {\n //the Sprite's X value is in the centre, due to anchor being 0.5, so taking away half the width of the sprite will find the left side\n return this.sprite.x - this.sprite.width / 2;\n\n }", "title": "" }, { "docid": "ed209fa1475a6fd0cae200c57b32cf2b", "score": "0.70162404", "text": "function TLayoutRect$SetLeft$5(Self$35, value$24) {\n Self$35.Left$11 = value$24;\n TLayoutRect$Resolve(Self$35);\n}", "title": "" }, { "docid": "0e9bf387dd13884524103b76b2e0c262", "score": "0.69924515", "text": "get left() {\n return this.leftPad;\n }", "title": "" }, { "docid": "230b82b46731ee31028b83c2207b7832", "score": "0.6975435", "text": "get Left() { return this.Canvas.offsetLeft; }", "title": "" }, { "docid": "2006cc4ea92ce94d119d5f73e05ef828", "score": "0.69530046", "text": "get insetLeft() {\n return this._insetLeft;\n }", "title": "" }, { "docid": "0756e3f7fb015ac07b9adf76d0733c4e", "score": "0.69461316", "text": "get leftMode()\n\t{\n\t\treturn this.#left.mode;\n\t}", "title": "" }, { "docid": "189aa01c8ccc4709b5afe4deada18f91", "score": "0.693609", "text": "get leftHeight() {\n if (!this.left) {\n return -1;\n }\n return this.left.height;\n }", "title": "" }, { "docid": "1b97fe19008f3c697c6590bdec829800", "score": "0.6927362", "text": "get left() {\n return this.leftTemplate;\n }", "title": "" }, { "docid": "c77f45a07335c85dd97596c0990e1677", "score": "0.6898278", "text": "left() {\n this.setHeading(-45);\n }", "title": "" }, { "docid": "d3e5a0ace9d592e903ab35a0fcec7a4d", "score": "0.68602383", "text": "get leftLineCount()\n\t{\n\t\treturn this.#left.lineCount;\n\t}", "title": "" }, { "docid": "f18666aca454b1e72d86f8ff5b93f0af", "score": "0.6857373", "text": "function cssStyleGetLeft() {\n var left = this.getEffectiveValue('left');\n if (typeof (left) == 'number')\n return left;\n\n if (left != '' && left.indexOf('px') == -1) {\n xbDEBUG.dump('xbStyle.getLeft: Element ID=' + this.object.id + ' does not use pixels as units. left=' + left + ' Click Ok to continue, Cancel to Abort');\n return 0;\n }\n\n if (top == 'auto' && this.object && typeof (this.object.offsetTop) == 'number') {\n left = this.object.offsetTop + 'px';\n }\n\n if (left == '')\n left = '0px';\n\n return xbToInt(left);\n }", "title": "" }, { "docid": "528716cbcf81ae04076f4f501d540e0b", "score": "0.68113446", "text": "static Left() {\n return new Vector3(-1.0, 0.0, 0.0);\n }", "title": "" }, { "docid": "c79322c6f5b6738c3a365a937d798c86", "score": "0.67723525", "text": "get topLeft() {\n return new PointF(this.left, this.top);\n }", "title": "" }, { "docid": "a0d0f5ae50707778aa9ff48e39fb2e9d", "score": "0.6770194", "text": "function Left(x) { return new _Either('Left', x); }", "title": "" }, { "docid": "8223ed5c5a73025831e8f01b231696a4", "score": "0.6749544", "text": "setLeft() {\n this.oX = 0;\n this.x = 0;\n Stack.requestPaintHUD = true;\n }", "title": "" }, { "docid": "a3a6bf8eaaa087f1ff8b7d445643a235", "score": "0.6738982", "text": "leftHeight() {\r\n if (this.left === null) {\r\n return 0;\r\n }\r\n return this.left.height;\r\n }", "title": "" }, { "docid": "0a4108944a836147ac4c1cfdfa87aa3b", "score": "0.66390485", "text": "get xBottomLeft() {\n return (this.getBounds().left)\n }", "title": "" }, { "docid": "205f7dbd463b54ca5f02462f809eaeaa", "score": "0.6619466", "text": "function getLeftPosition(obj)\n{\n\treturn dojo.position(obj).x;\n}", "title": "" }, { "docid": "2e94f7b6dc4511687ecf7551091f70e9", "score": "0.6579097", "text": "function getLeft() {\n let sector = this\n let field = sector.parentNode\n let newX = sector.x - 1\n let newY = sector.y \n return field[newX] && field[newX][newY] ? field[newX][newY] : false\n}", "title": "" }, { "docid": "7b225e4edda6ec838f1d9d46f56ce3c8", "score": "0.657012", "text": "showLeft() {\n this.tooltipElement.classList.add(getClass(\"left\"));\n this.element.style.setProperty(\"left\", toPx(this.node.getBoundingClientRect().left - this.element.offsetWidth - 10));\n this.centerVertically();\n }", "title": "" }, { "docid": "5ccfe093e370b91d9c325d66224c4f22", "score": "0.6543659", "text": "get left() {\n const xComponent = Math.cos(this.offsetAngle);\n const percentageFromLeft = mapToPercentage(xComponent);\n\n return `${percentageFromLeft}%`;\n }", "title": "" }, { "docid": "90aa5293e3fad2ebe909691018cc42b9", "score": "0.6533996", "text": "get nextFrameLeft() {\n return this.left + this.dx;\n }", "title": "" }, { "docid": "533dc71a7be8ca256ce225c63abbaa1f", "score": "0.6477698", "text": "goLeft() {\n if (this.allowLeftRight) {\n this.updateValue(Math.max(this.value - 10, this.min));\n }\n }", "title": "" }, { "docid": "f00882df237b3623b122ea9503e45da3", "score": "0.64659554", "text": "function left(value) {\n return new Left(value);\n}", "title": "" }, { "docid": "3383be1f1403ce9497b347ca77df1582", "score": "0.64657944", "text": "function getLeft(e){\n\t\tvar out = parseFloat(e.clientLeft || e.offsetLeft);\n\t\treturn (isNaN(out))?0:out;\n\t}", "title": "" }, { "docid": "1f9b82fa6105a14e86a036a399c061a3", "score": "0.6462473", "text": "left(value = '') {\n this._rightOffset = '';\n this._leftOffset = value;\n this._justifyContent = 'flex-start';\n return this;\n }", "title": "" }, { "docid": "1f9b82fa6105a14e86a036a399c061a3", "score": "0.6462473", "text": "left(value = '') {\n this._rightOffset = '';\n this._leftOffset = value;\n this._justifyContent = 'flex-start';\n return this;\n }", "title": "" }, { "docid": "1f9b82fa6105a14e86a036a399c061a3", "score": "0.6462473", "text": "left(value = '') {\n this._rightOffset = '';\n this._leftOffset = value;\n this._justifyContent = 'flex-start';\n return this;\n }", "title": "" }, { "docid": "50cff6264f3381cb900786e330434087", "score": "0.64588463", "text": "moveLeft() {\n const moveTo = this._getMoveTo(MOVE_LEFT);\n if (moveTo !== false && !stateManager.gameIsOver) {\n soundManager.playSound('moveLeft');\n this._moveToLane(moveTo);\n }\n }", "title": "" }, { "docid": "d5228ebcba3d5ce987e30a497b433ebe", "score": "0.64483756", "text": "function setLeft(e){\n\t\t\tif(e.pageX < ($(window).width() / 2)){\n\t\t\t\treturn e.pageX + 10;\n\t\t\t} else {\n\t\t\t\treturn e.pageX - (parseInt($('#tooltip').width()) + 20);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "54874604b1b079958b5d49f6506354f9", "score": "0.6438692", "text": "moveLeft() {\n this.direction.x = -1;\n this.direction.y = 0;\n }", "title": "" }, { "docid": "7044cb4d724783cdd1b87088f8db93a7", "score": "0.6435545", "text": "get TopLeft() { return [this.Left, this.Top ]; }", "title": "" }, { "docid": "6ebf7835af7403d196aadde26f33878c", "score": "0.64217985", "text": "moveLeft() {\n\t\tthis.applyForce(createVector(-3, 0));\n\t\tthis.dir = 1;\n\t}", "title": "" }, { "docid": "a62a7d2427d2400c8a731a0bd4836894", "score": "0.6385109", "text": "get scrollLeft() {\n return this.content.left\n }", "title": "" }, { "docid": "9d724d7333e0e746f683731a9a7229e0", "score": "0.6369497", "text": "function calcolaValueLeft(elemento){\n\tvar left = parseInt(window.getComputedStyle(elemento, null).getPropertyValue(\"left\"));\n\treturn left;\n}", "title": "" }, { "docid": "e65c259f703f5882db67a31d9fcbdd61", "score": "0.6359948", "text": "get leftMargin() {\r\n return this.i.cs;\r\n }", "title": "" }, { "docid": "a56d887e8f713459664cebae77981f4c", "score": "0.6348518", "text": "function xLeft(e, iX)\r\n{\r\n if(!(e=xGetElementById(e))) return 0;\r\n var css=xDef(e.style);\r\n if (css && xStr(e.style.left)) {\r\n if(xNum(iX)) e.style.left=iX+'px';\r\n else {\r\n iX=parseInt(e.style.left);\r\n if(isNaN(iX)) iX=xGetComputedStyle(e,'left',1);\r\n if(isNaN(iX)) iX=0;\r\n }\r\n }\r\n else if(css && xDef(e.style.pixelLeft)) {\r\n if(xNum(iX)) e.style.pixelLeft=iX;\r\n else iX=e.style.pixelLeft;\r\n }\r\n return iX;\r\n}", "title": "" }, { "docid": "4447273caee31c1a567dbd41d8938281", "score": "0.63473177", "text": "get xTopLeft() {\n return (this.getBounds().left)\n }", "title": "" }, { "docid": "355233bdd494a8e5d8b783059f13c809", "score": "0.6340016", "text": "get applyDocumentLeftTemplate() {\n return this.leftValue;\n }", "title": "" }, { "docid": "a60898d2ec206b7ab963ce5903fe2e7a", "score": "0.6328204", "text": "setLeftControl(x, y){\n\t\tthis.current.setLeft(x,y); }", "title": "" }, { "docid": "8545665ec05d35c513acce8ffb706377", "score": "0.62883425", "text": "getLeftPositions() {\n\n const values = this.getValues();\n\n const limits = this.getLimits();\n\n const size = this.state.size;\n\n const left = [values[0]-limits[0], values[1]-limits[0]];\n const leftPos = [left[0]/size*100, left[1]/size*100];\n\n if(this.state.reverse) {\n return [100-leftPos[0], 100-leftPos[1]];\n }\n return leftPos;\n }", "title": "" }, { "docid": "2b8ca0f219c28fc54d00dab47c829725", "score": "0.6266613", "text": "get leftMargin() {\r\n return this.i.ej;\r\n }", "title": "" }, { "docid": "cff8c9d8540dc0ce9a46bc814aa3f4bb", "score": "0.62658834", "text": "function left(){\r\n if(gameOver === false && parseInt(mower.css('left'))>0){\r\n mower.css('left', parseInt(mower.css('left')) -5);\r\n move_left = requestAnimationFrame(left);\r\n }\r\n }", "title": "" }, { "docid": "5a3fbc21d3f5ddb6d864ac22e3415ee0", "score": "0.6227736", "text": "left(){\n if(this.placed){\n switch(this.position.orientation){\n case 'north':\n this.position.orientation = 'west'\n break;\n case 'east':\n this.position.orientation = 'north'\n break;\n case 'south':\n this.position.orientation = 'east'\n break;\n case 'west':\n this.position.orientation = 'south'\n break;\n default:\n // do nothing\n break;\n }\n }\n }", "title": "" }, { "docid": "6fd0d71aa2d335270b9878aaf25c8084", "score": "0.6225737", "text": "get_top_left() {\n this.__top_left_c = this.__top_left_c || this.__position.clone();\n return this.__top_left_c;\n }", "title": "" }, { "docid": "fc8abeb6f6163ca124408539b1854659", "score": "0.62202007", "text": "get leftFile()\n\t{\n\t\treturn this.#left.file;\n\t}", "title": "" }, { "docid": "1408dbdcb251ccbb0cbd33c2c1785b44", "score": "0.6217622", "text": "moveLeft() {\n\t\tconst valid = this.activePiece.applyMovement(Tetronimo.LEFT, this.blockSet);\n\t\treturn { valid: valid };\n\t}", "title": "" }, { "docid": "a11a5cdeb400528abf767ee19921ce78", "score": "0.6217535", "text": "rotateLeft() {\n // a b\n // / \\ / \\\n // c b -> a.rotateLeft() -> a e\n // / \\ / \\\n // d e c d\n const other = this.right;\n this.right = other.left;\n other.left = this;\n this.height = Math.max(this.leftHeight, this.rightHeight) + 1;\n other.height = Math.max(other.rightHeight, this.height) + 1;\n return other;\n }", "title": "" }, { "docid": "509a3903c7adb2c75975538bedf4ab84", "score": "0.6211908", "text": "turnLeft() {\n if (this.position == null) {\n return;\n }\n this.position.direction = turnData[this.position.direction].left;\n }", "title": "" }, { "docid": "6e15393835ddce20ff1244d0a2628606", "score": "0.6211773", "text": "function getRemainSpaceLeft(){\n\t\tvar spaceTaken = -getInnerPos();\n\t\tvar spaceRemain = g_temp.sideSpace - spaceTaken;\n\t\treturn(spaceRemain);\n\t}", "title": "" }, { "docid": "6e15393835ddce20ff1244d0a2628606", "score": "0.6211773", "text": "function getRemainSpaceLeft(){\n\t\tvar spaceTaken = -getInnerPos();\n\t\tvar spaceRemain = g_temp.sideSpace - spaceTaken;\n\t\treturn(spaceRemain);\n\t}", "title": "" }, { "docid": "60541c770a7ce5c3b2e8cd67a87110b7", "score": "0.61976033", "text": "function changeDirectionLeft(){\n var direction = d3.select('#directionValues').node().value;\n if (direction === 'North'){\n direction = 'West';\n } else if (direction === 'West'){\n direction = 'South';\n } else if (direction === 'South'){\n direction = 'East';\n } else if (direction === 'East'){\n direction = 'North';}\n\n d3.select('#directionValues').property('value', direction);\n getInfo(direction);\n}", "title": "" }, { "docid": "53ad651218c921d000e98b80688fde4d", "score": "0.6191192", "text": "getMinimumPositionX() {\n return this._leftMargin;\n }", "title": "" }, { "docid": "61668b43decccdad4ace42ea73a2d2ed", "score": "0.6188486", "text": "function leftPosition() {\r\n return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;\r\n}", "title": "" }, { "docid": "0c07a742dadf0dad5aef16b2b914a052", "score": "0.6173337", "text": "goLeft(){\n this.position.x -= 0.1;\n }", "title": "" }, { "docid": "5d38aecee9c5d3b1e898f554a5b9242c", "score": "0.61591274", "text": "get paddingLeft() {\n return this._paddingLeft;\n }", "title": "" }, { "docid": "abcf8bf0a4324d3c25f933a28c685e03", "score": "0.6141523", "text": "get scrollLeft() {\n if (this.scroller) {\n return this.scroller.x;\n }\n\n return this.outerElement.scrollLeft;\n }", "title": "" }, { "docid": "43e1a41eb9349cf9dad2049d617f75d1", "score": "0.61350805", "text": "get width() {\n return this.right - this.left;\n }", "title": "" }, { "docid": "f309c1fbc9abf68f49df5f17ef885be5", "score": "0.61302745", "text": "getTieLeftX() {\n let tieEndX = this.getAbsoluteX();\n tieEndX += this.x_shift - this.leftDisplacedHeadPx;\n return tieEndX;\n }", "title": "" }, { "docid": "01ea49b25e5b75c0cc7f65e3229aca12", "score": "0.61062217", "text": "get right() {\n return this.x + this.width;\n }", "title": "" }, { "docid": "ac1a844cc07aaaf7cf57965f67690bb0", "score": "0.6101684", "text": "function changeLeftPosition(element, type) {\n switch (type) {\n case \"static\":\n return element.css('margin-left') == '0px' ? 0 : element.css('margin-left');\n default:\n return element.css('left') == 0 ? 0 : element.css('left');\n }\n}", "title": "" }, { "docid": "30cdbd06e69044303968fc840895740a", "score": "0.6092576", "text": "function changeleft(){\n\t\tif(click*pos-(wli*nli-wd) > 0 ){\n\t\t\tul.style.left = String(wd-wli*nli) + 'px';\n\t\t}else{\n\t\t\tul.style.left = String(-click*pos) + 'px';\n\t\t}\n\t}", "title": "" }, { "docid": "21ad026a8c40b3a858c2926887f92444", "score": "0.60898244", "text": "function INTERFACE_CreateLeft()\n{\n\tvar Left, UserBox, Rooms, ContactList;\n\n\tLeft = UTILS_CreateElement(\"div\", \"Left\");\n\tUserBox = INTERFACE_CreateUserBox();\n\tContactList = INTERFACE_CreateContact();\n\tRooms = INTERFACE_CreateRooms();\n\n\tLeft.appendChild(UserBox);\n\tLeft.appendChild(ContactList);\n\tLeft.appendChild(Rooms);\n\n\treturn Left;\n}", "title": "" }, { "docid": "5140f6fd34277cb466c5f998111be88a", "score": "0.6079083", "text": "moveLeft() {\n this.state = CPU_CONST.LEFT;\n this.x = this.x - this.speedX;\n }", "title": "" }, { "docid": "88c9eda8dd00684a8f6a52238c09c80b", "score": "0.60363483", "text": "static fromLeft(id, left) {\n const events = [...left.state.events, ...left.timeline.events];\n const members = MatrixRoom.getMembersFromEvents(events);\n const messages = MatrixRoom.getMessagesFromEvents(events);\n return new MatrixRoom(id, MatrixRoomStatus.LEFT, members, messages);\n }", "title": "" }, { "docid": "a8a2ae7e1e8a8e1a80213662ec7073c7", "score": "0.6034989", "text": "function setLeft(obj, nleft)\r\n{\r\n\t//Tracker#: 7082 SCREEN RENDERING ISSUES WHEN USING SAFARI OR FIREFOX.\r\n\t//added a check if the obj exists or not\r\n\tif(obj)\r\n\t{\r\n\t\tobj.style.left = nleft+\"px\";\r\n\t}\r\n}", "title": "" }, { "docid": "91133137a30874d9f5931244430fc9b0", "score": "0.6034944", "text": "left(v, d=1){\t\treturn this._getDirection(0, 1, 2, d, v);\t}", "title": "" }, { "docid": "79422c754a22ae7e6306c990af6f76d3", "score": "0.60277206", "text": "moveLeft() {\n\t\tsuper.moveLeft(CHUN_SPRITE_POSITION.moveLeft, CHUN_IDLE_ANIMATION_TIME, false, MOVE_SPEED);\n\t}", "title": "" }, { "docid": "f8dc32ea269549b775991650675546ae", "score": "0.6017461", "text": "get offsetLeft(){\r\n return this.htmlCounter.offsetLeft;\r\n }", "title": "" }, { "docid": "3f32f7b2f4144f2e79cf14e1511d61e6", "score": "0.6009721", "text": "getTieLeftX() {\n let tieEndX = this.getAbsoluteX();\n const note_glyph_width = this.glyph.getWidth();\n tieEndX += note_glyph_width / 2;\n tieEndX -= this.width / 2 + 2;\n return tieEndX;\n }", "title": "" }, { "docid": "d763a2695371ddfdc4c5ed232c82f465", "score": "0.6009247", "text": "function turnLeft(rover){\n switch (rover.direction) {\n case 'N':\n rover.direction = 'W';\n break;\n case 'E':\n rover.direction = 'N';\n break;\n case 'W':\n rover.direction = 'S';\n break;\n case 'S':\n rover.direction = 'E';\n break;\n }\n console.log(`POS: (${rover.x}, ${rover.y})`)\n console.log(`DIR: ${rover.direction} \\n\n `);\n }", "title": "" }, { "docid": "ebbe5a33887554ff1c6e22b51664ab37", "score": "0.59983754", "text": "function moveLeft()\n{\n\tif (defender.x > edge)\n\t{\t\n\t\tdefender.oldX = defender.x;\n\t\tdefender.x -= 2 * scale;\n\t\tClearObject(defender, ctx);\n\t\tDrawObject(defender, ctx);\n\t}\n}", "title": "" }, { "docid": "9b64321794a2d1d9968eb4cafee1e745", "score": "0.59856224", "text": "function getLeft(layer) {\r\n\r\n if (NS4) return layer.left;\r\n if (IE4) return layer.style.pixelLeft;\r\n if (NS6) return layer.style.left;\r\n return -1;\r\n}", "title": "" }, { "docid": "80815f6a0fbd2b8751938fc7647c1c54", "score": "0.598444", "text": "function getX(left){\n\t\tvar column = left / 100;\n\t\treturn column;\n\t}", "title": "" }, { "docid": "b47b9644a25c463f2d196c323712001d", "score": "0.59809047", "text": "applicationProperty() {\n return this.right ? 'right' : 'left';\n }", "title": "" }, { "docid": "b47b9644a25c463f2d196c323712001d", "score": "0.59809047", "text": "applicationProperty() {\n return this.right ? 'right' : 'left';\n }", "title": "" }, { "docid": "b47b9644a25c463f2d196c323712001d", "score": "0.59809047", "text": "applicationProperty() {\n return this.right ? 'right' : 'left';\n }", "title": "" }, { "docid": "b47b9644a25c463f2d196c323712001d", "score": "0.59809047", "text": "applicationProperty() {\n return this.right ? 'right' : 'left';\n }", "title": "" }, { "docid": "b47b9644a25c463f2d196c323712001d", "score": "0.59809047", "text": "applicationProperty() {\n return this.right ? 'right' : 'left';\n }", "title": "" }, { "docid": "b47b9644a25c463f2d196c323712001d", "score": "0.59809047", "text": "applicationProperty() {\n return this.right ? 'right' : 'left';\n }", "title": "" }, { "docid": "831c97c75c9dc16e1f701ea287628e78", "score": "0.5980623", "text": "left(args){\n if (!this.isPlaced()) return;\n if (this.noArgs(args)){\n this.rotate(90);\n }\n }", "title": "" }, { "docid": "3307a16a579e388cddff29ddf4c9d078", "score": "0.59797907", "text": "get labelLeftMargin() {\r\n return this.i.t;\r\n }", "title": "" }, { "docid": "ede5d2da6c4b5f4df9a6308e18c65c54", "score": "0.59715015", "text": "get canShowLeft() {return this.node.getBoundingClientRect().left - this.element.offsetWidth >= 0;}", "title": "" }, { "docid": "8e9d1cd3ac822290e8dedc121207bfc9", "score": "0.59609056", "text": "get right() { return this.x + this.width; }", "title": "" }, { "docid": "8f2ce34c250a7d2977f70f8509235f66", "score": "0.5958004", "text": "get rightX() {\n return this.width + this.x\n }", "title": "" }, { "docid": "13e25b755cbd1f5748e26ce53970d5f0", "score": "0.59467167", "text": "function get_left ( layername ){\n if ( ie )\n return document.all[layername].style.pixelLeft;\n else if ( nn )\n return document[layername].left;\n else if ( ns5 )\n return parseInt(window.document.getElementById(layername).style.left);\n return false;\n}", "title": "" } ]
95957fdd608675b368eb4d20a1b348f0
Shows the user's list of available Gists
[ { "docid": "c54439daf2468a7733d08875a725a79c", "score": "0.6988826", "text": "function listUserGists(page) {\n \n var first = (page == null || page == 1);\n \n function acceptGist(gist) {\n if (gist.data.description.startsWith(\"Ceylon Web Runner: \")) {\n// var show = false;\n// $.each(gist.data.files, function(idx, itm) {\n// if (idx.endsWith(\".ceylon\")) {\n// show = true;\n// }\n// });\n// return show;\n return true;\n }\n return false;\n }\n \n function showGist(gist) {\n if (first) {\n $('#yrcode').empty();\n first = false;\n }\n var desc = getGistName(gist);\n $('#yrcode').append('<li id=\"gist_' + gist.data.id + '\" class=\"news_entry\"><a href=\"#\" onClick=\"return handleEditGist(\\'' + gist.data.id + '\\')\">' + desc + '</a></li>');\n $('#yrcodehdr').show();\n $('#yrcode').show();\n }\n \n function onEnd(list) {\n if (list.hasMoreElements()) {\n $('#yrcodemore').off().click(function() { return listUserGists(list.lastPage + 1); });\n $('#yrcodemore').show();\n } else {\n $('#yrcodemore').hide();\n }\n if (selectedSet != null || selectedGist != null) {\n markGistSelected(selectedSet, selectedGist);\n }\n handleResizeSidebar();\n }\n \n retrieveUserGists(page, acceptGist, showGist, onEnd);\n}", "title": "" } ]
[ { "docid": "ce0851b066f77a53231b241f61cdb985", "score": "0.7246027", "text": "function updateGists() {\n listUserGists();\n}", "title": "" }, { "docid": "f46ea490ad1417e4e2099d760dbed318", "score": "0.6995089", "text": "function retrieveAllUserGists(acceptGist, showGist, userOnEnd) {\n function onEnd(list) {\n if (list.hasMoreElements()) {\n retrieveUserGists(ist.pages.length + 1, acceptGist, showGist, onEnd);\n } else if (userOnEnd != null) {\n userOnEnd(list);\n }\n }\n retrieveUserGists(1, acceptGist, showGist, onEnd);\n}", "title": "" }, { "docid": "3a3bebd2e9438b1d9b38de16f3455bf6", "score": "0.6903355", "text": "function retrieveUserGists(page, acceptGist, showGist, onEnd) {\n if (github.config.authentication == null) {\n return;\n }\n \n function handleGist(gist) {\n if (acceptGist(gist)) {\n showGist(gist);\n }\n }\n \n // Check that we have a valid GitHub token\n var token = $.cookie(\"githubauth\");\n if (token) {\n var gistsIter = github.gists();\n gistsIter.each({\n func: handleGist,\n finish: onEnd,\n page: page\n });\n }\n}", "title": "" }, { "docid": "19000316f8a9f2d417648b0edb1e96b1", "score": "0.6374858", "text": "function generateList() {\n var gistList = document.getElementById('gistList');\n gistList.innerHTML = '';\n\n for (var i = 0; i < fetchedGist.length; i++)\n \tgistList.appendChild(createListItem(fetchedGist[i], i, false));\n}", "title": "" }, { "docid": "375fc6922b1471430c02bc41f1dad1ef", "score": "0.6256393", "text": "function displayRecentGists($select, $nag)\n {\n var recent = getRecentGists();\n var length = recent.length;\n var val = null;\n var gist_ob = null;\n \n if (length)\n {\n $select.empty();\n while (length--)\n {\n val = recent[length];\n gist_ob = getRecentGistOb(val);\n $select.prepend(\"<option value='\" + val +\n \"'>\" + val +\n \" - \" + (gist_ob.desc.substr(0, 30) || \"\") + \"...\" +\n \"</option>\");\n }\n $nag.hide();\n $select.show();\n return true;\n }\n else\n {\n $nag.show();\n $select.hide();\n return false;\n }\n }", "title": "" }, { "docid": "d4d265b3dce8bf815fa68f60b1809dad", "score": "0.61083406", "text": "function GistList() {\n const { gistInfo, changeGist } = useGistInfo();\n\n useEffect(() => {\n let gists = PublicGists();\n gists.then((res) => {\n changeGist(res.data);\n })\n .catch((err) => {\n console.log(err);\n })\n }, []);\n\n\n return (\n <div className=\"container\">\n\n {gistInfo?.data.length < 1 ? \"No gists available.\" : (<>\n {gistInfo && gistInfo?.data.map((item, index) => (\n <div className=\"row\" key={index} style={itemcontent}>\n <div className=\"row justify-content-center\">\n <div className=\"col-sm-2\">\n <img src={item.owner.avatar_url} className=\"rounded-circle\" style={avatarImage} alt={item.owner.login} />\n <a style={inlineList} href={item.owner.html_url}>{item.owner.login}</a>\n </div>\n <div className=\"col-md-4\">\n <ul className=\"list-unstyled\">\n <li className=\"d-inline\" style={inlineList}><a href={item.html_url}>{Object.keys(item.files).length} Files</a></li>\n <li className=\"d-inline\" style={inlineList}><a href={item.owner.html_url}>Forks</a></li>\n <li className=\"d-inline\" style={inlineList}><a href={item.owner.html_url}>Comments</a></li>\n <li className=\"d-inline\" style={inlineList}><a href={item.owner.html_url}>Stars</a></li>\n </ul>\n </div>\n </div>\n <div className=\"row justify-content-center\">\n <div className=\"col-md-6\">\n <ul className=\"list-unstyled\">\n <li className=\"d-inline\" style={inlineList}>Created at: <Moment format=\"DD/MM/yyyy\">{item.created_at}</Moment></li>\n <li className=\"d-inline\" style={inlineList}>Last updated: <Moment format=\"DD/MM/yyyy\">{item.updated_at}</Moment></li>\n </ul>\n </div>\n </div>\n <div className=\"row justify-content-center\">\n <div className=\"col-md-6\">\n <label style={inlineList}>{item.description}</label>\n </div>\n </div>\n <div className=\"row justify-content-center\">\n <div className=\"col-md-6\">\n <ul className=\"list-unstyled\">\n {Object.keys(item.files).map((fileName, i) => (\n <li className=\"d-inline\" style={inlineList} key={i}><a href={item.html_url}>{fileName}</a></li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n ))}\n </>\n )}\n </div>\n )\n}", "title": "" }, { "docid": "6145498c6327bf02b12559ee5090f3bc", "score": "0.60926926", "text": "function getGists() {\n\t/* Do the XMLHttpRequest here and keep the result in the originalGistList.\n\tWhen you got the data, you need to iterate over them and call the \n\tfunction from the next step inside it per gist to generate the \n\thtml content (generateGistHtml) */\n\t\n\t\n\thttp_request = false;\n\tvar url = \"https://api.github.com/gists/public\";\n\t\n\t/* since: A string containing a timestamp in ISO 8601 format: \n\t\tYYYY-MM-DDTHH:MM:SSZ. Only gists updated at or after this time \n\t\tare returned. */\n\tvar since = \"2015-04-26T01:37:17Z\"\t\n\n\tif (window.XMLHttpRequest) { // Mozilla, Safari,...\n\t\thttp_request = new XMLHttpRequest();\n\t\tif (http_request.overrideMimeType) {\n\t\t\thttp_request.overrideMimeType('text/xml');\n\t\t}\n\t} else if (window.ActiveXObject) { // IE\n\t\ttry {\n\t\t\thttp_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t} catch (e) {\n\t\t\ttry {\n\t\t\thttp_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t} catch (e) {}\n\t\t}\n\t}\n\n\tif (!http_request) {\n\t\talert('Giving up :( Cannot create an XMLHTTP instance');\n\t\treturn false;\n\t}\n\thttp_request.onreadystatechange = createGistList;\n\thttp_request.open('GET', url, true);\n\thttp_request.send(null);\n}", "title": "" }, { "docid": "92d584801e196fd6b5d35e6afcfc7d40", "score": "0.60843843", "text": "function GistList() {\n}", "title": "" }, { "docid": "5e3a5ddb059cbdc75efe3d901e8850e1", "score": "0.6017382", "text": "function goToGistsPage(n) {\n navigate(`/${username}?page=${n}&gistsPerPage=${gistsPerPage}`);\n }", "title": "" }, { "docid": "87dd62f0a8d6120bb437fd09e7ac773c", "score": "0.5957377", "text": "function displayLists() {\n\tgroceryLists = [];\n\tsetTimeout(function() {\n\t\tcurrentID = firebase.auth().currentUser.uid;\n\t\t//adds greeting\n\t\t$.get(`usersList/${currentID}`, function (data) {\n\t\t\t$('.greeting').text(`Happy Holidays ${data[0].userNickname}!`);\n\t\t})\n\t\t//pulls list titles and pushes into groceryLists array\n\t\t$.get(`/groceryList/${currentID}`, function (data) {\n\t\t\tfor (let i=0; i< data.length; i++) {\n\t\t\t\tif (groceryLists.includes(data[i].whichList) === false) {\n\t\t\t\t\tgroceryLists.push(data[i].whichList)\n\t\t\t\t};\n\t\t\t};\n\t\t\tgroceryLists.forEach(function(item) {\n\t\t\t\t$('#add-grocery-list').append (`\n\t\t\t\t\t<div class=\"delete-list-div\">\n\t\t\t\t\t\t<br><a class=\"added-to-list\" onclick=\"showList('${item}')\">${item}</a>\n\t\t\t\t\t\t<button class=\"delete-list-button\" onclick=\"deleteList('${item}')\">Delete</button>\n\t\t\t\t\t</div>\n\t\t\t\t`)\n\t\t\t});\n\t\t});\n\t}, 1000);\n}", "title": "" }, { "docid": "ce186ca57d95c40d82d293110f05a417", "score": "0.59504575", "text": "function display(users) {\n users.forEach((user) => {\n list.innerHTML += `<li>${user.name}</li>`;\n });\n}", "title": "" }, { "docid": "8d4ebd1d40a904deb9a7573374bf559b", "score": "0.59488964", "text": "componentWillMount() {\n // Only display \"Open a gist\" if user has saved gists. This is a\n // legacy feature. It will be completely removed in the future.\n const STORAGE_SAVED_GISTS = 'gists';\n localforage.getItem(STORAGE_SAVED_GISTS)\n .then((gists) => {\n if (Array.isArray(gists)) {\n this.setState({\n legacyGistMenu: true,\n });\n }\n });\n }", "title": "" }, { "docid": "117ccadb23ce161783a541c59454d6ad", "score": "0.5898862", "text": "function displayGroceries() {\n const ul = document.querySelector('ul');\n groceries.forEach((item) => {\n const li = document.createElement('li');\n li.innerText = item.name;\n ul.appendChild(li);\n });\n}", "title": "" }, { "docid": "60d81ee95607d51e7d154a76c99c2b72", "score": "0.587866", "text": "componentWillMount() {\n // Only display \"Open a gist\" if user has saved gists. This is a\n // legacy feature. It will be completely removed in the future.\n const STORAGE_SAVED_GISTS = 'gists';\n localforage.getItem(STORAGE_SAVED_GISTS)\n .then((gists) => {\n if (Array.isArray(gists)) {\n this.setState({\n legacyGistMenu: true,\n });\n }\n });\n\n // Only display items related to Mapzen account if Tangram Play is\n // loaded from a domain with Mapzen account capabilities.\n this.getUserData();\n }", "title": "" }, { "docid": "194a1e2eb9347b202e0275edd34fc3ba", "score": "0.58171237", "text": "function showUsersGroups(userToSearch) {\n\n var array = getGroupsListForUsers(userToSearch);\n\n if (array.length > 0) {\n console.log(userToSearch.getUserName() + ' is found in the following groups: ');\n array.forEach(function (group) {\n console.log(group.group_name);\n });\n }\n else {\n console.log(userToSearch.getUserName() + ' is not found in any groups');\n }\n helpers.menuCallback();\n}", "title": "" }, { "docid": "ee3c5f814ceefcc93f084e8cdafcd3a1", "score": "0.57967466", "text": "function showGist(contentlist) {\n var list = document.getElementById('gists');\n var id, description, link, language;\n \n for (var i in contentlist) {\n id = contentlist[i].link;\n description = document.createElement('div');\n link = document.createElement('a');\n language = document.createElement('p');\n\n if (contentlist[i].description === null || contentlist[i].description ===\"\") {\n description.innerHTML = 'Description: No description provided';\n } else {\n description.innerHTML = 'Description: ' + contentlist[i].description;\n }\n\n link.setAttribute('href', contentlist[i].link);\n link.innerHTML = contentlist[i].link;\n language.innerHTML = 'Language: ' + contentlist[i].language;\n\n\n var fave_button = document.createElement('button');\n fave_button.innerHTML = 'Add to Favorite Gists';\n fave_button.setAttribute('fave_link', contentlist[i].link);\n \n fave_button.onclick = function() {\n var fave_link = this.getAttribute('fave_link');\n favegist.favorites.push(fave_link);\n localStorage.setItem('myfav', JSON.stringify(favegist));\n addToFave(fave_link);\n };\n\n description.id = contentlist[i].link;\n list.appendChild(description);\n description.appendChild(language);\n description.appendChild(link);\n description.appendChild(fave_button);\n }\n}", "title": "" }, { "docid": "88f56a506ab2ab92a14bc9bb945dc9cf", "score": "0.57943016", "text": "function getGists() {\n var numpage = document.getElementsByName('numpage')[0].value;\n\n for (var i = 0; i < numpage; i++) {\n\n /*XMLHTTPRequest code obtained from Mozilla Developer Network*/\n var request;\n if (window.XMLHttpRequest) { /*Mozilla, Safari, IE7+...*/\n request = new XMLHttpRequest();\n } else if (window.ActiveXObject) { /*IE6 and older*/\n request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n if (!request) {\n throw 'HttpRequest cannot be created';\n }\n \n var url = 'https://api.github.com/gists?page=' + numpage + '&per_page=30';\n\n request.onreadystatechange = function() {\n if (this.readyState === 4 && this.status === 200) {\n var new_gist = JSON.parse(this.responseText);\n for (var i = 0; i < new_gist.length; i++) {\n var description = new_gist[i].description;\n var link = new_gist[i].html_url;\n var language = \"\";\n for (var prop in new_gist[i].files) {\n if (new_gist[i].files[prop].language) {\n language = new_gist[i].files[prop].language;\n }\n var next_gist = new Gist(description, link, language);\n addGist(next_gist);\n }\n }\n }\n showGist(gistList);\n };\n \n request.open('GET', url, true);\n request.send(null);\n \n }\n}", "title": "" }, { "docid": "1c27563c6427f7a6c92cbed85d732cfb", "score": "0.5729105", "text": "function displayGroceries() {\r\n const ul = document.querySelector('ul');\r\n groceries.forEach((item) => {\r\n const li = document.createElement('li');\r\n li.innerText = item.name;\r\n const checkCircle = document.createElement('i');\r\n checkCircle.setAttribute('class', 'far fa-check-circle');\r\n li.appendChild(checkCircle);\r\n ul.appendChild(li);\r\n });\r\n}", "title": "" }, { "docid": "a2d95796d6a681abbb49a7046bc64132", "score": "0.5671827", "text": "function displayVolunteers() {\n document.getElementById('volunteers').innerHTML = \"\";\n let ref = firebase.database().ref(\"Users/\");\n ref.on(\n \"value\",\n function (snap) {\n snap.forEach(function (snap) {\n // obtains info for each volunteer from database\n initializeVolunteerInfo(snap);\n\n // only display info if availability is set to open\n if (availability === 'Open' && is_volunteer) {\n createVolunteerListing();\n }\n });\n });\n}", "title": "" }, { "docid": "ec8f1b05522a0d187f658212d2ccacee", "score": "0.56551063", "text": "function listSetGists(setGistId, noDefault) {\n\n function addGist(setName, id, title) {\n $('#examples_' + setName).append('<li id=\"gist_' + id + '\" class=\"news_entry\"><a href=\"#\" onClick=\"return handleEditGist(\\'' + id + '\\')\">' + title + '</a></li>');\n }\n\n function addSet(setName,id, title) {\n $('#examples_' + setName).append('<li id=\"set_' + id + '\" class=\"news_entry\"><a href=\"#\" onClick=\"return handleSelectSet(\\'' + id + '\\')\">' + title + '</a></li>');\n }\n\n function onSuccess(gist) {\n try {\n var index = JSON.parse(gist.data.files[\"index.json\"].content);\n clearExampleSets();\n $.each(index.sets, function(idxs, set) {\n addExamplesSet(idxs, set.title);\n $.each(set.items, function(idxi, item) {\n if (item.gist != null) {\n addGist(idxs, item.gist, item.title);\n } else if (item.set != null) {\n addSet(idxs, item.set, item.title);\n }\n });\n });\n if (!noDefault && index[\"default\"] != null) {\n editGist(index[\"default\"].gist);\n }\n markGistSelected(selectedSet, selectedGist);\n handleResizeSidebar();\n } catch (ex) {\n printError(\"Error in Set '\" + setGistId + \"': \" + ex);\n addExamples(); // Add our fixed example set\n }\n }\n \n function onError(xhr, status, err) {\n printError(\"Error retrieving Set '\" + setGistId + \"': \" + (err?err:status));\n addExamples(); // Add our fixed example set\n }\n \n // Retrieve code\n github.gist(setGistId).fetch({\n success: onSuccess,\n error: onError\n });\n}", "title": "" }, { "docid": "4b58c197beb25f43cb31251077e61772", "score": "0.5640632", "text": "function fetchGist() {\n var httpRequest = new XMLHttpRequest();\n if (!httpRequest) {\n \tthrow 'Fetch request creation failed.'\n }\n\n fetchedGist = [];\n var pageSelect = document.getElementById('numPages');\n var numPages = pageSelect[pageSelect.selectedIndex].value;\n var url = 'https://api.github.com/gists/public?page=';\n\n httpRequest.onreadystatechange = function() {\n \tif (httpRequest.readyState === 4) {\n \t fetchedGist = fetchedGist.concat(JSON.parse(this.responseText));\n\n \t if (currentRequest < numPages) {\n \t currentRequest++;\n \t httpRequest.open('GET', url + currentRequest);\n \t httpRequest.send();\n \t }\n \t else {\n removeFavsFetched();\n generateList();\n \t }\n }\n }\n\n var currentRequest = 1;\n\n httpRequest.open('GET', url + currentRequest);\n httpRequest.send();\n}", "title": "" }, { "docid": "f5741d17aed2d1ec9fac9768db9ee54c", "score": "0.5608409", "text": "function displayUsers(){\n var tofind = document.getElementById('searchbar').value;\n getusers(tofind,function(responsedata){\n var data = responsedata;\n finalcontent.innerHTML='<h3>Users</h3>';\n data.items.forEach(function(user){\n var userstring ='onclick=\"userrepos(\\''+user.login+'\\')\">';\n finalcontent.innerHTML+= '<tr><td>'+'<img src='+user.avatar_url+'>'+'&nbsp&nbsp&nbsp&nbsp'+'<span id=\"usersfont\" '+ userstring + user.login +'</span>'+'</td></tr>';\n });\n });\n }", "title": "" }, { "docid": "23f5d3fda2434920126ca0ac26cc085d", "score": "0.56070065", "text": "function displayGroceries() {\n const ul = document.querySelector('ul');\n const circle = document.querySelector('far fa-check-circle');\n groceries.forEach((item) => {\n const li = document.createElement('li');\n li.innerText = item.name;\n const checkCircle = document.createElement('i');\n checkCircle.setAttribute('class', 'far fa-check-circle');\n li.appendChild(checkCircle);\n ul.appendChild(li);\n });\n}", "title": "" }, { "docid": "6e01bca5a785048055aa94883a3bb4e3", "score": "0.56045216", "text": "function getRecentGists()\n {\n var recent = localStorage.getItem(\"codebeats-recent-gists\");\n return (recent) ? recent.split(\",\") : [];\n }", "title": "" }, { "docid": "346bd7fd4fbefea869a4de9634fc5c7d", "score": "0.56023186", "text": "function listGarages(){\n\tvar aj = $.ajax({\n\t\turl: \"garages\",\n\t\ttype: \"get\"\n\t});\n\taj.done(function(data) {\n\t\tvar ul = $(\"#garageUL\");\n\t\tul.html(\"\");\n\t\tdata.forEach(function(garage, index){\n\t\t\tif(garage != null) {\n\t\t\t\tvar t = $(\"<li> Name: \" + garage.name + \" Location: \" + garage.location + \"</li>\");\n\t\t\t\tt.click(function(){\n\t\t\t\t\tdeleteGarage(index);\n\t\t\t\t});\n\t\t\t\tul.append(t); \n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "a5f4f3873878b7d1ced0484b21f5950e", "score": "0.55976844", "text": "function renderFavArtistList() {\n var favArtistList = JSON.parse(window.localStorage.getItem(\"favArtistList\")) || [];\n var artistsEl = $(\"#fav-artist-list\");\n if (favArtistList !== null) {\n artistsEl.empty();\n var ulArtistsEl = $(\"<ul>\");\n for (var i = 0; i < favArtistList.length; i++) {\n var liArtistsEl = $(\"<li>\").addClass(\"artist\");\n liArtistsEl.text(favArtistList[i].artistName);\n ulArtistsEl.append(liArtistsEl);\n }\n artistsEl.append(ulArtistsEl);\n }\n}", "title": "" }, { "docid": "5cfb411267fa9aa512cdd7a39ccfd9a0", "score": "0.558702", "text": "function getUsers(){\n console.log('getUsers called');\n grout.Users.get().then(function(app){\n console.log('apps list loaded:', app);\n document.getElementById(\"output\").innerHTML = JSON.stringify(app);\n }, function(err){\n console.error('Error getting users:', err);\n });\n }", "title": "" }, { "docid": "9232d9c0f5a107fde134e7eaf73a9f0a", "score": "0.55637765", "text": "render(){\n if (this.props.loading) {\n return <LoadingPage />;\n }\n return(\n <Fragment>\n {\n this.props.searchedUserGists.length !== 0?(\n this.props.searchedUserGists.map((gist,index) => {\n const keys = Object.keys(gist.files);\n return(\n <Gist gist={gist} index={index} key={gist.id} keys={keys}/>\n )\n })\n ):(\n <Error/>\n )\n }\n \n </Fragment>\n )\n }", "title": "" }, { "docid": "82abda76632a1a686de18310d4fb6ef4", "score": "0.55535203", "text": "function populateOrgs() {\n if ($scope.curUser.role === 'ROLE_SITE-SU') {\n $scope.availableOrgs = $scope.curTrial.available_family_orgs;\n } else {\n $scope.availableOrgs.push($scope.curUser.organization);\n }\n }", "title": "" }, { "docid": "5f8a203632e76c0f72cbdfa15265d770", "score": "0.5545138", "text": "function displayGroupInfo() {\n firebase.auth().onAuthStateChanged(function (user) {\n db.collection(\"users\")\n .doc(user.uid)\n .get().then(function (doc) {\n var groupID = doc.data().group;\n var docRef = db.collection(\"groups\").doc(groupID);\n docRef.get().then((doc) => {\n if (doc.exists) {\n var groupName = doc.data().groupName;\n var desc = doc.data().desc;\n var members = doc.data().members;\n $(\"#name\").val(groupName);\n $(\"#desc\").val(desc);\n // document.getElementById(\"group_members\").innerHTML = \"\";\n displayMembers(members);\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document!\");\n }\n }).catch((error) => {\n console.log(\"Error getting document:\", error);\n });\n });\n\n });\n}", "title": "" }, { "docid": "99ea15f02ba766b5ba4d08c1f18c3da6", "score": "0.55395836", "text": "function showGritter(gritter){\r\n\tif(gritter == 'new_user_add_location'){\r\n\t\t//gritterNewUserAddLocation();\r\n\t}\r\n\telse if(gritter == 'multiple_location_names'){\r\n\t\t//gritterMultipleLocationNames();\r\n\t}\r\n\telse if (gritter == 'update_helppage'){\r\n\t\t//gritterUpdateHelpPage();\r\n\t}\r\n\telse if (gritter == 'update_publicprofiles'){\r\n\t\t//gritterUpdatePublicProfiles();\r\n\t}\r\n\telse if (gritter == 'update_newsearch'){\r\n\t\t//gritterUpdateNewSearch();\r\n\t}\r\n}", "title": "" }, { "docid": "6e9cb5611ed2494ec9bb30e064c363bb", "score": "0.553471", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.name;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "25edbd39c03e5bd8a1798ee894b3f373", "score": "0.55257165", "text": "function showUser(uid,gid){\n\tUserID=uid;\n\tGroupID=gid;\n\tUpdUsrGrp=0;\n\tshowPriveleges(uid,gid,'1');\n}", "title": "" }, { "docid": "279d69727f109ef31e7795069c526bc8", "score": "0.55162716", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.className = 'type=\"disc\"';\n li.innerText = user.username;\n userList.appendChild(li);\n });\n }", "title": "" }, { "docid": "fedee954240794e63f4e312fe133c003", "score": "0.5506642", "text": "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}`;\n}", "title": "" }, { "docid": "fad2ab8bae4ed0b9cff55588b41336d7", "score": "0.5502381", "text": "function printUsers(){\n console.log(userList)\n }", "title": "" }, { "docid": "2a158a00b3dd9e4f8dc79e4d5731f8fd", "score": "0.5474004", "text": "function outputUsers(users){\n usersList.innerHTML = `${users.map(user => `<li>${user.username}</li>`).join('')}`;\n}", "title": "" }, { "docid": "a60d15c25a1bf9899bc74948efeab1a8", "score": "0.54691875", "text": "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "title": "" }, { "docid": "3a34446c281313c7da4997f031f770b4", "score": "0.54492295", "text": "function outputUsers(users) {\n document.getElementById(\"totalusers\").innerHTML = (users).length\n userList.innerHTML = \"\";\n users.forEach((user) => {\n const li = document.createElement(\"li\");\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "6d9362781ea394f41ee9716aa532ce3c", "score": "0.54431283", "text": "function populateGrid(users) {\n\tvar html = '';\n\tfor (i=0; i<users.length; i++) {\n\t\t$(\".user-list\").html(html += \"<ul>\"+users[i] + \"</ul>\")\n\t\t\n\t};\n}", "title": "" }, { "docid": "e8be7109bc6a91d6b39256ce9159983b", "score": "0.54391223", "text": "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `\n}", "title": "" }, { "docid": "7000202777e82e32af56880ac802fbfd", "score": "0.5435865", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach(user=>{\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "92d029d495346e0f946abc9f4374c2ac", "score": "0.54355913", "text": "function getUserRecipes(){\n\n\tvar userRef = firebase.database().ref().child('User Profiles/');\n\tvar userEmail;\n\n\tconsole.log('HOOH');\n\tfirebase.auth().onAuthStateChanged(function(user) {\n if (user) {\n // User is signed in.\n\t\tconsole.log(user.email);\n\t\tuserEmail = user.email;\n\t\tuserRef.orderByChild('Email').equalTo(userEmail).once(\"value\", function(snapshot) {\n\t\t\tsnapshot.forEach(function(uname) {\n\t\t\t\t console.log(uname.child(\"displayName\").val());\n\t\t\t\t listOptions(uname.child(\"displayName\").val());\n\t\t\t });\n\t\t});\n } else {\n // No user is signed in.\n\tconsole.log('nah');\n }\n});\n}", "title": "" }, { "docid": "012f409eb4d54d3c4e01b8bc438d54fa", "score": "0.54293764", "text": "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "title": "" }, { "docid": "cd2c69d74853eafe0c438d9a8bcbbfb4", "score": "0.54273224", "text": "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "title": "" }, { "docid": "eb2bd43cfb9b7ff10e5e83cd2af8726e", "score": "0.54197925", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "eb2bd43cfb9b7ff10e5e83cd2af8726e", "score": "0.54197925", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "4560100c676c092f1a2ee588fe91bb05", "score": "0.5418663", "text": "function outputUsers(users) {\n userList.innerHTML = \"\";\n users.forEach((user) => {\n const li = document.createElement(\"li\");\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "bba899802f73833a37270d385a749f6b", "score": "0.541862", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "bba899802f73833a37270d385a749f6b", "score": "0.541862", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "bba899802f73833a37270d385a749f6b", "score": "0.541862", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "7a15b016468d87f232c2e7a5da168e2a", "score": "0.5417474", "text": "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map((user) => `<li>${user.username}</li>`).join(\"\")}\n `;\n}", "title": "" }, { "docid": "5395a7fe02ac505ad40ebb9418da2d7d", "score": "0.5417327", "text": "function showRepos(repoJson) {\n\tUSER_LIST.hidden = true;\n\tREPO_LIST.hidden = false;\n\tREPO_LIST.innherHTML = \"\";\n\tfor (repo of repoJson) {\n\t\tREPO_LIST.append(createRepo(repo));\n\t}\n}", "title": "" }, { "docid": "c91bc484f7e1ed32634a0607565e0797", "score": "0.5416393", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "c91bc484f7e1ed32634a0607565e0797", "score": "0.5416393", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "c91bc484f7e1ed32634a0607565e0797", "score": "0.5416393", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "da8a151177e426d7b0331fe780e98825", "score": "0.54102564", "text": "function outPutUsers(users){\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}`;\n \n}", "title": "" }, { "docid": "1e1e0bdf9e44deddf7ef4976bd0c6a50", "score": "0.5405535", "text": "function outputUsers(users) {\n usersList.innerHTML = users\n .map((user) => `<li>${user.username}</li>`)\n .join('');\n}", "title": "" }, { "docid": "b41b2b952e265901096289d2deb072ce", "score": "0.54054844", "text": "function outputUsers (users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `\n}", "title": "" }, { "docid": "f1851e050169ae9f1047d9efd1adcc4c", "score": "0.54023063", "text": "function showList () {\n const myData = getStorage();\n\n // We don't have values to show\n if(myData.length === 0) {\n $('.list-display-field').html(config.emptyListMsg);\n } else {\n const list = myData.reduce(\n (list, value, index) => `\n ${list}<div id=\"${index}\">\n ${value.user}: ${value.message}\n </div>`\n , '');\n\n // display the value here\n $('.list-display-field').html(list);\n }\n }", "title": "" }, { "docid": "550c79f9ecf5f57f6d81483a02b834fa", "score": "0.540168", "text": "function getOwners() {\n $.get(\"/api/owners\", renderOwnerList);\n }", "title": "" }, { "docid": "047f43cd563bbda97a5b3ef9fe733393", "score": "0.53887564", "text": "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user=> `<li>${user.username}</li>`).join('')}`;\n \n }", "title": "" }, { "docid": "acbdcbc11fbd27378d17c50adf7b33ec", "score": "0.5380512", "text": "function renderUsers() {\n for (let i = 0; i < userScores.length; i++) {\n const user = JSON.parse(localStorage.getItem(\"userScores\"));\n const userList = document.createElement(\"li\");\n userList.innerText = user[i];\n highScoreList.appendChild(userList);\n }\n}", "title": "" }, { "docid": "5e7fa844246828211da56022d77f49e6", "score": "0.5376507", "text": "function displayAll() {\n const result = document.querySelector('#result');\n const studList = document.createElement('ol');\n studList.classList.add('list-group', 'w-50', 'p-3');\n\n students.forEach(function(student) {\n const item = document.createElement('li');\n item.innerHTML = student.getFullName();\n item.classList.add('list-group-item');\n studList.appendChild(item);\n });\n result.appendChild(studList);\n}", "title": "" }, { "docid": "294cd33324f1edfb960a9486385b99fb", "score": "0.5375676", "text": "function displayFavourites(){\n\t//Exit if no favorites stored\n\tif (localStorage.getItem(\"favouritesId\") == null || localStorage.getItem(\"favouritesId\") == '')\n\t\treturn ;\n\t\n\tfavouritesId = localStorage.getItem(\"favouritesId\").split(\",\");\n\n\tfavouritesContainer.innerHTML = '';\n\tfavouritesId.forEach(favouriteId => {\n\t\tif (favouriteId != '') {\n\t\t\turl = baseUrl + prefixHeroes + \"getCharacterById?id=\" + favouriteId;\n\t\t\trequest(\"GET\", url, displayFavouriteCbk, null, false);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "e6e8a1fa6e93535050ca0fcc8ff3aae4", "score": "0.5369805", "text": "function displayUser(currentUser){\n $('div.solopoints').append(\"<p>My Points\" + currentUser.indPoints + \"/ 500 </p> <p> Progress towards $25 Nike Gift Card\");\n for (i=0; i < currentUser.userBadge.length; i++) {\n console.log(currentUser.userBadge[i].icon);\n $('div.badges').append(\"<span><img src=\" + currentUser.userBadge[i].icon + \"></img> <p>\" + currentUser.userBadge[i].name + \"</p></span>\");\n }\n\n}", "title": "" }, { "docid": "05b52e7e6c6608abad0b5de60178d236", "score": "0.5364765", "text": "function outputUsers(users) {\n userList.innerHTML = \"\";\n users.forEach((user) => {\n const li = document.createElement(\"li\");\n\n li.innerHTML = `<div class=\"icon-user\">\n <img src=\"image/guest.jpg\" alt=\"\" />\n <div class=\"status-circle ${user.active === 1 ? 'active':'offline'}\"></div>\n <div class=\"user-name\">${user.username}</div>\n </div>`;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "857bfc231ea2074a2b98a972f2e377f3", "score": "0.53633964", "text": "static listAction(){\n\t\tlet kparams = {};\n\t\treturn new kaltura.RequestBuilder('userinterest', 'list', kparams);\n\t}", "title": "" }, { "docid": "ba77608a376f0cc704a3a7b2a57173dd", "score": "0.5350465", "text": "function outputUsers(users){\n userList=innerHTML='';\n users.forEach((user)=>{\n const li = document.createElement('li');\n li.innerText=user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "5946a287e58b6bfe1d4ebf07f1625b86", "score": "0.5348842", "text": "function show_my_groups()\n{\n\tvar study_groups = [];\n\n\t$.ajax({\n\t\turl: '/studygroups/myGroups',\n\t\tmethod: 'GET',\n\t\tdataType: 'json',\n\t\tsuccess: function(data)\n\t\t{\n\t\t\tstudy_groups = data;\n\t\t\tjQuery(\".uos_my_study_groups\").empty();\n\t\t\tjQuery(\".uos_my_study_groups\").html(\"<h1>My Study Groups</h1>\");\n\n\t\t\tfor (var i = 0; i < study_groups.length; i++)\n\t\t\t{\n\t\t\t\tvar data = \"<div class = 'uos_sg'>\" +\n\t\t\t\t\t\t\t\t\"<div class = 'uos_study_group_img'>\" +\n\t\t\t\t\t\t\t\t\t\"<img src = '\" + study_groups[i]['img'] + \"'>\" +\n\t\t\t\t\t\t\t\t\"</div>\" +\n\t\t\t\t\t\t\t\t\"<div class = 'uos_study_group_text'>\" +\n\t\t\t\t\t\t\t\t\t\"<h3>\" + study_groups[i]['group_name'] + \"</h3>\" +\n\t\t\t\t\t\t\t\t\t\"<a href = '/group?id=\" + study_groups[i]['group_id'] + \"' id = 'uos_open_group'>View profile</a>\" +\n\t\t\t\t\t\t\t\t\"</div>\" +\n\t\t\t\t\t\t\t\"</div>\";\n\n\t\t\t\tjQuery(\".uos_my_study_groups\").append(data);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a6a5096a3a3ad0480919e6c0cb2699a4", "score": "0.5345026", "text": "function showUsers() {\n $(function() {\n $(\"#users-list\").empty();\n //users-list\n for (let user of users) {\n if (user.username === selectedUser.username) {\n $(\"#users-list\").append(\n `<li class=\"list-group-item list-group-item-action active\">${user.username}</li>`\n );\n } else {\n $(\"#users-list\").append(\n `<li class=\"list-group-item list-group-item-action\">${user.username}</li>`\n );\n }\n }\n });\n}", "title": "" }, { "docid": "b8059b250b2990dd55c911e0a18642eb", "score": "0.5340832", "text": "function getSuggestedUsers(){\n\tFriendService.getSuggestedUsers().then(function(response){\n\t\t$scope.suggestedUsers=response.data// List<User> [S in (A- (BUC))]\n\t},function(response){\n\t\tif(response.status==401)\n\t\t\t$location.path('/login')\n\t})\n\t}", "title": "" }, { "docid": "7c9eff6ccee926b3f8f992b2996b797c", "score": "0.5338616", "text": "function AllAuthorized() {\n $(\"#j-card-authentication\").hide();\n $(\"#j-card-configuration\").show();\n $(\"#j-card-action\").show();\n $(document).trigger(\"github4jiveAuthorized\");\n gadgets.window.adjustHeight(); // do this here in case the pre-auth callback above wasn't called\n\n // set up a query to get this user's list of repositories\n $(\"#loader\").addClass(\"j-loading-big\");\n osapi.http.get({\n 'href': host + '/github/user/repos?' +\n \"&ts=\" + new Date().getTime() +\n \"&place=\" + encodeURIComponent(placeUrl),\n //\"&query=\" + query,\n 'format': 'json',\n 'authz': 'signed'\n }).execute(function (response) {\n\n if (response.status >= 400 && response.status <= 599) {\n alert(\"ERROR!\" + JSON.stringify(response.content));\n }\n var data = response.content;\n for (var i = 0; i < data.length; i++) {\n var opt;\n var name = data[i].fullName;\n if (name === previousRepo) {\n opt = \"<option value=\" + data[i].name + \" selected>\" + data[i].fullName + \"</option>\";\n } else {\n opt = \"<option value=\" + data[i].name + \">\" + data[i].fullName + \"</option>\";\n }\n $(\"#projectList\").append(opt);\n }\n $(\"#loader\").removeClass(\"j-loading-big\");\n });\n}", "title": "" }, { "docid": "18e37f60a579b9256d56be47bc60b143", "score": "0.53336585", "text": "function displayGroceries() {\n const list = document.getElementById('groceries');\n groceries.forEach(element => {\n const container = document.createElement('li');\n container.innerText = element;\n list.appendChild(container);\n });\n}", "title": "" }, { "docid": "7115771e43abe101da15653e0ebc0f61", "score": "0.5327272", "text": "function showUserGroup(gid){\n\tGroupID=gid;\n\tUpdUsrGrp=1;\n\tshowPriveleges('0',gid,'1');\n}", "title": "" }, { "docid": "25a43a5a8a94bdd555dc9b8945346562", "score": "0.5326044", "text": "listAllUsers(){}", "title": "" }, { "docid": "1a52c81eddb6b03ea717116f24da90e9", "score": "0.53112715", "text": "function searchFollowers(minimumFollower, maximumFollower) {\n $(\"#results\").empty()\n $(\"#text-change\").html(\"Users with followers between \" + minimumFollower + \" and \" + maximumFollower);\n $.get(\"https://api.github.com/search/users?q=followers:\" + minimumFollower + \"..\" + maximumFollower + \"&per_page=100\", function (data) {\n console.log(data)\n data.items.forEach(element => {\n user = `<a target=\"_blank\" href=\"${element.html_url}\" style=\"padding:10px\">\n <img class=\"img-thumbnail ml-5\" width=\"150\" height=\"100\" src=\"${element.avatar_url}\"/>\n </a>\n `\n $(\"#results\").append(user)\n });\n })\n }", "title": "" }, { "docid": "3807b3368e9c063a2418dd33243fd23d", "score": "0.5310456", "text": "function displayUsers(users){\n const block = $('<ul>');\n users.forEach(function(user){\n const uElement = $('<li>').text(user.name);\n block.append(uElement);\n });\n $('section.users').append(block);\n}", "title": "" }, { "docid": "d943be6cb96cf5a1bcbf50a5b882bb54", "score": "0.53103334", "text": "function showMale() {\n\tlet bigList = document.getElementById(\"bigList\");\n\tfor (var i = 0; i < personCollection.length; i++) {\n\t\t\n\t\tif (personCollection[i].constructor.name == \"Male\") {\n\t\t\tbigList.innerHTML += personCollection[i].render();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2783a23ffd7cc2e374364e1c0030cccb", "score": "0.5304794", "text": "function outputUsers(users) {\n console.log(users);\n userList.innerHTML = '';\n users.forEach(user => {\n const li = document.createElement('li');\n li.innerText = user.username;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "95dee725de181dc959c305d00b7fe769", "score": "0.53008926", "text": "function displayAllUsers() {\n hideFields(\"#search\");\n var url = \"/displayAllUsers\";\n fetch(url).then(function (response) {\n if (response.ok) {\n response.json().then(function (json) {\n getAllUsersChart(json);\n });\n } else {\n console.log(\"error\");\n }\n });\n}", "title": "" }, { "docid": "d3392ee851da68d6b98947d2e6bbb5e3", "score": "0.52999586", "text": "function getFollowedUsers(){\n\tconst inputData = \"followedUserRequest\"\n\tfetch(\"/following\",fetchParameterInit(inputData))\n\t\t.then(response => {\n\t\t\tresponse.json()\n\t\t\t\t.then(\n\t\t\t\t\tresponseJson => {\n\t\t\t\t\t\tlet data = (responseJson.sort((a, b) => (a.name > b.name) ? -1 : 1));\n\t\t\t\t\t\tdata.forEach(currentValue => {\n\t\t\t\t\t\t\t$(\"#current-follow-dropdown\")[0].innerHTML +=\n\t\t\t\t\t\t\t`<option>${currentValue}</option>`\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t})}", "title": "" }, { "docid": "470dad319986a9b94485909cfaba373e", "score": "0.5299387", "text": "function showFemale() {\n\tlet bigList = document.getElementById(\"bigList\");\n\tfor (var i = 0; i < personCollection.length; i++) {\n\t\t\n\t\tif (personCollection[i].constructor.name == \"Female\") {\n\t\t\tbigList.innerHTML += personCollection[i].render();\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "8dd51a7559d982f18e5b9561625f9a13", "score": "0.52988684", "text": "function displayRepos (repos){\n filterInput.classList.remove(\"hide\");\n for (let repo of repos){\n const li = document.createElement(\"li\");\n li.classList.add(\"repo\");\n li.innerHTML = `<h3>${repo.name}</h3>`\n repoList.append(li);\n }\n}", "title": "" }, { "docid": "67ea6d8ec123e8a2b77c01f264d5fb8f", "score": "0.5298379", "text": "function renderFavorites() {\n // Get the list from local storage and store in local variable\n favoritePlayersNames = JSON.parse(localStorage.getItem(\"fav\"));\n if (!favoritePlayersNames) {\n favoritePlayersNames = [];\n }\n // Clear the container (ul)\n dropDownList.empty();\n // Loop through the list from localStorage and append to ul\n for (let i = 0; i < favoritePlayersNames.length; i++) {\n var listItem = $(\"<li></li>\");\n var listItemLinks = $(\"<a></a>\");\n listItem.append(listItemLinks);\n listItemLinks.html(\n favoritePlayersNames[i].playerName +\n \" (\" +\n favoritePlayersNames[i].platform +\n \")\"\n );\n dropDownList.append(listItem);\n }\n }", "title": "" }, { "docid": "f78b81d578db1ad9dbf7bd332f8797d4", "score": "0.528537", "text": "function outputUsers(users) {\n const userList = document.querySelector('#users');\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "title": "" }, { "docid": "52894fb0e6bfdac2830de374c8a03bf2", "score": "0.52833545", "text": "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n} // use join method b/c users are an array and turn it into a string", "title": "" }, { "docid": "73a83d9f362ff3dd3068a9aebe63604a", "score": "0.52795804", "text": "function outputUsers(users) {\n userList.innerHTML = '';\n users.forEach((user) => {\n const li = document.createElement('li');\n li.innerText = user.sender;\n userList.appendChild(li);\n });\n}", "title": "" }, { "docid": "84203672904aa30aa74426e55ba39ef9", "score": "0.52773994", "text": "getUserList() {\n this.onGet('/users').replyOnce(\n 200,\n [\n {\n login: 'railsjitsu',\n id: 32,\n node_id: 'MDQ6VXNlcjMy',\n avatar_url: 'https://avatars2.githubusercontent.com/u/32?v=4',\n gravatar_id: '',\n url: 'https://api.github.com/users/railsjitsu',\n },\n {\n login: 'nitay',\n id: 34,\n node_id: 'MDQ6VXNlcjM0',\n avatar_url: 'https://avatars2.githubusercontent.com/u/34?v=4',\n gravatar_id: '',\n url: 'https://api.github.com/users/nitay',\n },\n ],\n {\n link:\n '<https://api.github.com/users?since=5&per_page=2>; rel=\"next\", <https://api.github.com/users{?since}>; rel=\"first\"',\n }\n );\n }", "title": "" }, { "docid": "3fa74442056218410cb19f888660265d", "score": "0.5275179", "text": "function getGroupsAndUsers(){\n\t//PHP-Request\n\t$.get(\"php/getGroupsUser.php\", function(data){\n\t\tvar parsedData = JSON.parse(data);\n\t\t//For each user\n\t\tfor(var j = 0; j < parsedData[0][0].length; j++){\n\t\t\t//If it is not you who logged in\n\t\t\tif(credentials[0] != parsedData[0][1][j])\n\t\t\t\t//Add the user to the selection list\n\t\t\t\t$(\"select[id='users']\").append(new Option(parsedData[0][1][j], parsedData[0][0][j]));\n\t\t}\n\t\t//For each group\n\t\tfor(var j = 0; j < parsedData[1][0].length; j++){\n\t\t\t//Add the group to the selection list\n\t\t\t$(\"select[id='groups']\").append(new Option(parsedData[1][1][j], parsedData[1][0][j]));\n\t\t}\n\t});\n}//Display available groups and users", "title": "" }, { "docid": "4cc985d29df782f1451c49c3d256c6f8", "score": "0.52744305", "text": "function displayFav(userAccount) {\n const dbRef = firebase.database().ref(`user/${userAccount}/`).limitToLast(5);\n dbRef.on(\"value\", (firebaseData) => {\n document.getElementById(\"displayUsername\").innerHTML = \"\";\n firebaseData.forEach(function (childSnapshot) {\n var childKey = childSnapshot.key;\n var childData = childSnapshot.val();\n document.getElementById(\"displayUsername\").innerHTML +=\n `<div class=\"account-list\">\n <p>Username: \n <span>\n ${childData[\"username\"]}\n </span>\n </p> \n <p>Password: \n <span>\n ${childData[\"password\"]}\n </span>\n </p>\n </div>`\n ;\n });\n });\n}", "title": "" }, { "docid": "5dea1db310ef779cc8432b785aede182", "score": "0.5271808", "text": "function displayUsers(users) {\n //create a shortcut to the html element that will be modified\n //also create a fragment to store changes on, and that will be later appended to the html element\n var dom = document.querySelector('.users');\n var docFrag = document.createDocumentFragment();\n \n //run a foreach loop for each user in the users object\n //start out by selecting the array within the object so that the forEach method can be run\n users['users'].forEach(function(user) {\n //create a list item to be appended to the nav bar\n var li = document.createElement(\"li\");\n //make the text of the list item equal to the users full name\n li.textContent = user.name['first'] + \" \" + user.name['last'];\n //set a click event listener that contains the captured user data\n li.addEventListener('click', getUserInfo.bind(null, user));\n //append the list item to the document fragment\n docFrag.appendChild(li);\n });\n \n //append the document fragment to the selected html element\n dom.appendChild(docFrag);\n}", "title": "" }, { "docid": "5e9f74fb6ba0e809252cabd6724985ae", "score": "0.5267748", "text": "function buildGroupsForUserList(userName, listId) {\n var options = {\n \"username\" : userName,\n \"type\": \"users\"\n }\n // Use an SDK method to get an entity object \n // representing the user whose groups should be \n // displayed.\n apigeeClient.getEntity(options, function(error, entity, data){\n if (error) {\n var message = \"Error getting user entity. \" + data;\n apigeeClient.logError({tag:\"buildGroupsForUserList\", logMessage:message})\n } else {\n // Call an SDK method to get the groups to which \n // the user belongs.\n entity.getGroups(function(error, data, groups){\n if (error){\n var message = \"Couldn't get a user's groups. \" + data;\n apigeeClient.logError({tag:\"buildGroupsForUserList\", logMessage:message})\n } else {\n // Clear the list into which group data will go.\n $(listId).empty();\n // Loop through the list of groups, adding \n // each to the list\n for (var i = 0; i < groups.length; i++) {\n var group = groups[i];\n $(listId).append(\n '<li data-theme=\"c\">' +\n '<h3>' + group.path + '</h3>' +\n '</li>');\n }\n // Refresh the list to make sure it's styled.\n $(listId).listview('refresh');\n }\n });\n }\n });\n}", "title": "" }, { "docid": "a5dfcf3978e717dd06e783ca5d0c63fc", "score": "0.52676743", "text": "function schoolGetListForUser() {\r\n var url = getBaseURL() + \"Schools/Current\";\r\n return $http.get(url);\r\n }", "title": "" }, { "docid": "4045e6e2799f5e1bf0f8c3b2883fade6", "score": "0.52676594", "text": "function displayProviders(tlds) {\n // clear the providersList\n providerList.textContent = '';\n if ((typeof tlds !== 'undefined') && (tlds.length > 0)) {\n for (var i = 0; i < tlds.length; i++) {\n if (providers.has(tlds[i])) {\n providerList.appendChild(providers.get(tlds[i]));\n } else {\n unknownList.appendChild(createBareListItem(tlds[i]));\n }\n }\n // once we look at all the tlds, we need to flag for the user if something wasn't found.\n if (providerList.childElementCount == 0) {\n if (gapi_error) {\n spreadsheetGetFail();\n } else {\n providerCaption.innerHTML = \"I didn't detect any known providers.\"\n }\n }\n if (unknownList.childElementCount > 0) {\n unknownCaption.innerHTML = \"Un-sorted service providers\";\n }\n } else {\n providerList.innerHTML = \"I didn't detect anything. Try reloading the page to try again.\"\n }\n}", "title": "" }, { "docid": "c032927c77db5841d985b6e88dec649d", "score": "0.5266021", "text": "async function listRegistrations() {\n const [registrations] = await client.listRegistrations({\n parent: `projects/${projectId}/locations/${location}`,\n });\n console.info(registrations);\n }", "title": "" }, { "docid": "b24e71a721a000503b8f1af0f9d13d07", "score": "0.52622926", "text": "function display() {\n console.log(\"Persons list loading\");\n visitType = util.getQueryParameter('visitType');\n cluster = util.getQueryParameter('cluster');\n assistant = util.getQueryParameter('assistant');\n region = util.getQueryParameter('region');\n tabanca = util.getQueryParameter('tabanca');\n date = util.getQueryParameter('date');\n amostra = util.getQueryParameter('amostra')\n \n // Set the background to be a picture.\n var body = $('body').first();\n body.css('background', 'url(img/bafata.jpg) fixed');\n body.css('background-size', 'cover');\n getNoc();\n loadPersons();\n}", "title": "" }, { "docid": "73a8f53363c6237e4e113489277ab715", "score": "0.5260034", "text": "function updateListDisplay() {\n userString = '';\n for (var i = 0; i <userArray.length; ++i) {\n userString += '<li class=\\\"user-info\\\"><span class=\\\"user-full-name\\\">' + userArray[i].firstName + ' ' + userArray[i].lastName + '</span><span class=\\\"user-email\\\">' + userArray[i].email + '</span><span class=\\\"user-remove' + userArray[i].email + '\\\">X</span></li>';\n }\n // userString = userString.replace(/,/'');\n}", "title": "" }, { "docid": "b9ff407d655cc6e90ff30235dc1e5914", "score": "0.5259686", "text": "function displayGroceries() {\n const showGroceries = document.querySelector('#groceries');\n for(let i = 0; i <groceries.length; i++){\n const item = document.createElement('li');\n item.innerText = groceries[i];\n showGroceries.insertAdjacentElement('beforeend', item);\n }\n\n}", "title": "" }, { "docid": "61a31b426f0317e487702bc40c2646a1", "score": "0.5257964", "text": "function getAllSongs() {\n var firebaseUser = auth.$getAuth();\n if(firebaseUser) {\n firebaseUser.getToken().then(function(idToken) {\n $http({\n method: 'GET',\n url: '/songs',\n headers: {\n id_token: idToken\n }\n }).then(function(response) {\n songCollection.list = response.data;\n });\n });\n } else {\n songCollection.list = [];\n console.log('cannot get when not logged in');\n }\n }", "title": "" } ]
9a065677df97258e4535df4c1d9d5b4c
True if the node is a list container
[ { "docid": "5a7e9d357416089ed4df8787fd19761a", "score": "0.70888823", "text": "function isList(opts, node) {\n return opts.types.includes(node.type);\n}", "title": "" } ]
[ { "docid": "ce33a5aebdfac24844c8b810277de509", "score": "0.7076655", "text": "isList () {\n return this.constructor.isList()\n }", "title": "" }, { "docid": "4069691fe4e00a3e50a2f86c0ebd4134", "score": "0.70443124", "text": "function isParentsHasList(node) {\n if (typeof(node) !== 'object' || typeof(node.parent) !== 'function') {\n node = $(node)\n }\n \n let tagName = node.prop('tagName')\n if (tagName !== undefined && tagName.toLowerCase() === 'li') {\n return true\n }\n \n let parent = node.parent()\n while (parent.length > 0 && parent.hasClass('note-editable') === false) {\n tagName = parent.prop('tagName')\n if (tagName === undefined) {\n return false\n }\n //console.log(tagName)\n if (tagName !== undefined && tagName.toLowerCase() === 'li') {\n return true\n }\n parent = parent.parent()\n }\n return false\n }", "title": "" }, { "docid": "44908d4a71a40f2f451ef529efd09dbf", "score": "0.70113856", "text": "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "title": "" }, { "docid": "44908d4a71a40f2f451ef529efd09dbf", "score": "0.70113856", "text": "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "title": "" }, { "docid": "44908d4a71a40f2f451ef529efd09dbf", "score": "0.70113856", "text": "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "title": "" }, { "docid": "44908d4a71a40f2f451ef529efd09dbf", "score": "0.70113856", "text": "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "title": "" }, { "docid": "44908d4a71a40f2f451ef529efd09dbf", "score": "0.70113856", "text": "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "title": "" }, { "docid": "44908d4a71a40f2f451ef529efd09dbf", "score": "0.70113856", "text": "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "title": "" }, { "docid": "44908d4a71a40f2f451ef529efd09dbf", "score": "0.70113856", "text": "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "title": "" }, { "docid": "44908d4a71a40f2f451ef529efd09dbf", "score": "0.70113856", "text": "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "title": "" }, { "docid": "6a1f967287213ab7f0eef490ef2e247b", "score": "0.6646345", "text": "function isArrayOrList(el){\n return Object.prototype.toString.call( el ) === '[object Array]' ||\n Object.prototype.toString.call( el ) === '[object NodeList]';\n }", "title": "" }, { "docid": "6a1f967287213ab7f0eef490ef2e247b", "score": "0.6646345", "text": "function isArrayOrList(el){\n return Object.prototype.toString.call( el ) === '[object Array]' ||\n Object.prototype.toString.call( el ) === '[object NodeList]';\n }", "title": "" }, { "docid": "44e1288968b05f20a1b840394a83fd46", "score": "0.6517996", "text": "function isDataStructure(node) {\n // we have a list...\n if(node.type !== 'list')\n return false\n\n // with 1 or 2 items...\n if (node.children.length < 1 || node.children.length > 2)\n return false\n\n const listItem = node.children[0]\n\n // that has some text and a list...\n if (listItem.children.length !== 2)\n return false\n\n const paragraph = listItem.children[0]\n const text = paragraph.children[0]\n\n // that matches our data structure heading\n return text.type === 'text' && dataStructurePattern.test(text.value)\n}", "title": "" }, { "docid": "1e3aee753678eb06f3900e058fff1d8d", "score": "0.6402895", "text": "isNodeList(value) {\n return Array.isArray(value) && (value.length === 0 || Node.isNode(value[0]));\n }", "title": "" }, { "docid": "88bcf0c450a26b03ff67e1e49c62379d", "score": "0.6347663", "text": "function isListType(type) {\n return type.indexOf('List<') >= 0 || type.indexOf('CommaDelimitedList') >= 0;\n}", "title": "" }, { "docid": "8691a48f94c7f89d5c83fb1f31224bb5", "score": "0.63273007", "text": "function isListElement(parent,node){switch(parent.kind){case 245/* ClassDeclaration */:case 246/* InterfaceDeclaration */:return ts.rangeContainsRange(parent.members,node);case 249/* ModuleDeclaration */:var body=parent.body;return!!body&&body.kind===250/* ModuleBlock */&&ts.rangeContainsRange(body.statements,node);case 290/* SourceFile */:case 223/* Block */:case 250/* ModuleBlock */:return ts.rangeContainsRange(parent.statements,node);case 280/* CatchClause */:return ts.rangeContainsRange(parent.block.statements,node);}return false;}", "title": "" }, { "docid": "2c2f8c3a7ef313255b45ea4db7924c6b", "score": "0.629122", "text": "isElementList(value) {\n return Array.isArray(value) && (value.length === 0 || Element.isElement(value[0]));\n }", "title": "" }, { "docid": "61e063324861be9e86c4990a712db8f6", "score": "0.6241622", "text": "function isNodeList(element){\n return NodeList.prototype.isPrototypeOf(element)\n}", "title": "" }, { "docid": "dac92076f12791386ee8a428aedf7243", "score": "0.59881526", "text": "isListItem () {\n return this.constructor.isListItem()\n }", "title": "" }, { "docid": "ef7223f813cd2b868b2c60ea86389396", "score": "0.58917826", "text": "function getOwningList(node){\n\t\twhile (node.parentNode){\n\t\t\tnode = node.parentNode;\n\t\t\tif (node.className){\n\t\t\t\tif (node.className.match(/list_/))\n\t\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "7f1e5e9ead073708b40cd85166db7c41", "score": "0.5804689", "text": "static is_do_list_item(item){\n return ( Array.isArray(item) || //accept data_arrays too. //Instruction.is_instructions_array(item)\n Instruction.is_non_instructions_array_do_list_item(item)\n )\n }", "title": "" }, { "docid": "378d30d857a6ee70a2387eeb487ba9be", "score": "0.57573056", "text": "function li(node, index, parent) {\n\t var next = after(parent, index);\n\t return !next || element(next, 'li');\n\t}", "title": "" }, { "docid": "bc4a459950b847f0126384f3c2167579", "score": "0.5747453", "text": "function is_tagged_list(expr, the_tag) {\n return is_pair(expr) && head(expr) === the_tag;\n}", "title": "" }, { "docid": "bc4a459950b847f0126384f3c2167579", "score": "0.5747453", "text": "function is_tagged_list(expr, the_tag) {\n return is_pair(expr) && head(expr) === the_tag;\n}", "title": "" }, { "docid": "aa9180aa566c2f47ee214225d1ff63f0", "score": "0.57072216", "text": "function isTypeNode(node){return ts.isTypeNodeKind(node.kind);}", "title": "" }, { "docid": "2fc4e544fe0a9ec94ff1afc8970b7693", "score": "0.5703004", "text": "function isLinked(node) {\r\n\treturn node.parentNode.nodeName == 'A';\r\n}", "title": "" }, { "docid": "987f6cd1aa21d323bc6142136b93e745", "score": "0.5702827", "text": "function isNodeType(type) {\n\t return t.isType(this.type, type);\n\t}", "title": "" }, { "docid": "5f9c76a6bda59d895e636c9ff577cb38", "score": "0.5674165", "text": "function isBranchList(arg) {\n return !!arg && ('type' in arg);\n }", "title": "" }, { "docid": "5f9c76a6bda59d895e636c9ff577cb38", "score": "0.5674165", "text": "function isBranchList(arg) {\n return !!arg && ('type' in arg);\n }", "title": "" }, { "docid": "5f9c76a6bda59d895e636c9ff577cb38", "score": "0.5674165", "text": "function isBranchList(arg) {\n return !!arg && ('type' in arg);\n }", "title": "" }, { "docid": "f13e0e7ead8bdc448b9ca350ef55ce0c", "score": "0.5667335", "text": "function li(node, index, parent) {\n var next = after(parent, index)\n return !next || element(next, listItem)\n}", "title": "" }, { "docid": "f13e0e7ead8bdc448b9ca350ef55ce0c", "score": "0.5667335", "text": "function li(node, index, parent) {\n var next = after(parent, index)\n return !next || element(next, listItem)\n}", "title": "" }, { "docid": "f13e0e7ead8bdc448b9ca350ef55ce0c", "score": "0.5667335", "text": "function li(node, index, parent) {\n var next = after(parent, index)\n return !next || element(next, listItem)\n}", "title": "" }, { "docid": "cbe43b0ff01ea2a679738a07fcc1349f", "score": "0.5667194", "text": "function isNodeType(type) {\n\t\t return t.isType(this.type, type);\n\t\t}", "title": "" }, { "docid": "cbe43b0ff01ea2a679738a07fcc1349f", "score": "0.5667194", "text": "function isNodeType(type) {\n\t\t return t.isType(this.type, type);\n\t\t}", "title": "" }, { "docid": "cbe43b0ff01ea2a679738a07fcc1349f", "score": "0.5667194", "text": "function isNodeType(type) {\n\t\t return t.isType(this.type, type);\n\t\t}", "title": "" }, { "docid": "cbe43b0ff01ea2a679738a07fcc1349f", "score": "0.5667194", "text": "function isNodeType(type) {\n\t\t return t.isType(this.type, type);\n\t\t}", "title": "" }, { "docid": "03a568b4ef41ba757578dca94682d0e0", "score": "0.5640203", "text": "function isItselfOrContains(node, container) {\n while (node) {\n if (node === container) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}", "title": "" }, { "docid": "122f162103f6b17ee20f3103c46162ca", "score": "0.5603552", "text": "function isInTypeDefinition(node) {\n let types = new Set()\n while (node) {\n types.add(node.type)\n if (isTypeDefinition(node)) {\n return true\n }\n node = node.parent\n }\n return false\n}", "title": "" }, { "docid": "75e178372fe8196f677327879bcbdaff", "score": "0.55896235", "text": "function hasType(node){return!!node.type;}", "title": "" }, { "docid": "3667fbc80862974dce9e96c82fda0f9b", "score": "0.5585137", "text": "get isArrayNode() {\n return this.isLeaf ? false : this.value instanceof ArrayValueClass ? true : false\n }", "title": "" }, { "docid": "707c0a1a6a4eefe0ed3ca2359f2401aa", "score": "0.5561402", "text": "function haveChildrenChanged(jNode) {\n var jIndex = 0,\n domIndex, domChildren = jNode.domNode.childNodes,\n jChildren = jNode.children,\n curDomNode;\n\n for (domIndex = 0; domIndex < domChildren.length; ++domIndex) {\n // for each dom element\n curDomNode = domChildren[domIndex];\n\n if (curDomNode.nodeType === 3 || curDomNode.nodeType === 1) {\n // this is a node that I care about\n if (jIndex >= jChildren.length || jChildren[jIndex].domNode !== curDomNode) {\n // I've run out of jChildren, or they do not match up\n return true;\n }++jIndex;\n }\n }\n // If I didn't get to the end of the jList\n if (jChildren.length !== jIndex) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "949e69ff33c2f21dfdd6858b780f7d47", "score": "0.55437756", "text": "get isObjectNode() {\n return this.isLeaf ? false : this.value instanceof ArrayValueClass ? false : true\n }", "title": "" }, { "docid": "b3ca4705c0c560621e3169efb6a6c46f", "score": "0.5535953", "text": "function isArray(item) {\n\t return Object.prototype.toString.call(item) === \"[object Array]\";\n\t}", "title": "" }, { "docid": "ad1cd50240c3d790a080081688c3abed", "score": "0.5535404", "text": "function isNode(node) {\n return node instanceof Node;\n }", "title": "" }, { "docid": "7668226fbd07b7222cca71fc61ebd57e", "score": "0.55344826", "text": "function isLView(value) {\n return Array.isArray(value) && typeof value[TYPE] === 'object';\n}", "title": "" }, { "docid": "afba1034b48607ab5af754ee33638b47", "score": "0.5509137", "text": "function isNode(value) {\n if (!value) {\n return false;\n }\n return ['String', 'Number', 'Boolean', 'Array', 'Object'].indexOf(value.constructor.name) === -1;\n}", "title": "" }, { "docid": "a275604e94da5682575be71510ec6a1a", "score": "0.5483334", "text": "function isArray(item) {\n return Object.prototype.toString.call(item) === \"[object Array]\";\n}", "title": "" }, { "docid": "4e0a59dcda221e70ef9bf7d09b3264d7", "score": "0.54790837", "text": "static isNode(obj) {\n\t\treturn obj.type;\n\t}", "title": "" }, { "docid": "1b5f0fe693aee9215038ab3ca1fce828", "score": "0.5473838", "text": "function isObject(el) {\n return (typeof el === 'object' && el !== null && !Array.isArray(el)) ? true : false;\n }", "title": "" }, { "docid": "9bd53777b2d24e01842f0b52cadb1456", "score": "0.54690003", "text": "hasChildren() {\n if (this._node.isLeafNode()) {\n return false;\n } else {\n return !this._node.isEmpty();\n }\n }", "title": "" }, { "docid": "6a99f64311072e7b078c55ba89856cf4", "score": "0.5468736", "text": "function isListMember (list, user) {\n var inList = false;\n angular.forEach(config.listTypes, function (listType) {\n angular.forEach(user[listType + 's'], function (userList) {\n if (list._id === userList.list) {\n inList = true;\n return inList;\n }\n });\n });\n return inList;\n }", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ca7d62d5bc08b369fa613dd405c45360", "score": "0.54615504", "text": "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "title": "" }, { "docid": "ee43e32077910a7dff53254bd5a9ba9e", "score": "0.54598796", "text": "function isSyntaxList(n){return n.kind===324/* SyntaxList */;}", "title": "" }, { "docid": "154ba604a4ae624cce6da081de885f0b", "score": "0.5458603", "text": "function IsContainerType(obj) {\n\ttry {\n\t\t//return (GetExactType(obj) != 'Boolean' && GetExactType(obj) != 'Date' && GetExactType(obj) != 'Enumerator' && GetExactType(obj) != 'Function' && GetExactType(obj) != 'Number' && GetExactType(obj) != 'RegExp' && GetExactType(obj) != 'String' && GetExactType(obj) != 'VBArray' && GetExactType(obj) != null && GetExactType(obj) !== undefined && GetExactType(obj) != 'n/a')\n\t\treturn (GetExactType(obj) != 'Boolean' && GetExactType(obj) != 'Date' && GetExactType(obj) != 'Enumerator' && GetExactType(obj) != 'Function' && GetExactType(obj) != 'Number' && GetExactType(obj) != 'RegExp' && GetExactType(obj) != 'String' && GetExactType(obj) != 'VBArray' && GetExactType(obj) != null && GetExactType(obj) !== undefined)\n\t} catch(e) {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "d8d7dfa60a12c7b1c17776bb9209453d", "score": "0.54488266", "text": "hasChildren() {\n return this.getContent().length > 0\n }", "title": "" }, { "docid": "5a672688023acd3bb4a52b4f2efaadf0", "score": "0.54147387", "text": "function hasChildren(node) {\n return (typeof node === 'object')\n && (typeof node.childNodes !== 'undefined')\n && (node.childNodes.length > 0);\n}", "title": "" }, { "docid": "e3485782345ff508f4d55729f746c9e9", "score": "0.54058236", "text": "isOperationList(value) {\n return Array.isArray(value) && (value.length === 0 || Operation.isOperation(value[0]));\n }", "title": "" }, { "docid": "fa59c6debdd5775e7a43875cfbfd8f32", "score": "0.5392911", "text": "isElement(value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0_is_plain_object__[\"a\" /* default */])(value) && Node.isNodeList(value.children) && !Editor.isEditor(value);\n }", "title": "" }, { "docid": "b5db4dec7fa8cb9644724399e8d29faa", "score": "0.5391823", "text": "function isContainer(obj) {\n return obj !== null && typeof obj === 'object';\n}", "title": "" }, { "docid": "fe0719bb16aff6b977995bed5cf8da9b", "score": "0.53882414", "text": "function isTabNode(node) {\n return node.nodeName === 'LI' && node.getAttribute('role') === 'tab';\n}", "title": "" }, { "docid": "fe0719bb16aff6b977995bed5cf8da9b", "score": "0.53882414", "text": "function isTabNode(node) {\n return node.nodeName === 'LI' && node.getAttribute('role') === 'tab';\n}", "title": "" }, { "docid": "fe0719bb16aff6b977995bed5cf8da9b", "score": "0.53882414", "text": "function isTabNode(node) {\n return node.nodeName === 'LI' && node.getAttribute('role') === 'tab';\n}", "title": "" }, { "docid": "5b5fad624643aa2b5701e14e6ef72a89", "score": "0.5382591", "text": "isArray(path) {\n\t\treturn this.children(path).length > 0;\n\t}", "title": "" }, { "docid": "14f4ab82647b993383dab3b7fb7ea60f", "score": "0.5369716", "text": "function hasSubmenu( elm ) {\n\t\t\t\t\t\t\t\t\t\treturn elm.getElementsByTagName( \"ul\" ).length > 0;\n\t\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "14f4ab82647b993383dab3b7fb7ea60f", "score": "0.5369716", "text": "function hasSubmenu( elm ) {\n\t\t\t\t\t\t\t\t\t\treturn elm.getElementsByTagName( \"ul\" ).length > 0;\n\t\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "14f4ab82647b993383dab3b7fb7ea60f", "score": "0.5369716", "text": "function hasSubmenu( elm ) {\n\t\t\t\t\t\t\t\t\t\treturn elm.getElementsByTagName( \"ul\" ).length > 0;\n\t\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "a1fd1a7c9614fc07bd28a767dbe90d18", "score": "0.53684837", "text": "function isNestedDefinition(value) {\n return value != null && typeof value === 'object' && !Array.isArray(value);\n}", "title": "" }, { "docid": "233b991facb41af006c71bbd92e233d4", "score": "0.53673136", "text": "hasChildren() {\n const val = this.val();\n return _.isPlainObject(val) && _.keys(val).length > 0;\n }", "title": "" }, { "docid": "af5a4b1dcdedbda9ed5e65ea6160cc88", "score": "0.5348319", "text": "function isCirucular(ll){\n let current = ll.head;\n\n while(current){\n if(current.next === ll.head){\n return true;\n }\n current = current.next;\n }\n\n return false;\n}", "title": "" }, { "docid": "fb7bea86f3136db689e51490425f0b2b", "score": "0.5344862", "text": "function hasChildren(arg) {\n if (arg.children(\"ul\").length > 0) {\n arg.addClass(\"hasChildren\");\n arg.find(\"a\").eq(0).addClass(\"hasChildren\");\n }\n }", "title": "" }, { "docid": "a74adce1bced9763657d155dd00241e2", "score": "0.53368795", "text": "hasChildren() {\n return this.numberOfChildren > 0;\n }", "title": "" }, { "docid": "a74adce1bced9763657d155dd00241e2", "score": "0.53368795", "text": "hasChildren() {\n return this.numberOfChildren > 0;\n }", "title": "" }, { "docid": "a74adce1bced9763657d155dd00241e2", "score": "0.53368795", "text": "hasChildren() {\n return this.numberOfChildren > 0;\n }", "title": "" }, { "docid": "fe7728788fbee47833b650261948e123", "score": "0.5331093", "text": "function isInList(input)\n{\n if (!input)\n return false;\n else\n return true;\n}", "title": "" }, { "docid": "f9d23cbab025d653e4f81968bac5590b", "score": "0.532169", "text": "function kindNode(node) {\n\t return node.getKind() == 1 /* NODE */;\n\t}", "title": "" }, { "docid": "dd9a45d2134b1656852b03b0caf668fd", "score": "0.53178144", "text": "function addListContainer (context, elements, content) {\n var permitted = [\n DocumentApp.ElementType.BODY_SECTION,\n DocumentApp.ElementType.TABLE_CELL,\n DocumentApp.ElementType.TABLE_OF_CONTENTS,\n DocumentApp.ElementType.HEADER_SECTION,\n DocumentApp.ElementType.FOOTER_SECTION,\n DocumentApp.ElementType.FOOTNOTE_SECTION\n ];\n var PARENT = elements.ROOT;\n if (permitted.indexOf(elements.PARENT.getType()) > -1) {\n PARENT = elements.PARENT;\n }\n\n if (context.list.nesting === null){\n context.list.nesting = 0;\n } else {\n context.list.nesting += 1;\n }\n context.list.glyph = 'BULLET';\n if (glyph_type[content.tag]) {\n context.list.glyph = glyph_type[content.tag];\n }\n return PARENT;\n }", "title": "" }, { "docid": "e909270ceef0ed2b5a09961a1acde903", "score": "0.53171074", "text": "function isOrContains(node, container) {\n while (node) {\n if (node === container)\n return true;\n node = node.parentNode;\n }\n return false;\n}", "title": "" }, { "docid": "da1b3ab80663e17cdd07c2a20bd5c6fd", "score": "0.53149194", "text": "get isContainer() {\r\n return this._childRows.length > 0;\r\n }", "title": "" }, { "docid": "290f9c2ad343f28b493eeb1727a460c9", "score": "0.5306836", "text": "function isCollection(value) {\n //account for any data types which are not collections: null, and date. \n //Filter these values out, by using conditional if statement which \n //only returns true if the value is a collection.\n //account for Date:\n if (value instanceof Date === false\n //account for null:\n && value !== null\n //return true for object or array:\n && typeof value === 'object') {\n return true;\n } else return false;\n}", "title": "" }, { "docid": "5bf2665d71e6a12e02e2c82406b97c4e", "score": "0.5297695", "text": "isArray(path) {\n\t\t\treturn this.children(path).length > 0;\n\t\t}", "title": "" }, { "docid": "b1ee06aeadb6377bee8067ea8d509678", "score": "0.5283125", "text": "hasChildren() {\n if (this.lazy) {\n if (this.children == null) {\n return undefined; // null or undefined: Not yet loaded\n }\n else if (this.children.length === 0) {\n return false; // Loaded, but response was empty\n }\n else if (this.children.length === 1 &&\n this.children[0].isStatusNode()) {\n return undefined; // Currently loading or load error\n }\n return true; // One or more child nodes\n }\n return !!(this.children && this.children.length);\n }", "title": "" }, { "docid": "c97bce0fb19d6bf4bccd1ed8192914db", "score": "0.5273843", "text": "function containsType(type, list) {\r\n var result = false;\r\n if (list != null && list.length > 0) {\r\n $(list).each(function (index) {\r\n if (list[index].label == type) {\r\n result = true;\r\n }\r\n });\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "63a5a057e30d87b458a7421baf3cae98", "score": "0.5262768", "text": "function isSchema(node) {\n return (\n node instanceof MappingNode ||\n node instanceof ListNode ||\n node instanceof ScalarNode ||\n node instanceof DynamicNode\n );\n}", "title": "" }, { "docid": "68171003aa095d9fa872affb7cfa5e44", "score": "0.5260322", "text": "function isArray(xs) {\n return toString.call(xs) === '[object Array]';\n}", "title": "" }, { "docid": "68171003aa095d9fa872affb7cfa5e44", "score": "0.5260322", "text": "function isArray(xs) {\n return toString.call(xs) === '[object Array]';\n}", "title": "" } ]
87b7469281a861c2aafdbb9b6fdda189
write a statement that adds two indexes
[ { "docid": "b49937aa14ae4ff86deecdf1bada41fb", "score": "0.0", "text": "fibonacci(n){\n for (let i = 0; i <= 0; i++) {\n\n }\n// then each following index is equal to the sum of the previous two indexes\n\n// then select the input numeral\n\n// then loop/cycle through the array of indexes till you reach the input numeral position\n\n// then output the given number\n \n return -1;\n }", "title": "" } ]
[ { "docid": "add13d808db4eb938711764c1b713692", "score": "0.66558886", "text": "_addToIndex(index0, key0, key1, key2) {\n // Create layers as necessary\n const index1 = index0[key0] || (index0[key0] = {});\n const index2 = index1[key1] || (index1[key1] = {});\n // Setting the key to _any_ value signals the presence of the quad\n const existed = key2 in index2;\n if (!existed)\n index2[key2] = null;\n return !existed;\n }", "title": "" }, { "docid": "8ae8f95d201d44ba502d726ab4bbf7f6", "score": "0.66131747", "text": "_addToIndex(index0, key0, key1, key2) {\n // Create layers as necessary\n var index1 = index0[key0] || (index0[key0] = {});\n var index2 = index1[key1] || (index1[key1] = {});\n // Setting the key to _any_ value signals the presence of the quad\n var existed = key2 in index2;\n if (!existed)\n index2[key2] = null;\n return !existed;\n }", "title": "" }, { "docid": "0ec5d4afb582a2d6d9f43634c2c6e8d4", "score": "0.6610667", "text": "_addToIndex(index0, key0, key1, key2) {\n // Create layers as necessary\n const index1 = index0[key0] || (index0[key0] = {});\n const index2 = index1[key1] || (index1[key1] = {}); // Setting the key to _any_ value signals the presence of the quad\n\n const existed = (key2 in index2);\n if (!existed) index2[key2] = null;\n return !existed;\n }", "title": "" }, { "docid": "09b573c15d269ba99523b4be5be51062", "score": "0.6590449", "text": "_addToIndex(index0, key0, key1, key2) {\n // Create layers as necessary\n var index1 = index0[key0] || (index0[key0] = {});\n var index2 = index1[key1] || (index1[key1] = {});\n // Setting the key to _any_ value signals the presence of the quad\n var existed = key2 in index2;\n if (!existed)\n index2[key2] = null;\n return !existed;\n }", "title": "" }, { "docid": "4da1280473365cf7a8f89df78c0a4bc7", "score": "0.6562326", "text": "_addToIndex(index0, key0, key1, key2) {\n // Create layers as necessary\n var index1 = index0[key0] || (index0[key0] = {});\n var index2 = index1[key1] || (index1[key1] = {}); // Setting the key to _any_ value signals the presence of the quad\n\n var existed = key2 in index2;\n if (!existed) index2[key2] = null;\n return !existed;\n }", "title": "" }, { "docid": "78e9b17f0c6fe892d63f476f5074cee7", "score": "0.65464735", "text": "_addToIndex (index0, key0, key1, key2) {\n // Create layers as necessary\n const index1 = index0[key0] || (index0[key0] = {})\n const index2 = index1[key1] || (index1[key1] = {})\n // Setting the key to _any_ value signals the presence of the quad\n const existed = key2 in index2\n\n if (!existed) {\n index2[key2] = null\n }\n\n return !existed\n }", "title": "" }, { "docid": "43dfb64905c78ca86d157a06fba40209", "score": "0.64992243", "text": "_addToIndex (index0, key0, key1, key2) {\n // Create layers as necessary\n const index1 = index0[key0] || (index0[key0] = {});\n const index2 = index1[key1] || (index1[key1] = {});\n // Setting the key to _any_ value signals the presence of the quad\n const existed = key2 in index2;\n\n if (!existed) {\n index2[key2] = null;\n }\n\n return !existed\n }", "title": "" }, { "docid": "fbfc0adca2c0bc4bd059a2758217eb0c", "score": "0.62634677", "text": "function concatIndex(index1, index2) {\n // Special case if index1 is empty.\n if (indexLen(index1) === 0) {\n return index2\n }\n\n // Otherwise, make sure the types match.\n const type1 = index1.get('type')\n const type2 = index2.get('type')\n if (type1 !== type2) {\n throw new Error(`Cannot concatenate ${type1} with ${type2}.`)\n }\n\n // ...and dispatch based on type.\n return updateOneOf(index1, 'type', {\n plainIndex: (idx) => idx.update('data', (data) => (\n concatAnyArray(data, index2.getIn(['plainIndex', 'data'])))),\n rangeIndex: (idx) => idx.update('stop', (stop) => (\n stop + indexLen(index2))),\n // multiIndex: <not supported>,\n int_64Index: (idx) => idx.updateIn(['data', 'data'], (data) => (\n data.concat(index2.getIn(['int_64Index', 'data', 'data'])))),\n float_64Index: (idx) => idx.updateIn(['data', 'data'], (data) => (\n data.concat(index2.getIn(['float_64Index', 'data', 'data'])))),\n datetimeIndex: (idx) => idx.updateIn(['data', 'data'], (data) => (\n data.concat(index2.getIn(['datetimeIndex', 'data', 'data'])))),\n timedeltaIndex: (idx) => idx.updateIn(['data', 'data'], (data) => (\n data.concat(index2.getIn(['timedeltaIndex', 'data', 'data'])))),\n })\n}", "title": "" }, { "docid": "08685a8023b15b3a8c4db60482c18ede", "score": "0.5847052", "text": "function addVectors(a, b) {\n a[0] += b[0];\n a[1] += b[1];\n return a;\n }", "title": "" }, { "docid": "6933d3b67b3672e8934033cea8ecc558", "score": "0.56505567", "text": "function makeIndex(a, b) {\n let index = Object.create(null);\n\n (a || []).concat(b || []).forEach(function (a) {\n index[a] = true;\n });\n\n return index;\n}", "title": "" }, { "docid": "2a955f9d48127eb6344891abc4a391ad", "score": "0.56437004", "text": "function add_v2(v1, v2) { return [v1[0] + v2[0], v1[1] + v2[1]]; }", "title": "" }, { "docid": "1046182e90322db58c035037c2f15288", "score": "0.55808616", "text": "function add_(x,y) {\n var i,c,k,kk;\n k=x.length<y.length ? x.length : y.length;\n for (c=0,i=0;i<k;i++) {\n c+=x[i]+y[i];\n x[i]=c & mask;\n c>>=bpe;\n }\n for (i=k;c && i<x.length;i++) {\n c+=x[i];\n x[i]=c & mask;\n c>>=bpe;\n }\n }", "title": "" }, { "docid": "5d661eb80e177243f38d9e6f552addc0", "score": "0.55518955", "text": "function mojeFunkce(pole, indexA, indexB) {\n let prvniPrvek = pole[indexA];\n let druhyPrvek = pole[indexB];\n\n return prvniPrvek + druhyPrvek;\n}", "title": "" }, { "docid": "f9560d885188988dc0d8fda45bb477f2", "score": "0.5550528", "text": "function increase (context, type, id, index) {\n const wrap = (index != null\n // If `index` present, turn `x` into `x[index]`.\n ? (x) => t.memberExpression(x, t.numericLiteral(index), true)\n : (x) => x\n )\n return t.unaryExpression('++',\n wrap(\n t.memberExpression(\n t.memberExpression(t.callExpression(getData(context).id, [ ]), t.identifier(type)),\n t.stringLiteral(id),\n true\n )\n )\n )\n }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "713d17a29bd1a024d91c0e361f89285c", "score": "0.55366814", "text": "function add(x, y) {\n\t return (x + y ) | 0\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "150ac7f8eb3c34447b9316fca73fa52b", "score": "0.55221", "text": "__addIndexes(table_name, ifield, data, id) {\r\n data = data.toLowerCase()\r\n let index = this._indexes(table_name, ifield)\r\n if (indexTree.prototype.isPrototypeOf(index)) {\r\n let exist = this._indexes(table_name, ifield).find(data)\r\n if (exist) {\r\n if (index.type == \"UNIQUE\") {\r\n this._error(\"Duplicate entry ‘\" + data + \"’ for key ‘UNIQUE’\")\r\n }\r\n let other = (exist.other).push(id)\r\n // 由于是引用,无需再次操作indexTree\r\n // this._indexes(table_name, ifield).insert(data, other)\r\n } else {\r\n this._indexes(table_name, ifield).insert(data, [id])\r\n }\r\n } else {\r\n console.error(\"indexes is invalid\" + table_name + \".\" + ifield)\r\n }\r\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.55023843", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.55023843", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.55023843", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.55023843", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.55023843", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.55023843", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.55023843", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.55023843", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "115187149e900830b664c6624f749775", "score": "0.55023843", "text": "function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "da631edb7ad2abbc8646bc2d8c52d1ab", "score": "0.55015486", "text": "add(values) { return values[0] + values[1]; }", "title": "" }, { "docid": "972f6ade78aafd3918c2d020ad4233eb", "score": "0.5498292", "text": "function add_(x,y) {\n var i,c,k,kk;\n k=x.length<y.length ? x.length : y.length;\n for (c=0,i=0;i<k;i++) {\n c+=x[i]+y[i];\n x[i]=c & mask;\n c>>=bpe;\n }\n for (i=k;c && i<x.length;i++) {\n c+=x[i];\n x[i]=c & mask;\n c>>=bpe;\n }\n}", "title": "" }, { "docid": "bfbc36a7e2655a4f4a0959a56cff8fd2", "score": "0.5474404", "text": "function add(x, y) {\n\t return x + y | 0;\n\t //lets see how this goes on testling.\n\t // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t // return (msw << 16) | (lsw & 0xFFFF);\n\t }", "title": "" }, { "docid": "dd92b733b29175e2cf774025c26052a0", "score": "0.5464603", "text": "enterAlterByAddIndex(ctx) {\n\t}", "title": "" }, { "docid": "ee18d1ed248cfe2ce9bb1beb190f802b", "score": "0.54589814", "text": "function add_(x,y) {\n var i,c,k,kk;\n k=x.length<y.length ? x.length : y.length;\n for (c=0,i=0;i<k;i++) {\n c+=x[i]+y[i];\n x[i]=c & mask;\n c = (c - x[i]) / radix;\n }\n for (i=k;c && i<x.length;i++) {\n c+=x[i];\n x[i]=c & mask;\n c = (c - x[i]) / radix;\n }\n }", "title": "" }, { "docid": "f663a56e8ef81288115be71a8bafa8b0", "score": "0.54549515", "text": "function addIndexes(arr) {\n\t\n\t\n\tconst maps1 = arr.map(x => x + arr.indexOf(x));\n\t\n\treturn maps1;\n}", "title": "" }, { "docid": "2894388eef41ec04b9f65e84c24d4c4e", "score": "0.5446806", "text": "function add(x, y) {\n return (x + y ) | 0\n//lets see how this goes on testling.\n// var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n// var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n// return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "55cea39ebe1a2da1e7a6d2be95c7e2bb", "score": "0.54467916", "text": "function addToIndex(_toIndex, options) {\n var idx = undefined;\n\n try {\n idx = createLunrIndex(options);\n _toIndex.forEach(function (doc) {\n idx.add(doc);\n });\n } catch (e) {\n throw new Error('Redux-Lunr: Error while indexing. Did you pass an array of valid objects?');\n }\n return idx;\n}", "title": "" }, { "docid": "6185206d8e6dda8fb5363404fa97105a", "score": "0.5443357", "text": "function vAdd(a, b) {\n return vec(a.x + b.x, a.y + b.y);\n}", "title": "" }, { "docid": "65fa692b4404712421e989996d9a1c12", "score": "0.5440058", "text": "function add_(x, y) {\n var i, c, k, kk;\n k = x.length < y.length ? x.length : y.length;\n for (c = 0, i = 0; i < k; i++) {\n c += x[i] + y[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n for (i = k; c && i < x.length; i++) {\n c += x[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n }", "title": "" }, { "docid": "65fa692b4404712421e989996d9a1c12", "score": "0.5440058", "text": "function add_(x, y) {\n var i, c, k, kk;\n k = x.length < y.length ? x.length : y.length;\n for (c = 0, i = 0; i < k; i++) {\n c += x[i] + y[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n for (i = k; c && i < x.length; i++) {\n c += x[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n }", "title": "" }, { "docid": "cc31fb48f27c435ed34c53b0b3abb6fe", "score": "0.54240155", "text": "function incrementIndex() {\n index += 1;\n}", "title": "" }, { "docid": "36669eb980c1a395c1fda3ee767493b5", "score": "0.5417344", "text": "function add(...args) {\n return args.reduce((res, num, idx) => res + num * (idx + 1), 0);\n}", "title": "" }, { "docid": "fd08db5325728a090900292865e38a67", "score": "0.5390401", "text": "function add(x,y){return x+y|0;//lets see how this goes on testling.\n// var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n// var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n// return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "9d288191951297f2e9c56eeaf9f5967a", "score": "0.5370461", "text": "_countInIndex(index0, key0, key1, key2) {\n let count = 0, tmp, index1, index2;\n\n // If a key is specified, count only that part of index 0\n if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0];\n for (const value0 in index0) {\n if (index1 = index0[value0]) {\n // If a key is specified, count only that part of index 1\n if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1];\n for (const value1 in index1) {\n if (index2 = index1[value1]) {\n // If a key is specified, count the quad if it exists\n if (key2) (key2 in index2) && count++;\n // Otherwise, count all quads\n else count += Object.keys(index2).length;\n }\n }\n }\n }\n return count;\n }", "title": "" }, { "docid": "817e5694a6d7391e8042871b621011d1", "score": "0.5351017", "text": "function addToIndex(field, pkey, value) {\n //Get the new position\n var kidx = bindex(field, value);\n\n //Ensure the primary key is not duplicated\n if (field === primary && indexes[field][kidx] && indexes[field][kidx].value === value) {\n if (indexes[field][kidx].keys.indexOf(pkey) > -1) {\n throw new Error('cannot add duplicate primary key (\"' + pkey + '\")!');\n }\n }\n\n if (!indexes[field][kidx] || indexes[field][kidx].value !== value) {\n //If this is the first at the position, create the key value object\n indexes[field].splice(kidx, 0, {\n value: value,\n keys: []\n });\n }\n\n //Add the primary key\n indexes[field][kidx].keys.push(pkey);\n }", "title": "" }, { "docid": "b6ac0833456ddc5761caf2b9be6c6341", "score": "0.5339787", "text": "function add(v1, v2) {\n let result = [];\n for (let i = 0; i < v1.length; i++) {\n result[i] = v1[i] + v2[i];\n }\n return result;\n}", "title": "" }, { "docid": "5532c5e02fbd3562910237684e0a9e4b", "score": "0.5337524", "text": "function addPos(p0,p1) {\n newPos = p0.slice()\n newPos[0] += p1[0]\n newPos[1] += p1[1]\n newPos[2] += p1[2]\n return newPos\n}", "title": "" }, { "docid": "a4ad9d9e25b3388a4fdc0273b423268e", "score": "0.5332921", "text": "_countInIndex(index0, key0, key1, key2) {\n var count = 0, tmp, index1, index2;\n\n // If a key is specified, count only that part of index 0\n if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0];\n for (var value0 in index0) {\n if (index1 = index0[value0]) {\n // If a key is specified, count only that part of index 1\n if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1];\n for (var value1 in index1) {\n if (index2 = index1[value1]) {\n // If a key is specified, count the quad if it exists\n if (key2) (key2 in index2) && count++;\n // Otherwise, count all quads\n else count += Object.keys(index2).length;\n }\n }\n }\n }\n return count;\n }", "title": "" }, { "docid": "6019b8b260fc096e88fe263a166036aa", "score": "0.53052264", "text": "_countInIndex (index0, key0, key1, key2) {\n let count = 0;\n let tmp, index1, index2;\n\n // If a key is specified, count only that part of index 0\n if (key0) {\n (tmp = index0, index0 = {})[key0] = tmp[key0];\n }\n\n for (const value0 in index0) {\n index1 = index0[value0];\n\n if (index1) {\n // If a key is specified, count only that part of index 1\n if (key1) {\n (tmp = index1, index1 = {})[key1] = tmp[key1];\n }\n\n for (const value1 in index1) {\n index2 = index1[value1];\n\n if (index2) {\n if (key2) {\n // If a key is specified, count the quad if it exists\n (key2 in index2) && count++;\n } else {\n // Otherwise, count all quads\n count += Object.keys(index2).length;\n }\n }\n }\n }\n }\n\n return count\n }", "title": "" }, { "docid": "a71cddb715882cd4d2543a1a54f8af19", "score": "0.528795", "text": "function inject( a1, index, a2 ) {\n\n\t\treturn a1.slice( 0, index ).concat( a2 ).concat( a1.slice( index ) );\n\n\t}", "title": "" }, { "docid": "06bd69cbd7c8127f6c32151758acce4f", "score": "0.52815884", "text": "function add (a, b) {\n return [\n a[0] + b[0],\n a[1] + b[1]\n ]\n}", "title": "" }, { "docid": "9c1d716f0427d1bd0e1d80b0fba2e686", "score": "0.52753353", "text": "enterSpecialIndexDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "278ad7e9d43bc0e9e4ffd977bcbc588a", "score": "0.52752286", "text": "function V2Add(a, b, c) {\n c.x = a.x + b.x;\n c.y = a.y + b.y;\n return c;\n}", "title": "" }, { "docid": "bb49db84e90f8b7d98db28a9436c0ab6", "score": "0.52680224", "text": "static add( a, b ) {\n var x = a.m[0] + b.m[0];\n var y = a.m[1] + b.m[1];\n var result = new vec2( x, y );\n return result;\n }", "title": "" }, { "docid": "ab0638ca202311d9affb7747ade4fa8c", "score": "0.5266533", "text": "_countInIndex(index0, key0, key1, key2) {\n let count = 0,\n tmp,\n index1,\n index2; // If a key is specified, count only that part of index 0\n\n if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0];\n\n for (const value0 in index0) {\n if (index1 = index0[value0]) {\n // If a key is specified, count only that part of index 1\n if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1];\n\n for (const value1 in index1) {\n if (index2 = index1[value1]) {\n // If a key is specified, count the quad if it exists\n if (key2) key2 in index2 && count++; // Otherwise, count all quads\n else count += Object.keys(index2).length;\n }\n }\n }\n }\n\n return count;\n }", "title": "" }, { "docid": "985b29023f7e9d1d734ba4c2a8f5fb84", "score": "0.52584535", "text": "function sumWithSpreadOp(x,y){\n\treturn x + y;\n}", "title": "" }, { "docid": "4e14a922884d235a7aca971c7f56cef8", "score": "0.5252603", "text": "function twoSums(nums, target){\n let indexes = null\n\n for(i=0; i < nums.length; i++){\n for(t=i+1; t < nums.length; t++){\n if(!indexes && nums[i] + nums[t] == target){\n indexes = [i, t]\n }\n }\n }\n\n return indexes\n}", "title": "" }, { "docid": "8d13b07063bddcd1c09beab78b91f1cc", "score": "0.52467436", "text": "function twoSum(numbers, target) {\n let index = [];\n\n for (let i = 0; i < numbers.length - 1; i++) {\n for (let j = i + 1; j < numbers.length; j++) {\n if (numbers[i] + numbers[j] === target) {\n index.push(i, j);\n }\n }\n }\n return index;\n}", "title": "" }, { "docid": "85439da587c621d675ef409075b980df", "score": "0.5239882", "text": "_countInIndex(index0, key0, key1, key2) {\n var count = 0, tmp, index1, index2;\n\n // If a key is specified, count only that part of index 0\n if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0];\n for (var value0 in index0) {\n if (index1 = index0[value0]) {\n // If a key is specified, count only that part of index 1\n if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1];\n for (var value1 in index1) {\n if (index2 = index1[value1]) {\n // If a key is specified, count the quad if it exists\n if (key2) (key2 in index2) && count++;\n // Otherwise, count all quads\n else count += Object.keys(index2).length;\n }\n }\n }\n }\n return count;\n }", "title": "" }, { "docid": "18ef9693a0574fbc303492455214e081", "score": "0.5228451", "text": "function v3_add_new(a, b) {\n return [ a[0] + b[0],\n a[1] + b[1],\n a[2] + b[2] ];\n}", "title": "" }, { "docid": "6a9061977287ca02dee00bef2ba67b37", "score": "0.52194214", "text": "function vectorPlus ( vecteurA, vecteurB ){\r\n\treturn [ vecteurA[0]+vecteurB[0], vecteurA[1]+vecteurB[1]];\r\n}", "title": "" }, { "docid": "efcacbd55782b75fe9b687598034866f", "score": "0.5214695", "text": "function addvec(a, b) {\n return {\"x\":a.x+b.x, \"y\":a.y+b.y};\n}", "title": "" }, { "docid": "6dd1a332f2db5428ebf59d674f23d96c", "score": "0.52144724", "text": "function add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "6dd1a332f2db5428ebf59d674f23d96c", "score": "0.52144724", "text": "function add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "6dd1a332f2db5428ebf59d674f23d96c", "score": "0.52144724", "text": "function add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "6dd1a332f2db5428ebf59d674f23d96c", "score": "0.52144724", "text": "function add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "8ae68efb5d7c42d82879d6111a9008a9", "score": "0.52114356", "text": "combine(x, y) {\n return x + y;\n }", "title": "" }, { "docid": "fb6e5bc418828fa2aefb7a2036596214", "score": "0.5208862", "text": "enterAlterByAddSpecialIndex(ctx) {\n\t}", "title": "" }, { "docid": "a299fed10fc7a2eb0827e7401d1775e2", "score": "0.5206037", "text": "addNodes( a, b ) {\n return [ a[0]+b[0], a[1]+b[1], a[2]+b[2] ];\n }", "title": "" }, { "docid": "7ac0a51941b8e5293fd0f7d194af03e7", "score": "0.52046716", "text": "function inject(a1, index, a2) {\n\n\t\treturn a1.slice(0, index).concat(a2).concat(a1.slice(index));\n\n\t}", "title": "" }, { "docid": "7ac0a51941b8e5293fd0f7d194af03e7", "score": "0.52046716", "text": "function inject(a1, index, a2) {\n\n\t\treturn a1.slice(0, index).concat(a2).concat(a1.slice(index));\n\n\t}", "title": "" }, { "docid": "c1787282d6969e65a7c1c77ec5052338", "score": "0.52035755", "text": "function addto2(...arguments) {\n\treturn arguments.reduce((current, total) => current + total);\n}", "title": "" }, { "docid": "32f860076899961688e533cc0079a2e3", "score": "0.51908934", "text": "function add(a, b) {\n _ch_checkExactArgs(arguments, 2, 'add(a, b)');\n return _ch_vecApply('add', _ch_add, a, b);\n}", "title": "" }, { "docid": "6db727798f4478cda9e798b1ef35ec3f", "score": "0.51881456", "text": "enterIndexDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "dd23c119e8472fde51feae42a51e0fc2", "score": "0.51865196", "text": "function add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "dd23c119e8472fde51feae42a51e0fc2", "score": "0.51865196", "text": "function add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "dcaaaabaf47607cd87f601d11eaa11be", "score": "0.51767397", "text": "_countInIndex(index0, key0, key1, key2) {\n var count = 0,\n tmp,\n index1,\n index2; // If a key is specified, count only that part of index 0\n\n if (key0) (tmp = index0, index0 = {})[key0] = tmp[key0];\n\n for (var value0 in index0) {\n if (index1 = index0[value0]) {\n // If a key is specified, count only that part of index 1\n if (key1) (tmp = index1, index1 = {})[key1] = tmp[key1];\n\n for (var value1 in index1) {\n if (index2 = index1[value1]) {\n // If a key is specified, count the quad if it exists\n if (key2) key2 in index2 && count++; // Otherwise, count all quads\n else count += Object.keys(index2).length;\n }\n }\n }\n }\n\n return count;\n }", "title": "" }, { "docid": "c05b645749a92ab8917f747611f9090d", "score": "0.51691216", "text": "_countInIndex (index0, key0, key1, key2) {\n let count = 0\n let tmp, index1, index2\n\n // If a key is specified, count only that part of index 0\n if (key0) {\n (tmp = index0, index0 = {})[key0] = tmp[key0]\n }\n\n for (const value0 in index0) {\n index1 = index0[value0]\n\n if (index1) {\n // If a key is specified, count only that part of index 1\n if (key1) {\n (tmp = index1, index1 = {})[key1] = tmp[key1]\n }\n\n for (const value1 in index1) {\n index2 = index1[value1]\n\n if (index2) {\n if (key2) {\n // If a key is specified, count the quad if it exists\n (key2 in index2) && count++\n } else {\n // Otherwise, count all quads\n count += Object.keys(index2).length\n }\n }\n }\n }\n }\n\n return count\n }", "title": "" }, { "docid": "14bec5fcfbe4dc8d80d01771a1be22d4", "score": "0.51672244", "text": "function arrayPlusArray(arr1, arr2) {\r\n let result = 0\r\n for (let i = 0; i < arr1.length; i++) {\r\n result += arr1[i] + arr2[i]\r\n //result += arr2[i]\r\n }\r\n\r\n\r\n return result\r\n}", "title": "" }, { "docid": "0a11eed1a081ff618ca1902e8a15acc6", "score": "0.51566076", "text": "enterSimpleIndexDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "3a496cfc1ca8aa91a69ab3d1bdcd2aae", "score": "0.5147485", "text": "function add(left, right) {\n const sum = [left, right];\n reduce(sum);\n return sum;\n}", "title": "" }, { "docid": "7db00eae87648ae915b1445914a52f5d", "score": "0.514321", "text": "function add() {\n return [].slice.call(arguments).reduce(function (result, value, index) {\n return result + value * (index + 1);\n }, 0);\n}", "title": "" }, { "docid": "3f83ff89cf89b63464b716cdc026cddb", "score": "0.5141799", "text": "function add(left, right){\n\t\treturn left + right\n\t}", "title": "" }, { "docid": "397f05694ca1e89dee356453a8af721a", "score": "0.51374304", "text": "function updateResultIndex(start, end) {\n document.getElementById('result-index').innerHTML = start + \" - \" + end;\n }", "title": "" } ]
f2c4cb9a0aec892f50e3e111a4e9d089
============== UPDATE PAGE =============
[ { "docid": "f1ae67f19e052d6cc4177c483901baeb", "score": "0.0", "text": "function updatePage(data) {\n var existing, newStuff, i;\n var replacements = '.cwbdv, .bte, #ckey_spirit, #ckey_defend, #togpane_magico, #togpane_magict, #togpane_item, #quickbar, #togpane_log';\n var monsterReplacements = '#mkey_0, #mkey_1, #mkey_2, #mkey_3, #mkey_4, #mkey_5, #mkey_6, #mkey_7, #mkey_8, #mkey_9';\n\n // Replace `replacements` elements on live document with the newly obtained data\n existing = document.querySelectorAll(replacements);\n newStuff = data.querySelectorAll(replacements);\n i = existing.length;\n while (i--) {\n existing[i].parentNode.replaceChild(newStuff[i], existing[i]);\n }\n\n // Replace `monsterReplacements` elements on live document with the newly obtained data\n // Don't update dead monsters\n existing = document.querySelectorAll(monsterReplacements);\n newStuff = data.querySelectorAll(monsterReplacements);\n i = existing.length;\n while (i--) {\n if (existing[i].hasAttribute(\"onclick\") || newStuff[i].hasAttribute(\"onclick\")) {\n existing[i].parentNode.replaceChild(newStuff[i], existing[i]);\n }\n }\n\n var popup = data.getElementsByClassName('btcp');\n var navbar = data.getElementById('navbar');\n\n var popupLength = popup.length; // this is because popup.length is changed after insertBefore() is called for some reason.\n var navbarExists = !!navbar;\n\n // If there's navbar/popup in new content, show it\n if (navbarExists) {\n var mainpane = document.getElementById('mainpane');\n mainpane.parentNode.insertBefore(navbar, mainpane);\n window.at_attach(\"parent_Character\", \"child_Character\", \"hover\", \"y\", \"pointer\");\n window.at_attach(\"parent_Bazaar\", \"child_Bazaar\", \"hover\", \"y\", \"pointer\");\n window.at_attach(\"parent_Battle\", \"child_Battle\", \"hover\", \"y\", \"pointer\");\n window.at_attach(\"parent_Forge\", \"child_Forge\", \"hover\", \"y\", \"pointer\");\n }\n if (popupLength !== 0) {\n // Here we're loading popup to the page regardless of the skipNextRound / popupTime settings\n // even though it is \"skipped\" and not even visible; slightly increasing load time.\n // This is because OnPageReload() will later call scripts,\n // some of which will require popup in the document ( Counter Plus )\n var parent = document.getElementsByClassName('btt')[0];\n parent.insertBefore(popup[0], parent.firstChild);\n }\n\n // Run all script modules again\n OnPageReload();\n\n // Reload page if `skipToNextRound` and it is Round End\n // Round End detection: popup exists and navbar does not\n if ( popupLength !== 0 && !navbarExists ) {\n /*\n if ( settings.mouseMelee ) {\n localStorage.setItem('curX', curX);\n localStorage.setItem('curY', curY);\n }\n */\n // Skip to next round\n if ( settings.skipToNextRound ) {\n if (settings.popupTime === 0) {\n window.location.href = window.location.href;\n } else {\n setTimeout(function() {\n window.location.href = window.location.href;\n }, settings.popupTime);\n }\n }\n }\n\n // Remove counter datas on Game End\n // Game End detection: popup and navbar exists\n if ( popupLength !== 0 && navbarExists ) {\n localStorage.removeItem('record');\n localStorage.removeItem('rounds');\n }\n\n }", "title": "" } ]
[ { "docid": "60a248236c99d743ac3eccf7e545d42b", "score": "0.74447775", "text": "function updatePage() {\n \tcountLinks();\n \tgetDropDowns();\n \tquery();\n }", "title": "" }, { "docid": "2083d1aef44cae4302d564478162ec53", "score": "0.74053645", "text": "function updateEditPage () {\n\n var nameMap = table.makePermissionMap(true);\n\n // todo: refactor these doubled 4 lines of code.\n // todo: refactor this doubled line of comments.\n var viewSummaryDiv = $(\"#permissions-view-summary\");\n var viewNames = [].concat(nameMap.group.view).concat(nameMap.user.view);\n if (viewNames.length) viewSummaryDiv.find(\".summary-content\").text(viewNames.join(\", \"));\n AJS.setVisible(viewSummaryDiv, viewNames.length);\n\n var editSummaryDiv = $(\"#permissions-edit-summary\");\n var editNames = [].concat(nameMap.group.edit).concat(nameMap.user.edit);\n if (editNames.length) editSummaryDiv.find(\".summary-content\").text(editNames.join(\", \"));\n AJS.setVisible(editSummaryDiv, editNames.length);\n\n /**\n * Updates the hidden fields that submit the edited permissions in the form. The fields are updated with the\n * data in the Permissions table.\n */\n permissionManager.permissionsEdited = false;\n var permissionStrs = permissionManager.makePermissionStrings();\n for (var key in permissionStrs) {\n var updatedPermStr = permissionStrs[key];\n $(\"#\" + key).val(updatedPermStr);\n\n if (permissionManager.originalPermissions[key] != updatedPermStr) {\n permissionManager.permissionsEdited = true;\n }\n }\n }", "title": "" }, { "docid": "2083d1aef44cae4302d564478162ec53", "score": "0.74053645", "text": "function updateEditPage () {\n\n var nameMap = table.makePermissionMap(true);\n\n // todo: refactor these doubled 4 lines of code.\n // todo: refactor this doubled line of comments.\n var viewSummaryDiv = $(\"#permissions-view-summary\");\n var viewNames = [].concat(nameMap.group.view).concat(nameMap.user.view);\n if (viewNames.length) viewSummaryDiv.find(\".summary-content\").text(viewNames.join(\", \"));\n AJS.setVisible(viewSummaryDiv, viewNames.length);\n\n var editSummaryDiv = $(\"#permissions-edit-summary\");\n var editNames = [].concat(nameMap.group.edit).concat(nameMap.user.edit);\n if (editNames.length) editSummaryDiv.find(\".summary-content\").text(editNames.join(\", \"));\n AJS.setVisible(editSummaryDiv, editNames.length);\n\n /**\n * Updates the hidden fields that submit the edited permissions in the form. The fields are updated with the\n * data in the Permissions table.\n */\n permissionManager.permissionsEdited = false;\n var permissionStrs = permissionManager.makePermissionStrings();\n for (var key in permissionStrs) {\n var updatedPermStr = permissionStrs[key];\n $(\"#\" + key).val(updatedPermStr);\n\n if (permissionManager.originalPermissions[key] != updatedPermStr) {\n permissionManager.permissionsEdited = true;\n }\n }\n }", "title": "" }, { "docid": "d8fb8f0e3ef4a66bbe4387abeccbcebc", "score": "0.72555894", "text": "function update_page() {\n // gets local json file\n /*global $*/\n /*global ODS_api*/\n \n // update Permit and Transit info\n update_permits();\n \n // update items info\n update_items();\n \n // update Open Data info\n update_od_police();\n \n // update Transit info\n update_transit();\n \n // update website info\n update_site_data();\n \n // display updated date\n var d = new Date();\n var offset = -300;\n var estDate = new Date(d.getTime() + offset*60*1000);\n var uDate = estDate.toUTCString().replace('GMT', '');\n $('#stamp').text('Updated: ' + uDate + ' - Prototype - Revision 1');\n}", "title": "" }, { "docid": "12356ec4a6330d78fe30ed033f84b65c", "score": "0.68907773", "text": "function load_update_user_page() {\n page = 'update_user';\n load_page(load_update_user_data);\n}", "title": "" }, { "docid": "21f02ca7fb90552d0eaf6fd95f2baa02", "score": "0.67893773", "text": "function update() {\n //Location.reload() method reloads the current URL, like the Refresh button.\n document.location.reload()\n}", "title": "" }, { "docid": "28c23c699e7a9ab33a69934ba4756f1b", "score": "0.6749153", "text": "function handle_remote_update() {\n update_edit_form_display()\n //update_entity_tee(current_entity, current_id);\n}", "title": "" }, { "docid": "da208bb0df8e0c0c238e7bfcd52e1b86", "score": "0.66930753", "text": "function update(){\r\n //needs to update server with link/navigation information\r\n //ajax\r\n}", "title": "" }, { "docid": "5cbd53cb8b7195dea63cb6a5a67f72a3", "score": "0.6684341", "text": "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "title": "" }, { "docid": "a030fb0650009c87b1652b78c3350347", "score": "0.66784436", "text": "function pageUpdateAccount(){\n $(\"#update-name\").val(appUser.get('name'));\n $(\"#update-email\").val(appUser.get('email'));\n $(\"#update-username\").val(appUser.get('username'));\n }", "title": "" }, { "docid": "5644e2744c4b821c0dc018b0820de4c1", "score": "0.6656738", "text": "onPageUpdate(pageProps) {\n const updatePagesReference = () => this.getAllPagesPromise().then((allPages) => {\n allPages.update(pageProps)\n })\n\n this.navigateToPageAndDisplayChange(pageProps, updatePagesReference)\n }", "title": "" }, { "docid": "76e616ba52d326c59646f5b2562fef48", "score": "0.6655596", "text": "function update() {\n var restikoId = localStorage.getItem(\"id\");\n getValueFromForm()\n base('RESTIKO').update([{\n \"id\": restikoId,\n \"fields\": {\n \"Date\": date,\n \"Ce que j'ai fait\": fait,\n \"Ce que j'ai appris\": appris,\n \"Ce que j'ai aimé\": aime,\n \"Ce que j'ai utilisé de nouveaux\": nouveau,\n \"Problématiques rencontrées\": problem,\n \"Quels sont les objectifs ?\": objectif,\n \"Qu'est-ce qui m'a manqué ?\": manque,\n \"Qu'est-ce que tu ferais à la place du formateur ?\": formateur,\n \"Personne (Initiales)\": {\n \"id\": \"usrVA8D2T1b8KxCEw\",\n \"email\": \"[email protected]\",\n \"name\": \"FONG Tea\"\n },\n \"Objectif atteint ou pas\": succes,\n \"Field 13\": rating\n }\n }], function (err, records) {\n if (err) {\n console.error(err);\n return;\n }\n });\n setTimeout(function () {\n window.location = \"list.html\";\n }, 500);\n }", "title": "" }, { "docid": "ef282a5eb6ca427e342f0d9bac4b5f62", "score": "0.655896", "text": "function updatePage(req, res) {\n var pageId = req.params[\"pageId\"];\n var page = req.body;\n pageModel.updatePage(pageId, page)\n .then(function(status) {\n res.sendStatus(200);\n });\n}", "title": "" }, { "docid": "ff80f5c0dd640f5ca7bdfd1dbff4db24", "score": "0.6549572", "text": "function updatePage(json) {\n\tloadPage(json);\n\trefreshPersonalizedSchedule(json);\n}", "title": "" }, { "docid": "6b6c2b87de4de87c7eca931e92f85ec1", "score": "0.6542192", "text": "update(req, res) {\n logging.logTheinfo(\"widgets index Router\");\n res.status(200).send(\"update\");\n\n }", "title": "" }, { "docid": "b1bd55477eb6c1bfaf206b06989a3ca3", "score": "0.65356696", "text": "function updatePage(now){\n EventFactory.updateAllEvents(now);\n updateMainEvent(now);\n}", "title": "" }, { "docid": "e543a1901d315a6436c4a9514f0bec72", "score": "0.6530258", "text": "function pageUpdate() {\n var b = readify('beta-loading', false)\n\n if (! b) {\n console.log(cid)\n\n try {\n var url = getURL()\n console.log(url)\n request(url, addPosts)\n \n // don't update and clog the history unless the URL actually differs\n if (opath !== url) {\n window.history.pushState(null, null, url)\n \n opath = url\n }\n\n } catch(e) {\n debu(e)\n }\n }\n}", "title": "" }, { "docid": "9cbea71441cabab93ae4cdfb17d6946d", "score": "0.6479439", "text": "function alterPageUpdateForConsult() {\n clearFields(true);\n setTitleUpdate(\"\");\n setUpdateRegister(false);\n setIsReadonly(true);\n setSearchPersonBtnInactive(false);\n }", "title": "" }, { "docid": "5715e5522f73442716660269ad6bba74", "score": "0.6469732", "text": "function pageUpdated() {\n if (component.controller.loadAll) {\n // Retrieve new id\n component.updateModel();\n if (component.api && component.api.endLoad) {\n var listener = component.scope.$on(\"rows-rendered\", function (event, parameters) {\n if (parameters.grid === grid.id) {\n // Remove listener\n listener();\n component.api.endLoad();\n }\n });\n }\n } else {\n component.reload();\n }\n }", "title": "" }, { "docid": "d619cd9c23738358ac14a658d8b0e7eb", "score": "0.64624465", "text": "function submitEdit() {\n\treadEditorFields(editingPage)\n\tme.postPage(editingPage, function(e, resp) {\n\t\tif (e) {\n\t\t\talert(\"ERROR\")\n\t\t} else {\n\t\t\twindow.location.hash = \"#pages/\"+resp.id\n\t\t\tcleanUpEditor()\n\t\t}\n\t})\n}", "title": "" }, { "docid": "5fde2e82ed2b655f519261d0bcbd3668", "score": "0.6446103", "text": "function updateEvent(id) {\n\n window.location.href = \"/events/\" + id;\n\n /* $.get(\"/events/\" + id, function(data) {\n if (data) {\n // If this post exists, prefill our cms forms with its data\n eventNameInput.val(data.eventName);\n locationInput.val(data.location);\n detailsInput.val(data.details);\n participantsInput.val(data.participants);\n // If we have a post with this id, set a flag for us to know to update the post\n // when we hit submit\n updating = true;\n }\n });\n */\n\n // call it to front end\n /* $.ajax({\n method: \"PUT\",\n url: \"/api/events\",\n data: post\n })\n .then(function() {\n window.location.href = \"/events\";\n }); */\n }", "title": "" }, { "docid": "d8ede4cf679a429ff0effebc83ab8d25", "score": "0.6422082", "text": "function update() {\n\t\tvar updateField = \"\";\n\t\tif ((newName.value != \"\") && (newName.value != name.innerHTML)) {\n\t\t\tupdateField += \"name will be updated from \" + name.innerHTML + \" to \" + newName.value +\"\\n\";\n\t\t}\n\t\tif ((newEmail.value != \"\") && (newEmail.value != email.innerHTML)) {\n\t\t\tupdateField += \"email will be updated from \" + email.innerHTML + \" to \" + newEmail.value +\"\\n\";\n\t\t}\n\t\tif ((newPhone.value != \"\") && (phone.innerHTML != newPhone.value)) {\n\t\t\tupdateField += \"phone will be updated from \" + phone.innerHTML + \" to \" + newPhone.value +\"\\n\";\n\t\t}\n\t\tif ((newZipcode.value != \"\") && (zipcode.innerHTML != newZipcode.value)) {\n\t\t\tupdateField += \"zipcode will be updated from \" + zipcode.innerHTML + \" to \" + newZipcode.value +\"\\n\";\n\t\t}\n\t\tif ((newPassword.value != \"\") && (password.innerHTML != newPassword.value)) {\n\t\t\tupdateField += \"password will be updated from \" + password.innerHTML + \" to \" + newPassword.value +\"\\n\";\n\t\t}\n\t\tif (updateField != \"\") {\n\t\t\talert(updateField);\n\t\t} else {\n\t\t\talert(\"nothing will be updated.\");\n\t\t}\n\t\tupdateProfile();\n\t}", "title": "" }, { "docid": "b4f9766b5c37294c48ff8250c988b1d9", "score": "0.6403584", "text": "function updateWebpage()\n {\n snackBox();\n }", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.6384331", "text": "update(){}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.6384331", "text": "update(){}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.6384331", "text": "update(){}", "title": "" }, { "docid": "cec8f64571115c336855aba85025b539", "score": "0.6382247", "text": "function updateAboutPage(ev){\n ev.preventDefault();\n toggleLoadingGif(true);\n var params= {};\n params.method = \"POST\";\n params.url = \"/section/back/about/updateAboutPage\";\n params.data = \"about_page_text=\"+document.getElementById(\"about-page-text\").value;\n params.setHeader = true;\n console.log(params);\n ajaxRequest(params, mainPannelResponse); \n }", "title": "" }, { "docid": "279736425c5ec0a2b2c3f589a975df1b", "score": "0.6380106", "text": "function updateEditNotePage(urlObj, options) {\n\tvar index = urlObj.hash.replace( /.*index=/, \"\" ),\n\t\tpageSelector = urlObj.hash.replace( /\\?.*$/, \"\" );\n\tvar dataJSON = jQuery.parseJSON(localStorage.getItem(index)),\n\t\t$page = $( pageSelector );\n\tvar textfield = \"<b><label class='label'>Note Title:</label></b>\" +\n\t\t\t\t\t\"<input id='editNoteTitle' type='text' class='textInput' value='\" + \n\t\t\t\t\tdataJSON.title + \"'></input><b><label id='todoLabel' class='label'>\" + \n\t\t\t\t\t\"TODO:</label></b><textarea id='editNoteText' class='textInput'>\" +\n\t\t\t\t\tdataJSON.note + \"</textarea>\";\n\t\n\t$content = $page.children(\":jqmData(role=content)\");\n\t$content.html(textfield);\n\t$page.page();\n\t$(\"input\").textinput();\n\t$(\"textarea\").textinput();\n\t$(\"#editNoteText\").TextAreaResizer();\n\toptions.dataUrl = urlObj.href;\n\t$.mobile.changePage( $page, options );\n\tupdatePageLayout(\"#editNoteContent\", \"#editNoteHeader\", \"#editNoteNavbar\");\n}", "title": "" }, { "docid": "8c1e147ced6666ac852a7e55965966b4", "score": "0.6363297", "text": "function updatePage(){\n\t\tvar totalVotes = goodVotes+badVotes;\n\t\t//a fancy way to do console.log()\n\t\tif(x>0){ $('#judgement').text('Good Haircut'); }\n\t\telse if(x<0){ $('#judgement').text('Bad Haircut'); }\n\t\telse{ $('#judgement').text('Unknown'); }\n\t\t$('#confidence>span').text(confidence);\n\t\t$('#agreementValue').text(agreement);\n\t\t$('#numberOfVotes').text(totalVotes);\n\t\t$('#runningTotal').text(x);\n\t\tif(goodVotes>0) $('#goodVotes').text(\"(\"+goodVotes+\")\");\n\t\tif(badVotes>0) $('#badVotes').text(\"(\"+badVotes+\")\");\n\t}", "title": "" }, { "docid": "c38e3f9430f911ea119dc987a3be9928", "score": "0.636198", "text": "function updatePage() {\n switch (currentState)\n {\n case pageStates.DEFAULT:\n displayDefault();\n break;\n case pageStates.UNITY:\n displayUnity();\n break;\n case pageStates.CUSTOM:\n displayCustom();\n break;\n case pageStates.WEB:\n displayWeb();\n break;\n default:\n displayDefault();\n break;\n }\n}", "title": "" }, { "docid": "3cdd336cc96209de95176a3414613856", "score": "0.6342952", "text": "_update() {\n }", "title": "" }, { "docid": "7e1630f8cc774a82a04e9d73bb6befb4", "score": "0.631445", "text": "function handleEdit() {\n console.log(\"yes\");\n var currentEntry = $(this).parent(\"td\").parent(\"tr\").data(\"tableRow\");\n console.log(currentEntry);\n window.location.href = \"/update/\" + currentEntry\n }", "title": "" }, { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.6311803", "text": "function update() {}", "title": "" }, { "docid": "e7b7d75320f534d6b990dc1a37ef954e", "score": "0.6307913", "text": "function updateMessage(pageId)\n{\n\tcontainerArea = 'status_msg';\n\tpredefinedMessageFlag = true;\n\tvar poststr = \"messageid=\" + encodeURI(document.forms['frmEditMessages'].uid.options[document.forms['frmEditMessages'].uid.selectedIndex].value);\n \tmakePOSTRequest(\"index.php?id=\"+pageId+\"&mode=showmessage&no_cache=1\", poststr, 'displayMessage');\n}", "title": "" }, { "docid": "19fdf884c7a12ae0e9ae0c9fe443bf2d", "score": "0.6305255", "text": "async edit({ params, request, response, view }) {}", "title": "" }, { "docid": "a7fa8aa9631aa1a630b9f46cf8d7e182", "score": "0.6289289", "text": "function updatePage() {\n var firstpage = ($routeParams.page == 1 || $scope.sortOrFilters.page == 1); // Is this the first page?\n var pageparam = firstpage ? null : $scope.sortOrFilters.page; // Clear the page param or set page param\n $location.search('page', pageparam);\n }", "title": "" }, { "docid": "93a1b6bcc92d7d3e4ef8fe7f3ab0b771", "score": "0.6275932", "text": "function updatePage(pageId, page) {\n var url = \"/api/assignment/page/\" + pageId;\n return $http.put(url, page)\n .then(function(response) {\n return response.data;\n });\n }", "title": "" }, { "docid": "a13128d32df6b915969de1184282166f", "score": "0.62672716", "text": "function refreshPage() {\n setShowModal(false);\n getInfoList();\n }", "title": "" }, { "docid": "2fadc1d7770419694ced9ad121480a80", "score": "0.6260785", "text": "function viewUpdatedActivities() {\n\tvar param = \"itemId=\" + $(\"#itemId\").val() + \"&altType=\"+ $(\"#altType\").val()+\"&itemPrice=\"+ALREDY_SELECTED__ITEM_PRICE;\n\tdoAjax(\"jsp/tour/updatedActivities.jsp\", param, displayUpdatedItems,\"updatedActivities\", \"\");\n}", "title": "" }, { "docid": "1040529cb7a597271fba2803a06ce880", "score": "0.62457407", "text": "function update() {\n\t\t\n\t}", "title": "" }, { "docid": "112c6b779087ba74d3d2256c1a8cd990", "score": "0.6238694", "text": "function postEdit(response) {\n\tif (response == \"OK\") {\n\t\talert(\"Successfull update\");\n\t\t$(\"td:eq(0)\", row).html($(\"#descr\").val());\n\t\t$(\"td:eq(2)\", row).html($(\"#videourl\").val());\n\t\t$(\"td:eq(3)\", row).html($(\"#controls\").val());\n\t\t$(\"td:eq(4)\", row).html($(\"#question\").val());\n\t\t$(\"td:eq(5)\", row).html($(\"#info\").val());\n\t}\n\telse\n\t\talert(\"Action failed\");\n}", "title": "" }, { "docid": "10215c47082773ddf51cd315408f48c3", "score": "0.62298054", "text": "function updatePage(){\n\t\t//Find Inactive conversations\n\t\tInactiveConversations.query({active: false}, function (results){\n\t\t\t$scope.inactiveConversations = results;\n\t\t});\n\n\t\tActiveConversations.query({active: true}, function (results){\n\t\t\t$scope.activeConversations = results;\n\t\t});\n\n\t\tvar len = $scope.currentConversation.length;\n\n\t\tfor(var i = 0; i < $scope.activeConversations.length; i++){\n\t\t\tif ($scope.activeConversations[i].phoneNumber == $scope.currentConversationPhoneNumber){\n\t\t\t\t$scope.currentConversation = $scope.activeConversations[i].messages;\n\t\t\t}\n\t\t}\n\n\t\tif ($scope.currentConversation.length > len)\n\t\t\tsetTimeout(function(){scrollConversation()}, 5);\t\n\t}", "title": "" }, { "docid": "6e786116df2d8c659c1eaae82ee8dbda", "score": "0.6221684", "text": "submitEditUser(values) {\n const pageNumber = this.props.activePage;\n this.props.requestUpdateUsers(values, pageNumber);\n this.setState({\n isEditing: false\n })\n }", "title": "" }, { "docid": "ce609f529704ceeb7676e6022a479356", "score": "0.62214595", "text": "update() {\n\t\tlet title = this.refs.newTitle.value\n\t\tlet date = this.refs.newDate.value\n\t\tlet des = this.refs.newDescription.value\n\t\tlet link = this.refs.newLink.value\n\t\tlet id = this.props._id\n\n\t\tif(title == \"\" || date == \"\" || des == \"\" || link == \"\"){\n\t\t\talert(\"Fields can not be empty\")\n\t\t}else{\n\t\t\tlet data = '{\"Title\":\"' + title + '\",\"Description\":\"' + des + '\",\"Year\":\"' + date + '\",\"Link\":\"' + link + '\"}'\n\n\t\t\tthis.props.dispatch(updateProject(this.props._id, data))\n\t\t}\n\t}", "title": "" }, { "docid": "259337e6e85b99b6b4abdff4c57c8e12", "score": "0.621784", "text": "function prepareButtonUpdateOffer(aid) {\n\tofferToUpdate = aid;\n\twindow.location = 'editoffer.jsp?aid=' + aid;\n\n}", "title": "" }, { "docid": "4cdf9851f14f6974c216229b0c86698b", "score": "0.6174179", "text": "function updateDB(POST,response){\n\n\ttitle=POST.title; description=POST.description; location=POST.location; id=POST.id; link=POST.link; status=POST.status;\n\tvar sqlQuery = 'UPDATE issues SET title=\"'+title+'\",description=\"'+description+'\",location=\"'+location+'\",link=\"'+link+'\", status=\"'+status +'\" WHERE id=' + id;\n\tdbAccess.runQuery(sqlQuery, serve(response,id));\n }", "title": "" }, { "docid": "c42b5315804ea20b15f271bf762cbc66", "score": "0.61678946", "text": "function serverPut(id, userInputUpdatedDesc) {\r\n axios.put('/:' + id, {\r\n\r\n // userInputUpdatedDesc is whatever the user inputs to change the description to\r\n description: userInputUpdatedDesc\r\n\r\n })\r\n .then(function (response) {\r\n // success\r\n // should we reload the page here?\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n });\r\n}", "title": "" }, { "docid": "2650adc6ef0a5b9ff5c90361d7525ffe", "score": "0.6149552", "text": "function update(data) {\n console.log('+++ TODO');\n }", "title": "" }, { "docid": "51f14a7a5289bece05d1db565a139b93", "score": "0.61436695", "text": "function editDB(){\n\t\t\t\titem_name_form = document.getElementById(\"item_name\").value;\n\t\t\t\titem_price_form = document.getElementById(\"price\").value;\n\t\t\t\titem_quantity_form = document.getElementById(\"quantity\").value;\n\t\t\t\titem_barcode_form = document.getElementById(\"barcode\").value;\n\n\t\t\t\tsessionStorage.editStatus=\"edit\";\n\t\t\t\tupdateDB(item_name_form,item_quantity_form,item_price_form,item_barcode_form)\n\t\t\t\t\t.then(function(){\n\t\t\t\t\t\tconsole.log(\"updateDB\");\n\t\t\t\t\t})\n\t\t\t\t\t.catch(function(){\n\n\t\t\t\t\t})\n\n\t\t\t}", "title": "" }, { "docid": "ab5b17cce09ef67c888fdab911ed3c5b", "score": "0.6141165", "text": "handleUpdate(e) {\n e.preventDefault();\n // if user chooses to update 1 item (first item that matches parameters)\n if (this.state.UpdateProp && this.state.filter && e.target.value === 'update1') {\n fetch('/putOne', {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n filterUpdate: this.state.filterUpdate,\n filter: this.state.filter,\n propNew: this.state.UpdateProp,\n propData: this.state.newData\n })\n }).then(res => res.json())\n .then(response => alert('project updated!'), (error) => {\n throw error.message;\n })\n\n window.location.reload(); // fetch data once more to show updates\n }\n // if user chooses to updateALL items (all items that match parameters)\n if (this.state.UpdateProp && this.state.filter && e.target.value === 'updateAll') {\n fetch('/putAll', {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n filterUpdate: this.state.filterUpdate,\n filter: this.state.filter,\n propNew: this.state.UpdateProp,\n propData: this.state.newData\n })\n }).then(res => res.json())\n .then(response => alert('project updated!'), (error) => {\n throw error.message;\n })\n\n window.location.reload(); // fetch data once more to show updates\n }\n\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6140913", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6140913", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6140913", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6140913", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6140913", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6140913", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6140913", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "7eda91b3ac60aebbac48a8b5a7fdef99", "score": "0.6130076", "text": "function _updateProfileView(req,res,next){\n\tCommon.ensureUserInSession(req, res, function(caller) {\n\t\tvar adminId = req.param('id');\t\n\t\tADMIN_COLLECTION.find({_id: new ObjectID(adminId)},function(err, admin){\n\t\t\tif(err){\n\t\t\t\tconsole.log('Error in Getting amdin by Id : ' + err);\n\t\t\t\tres.send(err);\n\t\t\t}else{\n\t\t\t\tCommon.render(req, res, 'profile', {\n\t\t \tadmin:admin[0], \n\t\t\t\t \tpath : req.path,\n\t\t\t\t \tsession : req.session,\n\t\t\t\t \tcaller : caller\n\t\t });\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "e3b1e3766e177141f7c6e55570a57b95", "score": "0.6117782", "text": "function updateNotify()\n{\n\n\t\tif( get[ 'msg' ] == 'update' )\n\t\t{\n\n\t\t\t\tnotifySuccess( 'El menú <b>' + get[ 'element' ] + '</b> ha sido modificado correctamente.' );\n\n\t\t}\n\n}", "title": "" }, { "docid": "7205bf6717012bad4e55688cb06499e2", "score": "0.6110633", "text": "function update(){\n\t\tsubHeader();\n\t\tpagePositions();\n\t}", "title": "" }, { "docid": "f4ecdce05b2cf966a65059302c491391", "score": "0.6095254", "text": "update(req, res, next) {\n workoutDB.update(req.body)\n .then((workouts) => {\n res.locals.workouts = workouts;\n next();\n })\n .catch(err => next(err));\n }", "title": "" }, { "docid": "4f407a8791f146bb3824414d58b34cee", "score": "0.60914886", "text": "function updateEditedPost(id){\n var req = new Request.JSON({\n url: 'control.php?action=getSinglePost&id=' + id,\n onSuccess: function(post) { \n var postObject = new PostItem(post.post_id, post.username, post.date_posted, post.comment);\n // Replace the previous post\n postObject.display().replaces($(post.post_id + 'post')); \n }\n }).send(); \n}", "title": "" }, { "docid": "e7e2ca2765d7bd1513e746dd56d69d59", "score": "0.6085061", "text": "function putUpdate(data){\n $.ajax({\n url: location+'/'+$id,\n type: 'PUT',\n data: data,\n success: function(_data) {\n clearForm();\n updateTableUpdate(_data);\n }\n });\n }", "title": "" }, { "docid": "38b381d4b28ce0e4d753d75f5a684cb7", "score": "0.6083437", "text": "update() {\r\n this.sendDetail();\r\n }", "title": "" }, { "docid": "9bb11083b46906787c898a3b481331b3", "score": "0.60749006", "text": "update(req, res, next) {\n res.status(200).json({\n msg: 'Not implemented yet!'\n }).end()\n }", "title": "" }, { "docid": "adc8f6e8ebbbb64cc86b14d0f92ea0cb", "score": "0.60677975", "text": "function updatePageData(){\n // Update current step number\n $(\".kf-current-step\").each(function(index) {\n $(this).text(currentStep);\n });\n }", "title": "" }, { "docid": "91419f02fbb72190f4482a16763c57dd", "score": "0.60643256", "text": "function updateItem() {\n let postIdNumber = document.getElementById(\"updateNumber\").value;\n let authTestDataInput = document.getElementById('updateValue').value; //We get the value of the input provdied from the user for both the updateNumber and updateValue fields and assign each to a variable.\n\n const fetch_url = `http://localhost:3000/authtest/update/${postIdNumber}` //Like before, we pass in the input from the user to the url with a template literal\n const accessToken = localStorage.getItem('SessionToken')\n\n let authInputData = { authtestdata: { item: authTestDataInput } }; //We create an object that packages up our request. We capture the value of authTestDataInput and store it in the variable authInputData variable.\n const response = fetch(fetch_url, {\n method: 'PUT', //We are doing an update method, so this will be a PUT request.\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': accessToken\n },\n body: JSON.stringify(authInputData) //Just like we did in past POST methods, we use the stringify method to convert the objecat to a JSON object.\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n console.log(data) //We print the response to our fetch to the console.\n var myItem = document.getElementById('newItemValue') //We make a reference to the <label> in step 12 (Update Single Item) , then set its value to the data we put in DB.\n myItem.innerHTML = data.authtestdata;\n fetchAllFromAuthRoute(); //We run the getall function again and print the new contents of the database to the console.\n })\n}", "title": "" }, { "docid": "e4131e30cf60710dd38d53e062fd8069", "score": "0.60512966", "text": "function update() {\n\t\n\n\n\n}", "title": "" }, { "docid": "e33f3ede0073b374ae27a27834bd34e1", "score": "0.6049406", "text": "function ep_Edit() {\n // set the refresh flag\n\tnlapiSetFieldValue('custpage_2663_edit_mode', 'T', false);\n nlapiSetFieldValue('custpage_2663_refresh_page', 'T', false);\n \n // suppress the alert\n setWindowChanged(window, false);\n \n // submit the form -- calls submitForm function\n document.forms.main_form.submit();\n}", "title": "" }, { "docid": "2da6606537cf7fa7a29ca1843733f010", "score": "0.60379815", "text": "function refreshPage() {\n\tswitch(state.modus) {\n\t\tcase \"waiting\":\n\t\t\tsetupPanels(\"scoreboard\")\n\t\t\tfillPlayerGrid(\"scoreboard\")\n\t\t\tbreak\n\t\tcase \"ready\":\n\t\t\tsetupPanels(state.currentQuestion.questionMode)\n\t\t\tfillPlayerGrid(state.currentQuestion.questionMode)\n\t\t\tbreak\n\t\tdefault:\n\t\t\tsetupPanels(state.currentQuestion.questionMode)\n\t\t\tfillPlayerGrid(state.currentQuestion.questionMode)\n\t}\n}", "title": "" }, { "docid": "511e88917c9a4998fcfd2f64a232164f", "score": "0.60348266", "text": "update() {\n const {name, address1, address2, city, state: stateVal, zip, phone, creditValuePercentage, maxSpending, payoutAmountPercentage} = this.displayData.details;\n const {companyId, storeId} = state.get(this).params;\n const params = {\n name,\n address1,\n address2,\n city,\n state: stateVal,\n zip,\n phone,\n companyId,\n storeId\n };\n // Alternate usage\n if (this.alternativeGcmgr) {\n params.creditValuePercentage = creditValuePercentage;\n params.maxSpending = maxSpending;\n params.payoutAmountPercentage = payoutAmountPercentage;\n }\n // Update the store\n Service.get(this).update(params)\n .then(() => {\n // Redirect\n state.get(this).go('main.corporate.store.details', {companyId: params.companyId, storeId: params.storeId});\n });\n }", "title": "" }, { "docid": "020d247e974bc778ca7274ec5fb8933b", "score": "0.60308826", "text": "function update_entity_edit() {\n var form_record = Domain.entities[current_entity];\n Forms.init(form_record);\n update_edit_form_display();\n}", "title": "" }, { "docid": "8d27b1cf017db69501eb6db2f0b4971a", "score": "0.6030149", "text": "function update(obj){\n\n\t\tif (obj === \"guests\") {\n\t\t\tloadNbGuests();\n\n\t\t}\n\n\t\tloadMenuOverview()\n\t}", "title": "" }, { "docid": "22244d5da9a96f21162c037e9b014e9f", "score": "0.6014521", "text": "async update({ params, request, response }) {\n }", "title": "" }, { "docid": "4a5e5728be9d124a32978b9529c6f158", "score": "0.6013789", "text": "@action update_current_view(data) {\n this.page_state.update_current_view(data);\n }", "title": "" }, { "docid": "fc8e6bd4e9c0f9155fa98319c6b84091", "score": "0.6007819", "text": "function order_update_get(req, res, next) {\n Order.findById(req.params.id).exec(function(err, order) {\n if (err) {\n return next(err);\n }\n let obj = getObjectToShowForm('Update Order', order);\n res.render('order_form', obj);\n });\n}", "title": "" }, { "docid": "21bbd910de369661d7542531c3567b92", "score": "0.6006225", "text": "function updatePages() {\n $('#borrow-content .curr').html(currPage);\n $('#borrow-content .total').html(allPages);\n}", "title": "" }, { "docid": "34b53c88e5d04105df86b69cd68cfba6", "score": "0.6000606", "text": "function AddUpdatePage(pageID, pageName, caption, title, description, webbuilderID) {\n var newPageID = 0;\n var Mode = pageID > 0 ? \"E\" : \"A\";\n var UpdateLabel = '';\n var checks = $('div.divPermission tr:gt(0), #dvUser tr').find('input.sfCheckbox:checked');\n lstPagePermission = [];\n var beforeID = 0;\n var afterID = 0;\n if ($('#rdbBefore').prop('checked') == true) {\n beforeID = $('#cboPositionTab').val();\n } else if ($('#rdbAfter').prop('checked') == true) {\n afterID = $('#cboPositionTab').val();\n }\n var MenuSelected = 0;\n var _IsVisible = $('#rdbAdmin').prop('checked') ? $('#chkShowInDashboard').prop(\"checked\") : true;\n var lstPagePermission = [];\n lstPagePermission[0] = {\n \"PermissionID\": 1,\n \"RoleID\": 'cd3ca2e2-7120-44ad-a520-394e76aac552',\n \"Username\": \"\",\n \"AllowAccess\": true\n };\n lstPagePermission[1] = {\n \"PermissionID\": 2,\n \"RoleID\": 'cd3ca2e2-7120-44ad-a520-394e76aac552',\n \"Username\": \"\",\n \"AllowAccess\": true\n };\n lstPagePermission[2] = {\n \"PermissionID\": 1,\n \"RoleID\": 'a87e850f-14c8-4c89-86f4-4598ff27da72',\n \"Username\": \"\",\n \"AllowAccess\": true\n };\n var PageDetails = {\n PageEntity: {\n Mode: Mode,\n Caption: caption,\n PageID: pageID,\n PageName: pageName,\n IsVisible: true,\n IconFile: '',\n Title: title,\n Description: description,\n KeyWords: \"\",\n Url: \"\",\n StartDate: '',\n EndDate: '',\n RefreshInterval: 0,\n PageHeadText: \"SageFrame\",\n IsSecure: false,\n PortalID: parseInt(SageFramePortalID),\n IsActive: true,\n AddedBy: SageFrameUserName,\n BeforeID: beforeID,\n AfterID: afterID,\n IsAdmin: false,\n LstPagePermission: lstPagePermission,\n MenuList: MenuSelected,\n UpdateLabel: ''\n }\n };\n var objTagValue = GetSeoValue('easybuilder', title, description);\n SaveMessageShow(pageName + ' page adding');\n $.ajax({\n isPostBack: false,\n async: false,\n cache: false,\n type: 'POST',\n contentType: \"application/json; charset=utf-8\",\n data: JSON2.stringify({\n \"objPageInfo\": PageDetails.PageEntity,\n Culture: 'en-US',\n portalID: parseInt(SageFramePortalID),\n userName: SageFrameUserName,\n userModuleID: webBuilderUserModuleID,\n secureToken: SageFrameSecureToken,\n webbuilderID: webbuilderID,\n objTagValue: objTagValue\n }),\n dataType: 'json',\n crossDomain: true,\n url: SageFrameHostURL + '/Modules/WebBuilder/services/WebService.asmx/AddUpdatePages',\n success: function (data) {\n var response = data.d;\n if (response !== null)\n response = response.split(',');\n newPageID = { 'pageID': response[0], 'webbuilderID': response[1] };\n\n SaveMessageRemove();\n },\n error: function () {\n\n },\n });\n return newPageID;\n }", "title": "" }, { "docid": "a2e1545352c8af21c53fc928d25ad129", "score": "0.5991005", "text": "function updateData() {\n\t/*\n\t* TODO: Fetch data\n\t*/\n}", "title": "" }, { "docid": "ed82d193ab30d3086c9c32aeca6b5514", "score": "0.59896713", "text": "function printUpdate(req, res, next) {\n // Update the answer.\n update(\n req.params.answerId,\n req.params.questionId,\n req.params.quizId,\n req.body.imageId,\n req.body.value,\n req.body.isCorrect\n )\n .then((result) => {\n const updatedRows = result[0];\n if (updatedRows > 0) {\n // Find the answer.\n return find(req.params.answerId, req.params.questionId, req.params.quizId)\n .then((answer) => {\n res.status(200).json(answer);\n });\n }\n // Answer not found.\n throw new NotFoundError();\n })\n // Errors.\n .catch(next);\n}", "title": "" }, { "docid": "3b72e194b868efe9001f733526dc9359", "score": "0.5977299", "text": "function updatePageInfo(){\n\t\t\t$(\".pageInfo\").html(articleTitles[article]+\" (\"+pageNumber+\" / \"+parseInt(($(\"body\").find(\"#article_\"+article+\":hidden\").length)+1)+\")\");\n\t\t\tif(parseInt(($(\"body\").find(\"#article_\"+article+\":hidden\").length)+1) > 2){\n\t\t\t\t$(\".status\").stop(true, true).hide().css(\"width\", (pageNumber/parseInt(($(\"body\").find(\"#article_\"+article+\":hidden\").length)+1))*100+\"%\").fadeIn(300);\n\t\t\t}else{\n\t\t\t\t$(\".status\").css(\"width\", \"0%\");\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c6294cebc1566a26dd8e3fb2cd0d511b", "score": "0.5974116", "text": "function fanTuriUpdate(id) {\n let form = document.forms['updateFanTuriForm'];\n let check = {}\n check.id=id;\n check.nomi = form[\"nomiUpdate\"].value;\n fanTuriService.update(JSON.stringify(check), location.reload(), console.log(\"xato\"));\n}", "title": "" }, { "docid": "0448dab9c694d1776e0a64dc104740ce", "score": "0.5973072", "text": "function tiendaUpdate() {\r\n\tlocation.reload(true);\r\n}", "title": "" }, { "docid": "86c26a1bb03745a097c5f44c50b09765", "score": "0.59730095", "text": "function editPage(e) {\n if (!$editDialog) {\n createPageEditDialog();\n }\n editIndex = $('.write-pages li').index(this);\n\n var $window = $(window),\n ww = $window.width(),\n wh = $window.height(),\n pw = ww/(48 + 4),\n ph = wh/(36 + 10),\n p = Math.min(pw, ph);\n setupEditContent();\n $editDialog.css('font-size', p + 'px');\n $editDialog.dialog('open');\n }", "title": "" }, { "docid": "9c862a8644da7b375cb9d6cb070d2f6b", "score": "0.5971321", "text": "function updateCV(id) {\r\n let index = CVIdInput.value;\r\n let CVName = CVNameInput.value;\r\n let CVTitle = CVTitleInput.value;\r\n let CVDate = CVDateInput.value;\r\n\r\n let CV = { \"id\": index, \"name\": CVName, \"title\": CVTitle, \"date\": CVDate };\r\n\r\n addCVBtn.value = \"Add\";\r\n\r\n fetch(\"http://studenter.miun.se/~aslo1900/dt173g_projekt_rest/cv.php?id=\" + id, {\r\n method: \"PUT\",\r\n body: JSON.stringify(CV),\r\n })\r\n .then((response) => response.json())\r\n .then(data => {\r\n getCV(); \r\n CVNameInput.value = \"\"; \r\n CVTitleInput.value = \"\";\r\n CVDateInput.value = \"\";\r\n window.location.reload(); //Reload page after update\r\n })\r\n .catch((error) => {\r\n console.log(\"error: \", error);\r\n });\r\n}", "title": "" }, { "docid": "6c6a5e39544e775bc94ebf49b7ef43f4", "score": "0.59657526", "text": "function update() {\n displayed = false;\n prev_subject = curr_subject;\n curr_subject = select(\"#phrase\").value();\n loadJSON(api+curr_subject+access_token, gotData);\n}", "title": "" }, { "docid": "c0e7872a781f0951db5d6c48ccaabdaf", "score": "0.5965303", "text": "function updateInfo() {\n let newVals = grabFormValues();\n $.ajax({\n dataType: 'json',\n type: 'PUT',\n data: newVals,\n async: false,\n url: 'api/employees/' + curUser._id,\n success: function(response) {\n console.log(response);\n localStorage.setItem('currentUser', JSON.stringify(response));\n curUser = JSON.parse(localStorage.getItem('currentUser'));\n showInfo();\n },\n });\n }", "title": "" }, { "docid": "402960c2270c1352ca8340a293c85381", "score": "0.59621525", "text": "async update({ params, request, response }) {\n }", "title": "" }, { "docid": "84e6edf37204b52587629e712e5fccc1", "score": "0.59561324", "text": "function update()\n{\n\n}", "title": "" }, { "docid": "708e325d517a7b4d0085f3be4af6e7f4", "score": "0.59536725", "text": "function updateLink() {\n const url = urlInput.value;\n const name = nameInput.value;\n editBookmark({url, name, key}, () => {\n renderBookmarks(pagination.currentPage);\n cancelEdit();\n });\n }", "title": "" }, { "docid": "5fc2e5b2a8cb8fad4bb98d9c084bbdab", "score": "0.5951389", "text": "function updateCar(e) {\n e.preventDefault();\n findByQuery(\"admin/update\",getFormInfo());\n}", "title": "" }, { "docid": "df4b60da3175bab524958126d3012c97", "score": "0.59480953", "text": "function PageUpdate(){\n\t// enable opaque mask with loading bar and info tasks bellow\n\t// find all ajax calls within page\n\t//make server requests and update loading bar on each\n}", "title": "" }, { "docid": "485c0859e205661831c0cddd0e873585", "score": "0.59455955", "text": "function updateroster() {\n\n}", "title": "" }, { "docid": "dd540883d2628f12126e1849cea39605", "score": "0.59423757", "text": "function updateItemInDb()\n {\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n var result = this.responseText;\n $(\"#confirmUpdate\").text(result);\n }\n }\n \n xmlhttp.open(\"POST\", \"../stock/adminUpdateStock.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(collectData());\n }", "title": "" }, { "docid": "590423c7e343cc48bcb4fd7e2638734f", "score": "0.59411865", "text": "async update ({ params, request, response }) {\n }", "title": "" }, { "docid": "590423c7e343cc48bcb4fd7e2638734f", "score": "0.59411865", "text": "async update ({ params, request, response }) {\n }", "title": "" }, { "docid": "590423c7e343cc48bcb4fd7e2638734f", "score": "0.59411865", "text": "async update ({ params, request, response }) {\n }", "title": "" }, { "docid": "590423c7e343cc48bcb4fd7e2638734f", "score": "0.59411865", "text": "async update ({ params, request, response }) {\n }", "title": "" }, { "docid": "590423c7e343cc48bcb4fd7e2638734f", "score": "0.59411865", "text": "async update ({ params, request, response }) {\n }", "title": "" }, { "docid": "590423c7e343cc48bcb4fd7e2638734f", "score": "0.59411865", "text": "async update ({ params, request, response }) {\n }", "title": "" }, { "docid": "590423c7e343cc48bcb4fd7e2638734f", "score": "0.59411865", "text": "async update ({ params, request, response }) {\n }", "title": "" } ]
4e7c17cc739df3f8f603dbbcbf2fd0f3
Draw the first (left) image
[ { "docid": "7e2523a08d506f84e458acfdfd4b939e", "score": "0.5538632", "text": "function drawImage (index) {\n image(imgs[index], 0, 0);\n}", "title": "" } ]
[ { "docid": "ce7b93a69f15df25942c7a29ad5a6544", "score": "0.6658447", "text": "function drawLeftFaceEdge() {\n drawRightFaceEdge();\n\t/*translate and flip reverse the canvas\n ref: https://www.w3schools.com/tags/canvas_translate.asp\n Ref: https://stackoverflow.com/questions/8168217/html-canvas-how-to-draw-a-flipped-mirrored-image\n */\n ctx.translate(canvasWidth, 0);\n ctx.scale(-1, 1);\n}", "title": "" }, { "docid": "6e78f714ba12b82e7ca7937fcdc995e2", "score": "0.6642029", "text": "draw() {\n if (!this.img) return;\n ctx.drawImage(this.img, this.x, this.y);\n ctx.drawImage(this.img, this.x + W, 0);\n }", "title": "" }, { "docid": "35594a0858591133b44d14dff41efac5", "score": "0.65058005", "text": "draw(){\n this.x--\n // Aqui se genera el efecto de fondo infinito\n // Y cuando la posicion de X es menor que el ancho negatico (cuando la primer imagen sale del canvas, se resetea X a 0 para volver a inciar )\n \n if(this.x < -this.width) this.x = 0;\n ctx.drawImage(this.image, this.x, this.y, this.width, this.heigth)\n ctx.drawImage(\n this.image,\n this.x + this.width,\n this.y,\n this.width, \n this.heigth\n )\n }", "title": "" }, { "docid": "c769424be8126d988ebacd32d2d511da", "score": "0.627133", "text": "draw() {\n ctx.drawImage(this.rep, this.left, this.top);\n }", "title": "" }, { "docid": "f058181e1e8252986b4eecc5da620669", "score": "0.6148783", "text": "display() {\n push();\n noStroke();\n image(this.image, this.x, this.y, 150, 100);\n pop();\n }", "title": "" }, { "docid": "930782c65a2f5c4427edd306f470aaa7", "score": "0.60912806", "text": "draw() {\n angleMode(DEGREES);\n imageMode(CENTER);\n translate(this.x + this.width / 2, this.y + this.height / 2);\n rotate(this.angle);\n image(this.img, 0, 0, this.width, this.height);\n rotate(-this.angle);\n translate(-(this.x + this.width / 2), -(this.y + this.height / 2));\n imageMode(CORNER);\n angleMode(RADIANS);\n }", "title": "" }, { "docid": "e842fdc1e551916b58a0d40a33327974", "score": "0.606904", "text": "function goLeft() {\n checkActive();\n if (indexImage < 1) {\n indexImage = 0;\n updateImageOnArrow(indexImage);\n } else {\n indexImage = indexImage - 1;\n updateImageOnArrow(indexImage);\n }\n }", "title": "" }, { "docid": "11613e8035dde5f8022abf4c884a6d1c", "score": "0.5953873", "text": "function draw() {\n\t// pinta o fundo de preto\n\tbackground(0, 0, 0);\n\timage(img_ceu,0,0,900,400);\n\timage(img_floco1,pos_floco1.x,0,50,50);\n\timage(img_floco2,50,0,25,25);\n\timage(img_floco3,100,0,25,25);\n\timage(img_floco4,150,0,25,25);\n\timage(img_floco5,200,0,25,25);\n\timage(img_floco1,250,0,25,25);\n\timage(img_floco2,300,0,50,50);\n\timage(img_floco3,350,0,50,50);\n\timage(img_floco4,400,0,50,50);\n\n\t\n\timage(img_neve,0,300,900,100);\n\timage(img_olaf,600,210,287,150);\n\timage(img_arvore,100,100,300,300);\n\timage(img_estrela,peX,peY,150,150);\n\tpeX = peX + vX;\n\tpeY = peY + vY;\n\n\tfor (var i = 0; i < listaFlocos.length; i++) {\n\t\tdesenha_floco(listaFlocos[i]);\n\t\tatualiza_posicao_floco(listaFlocos[i]);\n\t}\n\n\n}", "title": "" }, { "docid": "ff9f0286feace005a8bd979746d12575", "score": "0.59475", "text": "function draw() {\n\t// pinta o fundo de preto\n\tbackground(img_fundo);\n\timage(imgpinheirinho, 89, 118, 170, 250);\n\timage(imgboneco_de_neve, 699, 150, 178, 180);\n\timage(imgestrela_real, pos_estrela_real.x, pos_estrela_real.y, 180, 90);\n\n\tif (pos_estrela_real.x > -180) pos_estrela_real.add(velec_estrela);\n\n\n\tposMouseAtual = mouseX;\n\n\tif (posMouseAtual>posMouseAnterior) {\n\t\tvento = 1;\n\t} else if (posMouseAtual<posMouseAnterior) {\n\t\tvento = -1;\n\t} else {\n\t\tvento = 0;\n\t}\n\n\tpos_neve1.y++;\n\n\tfor(i=0; i<flocolista.length;i++){\n\t\tpush();\n\t\ttranslate(flocolista[i].x, flocolista[i].y);\n\t\t// rotate(angulo);\n\t\trotate(flocolista[i].angulo);\n\t\tflocolista[i].angulo += flocolista[i].velocidade_angular;\n\t\timage(imgneve1, -25, -25, 50, 50);\n\t\tpop();\n\t\tflocolista[i].y += flocolista[i].velocidade;\n\t\tflocolista[i].x += vento * flocolista[i].velocidade_vento;\n\n\t\tif (flocolista[i].x > width + 50) flocolista[i].x = -50;\n\t\tif (flocolista[i].x < -50) flocolista[i].x = width + 50;\n\t\t\n\t\tif (flocolista[i].y > height) {\n\t\t\tflocolista[i].y = -50;\n\t\t}\n\t}\n\n\t// angulo += 0.02;\n\n\tif (pos_neve1.y > height) {\n\t\tpos_neve1.y = -100;\n\t}\n\n}", "title": "" }, { "docid": "1426c74c3d7ad149c56ec5ea1118071c", "score": "0.59356475", "text": "display() {\n push();\n imageMode(CENTER);\n image(this.image, this.x, this.y, this.size * 2, this.size * 2);\n this.currentFrame = this.image.getCurrentFrame();\n pop();\n }", "title": "" }, { "docid": "9f512ff7455236fa72ea274fbf941af0", "score": "0.5919678", "text": "display(){\n push();\n imageMode(CENTER);\n translate(this.x, this.y);\n rotate(this.angle);\n tint(255, 255, 255, this.transparency)\n image(this.image, 0, 0);\n pop();\n }", "title": "" }, { "docid": "4b7fef25843302b5cb3d92c140f1517b", "score": "0.591513", "text": "draw() {\n ctx.save();\n ctx.drawImage(imgs[this.type], this.x, this.y);\n ctx.restore();\n }", "title": "" }, { "docid": "719d89e8edbacce3be7ce1a02258cdd2", "score": "0.5905426", "text": "function potFront() {\n push();\n imageMode(CENTER);\n image(potTop, width / 2, 490, 120, 120);\n pop();\n}", "title": "" }, { "docid": "cbb0dfa919699057123aa8de8658d5ee", "score": "0.58974016", "text": "show(img) {\r\n // plz ignore the 4 lines below\r\n // this.r = 125;\r\n // rectMode(CENTER);\r\n // fill(255, 255, 0);\r\n // rect(this.x + 20, this.y + 10,this.r,this.r);\r\n this.img = img;\r\n image(img, this.x - 120, this.y);\r\n }", "title": "" }, { "docid": "9e61c07608902523da0b3ea31807cd64", "score": "0.5880122", "text": "draw() {\n if (this.isReady()) {\n //console.log(\"hola\")\n this.ctx.drawImage(this.img,this.x, this.y, this.width, this.height)\n //Cuando nuestro personaje avance el fondo se desplazará hacia la izquierda con velocidad negativa vx\n this.ctx.drawImage(this.img, this.x+this.width, this.y, this.width, this.height)\n \n }\n\n }", "title": "" }, { "docid": "d5166471f330e30a27e1565be105d89b", "score": "0.58768845", "text": "function drawLandBoard(){\r\n\tvar tmpY = 0; \r\n \t\r\n for (var i = 0; i < landBoardState.length; i++) {\r\n\t\tvar tmpX = 0;\r\n\t\tfor (var j = 0; j < landBoardState.length; j++) {\r\n \t\tctx.drawImage(landBoardState[i][j].image, 513 + tmpX, 64 + tmpY,70,70);\r\n \t\t\ttmpX += 75;\r\n\t\t};\r\n\t\ttmpY += 75;\r\n };\r\n}", "title": "" }, { "docid": "55b4dcb7b2afb1d48b5cda5921af39a4", "score": "0.5872335", "text": "function rotateLeft(){\r\n\timgNum++;\r\n\tif(imgNum > lastImg){\r\n\t\timgNum = 0;\r\n\t\tloadImg(imgArr[imgNum]);\r\n\t} else {\r\n\t\tloadImg(imgArr[imgNum]);\r\n\t}\r\n}", "title": "" }, { "docid": "0846cdab15bf8a8b3843d03ef8145338", "score": "0.58672285", "text": "function DrawLeft(in_xForm, in_count,ourOffset,scale2){\n \n var combinedMatrix = flatten(in_xForm);\n gl.uniformMatrix4fv(u_xForm, false, combinedMatrix);\n gl.drawArrays(gl.TRIANGLE_FAN, 0, 8);\n\n var heightDiv2 = .6 \n var xForm = mat4();\n xForm = mult(rotateZ(200),xForm);\n var theta2=((theta+bOffset[Math.floor(ourOffset)])-20)/2;\n xForm=mult(xForm,rotateZ(180*theta2/Math.PI));\n var scale = scalem(.8, .8, 0);\n xForm = mult(scale, xForm);\n var move = translate(0, heightDiv2,0);\n xForm = mult(move, xForm);\n \n xForm = mult(in_xForm, xForm); \n if(in_count > 1){\n DrawLeft(xForm, in_count - 1,ourOffset,scale2/3);\n DrawRight(xForm, in_count-1,ourOffset+scale2/3,scale2/3);\n Draw(xForm, in_count-1,ourOffset+scale2*2/3,scale2/3);\n }\n }", "title": "" }, { "docid": "fc971980f764b3e1ebd086b47449f664", "score": "0.58574086", "text": "draw() {\n stroke(0)\n strokeWeight(1)\n fill(this.color)\n rotate_and_draw_image(this.towerImg, this.pos.x - this.grids/2, this.pos.y - this.grids/2, this.grids, this.grids, this.angle)\n \n }", "title": "" }, { "docid": "4ca99a8f3c92167b06b22063891c5d68", "score": "0.58243626", "text": "function startscreen() {\n\tvar startimg = new Image();\n\tstartimg.src = \"img/start.png\";\n\t\tctx.drawImage(startimg, 0, 0, 800, 600);\n\t}", "title": "" }, { "docid": "9cdfc3f55ce5af971f63c224f90975e9", "score": "0.58157057", "text": "function Draw(){\n if(this.Active){\n this.ctx.drawImage(this.imageHighlight,this.x,this.y,this.width,this.height);\n }else{\n this.ctx.drawImage(this.imageFaded,this.x,this.y,this.width,this.height);\n }\n }", "title": "" }, { "docid": "bf4bffc98d59d3bd8addaecce239fff9", "score": "0.57980824", "text": "function firstAct(i) {\n\n console.log(\"firstAct\");\n if (i <= 5) {\n //drawYoung(i);\n shadeB(i);\n } else {\n drawOneRect(i);\n }\n\n // lowind = 6;\n // highind = 10;\n // midp = 8;\n direction = \"left\";\n}", "title": "" }, { "docid": "2dc891c6534beb7c1f2fe310b00a2f6b", "score": "0.57777953", "text": "display() {\n push();\n noStroke();\n imageMode(CENTER);\n image(this.img, mouseX, mouseY, this.radius * 2, this.radius * 2);\n pop();\n }", "title": "" }, { "docid": "8bc5f95973dac12fdda9b39ae55c8e1e", "score": "0.5753865", "text": "draw() {\r\n this.ctx.save()\r\n this.ctx.translate(this.x + (this.pSize / 2), this.y + (this.pSize / 2))\r\n this.ctx.rotate(this.angle)\r\n this.ctx.translate(-(this.x + (this.pSize / 2)), -(this.y + (this.pSize / 2)))\r\n this.ctx.drawImage(this.pl1, this.x, this.y, this.pSize, this.pSize)\r\n this.ctx.rotate(this.angle)\r\n this.ctx.restore()\r\n }", "title": "" }, { "docid": "2d59a60aac62cdd888e284a78cf3afa6", "score": "0.5744201", "text": "draw(){\n this.context.drawImage(this.img, this.x, this.y);\n }", "title": "" }, { "docid": "326c533e469f5fbae8a9b7abed4303e5", "score": "0.57245827", "text": "display4(){\n push();\n imageMode(CENTER);\n image(player2Sprite_flipped,this.x,this.y);\n pop();\n }", "title": "" }, { "docid": "8834ec67ecd3080b200384af65e8e077", "score": "0.5716373", "text": "function rotateLeft(){\n activeImage--;\n while (activeImage < 0) {\n activeImage += imageCount;\n }\n showImg();\n}", "title": "" }, { "docid": "8c941075f6ebfbe307029778fa7a48f3", "score": "0.5696356", "text": "function figureLeft() {\n\tfigure.pos.x--;\n}", "title": "" }, { "docid": "fac5af5855a2e58654469eebae44514b", "score": "0.5693394", "text": "function Left() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n var img = document.getElementById('hedgehog');\n var icon = document.getElementById('icon');\n resizeImage();\n\n if (img.naturalWidth > img.naturalHeight){\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, img.naturalWidth * 1, img.naturalHeight * 1, 0, 0, img.width * 1, img.height * 1);\n ctx.fillStyle = hex;\n ctx.fillRect(img.naturalWidth * 0, img.naturalHeight * 0, img.width * 0.3, img.height * 1);\n ctx.globalAlpha=0.5;\n ctx.drawImage(img, 0, 0, img.naturalWidth * 1, img.naturalHeight * 1, 0, 0, img.width * 1, img.height * 1);\n ctx.globalAlpha=1;\n ctx.drawImage(icon, 0, 0, icon.naturalWidth * 1, icon.naturalHeight * 1, img.width * 0.03, img.height * 0.82, img.width * 0.11, img.height * 0.16);\n ctx.fillStyle = 'white';\n ctx.font = \"34px Gotham Condensed Book\";\n var text = document.getElementById('buttonHtml').innerHTML;\n wrapText(ctx, text, img.width * 0.035, img.height * 0.1, img.width * 0.2, lineHeight * 0.85);\n } else if (img.naturalHeight > img.naturalWidth){\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, img.naturalWidth * 1, img.naturalHeight * 1, 0, 0, img.width * 1, img.height * 1);\n ctx.fillStyle = hex;\n ctx.fillRect(img.naturalWidth * 0, img.naturalHeight * 0, img.width * 0.3, img.height * 1);\n ctx.globalAlpha=0.5;\n ctx.drawImage(img, 0, 0, img.naturalWidth * 1, img.naturalHeight * 1, 0, 0, img.width * 1, img.height * 1);\n ctx.globalAlpha=1;\n ctx.drawImage(icon, 0, 0, icon.naturalWidth * 1, icon.naturalHeight * 1, img.width * 0.04, img.height * 0.85, icon.width, icon.height);\n ctx.fillStyle = 'white';\n ctx.font = \"42px Gotham Condensed Book\";\n var text = document.getElementById('buttonHtml').innerHTML;\n wrapText(ctx, text, img.width * 0.035, img.height * 0.1, img.width * 0.24, lineHeight * 0.85);\n } else {\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, img.naturalWidth * 1, img.naturalHeight * 1, 0, 0, img.width * 1, img.height * 1);\n ctx.fillStyle = hex;\n ctx.fillRect(img.naturalWidth * 0, img.naturalHeight * 0, img.width * 0.3, img.height * 1);\n ctx.globalAlpha=0.5;\n ctx.drawImage(img, 0, 0, img.naturalWidth * 1, img.naturalHeight * 1, 0, 0, img.width * 1, img.height * 1);\n ctx.globalAlpha=1;\n ctx.drawImage(icon, 0, 0, icon.naturalWidth * 1, icon.naturalHeight * 1, img.width * 0.03, img.height * 0.82, img.width * 0.16, img.height * 0.16);\n ctx.fillStyle = 'white';\n ctx.font = \"34px Gotham Condensed Book\";\n var text = document.getElementById('buttonHtml').innerHTML;\n wrapText(ctx, text, img.width * 0.035, img.height * 0.1, img.width * 0.2, lineHeight * 0.85);\n }\n}", "title": "" }, { "docid": "826b654abd72683af0f3c72c254b0771", "score": "0.569206", "text": "function left(index) {\n if (index > 0) {\n var temp = images[index];\n var index2 = index - 1;\n images[index] = images[index2];\n images[index2] = temp;\n icons();\n }\n}", "title": "" }, { "docid": "6943a26eac201da2990cbd3cb560a44f", "score": "0.5691329", "text": "draw() {\n ctx.drawImage(this.img, this.x, this.y, this.width, this.height);\n }", "title": "" }, { "docid": "12fb6be8c1d09df0d6091d5c5d524fc6", "score": "0.5679973", "text": "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0);\n if (!isAtLeftEdge)\n currentPosition -= 1;\n if (current.some(index => squares[currentPosition + index].classList.contains(\"block2\")))\n currentPosition += 1;\n draw();\n }", "title": "" }, { "docid": "e5d938287c77975b18ddec01bc17a45d", "score": "0.5675372", "text": "function loadStartImage() {\n \n var file = document.getElementById(\"sgfile\");\n sgImage = new SimpleImage(file);\n sgCanvas = document.getElementById(\"sgcan\");\n sgImage.drawTo(sgCanvas);\n \n}", "title": "" }, { "docid": "5035be47c7e5175e25c8456069ceaffa", "score": "0.5670524", "text": "function left_slider() {\n clear(); // First it will clear out the carousal images\n slider_img[current_pos - 1].style.display = \"block\"; // It decrements the value of current_position insider the slider_img array so that the previous image will be displayed.\n current_pos--;\n}", "title": "" }, { "docid": "3f1b98f33858e910276cfe117f883ba1", "score": "0.5670234", "text": "function moveLeft() {\n removeShape();\n actualShape.x--;\n if (collides(grid, actualShape)) {\n actualShape.x++;\n }\n applyShape();\n }", "title": "" }, { "docid": "622cee5f015a92f3c15931f10c5c897f", "score": "0.5667735", "text": "drawSelf() {\r\n this.drawBackground();\r\n for (let y = 2; y < this.height; y++) {\r\n for (let x = 0; x < this.width; x++) {\r\n if (this.hasBlock(x, y)) {\r\n this.drawBlock(x, y, this.getColor(x,y));\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "0a289df8d91a8878d84c094ccb6a9ffe", "score": "0.5653897", "text": "function initPosition() {\n img.buffer = gl.createBuffer();\n img.vertices = [-1, -1, +1, -1, -1, +1, -1, +1, +1, -1, +1, +1]; // two triangles to make a rect\n }", "title": "" }, { "docid": "4d7b00e8c9f12825f7e98fe93b21bc3c", "score": "0.56399614", "text": "function characterRunsLeft(x, y){\n image(packageRunLeft[runIndexLeft], x, y, 32, 32);\n\n if(runIndexLeft == packageRunLeft.length - 1){\n runIndexLeft = 0;\n }else{\n runIndexLeft++;\n }\n}", "title": "" }, { "docid": "2f2363a00ddbf2c10d4f8989b929acc2", "score": "0.563487", "text": "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0);\n if (!isAtLeftEdge) currentPosition--;\n if (current.some(index => squares[currentPosition + index].classList.contains('block2'))) {\n currentPosition++;\n }\n draw();\n }", "title": "" }, { "docid": "384f903d0825a585d0c9e0eb5bb5985d", "score": "0.5632652", "text": "function leftBackground() {\n push();\n // This is the bright side\n fill(brightColor);\n // Position is set at the corner of the rectangle\n rectMode(CORNER);\n rect(leftRectangleBackground.x, leftRectangleBackground.y, leftRectangleBackground.width, height);\n pop();\n}", "title": "" }, { "docid": "2b67ce8a01903196bbc459f0b6d86f3f", "score": "0.5628268", "text": "function drawImageFull(ctx, img) {\n if (isUndef(img)) { return }\n ctx.drawImage(img, 0, 0, kCanvasWidth, kCanvasHeight);\n}", "title": "" }, { "docid": "7d91ec75dfd8af76e891ec61ecdaeeb7", "score": "0.5612388", "text": "function createTopLeftCorner() {\n // draws the upper left box where the light and plant will be displayed\n draw.rect(250,300).x(0).y(0).fill('white').stroke({width:2});\n\n // create the leaf images\n leafYellow = draw.image('./leafYellow.png', 128, 128).attr({\n 'x': 20,\n 'y': 150\n });\n\n leafLightGreen = draw.image('./leafLightGreen.png', 128, 128).attr({\n 'x': 55,\n 'y': 90\n });\n\n leafGreen = draw.image('./leafGreen.png', 128, 128).attr({\n 'x': 55,\n 'y': 90\n });\n\n // draw the pot\n draw.image('./pot.png', 128, 128).attr({\"x\": 100, \"y\": 160});\n\n // the dead leaf should appear above the pot\n leafDead = draw.image('./leafDead.png', 128, 128).attr({\n 'x': 20,\n 'y': 150\n });\n\n // store all the leaf images in a global variable\n allLeaves = [leafDead, leafYellow, leafLightGreen, leafGreen];\n\n // draw the rectangle below the pot\n draw.rect(250,40).x(0).y(270).fill('gray').stroke({width:2});\n\n // create the light bulb on image\n lightBulbOn = draw.image('./lightbulb20001.png', 40, 70).rotate(150);\n\n // create the light bulb off image\n lightBulbOff = draw.image('./lightbulb20002.png', 40, 70).rotate(150).hide();\n}", "title": "" }, { "docid": "a09ec4cb8df7079d01fbbdd82ff2b1fe", "score": "0.56115854", "text": "function draw() {\n image(resultImg, 0, 0, 640, 480);\n}", "title": "" }, { "docid": "de1339d553edcaf7d34704569fa15c45", "score": "0.56046236", "text": "if ( left != null && right != null )\n {\n noFill();\n stroke(random(60), random(150), random(200));\n beginShape();\n for ( int i = 0; i < left.length; i++ )\n {\n vertex(i, height/4 + left[i]*50);\n }\n endShape();\n \n beginShape();\n for ( int i = 0; i < right.length; i++ )\n {\n vertex(i, 3*(height/4) + right[i]*50);\n }\n endShape();\n }", "title": "" }, { "docid": "1dfdc7635b6254d0199cfbc688180e10", "score": "0.5600672", "text": "display() {\n let stateImage = null;\n switch (this.state) {\n case true: //faceL\n stateImage = this.faceL;\n break;\n case false: //faceR\n stateImage = this.faceR;\n break;\n }\n image(stateImage, this.x, this.y);\n }", "title": "" }, { "docid": "e606c211cf780dc136fc7ced91c03697", "score": "0.55988663", "text": "display3(){\n push();\n imageMode(CENTER);\n image(player1Sprite_flipped,this.x,this.y);\n pop();\n }", "title": "" }, { "docid": "791e689c6f7ddc850607284a0cbc0878", "score": "0.55902076", "text": "function moveLeft() {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n \n if(!isAtLeftEdge) currentPosition -= 1\n \n if (current.some(index => square[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1\n }\n \n draw()\n \n }", "title": "" }, { "docid": "12fb062255e11d1661dfc2368b0e3487", "score": "0.5577373", "text": "function moveLeft() {\r\n undraw();\r\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0);\r\n if (!isAtLeftEdge) currentPosition -= 1;\r\n if (current.some(index => squares[currentPosition + index].classList.contains('block2'))) {\r\n currentPosition += 1;\r\n }\r\n draw();\r\n }", "title": "" }, { "docid": "b0e58d7d60cb036969b3c799439c24fb", "score": "0.5568258", "text": "function rewX() {\n while (rect.origin.x > box.left) {\n rect.origin.x -= img_width;\n }\n }", "title": "" }, { "docid": "b0e58d7d60cb036969b3c799439c24fb", "score": "0.5568258", "text": "function rewX() {\n while (rect.origin.x > box.left) {\n rect.origin.x -= img_width;\n }\n }", "title": "" }, { "docid": "1c052b4beed6dae24bf75a556a3631d5", "score": "0.5565232", "text": "function displayLeft() {\n if(randomNum1 === randomNum2){\n randomNum();\n } else {\n var el1 = document.getElementById('left');\n var imgEl1 = document.createElement('img');\n imgEl1.id = 'img1';\n imgEl1.src = imgArray[randomNum1].path;\n el1.appendChild(imgEl1);\n }\n\n}", "title": "" }, { "docid": "c023462f5d5802e87b9f0ba74e95bf0b", "score": "0.5564227", "text": "function wallCanvas() {\n push();\n imageMode(CENTER);\n image(windowWall, width / 2, height / 2, 500, 600);\n pop();\n}", "title": "" }, { "docid": "3356beccfb9c0ec86ec61b60dac4c74d", "score": "0.556144", "text": "drawme() {\n this.ctx.clearRect(0, 0, 400, 800);\n this._drawCols();\n this._drawRows();\n this._drawBlocks();\n // this.ctx.drawImage(this.img, 10, 10); \n }", "title": "" }, { "docid": "4f31dc63da7357fd549a4249d3597f90", "score": "0.55591094", "text": "function draw() {\n\tif (mouseIsPressed) {\n\t\tif (mouseButton === LEFT) {\n\t\t\t// Left mouse clicked!\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a3a5cb674eb504af30cf705da53468a7", "score": "0.5558606", "text": "leftRight() {\r\n if (this.x < canvas.width)\r\n this.x += 10;\r\n }", "title": "" }, { "docid": "f990acd3a6df0a59141d584f3f55ee7d", "score": "0.55580395", "text": "function leftArrow() {\r\n clearInterval(autoAdvance);\r\n for (var i = 0; i < 4; i++) {\r\n if ((photoOrder[i] - 1) === 0) {\r\n photoOrder[i] = 4;\r\n } else {\r\n photoOrder[i] -= 1;\r\n }\r\n populateFigures();\r\n }\r\n }", "title": "" }, { "docid": "4d56efb1dee776ba71444a4b81093215", "score": "0.55554396", "text": "function draw(){//\n image(img, 0, 0,width,height);\n gameMan.showAndUpdate();\n}", "title": "" }, { "docid": "cdebefec4ac9e0cc2f4f4c659082e33d", "score": "0.55505687", "text": "static drawSelection (tempDiv, firstPoint, event) {\n if (tempDiv !== null) {\n let imageOffset = $(\"#image\").offset();\n let relativeXEvent = event.pageX - imageOffset.left\n let relativeYEvent = event.pageY - imageOffset.top;\n let width = Math.abs(relativeXEvent - firstPoint.getX());\n let height = Math.abs(relativeYEvent - firstPoint.getY());\n let left = (relativeXEvent - firstPoint.getX() < 0) ? relativeXEvent : firstPoint.getX();\n let top = (relativeYEvent - firstPoint.getY() < 0) ? relativeYEvent : firstPoint.getY();\n $(\"#image\").append(tempDiv.css({width: width, height: height, left: left, top: top}));\n }\n }", "title": "" }, { "docid": "cd797ff0d21761431917a3ee0879a677", "score": "0.5547859", "text": "function flipDraw(image, x, y) {\n ctx.translate(x, y);\n ctx.scale(-1, 1);\n ctx.drawImage(image, -(box / 2), -(box / 2), box, box);\n ctx.scale(-1, 1);\n ctx.translate(-x, -y);\n}", "title": "" }, { "docid": "a0b9ba5b8fea00dfccf5e63a187de559", "score": "0.5546288", "text": "boatDraw() {\n\n drawBitmapCenteredWithRotation(this.IMG, this.x, this.y, this.angle);\n\n }", "title": "" }, { "docid": "cf80506149edd0302ea1cb67481fa9f0", "score": "0.5539861", "text": "draw() {\n ctx.beginPath();\n ctx.drawImage(this.src, this.x, this.y);\n }", "title": "" }, { "docid": "6e71a9131a3463c3fb2bf50c8a07a94d", "score": "0.5522212", "text": "function Draw() {\n context.clearRect(0, 0, width, height);\n //als er nog legen dingen zijn laat hij zien waar hij momenteel is\n if (OptionsLeft()) {\n ShowCurrent();\n }\n //loopt door alle vakjes en zorgt dat ze drawen\n for (let i = 0; i < grid.length; i++) {\n grid[i].draw();\n }\n}", "title": "" }, { "docid": "d33b3817a54a8bcb35e048881feaada0", "score": "0.5507228", "text": "function drawLandHand(){\r\n\r\n\tif (uppLeftLand==false){\r\n\t\tctx.drawImage(landHandState[0].image, 1000, 450, 100, 100);\r\n\t} else{\r\n\t\tctx.drawImage(landHandState[0].image, 1000, 450, 120, 120);\r\n\t}\r\n\tif (uppRightLand==false){\r\n\t\tctx.drawImage(landHandState[1].image, 1125, 450, 100, 100);\r\n\t} else{\r\n\t\tctx.drawImage(landHandState[1].image, 1125, 450, 120, 120);\r\n\t}\r\n\tif (downLeftLand==false){\r\n\t\tctx.drawImage(landHandState[2].image, 1000, 575, 100, 100);\r\n\t} else{\r\n\t\tctx.drawImage(landHandState[2].image, 1000, 575, 120, 120);\r\n\t}\r\n\tif (downRightLand==false){\r\n\t\tctx.drawImage(landHandState[3].image, 1125, 575, 100, 100);\r\n\t} else{\r\n\t\tctx.drawImage(landHandState[3].image, 1125, 575, 120, 120);\r\n\t}\r\n}", "title": "" }, { "docid": "34c0088edbef9be874b0906f2c5cd86b", "score": "0.55052304", "text": "function moveLeft() {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if(!isAtLeftEdge) {currentPosition -= 1}\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1\n }\n draw()\n }", "title": "" }, { "docid": "37f1e3928cc2a14d54d84e73d045e7af", "score": "0.5501486", "text": "flipHorizontal()\r\n\t{\r\n\t\t//get the size of image\r\n\t\tvar numRows = this.getHeight();\r\n\t\tvar numCols = this.getWidth();\r\n\t\tfor (var row = 0; row < numRows; row++) //Scan the rows\r\n\t\t{\r\n\t\t\tfor (var col = 0; col < numCols/2; col++) //Scan the columns\r\n\t\t\t{\r\n\t\t\t\t//Get the pixels to swap and swap them\r\n\t\t\t\tvar pix = this.getPixel(row, col);\r\n\t\t\t\tvar tmp = this.getPixel(row, numCols - (col+1));\r\n\t\t\t\tthis.setPixel(row,col, tmp);\r\n\t\t\t\tthis.setPixel(row,numCols - (col + 1), pix);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "c60afff1e2cc92a37cf391aac21f5a67", "score": "0.54926103", "text": "render(a)\n {\n //coordinate of top left corner\n var cornerX = a.posX - this.width / 2;\n var cornerY = a.posY - this.height / 2;\n \n image(this.images[this.currentSprite], cornerX, cornerY, this.width, this.height);\n }", "title": "" }, { "docid": "495706733350e9dfa9650dfc771a85f4", "score": "0.5485825", "text": "function draw(){\n\tctx.font=\"30px Arial\";\n\tctx.fillText(\"Press right!\", 230, 40);\n\tctx.drawImage(image, 100*winNum+100,40);\n\n\tvar xPos = [];\n\tvar yPos = [];\n\tfor(var i=0;i<10;i++){\n\t\txPos[i] = Math.floor(Math.random()*450);\n\t\tyPos[i] = Math.floor(Math.random()*350)+120;\n\t}\n\tcx = xPos[9];\n\tcy = yPos[9];\n\t\n\n\tfor(var j = 0;j<9;j++){\n\t\tctx.fillStyle = \"blue\";\n\t\tctx.fillRect(xPos[j],yPos[j],50,50);\n\t\tctx.fillStyle = \"black\";\n\t\tctx.fillText(\"<\", xPos[j]+15, yPos[j]+35);\n\t}\n\tctx.fillStyle = \"blue\";\n\tctx.fillRect(xPos[9],yPos[9],50,50);\n\tctx.fillStyle = \"black\";\n\tctx.fillText(\">\", xPos[9]+15, yPos[9]+35);\n\n\n\tctx.stroke();\n}", "title": "" }, { "docid": "d09fe0b5dfc2ce0217fed84c3510ec84", "score": "0.548447", "text": "dibuja(){\n ctx.drawImage(this.imageInstance,this.counterX*this.tileWidth,this.counterY*this.tileHeight,this.tileWidth,this.tileHeight,this.posX,this.posY,this.totalWidth,this.totalHeight)\n }", "title": "" }, { "docid": "a9c653c255484dc2d81b53aa8e729a2d", "score": "0.54834664", "text": "drawHeadTopSideLeft(painter) {\n let moveX = this.startX + this.chessItemWidth + this.margin;\n let moveY = this.startY + 7 * this.chessItemHeight + this.margin;\n painter.moveTo(moveX, moveY);\n let lineX = this.startX + 2 * this.chessItemWidth + this.margin;\n let lineY = this.startY + 8 * this.chessItemHeight + this.margin;\n painter.lineTo(lineX, lineY);\n painter.stroke();\n }", "title": "" }, { "docid": "db399760783f2afb54d85dc09626773b", "score": "0.5480758", "text": "function moveLeft(){\r\n undraw()\r\n const LeftEdge = current.some(index => (currentPosition + index) % Width === 0)\r\n\r\n if(!LeftEdge) {currentPosition -=1}\r\n\r\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition +=1\r\n }\r\n\r\n draw()\r\n }", "title": "" }, { "docid": "3f86146062aabc413547fc2d14487c4c", "score": "0.54797846", "text": "function mdraw(){\n\n\tbg.src = \"map2.png\";\n\tctx.drawImage(bg,0,0);\n\t\n\tstar.src = \"star.gif\";\n\tctx.drawImage(star, 290,150);\n\tctx.drawImage(star,849,287);\n\tairplane();\n\t\n\n}", "title": "" }, { "docid": "c9bd83dfcde71aa3c2d834dcf0741991", "score": "0.54788464", "text": "function start(){\n\tvar centerX = getWidth()/2;\n var centerY = getHeight()/2;\n var randomX = Randomizer.nextInt(HEAD_RADIUS, getWidth() - HEAD_RADIUS);\n var randomY = Randomizer.nextInt(HALF_LENGTH, getHeight() - HALF_LENGTH);\n var randomColor = Randomizer.nextColor();\n drawGhost(centerX, centerY, Color.red);\n drawGhost(randomX, randomY, randomColor);\n drawGhost(100,100, Color.green);\n drawGhost(300, 200, Color.black);\n drawGhost(40, 300, Color.orange);\n drawGhost(300, 50, Color.yellow);\n}", "title": "" }, { "docid": "3ec49aea45c957bada87b9dbf016c306", "score": "0.5476843", "text": "function _paintFirstTime(){\n\n _canvasDraw.clearRect(0,0,_canvasWidth,_canvasHeight);\n\n for(var i = 0; i < _dimension; i++){\n _canvasDraw.beginPath();\n _canvasDraw.moveTo(i*_cellDiameter+1,0);\n _canvasDraw.lineTo(i*_cellDiameter+1,_canvasHeight);\n _canvasDraw.stroke();\n\n _canvasDraw.beginPath();\n _canvasDraw.moveTo(0,i*_cellDiameter+1);\n _canvasDraw.lineTo(_canvasWidth,i*_cellDiameter+1);\n _canvasDraw.stroke();\n }\n }", "title": "" }, { "docid": "13b24d47da23e4437c46589a1676a396", "score": "0.5467898", "text": "function resetDraw(){\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.drawImage(bkg, 0, 0, canvas.width, canvas.height); \n}", "title": "" }, { "docid": "9a6d15d687da39a7cc2f192e9e96a019", "score": "0.546776", "text": "display() {\n push();\n fill(0,255,0);\n if (this.image === imageLeaf) {\n image(this.image, this.x, this.y, this.size, this.size);\n } else {\n ellipse(this.x, this.y, this.size);\n }\n pop();\n // if (x < 0 || x > width || y < 0 || y > height) {\n // var removed = targets.splice(this.index, 1);\n // }\n }", "title": "" }, { "docid": "d6ff535180f3fb75cc1bce73ac265d52", "score": "0.5467758", "text": "popFront() {\n \tif (this.poses.length > 0) {\n \t\tthis.poses.shift();\n \t\t// TODO: shift drawing instructions rather than doing it all over\n \t\tthis.graphics.clear();\n \t\tthis.graphics.setStrokeStyle(this.strokeSize);\n \t\tthis.graphics.beginStroke(this.strokeColor);\n \t\tthis.graphics.lineTo(this.poses[0].position.x / this.scaleX, this.poses[0].position.y / -this.scaleY);\n \t\tfor (var i=1; i<this.poses.length; ++i) {\n \t\t\tthis.graphics.lineTo(this.poses[i].position.x / this.scaleX, this.poses[i].position.y / -this.scaleY);\n \t\t}\n \t}\n }", "title": "" }, { "docid": "dc7940dbd7f69d96a7badef930f4fd1d", "score": "0.54676133", "text": "function draw(){\n\t$('.ship').css('display','none');\n\tcontext.clearRect(0,0,1200,920);\n\tcontext.drawImage(track,0,0,1200,920);\n context.drawImage(background, 0,0,1200,920);\n redraw(boat, boat_x, boat_y,rotation); \t\n}", "title": "" }, { "docid": "b525036a200ed446b6dcb85c3f279116", "score": "0.5464046", "text": "display(){\n\n if(camera.position.x - this.xpos >1300){\n this.xpos += 1310;\n } else if(camera.position.x - this.xpos < 0){\n this.xpos -= 1310;\n }\n image(this.image, this.xpos, this.ypos);\n image(this.image, this.xpos+this.width, this.ypos);\n image(this.image, this.xpos-this.width, this.ypos);\n this.sprite.display();\n //if camera position = position + half of image, display image in front\n }", "title": "" }, { "docid": "0093b7349cefcba10d521dd88711acc0", "score": "0.5459435", "text": "function moveLeft() {\r\n undraw()\r\n const leftEdge = current.some(index => (currentPosition + index) % width === 0)\r\n if (!leftEdge) currentPosition -= 1\r\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\r\n currentPosition += 1\r\n }\r\n\r\n draw()\r\n }", "title": "" }, { "docid": "bda6c07083c3e8088911313666ace186", "score": "0.5458922", "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": "3ae9b643cc19b392d9f41369d542733c", "score": "0.54587686", "text": "function firstCanvasMouseDown(ev) {\n app.x1 = (ev.offsetX * app.firstCanvas.width) / app.firstCanvas.clientWidth;\n app.y1 = (ev.offsetY * app.firstCanvas.height) / app.firstCanvas.clientHeight;\n\n app.clX = ev.clientX;\n app.clY = ev.clientY;\n app.isSelected = true;\n}", "title": "" }, { "docid": "01c5e47397a1d67de79759e8560eab67", "score": "0.54566556", "text": "draw(ctx) {\n ctx.drawImage(\n this.image,\n this.position.x,\n this.position.y,\n this.size,\n this.size\n );\n }", "title": "" }, { "docid": "dc290efda242e3911db3b02507492e93", "score": "0.5449309", "text": "render() {\n for (let y = 0; y < this.canvas.heigth; y += 1) {\n for (let x = 0; x < this.canvas.width; x += 1) {\n let pixel = x === 0 || y === 0 ? this.canvas.renderAt(x, y) : null;\n\n const line = this.pixels[x];\n if (!line) this.pixels[x] = [];\n\n if (!pixel) {\n for (let s = this.shapes.length - 1; s >= 0; s -= 1) {\n const v = this.shapes[s].renderAt(x, y);\n if (v) {\n pixel = v;\n break;\n }\n }\n }\n\n\n if (!pixel) {\n pixel = this.pixels[x][y] ? this.pixels[x][y] : this.canvas.renderAt(x, y);\n }\n this.pixels[x][y] = pixel;\n this.rl.write(pixel);\n }\n this.rl.write('\\n');\n }\n }", "title": "" }, { "docid": "cc80476d3ae036d1425c6a93de7e543a", "score": "0.544804", "text": "function draw() {\n if (page_stage == \"home\") {\n cnv.hide();\n\n if (ifIdle) {\n if (ifScroll == 'up') {\n window.scrollBy(0, -6);\n } else if (ifScroll == 'down') {\n window.scrollBy(0, 6);\n }\n }\n } else if (page_stage == 'page1') {\n if (!switchedHomeTo1) {\n switchTo1();\n switchedHomeTo1 = true;\n cnv.show();\n }\n background(255);\n if (ifIdle == 'not') {\n if (ifZoom == 'in') {\n p1_photo_w += 6;\n } else if (ifZoom == 'out') {\n p1_photo_w -= 6;\n }\n p1_photo_w = constrain(p1_photo_w, 5, 500);\n push();\n imageMode(CENTER);\n image(trump_photo, windowWidth/2, windowHeight/2, p1_photo_w, p1_photo_w*3/2);\n pop();\n }\n }\n}", "title": "" }, { "docid": "fb3b0bd8fe3ce32e07962056e832b072", "score": "0.5445257", "text": "function moveLeft () {\r\n undraw()\r\n const isAtLeftEdge = current.some(item => (currentPosition + item) % width === 0)\r\n if (!isAtLeftEdge) currentPosition -= 1\r\n if (current.some(item => squares[currentPosition + item].classList.contains('taken'))) {\r\n currentPosition += 1\r\n }\r\n draw()\r\n }", "title": "" }, { "docid": "60c162fa38d895bfb46a6237ccf2cb8b", "score": "0.54411983", "text": "function bDisp() {\n \"use strict\";\n\n\n\n //variables\n var ctx = document.getElementById(\"game\"),\n img = new Image();\n\n ctx.getContext(\"2d\");\n\n //build the stick man\n\n ctx = ctx.getContext(\"2d\");\n\n /*\n img.onload = function () {\n ctx.drawImage(img, 0, 280, 35, 33);\n };\n \n img.src = \"./Images/stickMan.jpg\"; \n \n */\n\n //draw the hoop\n ctx.beginPath();\n ctx.strokeStyle = \"red\";\n ctx.lineWidth = 1;\n ctx.moveTo(490, 160);\n ctx.lineTo(430, 160);\n ctx.stroke();\n\n //draw the pole\n ctx.beginPath();\n ctx.strokeStyle = \"black\";\n ctx.moveTo(490, 315);\n ctx.lineTo(490, 160);\n ctx.stroke();\n \n\n\n}", "title": "" }, { "docid": "cf509d3e3e4594ee882733df7afe935f", "score": "0.5439799", "text": "draw(){\n let theImage = new Image();\n theImage.src = this.theSrc;\n theImage.onload = ()=>{\n this.ctx.drawImage(theImage, this.x, this.y, this.width, this.height);\n }\n }", "title": "" }, { "docid": "24d32a1caf0c253fa0d6bb659a44b0da", "score": "0.5436965", "text": "draw () {\n //Insert images atributes to be displayd in screen, once. With loop, seems that the image is constantly on scrren\n context.drawImage(\n sprites,\n startScreen.sourceX,startScreen.sourceY,\n startScreen.sWidth,startScreen.sHeight,\n startScreen.destinyX,startScreen.destinyY,\n startScreen.sWidth,startScreen.sHeight,\n );\n }", "title": "" }, { "docid": "bdb51543deb0fa4f819b63610190ff20", "score": "0.5422467", "text": "show() {\n // stroke(255, 0, 0);\n // line(this.x - w/2, this.y - h/2, this.x + w/2, this.y - h/2);\n // line(this.x - w/2, this.y + h/2, this.x + w/2, this.y + h/2);\n // line(this.x - w/2, this.y - h/2, this.x - w/2, this.y + h/2);\n // line(this.x + w/2, this.y - h/2, this.x + w/2, this.y + h/2);\n // stroke(0);\n image(birdImg, this.x - w/2, this.y - h/2, w, h);\n }", "title": "" }, { "docid": "851e407c06e2cf2f673335424db7d9ee", "score": "0.5419519", "text": "display() {\n push();\n imageMode(CENTER)\n image(bossImage[this.hitCount], this.x, this.y, this.size * 2, this.size * 2);\n pop();\n }", "title": "" }, { "docid": "8cb8cd9ea69f4eb5dd53c038313f9b7e", "score": "0.5419494", "text": "draw(ctx) {\n ctx.save();\n ctx.translate(this.x-10, this.y-10);\n context.beginPath();\n context.fillStyle=\"#FF4422\"\n ctx.drawImage(this.balle, 0, 0, 20, 20);\n context.fill();\n ctx.restore();\n }", "title": "" }, { "docid": "862cee43a913ef82f657c643e4099ffb", "score": "0.54179895", "text": "function draw() {\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\tif(IMAGES_LOADED === 1){\n\t\tif(toggle === 0) {\n\t\t\tdrawImage(\"PikachuSilhouette\");\n\t\t\t//toggle = 1;\n\t\t} else {\n\t\t\tdrawImage(\"Pikachu\");\n\t\t\t//toggle = 0;\t\n\t\t}\t\n\t}\n\n}", "title": "" }, { "docid": "2e6cc5d02c65b3457c21a74d6d045d5b", "score": "0.5417276", "text": "function moveLeft() {\n //flips image back to original facing left\n objImage.style.transform = 'scaleX(+1)';\n walk();\n movement.x -= 7.5;\n //moves sprite left\n objImage.style.left = (parseInt(objImage.style.left) || 0) - 7.5 + 'px';\n}", "title": "" }, { "docid": "616542a34aaa57b221c72f5a96445783", "score": "0.5415935", "text": "function StartDrawImg(){\n _DrawImg = true;\n}", "title": "" }, { "docid": "0cb3a57e64d007740bfa0e29e1a24a1f", "score": "0.5415799", "text": "draw() {\n if(!this.spriteSheet){\n }\n else{\n \tapp.ctx.drawImage(\n this.image,\n this.frameIndex * this.width / this.numberPerFrame,\n 0,\n this.width / this.numberPerFrame,\n this.height,\n this.x,\n this.y,\n this.width / this.numberPerFrame ,\n this.height);\n }\n }", "title": "" }, { "docid": "e41b835b3ec61887cbc438ea71a1f5bc", "score": "0.5408709", "text": "drawHeadBottomSideLeft(painter) {\n let moveX = this.startX + this.chessItemWidth + this.margin;\n let moveY = this.startY + this.chessItemHeight + this.margin;\n painter.moveTo(moveX, moveY);\n let lineX = this.startX + 2 * this.chessItemWidth + this.margin;\n let lineY = this.startY + this.margin;\n painter.lineTo(lineX, lineY);\n painter.stroke();\n }", "title": "" }, { "docid": "72c5cc318701ad318fd76765e3898950", "score": "0.5408121", "text": "function drawImgIdle(){\n console.log('drawing idle')\n switch(lastPressed){\n case \"up\":\n idleDecider = p1Up;\n break;\n case \"down\":\n idleDecider = p1Down;\n break;\n case \"left\":\n idleDecider = p1Left;\n break;\n case \"right\":\n idleDecider = p1Right;\n break;\n }\n if(frameCounter < totalFrames){\n ctx.drawImage(idleDecider, 0, 0, spriteWidth, spriteHeight, g.playerArr[0].x - 18, g.playerArr[0].y - 28, spriteWidth*spriteScale, spriteHeight*spriteScale);\n }\n if(frameCounter == totalFrames - 1){\n console.log('resetting')\n ssNum=0;\n frameCounter = 0;\n }\n frameCounter++;\n }", "title": "" }, { "docid": "70402251881142f4a30607c98cf8a441", "score": "0.54031783", "text": "function draw_treeAnim()\n{\n\tcontext.clearRect(x-1,y-1,200,150);\n\timg(context,picture,x,y); \n\timg(context,\"img15\",1000,450);\n}", "title": "" }, { "docid": "b3605a48ca9fb9da2dd606787008a6c4", "score": "0.54026586", "text": "function draw() {\n background(255);\n //image(img, 0, 0);\n if (img.loaded()) {\n image(img, 40, 40);\n audioTriggerLow();\n //img.pause();\n }\n}", "title": "" }, { "docid": "601e6a69aa424b57b5696a839badf894", "score": "0.5400138", "text": "display() {\n\n if (this.clicked) { //when clicked on the cursor object\n push();\n image(xeroxImage, this.x, this.y, this.w, this.h);//change color\n pop();\n image(pointerCursor, mouseX, mouseY, 728.35 / 20, 720.74 / 20);\n } else if (this.rollover) { //if mouse is on the cursor object\n push();\n image(xeroxImage, this.x, this.y, this.w, this.h);\n pop();\n image(pointerCursor, mouseX, mouseY, 728.35 / 20, 720.74 / 20);\n } else { //default\n image(xeroxImage, this.x, this.y, this.w, this.h);\n }\n }", "title": "" } ]
e3a5ecb6b677cae1d0cc1ae5248c7108
b1 & (~b2) :: BigNat > BigNat > BigNat fixme is this one correct?
[ { "docid": "13ef9f4793a22719ef8243e2acd544c0", "score": "0.57971483", "text": "function h$ghcjsbn_andn_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"andn_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"andn_bb b2\");\n var i, lmin, l1 = b1[0], l2 = b2[0], t = [0];\n if(l1 <= l2) {\n for(i = 0; i <= l1; i++) t[i] = b1[i] & (~b2[i]);\n } else {\n for(i = 0; i <= l2; i++) t[i] = b1[i] & (~b2[i]);\n for(i = l2+1; i <= l1; i++) t[i] = b1[i];\n }\n while(l1 > 0 && t[l1] === 0) l1--;\n t[0] = l1;\n h$ghcjsbn_assertValid_b(t, \"andn_bb result\");\n return t;\n}", "title": "" } ]
[ { "docid": "c006d7f7d46bcd3144e72f88ec3c35d5", "score": "0.63476765", "text": "function bigint_not(arr) {\n for (var i = 0; i < arr.length; i++) {\n arr[i] = ~arr[i] >>> 0;\n }\n}", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "a72e25a37811f407a04b8455e984e6c8", "score": "0.6262601", "text": "function op_andnot(x,y) { return x&~y; }", "title": "" }, { "docid": "1334d34dbc4bac9f7ef7cad16cc09e7f", "score": "0.6224601", "text": "function op_andnot(x, y) { return x & ~y; }", "title": "" }, { "docid": "1334d34dbc4bac9f7ef7cad16cc09e7f", "score": "0.6224601", "text": "function op_andnot(x, y) { return x & ~y; }", "title": "" }, { "docid": "1334d34dbc4bac9f7ef7cad16cc09e7f", "score": "0.6224601", "text": "function op_andnot(x, y) { return x & ~y; }", "title": "" }, { "docid": "c8c79f6c513ae5b228dcc057e5d5140c", "score": "0.6112947", "text": "function op_andnot(x, y) {\n\t return x & ~y\n\t}", "title": "" }, { "docid": "158cab34c595bc169831b9e9f921775d", "score": "0.6030794", "text": "function op_andnot(x, y) {\n return x & ~y\n}", "title": "" }, { "docid": "158cab34c595bc169831b9e9f921775d", "score": "0.6030794", "text": "function op_andnot(x, y) {\n return x & ~y\n}", "title": "" }, { "docid": "158cab34c595bc169831b9e9f921775d", "score": "0.6030794", "text": "function op_andnot(x, y) {\n return x & ~y\n}", "title": "" }, { "docid": "158cab34c595bc169831b9e9f921775d", "score": "0.6030794", "text": "function op_andnot(x, y) {\n return x & ~y\n}", "title": "" }, { "docid": "158cab34c595bc169831b9e9f921775d", "score": "0.6030794", "text": "function op_andnot(x, y) {\n return x & ~y\n}", "title": "" }, { "docid": "158cab34c595bc169831b9e9f921775d", "score": "0.6030794", "text": "function op_andnot(x, y) {\n return x & ~y\n}", "title": "" }, { "docid": "158cab34c595bc169831b9e9f921775d", "score": "0.6030794", "text": "function op_andnot(x, y) {\n return x & ~y\n}", "title": "" }, { "docid": "158cab34c595bc169831b9e9f921775d", "score": "0.6030794", "text": "function op_andnot(x, y) {\n return x & ~y\n}", "title": "" }, { "docid": "158cab34c595bc169831b9e9f921775d", "score": "0.6030794", "text": "function op_andnot(x, y) {\n return x & ~y\n}", "title": "" }, { "docid": "158cab34c595bc169831b9e9f921775d", "score": "0.6030794", "text": "function op_andnot(x, y) {\n return x & ~y\n}", "title": "" }, { "docid": "f7c95f6471aabb1492842433a8f54786", "score": "0.6026745", "text": "function op_andnot(x, y) {\r\n return x & ~y;\r\n}", "title": "" }, { "docid": "b973a888f71fb296adc4cac0a89520fb", "score": "0.6020878", "text": "function op_andnot(x, y)\n{\n return x & ~y;\n}", "title": "" }, { "docid": "347014d23bd626a0d84c541d58bdbb45", "score": "0.60021937", "text": "function f2(b) {\n\t\tvar t = b[0] ^ b[1];\n\t\tb[0] = b[1];\t\t\t/* X[2]\t\t\t\t\t\t\t\t\t\t*/\n\t\tb[1] = b[2];\t\t\t/* X[2]\t\t\t\t\t\t\t\t\t\t*/\n\t\tb[2] = b[3];\t\t\t/* X[4]\t\t\t\t\t\t\t\t\t\t*/\n\t\tb[3] = t;\t\t\t\t/* X[1, 2]\t\t\t\t\t\t\t\t\t*/\n\t}", "title": "" }, { "docid": "9a084d55c478440101eedd6aefc960d3", "score": "0.59935874", "text": "function op_andnot(x, y) {\n return x & ~y;\n }", "title": "" }, { "docid": "65b1cf75f62ffccac29b3bff61ce966e", "score": "0.59709996", "text": "function op_andnot(x, y) {\n return x & ~y;\n}", "title": "" }, { "docid": "65b1cf75f62ffccac29b3bff61ce966e", "score": "0.59709996", "text": "function op_andnot(x, y) {\n return x & ~y;\n}", "title": "" }, { "docid": "89433444e7c62c58bcc5dcb1032fcb16", "score": "0.5969453", "text": "function op_andnot(x, y) {\n return x & ~y;\n}", "title": "" }, { "docid": "89433444e7c62c58bcc5dcb1032fcb16", "score": "0.5969453", "text": "function op_andnot(x, y) {\n return x & ~y;\n}", "title": "" }, { "docid": "89433444e7c62c58bcc5dcb1032fcb16", "score": "0.5969453", "text": "function op_andnot(x, y) {\n return x & ~y;\n}", "title": "" }, { "docid": "fc1acf407d2fc309ec9807d7685091ca", "score": "0.59530294", "text": "function op_andnot(x, y) {\n return x & ~y;\n }", "title": "" }, { "docid": "b1369cfba7b76c1a049c480a4134b39a", "score": "0.5909355", "text": "function rewriteBitComparison(left, right) {\n if (isBooleanExpression(left) && isBitConstant(right)) {\n return (right.value === true) ? left : new expressions.Unary(left, 'Not');\n }\n else if (isBooleanExpression(right) && isBitConstant(left)) {\n return (left.value === true) ? right : new expressions.Unary(right, 'Not');\n }\n\n // no conversion necessary\n return null;\n}", "title": "" }, { "docid": "045c590b23e0d649265a6d95f54a6a14", "score": "0.58405495", "text": "function h$ghcjsbn_neq_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"neq_bb\");\n h$ghcjsbn_assertValid_b(b2, \"neq_bb\");\n var bl1 = b1[0], bl2 = b2[0];\n if(bl1 !== bl2) {\n return true;\n } else {\n for(var i = bl1; i >= 1; i--) {\n var bw1 = b1[i], bw2 = b2[i];\n if(bw1 !== bw2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "045c590b23e0d649265a6d95f54a6a14", "score": "0.58405495", "text": "function h$ghcjsbn_neq_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"neq_bb\");\n h$ghcjsbn_assertValid_b(b2, \"neq_bb\");\n var bl1 = b1[0], bl2 = b2[0];\n if(bl1 !== bl2) {\n return true;\n } else {\n for(var i = bl1; i >= 1; i--) {\n var bw1 = b1[i], bw2 = b2[i];\n if(bw1 !== bw2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "045c590b23e0d649265a6d95f54a6a14", "score": "0.58405495", "text": "function h$ghcjsbn_neq_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"neq_bb\");\n h$ghcjsbn_assertValid_b(b2, \"neq_bb\");\n var bl1 = b1[0], bl2 = b2[0];\n if(bl1 !== bl2) {\n return true;\n } else {\n for(var i = bl1; i >= 1; i--) {\n var bw1 = b1[i], bw2 = b2[i];\n if(bw1 !== bw2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "045c590b23e0d649265a6d95f54a6a14", "score": "0.58405495", "text": "function h$ghcjsbn_neq_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"neq_bb\");\n h$ghcjsbn_assertValid_b(b2, \"neq_bb\");\n var bl1 = b1[0], bl2 = b2[0];\n if(bl1 !== bl2) {\n return true;\n } else {\n for(var i = bl1; i >= 1; i--) {\n var bw1 = b1[i], bw2 = b2[i];\n if(bw1 !== bw2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "045c590b23e0d649265a6d95f54a6a14", "score": "0.58405495", "text": "function h$ghcjsbn_neq_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"neq_bb\");\n h$ghcjsbn_assertValid_b(b2, \"neq_bb\");\n var bl1 = b1[0], bl2 = b2[0];\n if(bl1 !== bl2) {\n return true;\n } else {\n for(var i = bl1; i >= 1; i--) {\n var bw1 = b1[i], bw2 = b2[i];\n if(bw1 !== bw2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "7a212a6203fbe4f19e62be428564c0dd", "score": "0.5818252", "text": "function sc_bitNot(x) {\n return ~x;\n}", "title": "" }, { "docid": "b13817e6b947293bf61c23ad0f099b66", "score": "0.5712907", "text": "function Prelude__Interfaces__Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0($_0_arg, $_1_arg, $_2_arg, $_3_arg){\n \n if(($_3_arg.type === 7)) {\n \n if(($_2_arg.type === 7)) {\n \n if((!$_1_arg)) {\n \n if($_0_arg.equals((new $JSRTS.jsbn.BigInteger((\"0\"))))) {\n return false;\n } else {\n const $_8_in = $_0_arg.subtract((new $JSRTS.jsbn.BigInteger((\"1\"))));\n return Prelude__Interfaces__Data__Fin___64_Prelude__Interfaces__Eq_36_Fin_32_n_58__33__61__61__58_0($_8_in.add((new $JSRTS.jsbn.BigInteger((\"1\")))), $_2_arg.$1, $_3_arg.$1);\n }\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else if(($_3_arg.type === 0)) {\n return (!(!($_2_arg.type === 0)));\n } else if(($_3_arg.type === 1)) {\n return (!(!($_2_arg.type === 1)));\n } else if(($_3_arg.type === 6)) {\n \n if(($_2_arg.type === 6)) {\n const $cg$9 = $_3_arg.$2;\n const $cg$11 = $_2_arg.$2;\n let $cg$12 = null;\n if((((($cg$11.$1 == $cg$9.$1)) ? 1|0 : 0|0) === 0)) {\n $cg$12 = false;\n } else {\n const $cg$14 = Prelude__Nat__cmp($_2_arg.$1, $_3_arg.$1);\n if(($cg$14.type === 1)) {\n $cg$12 = Prelude__Interfaces__Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0($_3_arg.$1, $_1_arg, $cg$11.$2, $cg$9.$2);\n } else if(($cg$14.type === 2)) {\n $cg$12 = Prelude__Interfaces__Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0($_3_arg.$1.add($cg$14.$1.add((new $JSRTS.jsbn.BigInteger((\"1\"))))), $_1_arg, $cg$11.$2, Typedefs__Typedefs__weakenTDef(null, null, $cg$9.$2, $_3_arg.$1.add($cg$14.$1.add((new $JSRTS.jsbn.BigInteger((\"1\"))))), null));\n } else {\n $cg$12 = Prelude__Interfaces__Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0($_2_arg.$1.add($cg$14.$1.add((new $JSRTS.jsbn.BigInteger((\"1\"))))), $_1_arg, $cg$9.$2, Typedefs__Typedefs__weakenTDef(null, null, $cg$11.$2, $_2_arg.$1.add($cg$14.$1.add((new $JSRTS.jsbn.BigInteger((\"1\"))))), null));\n }\n }\n \n \n if($cg$12) {\n return Typedefs__Typedefs__vectEq(null, $_3_arg.$1, $_2_arg.$1, new $HC_2_0$Prelude__Interfaces__Eq_95_ictor($partial_2_4$Prelude__Interfaces___123_Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0_95_lam_95_7079_125_($_0_arg, $_1_arg), $partial_2_4$Prelude__Interfaces___123_Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0_95_lam_95_7080_125_($_0_arg, $_1_arg)), $_2_arg.$3, $_3_arg.$3);\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else if(($_3_arg.type === 5)) {\n \n if(($_2_arg.type === 5)) {\n return Typedefs__Typedefs__vectEq(null, $_3_arg.$1, $_2_arg.$1, new $HC_2_0$Prelude__Interfaces__Eq_95_ictor($partial_2_4$Prelude__Interfaces___123_Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0_95_lam_95_7081_125_($_0_arg, $_1_arg), $partial_2_4$Prelude__Interfaces___123_Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0_95_lam_95_7082_125_($_0_arg, $_1_arg)), $_2_arg.$2, $_3_arg.$2);\n } else {\n return false;\n }\n } else if(($_3_arg.type === 3)) {\n \n if(($_2_arg.type === 3)) {\n return Typedefs__Typedefs__vectEq(null, (new $JSRTS.jsbn.BigInteger((\"2\"))).add($_3_arg.$1), (new $JSRTS.jsbn.BigInteger((\"2\"))).add($_2_arg.$1), new $HC_2_0$Prelude__Interfaces__Eq_95_ictor($partial_2_4$Prelude__Interfaces___123_Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0_95_lam_95_7079_125_($_0_arg, $_1_arg), $partial_2_4$Prelude__Interfaces___123_Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0_95_lam_95_7080_125_($_0_arg, $_1_arg)), $_2_arg.$2, $_3_arg.$2);\n } else {\n return false;\n }\n } else if(($_3_arg.type === 2)) {\n \n if(($_2_arg.type === 2)) {\n return Typedefs__Typedefs__vectEq(null, (new $JSRTS.jsbn.BigInteger((\"2\"))).add($_3_arg.$1), (new $JSRTS.jsbn.BigInteger((\"2\"))).add($_2_arg.$1), new $HC_2_0$Prelude__Interfaces__Eq_95_ictor($partial_2_4$Prelude__Interfaces___123_Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0_95_lam_95_7079_125_($_0_arg, $_1_arg), $partial_2_4$Prelude__Interfaces___123_Typedefs__Typedefs___64_Prelude__Interfaces__Eq_36_TDef_39__32_n_32_a_58__33__61__61__58_0_95_lam_95_7080_125_($_0_arg, $_1_arg)), $_2_arg.$2, $_3_arg.$2);\n } else {\n return false;\n }\n } else if(($_3_arg.type === 4)) {\n \n if(($_2_arg.type === 4)) {\n \n if($_0_arg.equals((new $JSRTS.jsbn.BigInteger((\"0\"))))) {\n return false;\n } else {\n const $_153_in = $_0_arg.subtract((new $JSRTS.jsbn.BigInteger((\"1\"))));\n return Prelude__Interfaces__Data__Fin___64_Prelude__Interfaces__Eq_36_Fin_32_n_58__33__61__61__58_0($_153_in.add((new $JSRTS.jsbn.BigInteger((\"1\")))), $_2_arg.$1, $_3_arg.$1);\n }\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "3a8a7653507092ccf4c555dfd62d4d26", "score": "0.57031447", "text": "function h$ghcjsbn_rem_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"rem_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"rem_bb b2\");\n var t1 = [], t2 = [];\n h$ghcjsbn_quotRem_bb(t1, t2, b1, b2);\n h$ghcjsbn_assertValid_b(t2, \"rem_bb result\");\n return t2;\n}", "title": "" }, { "docid": "3a8a7653507092ccf4c555dfd62d4d26", "score": "0.57031447", "text": "function h$ghcjsbn_rem_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"rem_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"rem_bb b2\");\n var t1 = [], t2 = [];\n h$ghcjsbn_quotRem_bb(t1, t2, b1, b2);\n h$ghcjsbn_assertValid_b(t2, \"rem_bb result\");\n return t2;\n}", "title": "" }, { "docid": "3a8a7653507092ccf4c555dfd62d4d26", "score": "0.57031447", "text": "function h$ghcjsbn_rem_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"rem_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"rem_bb b2\");\n var t1 = [], t2 = [];\n h$ghcjsbn_quotRem_bb(t1, t2, b1, b2);\n h$ghcjsbn_assertValid_b(t2, \"rem_bb result\");\n return t2;\n}", "title": "" }, { "docid": "3a8a7653507092ccf4c555dfd62d4d26", "score": "0.57031447", "text": "function h$ghcjsbn_rem_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"rem_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"rem_bb b2\");\n var t1 = [], t2 = [];\n h$ghcjsbn_quotRem_bb(t1, t2, b1, b2);\n h$ghcjsbn_assertValid_b(t2, \"rem_bb result\");\n return t2;\n}", "title": "" }, { "docid": "3a8a7653507092ccf4c555dfd62d4d26", "score": "0.57031447", "text": "function h$ghcjsbn_rem_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"rem_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"rem_bb b2\");\n var t1 = [], t2 = [];\n h$ghcjsbn_quotRem_bb(t1, t2, b1, b2);\n h$ghcjsbn_assertValid_b(t2, \"rem_bb result\");\n return t2;\n}", "title": "" }, { "docid": "66b1bd2cb0d5ec19390ba0404ba682b6", "score": "0.5664347", "text": "function f1(b) {\n\t\tb[0] ^= b[2];\t\t\t/* X[1, 3]\t\t\t\t\t\t\t\t\t*/\n\t\tvar t = b[1];\n\t\tb[1] ^= b[3];\t\t\t/* X[2, 4]\t\t\t\t\t\t\t\t\t*/\n\t\tb[3] = b[2] ^ b[1];\t/* X[2, 3, 4]\t\t\t\t\t\t\t\t*/\n\t\tb[2] = b[0] ^ t;\t\t/* X[1, 2, 3]\t\t\t\t\t\t\t\t*/\n\t}", "title": "" }, { "docid": "27916fa38d7f04bba6bd16c4216a3d8e", "score": "0.5579933", "text": "function bigint_sub(base, rh) {\n var noborrow = true;\n for (var i = 0; i < base.length; i++) {\n var vc = full_add(base[i], ~rh[i] >>> 0, noborrow);\n base[i] = vc[0];\n noborrow = vc[1];\n }\n if (!noborrow) {\n throw new Error('noborrow');\n }\n}", "title": "" }, { "docid": "ab6ad6d4fe034e8509d58e775789dd5f", "score": "0.55585253", "text": "function opaqueAllTypesNegate(argument) {\n return -(argument);\n}", "title": "" }, { "docid": "bbfc70773dc59d2f0962ac100b52006d", "score": "0.5554512", "text": "function myxor(a,b) {\n return (a&&!b)||(!a && b);\n }", "title": "" }, { "docid": "e24411be9f09b0750368d085185eda0b", "score": "0.55446744", "text": "function equalConstTime(b1, b2) {\n if (b1.length !== b2.length) {\n return false;\n }\n var res = 0;\n for (var i = 0; i < b1.length; i++) {\n res |= b1[i] ^ b2[i]; // jshint ignore:line\n }\n return res === 0;\n}", "title": "" }, { "docid": "e24411be9f09b0750368d085185eda0b", "score": "0.55446744", "text": "function equalConstTime(b1, b2) {\n if (b1.length !== b2.length) {\n return false;\n }\n var res = 0;\n for (var i = 0; i < b1.length; i++) {\n res |= b1[i] ^ b2[i]; // jshint ignore:line\n }\n return res === 0;\n}", "title": "" }, { "docid": "3c0ee52083fce924fe86ae6cd4c1759f", "score": "0.55224353", "text": "function noPlus(a,b){\n\tif(b==0){\n\t\treturn a;\n\t\t}else{\n\t var ans = a^b;\n\t var car = (a&b) << 1;\n\t}\n\treturn noPlus(ans,car);\n}", "title": "" }, { "docid": "b62b031a5548439e90ad7fc8eebff4a1", "score": "0.5504761", "text": "function NAND(i1, i2) {\n if (i1 == false) return 1;\n if (i2 == false) return 1; \n return 0;\n }", "title": "" }, { "docid": "36163b8dfc57232c1f1a2c61ff1eac86", "score": "0.54790133", "text": "function h$ghcjsbn_xor_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"xor_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"xor_bb b2\");\n var i, lmin, lmax, blmax, l1 = b1[0], l2 = b2[0], t = [0];\n if(l1 <= l2) {\n lmin = l1;\n lmax = l2;\n blmax = b2;\n } else {\n lmin = l2;\n lmax = l1;\n blmax = b1;\n }\n for(i = 1; i <= lmin; i++) {\n t[i] = b1[i] ^ b2[i];\n }\n for(i = lmin + 1; i <= lmax; i++) {\n t[i] = blmax[i];\n }\n while(lmax > 0 && t[lmax] === 0) lmax--;\n t[0] = lmax;\n h$ghcjsbn_assertValid_b(t, \"xor_bb result\");\n return t;\n}", "title": "" }, { "docid": "36163b8dfc57232c1f1a2c61ff1eac86", "score": "0.54790133", "text": "function h$ghcjsbn_xor_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"xor_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"xor_bb b2\");\n var i, lmin, lmax, blmax, l1 = b1[0], l2 = b2[0], t = [0];\n if(l1 <= l2) {\n lmin = l1;\n lmax = l2;\n blmax = b2;\n } else {\n lmin = l2;\n lmax = l1;\n blmax = b1;\n }\n for(i = 1; i <= lmin; i++) {\n t[i] = b1[i] ^ b2[i];\n }\n for(i = lmin + 1; i <= lmax; i++) {\n t[i] = blmax[i];\n }\n while(lmax > 0 && t[lmax] === 0) lmax--;\n t[0] = lmax;\n h$ghcjsbn_assertValid_b(t, \"xor_bb result\");\n return t;\n}", "title": "" } ]
d68a5c9d8dd3d79d3eb62b7554150234
Bind the various events to the various DOM elements
[ { "docid": "9a2cf43b8ea38e089e4efe69928bc3ca", "score": "0.0", "text": "function setBindings() {\n if(AngularSlider.inputtypes.range) {\n // we're using range inputs\n\n /**\n * Bind the events necessary for a range input\n * @param {object} elem\n * @param {object} ptr\n * @param {string} rf\n */\n function bindSlider(elem, ptr, rf) {\n\n // make sure the element has all the methods and properties we'll need\n elem = angularize(elem);\n\n /**\n * Start event\n * @param {event} ev\n */\n function start(ev) {\n onStart(ev, ptr, rf);\n }\n\n /**\n * End event\n * @param {event} ev\n */\n function end(ev) {\n onMove(ev);\n onEnd();\n }\n\n // bind events to the range input\n\t\t\t\t\t\t\t\t\t\t\t$swipe.bind(elem, {\n\t\t\t\t\t\t\t\t\t\t\t\tstart : start,\n\t\t\t\t\t\t\t\t\t\t\t\tmove : onMove,\n\t\t\t\t\t\t\t\t\t\t\t\tend : end,\n\t\t\t\t\t\t\t\t\t\t\t\tcancel: onEnd\n\t\t\t\t\t\t\t\t\t\t\t});\n }\n\n // bind the events to the low value range input\n bindSlider(refs.minInput, refs.minPtr, refLow);\n\n if(isDualKnob) {\n // bind the events to the high value range input\n bindSlider(refs.maxInput, refs.maxPtr, refHigh);\n // bind the events to the selection bar range input\n bindSlider(refs.selInput, refs.selBar, refSel);\n }\n } else {\n // we're using normal DOM elements\n\n /**\n * Start event\n * @param {object} elem\n * @param {string} rf\n * @param {object} [ptr]\n */\n function bindSwipeStart(elem, rf, ptr) {\n\n // make sure the element has all the methods and properties we'll need\n elem = angularize(elem);\n\n // if no pointer reference is supplied, reference the element given\n if(angular.isUndefined(ptr)) {\n ptr = elem;\n } else {\n ptr = angularize(ptr);\n }\n\n // bind the swipe start event to the element\n $swipe.bind(elem, {\n start: function(ev) {\n onStart(ev, ptr, rf);\n }\n });\n }\n\n /**\n * Move event\n * @param {object} elem\n */\n function bindSwipe(elem) {\n\n // make sure the element has all the methods and properties we'll need\n elem = angularize(elem);\n\n // bind the swipe move, end, and cancel events\n $swipe.bind(elem, {\n move : onMove,\n end : function(ev) {\n onMove(ev);\n onEnd();\n },\n cancel: onEnd\n });\n }\n\n // bind the common events to the various common elements\n bindSwipe($document);\n bindSwipeStart(refs.minPtr, refLow);\n bindSwipeStart(refs.lowBub, refLow);\n bindSwipeStart(refs.flrBub, refLow, refs.minPtr);\n if(isDualKnob) {\n // bind the dual knob specific events to the dual knob specific elements\n bindSwipeStart(refs.maxPtr, refHigh);\n bindSwipeStart(refs.highBub, refHigh);\n bindSwipeStart(refs.ceilBub, refHigh, refs.maxPtr);\n bindSwipeStart(refs.selBar, refSel);\n bindSwipeStart(refs.selBub, refSel, refs.selBar);\n bindSwipeStart(refs.unSelBarLow, refLow, refs.minPtr);\n bindSwipeStart(refs.unSelBarHigh, refHigh, refs.maxPtr);\n } else {\n // bind the single knob specific events to the single knob specific elements\n bindSwipeStart(refs.ceilBub, refLow, refs.minPtr);\n bindSwipeStart(refs.fullBar, refLow, refs.minPtr);\n }\n }\n }", "title": "" } ]
[ { "docid": "b6f4b1dd4977b3d83412ca1f6f2acaaa", "score": "0.76979876", "text": "function bindEvents(){\n\t\t\n\t\t$(document).on(\"click\",\".item_tag\",function(e){\n\t\t\n\t\t\tdisplayItems($(e.target));\n\t\t\t\n\t\t});\n\t\t\n\t\t\n\t\t$(document).on(\"click\",\".item\",function(e){\n\t\t\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\taddItem($(e.target));\n\t\t\n\t\t});\n\t\t\n\t\t\n\t\t$(document).on(\"click\",\".selected_item\",function(e){\n\t\t\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\tremoveItem($(e.target));\n\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "d1d33a18444c7edf94d217592b039d14", "score": "0.72224885", "text": "bindDOMElements() {\n this.$container.find('.item').on('click', this.onMenuItemClick.bind(this));\n\n if( !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n this.$container.find('.item').on('mouseover', this.onMenuItemMouseOver.bind(this));\n this.$container.find('.item').on('mouseout', this.onMenuItemMouseOut.bind(this));\n }\n\n this.$container.find('.submenu').on('click', this.onSubMenuContainerClick.bind(this));\n }", "title": "" }, { "docid": "f6f551d4b18367b1a9feb8306c972e9b", "score": "0.7205696", "text": "function bindEvents() {\n if (that._elements[\"previous\"]) {\n that._elements[\"previous\"].addEventListener(\"click\", function() {\n navigate(getPreviousIndex());\n });\n }\n\n if (that._elements[\"next\"]) {\n that._elements[\"next\"].addEventListener(\"click\", function() {\n navigate(getNextIndex());\n });\n }\n\n var indicators = that._elements[\"indicator\"];\n if (indicators) {\n for (var i = 0; i < indicators.length; i++) {\n (function(index) {\n indicators[i].addEventListener(\"click\", function(event) {\n navigateAndFocusIndicator(index);\n });\n })(i);\n }\n }\n\n if (that._elements[\"pause\"]) {\n if (that._properties.autoplay) {\n that._elements[\"pause\"].addEventListener(\"click\", onPauseClick);\n }\n }\n\n if (that._elements[\"play\"]) {\n if (that._properties.autoplay) {\n that._elements[\"play\"].addEventListener(\"click\", onPlayClick);\n }\n }\n\n that._elements.self.addEventListener(\"keydown\", onKeyDown);\n\n if (!that._properties.autopauseDisabled) {\n that._elements.self.addEventListener(\"mouseenter\", onMouseEnter);\n that._elements.self.addEventListener(\"mouseleave\", onMouseLeave);\n }\n }", "title": "" }, { "docid": "1824743d2c5695a5913aceeb858ff0b4", "score": "0.70269716", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(e.target);\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", onClick(documentClick));\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"mousedown\", onClick(self.open));\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"mousedown\", onClick(selectDate));\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return e.target.select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"mousedown\", onClick(function (e) {\n updateTime(e);\n triggerChange();\n }));\n }\n }\n }", "title": "" }, { "docid": "110dc42fa403bff323e00ea6694b82e8", "score": "0.7017081", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(getEventTarget(e));\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"click\", documentClick);\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"click\", onMonthNavClick);\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"click\", selectDate);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return getEventTarget(e).select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"click\", timeIncrement);\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"click\", function (e) {\n updateTime(e);\n triggerChange();\n });\n }\n }\n if (self.config.allowInput)\n bind(self._input, \"blur\", onBlur);\n }", "title": "" }, { "docid": "2f95572ea4a936f41bbdcd077395afa5", "score": "0.70043004", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(e.target);\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", onClick(documentClick));\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"mousedown\", onClick(self.open));\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"mousedown\", onClick(selectDate));\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return e.target.select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"mousedown\", onClick(function (e) {\n updateTime(e);\n triggerChange();\n }));\n }\n }\n }", "title": "" }, { "docid": "2f95572ea4a936f41bbdcd077395afa5", "score": "0.70043004", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(e.target);\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", onClick(documentClick));\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"mousedown\", onClick(self.open));\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"mousedown\", onClick(selectDate));\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return e.target.select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"mousedown\", onClick(function (e) {\n updateTime(e);\n triggerChange();\n }));\n }\n }\n }", "title": "" }, { "docid": "2f95572ea4a936f41bbdcd077395afa5", "score": "0.70043004", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(e.target);\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", onClick(documentClick));\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"mousedown\", onClick(self.open));\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"mousedown\", onClick(selectDate));\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return e.target.select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"mousedown\", onClick(function (e) {\n updateTime(e);\n triggerChange();\n }));\n }\n }\n }", "title": "" }, { "docid": "2f95572ea4a936f41bbdcd077395afa5", "score": "0.70043004", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(e.target);\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", onClick(documentClick));\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"mousedown\", onClick(self.open));\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"mousedown\", onClick(selectDate));\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return e.target.select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"mousedown\", onClick(function (e) {\n updateTime(e);\n triggerChange();\n }));\n }\n }\n }", "title": "" }, { "docid": "45f1f1e2c22d5a1055a0a6bf35a0602b", "score": "0.69883114", "text": "@autobind\n initEvents() {\n $(document).on('intro', this.triggerIntro);\n $(document).on('instructions', this.triggerInstructions);\n $(document).on('question', this.triggerQuestion);\n $(document).on('submit_query', this.triggerSubmitQuery);\n $(document).on('query_complete', this.triggerQueryComplete);\n $(document).on('bummer', this.triggerBummer);\n }", "title": "" }, { "docid": "5f95f9a83c50fd444916867168b86858", "score": "0.6981436", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(getEventTarget(e));\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"click\", documentClick);\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"click\", onMonthNavClick);\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"click\", selectDate);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return getEventTarget(e).select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"click\", timeIncrement);\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"click\", function (e) {\n updateTime(e);\n triggerChange();\n });\n }\n }\n if (self.config.allowInput)\n bind(self._input, \"blur\", onBlur);\n }", "title": "" }, { "docid": "96a17e5abd136a4718d503fad4b7b7a0", "score": "0.6971559", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(getEventTarget(e));\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", documentClick);\n bind(window.document, \"focus\", documentClick, {capture: true});\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"click\", onMonthNavClick);\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"click\", selectDate);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return getEventTarget(e).select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, {capture: true});\n bind(self.timeContainer, \"click\", timeIncrement);\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () {\n return self.secondElement && self.secondElement.select();\n });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"click\", function (e) {\n updateTime(e);\n triggerChange();\n });\n }\n }\n if (self.config.allowInput) {\n bind(self._input, \"blur\", onBlur);\n }\n }", "title": "" }, { "docid": "c48a9b6a02a28df1a070a38cc937516c", "score": "0.6969854", "text": "_bindEvents() {\n // Bind document click event to close dropdown\n document.addEventListener('click', this._onDocumentClick);\n\n // Bind event handlers to orginal input\n this.element.addEventListener('change', this._onOriginalInputChange);\n\n // Bind event handlers to internal input\n this.input.addEventListener('input', this._onInputChange);\n this.input.addEventListener('click', this._onInputClick);\n this.input.addEventListener('keydown', this._onInputKeyDown);\n this.input.addEventListener('keypress', this._onInputKeyPress);\n this.input.addEventListener('focusout', this._onInputFocusOut);\n this.input.addEventListener('focusin', this._onInputFocusIn);\n }", "title": "" }, { "docid": "ab94d5fcb7f9d634a65cc0763f41958a", "score": "0.6964574", "text": "bindEvents() {\n }", "title": "" }, { "docid": "104e92f09d27041b8c5cb0b2fa1d5107", "score": "0.6964435", "text": "bindEvents() {\n document\n .getElementById(\"allButton\")\n .addEventListener(\"click\", amiiboCards.renderAllAmiibo.bind(amiiboCards));\n document\n .getElementById(\"haveButton\")\n .addEventListener(\n \"click\",\n amiiboCards.renderCheckedAmiibo.bind(amiiboCards)\n );\n document\n .getElementById(\"needButton\")\n .addEventListener(\n \"click\",\n amiiboCards.renderUncheckedAmiibo.bind(amiiboCards)\n );\n document\n .getElementById(\"sort\")\n .addEventListener(\"change\", amiiboCards.sort.bind(amiiboCards));\n }", "title": "" }, { "docid": "d829aed479382b7eabc32626754a4a75", "score": "0.6957795", "text": "function _bindEvents() {\n _$sort.on(CFG.EVT.CLICK, _setSort);\n _$navbar.on(CFG.EVT.CLICK, _SEL_BUTTON, _triggerAction);\n _$search.on(CFG.EVT.INPUT, _updateSearch);\n _$clear.on(CFG.EVT.CLICK, _clearSearch);\n }", "title": "" }, { "docid": "d16a477caea59e8f22884cfea01f8acc", "score": "0.69359624", "text": "registerDomEvents() {/*To be overridden in sub class as needed*/}", "title": "" }, { "docid": "9aff20eedd218c80b4c799b32d9cc6dd", "score": "0.6930984", "text": "function bindEvents() {\n document.addEventListener('deviceready', onDeviceReady, false);\n\t\tdocument.addEventListener('click', onTrigger, false);\n\t\tdocument.addEventListener('change', onTrigger, false);\n\t\tdocument.addEventListener('keyup', onTrigger, false);\n }", "title": "" }, { "docid": "45f4d0250dc14fa7647b7b606e2c5c01", "score": "0.69204503", "text": "bindEvents() {\n this.node.addEventListener('change', this.update.bind(this));\n this.node.addEventListener('input', this.update.bind(this));\n this.node.addEventListener('click', this.update.bind(this));\n this.node.addEventListener('touchend', this.update.bind(this));\n this.node.addEventListener('keyup', this.update.bind(this));\n }", "title": "" }, { "docid": "88a5981c6eb818e8762ea6105a36bbbb", "score": "0.688483", "text": "function bindEvents(){\n document.querySelector('#pre').addEventListener('click', () => {\n handleTraversal(preorder)\n })\n document.querySelector('#in').addEventListener('click', () => {\n handleTraversal(inorder)\n })\n document.querySelector('#post').addEventListener('click', () => {\n handleTraversal(postorder)\n })\n }", "title": "" }, { "docid": "6c321119127b62c6d1f0091a160a492c", "score": "0.6880511", "text": "events() {\n \t\tthis.openButton.on(\"click\", this.openOverlay.bind(this));\n\t\tthis.closeButton.on(\"click\", this.closeOverlay.bind(this));\n\t\t// search window will be open by keybaord. \n\t\t $(document).on(\"keydown\", this.keyPressDispatcher.bind(this));\n\t\t// when use input data in search window, typingLogic method is called. \n\t\t// searchField is defined by constructor of this class.\n\t\t/* we can use $('#search-term), but accessing DOM is much slower than\n\t\t JavaScript(jQuery). So, we use a property of this class object. which is\n\t\t 'searchField'. This is same as #Search-term and defined by constructor. */\n \t\tthis.searchField.on(\"keyup\", this.typingLogic.bind(this));\n \t}", "title": "" }, { "docid": "19a05d83dd8e19dfed9a698760597440", "score": "0.6858026", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n\n if (self.isMobile) {\n setupMobile();\n return;\n }\n\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent)) bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\") onMouseOver(e.target);\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config[\"static\"]) bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined) bind(window.document, \"touchstart\", documentClick);else bind(window.document, \"mousedown\", onClick(documentClick));\n bind(window.document, \"focus\", documentClick, {\n capture: true\n });\n\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"mousedown\", onClick(self.open));\n }\n\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"mousedown\", onClick(selectDate));\n }\n\n if (self.timeContainer !== undefined && self.minuteElement !== undefined && self.hourElement !== undefined) {\n var selText = function selText(e) {\n return e.target.select();\n };\n\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, {\n capture: true\n });\n bind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined) bind(self.secondElement, \"focus\", function () {\n return self.secondElement && self.secondElement.select();\n });\n\n if (self.amPM !== undefined) {\n bind(self.amPM, \"mousedown\", onClick(function (e) {\n updateTime(e);\n triggerChange();\n }));\n }\n }\n }", "title": "" }, { "docid": "98caa5e530e5555f3bbec8ad0b3ee66d", "score": "0.68325967", "text": "function bindEvents() {\n\t\t\tif(options.selection.mode != null){\n\t\t\t\toverlay.observe('mousedown', mouseDownHandler);\t\t\t\t\n\t\t\t}\t\t\t\t\t\n\t\t\toverlay.observe('mousemove', mouseMoveHandler)\n\t\t\toverlay.observe('click', clickHandler)\n\t\t}", "title": "" }, { "docid": "50f9dd00da03c9b6f1f9d3bc26db79ee", "score": "0.6829172", "text": "_addEventListeners() {\n this.el.addEventListener('click', this._onClickBound);\n this.el.addEventListener('keydown', this._onKeydownBound);\n }", "title": "" }, { "docid": "f25baa404bee0e794062a98a8df12500", "score": "0.6792824", "text": "function attachEventHandlers() {\n // TODO arrow: attach events for functionality like in assignment-document described\n var clicked;\n $(\"#\"+_this.id).click(function(event){\n clicked = true;\n diagram.selectArrow(_this);\n });\n $(\"#\"+_this.id).contents().on(\"dblclick contextmenu\", function(event){\n clicked = true;\n event.preventDefault();\n });\n\n // TODO arrow optional: attach events for bonus points for 'TAB' to switch between arrows and to select arrow\n $(\"#\"+_this.id).contents().attr(\"tabindex\",\"0\");\n\n $(\"#\"+_this.id).keydown(function(event){\n if(event.which == \"13\"){\n diagram.selectArrow(_this);\n }\n if(event.which == \"9\"){\n clicked = false;\n }\n })\n $(\"#\"+_this.id).contents().focusin(function(event){\n if(!clicked){\n setActive(true);\n }\n });\n $(\"#\"+_this.id).contents().focusout(function(event){\n setActive(false);\n });\n }", "title": "" }, { "docid": "95ed71c5d4bd46535f78d49d1794d465", "score": "0.67883724", "text": "function bindEventHandlers() {\r\n dom.mobileMenuIcon.on('click', mobileMenuIconClicked);\r\n dom.mobileMenuClose.on('click', mobileMenuCloseClicked)\r\n\t}", "title": "" }, { "docid": "a9c71c7436da4082fe6ee62f39b7ba89", "score": "0.67864466", "text": "function eventListeners(){\n changeOnButtonClicks();\n changeOnDotClicks();\n changeOnArrowKeys();\n changeOnAnnaLink();\n highlightDotsOnMouseover();\n highlightButtonsOnMouseover();\n highlightAnnaLinkOnMouseover();\n $(document).on(\"mousemove\", foregroundButtons);\n}", "title": "" }, { "docid": "c42d4b4f7c289e5f35d9dcdd3a43916e", "score": "0.6777908", "text": "function bindEvents() {\n if (options.dots) {\n var dotLinks = ML.nodeArr(el.querySelectorAll('.carousel-dots a'));\n\n dotLinks.forEach(function(item) {\n ML.El.evt(item, 'click', dotClick);\n });\n }\n\n ML.El.evt(nextButton, 'click', paginationClick);\n\n ML.El.evt(prevButton, 'click', paginationClick);\n\n if (options.touch) {\n ML.El.evt(ul, 'touchstart', dragStart);\n ML.El.evt(ul, 'touchend', dragEnd);\n ML.El.evt(ul, 'touchmove', dragAction);\n }\n\n if (options.arrowKeys) {\n // To prevent being bound more than once.\n if (!ML.El.isBound(document, 'keydown', 'paginationKeydown')) {\n ML.El.evt(document, 'keydown', paginationKeydown);\n }\n }\n }", "title": "" }, { "docid": "985529560c096e1ed6548e1294f484fc", "score": "0.67743826", "text": "function bindEvents() {\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('touchmove', onTouchMove);\n document.addEventListener('touchstart', onTouchMove);\n window.addEventListener('resize', onWindowResize);\n }", "title": "" }, { "docid": "bb7daa71234458a75d92f0b3d9d0403f", "score": "0.6765009", "text": "function bindEvents() {\n element.addEventListener(\"mousemove\", onMouseMove);\n element.addEventListener(\"touchmove\", onTouchMove, { passive: true });\n element.addEventListener(\"touchstart\", onTouchMove, { passive: true });\n window.addEventListener(\"resize\", onWindowResize);\n }", "title": "" }, { "docid": "3ceb1b1c3792fc9966160747c64d0981", "score": "0.675269", "text": "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "title": "" }, { "docid": "62bf88141963a7ebc4a8b33e04275af9", "score": "0.67389774", "text": "function bindEventHandlers () {\n $('#createHaiku').on('click', createHaiku);\n $('#clearOutput').on('click', clearOutput);\n }", "title": "" }, { "docid": "ad9e1a3de5ad0a570467b63573a7ca8a", "score": "0.67350185", "text": "function bindEvents() {\n\t\t\teManager.on('showForm', function() {\n\t\t\t\tshowForm();\n\t\t\t});\n\t\t\teManager.on('csvParseError', function() {\n\t\t\t\tshowError();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "571bdacd3298eeef507971d5331e9b36", "score": "0.6715863", "text": "function addEventListeners()\n\t{\n\t\t// window event\n\t\t$(window).resize(callbacks.windowResize);\n\t\t$(window).keydown(callbacks.keyDown);\n\t\t\n\t\t// click handler\n\t\t$(document.body).mousedown(callbacks.mouseDown);\n\t\t$(document.body).mouseup(callbacks.mouseUp);\n\t\t$(document.body).click(callbacks.mouseClick);\n\n\t\t$(document.body).bind('touchstart',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchstart(e);\n\t\t});\n\t\t$(document.body).bind('touchend',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchend(e);\n\t\t});\n\t\t$(document.body).bind('touchmove',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchmove(e);\n\t\t});\n\t\t\n\t\tvar container = $container[0];\n\t\tcontainer.addEventListener('dragover', cancel, false);\n\t\tcontainer.addEventListener('dragenter', cancel, false);\n\t\tcontainer.addEventListener('dragexit', cancel, false);\n\t\tcontainer.addEventListener('drop', dropFile, false);\n\t\t\n\t\t// GUI events\n\t\t$(\".gui-set a\").click(callbacks.guiClick);\n\t\t$(\".gui-set a.default\").trigger('click');\n\t}", "title": "" }, { "docid": "8672faaa08f9541c1c06ef60317aedef", "score": "0.671413", "text": "_bindEvents() {\n\t\t_.bindAll(\n\t\t\tthis,\n\t\t\t'_onClickPlay',\n\t\t\t'_onPlayerReceived',\n\t\t\t'_onInterval',\n\t\t\t'_onPlay',\n\t\t\t'_onPause',\n\t\t\t'_onEnded',\n\t\t\t'_onLoaded',\n\t\t\t'_onError',\n\t\t\t'_onReady'\n\t\t);\n\n\t\tthis.$el.on('click.' + this.options.eventNamespace, this.options.trigger, this._onClickPlay);\n\t}", "title": "" }, { "docid": "b1e33d3af3c1c92d535549582f7786d7", "score": "0.6709075", "text": "function bindEventHandlers() {\r\n\r\n\t\t\tif(o.buttons) {\r\n\t\t\t\t//add event handlers\r\n\t\t\t\t$nav.on({\r\n\t\t\t\t\t'click': doOnBtnClick,\r\n\t\t\t\t\t'slideChanged': doOnSlideChanged\r\n\t\t\t\t}, 'li');\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(o.arrows) {\r\n\t\t\t\t$prevArrow.on('click', function() {\r\n\t\t\t\t\tdoOnArrowClick(false);\r\n\t\t\t\t});\r\n\t\t\t\t$nextArrow.on('click', function() {\r\n\t\t\t\t\tdoOnArrowClick(true);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t//display/hide the navigation on $root hover\r\n\t\t\t$root.on({\r\n\t\t\t\t'mouseenter': doOnSliderMouseEnter,\r\n\t\t\t\t'mouseleave': doOnSliderMouseLeave\r\n\t\t\t});\r\n\r\n\t\t\t$(window).on('resize', function(){\r\n\t\t\t\tserSliderHeight(currentIndex);\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "c5b5b55d3a2f0138cabf5c502de99a7c", "score": "0.670561", "text": "_bindEvents() {\n this.$scope.on('change', this.checkbox, (event) => {\n this._toggleItem(event.target);\n });\n\n $('body').on('click', `[${this.compareRemove}]`, (event) => {\n const id = parseInt($(event.target).attr(this.compareRemove), 10);\n this._removeItem(id);\n\n return false;\n });\n }", "title": "" }, { "docid": "ad0eadf2f26f5e28c589aa26f9d36aeb", "score": "0.66950125", "text": "initEvents() {\n var self = this;\n\n $('#import-nodes-lists').on('click', 'li.import-node', self.nodeClicked.bind(self));\n $('#import-nodes-lists').on('click', '.import-node-remove', self.nodeRemoved.bind(self));\n $('#import-nodes-lists').on('click', '.import-node-edit', self.nodeEdit.bind(self));\n $('#import-nodes-lists').on('submit', '.import-node-form', self.nodeEdited.bind(self));\n $('#import-nodes-lists').on('focusout', '.import-node-form input', self.nodeEdited.bind(self));\n $('#import_send').click(self.submitNodes.bind(self));\n }", "title": "" }, { "docid": "27be7b33d1a7a3c81bc88a347e547eb3", "score": "0.66797763", "text": "function bindEvents() {\n for (var i=0; i < triggers.length; i++) {\n triggers[i].addEventListener('click', function(e) {\n var clickedEl = e.target; // clicked Element\n if (clickedEl.tagName === 'I') {\n clickedEl = clickedEl.parentNode;\n }\n e.preventDefault();\n setActivePanel(clickedEl);\n });\n } \n }", "title": "" }, { "docid": "57f214770f451b143a6ac7b2efdb228e", "score": "0.6671672", "text": "registerDomEvents() {\n\t\tgetComponentElementById(this,\"DataListSearchInput\").on(\"keyup\", function() {\n\t\t\tlet search_text = getComponentElementById(this,\"DataListSearchInput\").val();\n\t\t\tsetTimeout(function() {\n\t\t\t\tif (search_text == getComponentElementById(this,\"DataListSearchInput\").val()) {\n\t\t\t\t\tgetComponentElementById(this,\"DataList\").html(\"\");\n\t\t\t\t\tthis.current_page_array = [];\n\t\t\t\t\tthis.current_list_offset = 0;\n\t\t\t\t\tthis.loadPage();\n\t\t\t\t}\n\t\t\t}.bind(this),500);\n\t\t}.bind(this));\n\t\tgetComponentElementById(this,\"btnResetSearch\").on(\"click\", function() {\n\t\t\tgetComponentElementById(this,\"DataListSearchInput\").val(\"\");\n\t\t\tgetComponentElementById(this,\"DataList\").html(\"\");\n\t\t\tthis.current_page_array = [];\n\t\t\tthis.current_list_offset = 0;\n\t\t\tthis.loadPage();\n\t\t}.bind(this));\n\t\tgetComponentElementById(this,\"DataListMoreButton\").on(\"click\", function() {\n\t\t\tthis.current_list_offset += this.list_offset_increment;\n\t\t\tthis.loadPage();\n\t\t}.bind(this));\n\t\tthis.handleOnClassEvent(\"click\",\"data_list_item_\"+this.getUid(),\"_row_item_\",\"on_item_clicked\");\n\t}", "title": "" }, { "docid": "04f7ac5813c34938200c35c786d23ad6", "score": "0.6667471", "text": "function _bindEvents() {\r\n el.form.on('submit', _formHandler);\r\n el.email_input.on('focus', _resetErrors);\r\n }", "title": "" }, { "docid": "3cfe774d5a9dd5a4c899c26f5d93cfa0", "score": "0.66571033", "text": "initEvents() {\n this.root.querySelectorAll(this.options.buttonsSelector).forEach(\n button => {\n button.addEventListener(\n 'focus',\n event => this.focusButtonEventHandler(event)\n )\n\n button.addEventListener(\n 'click',\n event => this.clickButtonEventHandler(event)\n )\n\n button.addEventListener(\n 'keydown',\n event => this.keydownButtonEventHandler(event)\n )\n }\n )\n }", "title": "" }, { "docid": "ae28bac16e0c7fcb07823fa41c6bdb87", "score": "0.6641391", "text": "function bindEvents() {\n regenerateButton.addEventListener('click', generate);\n filledSquareProbabilityRange.addEventListener('change', onFilledSquareProbabilityRangeChange);\n fillSquaresCheckbox.addEventListener('change', onFillSquaresCheckboxChange);\n colourSelect.addEventListener('change', onColourChange);\n canvas.addEventListener('click', onCanvasClick);\n }", "title": "" }, { "docid": "b49d1f21ec306852a68aa2ae30b9e67e", "score": "0.663307", "text": "function _bindEventHandlers() {\n\t\t\n helper.bindEventHandlers();\n }", "title": "" }, { "docid": "f9e73d0b0850c9b2c63bbfcbf332e8fd", "score": "0.6607798", "text": "function initEvents () {\n\t\t\t$container.on(\"click\", \"a.ibm-twisty-trigger, span.ibm-twisty-head\", function (evt) {\n\t\t\t\tevt.preventDefault();\n\n\t\t\t\tvar $li = $(this).closest(\"li\");\n\n\t\t\t\ttoggle($li);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "406f18e3ada2f592e54e13f0190a991f", "score": "0.6600174", "text": "bindEvents() {\n cacheDOM.setButton.addEventListener(\"mousedown\", this.set.bind(this));\n cacheDOM.stopButton.addEventListener(\"mousedown\", this.stop.bind(this));\n cacheDOM.snoozeButton.addEventListener(\"mousedown\", this.snooze.bind(this));\n cacheDOM.minuteInc.addEventListener(\"mousedown\", this.incrementMin.bind(this));\n cacheDOM.minuteDec.addEventListener(\"mousedown\", this.decrementMin.bind(this));\n cacheDOM.hourInc.addEventListener(\"mousedown\", this.incrementHour.bind(this));\n cacheDOM.hourDec.addEventListener(\"mousedown\", this.decrementHour.bind(this));\n }", "title": "" }, { "docid": "910a95da3f84d85bf29ccb662feb9194", "score": "0.6573508", "text": "_initEvents () {\n this.el.addEventListener('click', (e) => {\n if (e.target.dataset.action in this.actions) {\n this.actions[e.target.dataset.action](e.target);\n } else this._checkForLi(e.target);\n });\n }", "title": "" }, { "docid": "176aa3734a52243af27ba5a29a4ebdbb", "score": "0.6571417", "text": "function _events () {\n _checkSubNav();\n $window.on('scroll', function () {\n _checkSubNav();\n });\n $window.on('resize', function () {\n _findMeasurements();\n })\n }", "title": "" }, { "docid": "3fdff785ff725646a49f9973276ebd17", "score": "0.65646297", "text": "function bindEvents() {\n var tabs = that._elements[\"tab\"];\n if (tabs) {\n for (var i = 0; i < tabs.length; i++) {\n (function(index) {\n tabs[i].addEventListener(\"click\", function(event) {\n navigateAndFocusTab(index);\n });\n tabs[i].addEventListener(\"keydown\", function(event) {\n onKeyDown(event);\n });\n })(i);\n }\n }\n }", "title": "" }, { "docid": "3fdff785ff725646a49f9973276ebd17", "score": "0.65646297", "text": "function bindEvents() {\n var tabs = that._elements[\"tab\"];\n if (tabs) {\n for (var i = 0; i < tabs.length; i++) {\n (function(index) {\n tabs[i].addEventListener(\"click\", function(event) {\n navigateAndFocusTab(index);\n });\n tabs[i].addEventListener(\"keydown\", function(event) {\n onKeyDown(event);\n });\n })(i);\n }\n }\n }", "title": "" }, { "docid": "a038a9ea9838cebc7b23aca29bc106ff", "score": "0.6558427", "text": "function bindEvents() {\n $(document).on('ready', onDocumentReady);\n }", "title": "" }, { "docid": "eed7b04e24ee94a40aaff7098ac8dbab", "score": "0.6552318", "text": "initClickHandlers() {\n this.domElements.tabSelected = $('.tabBars');\n this.domElements.containerSelected = $('.businessContainer');\n $('.eventsContainer').on('click', '.event', this.domClickHandler);\n $('.businessContainer').on('click', '.business', this.domClickHandler);\n $('.mapContainer').on('click', '.addLocation', this.addLocationClickHandler);\n $('.calculateRoute').on('click', this.apiList.map.calculateAndDisplayRoute);\n $('.tabContainer').on('click', '.tab', this.tabClickHandler);\n }", "title": "" }, { "docid": "0e8eb291fc93e9428540ab2296ac1e51", "score": "0.65492463", "text": "function BindElements() {\n $.BdgNS._pDiv = $('#ParentDIV');\n $.BdgNS._pDivHt = $.BdgNS._pDiv.height();\n $.BdgNS._pDivWd = $.BdgNS._pDiv.width();\n $.BdgNS._pDiv.find(\".dragImgClass\").MakeImgDragResize();\n $.BdgNS._pDiv.find(\".dragClass\").MakeDivDragResize();\n\n $.BdgNS._pDiv.on(\"click\", ResetOpacity)\n .on(\"click\", function () { $.BdgNS.actions.ResetImg($(this).find('.dragImgClass')); })\n .on(\"mousemove\", CrsrPosition)\n .on(\"mouseout\", function () { $(\"#dvPos\").html('0, 0'); });\n }", "title": "" }, { "docid": "1be7154bbbb3bc6ef695e960e3fabf6c", "score": "0.6536191", "text": "setEvents(){\n const listElements = this.el.childNodes;\n for(let i = 0; i < listElements.length; i++){\n listElements[i].addEventListener('mousedown',this.onItemClickedEvent,true);\n }\n }", "title": "" }, { "docid": "81f7e51bb8a705ce57e2e3ca3ffa358c", "score": "0.65331286", "text": "setEventListeners() {\n $('body').on('touchend click','.menu__option--mode',this.onModeToggleClick.bind(this));\n $('body').on('touchend',this.onTouchEnd.bind(this));\n this.app.on('change:mode',this.onModeChange.bind(this));\n this.app.on('show:menu',this.show.bind(this));\n this.book.on('load:book',this.setTitleBar.bind(this));\n this.book.on('pageSet',this.onPageSet.bind(this));\n this.tutorial.on('done',this.onTutorialDone.bind(this));\n }", "title": "" }, { "docid": "87258a0f5b38d896034e7ecea1b2c4b0", "score": "0.6529713", "text": "function bindEvents() {\n navCategory.on(\"click\", showCategoryNav);\n navCategory.on(\"mouseover\", showCategoryNav);\n $mobileMenuTrigger.on('click', onHamburgerClick);\n //$document.on(\"mouseup\", conditionallyCloseMenus);\n $header.on('mouseleave', hideCategoryNav);\n $search.on('click', expandSearch);\n $searchMobileContainer.on('click', expandSearch);\n $closeSearch.on('click', closeSearch);\n $footerHeadLinks.on('click', footerCategoryClick);\n\n window.addEventListener(\"pagehide\", resetMobileNav, false);\n }", "title": "" }, { "docid": "1b3a03ab474844c2fb6d448f19784682", "score": "0.6529385", "text": "function bindEvents() {\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('touchmove', onTouchMove);\n document.addEventListener('touchstart', onTouchMove);\n \n window.addEventListener('resize', onWindowResize);\n }", "title": "" }, { "docid": "e62e834cc2ae507bc595e8d3d57255ec", "score": "0.652657", "text": "function bindEvents(){\r\n\t\t//Move to next page button click\r\n\t\t$('.btn_continue').bind('click', function(){ \r\n\t\t\tvar nameVal = $(this).attr(\"name\");\r\n\t\t\tloadnextpage(nameVal); \r\n\t\t\treturn false;\r\n\t\t});\r\n\r\n\t\t$('.entertowin, #sorryRegister').bind('click', function(){\r\n\t\t\tloadnextpage('register'); \r\n\t\t\treturn false;\r\n\t\t});\r\n\r\n\t\t//Select Partners on Partners page\r\n\t\t$('#selectSix').bind('click', function(){\r\n\t\t\tpartnersSelect();\r\n\t\t\treturn false;\r\n\t\t});\r\n\t\t\r\n\t\t$('#double_down').bind('click', function(){\r\n\t\t\tloadnextpage('doubledown');\r\n\t\t\treturn false;\r\n\t\t});\r\n\r\n\t\t$('#keep_offer').bind('click', function(){\r\n\t\t\tloadnextpage('register');\r\n\t\t\treturn false;\r\n\t\t});\r\n\t\t\r\n\t\t$('.reset').bind('click', function(){\r\n\t\t\tresetGame(); \r\n\t\t\treturn false; \r\n\t\t});\r\n\t}", "title": "" }, { "docid": "659805c6c7e2e493cc4de1c6d3431a0f", "score": "0.65244865", "text": "bindEvents() {\n if (this._inputElement) {\n this._inputElement.addEventListener('blur', this.blurEventHandler.bind(this));\n this._inputElement.addEventListener('keyup', this.keyUpEventHandler.bind(this));\n }\n }", "title": "" }, { "docid": "b379df4bb059b72bf1e5a90089822db5", "score": "0.6513616", "text": "registerDomEvents() {\n\t\tgetComponentElementById(this,\"btnSave\").on(\"click\", function() {\n\t\t\tthis.saveEntity();\n\t\t}.bind(this));\n\n\t\tgetComponentElementById(this,\"btnDelete\").on(\"click\", function() {\n\t\t\tshowAlert(\"Are you sure?\",\"warning\",[\"Cancel\",\"Delete\"],false,0,this.deleteEntity.bind(this),this.doNothing);\n\t\t}.bind(this));\n\n\t}", "title": "" }, { "docid": "2e773e4cc3fd76afa8a47186d12d2399", "score": "0.65035236", "text": "function attachEvents() {\n var\n inputs = document.querySelectorAll('input'),\n\n i;\n\n // Input Elements Events Listeners\n for (i = 0; i < inputs.length; i = i + 1) {\n // if input element isn't the file chooser\n if (inputs[i].id !== 'picture_input') {\n // Validation Part\n inputs[i].addEventListener('input', checkEventElementValidity);\n inputs[i].addEventListener('blur', removeBorder);\n\n // Storage Part\n inputs[i].addEventListener('input', addElemValueToSessionStorage);\n // the input element is the file chooser \n } else {\n inputs[i].addEventListener('change', handleFileSelect);\n }\n }\n\n // Picture dnd Events Listeners\n picture_container.addEventListener('dragenter', dragEnterHandler);\n picture_container.addEventListener('drop', dropHandler);\n picture_container.addEventListener('dragover', dragOverHandler);\n picture_container.addEventListener('dragstart', dragStartHandler);\n }", "title": "" }, { "docid": "3e493825e032c0e139e90d6104b7d17b", "score": "0.6496357", "text": "listen() {\n [\"change\"].forEach(name => {\n this.el_.addEventListener(name, this.handler_, false)\n })\n }", "title": "" }, { "docid": "6b5a9b3173491870d796162dbe39a057", "score": "0.64723563", "text": "function addListeners() {\n //get the elements to add listener and change image\n let cardContainers = Array.from($(\".col-md-3\"));\n addEvents(cardContainers, 'image/jazz-music-rubber-duck.jpg', 'mouseover');\n addEvents(cardContainers, 'image/question.png', 'mouseout');\n }", "title": "" }, { "docid": "9a802e9786167aea869ea40bd7e4eed1", "score": "0.64652586", "text": "delegateEvents() {\n this._userEvent('beforeDelegateEvents');\n this._closeComponentsOnEsc();\n Object.keys(this.DOMEvents).forEach((key) => {\n const [, eventName, selectorString] = key.match(delegateEventSplitter);\n if (selectorString) {\n this._on(eventName, selectorString, (evt, target) => {\n this.DOMEvents[key].call(this, evt, target);\n });\n } else {\n this.wrapper.addEventListener('click', (evt) => {\n this.DOMEvents[key].call(this, evt);\n });\n }\n });\n this._userEvent('afterDelegateEvents');\n }", "title": "" }, { "docid": "ea7b8710a79e47099eb0cc589dff111d", "score": "0.6462986", "text": "addEventHandlers() {\n\n\t\tthis.elementConfig.addButton.on(\"click\",this.handleAdd);\n\t\tthis.elementConfig.cancelButton.on(\"click\",this.handleCancel);\n\t\tthis.elementConfig.retrieveButton.on(\"click\",this.retrieveData);\n\n\n\t}", "title": "" }, { "docid": "341a7aee1288745a860ccb968e318fb3", "score": "0.6456832", "text": "_bindEvents() {\n const thisObj = this;\n\n this._muteBtn\n .off()\n .on(\"click\", function () {\n if (thisObj._isMuted) {\n thisObj._unmute();\n } else {\n thisObj._mute();\n }\n });\n\n this._ackAllBtn\n .off()\n .on(\"click\", function () {\n if (!thisObj._ackAllBtn.hasClass(\"disabled\")) {\n thisObj.panelElem.trigger(NotifPanel.ACK_ALL_EVENT);\n }\n });\n\n this.bellElem\n .off()\n .on(\"click\", function () {\n thisObj._toggle();\n });\n }", "title": "" }, { "docid": "af079a915df204f3966820ef46d04ab3", "score": "0.64565545", "text": "function bindEventHandlers() {\n startEl.addEventListener(\"click\", startQuiz);\n submitEl.addEventListener(\"click\", saveScore);\n choice1El.addEventListener(\"click\", answerQuestion);\n choice2El.addEventListener(\"click\", answerQuestion);\n choice3El.addEventListener(\"click\", answerQuestion);\n choice4El.addEventListener(\"click\", answerQuestion);\n\n goBackBtnEl.addEventListener(\"click\", backtoStart);\n clearBtnEl.addEventListener(\"click\", clearHighscores);\n}", "title": "" }, { "docid": "c9c7140ee9dcf678852e8c76bfe1acee", "score": "0.6449722", "text": "wireEvent() {\n if (!isNullOrUndefined(this.selection)) {\n this.selection.initCaret();\n }\n this.wireInputEvents();\n if (!isNullOrUndefined(this.iframe)) {\n this.iframe.addEventListener('load', this.onIframeLoad);\n }\n this.viewerContainer.addEventListener('scroll', this.scrollHandler);\n this.viewerContainer.addEventListener('mousedown', this.onMouseDownInternal);\n this.viewerContainer.addEventListener('keydown', this.onKeyDownInternal);\n this.viewerContainer.addEventListener('mousemove', this.onMouseMoveInternal);\n this.viewerContainer.addEventListener('contextmenu', this.onContextMenu);\n this.viewerContainer.addEventListener('dblclick', this.onDoubleTap);\n this.viewerContainer.addEventListener('mouseup', this.onMouseUpInternal);\n window.addEventListener('resize', this.onWindowResize);\n window.addEventListener('keyup', this.onKeyUpInternal);\n window.addEventListener('mouseup', this.onImageResizer);\n window.addEventListener('touchend', this.onImageResizer);\n this.viewerContainer.addEventListener('touchstart', this.onTouchStartInternal);\n this.viewerContainer.addEventListener('touchmove', this.onTouchMoveInternal);\n this.viewerContainer.addEventListener('touchend', this.onTouchUpInternal);\n if (navigator.userAgent.match('Firefox')) {\n this.viewerContainer.addEventListener('DOMMouseScroll', this.zoomModule.onMouseWheelInternal);\n }\n this.viewerContainer.addEventListener('mousewheel', this.zoomModule.onMouseWheelInternal);\n }", "title": "" }, { "docid": "58a647f97d69ee91e82d81e5cf60b2aa", "score": "0.6441666", "text": "_events() {\n var _this = this;\n this._pauseEvents();\n if(this.hasNested){\n this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound);\n }else{\n this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound);\n\t this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound);\n }\n this.isOn = true;\n }", "title": "" }, { "docid": "dff2d6a95256f033b4a8e387336e29fa", "score": "0.64248353", "text": "_addEventListeners() {\n\n this.el.addEventListener('click', this._onClickBound);\n window.addEventListener('scroll', this._onScrollBound);\n window.addEventListener('orientationchange', this._onScrollBound);\n document.addEventListener('spark.visible-children', this._onVisibleBound, true);\n\n if (canObserve)\n this._addMutationObserver();\n else\n window.addEventListener('resize', this._onResizeBound, false);\n }", "title": "" }, { "docid": "d35a6865ba84a9be2f351c081821ac79", "score": "0.6419048", "text": "_bindEvents() {\n document.addEventListener('keydown', this._keydownHandler.bind(this), false);\n document.addEventListener('keyup', this._keyupHandler.bind(this), false);\n }", "title": "" }, { "docid": "35fba6be69639194e9cc7d3bc0e9fe8e", "score": "0.6417961", "text": "_setupListeners() {\n this._handleWindowClick = this._handleWindowClickH.bind(this);\n document.addEventListener('click', this._handleWindowClick);\n this._handleResize = debounce(this._handleResizeH.bind(this), 100);\n window.addEventListener('resize', this._handleResize);\n this._handleKeyDown = this._handleKeyDownH.bind(this);\n this.el.addEventListener('keydown', this._handleKeyDown);\n this._handleFocus = this._handleFocusH.bind(this);\n document.addEventListener('focus', this._handleFocus, true);\n this._handleBlur = this._handleBlurH.bind(this);\n document.addEventListener('blur', this._handleBlur, true);\n this._handleVisibleChildren = this._handleVisibleChildrenH.bind(this);\n document.addEventListener('spark.visible-children', this._handleVisibleChildren, true);\n }", "title": "" }, { "docid": "68ec5c2b49590f0cd16b87df60c45e1b", "score": "0.64107585", "text": "function bindEvents() {\n\t\tself._handlers = [];\n\t\tself._animationLoop = [];\n\t\tif (self.config.wrap) {\n\t\t\t[\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n\t\t\t\tArray.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n\t\t\t\t\treturn bind(el, \"mousedown\", onClick(self[evt]));\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tif (self.isMobile) return setupMobile();\n\n\t\tself.debouncedResize = debounce(onResize, 50);\n\t\tself.triggerChange = function () {\n\t\t\ttriggerEvent(\"Change\");\n\t\t};\n\t\tself.debouncedChange = debounce(self.triggerChange, 300);\n\n\t\tif (self.config.mode === \"range\" && self.daysContainer) bind(self.daysContainer, \"mouseover\", function (e) {\n\t\t\treturn onMouseOver(e.target);\n\t\t});\n\n\t\tbind(window.document.body, \"keydown\", onKeyDown);\n\n\t\tif (!self.config.static) bind(self._input, \"keydown\", onKeyDown);\n\n\t\tif (!self.config.inline && !self.config.static) bind(window, \"resize\", self.debouncedResize);\n\n\t\tif (window.ontouchstart !== undefined) bind(window.document, \"touchstart\", documentClick);\n\n\t\tbind(window.document, \"mousedown\", onClick(documentClick));\n\t\tbind(self._input, \"blur\", documentClick);\n\n\t\tif (self.config.clickOpens === true) {\n\t\t\tbind(self._input, \"focus\", self.open);\n\t\t\tbind(self._input, \"mousedown\", onClick(self.open));\n\t\t}\n\n\t\tif (!self.config.noCalendar) {\n\t\t\tself.monthNav.addEventListener(\"wheel\", function (e) {\n\t\t\t\treturn e.preventDefault();\n\t\t\t});\n\t\t\tbind(self.monthNav, \"wheel\", debounce(onMonthNavScroll, 10));\n\t\t\tbind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n\n\t\t\tbind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n\t\t\tbind(self.daysContainer, \"mousedown\", onClick(selectDate));\n\n\t\t\tif (self.config.animate) {\n\t\t\t\tbind(self.daysContainer, [\"webkitAnimationEnd\", \"animationend\"], animateDays);\n\t\t\t\tbind(self.monthNav, [\"webkitAnimationEnd\", \"animationend\"], animateMonths);\n\t\t\t}\n\t\t}\n\n\t\tif (self.config.enableTime) {\n\t\t\tvar selText = function selText(e) {\n\t\t\t\treturn e.target.select();\n\t\t\t};\n\t\t\tbind(self.timeContainer, [\"wheel\", \"input\", \"increment\"], updateTime);\n\t\t\tbind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n\n\t\t\tbind(self.timeContainer, [\"wheel\", \"increment\"], self.debouncedChange);\n\t\t\tbind(self.timeContainer, \"input\", self.triggerChange);\n\n\t\t\tbind([self.hourElement, self.minuteElement], \"focus\", selText);\n\n\t\t\tif (self.secondElement !== undefined) bind(self.secondElement, \"focus\", function () {\n\t\t\t\treturn self.secondElement.select();\n\t\t\t});\n\n\t\t\tif (self.amPM !== undefined) {\n\t\t\t\tbind(self.amPM, \"mousedown\", onClick(function (e) {\n\t\t\t\t\tupdateTime(e);\n\t\t\t\t\tself.triggerChange(e);\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "78d167412814500084cbcd85163ea41c", "score": "0.6400382", "text": "function bindEvents() {\n\t\tself._handlers = [];\n\t\tself._animationLoop = [];\n\t\tif (self.config.wrap) {\n\t\t\t[\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n\t\t\t\tArray.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n\t\t\t\t\treturn bind(el, \"mousedown\", onClick(self[evt]));\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tif (self.isMobile) return setupMobile();\n\n\t\tself.debouncedResize = debounce(onResize, 50);\n\t\tself.triggerChange = function () {\n\t\t\ttriggerEvent(\"Change\");\n\t\t};\n\t\tself.debouncedChange = debounce(self.triggerChange, 300);\n\n\t\tif (self.config.mode === \"range\" && self.daysContainer) bind(self.daysContainer, \"mouseover\", function (e) {\n\t\t\treturn onMouseOver(e.target);\n\t\t});\n\n\t\tbind(window.document.body, \"keydown\", onKeyDown);\n\n\t\tif (!self.config.static) bind(self._input, \"keydown\", onKeyDown);\n\n\t\tif (!self.config.inline && !self.config.static) bind(window, \"resize\", self.debouncedResize);\n\n\t\tif (window.ontouchstart !== undefined) bind(window.document, \"touchstart\", documentClick);\n\n\t\tbind(window.document, \"mousedown\", onClick(documentClick));\n\t\tbind(self._input, \"blur\", documentClick);\n\n\t\tif (self.config.clickOpens === true) bind(self._input, \"focus\", self.open);\n\n\t\tif (!self.config.noCalendar) {\n\t\t\tself.monthNav.addEventListener(\"wheel\", function (e) {\n\t\t\t\treturn e.preventDefault();\n\t\t\t});\n\t\t\tbind(self.monthNav, \"wheel\", debounce(onMonthNavScroll, 10));\n\t\t\tbind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n\n\t\t\tbind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n\t\t\tbind(self.daysContainer, \"mousedown\", onClick(selectDate));\n\n\t\t\tif (self.config.animate) {\n\t\t\t\tbind(self.daysContainer, [\"webkitAnimationEnd\", \"animationend\"], animateDays);\n\t\t\t\tbind(self.monthNav, [\"webkitAnimationEnd\", \"animationend\"], animateMonths);\n\t\t\t}\n\t\t}\n\n\t\tif (self.config.enableTime) {\n\t\t\tvar selText = function selText(e) {\n\t\t\t\treturn e.target.select();\n\t\t\t};\n\t\t\tbind(self.timeContainer, [\"wheel\", \"input\", \"increment\"], updateTime);\n\t\t\tbind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n\n\t\t\tbind(self.timeContainer, [\"wheel\", \"increment\"], self.debouncedChange);\n\t\t\tbind(self.timeContainer, \"input\", self.triggerChange);\n\n\t\t\tbind([self.hourElement, self.minuteElement], \"focus\", selText);\n\n\t\t\tif (self.secondElement !== undefined) bind(self.secondElement, \"focus\", function () {\n\t\t\t\treturn self.secondElement.select();\n\t\t\t});\n\n\t\t\tif (self.amPM !== undefined) {\n\t\t\t\tbind(self.amPM, \"mousedown\", onClick(function (e) {\n\t\t\t\t\tupdateTime(e);\n\t\t\t\t\tself.triggerChange(e);\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "4b490781261510bc023332f91a832537", "score": "0.6393832", "text": "_events() {\n this.$element.off('.zf.reveal').on({\n 'open.zf.reveal': this.open.bind(this),\n 'closed.zf.reveal': this.close.bind(this)\n });\n\n this.$insert.off('click').on({\n 'click': this.insert.bind(this)\n });\n\n this.$menu.off('click', '[data-name]').on({\n 'click': this._loadShortcode.bind(this)\n }, '[data-name]');\n\n this.$form.off('input change', ':input').on({\n 'input': this._loadPreview.bind(this),\n 'change': this._loadPreview.bind(this)\n }, ':input');\n }", "title": "" }, { "docid": "70de7ccd841faf390ad38fda1e8d3037", "score": "0.63924974", "text": "_events() {\n this._addKeyHandler();\n this._addClickHandler();\n this._setHeightMqHandler = null;\n\n if (this.options.matchHeight) {\n this._setHeightMqHandler = this._setHeight.bind(this);\n\n $(window).on('changed.zf.mediaquery', this._setHeightMqHandler);\n }\n\n if(this.options.deepLink) {\n $(window).on('popstate', this._checkDeepLink);\n }\n }", "title": "" }, { "docid": "5a15067f167eb0f9b065ecbecca47896", "score": "0.63903964", "text": "function bindEvents(){\n //Shows spinner loader on AJAX calls\n $(document).on({\n ajaxStart: function(){\n $('#loader').removeClass('hidden');\n $('body').addClass('loading');\n },\n ajaxStop: function(){ \n $('#loader').addClass('hidden');\n $('body').removeClass('loading');\n } \n });\n //bind events to the edit button.\n $('.btn-edit').on('click',(e) => {\n var data = JSON.parse($(e.currentTarget).parent().find('.inp_data').val());\n var dialogOptions = {\n dismissible: false\n };\n let dialog = new ItemEditDialog(dialogOptions, data);\n dialog.open();\n });\n //bind events to the delete button.\n $('.btn-delete').on('click', (e) => {\n var data = JSON.parse($(e.currentTarget).parent().find('.inp_data').val());\n var dialogOptions = {\n dismissible: false\n };\n let dialog = new ItemDeleteDialog(dialogOptions, data);\n dialog.open();\n });\n //binds events to the add button\n $('#btn_add').on('click', (e) => {\n var dialogOptions = {\n dismissible: false\n };\n let dialog = new ItemAddDialog(dialogOptions);\n dialog.open();\n });\n }", "title": "" }, { "docid": "f8e84abf41f790e145052eefe631557c", "score": "0.63882446", "text": "bindEvents() {\n this.node.addEventListener('rh-toggle', this.update.bind(this));\n }", "title": "" }, { "docid": "412213f34fdd52f5ecdc5bfb6dd33df3", "score": "0.638485", "text": "function assignEventListeners() {\n \tpageElements.output.addEventListener('click', editDelete, false);\n \t pageElements.authorSelect.addEventListener('change', dropDown, false);\n \t pageElements.tagSelect.addEventListener('change', dropDown, false);\n \t pageElements.saveBtn.addEventListener('click', saveAction ,false);\n \t pageElements.addBtn.addEventListener('click', addAction, false);\n \t pageElements.getAllBtn.addEventListener('click', getAll, false);\n \t pageElements.deleteBtn.addEventListener('click', deleteIt, false);\n }", "title": "" }, { "docid": "4086e2ee9118abfd523104e3fac2b51c", "score": "0.6374633", "text": "function setupListeners() {\n // handle mouse down and mouse move\n el.on('mousedown touchstart', handleMouseDown);\n\n // handle mouse up\n pEl.on('mouseup touchend', handleMouseUp);\n\n // handle window resize\n $(win).resize(handleWindowResize);\n\n $('body').on(opts['namespace'] + '-neighbour-resized', function(e) {\n if (e.target !== el[0]) {\n handleNeighbourSplitter();\n }\n });\n\n // destory, cleanup listeners\n scope.$on('$destroy', function() {\n el.off('mousedown touchstart', handleMouseDown);\n pEl.off('mouseup touchend', handleMouseUp);\n $(win).off('resize', handleWindowResize);\n });\n }", "title": "" }, { "docid": "eda7623bda10f2e6f558abca09164d5a", "score": "0.63635856", "text": "function attachEventHandlers() {\n // TODO device: attach context menu to device (call showContextMenu() in model-diagram.js if context menu is called)\n $(\"#\"+title).contextmenu(function(ev){\n diagram.showContextMenu(_this, ev);\n });\n // TODO device: attach events for functionality like in assignment-document described\n $(\"#\"+title).mousedown(function(event){\n return false;\n });\n $(\"#\"+title).click(function(event){\n diagram.deviceMouseDown(_this);\n });\n\n $(\"#\"+title).dblclick(function(event) {\n alert(name[type] +\" \"+ index);\n });\n\n $(\"#\"+title).keydown(function(event){\n if(event.which == \"13\"){\n diagram.deviceMouseDown(_this);\n }\n });\n\n var x = $(\"#arrow-device-add-reference\").clone();\n x.attr(\"id\", \"arrow-symbol-\"+ title);\n $(\"#\"+title).append(x);\n $(\"#\"+title).hover(function(event){\n if($(window).width() >= 768){\n x.attr(\"style\", \"display: block;\");\n }\n }, function(event){\n x.attr(\"style\", \"display: none;\");\n });\n x.click(function(event){\n diagram.toggleArrowActive();\n });\n\n $(\"#\"+title).removeClass('ui-draggable-dragging');\n\n // TODO device: attach drag & drop functionality\n $(\"#\"+title).draggable({\n start: function(event){\n if($(window).width() <= 767){\n return false;\n }\n },\n containment: diagram.area,\n drag: function(event){\n moveDevice();\n }\n });\n\n\n // TODO device optional: attach events for bonus points for 'Tab' and 'Enter'\n $(\"#\"+_this.title).attr(\"tabindex\",\"0\");\n }", "title": "" }, { "docid": "805a1a5ca80a77c68b56c3ec31d23cbc", "score": "0.63615763", "text": "function bindEvents (vDom, D) {\n\n var vType = getType(vDom)\n var vNode\n var evts\n var evt\n var child\n var children\n\n if (vType === VATOM || vType === VNULL) { return }\n\n vNode = vType === VCHILD ? vDom[2] : vDom\n evts = vNode[1][ON]\n children = vNode[2]\n\n if (evts) {\n for (evt in evts) {\n D.addEventListener(evt, evts[evt])\n }\n }\n\n if (children) {\n for (child = 0; child < children.length; child++) {\n bindEvents(children[child], D.childNodes[child])\n }\n }\n}", "title": "" }, { "docid": "1582abc63fb167ec50783cf871849a0b", "score": "0.63596827", "text": "function bindEvents() {\n DOM.window.on('scroll', windowOnScroll)\n }", "title": "" }, { "docid": "dfc7df58a9bd29c65a7c690fd6c513a9", "score": "0.6358992", "text": "function setupEventHandlers() {\n\t// menus\n\t$(\"#menu_nav\").on(\"click\", onClickHandlerMainMenu);\n\t$(\"#menu_lang\").on(\"click\", onClickHandlerMainMenu);\n\t$(\"#menu_footer\").on(\"click\", onClickHandlerMainMenu);\n\t$('#campanya').hover( hoverOverSub, hoverOutSub );\n\t$('#idioma').hover( hoverOverSub, hoverOutSub );\n\n\t$('.submenu>li').hover(hoverOverSubelement,hoverOutSubelement);\n\n\t$('.photo_link').hover( hoverOverPhoto, hoverOutPhoto );\n\t$(\"#sec_aniversary\").on(\"click\", onClickHandlerAniversary);\n\t$('#sec_aniversary').bind('scroll', switchYears );\n\n\t$(\"#sec_novedades .buttons_container\").on(\"click\", onButtonClickHandler );\n\t$(\"#sec_business .buttons_container\").on(\"click\", onButtonClickHandler );\n\n\t$('#sec_descargas li').hover( hoverOverDownload, hoverOutDownload );\n\t//ACCION CERRAR GALERIA\n\t$('#pane_wrapper').click(function(){\n\t\t$(this).fadeOut(300,function(){\n\t\t\tunPanIt();\n\t\t\t$('#pane_wrapper').css('top','58px');\n\t\t\t$('#pane_wrapper').css('bottom','22px');\n\t\t\t$('#outer_container #pan_container').html('');\n\t\t\t$(this).css('zIndex','1');\n\t\t});\n\t});\n}", "title": "" }, { "docid": "36cde72b79787000ec78ec4232811a9f", "score": "0.63533705", "text": "_createControls() {\n if (this._leftControl) {\n this._leftControl\n .addEventListener('click', () => this._leftMoveHandler());\n }\n if (this._rightControl) {\n this._rightControl\n .addEventListener('click', () => this._rightMoveHandler());\n }\n if (this._settings.swipes) {\n this._itemsHolder\n .addEventListener('pointerdown', event => this._pointerDownHandler(event));\n }\n if (this._relatedSliders.length > 0) {\n this._container.addEventListener('moveRelatedLeft', () => this._moveRelatedLeftHandler());\n this._container.addEventListener('moveRelatedRight', () => this._moveRelatedRightHandler());\n }\n }", "title": "" }, { "docid": "983a0414c0ff794cde231ec26e0bbf21", "score": "0.6347778", "text": "_events() {\n this._linkClickListener = this._handleLinkClick.bind(this);\n this.$element.on('click.zf.smoothScrollWithLinks', 'a[href*=\"#\"]', this._linkClickListener);\n }", "title": "" }, { "docid": "f8f4bcaded887ecc6c45a19c68670880", "score": "0.63429487", "text": "_events() {\n var _this = this;\n\n this._updateMqHandler = this._update.bind(this);\n\n $(window).on('changed.zf.mediaquery', this._updateMqHandler);\n\n this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this));\n }", "title": "" }, { "docid": "2b18066237d19818729da2bcc954ceac", "score": "0.6340232", "text": "_bindMouseAndTouchEvents() {\n var self = this;\n\n /* Mouse events */\n this._element.addEventListener(\"mousedown\", (ev) => {\n self._onMouseDown(ev);\n }, false);\n this._element.addEventListener(\"mouseup\", (ev) => {\n self._onMouseUp(ev);\n }, false);\n this._element.addEventListener(\"mouseleave\", (ev) => {\n self._onMouseUp(ev);\n }, false);\n this._element.addEventListener(\"mousemove\", (ev) => {\n self._onMouseMove(ev);\n }, false);\n\n /* Scroll event */\n this._element.addEventListener(\"wheel\", (ev) => {\n self._onWheel(ev);\n }, false);\n\n /* Touch events */\n this._element.addEventListener(\"touchstart\", (ev) => {\n self._onTouchStart(ev);\n }, false);\n this._element.addEventListener(\"touchend\", (ev) => {\n self._onTouchEnd(ev);\n }, false);\n this._element.addEventListener(\"touchmove\", (ev) => {\n self._onTouchMove(ev);\n }, false);\n\n /* Context menu event, this will cause the context menu\n to no longer pop up on right clicks. */\n this._element.oncontextmenu = (ev) => {\n ev.preventDefault();\n return false;\n }\n }", "title": "" }, { "docid": "80a99f1ced2d03e7222f843366c1d693", "score": "0.633308", "text": "function swatchEvents () {\n var $swatchCell = $( \".swatchCell\" );\n $swatchCell.on('click', selectSwatch);\n }", "title": "" }, { "docid": "309a89f6086b4090f44abbad526a2a7c", "score": "0.6319086", "text": "function getEventListeners() {\n $(\"#task-input\").on(\"click\", \"#submit-task\", initialpostTask);\n $(\"#completed-task-home\").on(\"click\", \".status\", putStatusUpdate);\n $(\"#completed-task-home\").on(\"click\", \".delete\", deleteTask);\n $(\"#completed-task-home\").on(\"click\", \".update\", checkStringLength);\n $(\"#incompleted-task-home\").on(\"click\", \".status\", putStatusUpdate);\n $(\"#incompleted-task-home\").on(\"click\", \".delete\", deleteTask);\n $(\"#incompleted-task-home\").on(\"click\", \".update\", checkStringLength);\n animations();\n}", "title": "" }, { "docid": "d202820153a98d2678451e1e1bb81a3e", "score": "0.63092613", "text": "function _events () {\n if ($overlayTrigger !== undefined) {\n $overlayTrigger.on('click', function (e) {\n e.preventDefault();\n $overlay = $('#' + $overlayTrigger.data('overlaytarget'));\n $overlayCloseButton = $overlay.find('.js-overlay-close');\n _openOverlay();\n }); \n }\n if ($overlayCloseButton !== undefined) {\n $overlayCloseButton.on('click', function (e) {\n e.preventDefault();\n $overlay = $(this).parents('.overlay');\n _closeOverlay();\n });\n }\n\n }", "title": "" }, { "docid": "ac695150a7446d297fcf1a47654c3fee", "score": "0.63069105", "text": "function addclickEvents(){\n document.getElementById(\"flask\").addEventListener(\"click\", function() {\n callFlask();\n }, false);\n document.getElementById(\"magnet\").addEventListener(\"click\", function() {\n \tcallMagnet();\n }, false);\n document.getElementById(\"heater_button\").addEventListener(\"click\", function() {\n \tcallHeater();\n }, false);\n document.getElementById(\"stir_button\").addEventListener(\"click\", function() {\n \tcallStir();\n }, false);\n document.getElementById(\"pipette\").addEventListener(\"click\", function() {\n \tcallPipette();\n }, false);\n}", "title": "" }, { "docid": "da923b862ad0ac7368e548bb7439632d", "score": "0.63044536", "text": "addEventListeners(){\n\t\tif(!this.document) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._triggerEvent = this.triggerEvent.bind(this);\n\n\t\tDOM_EVENTS.forEach(function(eventName){\n\t\t\tthis.document.addEventListener(eventName, this._triggerEvent, { passive: true });\n\t\t}, this);\n\n\t}", "title": "" }, { "docid": "ad25ab07c90b74bf9cdd75d67fd91ae7", "score": "0.6303686", "text": "_events() {\n this._eventsForHandle(this.$handle);\n if(this.handles[1]) {\n this._eventsForHandle(this.$handle2);\n }\n }", "title": "" }, { "docid": "83ad058dc0ba1facc1affafdb8dd4baf", "score": "0.6297278", "text": "attachEventListenersStaticElements(){\n domGetElementById(ids.IMAGE_TAB).addEventListener(\"click\", this.controllerEventHandler.viewImages);\n domGetElementById(ids.VIDEO_TAB).addEventListener(\"click\", this.controllerEventHandler.viewVideos);\n }", "title": "" }, { "docid": "2c7e4d80030d868baa80ffeed3219d3d", "score": "0.629704", "text": "function setEvents() {\n $(\".slidecontainer\").click(function () {\n var closing = this.variables.closed.get() === \"true\";\n closing = !closing;\n this.variables.closed.set(\"\" + closing);\n if (closing) {\n $(\".navbar\").collapse(\"hide\");\n $(\".slidecontainer\").removeClass(\"open\").addClass(\"closed\");\n $(\"#regionContainer\").css(\"margin-top\", \"6px\");\n } else {\n $(\".navbar\").collapse(\"show\");\n $(\".slidecontainer\").removeClass(\"closed\").addClass(\"open\");\n $(\"#regionContainer\").css(\"margin-top\", \"93px\");\n }\n\n return false;\n }.bind(this));\n\n $(\".sort\").on(\"click\", function (e) {\n var rawid = e.target.id;\n var id = rawid.replace(/Sort$/, \"\");\n var $btn = $('#' + rawid);\n var measure = $btn.data('measure');\n \n this.variables.sort.set(measure);\n $(\".sort\").removeClass(\"fa-sort-amount-desc\");\n $btn.addClass(\"fa-sort-amount-desc\");\n\n // Clear elements\n $(\".vmChart\").remove();\n // Request new elements\n getTopTenants.call(this);\n }.bind(this));\n }", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.6295806", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.6295806", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.6295806", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.6295806", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.6295806", "text": "function EventHandlers() {}", "title": "" } ]
c221794ad6e158ad798b56a956f3b580
PubSubClient class that initializes event handlers, connects to the server Login Options: username: xmpp account username (without domain) password: xmpp account password or nick: nick for anonymous login PUBSUB Options: node: the node to subscribe and listen for updates event_cb: callback fired when an event occurs in the subscribed node. Has entry with payload as first argument and PubSub object as second argument
[ { "docid": "c23dfd20c029b337e825d44f2171172b", "score": "0.6911592", "text": "function PubSubClient(options) {\n this.options = options;\n this.updates = new Array();\n var connection = null;\n if (typeof(options.jid) != 'undefined' && options.jid.length) {\n connection = this.attach(options.jid, options.rid, options.sid);\n }\n else {\n connection = this.connect(options.username, options.password);\n }\n\n $(window).blur(function(context) {\n return function() {\n context.focus = false;\n };\n }(this));\n\n $(window).focus(function(context) {\n return function() {\n context.focus = true;\n /* reset counter */\n context.unread = 0;\n };\n }(this));\n\n}", "title": "" } ]
[ { "docid": "b3efe2ca85972534063b45ff72120a01", "score": "0.6496762", "text": "function BasicPubSubClient(logLevel) {\n if (logLevel === void 0) { logLevel = logger_1.LogLevel.WARNING; }\n var _this = _super.call(this) || this;\n // topic => token\n _this._topics = new Map();\n _this._connecting = false;\n _this._connected = false;\n _this._manualDisconnect = false;\n _this._initialConnect = false;\n _this._onPong = _this.registerEvent();\n _this._onResponse = _this.registerEvent();\n /**\n * Fires when a message that matches your listening topics is received.\n *\n * @eventListener\n * @param topic The name of the topic.\n * @param message The message data.\n */\n _this.onMessage = _this.registerEvent();\n /**\n * Fires when the client finishes establishing a connection to the PubSub server.\n *\n * @eventListener\n */\n _this.onConnect = _this.registerEvent();\n /**\n * Fires when the client closes its connection to the PubSub server.\n *\n * @eventListener\n * @param isError Whether the cause of the disconnection was an error. A reconnect will be attempted if this is true.\n */\n _this.onDisconnect = _this.registerEvent();\n /**\n * Fires when the client receives a pong message from the PubSub server.\n *\n * @eventListener\n * @param latency The current latency to the server, in milliseconds.\n * @param requestTimestampe The time the ping request was sent to the PubSub server.\n */\n _this.onPong = _this.registerEvent();\n _this._logger = new logger_1.default({\n name: 'twitch-pubsub-client',\n minLevel: logLevel\n });\n return _this;\n }", "title": "" }, { "docid": "27af3af41ed6e0335cbb73f5bfe64cee", "score": "0.60161304", "text": "function pub_subscribe(){\n\t\tpubnub.subscribe({\n\t\t channel : \"smarthome_response\",\n\t\t message : function(m){\n\t\t console.log(m)\n\t\t message_notification(m);\n\t\t },\n\t\t error : function (error) {\n\t\t console.log(JSON.stringify(error));\n\t\t }\n\t\t});\n\t}", "title": "" }, { "docid": "d9b28b2363e3e412d4d0b0bc533a8ef7", "score": "0.59835446", "text": "function onConnect() {\n\t// Once a connection has been made, make a subscription and send a message.\n\tconsole.log(\"Connected (event 'onConnect')\" )\n\t\n\t//client.subscribe(\"World\");\n\tclient.subscribe(topicSUB, {qos: 0});\n}", "title": "" }, { "docid": "1c2da25b7ff0dd5d73ce98979ca5ac74", "score": "0.59223187", "text": "function publish() {\n\n pubnub = new PubNub({\n publishKey : 'demo',\n subscribeKey : 'demo'\n })\n\n function publishSampleMessage() {\n console.log(\"Since we're publishing on subscribe connectEvent, we're sure we'll receive the following publish.\");\n var publishConfig = {\n channel : \"hello_world\",\n message : \"Hello from PubNub Docs!\"\n }\n pubnub.publish(publishConfig, function(status, response) {\n console.log(status, response);\n })\n }\n\n pubnub.addListener({\n status: function(statusEvent) {\n if (statusEvent.category === \"PNConnectedCategory\") {\n publishSampleMessage();\n }\n },\n message: function(message) {\n console.log(\"New Message!!\", message);\n },\n presence: function(presenceEvent) {\n // handle presence\n }\n })\n console.log(\"Subscribing..\");\n pubnub.subscribe({\n channels: ['hello_world']\n });\n}", "title": "" }, { "docid": "bc08fba05d613881fa4f926734b91e03", "score": "0.59084064", "text": "function initPubNub(pubKey, subKey, uid, channel, username) {\n console.log(pubKey, subKey)\n pubNub = new PubNub({\n publishKey : pubKey,\n subscribeKey : subKey,\n uuid: uid,\n logVerbosity: true,\n ssl: true\n });\n\n//listens to the messages published by some client\n pubNub.addListener({\n status: function(statusEvent) {\n if (statusEvent.category === \"PNConnectedCategory\") {\n console.log('join success with UID: ' + UID);\n }\n },\n message: function(msg) {\n console.log(msg);\n if (msg.message.uuid != UID) {\n if(msg.message.description===\"remote user has shared screen\"){\n otherScreenShareActiveStatus();\n } else if(msg.message.description===\"remote user has stopped sharing screen\"){\n otherScreenShareInactiveStatus();\n } else{\n addRemoteMsg(msg.message.uuid, msg.message.description, msg.message.title);\n }\n } else {\n console.log('message sent successfully to channel');\n }\n },\n presence: function(presenceEvent) {\n // handle presence events\n console.log('presence event: ' + JSON.stringify(presenceEvent));\n }\n })\n console.log(\"Subscribing..\");\n\n // subscribe a pubNub Channel using the same name as our video chat\n pubNub.subscribe({\n channels: [channel]\n });\n\n channelName = channel;\n UID = uid;\n user=username;\n}", "title": "" }, { "docid": "d57c311781ffe24353b3404fbf0b75ca", "score": "0.588848", "text": "init() {\n\n //program.parse(process.argv);\n\n this.client = mqtt.connect({\n host: this.host,\n port: this.port\n });\n this.client.on('connect',\n () => {\n console.log(`Connected, Listening to:\n host: ${this.host} \n port: ${this.port} \n topic: ${this.topic}`);\n this.client.subscribe(this.topic);\n });\n this.client.on('message', this.messageCallback || this._defaultMessageCallback)\n }", "title": "" }, { "docid": "1dab0cefc228039b325be43e5336e755", "score": "0.58853436", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"#\");\n}", "title": "" }, { "docid": "cd65e5622b8445bd50107d8db86d9c07", "score": "0.58420265", "text": "function onConnect() {\r\n// Once a connection has been made, make a subscription and send a message.\r\nconsole.log(\"onConnect\");\r\n\t\r\nclient.subscribe(topic_rx); // raspebrry\r\nmessage = new Paho.MQTT.Message(\"ll:Hello: CloudMQTT\");\r\nmessage.destinationName = topic_tx; // recibe\r\n}", "title": "" }, { "docid": "35bf6b703588ef8d7b79b3b6e311d1ee", "score": "0.5815034", "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\t\r\n client.subscribe('test');\r\n message = new Paho.MQTT.Message(\"ll:Hello: CloudMQTT\");\r\n message.destinationName = topic;\r\n \r\n }", "title": "" }, { "docid": "1f00c86c2237cffabc8529a7a20bf33d", "score": "0.581159", "text": "function guiSendInitSubscribe() {\n let user = document.querySelector('#subscribe_test_setting_form [name=user]').value.trim();\n let eventName = document.querySelector('#subscribe_test_setting_form [name=event_name]').value.trim();\n let accept = document.querySelector('#subscribe_test_setting_form [name=accept]').value.trim();\n let contentType = document.querySelector('#subscribe_test_setting_form [name=content_type]').value.trim();\n let expires = parseInt(document.querySelector('#subscribe_test_setting_form [name=expires]').value.trim());\n if (user === '') {\n guiWarning('Missed user name');\n return;\n }\n\n let target = user; // + '@' + serverConfig.domain;\n let params = null;\n\n /* \n params is optional.\n Used if domain or from-user is different from used in REGISTER/INVITE\n\n let params = {\n to_uri: new JsSIP.URI('sip', user, serverConfig.domain),\n to_display_name: null,\n from_uri: new JsSIP.URI('sip', userAccount.user, serverConfig.domain),\n from_display_name: null,\n }\n */\n try {\n subscriber = jssipUA.subscribe(\n target,\n eventName,\n accept, {\n expires,\n contentType,\n params\n });\n } catch (e) {\n console.log('Error: cannot create subscriber', e);\n guiError('Cannot create subscriber');\n }\n\n /**\n * Active event\n * Received the first NOTIFY with Subscription-State: active\n */\n subscriber.on('active', () => {\n console.log('subscriber>> active')\n guiInfo('subscriber: active');\n });\n\n /** \n * Incoming NOTIFY with body event\n * If NOTIFY Subscription-State: terminated - the argument isFinal = true \n */\n subscriber.on('notify', (isFinal, notify, body, contentType) => { // with not empty body\n console.log(`subscriber>> receive ${isFinal ? 'final ' : ''}NOTIFY`, notify, body, contentType);\n guiInfo(`receive ${isFinal ? 'final ' : ''}notify`);\n });\n\n /**\n * Subscription terminated. \n * \n * Termination code converted to English text.\n * \n * For terminationCode==RECEIVE_FINAL_NOTIFY may be set \n * SubscriptionState header parameters:\n * reason (undefined or string)\n * retryAfter (undefined or number)\n */\n subscriber.on('terminated', (terminationCode, reason, retryAfter) => {\n let terminationText = subscriberTerminationText(subscriber, terminationCode);\n console.log(`subscriber>>: terminated (${terminationText})${reason ? (' reason=\"' + reason + '\"') : ''}${retryAfter !== undefined ? (' retry-after=' + retryAfter) : ''}`);\n guiWarning(`subscriber: terminated (${terminationText})${reason ? (' reason=\"' + reason + '\"') : ''}`);\n subscriber = null;\n if (retryAfter !== undefined) {\n console.log(`You asked repeat subscription after ${retryAfter} seconds`);\n }\n guiSubscribeButtons();\n });\n\n /**\n * Subscribe dialog accepted (subscribe OK received)\n * Next after initial subscribe can be send only after the event\n * \n * If you send sequence: initial subscribe and immediately next subscribe,\n * next subscribe should be enqueued and send after the event.\n * (See subscribe enqueue example in ACD phone prototype broadsoft_acd.js)\n */\n subscriber.on('accepted', () => {\n console.log('subscriber>>: accepted');\n });\n\n if (expires > 0) {\n // normal subscribe\n subscriber.subscribe();\n } else {\n // fetch SUBSCRIBE (with expires: 0), see RFC 6665 4.4.3\n subscriber.terminate();\n }\n guiSubscribeButtons();\n}", "title": "" }, { "docid": "0a6058cbd45173ba3019847531872e51", "score": "0.57872224", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"/chat\");\n}", "title": "" }, { "docid": "c8179946958ee2e2078abc348695a40c", "score": "0.57706827", "text": "function onConnect() {\n // Fetch the MQTT topic from the form\n //topic = document.getElementById(\"topic\").value;\n topic = \"mqttonweb\";\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n}", "title": "" }, { "docid": "71ab298f3a59db17b0593c60f8d9372d", "score": "0.57695216", "text": "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n\t\r\n client.subscribe(\"[email protected]/IoT\");\r\n message = new Paho.MQTT.Message(\"Conectado al servidor NTP\");\r\n message.destinationName = \"[email protected]/IoT1\";\r\n client.send(message);\r\n\t\r\n }", "title": "" }, { "docid": "a3d6feeed763346d4d6c7278b4f49a4a", "score": "0.5750836", "text": "function onConnect() {\n \n client.subscribe(topic);\n}", "title": "" }, { "docid": "2952eb48da2c5a9fea71c642b41deaa8", "score": "0.57407093", "text": "function pub_subscribe(){\n\tpubnub.subscribe({\n\t channel : \"smarthome_response\",\n\t message : function(m){\n\t console.log(m)\n\t home_control(m);\n\t },\n\t error : function (error) {\n\t console.log(JSON.stringify(error));\n\t }\n\t});\n}", "title": "" }, { "docid": "1e8708f8494ddbb4239c4874905b6fa6", "score": "0.5738603", "text": "function initSubscribe() {\n pubSubClient.subscribe(redis_config.buffer_redis.notice_channel_config.server_to_site_channel);\n pubSubClient.on('message', function (channel, message) {\n handleSubMsg(channel, message);\n });\n}", "title": "" }, { "docid": "e2a6874ab1b8d6104bcffd4cc0d19021", "score": "0.5736395", "text": "function subscribe() {\r\n\t console.log(\"Subscribed to \" + config.number);\r\n pubnub.subscribe({\r\n restore : true,\r\n channel : config.number,\r\n message : receive,\r\n disconnect : disconnectcb,\r\n reconnect : reconnectcb,\r\n connect : function() { onready(true) }\r\n });\r\n }", "title": "" }, { "docid": "62568d9b8963ee557590be2528ab58e8", "score": "0.5723555", "text": "function _kn_initMicroserver()\n{\n if ((! self.kn__standAlone) &&\n parent && kn_isReady(parent) &&\n ((typeof parent.kn) != \"unknown\") && parent.kn)\n {\n kn = parent.kn;\n kn_server = parent.kn_server;\n kn_blank = parent.kn_blank;\n } else {\n \n\n kn = _kn_object(\n\n // CVS uses RCS for versioning\n 'RCSID', \"$Id: pubsub_raw.js,v 1.11 2004/04/19 05:39:12 bsittler Exp $\", //#\n\n 'ownerWindow', window,\n 'leaderWindow', window,\n\n 'tunnelURI', null,\n 'tunnelID', null,\n 'tunnelMaxAge', null,\n 'lastTag_', null,\n\n 'getHashCache', _kn_getHashCache,\n 'setHashCache', _kn_setHashCache,\n\n 'lastError', null,\n 'tunnelRunning_', false,\n\n 'tunnelFrame_', null,\n 'dispatch_', _kn_object(), // window-external 'router table' to other windows\n 'documents', _kn_object(),\n\n // core pub/sub api\n 'subscribe', _kn_subscribe,\n 'unsubscribe', _kn_unsubscribe,\n 'publish', _kn_publish,\n 'publishForm', _kn_publishForm,\n\n 'setHandler', _kn_setHandler,\n 'clearHandler', _kn_clearHandler,\n\n // tunnel control\n 'restartTunnel', kn__restartTunnel,\n\n 'iw', kn_inspectInWindow, // for debugging\n 'userid', \"guest\", // the default\n 'displayname', _kn_$(\"Guest User\") // the default\n\n );\n \n // call the handler to execute developer-defined code that \n // modifies auth properties before they are appended to kn\n \n if (self.kn_customInit)\n {\n self.kn_customInit();\n }\n\n // implementation of kn_sendCallback\n kn._sendCallback = //_\n _kn_sendCallback;\n\n // implementation of kn_tunnelLoadCallback\n kn._tunnelLoadCallback = //_\n _kn_tunnelLoadCallback;\n\n // kn._doMethod(do_method, options, handler)\n // The kn._doMethod method is used to dispatch a request with some\n // arbitrary do_method.\n // - do_method is a method name to invoke on the router\n // - options is an optional object containing additional parameters;\n // - do_method may be overridden by options.do_method\n // - options.kn_status_from is ignored\n // - handler is an optional handler object with three optional methods:\n // - onError(event), which will be called if there's an error\n // creating the route and passed a status event describing the\n // error.\n // - onSuccess(event), which will be called if the route is created\n // successfully and passed a status event describing the error.\n // - onStatus(event), which supersedes both of the above if it is\n // supplied.\n // No value is returned, and the generated request will have\n // an auto-generated kn_status_from header for status event\n // tracking purposes.\n kn._doMethod = _kn_doMethod;\n\n // kn.X(options, handler)\n // All currently known status-providing do_methods are exposed\n // using helper methods of kn. The helper methods are named\n // kn.X, where X is the uppercased version of the do_method in\n // question. These are equivalent to kn._doMethod(\"x\",\n // options, handler), where x is the proper (lower-case)\n // version of the do_method in question.\n {\n // currently known do_methods which provide status events\n var p =\n ( \"route add_route delete_route update_route add_journal\" +\n \" notify add_topic clear_topic set_topic_property\" +\n \" delete_topic\" +\n \" add_notify delete_notify update_notify batch save_config\" ) .\n split(\" \");\n for (var i = 0; i < p.length; i ++)\n {\n kn[p[i].toUpperCase()] =\n new Function('options', 'handler',\n 'kn._doMethod(_kn_unescape(\"' +\n _kn_escape(p[i]) +\n '\"), options, handler);'\n );\n }\n }\n\n // in-memory queue support\n kn.sendQueue = _kn_sendQueue;\n\n // POOL OF MEMORY\n\n // the pool must be shared by different frames using the same\n // microserver instance\n kn._pool = new _kn_Pool();\n // register an object with the pool, and return its index\n kn._memorize = _kn_memorize;\n // dereference an index\n kn._recall = _kn_recall;\n // recycle an index, and return the object it referred to\n kn._forget = _kn_forget;\n\n // SCHEDULER\n\n // replacement for setInterval()\n kn._setInterval = _kn_setInterval;\n // replacement for clearInterval()\n kn._clearInterval = _kn_clearInterval;\n\n // STRING CONVENIENCE FUNCTIONS\n\n kn._ownerWindow = kn.ownerWindow;\n\n kn._seqNum = 0; // request sequence number for building kn_status_from\n kn.TFN_ = null; // short for kn.tunnelFrame_.name\n kn._hits = 0; // number of events on the current tunnel\n\n kn._isLeaderP = false;\n kn.isLoadedP_ = false;\n kn._isBrokenP = false;\n kn._isRestartingP = false;\n kn._leaderScannerTimer = null;\n\n kn._unreachable = //_\n _kn_object(); // list of unreachable windows\n\n kn._appFrame = null;\n kn._postFrame = null;\n\n kn._workQ = //_\n new Array(); // deferred work list\n kn._workQcursor = 0;\n kn._worker = null;\n kn._postFrameBusy = false;\n kn._processWorkQ = //_\n _kn_processWorkQ;\n\n kn._followers = //_\n _kn_object(); // all other known windows\n kn._dispatchFunction = //_\n _kn_object(); // window-local 'router table' to functions\n\n // window-local data pointers for functions; they are\n // automatically kn._forget()ed when no longer needed; the\n // pointed-to objects are passed as second arguments to handlers\n kn._dispatchPtr = //_\n _kn_object();\n\n kn._argv = kn_argv; // this is the kn_argv of the owner window\n // do not use directly; use _kn_debug() instead\n kn._debug = //_\n kn._argv.kn_debug;\n // do not use directly; use _kn_options() instead\n kn._options = //_\n kn._argv.kn_options || //_\n kn._argv.kn_opts || //_\n kn._argv.kn_hacks;\n kn_response_flush = kn._argv.kn_response_flush ?\n kn._argv.kn_response_flush :\n kn_response_flush;\n kn_lang = kn._argv.kn_lang ?\n kn._argv.kn_lang :\n kn_lang;\n\n kn._onPostSuccess = //_\n _kn_onPostSuccess;\n kn._onPostError = //_\n _kn_onPostError;\n kn._onTunnelStatus = //_\n _kn_onTunnelStatus;\n\n self.iw = kn.iw;\n\n // these two URIs are used outside of kn.js\n if (self.kn_server == null)\n kn_server = \"/kn\";\n if (kn._argv.kn_server) kn_server = kn._argv.kn_server; // the url says\n if (self.kn_blank == null)\n kn_blank = kn_server + \"?do_method=blank\";\n if (kn._argv.kn_blank) kn_blank = kn._argv.kn_blank; // the url says\n\n // make them absolute\n if (! _kn_hasProto(kn_server))\n {\n kn_server = location.protocol + '//' + location.host +\n kn_resolvePath(location.pathname, kn_server);\n }\n if (! _kn_hasProto(kn_blank))\n {\n kn_blank = location.protocol + '//' + location.host +\n kn_resolvePath(location.pathname, kn_blank);\n }\n\n if (self.kn_userid) kn.userid = self.kn_userid; // the server says\n if (kn._argv.kn_userid) kn.userid = kn._argv.kn_userid; // the url says\n if (self.kn_displayname) kn.displayname = self.kn_displayname; // the server says\n if (kn._argv.kn_displayname) kn.displayname = kn._argv.kn_displayname; // the url says\n\n var hashCache = \"\";\n if (self.kn_hashCache) hashCache = self.kn_hashCache; // the server says\n if (kn._argv.kn_hashCache) hashCache = kn._argv.kn_hashCache; // the url says\n kn.setHashCache(hashCache);\n\n kn.tunnelURI =\n \"/who/\" +\n _kn_escape(kn.userid) +\n \"/s/\"+Math.random().toString().substring(2, 10) +\n \"/kn_journal\";\n if (self.kn_tunnelURI) kn.tunnelURI = self.kn_tunnelURI; // the server says\n if (kn._argv.kn_tunnelURI) kn.tunnelURI = kn._argv.kn_tunnelURI; // the url says\n kn.tunnelURI = _kn_absoluteTopicURI(kn.tunnelURI);\n\n kn.tunnelID = Math.random().toString().substring(2, 10);\n if (self.kn_tunnelID) kn.tunnelID = self.kn_tunnelID; // the server says\n if (kn._argv.kn_tunnelID) kn.tunnelID = kn._argv.kn_tunnelID; // the url says\n\n if (self.kn_tunnelMaxAge) kn.tunnelMaxAge = self.kn_tunnelMaxAge; // the server says\n if (kn._argv.kn_tunnelMaxAge) kn.tunnelMaxAge = kn._argv.kn_tunnelMaxAge; // the url says\n\n if (self.kn_lastTag_) kn.lastTag_ = self.kn_lastTag_; // the server says\n if (kn._argv.kn_lastTag_) kn.lastTag_ = kn._argv.kn_lastTag_; // the url says\n\n // automatic batching support\n kn.maxBatchSize = kn_maxBatchSize;\n if (kn._argv.kn_maxBatchSize) kn.maxBatchSize = parseInt(kn._argv.kn_maxBatchSize);\n\n // automatic retry support\n if (kn._argv.kn_retryInterval)\n kn_retryInterval = parseInt(kn._argv.kn_retryInterval);\n if (kn._argv.kn_maxRetryInterval)\n kn_maxRetryInterval = parseInt(kn._argv.kn_maxRetryInterval);\n\n if (self.kn__wrapApp)\n {\n // allow a custom override for appwrapping\n kn__wrapApp();\n }\n else\n {\n // only the master arranges for its own tunnel & post frames\n _kn_wrapApp();\n }\n }\n return kn;\n}", "title": "" }, { "docid": "fef7d54271853bc9a76788026acfbc19", "score": "0.5706147", "text": "async initializePubsub (thisNode) {\n try {\n // Subscribe to the coordination channel, where new peers announce themselves\n // to the network.\n await this.adapters.pubsub.subscribeToPubsubChannel(\n DEFAULT_COORDINATION_ROOM,\n // this.adapters.peers.addPeer\n this.thisNodeUseCases.addSubnetPeer,\n thisNode\n )\n } catch (err) {\n console.error('Error in pubsub-use-cases.js/initializePubsub()')\n throw err\n }\n }", "title": "" }, { "docid": "a1628a86e3a5b106731bf8ad45df595a", "score": "0.56097907", "text": "function onConnect() {\n console.log(\"onConnect\");\n subTopic();\n}", "title": "" }, { "docid": "cc2e40995c5d79a2b9b17b3d419ce6b8", "score": "0.56053686", "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(\"World\");\r\n message = new Paho.Message(\"Hello\");\r\n message.destinationName = \"World\";\r\n client.send(message);\r\n}", "title": "" }, { "docid": "d0a87ee8d171938c93e9104a66172100", "score": "0.5596863", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log('%cConnecting to MQTT : Success ', 'color: green');\n client.subscribe(\"domoticz/out\");\t// on écoute domoticz\n //message = new Paho.MQTT.Message(\"Hello\");\n //message.destinationName = \"domoticz/in\";\n //client.send(message);\n}", "title": "" }, { "docid": "852591b2d47ec4cef149d5c2f9a1357f", "score": "0.5576299", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(topic);\n}", "title": "" }, { "docid": "e402a5f60ecbb5b5c06b0de8a61a42ca", "score": "0.5560629", "text": "constructor(props) {\n super(props);\n this.pubnub = new PubNubReact({\n publishKey: 'pub-c-13c2bc5e-08c5-4592-8235-a152dda43d25',\n subscribeKey: 'sub-c-475356e2-0925-11e8-b7c9-024a5d295ade'\n });\n \n this.pubnub.init(this);\n }", "title": "" }, { "docid": "a11501fba76395243ac0c4c145eabb02", "score": "0.553272", "text": "function onConnect() {\r\n// Once a connection has been made, make a subscription and send a message.\r\nconsole.log(\"onConnect\");\r\nclient.subscribe(\"ga\");\r\nclient.subscribe(\"ganesh\");\r\n\r\n/*message = new Paho.MQTT.Message(\"ganesh\");\r\nmessage.destinationName = \"/ganesh\";\r\nclient.send(message); */\r\n}", "title": "" }, { "docid": "92314f55e8606760c7b41bc059e71cdf", "score": "0.5527591", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"/World\");\n var message = new Paho.MQTT.Message(\"Hello\");\n message.destinationName = \"/World\";\n client.send(message); \n}", "title": "" }, { "docid": "2078de372e6934057fe904a706a61afc", "score": "0.5522936", "text": "function XmppCore(opts) {\n\t// jsnode events boilerplate.\n\tevents.EventEmitter.call(this);\t\n\t\t\t\n\t/**\n\t * Set to true for debugging output.\n\t */\n\tthis._debug = true;\n\n\t/**\n\t * The set of options passed into the constructor.\n\t */\n\tthis._opts = require('extend')(defaultOpts, opts);\t\n\t\n\t/**\n\t * True if TLS encryption has been negotiated via STARTTLS.\n\t */\n\tthis._tlsEnabled = false;\n\t\n\t/**\n\t * True if client has authed with the server.\n\t */\n\tthis._authenticated = false;\n\t\n\t/**\n\t * A set of server features populated during stream-negotiation.\n\t */\n\tthis._features = {};\n\t\n\t/**\n\t * The JID used for sending and receiving stanzas.\n\t */\n\tthis.jid = opts.user + \"@\" + opts.host;\n\t\n\t/**\n\t * A set of callback handlers for IQ stanzas.\n\t */\n\tthis._iqHandler = {};\n\t\n\tif(opts.autoConnect === true)\n\t\tthis._init();\t\n}", "title": "" }, { "docid": "83a509f546d656f253508436378ddd68", "score": "0.55158716", "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(\"VMC/1035/VEND_ORDER_ITEM\");\r\n // message = new Paho.Message(\"Hello\");\r\n // message.destinationName = \"World\";\r\n // client.send(message);\r\n \r\n}", "title": "" }, { "docid": "7762f11f88bba64bcf4d858c7eed7562", "score": "0.5496269", "text": "function mqttClientConnectHandler() {\n console.log('connected to MQTT server');\n mqttClient.subscribe(rawTopic);\n console.log(\"subscribed to\", rawTopic);\n mqttClient.subscribe(statusTopic);\n console.log(\"subscribed to\", statusTopic);\n }", "title": "" }, { "docid": "1c9538b8b3331d44d6e14ca4e3d48d37", "score": "0.5492693", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n message = new Paho.MQTT.Message(\"Connect from \" + clientId);\n client.subscribe(\"login\");\n client.subscribe(\"motor/status\");\n client.subscribe(\"shaft/status\");\n message = new Paho.MQTT.Message(\"Connect from \" + clientId);\n message.destinationName = \"login\";\n client.send(message);\n loginFlag = 1;\n}", "title": "" }, { "docid": "8d6f75a3a0ebdbec976a531bab787001", "score": "0.54831254", "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(\"outTopic\");\r\n message = new Paho.MQTT.Message(\"1\");\r\n message.destinationName = \"inTopic\";\r\n client.send(message);\r\n \r\n}", "title": "" }, { "docid": "28abdc04e3509d0026bd6b989379ef36", "score": "0.54712296", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(settings.topic + \"/#\");\n message = new Paho.MQTT.Message('{\"type\": \"test\"}');\n message.destinationName = settings.topic + \"/dash\";\n client.send(message);\n}", "title": "" }, { "docid": "5ca291ef4abac0294c0898b60b77532f", "score": "0.54670554", "text": "function setup() {\r\n\r\n // we will re-use the oauth-authentication, so the password is actually useless here\r\n var authenticate = function(client, username, password, callback) {\r\n oauth_methods.authenticateToken(username, function(resp, client){\r\n if (client === false) {\r\n callback(null, false);\r\n } else {\r\n client.user = client;\r\n callback(null, true);\r\n }\r\n });\r\n };\r\n\r\n // In this case the client authorized as alice can publish to /users/alice taking\r\n // the username from the topic and verifing it is the same of the authorized user\r\n var authorizePublish = function(client, topic, payload, callback) {\r\n callback(null, client.user === topic.split('/')[1]);\r\n };\r\n\r\n // In this case the client authorized as alice can subscribe to /users/alice taking\r\n // the username from the topic and verifing it is the same of the authorized user\r\n var authorizeSubscribe = function(client, topic, callback) {\r\n callback(null, client.user === topic.split('/')[1]);\r\n };\r\n\r\n server.authenticate = authenticate;\r\n server.authorizePublish = authorizePublish;\r\n server.authorizeSubscribe = authorizeSubscribe;\r\n log.info(\"MQTT server listening on port \" + settings.port);\r\n }", "title": "" }, { "docid": "d50c68973b4c2ac63dec335e13205503", "score": "0.5465246", "text": "function onConnect() {\r\n // When connected, subscribing meteo topic then send message to topic World\r\n client.subscribe(\"home_inside/#\");\r\n client.subscribe(\"#\");\r\n message = new Paho.MQTT.Message(\"Un utilisateur vient de se connecter\");\r\n message.destinationName = \"World\";\r\n client.send(message);\r\n}", "title": "" }, { "docid": "f7757dab2d752d94da399cc47bdbd9c0", "score": "0.54566985", "text": "function onConnected() {\n console.log(new Date() + \": Connected to PubNub.\");\n}", "title": "" }, { "docid": "f7757dab2d752d94da399cc47bdbd9c0", "score": "0.54566985", "text": "function onConnected() {\n console.log(new Date() + \": Connected to PubNub.\");\n}", "title": "" }, { "docid": "9c945231a44a8af599301031f8bd79f0", "score": "0.5452928", "text": "function onConnect() {\n // Print output for the user in the messages div\n statusMsg('Subscribing to: ' + topic['ctl']);\n\n // Subscribe to the requested topic\n mqttc.subscribe(topic['ctl']);\n}", "title": "" }, { "docid": "77c8caec299a7736535dc3c6f60ad207", "score": "0.5450701", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"World\");\n let message = new MQTT.Message(\"Hello\");\n message.destinationName = \"World\";\n client.send(message);\n}", "title": "" }, { "docid": "749b52f91ab4499683b7f1f710b5f42a", "score": "0.54328907", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(topic);\n var message = new Paho.MQTT.Message(messaggioPerRaspi);\n message.destinationName = topic;\n client.send(message);\n}", "title": "" }, { "docid": "71c468f4ca8ae13f2a9cc67497332460", "score": "0.5428929", "text": "function mqtt_onConnect() {\n console.log(\"mqtt_onConnect\");\n client.subscribe(MQTT_TOPIC_SUB_MAIN);\n //message = new Paho.MQTT.Message(\"Hello\");\n //message.destinationName = \"World\";\n //client.send(message);\n document.getElementById(\"alert_warning\").style.display = \"none\";\n document.getElementById(\"alert_error\").style.display = \"none\";\n}", "title": "" }, { "docid": "6d29c78c8f4371a3fdb8bcdf8fe21728", "score": "0.54233485", "text": "function myClientConnected() {\n MQTT_CLIENT.subscribe(\"data/iotDevice/from_esp\");\n}", "title": "" }, { "docid": "f55b608780f12ded83f429ac6ee4fb55", "score": "0.54020816", "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(\"VMC/1035/ORDER_ITEM_RESPONSE\");\r\n // message = new Paho.Message(\"Hello\");\r\n // message.destinationName = \"World\";\r\n // client.send(message);\r\n \r\n}", "title": "" }, { "docid": "27e488a9e6790184dfbb30e8be2958eb", "score": "0.53875625", "text": "function pubSub(){\n\n var singles = {},\n newListener = newSingle('newListener'),\n removeListener = newSingle('removeListener'); \n \n function newSingle(eventName) {\n return singles[eventName] = singleEventPubSub(\n eventName, \n newListener, \n removeListener\n ); \n } \n\n /** pubSub instances are functions */\n function pubSubInstance( eventName ){ \n \n return singles[eventName] || newSingle( eventName ); \n }\n\n // add convenience EventEmitter-style uncurried form of 'emit' and 'on'\n ['emit', 'on', 'un'].forEach(function(methodName){\n \n pubSubInstance[methodName] = varArgs(function(eventName, parameters){\n apply( parameters, pubSubInstance( eventName )[methodName]);\n }); \n });\n \n return pubSubInstance;\n}", "title": "" }, { "docid": "27e488a9e6790184dfbb30e8be2958eb", "score": "0.53875625", "text": "function pubSub(){\n\n var singles = {},\n newListener = newSingle('newListener'),\n removeListener = newSingle('removeListener'); \n \n function newSingle(eventName) {\n return singles[eventName] = singleEventPubSub(\n eventName, \n newListener, \n removeListener\n ); \n } \n\n /** pubSub instances are functions */\n function pubSubInstance( eventName ){ \n \n return singles[eventName] || newSingle( eventName ); \n }\n\n // add convenience EventEmitter-style uncurried form of 'emit' and 'on'\n ['emit', 'on', 'un'].forEach(function(methodName){\n \n pubSubInstance[methodName] = varArgs(function(eventName, parameters){\n apply( parameters, pubSubInstance( eventName )[methodName]);\n }); \n });\n \n return pubSubInstance;\n}", "title": "" }, { "docid": "27e488a9e6790184dfbb30e8be2958eb", "score": "0.53875625", "text": "function pubSub(){\n\n var singles = {},\n newListener = newSingle('newListener'),\n removeListener = newSingle('removeListener'); \n \n function newSingle(eventName) {\n return singles[eventName] = singleEventPubSub(\n eventName, \n newListener, \n removeListener\n ); \n } \n\n /** pubSub instances are functions */\n function pubSubInstance( eventName ){ \n \n return singles[eventName] || newSingle( eventName ); \n }\n\n // add convenience EventEmitter-style uncurried form of 'emit' and 'on'\n ['emit', 'on', 'un'].forEach(function(methodName){\n \n pubSubInstance[methodName] = varArgs(function(eventName, parameters){\n apply( parameters, pubSubInstance( eventName )[methodName]);\n }); \n });\n \n return pubSubInstance;\n}", "title": "" }, { "docid": "27e488a9e6790184dfbb30e8be2958eb", "score": "0.53875625", "text": "function pubSub(){\n\n var singles = {},\n newListener = newSingle('newListener'),\n removeListener = newSingle('removeListener'); \n \n function newSingle(eventName) {\n return singles[eventName] = singleEventPubSub(\n eventName, \n newListener, \n removeListener\n ); \n } \n\n /** pubSub instances are functions */\n function pubSubInstance( eventName ){ \n \n return singles[eventName] || newSingle( eventName ); \n }\n\n // add convenience EventEmitter-style uncurried form of 'emit' and 'on'\n ['emit', 'on', 'un'].forEach(function(methodName){\n \n pubSubInstance[methodName] = varArgs(function(eventName, parameters){\n apply( parameters, pubSubInstance( eventName )[methodName]);\n }); \n });\n \n return pubSubInstance;\n}", "title": "" }, { "docid": "430df1e6df08d7293ce2bf8e9d7ff51b", "score": "0.53821063", "text": "function PubSub() {\n\n /*\\\n |*| This really doesn't need to be in production code, but once \n |*| bitten, twice shy of 80's hair bands and their pyrotechnics.\n \\*/\n if (!(this instanceof arguments.callee)) {\n throw new Error('Constructor called as a function');\n }\n\n// This object holds the subscribers and queues.\n var _content = {},\n\n// The unique id of each subscriber and becaomes the token by which subscribers\n// can be identified and deleted. This is only used when deleting a subscriber.\n _subscriberUid = -1;\n\n// <a id=\"pubsub.getSubscribers\" />\n// #### PubSub.getSubscribers()\n// A priviledged method (closure) that returns the list of subscribers and\n// queues associated with the given key.\n\n// **Example**\n\n// var topicSubscribers = pubsub.getSubscribers( 'Topic' );\n// \n// // This is currently only used to delete subscribers.\n// var allSubscribers = pubsub.getSubscribers();\n\n this.getSubscribers = function ( key ) {\n return key ? _content[ key ] : _content;\n };\n\n// <a id=\"pubsub.setSubscriber\" />\n// #### PubSub.setSubscriber()\n// A priviledged method (closure) that creates or sets the value of a\n// subscriber.\n\n// **Example**\n\n// pubsub.setSubscriber( 'Topic', {\n// callback: function () { console.log( arguments ) }\n// });\n this.setSubscriber = function ( key, value ) {\n if (!_content[ key ]) {\n _content[ key ] = [];\n }\n value.token = (++_subscriberUid).toString();\n _content[ key ].push( value );\n return value.token;\n };\n\n// <a id=\"pubsub.deleteSubscriber\" /> \n// #### PubSub.deleteSubscriber()\n// A priviledged method (closure) that deletes a subscriber.\n\n// **Example**\n\n// var token = pubsub.subscribe( 'Topic', {\n// callback: function () { console.log( arguments ) }\n// });\n// pubsub.deleteSubscriber( token );\n this.deleteSubscriber = function ( i, j ) {\n if (typeof _content[ i ] === 'object' &&\n _content[ i ].splice( j, 1 ).length == 1) {\n return true;\n } else {\n return false;\n }\n };\n\n// <a id=\"pubsub.broadcast\" /> \n// #### PubSub.broadcast()\n// A priviledged method (closure) that puts a method on the appropriate\n// subscriber queues and calling the subscriber's callback methods.\n\n// **Example**\n\n// pubsub.broadcast( 'Topic', {\n// callback: function () { console.log( arguments ) }\n// });\n this.broadcast = function ( key, value ) {\n var subscribers = this.getSubscribers( key );\n if (!subscribers) {\n return false;\n }\n for (var i in subscribers) {\n var subscriber = subscribers[ i ];\n if (!subscriber[ 'queue' ]) {\n subscriber[ 'queue' ] = new Queue();\n }\n subscriber[ 'queue' ].push( value );\n subscriber.callback.bind( subscriber );\n try {\n subscriber.callback();\n } catch (e) {\n /* Fail silently? That seems like a bad idea. */\n }\n }\n return true;\n };\n }", "title": "" }, { "docid": "28fde0419e60b32aba3ae7f710465d17", "score": "0.53793085", "text": "function _onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log('onConnect');\n var ps = window.MQTTclient.p_registers;\n\n for (var i = ps.length - 1; i >= 0; i--) {\n const p = ps[i]; // this._register(p['element'],p['channel']); // reduce below to this for re-usability\n\n var element = p['element'];\n var channel = p['channel']; // window.MQTTclient.splice(i, 1); // todo removal\n\n window.MQTTclient.client.subscribe(channel);\n\n if (!window.MQTTclient.registers[channel]) {\n window.MQTTclient.registers[channel] = [];\n }\n\n console.info('Subscribed to ' + channel + ' for ' + element);\n window.MQTTclient.registers[channel].push(element);\n } // message = new Paho.MQTT.Message(\"Hello\");\n // message.destinationName = \"World\";\n // client.send(message);\n\n} // called when the client connection fails to initialize", "title": "" }, { "docid": "5a2766694e9fab4fdb6d748409c73256", "score": "0.5363823", "text": "function init(eventPub, corpus, phraseLength){\n eventPublisher = eventPub;\n corpus = corpus;\n var secret = common.generateSecretPhrase(corpus, phraseLength);\n console.log(\"SECRET: \", secret);\n secretPhrase = secret.secretPhrase;\n maskedPhrase = secret.maskedPhrase;\n\n // Set the event handler for client guesses\n eventPublisher.on('clientSendMessage', function(message){\n evaluateGuess(message);\n });\n // Indicate that the server is ready\n eventPublisher.emit('initServer');\n var initialMessage = maskedPhrase + \"\\n0\\n0\";\n eventPublisher.emit('serverMessage', initialMessage);\n}", "title": "" }, { "docid": "f475972b3a54f2f44c677e2d474960ff", "score": "0.53607434", "text": "function on_connect() {\n console.log(\"conencted\")\n console.log(client);\n client.subscribe(mq_queue, on_message);\n }", "title": "" }, { "docid": "732fd448002065b590e3f878fd71679a", "score": "0.5354322", "text": "function initialize() {\n\t\n\t//lets open channel\n openChannel();\n\t\n\t//initial message\n //onMessage({\"user\":\"[email protected]\",\"message\":\"Hello!\"});\n }", "title": "" }, { "docid": "2e221cb1a88c6eab9b15517984e6c118", "score": "0.53537506", "text": "function subscribe(topic, handler){\n\t\t_SUBSCRIPTIONS[topic] = { subscribed: true, handler: handler };\n\t\t_SOCKET.send({ action: \"pubsub\", command: \"subscribe\", topic: topic });\n\t\t_SUBSCRIPTIONS[topic].subscribed = true;\n\t}", "title": "" }, { "docid": "8d73b956402b1e3e4d35ce542b9c62b8", "score": "0.534706", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(topic);\n // Keep alive the channel\n keepAlive('KA');\n }", "title": "" }, { "docid": "fcf228795adb2f03a518f6ce69dcb182", "score": "0.53446835", "text": "function pubSub(){\n\n var singles = {},\n newListener = newSingle('newListener'),\n removeListener = newSingle('removeListener');\n\n function newSingle(eventName) {\n return singles[eventName] = singleEventPubSub(\n eventName,\n newListener,\n removeListener\n );\n }\n\n /** pubSub instances are functions */\n function pubSubInstance( eventName ){\n\n return singles[eventName] || newSingle( eventName );\n }\n\n // add convenience EventEmitter-style uncurried form of 'emit' and 'on'\n ['emit', 'on', 'un'].forEach(function(methodName){\n\n pubSubInstance[methodName] = varArgs(function(eventName, parameters){\n apply( parameters, pubSubInstance( eventName )[methodName]);\n });\n });\n\n return pubSubInstance;\n}", "title": "" }, { "docid": "fcf228795adb2f03a518f6ce69dcb182", "score": "0.53446835", "text": "function pubSub(){\n\n var singles = {},\n newListener = newSingle('newListener'),\n removeListener = newSingle('removeListener');\n\n function newSingle(eventName) {\n return singles[eventName] = singleEventPubSub(\n eventName,\n newListener,\n removeListener\n );\n }\n\n /** pubSub instances are functions */\n function pubSubInstance( eventName ){\n\n return singles[eventName] || newSingle( eventName );\n }\n\n // add convenience EventEmitter-style uncurried form of 'emit' and 'on'\n ['emit', 'on', 'un'].forEach(function(methodName){\n\n pubSubInstance[methodName] = varArgs(function(eventName, parameters){\n apply( parameters, pubSubInstance( eventName )[methodName]);\n });\n });\n\n return pubSubInstance;\n}", "title": "" }, { "docid": "fcf228795adb2f03a518f6ce69dcb182", "score": "0.53446835", "text": "function pubSub(){\n\n var singles = {},\n newListener = newSingle('newListener'),\n removeListener = newSingle('removeListener');\n\n function newSingle(eventName) {\n return singles[eventName] = singleEventPubSub(\n eventName,\n newListener,\n removeListener\n );\n }\n\n /** pubSub instances are functions */\n function pubSubInstance( eventName ){\n\n return singles[eventName] || newSingle( eventName );\n }\n\n // add convenience EventEmitter-style uncurried form of 'emit' and 'on'\n ['emit', 'on', 'un'].forEach(function(methodName){\n\n pubSubInstance[methodName] = varArgs(function(eventName, parameters){\n apply( parameters, pubSubInstance( eventName )[methodName]);\n });\n });\n\n return pubSubInstance;\n}", "title": "" }, { "docid": "a710cfae9fbc057e7c5e57afb04dd919", "score": "0.53230286", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(mqttconfig.topic);\n }", "title": "" }, { "docid": "a74655e1f47730b8259df6a31bac2e67", "score": "0.5312589", "text": "function subscribe_create(pubsub, username, callback) {\n var w = new Weave(pubsub, null, username);\n w.create_weave(function() {\n\tw.subscribe();\n\tw.get_weave_status(function(status) {\n\t callback(w, status);\n\t});\n });\n}", "title": "" }, { "docid": "c67ae27d29a92fa88a2e7251d5cd069d", "score": "0.530873", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n client.subscribe(topicEncoder);\n client.subscribe(topicController);\n console.log(\"onConnect\");\n}", "title": "" }, { "docid": "00ff62246349e51c8df38bdc811e259f", "score": "0.5307149", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n debug(\"Mqtt client connected\");\n // client.subscribe(\"World\");\n // message = new Paho.MQTT.Message(\"Hello\");\n // message.destinationName = \"World\";\n // client.send(message);\n}", "title": "" }, { "docid": "f9d5de8815dd289c9f09e1e56b7caa89", "score": "0.5296719", "text": "async function quickstart(\n projectId = 'deft-medium-295815', // Your Google Cloud Platform project ID\n topicName = 'my-topic', // Name for the new topic to create\n subscriptionName = 'my-sub' // Name for the new subscription to create\n ) {\n \n\n // Instantiates a client\n const pubsub = new PubSub({projectId});\n console.log(pubsub)\n\n // Creates a new topic\n const [topic] = await pubsub.createTopic(topicName);\n console.log(`Topic ${topic.name} created.`);\n \n // Creates a subscription on that new topic\n const [subscription] = await topic.createSubscription(subscriptionName);\n // Creates a client; cache this for further use.\n const subClient = new pubsub.SubscriberClient();\n \n // // Receive callbacks for new messages on the subscription\n // subscription.on('message', message => {\n // console.log('Received message:', message.data.toString());\n // process.exit(0);\n // });\n \n // // Receive callbacks for errors on the subscription\n // subscription.on('error', error => {\n // console.error('Received error:', error);\n // process.exit(1);\n // });\n \n \n }", "title": "" }, { "docid": "6eeb66552df5e85b37d62de26ca9aaf8", "score": "0.52922", "text": "function onClientMessage(data) {\n \n function onLoggedIn(roomID, message){\n clients = getClients(roomID)\n \n var browsers = clients.map(function(c){return c.browser})\n client.browser = message.login.browser\n client.roomID = roomID\n client.send(json({announcement: \"<br>Welcome to Tutti - interactively run Javascript on multiple browsers!\"}))\n client.send(json({announcement: \"====================================================================\"}))\n client.send(json({announcement: \"You can execute any Javascript in the shell below.\"}))\n client.send(json({browsers:browsers}))\n client.send(json({announcement: \"<br>To connect another browser, just copy-n-paste the current URL into it.\"}))\n clients.push(client)\n //message.sessionId = client.sessionId\n message.browser = client.browser\n\n broadcast(client, {announcement:client.browser + ' joined'})\n \n }\n \n var client = this\n var message = JSON.parse(data)\n if (message.login) {\n \n var clients\n var roomID\n if (config.rooms){\n roomID = message.login.roomID\n \n db.get(roomID, function(room){\n if (!room){\n client.send({announcement:\"Room does not exist. Try going back to the front page and creating another room.\"})\n client._onDisconnect()\n return\n }\n\n if (room.secret !== message.login.secret){\n client.send({announcement:\"Login failed! You gave the wrong secret token for this room. Bye!\"})\n client._onDisconnect()\n return\n }\n \n onLoggedIn(roomID, message)\n })\n \n }else{\n roomID = 'root'\n onLoggedIn(roomID, message)\n }\n \n }else{\n broadcast(client, message)\n }\n}", "title": "" }, { "docid": "8b60a7a6d7921631e0316ebb072f1a4c", "score": "0.5285257", "text": "onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n this.serverConnected = true;\n console.log(\"mqtt connect\");\n }", "title": "" }, { "docid": "b81f23010f63800df2a0155e5002d8f3", "score": "0.5279374", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"Connection OK\");\n console.log(\"Listening for data...\");\n\n //client.subscribe(\"/sensors/#\");\n client.subscribe(\"/home/sensors/#\"); \n //client.subscribe(\"#\");\n\n //client.subscribe(\"/openhab/state/PowerMeter\");\n //message = new Paho.MQTT.Message(\"Hello\");\n //message.destinationName = \"/test/\";\n //client.send(message);\n}", "title": "" }, { "docid": "3e35407ed7d5548e103349acc8fd1fa6", "score": "0.52788496", "text": "function onConnect() {\n client.subscribe(clientId);\n }", "title": "" }, { "docid": "170b34b8e5c2cf29bbe53ebe37784ea6", "score": "0.5274782", "text": "async init_slave(pubsub){\r\n await this.init_slave_handshake(pubsub);\r\n await this.init_slave_heartbeat(pubsub);\r\n await this.init_slave_filestore(pubsub);\r\n }", "title": "" }, { "docid": "8973bbac1594ef1810d54aec3920f32b", "score": "0.52593577", "text": "function init(){\n scctChannel.connectToPublisher(\n '10.0.0.1', //IP ADDRESS\n '8080', //PORT\n 'JFSMSKFV83H0834HG0', //API KEY\n 3600 //TIMEOUT\n );\n}", "title": "" }, { "docid": "c4f349cbfa7581266d2dabf6cc22d499", "score": "0.52549005", "text": "constructor() {\n super();\n this.testPubSub = this.testPubSub.bind(this);\n }", "title": "" }, { "docid": "4635f78db3e1f0fee8583f768a0df8e5", "score": "0.5247269", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"Connected to MQTT...\");\n \n //Subscribe to the topics\n client.subscribe(\"tomate/temperaturadoar\");\n client.subscribe(\"tomate/umidadedoar\");\n client.subscribe(\"tomate/temperaturadosolo1\")\n client.subscribe(\"tomate/umidadedoar1\")\n client.subscribe(\"tomate/vazao1\")\n client.subscribe(\"tomate/volume1\")\n client.subscribe(\"tomate/nivel1\")\n client.subscribe(\"tomate/temperaturadosolo2\")\n client.subscribe(\"tomate/umidadedoar2\")\n client.subscribe(\"tomate/vazao2\")\n client.subscribe(\"tomate/volume2\")\n client.subscribe(\"tomate/nivel2\")\n client.subscribe(\"tomate/umidadedoar3\")\n client.subscribe(\"tomate/vazao3\")\n client.subscribe(\"tomate/volume3\")\n client.subscribe(\"tomate/nivel3\")\n client.subscribe(\"tomate/condutividade3\")\n client.subscribe(\"tomate/ph3\")\n \n //...\n \n }", "title": "" }, { "docid": "dc63b3e514e80a3108f189e7cc65a465", "score": "0.52111614", "text": "function PubSub(context) {\n var topics = {};\n\n this.subscribe = function (topic, callback, once) {\n if (typeof callback !== 'function') {\n return false;\n }\n\n if (!topics.hasOwnProperty(topic)) {\n topics[topic] = {};\n }\n\n var id = Math.random().toString(35);\n topics[topic][id] = [callback, !!once];\n\n return id;\n };\n\n this.unsubscribe = function (token) {\n for (var topic in topics) {\n if (topics[topic][token]) {\n delete topics[topic][token];\n return true;\n }\n }\n return false;\n };\n\n this.publish = function (topic) {\n if (topics.hasOwnProperty(topic)) {\n var args = Array.prototype.slice.call(arguments, 1),\n idr = [];\n\n for (var id in topics[topic]) {\n var sub = topics[topic][id];\n try {\n sub[0].apply(context, args);\n } catch (ex) {\n if (global.console) {\n console.error('jsPDF PubSub Error', ex.message, ex);\n }\n }\n if (sub[1]) idr.push(id);\n }\n if (idr.length) idr.forEach(this.unsubscribe);\n }\n };\n }", "title": "" }, { "docid": "d1a23b0bd496639399326848d05844ca", "score": "0.52097267", "text": "function PubSub(context) {\n var topics = {};\n\n this.subscribe = function (topic, callback, once) {\n if (typeof callback !== 'function') {\n return false;\n }\n\n if (!topics.hasOwnProperty(topic)) {\n topics[topic] = {};\n }\n\n var id = Math.random().toString(35);\n topics[topic][id] = [callback, !!once];\n\n return id;\n };\n\n this.unsubscribe = function (token) {\n for (var topic in topics) {\n if (topics[topic][token]) {\n delete topics[topic][token];\n return true;\n }\n }\n return false;\n };\n\n this.publish = function (topic) {\n if (topics.hasOwnProperty(topic)) {\n var args = Array.prototype.slice.call(arguments, 1),\n idr = [];\n\n for (var id in topics[topic]) {\n var sub = topics[topic][id];\n try {\n sub[0].apply(context, args);\n } catch (ex) {\n if (global.console) {\n console.error('jsPDF PubSub Error', ex.message, ex);\n }\n }\n if (sub[1]) idr.push(id);\n }\n if (idr.length) idr.forEach(this.unsubscribe);\n }\n };\n }", "title": "" }, { "docid": "d1a23b0bd496639399326848d05844ca", "score": "0.52097267", "text": "function PubSub(context) {\n var topics = {};\n\n this.subscribe = function (topic, callback, once) {\n if (typeof callback !== 'function') {\n return false;\n }\n\n if (!topics.hasOwnProperty(topic)) {\n topics[topic] = {};\n }\n\n var id = Math.random().toString(35);\n topics[topic][id] = [callback, !!once];\n\n return id;\n };\n\n this.unsubscribe = function (token) {\n for (var topic in topics) {\n if (topics[topic][token]) {\n delete topics[topic][token];\n return true;\n }\n }\n return false;\n };\n\n this.publish = function (topic) {\n if (topics.hasOwnProperty(topic)) {\n var args = Array.prototype.slice.call(arguments, 1),\n idr = [];\n\n for (var id in topics[topic]) {\n var sub = topics[topic][id];\n try {\n sub[0].apply(context, args);\n } catch (ex) {\n if (global.console) {\n console.error('jsPDF PubSub Error', ex.message, ex);\n }\n }\n if (sub[1]) idr.push(id);\n }\n if (idr.length) idr.forEach(this.unsubscribe);\n }\n };\n }", "title": "" }, { "docid": "b801dc85b3db8715b559d01d89770afc", "score": "0.52053314", "text": "function kn_subscribe(kn_from, kn_to, kn_options, handler)\n{\n return kn.subscribe(kn_from, kn_to, kn_options, handler);\n}", "title": "" }, { "docid": "fcf5789e4a0b027b00d773e3d11893be", "score": "0.5175108", "text": "function Connected() {\r\n console.log(\"Connected\");\r\n mqttClient.subscribe(subscription);\r\n}", "title": "" }, { "docid": "4ab59947aef698848a2c7bcbfe7cca33", "score": "0.5147284", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n //The operator # Means listen all topic after UID\n client.subscribe(gateway_uid + \"/client_response/#\");\n }", "title": "" }, { "docid": "daee16ced3a9f6b3428eb5c35fd8b484", "score": "0.51421106", "text": "function Connect() {\n mqttClient.connect({\n onSuccess: Connected,\n onFailure: ConnectionFailed,\n keepAliveInterval: 10,\n userName: username,\n useSSL: true,\n password: password\n });\n}", "title": "" }, { "docid": "d41a1bd2044e8dffc32bee2ad37ae44b", "score": "0.51343274", "text": "function onConnect() {\n console.log(\"onConnect\");\n client.subscribe(TOPIC_JOKER);\n onSendMessage(`${config.clientId}-1`, TOPIC_CONNECTION_CLIENT);\n}", "title": "" }, { "docid": "ee1eabee3813f98a35f4911aba16fa63", "score": "0.5131864", "text": "function onConnect() {\n mqtt_connected = true;\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"mqtt_app> onConnect() mqtt running\");\n send_custom_event(\"three_param\",{name:\"MQTT\",visible:false});\n for(let topic of config.mqtt.subscriptions){\n console.log(topic)\n client.subscribe(topic);\n console.log(`mqtt_app> - subscribed to ${topic}`);\n }\n}", "title": "" }, { "docid": "c44ec67196586055ed5dfba40e9c41e3", "score": "0.5130623", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"/iotDomoticsKR182\");\n }", "title": "" }, { "docid": "8d6116ddd803e26b9ec09ee58e954cdc", "score": "0.51262075", "text": "function Connect(){\r\n\tmqttClient.connect({\r\n\t\tonSuccess: Connected,\r\n\t\tonFailure: ConnectionFailed,\r\n\t\tkeepAliveInterval: 10,\r\n\t\tuserName: username,\r\n\t\tuseSSL: true,\r\n\t\tpassword: password\t\r\n\t});\r\n}", "title": "" }, { "docid": "ab150c666c46a682908a8dccabf0f9e2", "score": "0.5115823", "text": "function onConnect() {\n\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n\n var topicFilter = \"prices/\" + $routeParams.filter.replace(/\\|/g, \"/\") + \"/#\";\n console.log(\"Subscribing to: \" + topicFilter);\n\n client.subscribe(topicFilter);\n }", "title": "" }, { "docid": "0d0f304f1dc8b812f0fa09833f1167ca", "score": "0.51108885", "text": "constructor({ blockchain, transactionPool, wallet }) {\n\n this.blockchain = blockchain;\n this.transactionPool = transactionPool;\n this.pubnub = new PubNub(credentials);\n this.wallet = wallet;\n\n this.pubnub.subscribe({ channels: [Object.values(CHANNELS)] });\n this.pubnub.addListener(this.listener());\n }", "title": "" }, { "docid": "61410c4db9ee030567d79700b82b6214", "score": "0.5109198", "text": "function PubSub(context) {\n if (typeof context !== \"object\") {\n throw new Error(\n \"Invalid Context passed to initialize PubSub (jsPDF-module)\"\n );\n }\n var topics = {};\n\n this.subscribe = function(topic, callback, once) {\n once = once || false;\n if (\n typeof topic !== \"string\" ||\n typeof callback !== \"function\" ||\n typeof once !== \"boolean\"\n ) {\n throw new Error(\n \"Invalid arguments passed to PubSub.subscribe (jsPDF-module)\"\n );\n }\n\n if (!topics.hasOwnProperty(topic)) {\n topics[topic] = {};\n }\n\n var token = Math.random().toString(35);\n topics[topic][token] = [callback, !!once];\n\n return token;\n };\n\n this.unsubscribe = function(token) {\n for (var topic in topics) {\n if (topics[topic][token]) {\n delete topics[topic][token];\n if (Object.keys(topics[topic]).length === 0) {\n delete topics[topic];\n }\n return true;\n }\n }\n return false;\n };\n\n this.publish = function(topic) {\n if (topics.hasOwnProperty(topic)) {\n var args = Array.prototype.slice.call(arguments, 1),\n tokens = [];\n\n for (var token in topics[topic]) {\n var sub = topics[topic][token];\n try {\n sub[0].apply(context, args);\n } catch (ex) {\n if (global.console) {\n console.error(\"jsPDF PubSub Error\", ex.message, ex);\n }\n }\n if (sub[1]) tokens.push(token);\n }\n if (tokens.length) tokens.forEach(this.unsubscribe);\n }\n };\n\n this.getTopics = function() {\n return topics;\n };\n }", "title": "" }, { "docid": "52ecda1b61a22247f6eebf22c999542b", "score": "0.51073796", "text": "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n connected = true;\r\n console.log(\"onConnect\");\r\n var message = new Paho.MQTT.Message(\"Subscribed to topic\");\r\n message.destinationName = '/Banner';\r\n client.subscribe(topic);\r\n client.send(message);\r\n }", "title": "" }, { "docid": "74d07faa21816cc67d5a2006252b422e", "score": "0.51065737", "text": "function subscribe() { //subscribe to push messaging\n console.log('Subscribing.');\n subscribeButton.prop('disabled', true);\n nameInput.prop('disabled', true);\n reg.pushManager.subscribe({userVisibleOnly: true})\n .then(function(pushSubscription) {\n console.log('Subscribed to Notification Server! Endpoint:', pushSubscription.endpoint);\n subscribeButton.prop('disabled', false);\n subscribeButton.text('Unsubscribe');\n isSubscribed = true;\n var name = nameInput.val();\n if (!name.trim() || name === undefined) {\n console.log('Using default name.');\n name = DEFAULT_NAME;\n nameInput.val(name);\n }\n var user = new User(pushSubscription, name);\n sendSubscriptionToServer(user);\n }).catch(function(error) {\n // During development it often helps to log errors to the\n // console. In a production environment it might make sense to\n // also report information about errors back to the\n // application server.\n console.log('Error subscribing.', error);\n });\n}", "title": "" }, { "docid": "23eb980ea06a85e5f0e9012dc963c796", "score": "0.51061887", "text": "serverPeers_subscribe() {\n return this.request('server.peers.subscribe', []);\n }", "title": "" }, { "docid": "9a651f3cd14411d9703fb4143bf34c0a", "score": "0.5103287", "text": "constructor() {\n this.storage = new DataStore();\n // Redis connection for everything.\n this.redis = undefined;\n // Redis connection for subscribe. This is needed because redis requires\n // subscribe connection to be standalone.\n this.redisSub = undefined;\n if (config.get('redis.type') == 'real') {\n this._createRealRedis();\n } else if (config.get('redis.type') == 'mock') {\n this._createMockRedis();\n } else {\n throw 'invalid redis type ' + config.get('type');\n }\n // An object that maps channel ID to a list of callbacks for pub/sub.\n // callback is of the format: function (channel, message)\n this.channelSub = {};\n // Set to true if on('message') have been set.\n this.subscribed = false;\n }", "title": "" }, { "docid": "f2f99eb98fd0e8133f8bb28abe66a9cb", "score": "0.50916487", "text": "function client() {\n\n /**\n * Add routing methods to client-side primus.\n */\n\n (function route() {\n if (typeof methods === 'undefined') return;\n\n methods.forEach(function(method) {\n Primus.prototype[method] = function(path, body) {\n var message = Object.create(null);\n message.method = method.toUpperCase();\n message.path = path;\n message.body = body;\n message.id = this.id;\n this.write(message);\n }\n });\n })();\n\n /**\n * Add set functionality to client-side primus.\n */\n\n (function set() {\n Primus.prototype.set = function(key, value) {\n var changing = this[key] !== value;\n this[key] = value;\n if (changing) this.emit('change:' + key);\n }\n })();\n\n\n /**\n * Middleware to add message parser to client-side primus.\n * Optionally added on the client-side via primus.addParser().\n */\n\n (function parser() {\n Primus.prototype.addParser = function() {\n this.on('data', function(data) {\n if (typeof data.call !== 'object') return;\n if (typeof this[data.call.method] !== 'function') return;\n this[data.call.method].apply(this, data.call.args);\n });\n }\n })();\n\n}", "title": "" }, { "docid": "9f801a99c9a9b630a910104ee04a8a74", "score": "0.5075118", "text": "function PubSub(context) {\r\n if (_typeof(context) !== 'object') {\r\n throw new Error('Invalid Context passed to initialize PubSub (jsPDF-module)');\r\n }\r\n\r\n var topics = {};\r\n\r\n this.subscribe = function (topic, callback, once) {\r\n once = once || false;\r\n\r\n if (typeof topic !== 'string' || typeof callback !== 'function' || typeof once !== 'boolean') {\r\n throw new Error('Invalid arguments passed to PubSub.subscribe (jsPDF-module)');\r\n }\r\n\r\n if (!topics.hasOwnProperty(topic)) {\r\n topics[topic] = {};\r\n }\r\n\r\n var token = Math.random().toString(35);\r\n topics[topic][token] = [callback, !!once];\r\n return token;\r\n };\r\n\r\n this.unsubscribe = function (token) {\r\n for (var topic in topics) {\r\n if (topics[topic][token]) {\r\n delete topics[topic][token];\r\n\r\n if (Object.keys(topics[topic]).length === 0) {\r\n delete topics[topic];\r\n }\r\n\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n };\r\n\r\n this.publish = function (topic) {\r\n if (topics.hasOwnProperty(topic)) {\r\n var args = Array.prototype.slice.call(arguments, 1),\r\n tokens = [];\r\n\r\n for (var token in topics[topic]) {\r\n var sub = topics[topic][token];\r\n\r\n try {\r\n sub[0].apply(context, args);\r\n } catch (ex) {\r\n if (global.console) {\r\n console.error('jsPDF PubSub Error', ex.message, ex);\r\n }\r\n }\r\n\r\n if (sub[1]) tokens.push(token);\r\n }\r\n\r\n if (tokens.length) tokens.forEach(this.unsubscribe);\r\n }\r\n };\r\n\r\n this.getTopics = function () {\r\n return topics;\r\n };\r\n }", "title": "" }, { "docid": "0e3f2a2f028d536192ed5fac6edbbddb", "score": "0.5065014", "text": "function doClientConnect( context ) {\n console.log( 'Connect.' );\n client.subscribe( TOPIC_STORE ); \n client.subscribe( TOPIC_PHOTON ); \n}", "title": "" }, { "docid": "8e3eda55b5fc1ade828311275072b1af", "score": "0.5058812", "text": "function onConnect() {\n // update localDiv text:\n localDiv.innerHTML = 'connected to broker. Subscribing...'\n // subscribe to the topic:\n client.subscribe(topic, onSubscribe);\n}", "title": "" }, { "docid": "5a4eeb7758da99a280b2c9ffbd1f68c4", "score": "0.50534606", "text": "init_master_filestore(pubsub){\r\n return new Promise((resolve, reject) => {\r\n try{\r\n pubsub.subscribe(\"store\", (req) => {\r\n // listen to incoming message for whether action is successfull\r\n }).then((topic) => {\r\n console.log(`subscribed to ${topic}`);\r\n resolve(\"success\");\r\n })\r\n }\r\n catch(err){reject(err)}\r\n })\r\n }", "title": "" }, { "docid": "86cf11dccfde063f72cff41a1406767f", "score": "0.50519264", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"ROBOT\");\n // $(\"#pgsshow\").html(\"ค้นหา GPS ไม่เจอ\");\n\n}", "title": "" }, { "docid": "85fbbe5e486d1149ed5bfbde30b57bc3", "score": "0.50510997", "text": "onConnectedToMqttSrv() {\n console.log('MQTT connection connected');\n if (this.connectedCallback != null) {\n this.connectedCallback(true);\n } else {\n console.log('onConnectedToMqttSrv: No callback defined');\n }\n this.mqttClient.subscribe(\"json/posecore/+/connected/+\", {qos:0});\n this.sendClientConnected();\n }", "title": "" }, { "docid": "4c8cd1344dd6f0654379da6358d46020", "score": "0.50464344", "text": "function on_startup() {\n console.log(\"Starting: server current directory:\" + __dirname);\n dm.Start(HOST, PORT);\n zmqSub.connect(URL_SUB);\n zmqSub.subscribe(TOPIC);\n console.log(\"Subscriber connected to \" + URL_SUB + \"...\\n\");\n}", "title": "" }, { "docid": "eb65fb9c22f84fe2a1d76dcc5e0a3a77", "score": "0.5044254", "text": "function onConnect() {\n setSocketOpen(true);\n client.current.subscribe(\"demo\");\n console.log(\"subscribed to demo topic\")\n}", "title": "" }, { "docid": "383a2d316618bfbdf9c3ba9eec3906a8", "score": "0.50404525", "text": "constructor(props) {\n super(props); // Define props in the constructor\n this.onKeyDown = this.onKeyDown.bind(this);\n this.submitMessage = this.submitMessage.bind(this);\n this.onTextChange = this.onTextChange.bind(this);\n\n // Constructors are also a good place to initialize state\n this.state = {\n pubnub: ChannelStore.pubnubGet(),\n message: '',\n UUID: ChannelStore.getUser(),\n channel: ChannelStore.getChannel()\n }\n }", "title": "" }, { "docid": "ead782e5eac27b31fa740fdb20830d51", "score": "0.50357354", "text": "function initClient(requestUrl) {\n var clientId = String(Math.random()).replace('.', '');\n var client = new Paho.MQTT.Client(requestUrl, clientId);\n var connectOptions = {\n onSuccess: function (data) {\n console.log('connected');\n var topic = \"/myThing2/1\";\n \n // subscribe to the drawing\n client.subscribe(topic);\n \n // publish a lifecycle event\n var ping_for_get = new Paho.MQTT.Message(\"Hello world 1\");\n ping_for_get.destinationName = \"/myThing2/1\";\n var active_sync = function() {\n console.log(\"Pinging client with 'Hello world 1' message\")\n client.send(ping_for_get);\n setTimeout(active_sync, 5000);\n };\n active_sync();\n },\n useSSL: true,\n timeout: 20,\n mqttVersion: 4,\n onFailure: function (err) {\n console.error('connect failed');\n console.error(err);\n },\n }\n\n client.onConnectionLost = function(responseObject) {\n console.log(responseObject)\n if (responseObject.errorCode !== 0) {\n console.log(\"onConnectionLost:\"+responseObject.errorMessage);\n }\n }\n\n client.connect(connectOptions);\n\n}", "title": "" }, { "docid": "931144687441061572551fb5498f891f", "score": "0.50287235", "text": "static subscribe(commands,interval,callback){return Server.subscribeEx(commands,interval,null,callback)}", "title": "" }, { "docid": "e6ec36b2ee61784db6949fb797f07327", "score": "0.5026865", "text": "function onConnect() {\n console.log('client is connected');\n client.subscribe(\"BPM-promedio/Nic\");\n client.subscribe(\"BPM-promedio/Andres\");\n }", "title": "" } ]
13ef9b3443dfdf746fd697cd458a4cdb
process when user click on the canvas check which monster is clicked
[ { "docid": "0b57c7a14452362123c6737c9f05238e", "score": "0.6975377", "text": "function ClickEventProcess(event) {\n\tvar x = event.pageX - canvas.offsetLeft;\n\tvar y = event.pageY - canvas.offsetTop;\n\n\tfor (var g = list.items.length - 1; g >= 0; g--) {\n\t\tif (list.items[g].isSelected && list.items[g].isClick && start_Flag > 0) {//check to choose monsters on the screen\n\t\t\tif (list.items[g].isClick(x, y)) {\n\t\t\t\tcList.missClick = false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcList.missClick = true;\n\t\t}\n\t}\n\n\tif (cList.missClick) {\n\t\tcList.StageList[cList.currentStage].score--; //minus score when user miss click\n\t\tcList.missClick = false;\n\t}\n}", "title": "" } ]
[ { "docid": "d63c885a5d396d6db7b6372fcbbbb6dc", "score": "0.6727036", "text": "clicked(mx, my){\n let d = dist(mx, my, this.x, this.y);\n if(d< this.w){\n this.isclicked = true;\n }else{\n this.isclicked = false;\n }\n }", "title": "" }, { "docid": "d63c885a5d396d6db7b6372fcbbbb6dc", "score": "0.6727036", "text": "clicked(mx, my){\n let d = dist(mx, my, this.x, this.y);\n if(d< this.w){\n this.isclicked = true;\n }else{\n this.isclicked = false;\n }\n }", "title": "" }, { "docid": "efba2d4c57905bb16eb3fa29eb144371", "score": "0.6538638", "text": "function handleClick(eventParams){\n //Mouse coordinates!\n mouseXpos = eventParams.clientX;\n mouseYpos = eventParams.clientY;\n\n if(checkBounds(pMelee, eventParams.clientX, eventParams.clientY)){\n //character activate location\n //turns on a switch to enable player object/particle movement\n pMelee.Y = canvas.height-waterCont.height-50;\n eMelee.Y = canvas.height-waterCont.height-50;\n eRanged.Y = canvas.height-waterCont.height-50;\n pMelee.act=true;\n eMelee.act = true;\n eRanged.act = true;\n }\n\n if (checkBounds(pRanged, eventParams.clientX, eventParams.clientY)){\n //character activate location\n //turns on a switch to enable player object/particle movement\n pRanged.Y = canvas.height-waterCont.height-50;\n eMelee.Y = canvas.height-waterCont.height-50;\n eRanged.Y = canvas.height-waterCont.height-50;\n pRanged.act=true;\n eMelee.act = true;\n eRanged.act = true;\n }\n\n}", "title": "" }, { "docid": "d8bd841dc7db596e2b0eac9ef9752a66", "score": "0.64794296", "text": "function mouseClicked() {\n\n buttonSystem()\n\n if (pantalla === 6 && contadorOn === true) {\n checkSelected(tilesN1)\n }\n\n if (pantalla === 4 && contadorOn === true) {\n checkSelected(tilesN2)\n }\n\n if (pantalla === 8 && contadorOn === true) {\n checkSelected(tilesN3)\n }\n}", "title": "" }, { "docid": "5f87c4f2e2ad99d71a7228ac197f1fd0", "score": "0.64670813", "text": "function handleClick(mx, my){\n\t\n\t// See which gridpoint was clicked\n\tclickX = floor(mx / level.pixelSizeX);\n\tclickY = floor(my / level.pixelSizeY);\n\n\t// Make sure the click was on the canvas\n\tif(clickX < 0 || clickX >= level.pixelsX) return;\n\tif(clickY < 0 || clickY >= level.pixelsY) return;\n\t\n\t// Determine which level point was clicked.\n\tvar clickPos = level.posFromXY(clickX, clickY);\n\n\tswitch(clickSelector.value()){\n\t\tcase \"Place wall\":\n\t\t\tlevel.changeSquare(clickPos, 1);\n\t\t\tbreak;\n\t\tcase \"Eraser\":\n\t\t\tlevel.changeSquare(clickPos, 0);\n\t\t\tbreak;\n\t\tcase \"Place start\":\n\t\t\tlevel.changeSquare(clickPos, 0);\n\t\t\tlevel.start = clickPos;\n\t\t\tlevel.render();\n\t\t\tbreak;\t\t\t\n\t\tcase \"Place goal\":\n\t\t\tlevel.changeSquare(clickPos, 0);\n\t\t\tlevel.goal = clickPos;\n\t\t\tlevel.render();\n\t\t\tbreak;\t\t\t\n\t}\n}", "title": "" }, { "docid": "5a208dec0ccb6a55a455050cf4f2ec04", "score": "0.64400434", "text": "function click(x,y) {\n //TODO: translate the click into a click on the world (need to factor in\n // the viewport)\n // also if a disaster is selected at the time of the click, handle it\n }", "title": "" }, { "docid": "1a75edf829037a80e32d4b71b0f4303e", "score": "0.63551253", "text": "function clickedEnemy(x, y)\t{\n\t\tfor(var i = 0; i < enemy.length; i++)\t{\n\t\t\tif(Math.abs(enemy[i].x-x) <= 20 && Math.abs(enemy[i].y-y) <= 20)\t{\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "title": "" }, { "docid": "174dd2cfed371f7b19b4287a070a11a8", "score": "0.6344039", "text": "mouseClick(){\n\t\tif (dist(this.x, this.y, mouseX, mouseY) < 12) {\n\t\t\tif (this.isActive == false) {\n\t\t\t\tthis.isActive = true;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.isActive = false;\n\t\t\tactiveCity = 0;\n\t\t\tskyColor = color(125);\n\t\t}\n\t}", "title": "" }, { "docid": "3cfc578db5c5fb183b66984289ace9db", "score": "0.6309352", "text": "function select() {\n var x = event.x;\n var y = event.y;\n \n var rect = c.getBoundingClientRect();\n \n x -= rect.left;\n y -= rect.top;\n \n //console.log(\"\" + x + \", \" + y);\n if (abilities.length < 1) {\n if(y>=475 && y<=490){\n if(x>=510 && x<=560){\n abilities.push(\"wings\");\n console.log(\"wings\");\n color = \"#98D4FF\";\n ctx.fillStyle=\"#FFFFFF\";\n ctx.fillRect(508,360,230,200);\n survivor_medium.src = \"./img/wings_amoeba.png\";\n c.removeEventListener(\"mousedown\", select);\n } else if(x>=590 && x<=628){\n abilities.push(\"gills\")\n console.log(\"gills\");\n color=\"#00CC99\";\n ctx.fillStyle=\"#FFFFFF\";\n ctx.fillRect(508,360,230,200);\n survivor_medium.src = \"./img/gills_amoeba.png\";\n c.removeEventListener(\"mousedown\", select);\n }\n }\n } else {\n ctx.fillStyle=\"#000000\";\n ctx.font=\"15px century gothic\";\n ctx.fillText(\"You already chose an evol!\",510,380);\n }\n}", "title": "" }, { "docid": "c7a882f5bb4fb3d130d808dfa03035ee", "score": "0.6293118", "text": "function ManagementClick() {\n\tif ((MouseX >= 250) && (MouseX < 750) && (MouseY >= 0) && (MouseY < 1000)) CharacterSetCurrent(Player);\n\tif ((MouseX >= 750) && (MouseX < 1250) && (MouseY >= 0) && (MouseY < 1000)) CharacterSetCurrent(ManagementMistress);\n\tif ((MouseX >= 1250) && (MouseX < 1750) && (MouseY >= 0) && (MouseY < 1000)) CharacterSetCurrent(ManagementSub);\n\tif ((MouseX >= 1885) && (MouseX < 1975) && (MouseY >= 25) && (MouseY < 115) && Player.CanWalk()) CommonSetScreen(\"Room\", \"MainHall\");\n\tif ((MouseX >= 1885) && (MouseX < 1975) && (MouseY >= 145) && (MouseY < 235)) InformationSheetLoadCharacter(Player);\n}", "title": "" }, { "docid": "051dc8f3f3676915948d8a4393738088", "score": "0.627712", "text": "onMouseMouve(e){\n this.currentPosition=getCordinateOncanvase(e,this.canvas);\n switch(this.tool){\n case TOOL_LINE:\n this.drawShap(this._lineWidth);\n break;\n case TOOL_RECTANGLE:\n case TOOL_CIRCLE:\n case TOOL_TRIANGLE:\n this.drawShap(this._lineWidth);\n break;\n case TOOL_PENCIL:\n this.drawFreeLine(this._lineWidth);\n break;\n case TOOL_BRUCH:\n this.drawFreeLine(this._brushLineWidth);\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "f78499d3b1110d6bf06b39123610192b", "score": "0.62432706", "text": "function clickHandler(e) {\n //Store the class of current player's turn, by checking whose turn currently is. \n currentClassTurn = circleTurn ? O_Class : X_Class;\n let cell = e.target;\n //Function to display current mark of current player's turn\n placeMark(cell, currentClassTurn);\n //If someone wins\n if (checkWin(currentClassTurn)) {\n //A function takes argument false to denote it's not a draw. \n endGame(false);\n } else if (isDraw()) {\n //if checkWin() returns false and isDraw() returns true, it's a draw\n endGame(true);\n } else {\n //if no one wins and game is running,keep swaping turns. \n swapTurn();\n }\n }", "title": "" }, { "docid": "daa82e7f55544612c0c18addc9e48782", "score": "0.6239073", "text": "function mouseClicked() {\n\n if (pageNum == 6) {//checks if user is on pg 6\n //checks if where you clicked is within declared parameters of feather button\n if (isWithin(xCoord, yCoord, xRadius, yRadius)) {\n print(\"touching shape\");\n\n //actives featherClicked function\n featherClicked = true; \n }\n }\n \n \telse if (pageNum == 7) {//checks if user is on pg 7\n for (var i = 0; i <= 5; i++) {// checks if user is on pg 7\n //calls on button area\n if (isWithin(dementorxCoords[i], dementoryCoords[i], dementorWidth, dementorHeight)) {\n\n //activates dementor clicked function\n print(\"touching shape\");\n dementorClicked = true;\n\n //advances page number\n pageNum = 8;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "d100cdd1119b1a61017c643eda29dced", "score": "0.62248033", "text": "function mouseClicked() {\n // increment score by 1\n STATE.score += 1;\n\n // check if any clickable objects were clicked on\n clickable.forEach(function(obj) {\n if (obj.inside(mouseX, mouseY)) {\n obj.onClick();\n }\n });\n}", "title": "" }, { "docid": "12229edf4f8743cce5e7f95f9b8a76c9", "score": "0.620794", "text": "function ClickAnalyser(e) {\n console.log('click: ' + e.offsetX + '/' + e.offsetY);\n if (game_mode == 'play'){\n var rect = collides(PosButtons, e.offsetX, e.offsetY);\n if (rect[0]) {\n console.log('collision: ' + rect[0].x + '/' + rect[0].y);\n ClosePosition(rect[1]);\n } \n else {\n console.log('clicked on nothing clickable');\n }\n }\n if (game_mode == 'game_over'){\n if (x>=600 && x<=950 && y>=515 && y<=620){\n restart();\n }\n }\n }", "title": "" }, { "docid": "b416178de27e934562dcab57b7cc9ca9", "score": "0.6139704", "text": "isPressed(mx,my){\n\t\t// Will actualy change the program state variables, trigerring events in the next frame.\n\t\tif(this.mode == 0 || this.mode == 2){\n\t\t\tif(this.text == \"Stop\") TOOL = 1;\n\t\t\telse if(this.text == \"Run\"){\n\t\t\t\tTOOL = 2;\n\t\t\t\t// Need to reset variables for new begin\t\n \t\t\t\tNUMBER_GENERATION_FRAME = 0;\n\t\t\t\tNUMBER_GENERATION = 0;\n\t\t\t\tPERMIT_ARRAY = [];\n \t\t\t\tfor(let i = 0; i < NUMBER_MOVES; i++) PERMIT_ARRAY.push(PERMIT_VALUES);\n\t\t\t\t\n\t\t\t\tCURRENT_DIVERSITY = DIVERSITY_WEIGHT;\n\t\t\t\tPLAYERS = new PlayerControl(NUMBER_PLAYERS,START_POS,OBJECTIVE_POS,PLAYER_SIZE);\n\t\t\t\tGA_MANAGER = new GeneticAlgorithm(CROSSOVER_METHOD,SELECTION_METHOD,\"discrete\",PERMIT_ARRAY,NUMBER_MOVES,NUMBER_PLAYERS,P_MUTATION,P_CROSSOVER,P_ELITISM);\n\t\t\t}\n\t\t\telse if(this.text == \"Draw\" && (TOOL != 2 && TOOL != 3)) TOOL = 3;\n\t\t\telse if(this.text == \"Delete\" && (TOOL != 2 && TOOL != 4)) TOOL = 4;\n\t\t\telse if(this.text == \"Player Pos.\" && (TOOL != 2 && TOOL != 5)) TOOL = 5;\n\t\t\telse if(this.text == \"Goal Pos.\" && (TOOL != 2 && TOOL != 6)) TOOL = 6;\n\t\t\telse if(this.text == \"Crossover\" && (TOOL != 2 && TOOL != 7)) TOOL = 7;\n\t\t\telse if(this.text == \"Elitism\" && (TOOL != 2 && TOOL != 8)) TOOL = 8;\n\t\t\telse if(this.text == \"Mutation\" && (TOOL != 2 && TOOL != 9)) TOOL = 9;\n\t\t\telse if(this.text == \"Player Size\" && (TOOL != 2 && TOOL != 10)) TOOL = 10;\n\t\t\telse if(this.text == \"Diversity\" && (DIVERSITY_TOOL == 0)) DIVERSITY_TOOL = 1;\n\t\t\telse if(this.text == \"Falloff\" && (DIVERSITY_TOOL == 0)) DIVERSITY_TOOL = 2;\n\t\t\telse if(this.text == \"Selection Method:\" && (TOOL != 2 && TOOL != 11)) TOOL = 11;\n\t\t\telse if(this.text == \"Crossover Method:\" && (TOOL != 2 && TOOL != 12)) TOOL = 12;\n\t\t\t\n\t\t}\n\t\t// Only allow to access these buttons while stopped\n\t\telse if(this.mode == 1 && TOOL == 1){\n\t\t\t// Increment button pressed\n\t\t\tif(mx >= this.pos.x + (3 *this.size.x / 4) && my < this.pos.y + (this.size.y / 2)){\n\t\t\t\tif(this.text == \"Pop. Size\" && NUMBER_PLAYERS < 999){\n\t\t\t\t\tNUMBER_PLAYERS = NUMBER_PLAYERS + 5;\n\t\t\t\t\tthis.varText = \": \" + NUMBER_PLAYERS;\n\t\t\t\t}\n\t\t\t\tif(this.text == \"Moves\" && NUMBER_MOVES < 999){\n\t\t\t\t\tNUMBER_MOVES = NUMBER_MOVES + 10;\n\t\t\t\t\tthis.varText = \": \" + NUMBER_MOVES;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Decrement button pressed\n\t\t\telse if(mx >= this.pos.x + (3 *this.size.x / 4) && my >= this.pos.y + (this.size.y / 2)){\n\t\t\t\tif(this.text == \"Pop. Size\" && NUMBER_PLAYERS > 10){\n\t\t\t\t\tNUMBER_PLAYERS = NUMBER_PLAYERS - 5;\n\t\t\t\t\tthis.varText = \": \" + NUMBER_PLAYERS;\n\t\t\t\t}\n\t\t\t\tif(this.text == \"Moves\" && NUMBER_MOVES > 50){\n\t\t\t\t\tNUMBER_MOVES = NUMBER_MOVES - 10;\n\t\t\t\t\tthis.varText = \": \" + NUMBER_MOVES\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}", "title": "" }, { "docid": "326d4a4a6292738873cf7f268e4d395d", "score": "0.613148", "text": "function choose(abOne, abTwo, colOne, colTwo, srcOne, srcTwo){\n\n var x = event.x;\n var y = event.y;\n \n var rect = c.getBoundingClientRect();\n \n x -= rect.left;\n y -= rect.top;\n \n //console.log(\"\" + x + \", \" + y);\n \n if(y>=475 && y<=490){\n if(x>=510 && x<=560){\n abilities.push(abOne);\n console.log(abOne);\n color = colOne;\n ctx.fillStyle=\"#FFFFFF\";\n ctx.fillRect(508,360,230,200);\n survivor_medium.src = srcOne;\n c.removeEventListener(\"mousedown\", select, 200);\n } else if(x>=590 && x<=628){\n abilities.push(abTwo)\n console.log(abTwo);\n color=colTwo;\n ctx.fillStyle=\"#FFFFFF\";\n ctx.fillRect(508,360,230,200);\n survivor_medium.src = srcTwo;\n c.removeEventListener(\"mousedown\", select, 200);\n }\n }\n}", "title": "" }, { "docid": "2897afd340820fb29b5d773f7978ca3e", "score": "0.6121204", "text": "function mouseClicked() {\n if(mouseX>=500 && mouseX<=980 && mouseY>=410 && mouseY<=550 && turn == true && playable){\n playerAttack();\n console.log(enemyHP+enemyName);\n } else if (mouseX>=500 && mouseX<=980 && mouseY>=410 && mouseY<=550 && turn == false && playable) {\n enemyAttack();\n console.log(playerHP+playerName);\n } else if (mouseX>=500 && mouseX<=980 && mouseY>=550 && mouseY<=730) {\n playerHP = 100;\n enemyHP = 100;\n turn = true;\n playable = true;\n clearMessage();\n }\n}", "title": "" }, { "docid": "767d05a32419f84646dfb155c2d9eda2", "score": "0.61159956", "text": "canvasClickHandler(ev, johny, level, mainPage){\r\n\t\tif(this.paused == true){\r\n\t\t\tif(level.arrayPause[0].mouseOverBoundingBox(ev)){\r\n\t\t\t\tjohny.audioControl(true, true);\r\n\t\t\t}\r\n\t\t\telse if(level.arrayPause[1].mouseOverBoundingBox(ev)){\r\n\t\t\t\tjohny.audioControl(true, false);\r\n\t\t\t}\r\n\t\t\telse if(level.arrayPause[2].mouseOverBoundingBox(ev)){\r\n\t\t\t\tjohny.audioControl(false, true);\r\n\t\t\t}\r\n\t\t\telse if(level.arrayPause[3].mouseOverBoundingBox(ev)){\r\n\t\t\t\tjohny.audioControl(false, false);\r\n\t\t\t}\r\n\t\t\telse if(level.arrayPause[4].mouseOverBoundingBox(ev)){\r\n\t\t\t\tmainPage.postMessage(\"back\",\"*\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(johny.dead || johny.finish){\r\n\t\t\tif(level.arrayPause[4].mouseOverBoundingBox(ev)){\r\n\t\t\t\tmainPage.postMessage(\"back\",\"*\");\r\n\t\t\t}\r\n\t\t}\r\n }", "title": "" }, { "docid": "89c46db3a7305335218d00780dccb7f3", "score": "0.6115978", "text": "mouseClick(){\n\t\tif (dist(this.xCoord, this.yCoord, mouseX, mouseY) < 12) {\n\t\t\tif (this.isActive == false) {\n\t\t\t\tthis.isActive = true;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.isActive = false;\n\t\t}\n\t}", "title": "" }, { "docid": "5477527c010b7f169ffd863589e86437", "score": "0.61105406", "text": "function handleClick(e){\n const cell = e.target;\n const currentClass = circleTurn ? oClass : xClass;\n placeMark(cell, currentClass); //marks the current class with className X Or O\n if(checkWinner(currentClass)){\n endGame(false)\n }else if(isDraw()){\n endGame(true)\n }else{\n swapTurns();\n }\n\n}", "title": "" }, { "docid": "d76708cdd5467ba33bef02798e133042", "score": "0.6107996", "text": "clicked(player){\n if(player === \"one\"){\n //race counter just counter up until it reaches the distance required\n if(this.raceCounter<100){\n if(key===\"a\"||key===\"d\"){\n this.counter = this.counter+1;\n this.raceCounter = this.raceCounter+1;\n this.x += this.dx;\n }\n }\n else if(this.raceCounter >=100 && this.winTwo === false){\n this.winOne = true;\n }\n }\n if(player === \"two\"){\n if(this.raceCounter<100){\n if(key===\"h\" || key===\"k\"){\n this.counter = this.counter + 1;\n this.raceCounter = this.raceCounter + 1;\n this.x += this.dx;\n }\n }\n else if (this.raceCounter >=100 && this.winOne === false){\n this.winTwo = true;\n }\n }\n\n }", "title": "" }, { "docid": "8115dad1f13f02d414f2fb552ed1e332", "score": "0.6106185", "text": "function mouseClicked() {\n\n\t\t//Tests for X and Y\n\t\t//createDiv('Mouse X :' + mouseX + 'Mouse Y :' + mouseY);\n //Code for xy coordinate multiple choice\n if (md >= 16) {\n\t\t//Wrong ans 1\n\t\tif(mouseX >= 158 && mouseY >= 280 && mouseX <= 195 && mouseY <= 330)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Right ans 2\n\t\tif(mouseX >= 160 && mouseY >= 398 && mouseX <= 200 && mouseY <= 440)\n\t\t\tgreeting.html('Correct!');\n\t\t//Wrong ans 3\n\t\tif(mouseX >= 170 && mouseY >= 493 && mouseX <= 213 && mouseY <= 532)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Wrong ans 4\n\t\tif(mouseX >= 185 && mouseY >= 610 && mouseX <= 221 && mouseY <= 650)\n\t\t\tgreeting.html('Correct!');\n\t\t//Wrong ans 4\n\t\tif(mouseX >= 195 && mouseY >= 705 && mouseX <= 240 && mouseY <= 750)\n\t\t\tgreeting.html('Incorrect!');\n\t }\n}", "title": "" }, { "docid": "a2f3d1540491760d98f34b442f298189", "score": "0.6103862", "text": "function logic(e) {\n\n if (e.target !== e.currentTarget) {\n\n var ligne = e.target.id.substring(1,2);\n var colonne = e.target.id.substring(2,3);\n\n if (jeux[ligne][colonne] == 0) {\n e.target.style.background = '#bbb';\n\n jeux[ligne][colonne] = 3;\n score++;\n\n } else if (jeux[ligne][colonne] == 1) {\n e.target.style.background = 'red';\n\n jeux[ligne][colonne] = 2;\n score++;\n\n nombrePrises++;\n //fin de la partie\n if (nombrePrises == 17) {\n alert(\"All enemy battleships have been defeated! You win!\");\n alert('your score is '+score+' click');\n $('#score').css('text-align', 'left').css('font-size', '150%').css('color', 'green');\n $('#score').text('your win after '+score+' clicks');\n }\n\n // en cas de click une deuxieme fois dans une cellule selectionnée\n } else if (jeux[ligne][colonne] > 1) {\n alert(\"Stop wasting your torpedos! You already fired at this location.\");\n }\n }\n e.stopPropagation();\n }", "title": "" }, { "docid": "ecf6a5d059d905a5271f9465dc16e95c", "score": "0.60981864", "text": "clickEvent(code) {\n if (this.input.getKey(\"special\") == code) {\n this.special();\n }\n if(this.input.getKey(\"damage\") == code){\n this.attack();\n }\n }", "title": "" }, { "docid": "1f689376122db58c3aefee603e3d4eba", "score": "0.6090971", "text": "function C101_KinbakuClub_ClubRoom1_Click() {\n\n\t// When the user clicks on any character (screen is divided in 4, 3rd can be the player)\n\tif ((MouseX >= 15) && (MouseX <= 115) && (MouseY >= 520) && (MouseY <= 580)) SetScene(CurrentChapter, \"ClubRoom3\");\n\tif ((MouseX >= 1085) && (MouseX <= 1185) && (MouseY >= 520) && (MouseY <= 580)) SetScene(CurrentChapter, \"ClubRoom2\");\n\tif ((MouseX >= 0) && (MouseX <= 215) && (MouseY >= 45) && (MouseY <= 350)) SetScene(CurrentChapter, \"Door\");\n\n\t// Checks if the user clicks on any regular item\n\tInventoryClick(GetClickedInventory(), \"C101_KinbakuClub\", \"ClubRoom1\");\n\n}", "title": "" }, { "docid": "6d1baa19cd5949fd8e79ff092080055d", "score": "0.6090251", "text": "function C101_KinbakuClub_ClubRoom1_Click() {\n\n\t// When the user clicks on any character (screen is divided in 4, 3rd can be the player)\n\tif ((MouseX >= 15) && (MouseX <= 115) && (MouseY >= 520) && (MouseY <= 580)) SetScene(CurrentChapter, \"ClubRoom3\");\n\tif ((MouseX >= 1085) && (MouseX <= 1185) && (MouseY >= 520) && (MouseY <= 580)) SetScene(CurrentChapter, \"ClubRoom2\");\n\tif ((MouseX >= 0) && (MouseX <= 215) && (MouseY >= 45) && (MouseY <= 350)) SetScene(CurrentChapter, \"Door\");\n\tif ((MouseX >= 235) && (MouseX <= 650) && (MouseY >= 140) && (MouseY <= 510)) SetScene(CurrentChapter, \"Lauren\");\n\n\t// Checks if the user clicks on any regular item\n\tInventoryClick(GetClickedInventory(), \"C101_KinbakuClub\", \"ClubRoom1\");\n\n}", "title": "" }, { "docid": "e428314c7c3e63ad6cc60707f2ab2e36", "score": "0.608285", "text": "action ( type, px, py, evt ) {}", "title": "" }, { "docid": "9cf87de76b3e0058491f8ece8b4aff98", "score": "0.6080215", "text": "clicked(px, py) {\n let d = dist(px, py, this.x, this.y);\n if (d < this.r)\n if (px > this.x && px < this.x + this.r && py > this.y && py < this.y + this.r) {\n\n this.screm = screms[ Math.round(random(screms.length-1)) ]\n }\n }", "title": "" }, { "docid": "eab8f6b1cb47df88f40320937e55da5e", "score": "0.6062025", "text": "function handleClick() {\n if (!runTimer) timerID = setInterval(gameTimer, 1000);\n runTimer = true;\n var row = parseInt($(this).parent().attr('data-rowNum'));\n var column = parseInt($(this).attr('data-columnNum'));\n if (winner || gameOver) {\n return;\n } else if (board[row][column].mine) {\n explosionCoordinates = [row, column];\n gameOver = true;\n } else {\n expandShownCells(row, column);\n calculateWinner();\n }\n\n render();\n}", "title": "" }, { "docid": "d3030574f39902d3d619c99cca4e0af9", "score": "0.6049503", "text": "function on_click(event) {\r\n\r\n //console.log(\"Click event at X=\" + event.offsetX + \", Y=\" + event.offsetY);\r\n\r\n if (board.isGameover()) {\r\n console.log(\"The game is over - no action to take\");\r\n return;\r\n }\r\n\r\n if (canvasLocked) {\r\n console.log(\"The canvas is logically locked - this happens while the previous click is being processed\");\r\n return;\r\n } \r\n\r\n var row = Math.floor(event.offsetY / TILE_SIZE);\r\n var col = Math.floor(event.offsetX / TILE_SIZE);\r\n\r\n //console.log(\"Resolved to Col=\" + col + \", row=\" + row);\r\n\r\n var message;\r\n\r\n if (row >= board.height || row < 0 || col >= board.width || col < 0) {\r\n console.log(\"Click outside of game boundaries!!\");\r\n return;\r\n\r\n } else if (analysisMode) { // analysis mode\r\n\r\n var button = event.which\r\n\r\n var tile = board.getTileXY(col, row);\r\n\r\n var tiles = [];\r\n\r\n if (button == 1) { // left mouse button\r\n\r\n if (tile.isFlagged()) { // no point clicking on an tile with a flag on it\r\n console.log(\"Tile has a flag on it - no action to take\");\r\n return;\r\n }\r\n\r\n if (!board.isStarted()) {\r\n board.setStarted();\r\n }\r\n\r\n // allow for dragging and remember the tile we just changed\r\n dragging = true;\r\n dragTile = tile;\r\n\r\n if (tile.isCovered()) {\r\n var flagCount = board.adjacentFoundMineCount(tile);\r\n tile.setValue(flagCount);\r\n } else {\r\n tile.setCovered(true);\r\n }\r\n\r\n tiles.push(tile);\r\n\r\n } else if (button == 3) { // right mouse button\r\n\r\n // toggle the flag and return the tiles which need to be redisplayed\r\n tiles = analysis_toggle_flag(tile);\r\n\r\n console.log(\"Number of bombs \" + board.num_bombs + \" bombs left to find \" + board.bombs_left);\r\n }\r\n\r\n // update the graphical board\r\n window.requestAnimationFrame(() => renderTiles(tiles));\r\n\r\n } else { // play mode\r\n var button = event.which\r\n\r\n var tile = board.getTileXY(col, row);\r\n\r\n if (button == 1) { // left mouse button\r\n\r\n if (tile.isFlagged()) { // no point clicking on an tile with a flag on it\r\n console.log(\"Tile has a flag on it - no action to take\");\r\n return;\r\n }\r\n\r\n if (!board.isStarted()) {\r\n //message = {\"id\" : \"new\", \"index\" : board.xy_to_index(col, row), \"action\" : 1};\r\n board.setStarted();\r\n }\r\n\r\n //if (!tile.isCovered()) { // no point clicking on an already uncovered tile\r\n //\tconsole.log(\"Tile is already revealed - no action to take\");\r\n //\treturn;\r\n //}\r\n\r\n if (!tile.isCovered()) { // clicking on a revealed tile is considered chording\r\n if (board.canChord(tile)) {\r\n message = { \"header\": board.getMessageHeader(), \"actions\": [{ \"index\": board.xy_to_index(col, row), \"action\": 3 }] }; //chord\r\n } else {\r\n console.log(\"Tile is not able to be chorded - no action to take\");\r\n return;\r\n }\r\n\r\n } else {\r\n message = { \"header\": board.getMessageHeader(), \"actions\": [{ \"index\": board.xy_to_index(col, row), \"action\": 1 }] }; // click\r\n }\r\n\r\n } else if (button == 3) { // right mouse button\r\n\r\n if (!tile.isCovered()) { // no point flagging an already uncovered tile\r\n return;\r\n }\r\n\r\n if (!board.isStarted()) {\r\n console.log(\"Can't flag until the game has started!\");\r\n return;\r\n } else {\r\n message = { \"header\": board.getMessageHeader(), \"actions\": [{ \"index\": board.xy_to_index(col, row), \"action\": 2 }] };\r\n }\r\n }\r\n }\r\n\r\n // we don't need to send a message if we are drawing a board in analysis mode\r\n if (!analysisMode) {\r\n // one last check before we send the message\r\n if (canvasLocked) {\r\n console.log(\"The canvas is logically locked\");\r\n return;\r\n } else {\r\n canvasLocked = true;\r\n }\r\n\r\n justPressedAnalyse = false;\r\n\r\n var reply = sendActionsMessage(message);\r\n }\r\n\r\n}", "title": "" }, { "docid": "c14113d36769b262658a5b1a79e98b2f", "score": "0.60423917", "text": "function clickHandler(event) {\r\n if(flag>=1) {\r\n treasureLocation= randomTreasureLocation();\r\n flag--;\r\n }\r\n console.log(\"Click is at co-ordinate (x)\"+ event.pageX+ '(Y)'+event.pageY);\r\n distaceOfTC();\r\n xCoordinate = event.pageX;\r\n yCoordinate = event.pageY;\r\n countClick++;\r\n}", "title": "" }, { "docid": "681f564d38918357b55bc38a1eda0dbb", "score": "0.6032996", "text": "function click() {\r\n if (BOARD.turn !== PLAYER_TEAM) return;\r\n\r\n if (BOARD.selected) {\r\n selected_click(this.id);\r\n }\r\n else {\r\n not_selected_click(this.id);\r\n }\r\n\r\n}", "title": "" }, { "docid": "1095b8c6ae354c3871356263b2bdf377", "score": "0.6027029", "text": "function SelectCheck(event){ \r\n\tvar rect = canvas.getBoundingClientRect();\r\n\tvar cX = event.clientX - rect.left;\r\n\tvar cY = event.clientY - rect.top;\r\n\tYy = 0;\r\n\t\r\n\tif(Within(cY,1180,1180+80) && Explorationmode == 0){ //mode switch buttons\r\n\t\tconsole.log(\"buttons\");\r\n\t\tif(Within(cX,180,180+80)){\r\n\t\t\tconsole.log(\"switching to resources mode\")\r\n\t\t\tMode = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(Within(cX,360,360+80)){\r\n\t\t\tconsole.log(\"switching to reserach mode\")\r\n\t\t\tMode = 1;\r\n\t\t}\r\n\t\t\r\n\t\tif(Within(cX,540,540+80)){\r\n\t\t\tconsole.log(\"switching to exploration mode\")\r\n\t\t\tMode = 2;\r\n\t\t}\r\n\t}\r\n\r\n\tif(Mode == 0){ //Resource mode buttons check\t\r\n\t\tfor(var i = 0; i < Resources.length; i++){\r\n\t\t\tif(Resources[i].Res_Discovered == true){\r\n\t\t\t\tYy = Resources[i].Res_BarHeight;\r\n\t\t\t\tif(Within(cY,Yy,Yy+80)){\r\n\t\t\t\t\tconsole.log(\"region detected: \" + Resources[i].Res_Name);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(Within(cX,420,500)){\r\n\t\t\t\t\t\tconsole.log(\"New auto pressed\")\r\n\t\t\t\t\t\tConstruct_Auto(i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(Within(cX,520,600)){\r\n\t\t\t\t\t\tconsole.log(\"Dismantle auto pressed\")\r\n\t\t\t\t\t\tDismantle_Auto(i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(Within(cX,620,700)){\r\n\t\t\t\t\t\tconsole.log(\"Manual task pressed\")\r\n\t\t\t\t\t\tPerform_Task(i);\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}\r\n\t\r\n\tif(Mode == 1){ //Research mode buttons check\t\r\n\t\tfor(var i = 0; i < Research.length; i++){\r\n\r\n\t\t\tif(Research[i].Research_Status == 1){\r\n\t\t\t\tYy = Research[i].Res_BarHeight;\r\n\t\t\t\tif(Within(cY,Yy,Yy+80)){\r\n\t\t\t\t\tconsole.log(\"region detected: \" + Research[i].Research_Name);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(Within(cX,620,700)){\r\n\t\t\t\t\t\tconsole.log(\"Research pressed\")\r\n\t\t\t\t\t\tBuy_Research(i);\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}\r\n\t\t\r\n\tif(Mode == 2){ //exploration mode buttons check\r\n\t\tif (Explorationmode == 0){ //List mode\r\n\t\t\tfor(var i = 0; i < Exp.length; i++){\r\n\t\t\t\tYy = Exp[i].BarHeight;\r\n\t\t\t\tif(Exp[i].Discovered == 1){\r\n\t\t\t\t\tif(Within(cY,Yy+20,Yy+80)){\r\n\t\t\t\t\t\tconsole.log(\"region detected: \" + Exp.Exp_Name);\r\n\t\t\t\t\t\tif(Within(cX,620,700)){\r\n\t\t\t\t\t\t\tconsole.log(\"Explore pressed\")\r\n\t\t\t\t\t\t\tstoryactive = i;\r\n\t\t\t\t\t\t\tExplorationDrawer_list_button(storyactive);\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}\t\r\n\t\t}\r\n\t\telse{ //story mode\r\n\t\t\tif(expbuttoncount != 0){\r\n\t\t\t\tfor(var i = 0; i < expbuttoncount; i++){\r\n\t\t\t\t\tYy = ExpBoxes[i];\r\n\t\t\t\t\tif(Within(cY,Yy,Yy+BoxHeight)){\r\n\t\t\t\t\t\tif(Within(cX,BoxX,BoxX+BoxWidth)){\r\n\t\t\t\t\t\t\tconsole.log(\"Explore deeper pressed\")\r\n\t\t\t\t\t\t\tTag = i;\r\n\t\t\t\t\t\t\tExploration_story_button(storyactive);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "65399567be1bd2820dcfbd3230d79b1d", "score": "0.6021524", "text": "function click() {\n\t\t//Capture the random number based on the crystal clicked \n\t\tvar crystalValue = ($(this).attr(\"data_crystalValue\"));\n\t\tcrystalValue = parseInt(crystalValue);\n\t\t//Append the current score with the random number \n\t\t//of the crystal selected by user\n\t\tcurrentScore += crystalValue;\n\t\t$(\"#currentScore\").html(currentScore);\n\t\t//Check if selected score is same as the target score \n\t\tif(currentScore == targetNumber){\n\t\t\t//increment win counter and reset the data\n\t\t\twin++;\n\t\t\t$(\"#win\").html(win);\n\t\t\treset();\n\t\t}else if(currentScore > targetNumber){ //if user seclection exceeds \n\t\t\t//increment lose counter and reset the data\n\t\t\tlose++;\n\t\t\t//$(\"#lose\").html(\"<h2>\" + lose + \"</h2>\");\n\t\t\t$(\"#lose\").html(lose);\n\t\t\treset();\n\t\t}\n\t}", "title": "" }, { "docid": "d4eedf8551c46b2ebcc7d74a82ee70c9", "score": "0.60206574", "text": "click(boardRenderer, renderer) { }", "title": "" }, { "docid": "709e3171a73fd85af89af7c72fc07f87", "score": "0.60112417", "text": "handleClick () {\n\t\tthis.props.tileClick(this.props.position, this.props.character)\n\t}", "title": "" }, { "docid": "0ea24c22bd1c630fad9686ca4f147065", "score": "0.6009261", "text": "function clickHandler() {\n let x = this.id;\n if (board[x] === \"\" && turn === 0) {\n board[x] = \"x\";\n this.setAttribute(\"id\", \"p1\");\n isOver(\"x\");\n progress++;\n updateProgress(progress);\n turn++;\n } else if (board[x] === \"\" && turn === 1) {\n board[x] = \"o\";\n this.setAttribute(\"id\", \"p2\");\n isOver(\"o\");\n progress++;\n updateProgress(progress);\n turn = turn - 1;\n }\n}", "title": "" }, { "docid": "733ee3b62e08c6bbb3319d961c55c0d4", "score": "0.5993516", "text": "function handleClick(e){\nconst cell = e.target \nconst currentClass = circleTurn ? CIRCLE_CLASS : X_CLASS\nplaceMark(cell, currentClass)\nif(checkWin(currentClass)){\nendGame(false)\n}\nelse if(isDraw()){\n endGame(true)\n}\nelse {\n swapTurns()\n setBoardHoverClass()\n}\n\n}", "title": "" }, { "docid": "eb7995965b8088ceb949d173b062b5dc", "score": "0.5992693", "text": "function enemySelectScreen() {\n $(\"#choicesSection\").on(\"click\", \".character\", function() {\n if (!enemySelected) {\n enemySelected = true;\n //Assigning the selected character to enemyChar\n enemyChar = $(this);\n renderEnemyScreen(enemyChar);\n }\n });\n }", "title": "" }, { "docid": "c6f6ad9c2825440d69782dc54a727081", "score": "0.5990652", "text": "click(c)\n {\n if (c.x < this.pos.x){ return; }\n if (c.y < this.pos.y){ return; }\n\n console.log(\"DEBUG: click on info panel.\");\n }", "title": "" }, { "docid": "4362799aa11d0c1b150dfd70393d5663", "score": "0.5988799", "text": "function AnimalImageClickFunction(animal)\n{\n\tvar player = game.player0;\n\tif (game.right) player = game.player1;\n\n\tif (animal.continent.checkpoints[0].right == game.right) \n\t{\n\t\tif (player.currentAnimal == null && player.animalsCaptured.indexOf(animal) == -1) \n\t\t{\n\t\t\tplayer.currentAnimal = animal;\n\t\t\tplayer.animalSelected = true;\n\t\t\tanimal.selected = true;\n\t\t\tShadowAnimalImage(animal);\n\t\t\tAnimalSelected(player, animal);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "56f0aaa79c76c8c3a79aeb310def99c9", "score": "0.59809506", "text": "creatuerEditorClickHandler(clickPositionX,clickPositionY){\n\n //First we check if the click was in the creature list on the left of the screen\n if(clickPositionX < this.creatureListWidth){\n if(clickPositionY < 30){\n console.log(\"UP!\");\n if(this.creatureScrollIndex > 0){\n this.creatureScrollIndex--;\n console.log(this.creatureScrollIndex);\n this.updateScreen();\n }\n }\n else if(clickPositionY > this.canvas.height - 30){\n console.log(\"DOWN\");\n if(this.creatureScrollIndex < player.myCreatures.length - 8){\n this.creatureScrollIndex++;\n console.log(this.creatureScrollIndex);\n this.updateScreen();\n }\n else{\n console.log(\"End of list!\");\n }\n }\n //If the click was not on one of the scroll buttons, it must have been on one of our Creatures\n else{\n this.selectedCreature = Math.floor((clickPositionY-30)/95) + this.creatureScrollIndex;\n this.skillScrollIndex = 0;\n this.updateScreen();\n console.log(this.selectedCreature);\n }\n }\n\n //check to see if the add/remove from party button was pressed\n if(clickPositionX > 210 && clickPositionX < 420 && clickPositionY > 170 && clickPositionY < 205){\n this.addRemoveParty();\n }\n\n //Check to see if the click was in the Memorized Skills box\n if(clickPositionX > 870 && clickPositionX < 1190 && clickPositionY > 100 && clickPositionY < 405){\n if((clickPositionY - 100)%50 > 24 && (clickPositionY - 100)%50 < 42){\n var heightIndex = Math.floor((clickPositionY - 100)/50);\n console.log( (clickPositionY - 100)%50 + \" MEMORIZED SKILLS \" + heightIndex);\n player.myCreatures[this.selectedCreature].equipLearnedSkill(player.myCreatures[this.selectedCreature].memorizedSkills[heightIndex + this.skillScrollIndex][0]);\n this.updateScreen();\n }\n\n }\n\n //Check to see if the player is unequipping the selected Creature's item\n if(clickPositionX > 280 && clickPositionX < 350 && clickPositionY > 585 && clickPositionY < 603){\n console.log(\"UNEQUIP\");\n player.myCreatures[this.selectedCreature].unequip(3);\n this.updateScreen();\n }\n //Check to see if the player is unequipping the Creature's organs\n else if(clickPositionX > 500 && clickPositionX < 570){\n if(clickPositionY > 185 && clickPositionY < 200){\n //Store whether or not this creature is in the player's party\n this.isInParty = false;\n for(let x = 0; x < player.myCombatCreatures.length; x++){\n if(player.myCombatCreatures[x] == this.selectedCreature){\n this.isInParty = true;\n }\n }\n //Body can only be unequipped if the creature is not in the party\n if(!this.isInParty){\n player.myCreatures[this.selectedCreature].unequip(0);\n console.log(\"UNEQUIP 1\");\n this.updateScreen();\n }\n }\n else if(clickPositionY > 385 && clickPositionY < 400){\n player.myCreatures[this.selectedCreature].unequip(1);\n console.log(\"UNEQUIP 2\");\n this.updateScreen();\n }\n else if(clickPositionY > 585 && clickPositionY < 600){\n player.myCreatures[this.selectedCreature].unequip(2);\n console.log(\"UNEQUIP 3\");\n this.updateScreen();\n }\n }\n\n //Check if the click was on the left/right scroll buttons for the Organ list\n if(clickPositionX > 310 && clickPositionX < 345 && clickPositionY > 620 && clickPositionY < 790){\n if(this.organScrollIndex > 0){\n this.organScrollIndex--;\n }\n this.updateScreen();\n }\n else if(clickPositionX > 1155 && clickPositionX < 1190 && clickPositionY > 620 && clickPositionY < 790){\n if(this.organScrollIndex < player.inventoryList[this.selectedOrganType].length - 4){\n this.organScrollIndex++;\n }\n this.updateScreen();\n }\n\n //If the click was not in the creature list, we check if it's one of the body part buttons\n if(clickPositionX > this.creatureListWidth + 10 && clickPositionX < this.creatureListWidth + 100){\n if(clickPositionY > 620 && clickPositionY < 655){\n this.selectedOrganType = 0;\n this.organScrollIndex = 0;\n this.updateScreen();\n console.log(\"BONES\");\n }\n else if(clickPositionY > 665 && clickPositionY < 700){\n this.selectedOrganType = 1;\n this.organScrollIndex = 0;\n this.updateScreen();\n console.log(\"GUTS\");\n }\n else if(clickPositionY > 710 && clickPositionY < 745){\n this.selectedOrganType = 2;\n this.organScrollIndex = 0;\n this.updateScreen();\n console.log(\"SKIN\");\n }\n else if(clickPositionY > 755 && clickPositionY < 790){\n this.selectedOrganType = 3;\n this.organScrollIndex = 0;\n this.updateScreen();\n console.log(\"ITEM\");\n }\n }\n\n //Checking if the click was on one of the \"Equip\" organ buttons\n if(clickPositionY > 764 && clickPositionY < 785){\n if(clickPositionX > 420 && clickPositionX < 485){\n //console.log(player.myOrgans[this.selectedOrganType][this.organScrollIndex][1]);\n this.equipOrgan(this.organScrollIndex);\n }\n else if(clickPositionX > 620 && clickPositionX < 685){\n //console.log(player.myOrgans[this.selectedOrganType][this.organScrollIndex + 1][1]);\n this.equipOrgan(this.organScrollIndex + 1);\n }\n else if(clickPositionX > 820 && clickPositionX < 885){\n //console.log(player.myOrgans[this.selectedOrganType][this.organScrollIndex + 2][1]);\n this.equipOrgan(this.organScrollIndex + 2);\n }\n else if(clickPositionX > 1020 && clickPositionX < 1085){\n //console.log(player.myOrgans[this.selectedOrganType][this.organScrollIndex + 3][1]);\n this.equipOrgan(this.organScrollIndex + 3);\n }\n\n }\n\n //Checking if the click was on the \"BACK\" button\n if(clickPositionX > canvas.width - 70 && clickPositionX < canvas.width - 10 && clickPositionY > 10 && clickPositionY < 30){\n console.log(\"BACK\");\n //Go to the World Map\n setGameMode(5);\n }\n\n }", "title": "" }, { "docid": "ff02a037bc7f0ce923417d1a192748ed", "score": "0.59779567", "text": "function clicked(M_pos){\n\tif(click_check(M_pos,player)){\t\t\n\t\tfor(var i=0; i<bugs.length; i++){\n\t\t\tbugs[i].select();\n\t\t}\n\t\treturn;\n\t}\t\n\t\n\tvar counter = 0;\n\tfor(var i=0; i<bugs.length;i++){\n\t\tif(click_check(M_pos, bugs[i])){\n\t\t\t\tbugs[i].click();\n\t\t\t\tcounter+=1;\n\t\t}\n\t}\n\tif(counter === 0){\n\t\tfor(var i=0; i<bugs.length; i++){\n\t\t\tbugs[i].deselect();\n\t\t}\n\t\treturn;\n\t}\n}", "title": "" }, { "docid": "704d4413b5c955ded38b4448b8085b1c", "score": "0.5972864", "text": "function mouseClick(event){\n\n var eventCaught = false;\n\n //get the event number\n if(event.which===1){ //left-click\n var canvasClickX = event.pageX - canvas.offsetLeft;\n var canvasClickY = event.pageY - canvas.offsetTop;\n\n console.log(\"mouse click at \" + canvasClickX + \", \" + canvasClickY);\n //check to see if a local unit was clicked\n for(var i=0; i< simState.arrLocalUnits.length; i++){\n if(simState.arrLocalUnits[i].BolIsClickedOn(canvasClickX, canvasClickY)){\n ChangeMovementSelectionState( simState.arrLocalUnits[i]);\n eventCaught = true;\n }\n }\n }\n if(!eventCaught){ //the event was not caught by a unit, so set a new indexOfTarget for selected units\n SetUnitMovementGoal(canvasClickX, canvasClickY);\n SendUnitList();\n }\n}", "title": "" }, { "docid": "b4ead5ead83c5aad39f72c46dc857956", "score": "0.59725654", "text": "function select() {\n $(\".character\").on(\"click\", function () {\n //if (isCharSelect === false && isDefenderSelect === false){\n // prepend click image to character box\n $(\"#charbox\").prepend($(this));\n //console.log(this);\n // then prepend the rest to enemies box\n $(\"#enembox\").prepend($(\".allchar\"));\n //$(\".allchar .image\").attr(\"style\", \"background:red\");\n $(\".allchar .image\").attr(\"class\", \"col-2 image character enem\");\n isCharSelect = true;\n\n $(\".character\").off(\"click\");\n console.log(\"Is My Charater select yet? \" + isCharSelect)\n selectChar = $(this).attr(\"id\");\n console.log(\"My character is \" + selectChar)\n //}\n getCharAtr();\n charOriginalAtt = charAtt;\n enemies();\n console.log(\"--------------------------\");\n })\n //END select()\n }", "title": "" }, { "docid": "39cd992022dbb8241429d785a12e178e", "score": "0.59648967", "text": "function cellClicked(e) {\n if (gameOver) {\n reset();\n }\n\n if (clickCount > 2) {\n checkWinner();\n } else if (clickCount === 9) {\n itsADraw();\n \n }\n\n togglePlayer(event)\n}", "title": "" }, { "docid": "67a98efcfe6f5c8d6f8ce97a07d3f22f", "score": "0.5958691", "text": "function clicky(e) {\n //We only want to handle clicks if it is currently our turn\n if ( theGame.turn != player ) {\n return;\n }\n\n var xCoord = e.offsetX;\n var yCoord = e.offsetY;\n\n var oneThird = canvas.width/3;\n\n //Figure out which little board was clicked on\n var xBoard = Math.floor(xCoord/oneThird);\n var yBoard = Math.floor(yCoord/oneThird);\n\n //Figure out which location on little board was clicked on\n //**************************************************\n //Fix me! Add padding to calculations!\n var xLoc = Math.floor(3 * (xCoord - xBoard * oneThird) / oneThird);\n var yLoc = Math.floor(3 * (yCoord - yBoard * oneThird) / oneThird);\n\n //Check to see if turn is in the right board\n if ((xBoard == theGame.activeX && yBoard == theGame.activeY) || (theGame.activeX == -1)) {\n //Check to see if the turn is in an empty pace\n if (theGame.boards[xBoard][yBoard].state[xLoc][yLoc] == 0) {\n //Send move to server to be checked\n executeMove(xBoard, yBoard, xLoc, yLoc, theGame.room);\n }\n }\n}", "title": "" }, { "docid": "7bc1a8d765b899eaeb533ccc8f4343b0", "score": "0.5943105", "text": "function mousePressed() {\r\n var d = dist(mouseX, mouseY, e_x, e_y)\r\n var d2 = dist(mouseX, mouseY,(width / 2)+10, 400)\r\n if (d < e_radius) {\r\n newEye();\r\n score++;\r\n }\r\n if ((d2 < m_radius) && (medmode == true)) {\r\n medmode = false;\r\n //resetKey = true;\r\n //gameOver();\r\n timer = 0;\r\n }\r\n}", "title": "" }, { "docid": "49f8bbb125ab4c2bad5624a4c4c9679f", "score": "0.5942824", "text": "function handleClick(event) {\n const cell = event.target;\n const currentClass = circleTurn ? CIRCLE_CLASS : X_CLASS;\n placeMark(cell, currentClass);\n // This will check all winning arrays to see if anyone has won\n if (checkWin(currentClass)) {\n endGame(false);\n //This will check all arrays to see if a draw has happened \n } else if (isDraw()) {\n endGame(true);\n //If non of the above has happened it will become the next players turn\n } else {\n switchTurns();\n setBoardHoverClass();\n }\n}", "title": "" }, { "docid": "182093c09aed9db43638cdea27ceb6d0", "score": "0.5942544", "text": "function enemies() {\n $(\".enem\").on(\"click\", function () {\n //if (isCharSelect === true && isDefenderSelect === false ){\n $(\"#defender\").prepend($(this));\n $(this).attr(\"class\", \"col-2 image character def\");\n //$(\".def\").attr(\"style\", \"background:black; color:white\");\n isDefenderSelect = true;\n $(\".enem\").off(\"click\");\n //}\n console.log(\"Is Defender there? \" + isDefenderSelect);\n selectDefender = $(this).attr(\"id\");\n console.log(\"The Defender is \" + selectDefender)\n console.log(\"My char original attack is \" + charOriginalAtt);\n getDefAtr();\n fight();\n $(\".def\").off(\"click\");\n console.log(\"--------------------------\");\n })\n //END enemies()\n }", "title": "" }, { "docid": "a4935d5d78b6fe20f58ad1deafb452b6", "score": "0.5941882", "text": "function picking(gl, ev){\n\n var x = ev.clientX, y = ev.clientY;\n var rect = ev.target.getBoundingClientRect();\n\n if (rect.left <= x && x < rect.right && rect.top <= y && y < rect.bottom) {\n // If pressed position is inside <canvas>, check if it is above object\n var x_in_canvas = x - rect.left, y_in_canvas = rect.bottom - y;\n check(gl, x_in_canvas, y_in_canvas, ev);\n }\n \n}", "title": "" }, { "docid": "ce16b8ddb4c119b1984cbce2a08e1938", "score": "0.59369", "text": "function terrainChooseClick(){\r\n\tif(akcja == terrainChooseNumber){\r\n\t\takcja = -1;\r\n\t} else {\r\n\t\takcja = terrainChooseNumber;\r\n\t}\r\n\tterrainChooseDraw();\r\n}", "title": "" }, { "docid": "388d7c27335dc8870e4a5607e66c534b", "score": "0.5924529", "text": "function handleclick(e) {\n const cell = e.target;\n const currentClass = xTurn ? xClass : oClass;\n placeMark(cell, currentClass);\n //this means that it will check if the current class is still in there but if not dont endgame else if if it is a draw endgame true else kep playing\n if (checkWin(currentClass)) {\n endGame(false);\n } else if (isDraw()) {\n endGame(true);\n } else {\n swapTurn();\n setHoverBoardClass();\n }\n}", "title": "" }, { "docid": "373002aff616691ea7beebecc1ca3b72", "score": "0.5923381", "text": "function mouseClicked(e)\n{\n\tmouseX = e.pageX - ctx.canvas.offsetLeft;//X is the page minus the canvas left\n\tmouseY = e.pageY - ctx.canvas.offsetTop;//Y is the page minus the canvas top\n\tif(btnred.checkClicked())//Checks if red is clicked\n\t{\n\t\tstartFlashRed();\n\t}\n\tif(btnyellow.checkClicked())//Checks if yellow is clicked\n\t{\n\t\tstartFlashYellow();\t\t\n\t}\n\tif(btngreen.checkClicked())//Checks if green is clicked\n\t{\n\t\tstartFlashGreen();\t\t\n\t}\n\tif(btnblue.checkClicked())//Checks if blue is clicked\n\t{\n\t\tstartFlashBlue();\n\t}\n\tif(btncyan.checkClicked())//Checks if cyan is clicked\n\t{\n\t\tstartFlashCyan();\t\t\n\t}\n\tif(btnbrown.checkClicked())//Checks if brown is clicked\n\t{\n\t\tstartFlashBrown();\t\t\n\t}\n\tif(btngrey.checkClicked())//Checks if grey is clicked\n\t{\n\t\tstartFlashGrey();\t\t\n\t}\n\tif(btnorange.checkClicked())//Checks if orange is clicked\n\t{\n\t\tstartFlashOrange();\n\t}\n\tif(btnpurple.checkClicked())//Checks if purple is clicked\n\t{\n\t\tstartFlashPurple();\n\t}\n\tif(btnstart.checkClicked())//Checks if the start button is clicked\n\t{\n\t\tstartGameOne();//Starts stage one\n\t\t//Makes the button unclickable\n\t\tbtnstart.xleft = 0;\n\t\tbtnstart.xright = 0;\n\t\tbtnstart.ytop =0;\n\t\tbtnstart.ybottom = 0;\n\t}\n\tif(btnover.checkClicked())//Checks if the over button is clicked\n\t{\n\t\tlocation.reload();\n\t\t//Makes it unclickable\n\t\tbtnover.xleft = 0;\n\t\tbtnover.xright = 0;\n\t\tbtnover.ytop =0;\n\t\tbtnover.ybottom = 0;\n\t}\n}", "title": "" }, { "docid": "14e6cf6b0bac406711ef64e545049d43", "score": "0.5920807", "text": "click(event) {\n this.clickPersons(event);\n this.clickWeddings(event);\n reDraw();\n }", "title": "" }, { "docid": "685f78b7f032c0ccd002bb351024c23d", "score": "0.59194726", "text": "function onMouseDown(e) {\n if (gamestate !== 2) {\n // Get the mouse position\n var pos = getMousePos(canvas, e);\n hinttimer = 60;\n\n // Start dragging\n if (!drag) {\n // Get the tile under the mouse\n mt = getMouseTile(pos);\n\n if (mt.valid && mainmenu != true && helpmenu != true && gameover != true && beginninganim != true) {\n // Valid tile\n createjs.Sound.play(\"Buttonclick\");\n\n var swapped = false;\n if (level.selectedtile.selected) {\n if (mt.x == level.selectedtile.column && mt.y == level.selectedtile.row) {\n // Same tile selected, deselect\n level.selectedtile.selected = false;\n drag = true;\n return;\n } else if (canSwap(mt.x, mt.y, level.selectedtile.column, level.selectedtile.row)) {\n // Tiles can be swapped, swap the tiles\n mouseSwap(mt.x, mt.y, level.selectedtile.column, level.selectedtile.row);\n swapped = true;\n }\n }\n\n if (!swapped) {\n // Set the new selected tile\n level.selectedtile.column = mt.x;\n level.selectedtile.row = mt.y;\n level.selectedtile.selected = true;\n }\n } else {\n // Invalid tile\n level.selectedtile.selected = false;\n }\n\n // Start dragging\n drag = true;\n }\n\n // Check if a button was clicked\n for (var i = 0; i < buttons.length; i++) {\n if (buttons[i].visible === true && beginninganim != true) {\n if (pos.x >= buttons[i].x && pos.x < buttons[i].x + buttons[i].width &&\n pos.y >= buttons[i].y && pos.y < buttons[i].y + buttons[i].height) {\n\n // Button i was clicked\n createjs.Sound.play(\"Buttonclick\");\n\n switch (i) {\n case 0:\n // Open help menu\n mainmenu = true;\n buttonSwitchManager(false,false,false,false,false,false);\n break;\n\n case 1:\n // hint button\n hinttimer = 1;\n break;\n \n case 2:\n //help menu resume button\n helpmenu = false;\n if (mainmenu !=true)\n {\n buttonSwitchManager(true,true,false,false,false,false);\n }\n else if (mainmenu === true) {\n buttonSwitchManager(false,false,true,true,false,false);\n }\n break;\n\n case 3:\n //main menu play button\n beginninganim = true;\n\n setTimeout(function () {\n switchmanager(\"anim\");\n }, 1000);\n setTimeout(function () {\n switchmanager(\"anim\");\n }, 2000);\n setTimeout(function () {\n switchmanager(\"anim\");\n }, 3000);\n setTimeout(function () {\n switchmanager(\"end\");\n }, 4000);\n \n setInterval(function(){\n gametime();\n }, 1000);\n\n mainmenu = false;\n buttonSwitchManager(true,true,false,false,false,false);\n break;\n\n case 4:\n helpmenu = true;\n buttonSwitchManager(false,false,true,false,false,false);\n break;\n\n case 5:\n console.log(\"button clicked\");\n time = timetowin;\n gameover = false;\n newGame();\n break;\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "6b60249295285e9bbd5a96be099d1d0d", "score": "0.5918586", "text": "function handleClick(e) {\n const cell = e.target\n //4-placeMrk, we need to know whos turn is, so we creat a varibale o turn if it's true, it's o turn, if false X turn\n const currentClass = circleTurn ? playerTow : playerOne\n //placeMark\n placeMark(cell, currentClass)\n //6-now we can check for win after creating th winin compnations\n if (checkWin(currentClass)) {\n endGame(false)\n } else if (isDraw()) {\n endGame(true)\n } else {\n swapTurns()\n setBoardHoverClass()\n }\n}", "title": "" }, { "docid": "e86daebcde45569d619cf39fdc00e2d5", "score": "0.5909622", "text": "mouseClick() { \n if (mouseX >= this.x && mouseX <= this.x+100 && \n mouseY >= this.y && mouseY <= this.y+100) {\n if (overKnight && mouseIsPressed && (mouseButton == LEFT)) {\n storX=this.x;\n storY=this.y; \n //if(bool_mouseReleased == true) {this.modColor=200;} \n } \n }\n if( (bool_mouseReleased==true ) && \n (this.x==storX && this.y==storY ) ){\n this.modColor=200; }\n }", "title": "" }, { "docid": "111aa8f8ba13ffb3a91b89fb50418b8f", "score": "0.59053135", "text": "character(targetClicked) {\n\n // Dynamically generated array of characters still in play\n let availableChars = [];\n for(let i = 0; i < gameProps.availableCharacters.length; i++) {\n availableChars.push(gameProps.availableCharacters[i].name);\n }\n for(let i = 0; i < gameProps.availableEnemies.length; i++) {\n availableChars.push(gameProps.availableEnemies[i].name);\n }\n\n // Screen out character clicks which are no longer available for selection\n if (availableChars.indexOf(targetClicked) !== -1) {\n\n // Ignore click if both hero and enemy are already chosen\n if (!Object.keys(gameProps.chosenHero).length > 0 ||\n !Object.keys(gameProps.chosenEnemy).length > 0)\n {\n // If hero not chosen and enemy not chosen...\n if (Object.keys(gameProps.chosenHero).length === 0 &&\n Object.keys(gameProps.chosenEnemy).length === 0) {\n // User click intent was to set hero\n gameProps.choseHero(targetClicked); // Finally... a gameProps method call\n DOM.render(\"heroChosen\"); // which also auto calls render(\"chooseEnemy\");\n DOM.render(\"updateAlerts\");\n }\n\n // If hero was already chosen and enemy not chosen...\n if (Object.keys(gameProps.chosenHero).length > 0 &&\n Object.keys(gameProps.chosenEnemy).length === 0) {\n // User click intent was to set enemy\n DOM.render('ejectDefeatedEnemy');\n gameProps.choseEnemy(targetClicked); // Finally... a gameProps method call\n\n // Only after user chooses enemy do we update DOM\n if (Object.keys(gameProps.chosenEnemy).length > 0) {\n DOM.render(\"enemyChosen\");\n DOM.render(\"updateAlerts\");\n }\n }\n }\n }\n }", "title": "" }, { "docid": "9281c0df17c2823742dbfbacdd5cbeca", "score": "0.5903608", "text": "initClickTools() {\n this.game.mapRender.renderer.domElement.addEventListener('click', ()=>{\n let moveToolActive = this.moveToolButton.checked;\n let interactToolActive = this.interactToolButton.checked;\n let inspectToolActive = this.inspectToolButton.checked;\n if (this.game.mapRender.controls.enabled && (moveToolActive || interactToolActive || inspectToolActive)) {\n let coord = new WorldAndScenePoint(this.game.mapRender.rollOverMesh.position, false).world();\n console.log(coord);\n let scanLevel = parseInt(this.scanLevelSelect.value);\n let commandName;\n let commandParameters;\n if (moveToolActive) {\n commandName = 'move';\n commandParameters = [coord.x, coord.y, coord.z, scanLevel];\n }\n else if (interactToolActive) {\n commandName = 'interact';\n commandParameters = [coord.x, coord.y, coord.z, scanLevel];\n }\n else if (inspectToolActive) {\n commandName = 'inspect';\n commandParameters = [coord.x, coord.y, coord.z, scanLevel];\n }\n this.sendCommand(commandName, commandParameters);\n }\n });\n }", "title": "" }, { "docid": "4241472c495e85214db9c93326c60744", "score": "0.59002095", "text": "function mouseClicked() {\n isDrawing = !isDrawing;\n // remember the clicked spot and make it as source\n myX = mouseX;\n myY = mouseY;\n}", "title": "" }, { "docid": "8ff0c232a7a7a57f2e7af11e16c5a0fd", "score": "0.58983034", "text": "function startLevel(){\n//Level Specific\n if(level==2){\n boy.setAttribute(\"stroke\",\"#4A708B\");\n boy1.setAttribute(\"stroke\",\"#4A708B\");\n text2.setAttribute(\"fill\", \"#4A708B\");\n }\n if(level==4 && b==1){\n d=1;\n mice();\n }\n if(level==9 && b==1){\n d=1; \n miceReturn(); \n }\n if(level==10){\n a=1;\n b=0; \n mouseTion(); \n }\n//End\n attempt = attempt+1;\n if(attempt==1){\n accio.innerHTML = \"Attempt: \"+attempt;\n }\n else{\n accio.innerHTML = \"Attempts: \"+attempt;\n }\n if(level!=10){ \n var pt = canvas.createSVGPoint()\n pt.x = event.clientX\n pt.y = event.clientY\n var svgPt = pt.matrixTransform(canvas.getScreenCTM().inverse()) \n mouseX = svgPt.x-8;\n mouseY = svgPt.y-15.5;\n mouse = makeImage(\"Images/Mouse Icons/Mouse.png\", mouseX, mouseY, 15, 15);\n canvas.addEventListener('mousemove', moveMouse); \n }\n mouse.setAttribute(\"opacity\",1);\n death.addEventListener('mouseover',endGame);\n button.setAttribute(\"fill\",\"#FF8C00\");\n button.removeEventListener(\"click\",startLevel);\n canvas.setAttribute(\"cursor\",\"pointer\");\n}", "title": "" }, { "docid": "17e2b3182b127c7acfe1e266de659f4b", "score": "0.58938575", "text": "clickClick(){\n let cont = document.querySelector(\"#gameBoard\");\n cont.addEventListener(\"click\", doSomething.bind(this), false);\n function doSomething(e) {\n let clickedItem = e.target.id;\n let passedX = clickedItem.slice(4,5);\n let passedY = clickedItem.slice(5,6);\n if (e.target.dataset.boardStatus === '0'){\n this.updateBoard(playerClick(passedX,passedY,this.playerTurn()));\n this.boardFill += 1;\n }\n this.alertWinner();\n // player notifications\n this.playerTurnNotification(this.boardFill);\n }\n }", "title": "" }, { "docid": "1834855b910dfdc038ea880178032498", "score": "0.5889874", "text": "click() {\n\n switch (this.pan.nivel) {\n case \"Main\":\n\n //pasar del menu principal al juego\n\n if (this.app.mouseX > 289 && this.app.mouseX < 500 && this.app.mouseY > 505 && this.app.mouseY < 600) {\n this.menus.stop();\n this.pan.boton.play();\n this.gameplay.play();\n\n this.pan.nivel = \"Juego\";\n this.coger = true;\n\n //crea los objetos\n this.objetos[0] = (new Pick(this.app, 430, this.app.height / 2 + 25));\n this.objetos[1] = (new Pick(this.app, 560, this.app.height / 2 + 25));\n this.objetos[2] = (new Pick(this.app, 690, this.app.height / 2 + 25));\n\n //crea los jugadores\n this.jugadorUno = new Jugador(this.app, \"Uno\", 150, -200);\n this.jugadorDos = new Jugador(this.app, \"Dos\", 250, -200);\n\n\n //crea la bandera\n this.bandera = new Bandera(this.app, 1551, -100);\n this.letrero = new Bandera(this.app, 40, -300);\n }\n\n //pasar del menu a instrucciones\n if (this.app.mouseX > 690 && this.app.mouseX < 900 && this.app.mouseY > 500 && this.app.mouseY < 600) {\n this.pan.boton.play();\n this.pan.nivel = \"Help\";\n }\n\n break;\n\n case \"Help\":\n\n //de las instrucciones al menu\n if (this.app.dist(this.app.mouseX, this.app.mouseY, 100, 600) < 150) {\n this.pan.boton.play();\n this.pan.nivel = \"Main\";\n }\n break;\n\n case \"Juego\":\n\n //coger un objeto\n\n for (let i = 0; i < this.objetos.length; i++) {\n let obj = this.objetos[i];\n if (this.app.mouseX > obj.x - obj.hover.width / 2 && this.app.mouseX < obj.x + obj.hover.width / 2 &&\n this.app.mouseY > obj.y - obj.hover.height / 2 && this.app.mouseY < obj.y + obj.hover.height / 2) {\n this.pan.boton.play();\n if (this.turnoCoger == 1) {\n this.elementoUno = obj;\n this.objetos.splice(i, 1);\n this.turnoCoger = 2;\n break;\n }\n\n if (this.turnoCoger == 2) {\n this.elementoDos = obj;\n this.objetos = [];\n this.coger = false;\n this.poner = true;\n break;\n }\n }\n\n }\n\n\n\n //pasa de ronda\n if (this.pan.aumento == 1) {\n if (this.app.mouseX > 525 && this.app.mouseY > 588 && this.app.mouseX < 660 && this.app.mouseY < 615) {\n this.pan.boton.play();\n\n //crea los objetos\n this.objetos[0] = (new Pick(this.app, 430, this.app.height / 2 + 25));\n this.objetos[1] = (new Pick(this.app, 560, this.app.height / 2 + 25));\n this.objetos[2] = (new Pick(this.app, 690, this.app.height / 2 + 25));\n this.contadorCorrector = 0;\n this.ronda += 1;\n this.turnoCoger = 1;\n this.turnoPoner = 1;\n this.pan.aumento = 0;\n this.jugadorUno.pos.x = 150;\n this.jugadorUno.pos.y = -200;\n this.jugadorUno.gravedad = true;\n this.jugadorDos.gravedad = true;\n this.jugadorUno.noqueado = false;\n this.jugadorDos.noqueado = false;\n this.jugadorDos.pos.x = 250;\n this.jugadorDos.pos.y = -200;\n this.pan.crecimiento = 0;\n this.jugadorUno.caido = false;\n this.jugadorDos.caido = false;\n this.elementoUno = \"\";\n this.elementoDos = \"\";\n this.finalCountdown = false;\n this.cuenta = 4;\n this.coger = true;\n\n for (let i = 0; i < this.elementos.length; i++) {\n if (this.elementos[i].tipo == \"Mina\") this.elementos[i].activada = false;\n\n }\n\n if (this.jugadorUno.gano) {\n this.jugadorUno.puntaje += 100;\n this.pan.unoPuntaje = this.jugadorUno.puntaje;\n this.jugadorUno.gano = false;\n }\n if (this.jugadorDos.gano) {\n this.jugadorDos.puntaje += 100;\n this.pan.dosPuntaje = this.jugadorDos.puntaje;\n this.jugadorDos.gano = false;\n }\n }\n }\n\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n\n //posicion relativa del mouse dentro de la camara\n\n\n for (let i = 0; i < this.cuadricula.length; i++) {\n let cuadro = this.cuadricula[i];\n\n if (this.mouseCam.x >= cuadro.pos.x && this.mouseCam.x <= cuadro.pos.x + cuadro.ancho && this.mouseCam.y >= cuadro.pos.y && this.mouseCam.y <= cuadro.pos.y + cuadro.alto && cuadro.ocupado == false) {\n\n //crear arma, trampa o plataforma\n\n if (this.poner && this.finalCountdown == false && this.contadorCorrector > 10) {\n this.pan.boton.play();\n if (this.turnoPoner == 1) {\n if (this.elementoUno.tipo != \"Suelo\") this.elementos.push(new Elemento(this.app, cuadro.pos.x + cuadro.ancho / 2, cuadro.pos.y + cuadro.alto / 2, this.elementoUno.tipo));\n if (this.elementoUno.tipo == \"Suelo\") this.suelo.push(new Suelo(this.app, cuadro.pos.x, cuadro.pos.y));\n this.elementoUno = null;\n }\n\n if (this.turnoPoner == 2) {\n if (this.elementoDos.tipo != \"Suelo\") this.elementos.push(new Elemento(this.app, cuadro.pos.x + cuadro.ancho / 2, cuadro.pos.y + cuadro.alto / 2, this.elementoDos.tipo));\n if (this.elementoDos.tipo == \"Suelo\") this.suelo.push(new Suelo(this.app, cuadro.pos.x, cuadro.pos.y));\n this.elementoDos = null;\n }\n\n this.cuadricula[i].ocupado = true;\n if (this.turnoPoner == 1) {\n this.turnoPoner = 2;\n break;\n }\n\n if (this.turnoPoner == 2) {\n this.finalCountdown = true;\n this.contadorCorrector = 0;\n this.turnoponer == 1;\n break;\n }\n }\n }\n }\n\n break;\n\n case \"Game Over\":\n //reset\n if (this.app.mouseX > 488 && this.app.mouseX < 711 && this.app.mouseY > 575 && this.app.mouseY < 625) {\n this.reset();\n }\n\n break;\n\n } //cierra el switch de pantalla\n }", "title": "" }, { "docid": "b34ce8c53ed2d943d71b757101da3dd2", "score": "0.5889142", "text": "function mouseClicked() {\n var x = getGridPos(mouseX); // get x pos\n var y = getGridPos(mouseY); // get y pos\n walkers.push(new Walker(x, y, palette)); // generate and add to the array\n}", "title": "" }, { "docid": "81afb1bf654f9ff5598c53d060bc8d15", "score": "0.58877826", "text": "function clickedTarget() {\n // Right now, just updates a count.\n // Could use some player feedback here\n hits3 += 1;\n}", "title": "" }, { "docid": "2e552854619a9ddc2a2bee4752c10a22", "score": "0.5885488", "text": "canvasClicked(event) {\n\t\ttry {\n\t\t\tvar CQMMeasuresGraphReference = this.idObject[event.target.id];\n\t\t\tvar activeElement = CQMMeasuresGraphReference.getElementAtEvent(event);\n\t\t\t//switchValue will be the label of the particular bar that was clicked on\n\t\t\tvar switchValue = activeElement[0]._model.label;\n\t\t\tthis.switchGaugeGraphToDisplay(switchValue);\n\t\t}\n\t\tcatch(error) {\n\t\t\t//ignore the error here since this will typically mean that the user failed to click on an element within the canvas\n\t\t}\n\t}", "title": "" }, { "docid": "f437f6f89f819bf7fdc5f7267630e228", "score": "0.5884025", "text": "function markingMenuOnMouseDown(){\r\n\r\n\ttracker.startTimer();\r\n\ttracker.newAttempt();\r\n}", "title": "" }, { "docid": "0e2bc8f7ad61044eae49921aed733a07", "score": "0.58801854", "text": "function turnClick(e) \n {\n if (versusMode == \"human\") \n {\n if (typeof gmBoard.mainBoard[e.target.id] == \"number\") \n {\n //Checks by the X or O sign whether it's the player's turn or the opponent's turn, then simulates a turn and switches signs\n if (current == humanPlayer.move) \n {\n turn(e.target.id, current);\n current = opponent.move;\n } \n else if (current == opponent.move) \n {\n turn(e.target.id, current);\n current = humanPlayer.move;\n }\n }\n } \n //Process human player's choice, then use minimax to find the CPU's ideal move.\n else \n {\n if (typeof gmBoard.mainBoard[e.target.id] == \"number\") \n {\n turn(e.target.id, humanPlayer.move);\n if (!isGameOver) turn(bestSpot(), opponent.move);\n }\n }\n }", "title": "" }, { "docid": "9337c7c2f23593cd8ed4fe2ba00545ee", "score": "0.58618706", "text": "function canvasMouseUp(){\n\tclick();\n}", "title": "" }, { "docid": "c025c7c22f087a901d97f357d8208aeb", "score": "0.5861449", "text": "function draw(event) {\n // get the touch coordinates\n if (event.targetTouches && event.targetTouches.length > 0) {\n var coors = {\n x: event.targetTouches[0].pageX,\n y: event.targetTouches[0].pageY+ document.body.scrollTop - _$.canvas.offsetTop\n };\n // pass the coordinates to the appropriate handler\n drawer[event.type](coors);\n }\n }", "title": "" }, { "docid": "3fbc4015b59edca9eb8b8e4b0162fe7a", "score": "0.5860715", "text": "mouseReleased(){\n if (winMouseX > this.wMin && winMouseX < this.wMax && winMouseY > this.hMin && winMouseY < this.hMax && this.clickable){\n this.clicked();\n }\n }", "title": "" }, { "docid": "07fd4a42a943739d95a4aa9707fab07a", "score": "0.5857238", "text": "clickedBox(){\n\t\tthis.input.on('gameobjectdown', (pointer, gameObject) => {\n\t\t\tfor(var i=0;i<36;i++){\n\t\t\t\tif(this.gameBoard[i] == i ){\n\t\t\t\t\t\tif(gameObject.data.get('card_number') == i){\n\t\t\t\t\t\t\t\tthis.round(gameObject.x,gameObject.y,i,0)\n\t\t\t\t\t\t\t\tconsole.log(this.cardWeGet)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}else if(gameObject.data.get('card_number') == 53){\n\t\t\t\t\t\t\tthis.round(gameObject.x,gameObject.y,-1,1)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "5e7df1e55762ef9cda1f82de2eb450b7", "score": "0.58457375", "text": "clicked(tempMx,tempMy){\n\t\tthis.mx=tempMx;\n\t\tthis.my=tempMy;\n\n\t\tlet d= dist(this.mx,this.my,this.x,this.y);\n\t\tif (d<this.r){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "9b2c0374fbf5fda4dcdc757be23ec087", "score": "0.58331126", "text": "function click(event) {\n mouse.x = event.x - canvas.offsetLeft;\n mouse.y = event.y - canvas.offsetTop;\n let c = Math.floor(mouse.x / pixel);\n let r = Math.floor(mouse.y / pixel);\n grid[c][r] = !grid[c][r];\n // show(grid);\n context.beginPath();\n context.rect(c * pixel, r * pixel, pixel, pixel);\n context.fillStyle = grid[c][r] ? \"black\" : \"white\";\n context.fill();\n context.stroke();\n}", "title": "" }, { "docid": "41897ac455f8e1da42ae7c1e7dc79caa", "score": "0.5832213", "text": "turn(){\n \n //middle pieces\n for(let i = 0; i < this.space.length; i++){\n this.space[i].addEventListener(\"click\", function(e){\n if(e.target.getAttribute(\"cx\")== \"160\"){\n //bottom middle piece changes\n if(e.target.getAttribute(\"cy\")== \"190\"){\n this.board = [7];\n //checks whos turn it is\n if(turn != false){\n turn = false;\n e.target.style.fill = \"#446a7d\";\n e.target.setAttribute(\"click\", \"1\");\n player1 = true;\n console.log(player1);\n \n }\n else{\n //player 2's turn\n turn = true;\n e.target.style.fill = \"#df1e35\";\n e.target.setAttribute(\"click\", \"2\");\n player1 = false;\n console.log(player1);\n \n } \n //middle piece in middle section changes\n } else if(e.target.getAttribute(\"cy\")== \"115\"){\n this.board = [4];\n if(turn != false){\n turn = false;\n e.target.style.fill = \"#446a7d\";\n e.target.setAttribute(\"click\", \"1\");\n player1 = true;\n console.log(player1);\n \n \n }else{\n turn = true;\n e.target.style.fill = \"#df1e35\";\n e.target.setAttribute(\"click\", \"2\");\n player1 = false;\n console.log(player1);\n }\n } else {\n //middle top piece changes\n this.board = [1];\n if(turn != false){\n turn = false;\n e.target.style.fill = \"#446a7d\";\n player1 = true;\n e.target.setAttribute(\"click\", \"1\");\n console.log(player1);\n\n \n }else{\n turn = true;\n e.target.style.fill = \"#df1e35\";\n e.target.setAttribute(\"click\", \"2\");\n player1 = false;\n console.log(player1);\n } \n }\n } \n \n \n \n \n } )\n \n }\n //right pieces\n for(let i = 0; i < this.space.length; i++){\n this.space[i].addEventListener(\"click\", function(e){\n if(e.target.getAttribute(\"cx\")== \"235\"){\n //bottom right changes\n if(e.target.getAttribute(\"cy\")== \"190\"){\n this.board = [8];\n if(turn != false){\n turn = false;\n e.target.style.fill = \"#446a7d\";\n e.target.setAttribute(\"click\", \"1\");\n player1 = true;\n console.log(player1);\n \n \n }else{\n turn = true;\n e.target.style.fill = \"#df1e35\";\n e.target.setAttribute(\"click\", \"2\");\n player1 = false;\n console.log(player1);\n } \n } //middle right changes \n else if(e.target.getAttribute(\"cy\")== \"115\"){\n this.board = [5];\n if(turn != false){\n turn = false;\n e.target.style.fill = \"#446a7d\";\n e.target.setAttribute(\"click\", \"1\");\n player1 = true;\n \n }else{\n turn = true;\n e.target.style.fill = \"#df1e35\";\n e.target.setAttribute(\"click\", \"2\");\n player1 = false;\n }\n //top right changes\n } else {\n this.board = [2];\n if(turn != false){\n turn = false;\n e.target.style.fill = \"#446a7d\";\n e.target.setAttribute(\"click\", \"1\");\n player1 = true;\n \n }else{\n turn = true;\n e.target.style.fill = \"#df1e35\";\n e.target.setAttribute(\"click\", \"2\");\n player1 = false;\n }\n }\n } \n \n \n \n \n } )\n }\n //left pieces\n for(let i = 0; i < this.space.length; i++){\n this.space[i].addEventListener(\"click\", function(e){\n if(e.target.getAttribute(\"cx\")== \"90\"){\n //bottom left changes\n if(e.target.getAttribute(\"cy\")== \"190\"){\n this.board = [6];\n if(turn != false){\n turn = false;\n e.target.style.fill = \"#446a7d\";\n e.target.setAttribute(\"click\", \"1\");\n player1 = true;\n console.log(player1);\n \n \n }else{\n turn = true;\n e.target.style.fill = \"#df1e35\";\n e.target.setAttribute(\"click\", \"2\");\n player1 = false;\n console.log(player1);\n } \n } //middle left changes \n else if(e.target.getAttribute(\"cy\")== \"115\"){\n this.board = [3];\n if(turn != false){\n turn = false;\n e.target.style.fill = \"#446a7d\";\n e.target.setAttribute(\"click\", \"1\");\n player1 = true;\n \n }else{\n turn = true;\n e.target.style.fill = \"#df1e35\";\n e.target.setAttribute(\"click\", \"2\");\n player1 = false;\n }\n //top left changes\n } else {\n this.board = [0];\n if(turn != false){\n turn = false;\n e.target.style.fill = \"#446a7d\";\n e.target.setAttribute(\"click\", \"1\");\n player1 = true;\n \n }else{\n turn = true;\n e.target.style.fill = \"#df1e35\";\n e.target.setAttribute(\"click\", \"2\");\n player1 = false;\n }\n }\n } \n })\n \n \n \n \n\n }\n }", "title": "" }, { "docid": "00376473ef1ce896038013d4fe0b7ef6", "score": "0.58257544", "text": "function fill_enemy(y, x, id, enemy_info){\n let enemy_group = document.querySelector('#enemy-group');\n let enemy_digimon = enemy_group.children[y].children[x];\n enemy_digimon.id = `digimon_${enemy_info[id].id}`;\n enemy_digimon.style.backgroundImage = enemy_info[id].image;\n enemy_digimon.title = enemy_info[id].title;\n enemy_digimon.innerHTML = enemy_info[id].id;\n \n //todo dar uma forma melhor para n dar multiplas calls na animacao\n if(typeof enemy_group.children[y].children[x].move === 'undefined'){\n battle_animation(enemy_group.children[y].children[x]);\n }\n\n enemy_digimon.addEventListener('click', (e) => {\n if(e.target.classList.contains('enemy')){\n if(typeof target_digimon !== 'undefined'){\n target_digimon.selected.cancel();\n } \n target_digimon = e.target;\n target_digimon.selected.play();\n } \n });\n}", "title": "" }, { "docid": "a108ea7e26d213ba67771fac08ac7d54", "score": "0.5823047", "text": "function dblclick(e)\n{\n\t// open the mines around the clicked block\n\tif(GameState.status==2 && !GameState.IsLocking)\n\t{\n\t\tvar offset_X = e.clientX-$('#myCanvas').position().left+window.pageXOffset\n\t\t\t\t\t\t\t\t\t- MineArea_x - (MineArea_width - (Mine_Size*Mine_col))/2;\n\t\tvar offset_Y = e.clientY-$('#myCanvas').position().top+window.pageYOffset\n\t\t\t\t\t\t\t\t\t- MineArea_y - (MineArea_height - (Mine_Size*Mine_row))/2;\n\t\tvar _x = Math.floor(offset_Y/Mine_Size);\n\t\tvar _y = Math.floor(offset_X/Mine_Size);\n\t\n\t\tGameState.IsLocking=true;\n\t\topen(_x,_y);\n\t}\n}", "title": "" }, { "docid": "13ce722291a76539c4044958dab2f079", "score": "0.58218235", "text": "function mouseClicked() {}", "title": "" }, { "docid": "def892a9ee24aec572a74c9013c1b3bd", "score": "0.58207214", "text": "function golOnClick(e) {\n var cell = getCursorPosition(e);\n drawing = true;\n if (cell.isValid()) {\n // If the cell is active continue drawing all cells in the current action as active.\n if (checkCellActive(cell)) {\n drawingActives = false;\n } else {\n drawingActives = true;\n }\n }\n golOnMouseMove(e);\n\n}", "title": "" }, { "docid": "dbe745b116c11592d559d65785e4ac24", "score": "0.5820446", "text": "function createItemClickEvents() {\n //First Room\n $(\"#room1-item1\").click(function() {\n if (enemyMap.enemy2.isDead()) {\n player.checkClickItem();\n alertRoom(\"You found a \" + player.items[player.items.length - 1].name + \".\");\n $(\"#room1-item1\").off(\"click\");\n $(\"#room1-item1\").css({'cursor' : \"url('img/gauntlet_mouse.png') 10 10, pointer\"});\n }\n else {\n alertRoom(\"Can't access, an enemy is in your path!\")\n }\n });\n\n $(\"#room1-item2\").click(function() {\n player.checkClickConsumable();\n alertRoom(\"You found a \" + player.items[player.items.length - 1].name + \".\");\n $(\"#room1-item2\").off(\"click\");\n $(\"#room1-item2\").css({'cursor' : \"url('img/gauntlet_mouse.png') 10 10, pointer\"});\n });\n\n $(\"#room2-item3\").click(function() {\n if (enemyMap.enemy4.isDead() && enemyMap.enemy5.isDead()) {\n player.checkClickItem();\n alertRoom(\"You found a \" + player.items[player.items.length - 1].name + \".\");\n $(\"#room2-item3\").off(\"click\");\n $(\"#room2-item3\").css({'cursor' : \"url('img/gauntlet_mouse.png') 10 10, pointer\"});\n }\n else {\n alertRoom(\"Can't access, enemies guard the area!\")\n }\n });\n}", "title": "" }, { "docid": "262844eeda20b83cfb206d0297730c98", "score": "0.581879", "text": "function click(event) {\n if (game.action === ACTION.SELECT_SQUARE) {\n game.powerFollowUp(getSquare(event.pageX, event.pageY));\n }\n}", "title": "" }, { "docid": "b41b4f550c42fa73e97d39f61d2e8217", "score": "0.58172256", "text": "itemClick() {\n\n // these if statements feel a little dirty but i will use them lol\n\n if (!this.scene.scene.isActive('tradescene')) {\n // if not clicked in trade scene:\n }\n\n // set special use cases for certain items (for example, can only use energy drink when on planet)\n // this is pretty hacky, i will figure out a better way to do stuff like this for other projects lol\n if (this.item.components.hasOwnProperty('dayTimeIncrease')) {\n if (game.scene.isActive('settlementmenu') ||\n game.scene.isActive('ecosystemmenu') ||\n game.scene.isActive('planetscene')) {\n this.item.onUse(this.inventory, this.index);\n return;\n }\n return;\n }\n this.item.onUse(this.inventory, this.index);\n }", "title": "" }, { "docid": "c9aaf21ac9bae4dc3b58ef99eefebe5f", "score": "0.58147746", "text": "function updateTool(event) {\n currentTile = '';\n if (event.currentTarget.textContent === 'axe') {\n axe.style.border = '5px solid rgb(46, 46, 70)';\n pickaxe.style.border = '1px solid grey';\n shovel.style.border = '1px solid grey';\n currentTool = axe.textContent;\n }\n if (event.currentTarget.textContent === 'pickAxe') {\n pickaxe.style.border = '5px solid rgb(46, 46, 70)';\n axe.style.border = '1px solid grey';\n shovel.style.border = '1px solid grey';\n currentTool = pickaxe.textContent;\n }\n if (event.currentTarget.textContent === 'shovel') {\n shovel.style.border = '5px solid rgb(46, 46, 70)';\n axe.style.border = '1px solid grey';\n pickaxe.style.border = '1px solid grey';\n currentTool = shovel.textContent;\n }\n}", "title": "" }, { "docid": "7f43f3609e5ef1eaeadd86e3e109813a", "score": "0.5812579", "text": "function mouseClicked () {\n\n switch (state) {\n\n case 'menu':\n menuMouseClicked(); //(menu.js)\n break;\n\n case 'game':\n //listen for clicks when player is dead\n if (socket.id in waitingData) {\n deathMenuMouseClicked(socket);\n }\n }\n\n}", "title": "" }, { "docid": "406ad929185946e52c416fe8c8e8f2f8", "score": "0.5811671", "text": "function mouseClicked()\n{\n // for each registed click action\n for(action of clickActions)\n\n // icon was clicked: dispatch callback\n if(mouseX > WIDTH - 50 && mouseX < WIDTH && mouseY > HEIGHT - action.position * 50 && mouseY < HEIGHT - (action.position - 1) * 50)\n {\n action.callback();\n }\n}", "title": "" }, { "docid": "953c81ec754f9be34c3f5352f585ee55", "score": "0.5811248", "text": "function enemySelection(){\n//$(\".invisibleBox\").on(\"click\", function(){\n\t$(\"#attackCounter\").html('');\n\t\n\tcounterEnimy++;\n var id = $(this).attr(\"id\");\n selectedEnemyID = id;\n \n var num = id.split(\"-\")[1]-1;\n \n var oponent = enimies[num];\n enimyAttackPower = parseInt($(this).children().attr(\"data-attackPower\"));\n enimyName = $(this).children().attr(\"data-name\");\n enimyHp = parseInt($(this).children().attr(\"data-hpValue\"));\n \n \n index = enimies.indexOf(oponent);\n \n var enimy = [];\n enimies.splice(index, 1);\n\n for (var i = 0; i < enimies.length; i++) {\n \tif(enimies[i] != oponent) {\n \t\tenimy.push(enimies[i]);\n \t}\n }\n \n $('#defender').html($(this));\n // changing style of defender\n $(this).css({\n \"background-color\": \"black\",\n \"border\": \"1.5px solid red\",\n \"color\": \"#fff\"\n });\n\t\n\tisEnemySelected = true;\n\t$(\".invisibleBox\").off(\"click\");\n}", "title": "" }, { "docid": "8e8d617022289998f8c4f02be312d21e", "score": "0.58078665", "text": "function clickedPeg(){\n removeAnimation()\n pegClick1 = this.id\n if (tower[pegClick1][0] != null) {\n tower.click1 = this.id\n $(this).children().first().addClass(\"clickedPeg\")\n peg.off(\"click\")\n peg.on(\"click\", secondClickedPeg)\n $(this).off(\"click\")\n }\n}", "title": "" }, { "docid": "fddf275453345ddc383ddcaf2126dbfd", "score": "0.580731", "text": "function cellClicked(event) {\r\n if (gameActive == true) {\r\n togglePlayer(event);\r\n checkWin();\r\n };\r\n}", "title": "" }, { "docid": "50aa39498f8b9559b38135e15e6d3587", "score": "0.5807084", "text": "click(x_, y_) {\n // console.log(\"click(\"+x_+\", \"+y_+\"), isFirstClick:\" +this.isFirstClick)\n let y = Math.floor(x_ / this.view.spriteSize)\n let x = Math.floor(y_ / this.view.spriteSize) \n if(this.isFirstClick) { // first selection \n this.isFirstClick = false;\n this.selectedSprite.x = x; this.selectedSprite.y = y\n this.view.selected(x, y, true)\n this.view.drawAll(context)\n } else { // second selection\n\n function areNeighbors(x1_, y1_, x2_, y2_) {\n if(x1_ === x2_ && y1_ === y2_) {\n return false\n }\n return (\n (x1_ === x2_ || x1_ === x2_ + 1 || x1_ === x2_ - 1) &&\n (y1_ === y2_ || y1_ === y2_ + 1 || y1_ === y2_ - 1) \n )\n }\n\n this.isFirstClick = true\n this.view.selected(this.selectedSprite.x, this.selectedSprite.y, false)\n if( areNeighbors(x, y, this.selectedSprite.x, this.selectedSprite.y) ) {\n this.model.swap(x, y, this.selectedSprite.x, this.selectedSprite.y)\n if(this.model.isAlignmentExist()) {\n this.view.swap(x, y, this.selectedSprite.x, this.selectedSprite.y)\n this.isSwap = true\n this.gameEventHandler(this.context)\n this.isSwap = false\n } else {\n this.model.swap(x, y, this.selectedSprite.x, this.selectedSprite.y)\n this.view.drawAll(this.context)\n }\n } else {\n this.view.drawAll(this.context)\n }\n }\n }", "title": "" }, { "docid": "0293b78f76c2f8985b0c83962f14ae6c", "score": "0.5799511", "text": "function mouseClicked(){\n\n for(var i = 0; i < target.length; i++){\n if(target[i].mouseOver()){\n goToIndex(i);\n }\n }\n if(width>=800){\n var d = dist(controls[2].x,controls[2].y,mouseX,mouseY);\n if(d<controls[2].width){\n bullets.push(new Bullet(ship.x+(ship.width/2),ship.y));\n }\n }else{\n var d = dist(controls[2].x,controls[2].y+controls[2].height/2,mouseX,mouseY);\n if(d<controls[2].width){\n bullets.push(new Bullet(ship.x+(ship.width/2),ship.y));\n }\n }\n}", "title": "" }, { "docid": "803470fba51ee7f2c6e1cb574c2680b5", "score": "0.57954484", "text": "function runMedium(){\n this.ballMed.setActive();\n}", "title": "" }, { "docid": "fd432f09afd8b4c300bc21a141fcf3df", "score": "0.57946575", "text": "handleCanvasClick(event) {}", "title": "" }, { "docid": "6a7b2126c3b0030496aa129c434b8c36", "score": "0.5790874", "text": "function onCanvasClick() {\n if (true) { // should decide according to drawing mode\n handleLineDrawing();\n }\n }", "title": "" }, { "docid": "d7ca260cc30b181a9f568f5666d1109a", "score": "0.57882273", "text": "\"click #mycanvas\" (event) {\r\n if (Template.instance().won.get() !== ONGOING) {\r\n alert(\"Game over. Please restart the game.\");\r\n document.getElementById(\"reset\").focus();\r\n return;\r\n }\r\n // calculate click with respect to canvas\r\n var canvas = event.target;\r\n var rect = canvas.getBoundingClientRect();\r\n var x = event.clientX - rect.left;\r\n var y = event.clientY - rect.top;\r\n\r\n // draw move.\r\n if (canvas.getContext) {\r\n // increment the counter when button is clicked\r\n var currentPlayer = Template.instance().player;\r\n var dropped;\r\n if (!VS_HUMAN && currentPlayer.get() === BLACK) {\r\n console.log(\"computer is thinking...\");\r\n var aiMove = getComputerMove(STATE_TABLE);\r\n dropped = drop(STATE_TABLE, canvas.getContext(\"2d\"), aiMove, currentPlayer.get());\r\n } else {\r\n dropped = drop(STATE_TABLE, canvas.getContext(\"2d\"), Math.floor(x / 100), currentPlayer.get());\r\n }\r\n\r\n if (dropped) {\r\n\r\n // check if game is won.\r\n if (checkWin(currentPlayer.get(), STATE_TABLE) === WON) {\r\n Template.instance().won.set(currentPlayer.get() + \" wins!\");\r\n alert(currentPlayer.get() + \" wins!\");\r\n document.getElementById(\"reset\").focus();\r\n }\r\n\r\n // change players\r\n getNextPlayer(currentPlayer);\r\n // call AI\r\n if (!VS_HUMAN && currentPlayer.get() === BLACK) {\r\n setTimeout(function() {\r\n document.getElementById(\"mycanvas\").click();\r\n }, 1000);\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "4a94bc7f5c70ffa45242c4a9763c5a8d", "score": "0.5785777", "text": "function handleMouseClick(evnt) {\n if(winScreen) {\n player1Score = 0;\n player2Score = 0;\n winScreen = false;\n }\n}", "title": "" }, { "docid": "b838286dd15c359c40f818b9db2fcbde", "score": "0.5785004", "text": "house1 (player,tile){\r\n // console.log('house1',tile.index)\r\n console.log ('score ' , window.score)\r\n if (this.food1 == 1) {\r\n this.collectSoundSnd.play();\r\n window.score = window.score + 1\r\n \r\n }\r\n // disable and hide food \r\n this.food1 = 0 \r\n this.chicken.x=-50\r\n this.chicken.y=-50\r\n \r\n }", "title": "" }, { "docid": "09c6abd88502e15e471f3a1ef20cb28b", "score": "0.5784477", "text": "function afterClick() {\n\n // placeCharacter(character.image, character.name, character.type, character.alive);\n\n placeCharacter(human1.image, human1.name, human1.type, human1.alive);\n placeCharacter(human2.image, human2.name, human2.type, human2.alive);\n placeCharacter(human3.image, human3.name, human3.type, human3.alive);\n placeCharacter(parasite1.image, parasite1.name, parasite1.type, parasite1.alive);\n placeCharacter(parasite2.image, parasite2.name, parasite2.type, parasite2.alive);\n placeCharacter(parasite3.image, parasite3.name, parasite3.type, parasite3.alive);\n placeCharacter(parasite4.image, parasite4.name, parasite4.type, parasite4.alive);\n placeCharacter(parasite5.image, parasite5.name, parasite5.type, parasite5.alive);\n placeCharacter(parasite6.image, parasite6.name, parasite6.type, parasite6.alive);\n placeCharacter(parasite7.image, parasite7.name, parasite7.type, parasite7.alive);\n}", "title": "" }, { "docid": "19acbd7277112c82c915f525930fdeb2", "score": "0.5781174", "text": "onClickOnCell({ row, col }) {\n const { grid: { collection } } = this.model;\n const result = Engine.checkSelectedCell(collection, row, col);\n\n this.model.updateCellsData(result);\n\n if ( result === Engine.MINE ) {\n this.view.gameOver(\"lose\");\n this.view.revealCells(this.model.allMines.flat());\n } else if ( this.model.isGameWon ) {\n this.view.revealCells(result);\n this.view.gameOver(\"win\");\n this.view.flagMines(this.model.totFlaggedCells.flat());\n } else {\n this.view.revealCells(result);\n }\n }", "title": "" } ]
87cc8680446073119ebb1d6f41c5d61f
DELETE_PICTURE input:: viewer_phone picture_id output:: api_name viewer_phone picture_id
[ { "docid": "25cf9187c131f4f9d2579c15f688e4ce", "score": "0.81800026", "text": "function delete_picture(viewer_phone, picture_id)\n{\n\tvar API_URL = \"http://75.101.134.112/stream/1.0/api/delete_picture.php?viewer_phone=\" + viewer_phone + \"&picture_id=\" + picture_id;\n\tconsole.log(API_URL);\n\n\t$.getJSON(API_URL, function (data) \n\t{\n\t\tconsole.log(data);\n\t});\n}", "title": "" } ]
[ { "docid": "b19570a9ed512ae3c739844e1031a863", "score": "0.6862267", "text": "function deletePic(){\n console.log(\"Delete Clicked\")\n fetch(`http://localhost:3000/photos/${photo.id}`, {\n method: \"DELETE\"\n })\n .then(r => r.json())\n .then(() => {\n removePic(photo.id)\n } )\n }", "title": "" }, { "docid": "431bc632931b9f77ff63ca27d802dad2", "score": "0.6473448", "text": "function deletePicture(obj) {\n var image_id = obj.value;\n\n // submit query to server\n var formdata = new FormData();\n var request = new XMLHttpRequest();\n request.addEventListener(\"load\", deleteFinished, false);\n request.addEventListener(\"error\", deleteError, false);\n request.open(\"POST\", \"/jahen19/mvc/public/api/delete/picture/\" + image_id, true);\n request.send(formdata);\n}", "title": "" }, { "docid": "fc2837b517b67badf007c0fc0b7fc882", "score": "0.6406867", "text": "function deleteImage() {\n\tvar image = request.httpParameterMap.file.value;\n\tvar id = request.httpParameterMap.id.value;\n\tvar file = new File(image);\n\tfile.remove();\n\tCalls.deleteFileOnCloudinary(id);\n\treturn imageManager();\n}", "title": "" }, { "docid": "aaacb68c3313c9b249fffbb36587ea21", "score": "0.61079156", "text": "async deletePhoto(filename, refreshCallback) {\n const data = {\n photos: [filename],\n allPhotos: false\n }\n const response = await fetch(\"/eforce-gallery/photos/delete\", {\n method: \"POST\",\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n })\n refreshCallback()\n createPopupWindow((await response.json()).deleted)\n }", "title": "" }, { "docid": "c78f01c0febaa67407376d11c53461e9", "score": "0.59489167", "text": "function deleteProfilePic(req, res) {\n userService.deleteProfilePic(req, res)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "title": "" }, { "docid": "7e111621cb6deafc038091d7578ff2a8", "score": "0.593168", "text": "static delete(screenshotID) {\n console.log('deletin')\n return fetch(`${REACT_APP_API_URL}/screenshots/${screenshotID}`, {\n method: \"DELETE\",\n }).then(res => res.json())\n }", "title": "" }, { "docid": "4f94b3a0e0a1d35ed8a8b9da285b4d6e", "score": "0.58645475", "text": "async function destroyPhoto(id){\n let timestamp = Date.now()\n let sign = await signature(`public_id=${id}&timestamp=${timestamp}`)\n\n const formData = new FormData();\n formData.append(\"public_id\",`${id}`)\n formData.append(\"timestamp\", `${timestamp}`)\n formData.append(\"api_key\",\"718563786378529\")\n formData.append(\"upload_preset\", \"j9hm67rk\")\n formData.append(\"signature\", `${sign}`)\n \n\n const response = await fetch(\"https://api.cloudinary.com/v1_1/juanrojasc/image/destroy\", {\n method: \"POST\",\n body: formData\n })\n const state = await response.status;\n const json = await response.json();\n return [state, json]\n}", "title": "" }, { "docid": "e56c389b5ade0d7fd068a938a5ecb7a6", "score": "0.58393735", "text": "function delete_from_stream(viewer_phone, stream_id)\n{\n\tvar API_URL = \"http://75.101.134.112/stream/1.0/api/delete_from_stream.php?viewer_phone=\" + viewer_phone + \"&stream_id=\" + stream_id;\n\tconsole.log(API_URL);\n\n\t$.getJSON(API_URL, function (data) \n\t{\n\t\tconsole.log(data);\n\t});\n}", "title": "" }, { "docid": "31001ab2e2f0f59985ab7b6373719356", "score": "0.5815045", "text": "function deleteImage(req, res) {\n\tImage.deleteOne({_id : req.params.id}, (err, result) => {\n\t\tres.json({ message: \"Image successfully deleted!\", result });\n\t});\n}", "title": "" }, { "docid": "7ce270e33fd8b21ada2b5580bdecf51c", "score": "0.5759769", "text": "function deleteFile(fileToDelete){\n var url = \"http://localhost/webservices_dt117g/projekt/filemanager_api.php/photos/\" + fileToDelete;\n var http = new XMLHttpRequest();\n http.open(\"DELETE\", url, true);\n http.send(); \n http.onreadystatechange = function() {\n if(http.readyState == 4 && this.status == 200) {\n alert(\"File deleted\");\n location.reload();\n }\n } \n }", "title": "" }, { "docid": "1b8fcbb250cab3f7eccce227bed9d2ad", "score": "0.57557666", "text": "function delImageFromCloudinary(id) {\n var xttp = new XMLHttpRequest();\n var url = \"https://api.cloudinary.com/v1_1/technoligest/delete_by_token\";\n xttp.open(\"POST\", url, true);\n var form = new FormData();\n form.append('token', localStorage.getItem(id));\n xttp.send(form);\n xttp.onreadystatechange = function () {\n if (xttp.readyState == XMLHttpRequest.DONE) {\n var res = JSON.parse(xttp.response);\n if (res.hasOwnProperty(\"error\")) {\n dangerAlert(\"Could not delete image for some reason.\")\n } else {\n successAlert(\"The image has been deleted.\");\n }\n } else if (xttp.readyState == XMLHttpRequest.UNSENT) {\n dangerAlert(\"Could not delete image for some reason.\")\n }\n }\n}", "title": "" }, { "docid": "d6ddaa9852388182f7839811b205b195", "score": "0.57484245", "text": "function deletePicture(id) {\n\tvar div = $(\"#\" + id).closest(\".row\").parent();\n\tdiv.remove();\n\t\n\t--nbPictures;\n}", "title": "" }, { "docid": "57e7dc62eb29b7908f637fcd932f38c3", "score": "0.5745441", "text": "function deleteImage(element, storageType, pkey) {\n\t\n\tlet ajaxReq = $.ajax({\n\t url: storageType + '/' + pkey,\n\t cache: false,\n\t contentType: false,\n\t processData: false,\n\t method: 'DELETE'\n\t});\n\t\n // calls on success of file DELETE\n ajaxReq.done(function(data){\n \talert(\"Image has been deleted.\");\n \t// erasing deleted image's row\n \t$(element).parents('tr').empty();\n });\n \n // calls on failure of file DELETE\n ajaxReq.fail(function(data) {\n\t\talert(data.responseText);\n\t});\n}", "title": "" }, { "docid": "c2c5a4f1543d787dcf8edfabdf9cfc43", "score": "0.57050717", "text": "function deleteImage() {\n //Get the URL of the image to delete\n var image = document.getElementById('photo');\n imageURL = image.src;\n\n //Make the AJAX call to delete the image\n $.ajax ({\n url: 'php/deleteImage.php',\n data: {url: imageURL}\n });\n\n while (results.firstChild) {\n results.removeChild(results.firstChild);\n }\n\n printResponse();\n}", "title": "" }, { "docid": "1cac1995b3c1f2620d6025465d1ec90d", "score": "0.5700879", "text": "function unlike_picture(picture_id, liker_phone)\n{\n\tvar API_URL = \"http://75.101.134.112/stream/1.0/api/unlike_picture.php?picture_id=\" + picture_id + \"&liker_phone=\" + liker_phone;\n\tconsole.log(API_URL);\n\n\t$.getJSON(API_URL, function (data) \n\t{\n\t\tconsole.log(data);\n\t});\n}", "title": "" }, { "docid": "7a55d968087a7163fa0ed020e0b6fec3", "score": "0.5694189", "text": "deleteImage(event) {\n let imageId = event.target.id;\n imageSourcesList.splice(imageId, 1);\n app.renderImages();\n }", "title": "" }, { "docid": "6e20708bc5cf414aa0da779727c1da5c", "score": "0.5692892", "text": "function delete_photos(db, json_data) {\n let values =\n `${json_data.map(entry => `(${entry.id})`)}`\n\n let delete_query =\n `DELETE FROM tigaserver_app_photo WHERE id IN (VALUES ${values});`\n\n // return db.runSql(delete_query);\n run_big_query(delete_query,()=>{}, 'delete')\n}", "title": "" }, { "docid": "27f527e01f04ce89ad741f60526e777f", "score": "0.5634273", "text": "function deleteImage() {\n\n\tdeletebit = 1;\n}", "title": "" }, { "docid": "b034870db49b9a1ef916d0dcff23786a", "score": "0.5624369", "text": "function cloudDelete(id) {\n Campground.findById(id, function(err, foundGround) {\n if (err || !foundGround) {\n console.log(\"Campground not found\");\n }\n else {\n cloudinary.uploader.destroy(foundGround.image.public_id, function(err, result) {\n console.log(err);\n });\n }\n });\n}", "title": "" }, { "docid": "b2d1be376a4a7a435f3fcbfa67b23d50", "score": "0.56209254", "text": "function carousel_deletePic(Name, idPic){\n /**\n * LOGISTICS\n *\n *\n * restartCarousel = true / false - daca sa se restarteze carouselul sau nu\n * id.pic =\n * id.showPic = id-ul pozei din pic-details\n * deletePic = [obj] selectia pozei ce urmeaza sa fie deletata\n *\n * first_pozPic = prima poza vizibila din setul curent, indexul ei in cadrul tuturor pozelor\n * startFrom = resetam startFrom al carouselului\n *\n * ----[ MODIFICARE poza detaliata ]----------------\n *\n * - se incearca selectarea primei poze dupa cea deletata\n * - daca nu exista\n * - se incearca selectarea precedentei\n * - daca precedenta are display = none si prima poza din set nu are indexul = 0\n * - trebuie sa ne intoarcem cu un set in urma\n *\n * - daca nici o poza precedenta nu mai exista\n * - inseamna ca cea deletata era unica deci nu trebuie resetat carouselul\n *\n * ----[ Finalizare ]----------------------------------\n *\n * - stergerea efectiva a pozei\n * - resetarea carouselului\n *\n */\n\n var id = {};\n var el = {};\n var vr = {};\n\n vr.restartCarousel = true;\n vr.startFrom = first_pozPic;\n\n id.pic = 'pic_'+idPic;\n el.deletedPic = $('.image_carousel .carousel-content *[class^=thumbPic-manager][id='+id.pic+']');\n\n alert('In carousel_deletePic '+ 'id = '+id.pic+' first_pozPic ='+first_pozPic);\n\n\n //=================================[ determina poza din details- picture ]======================================\n id.showPic = '';\n\n el.nextPic = el.deletedPic.next();\n if(el.nextPic.length > 0)\n {\n id.showPic = el.nextPic.attr('id').split('_')[1];\n }\n else\n {\n el.prevPic = el.deletedPic.prev();\n if(el.prevPic.length > 0)\n {\n id.showPic = el.prevPic.attr('id').split('_')[1];\n /*inseamna ca trebuie sa ne ducem inspate deoarece toate pozele din setul actual s-au terminat*/\n if(el.prevPic.css('display')=='none' && first_pozPic!=0)\n vr.startFrom -= 3;\n }\n else{\n /*inseamna ca e ultima poza din show deci nu prea am de ce sa restartez nimic*/\n alert(\"nu-i a buna in carousel_deletePic\");\n vr.restartCarousel = false\n }\n }\n //===============================================================================================================\n\n alert('showPic_id = '+ id.showPic);\n\n // sterge poza\n el.deletedPic.remove();\n if(vr.restartCarousel)\n carouselRestart(vr.startFrom, id.showPic);\n\n\n }", "title": "" }, { "docid": "f3fe3baf852f587b3bd3d2e8d14b6a47", "score": "0.5618841", "text": "deleteImage(imageID) {\n fetch(`https://maximum-arena-3000.codio-box.uk/api/images/${imageID}`, {\n method: \"DELETE\",\n body: null,\n headers: {\n \"Authorization\": \"Basic \" + btoa(this.context.user.username + \":\" + this.context.user.password)\n }\n })\n .then(status)\n .then(json)\n .then(dataFromServer => {\n this.deleteImageFromImagesObject(imageID);\n message.success('Image deleted successfully', 4);\n })\n\n .catch(error => {\n message.error(`Error deleting image! Please try again!`, 6);\n });\n }", "title": "" }, { "docid": "f0ac760f90c12a4b46dc50a8f43f374c", "score": "0.5581264", "text": "function deleteImg(user, imgUrl){\n let imgName = imgUrl.substr(imgUrl.lastIndexOf('/') + 1);\n let form_delete = new FormData();\n form_delete.append('username', user);\n form_delete.append('img_url', imgUrl);\n form_delete.append('img_name', imgName);\n $.ajax({\n url: 'https://cogniapi.altervista.org/deleteImg.php', // point to server-side PHP script\n dataType: 'text', // what to expect back from the PHP script, if anything\n cache: false,\n contentType: false,\n processData: false,\n crossDomain: true,\n data: form_delete,\n type: 'post',\n success: function (php_script_response) {\n location.reload();\n },\n error: function (php_script_response) {\n console.err(php_script_response);\n alert('Sorry! We\\'ve encountered some unexpected errors');\n }\n });\n}", "title": "" }, { "docid": "e3195f7f86ab695e01d69d2e2c989d27", "score": "0.5563633", "text": "function deleteImage(){\n console.log(\"Delete\")\n image = canvas.getActiveObject();\n if (image) image.remove()\n}", "title": "" }, { "docid": "91549e8209f16c4a914258067f69c150", "score": "0.5560616", "text": "deletePicture(photo, position) {\n return __awaiter(this, void 0, void 0, function* () {\n // Remove this photo from the Photos reference data array\n this.photos.splice(position, 1);\n // Update photos array cache by overwriting the existing photo array\n Storage.set({\n key: this.PHOTO_STORAGE,\n value: JSON.stringify(this.photos)\n });\n // delete photo file from filesystem\n const filename = photo.filepath.substr(photo.filepath.lastIndexOf('/') + 1);\n yield Filesystem.deleteFile({\n path: filename,\n directory: FilesystemDirectory.Data\n });\n });\n }", "title": "" }, { "docid": "9e1b8121722f25da3316b6e8055d69e0", "score": "0.5558739", "text": "function delete_image(req, res, image_path, success, redirect_uri, message) {\n image\n .destroy(image_path)\n .then(function () {\n req.session.user.image = '/img/users/' + req.file.filename;\n req.session.message = {\n text: message,\n type: success ? 'success' : 'danger'\n };\n res.redirect(success ? redirect_uri : '/idm/users/' + req.user.id);\n })\n .catch(function (error) {\n debug('Error: ', error);\n req.session.message = { text: ' Error saving image.', type: 'danger' };\n res.redirect('/idm/users/' + req.user.id);\n });\n}", "title": "" }, { "docid": "022120a90eddd3eee6dce0c847b11158", "score": "0.5555812", "text": "function deleteImage(response, request) {\n console.log(\"Request handler 'deleteImage' was called.\");\n fs.readFile('./view/deletedImage.html', function (err, html) {\n if (err) {\n throw err;\n } else {\n var query = url.parse(request.url).query,\n params = querystring.parse(query),\n doc = jsdom.jsdom(html);\n fs.unlink(\"./images/\" + params.Image); //removing image from gallery\n doc.getElementById('deleteSuccessMSG').innerHTML = ' <strong style=\"font-size: 50px;\">' +\n 'Image \"' + params.Image + '\" Has been removed from gallery.' +\n '</strong>';\n response.writeHead(200, {'Content-type': 'text/html'});\n response.end(jsdom.serializeDocument(doc));\n }\n });\n}", "title": "" }, { "docid": "598a36b7b3d4fdd8f3e1b3c515601160", "score": "0.55464554", "text": "remove(req, res, next) {\r\n\r\n Camera.deleteOne({ _id: req.params.id }).exec()\r\n .then(removed => super.sendResponse(res, {}))\r\n .catch(err => super.handleError(res, err));\r\n\r\n }", "title": "" }, { "docid": "40c3f970bfe0ac8fba6ab1a170106cb8", "score": "0.55407685", "text": "function removePicture(url) {\n S3.delete(imgUrl(url), function (err, r) {\n if (err) {\n toast.message(err);\n } else {\n toast.message(\"Imagem Excluída\");\n vm.needSave = true;\n vm.form.pictures.splice(vm.form.pictures.indexOf(url), 1);\n }\n });\n }", "title": "" }, { "docid": "b94c66cfcbb9fead876692166cd273d8", "score": "0.5532301", "text": "function deleteImage() {\n fs.unlink(imagefile, (err) => {\n if (err) { return console.error(err); }\n });\n}", "title": "" }, { "docid": "b4213060838fe833ff8036253fb08ba5", "score": "0.5514469", "text": "function deleteNameplate(nameplateid) {\n console.log('deleteNameplate = ', deleteNameplate);\n $http({\n method: 'DELETE',\n url: '/nameplate/delete' + nameplateid // NOTE: changing path resulted with this error: DELETE http://localhost:5500/mainPage/deleteMustMatc26 404 (Not Found)\n }).then(function(response) {\n getNameplate();\n });\n console.log('delete from nameplate.factory.js'); // NOTE: 02: logging ok!\n } // NOTE: for: function deleteNameplate", "title": "" }, { "docid": "d240522fa0d00030aa1d9f7f6a34dcd3", "score": "0.5510864", "text": "function deleteReply(url, callback) {\n axios\n .delete(url)\n .then((response) => {\n console.log(response.data)\n callback && callback(response.data)\n })\n .catch(error => console.log(error))\n .finally(() => lazyloadImages())\n }", "title": "" }, { "docid": "01babac1d26161b36259887b74c99c2e", "score": "0.54778767", "text": "function deleteMedia(id) {\n Media.delete(id).then(\n function onSuccess(responce) {\n console.log(responce);\n },\n\n function onError(responce) {\n console.log(responce);\n }\n );\n }", "title": "" }, { "docid": "b7213b71e4ab4e9ac679d74448baffcc", "score": "0.5475689", "text": "function deletePic(path) {\n var tempFile = fs.openSync('./' + path, 'r');\n fs.closeSync(tempFile);\n fs.unlinkSync('./' + path);\n}", "title": "" }, { "docid": "aaa3002f73c5fd4334352574b1e133b3", "score": "0.54749614", "text": "function deleteCameraFromDb(cameraId){\n\tif (window.XMLHttpRequest) {\n\t\t// code for IE7+, Firefox, Chrome, Opera, Safari\n\t\txmlhttp = new XMLHttpRequest();\n\t} else { // code for IE6, IE5\n\t\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}\n\n\txmlhttp.onreadystatechange = function() {\n\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\t\t\tdebugger;\n\t\t}\n\t}\n\n\txmlhttp.open(\"GET\",\"php/deletecamera.php?id=\" + cameraId,true);\n\txmlhttp.send();\n}", "title": "" }, { "docid": "59033f3a2d668780bfbd7280f7a12a12", "score": "0.5470938", "text": "function onRemovePhoto1Click(button) \r\n{\r\n\t//checks if the anwser is yes and if so then remove the image\r\n\tif(button == 1)\r\n\t\tgetDocID('imgSumbitPhoto1').src = '';\r\n}//end of onRemovePhoto1Click()", "title": "" }, { "docid": "e8d89bf78741925f02d1a36085455dd7", "score": "0.5458133", "text": "function deletePhoto(id) { \n\n var p = new Promise(function(resolve, reject) {\n\n findPhotosByFileName(id).then(function(photos) {\n if (photos.length > 0) {\n var photo = photos[0]; \n photo.photoStatus = photoStatuses.Deleted; \n db.put('photoTable', photo, id); \n\n resolve(photo); \n }\n }); \n }); \n\n return p; \n }", "title": "" }, { "docid": "5c5ed40f653c267301dd3bca158733ef", "score": "0.5449143", "text": "async removePicture({commit}, pic) {\n await axios.post(\"/pictures/delete-unused-pics\", { urls : pic });\n \n commit('removePic', pic) \n }", "title": "" }, { "docid": "5c1ca97aa7a7a332a21f7b441328a00a", "score": "0.54430085", "text": "function onRemovePhoto4Click(button) \r\n{\r\n\t//checks if the anwser is yes and if so then remove the image\r\n\tif(button == 1)\r\n\t\tgetDocID('imgSumbitPhoto4').src = '';\r\n}//end of onRemovePhoto4Click()", "title": "" }, { "docid": "7f07aa0606e2e4028509f203816afd72", "score": "0.5436558", "text": "function deletePhotoFromWishlist(photo, ID) {\n\tconsole.log(\"Deleting photo \" + photo.WID + \" from wishlist...\");\n\t\n\t// DELETE photo from user's wishlist\n\t$.ajax({\n\t\turl: backendUrl + \"wishlist/\" + photo.WID,\n\t\tcontext: document.body,\n\t\ttype: 'DELETE',\n\t\t//type: 'POST',\n\t\t//headers: {'X-HTTP-Method-Override': 'DELETE'},\n\t\tsuccess: function(data) {\n\t\t\tconsole.log(\"deletePhotoFromWishlist() AJAX successful API DELETE.\");\n\t\t\talert(\"Photo removed from your wishlist.\");\n\n\t\t\t// Change buttons\n\t\t\t$(\"#remWishButton\" + ID).css('display', 'none');\n\t\t\t$(\"#wishButton\" + ID).css('display', 'inline');\n\t\t},\n\t\terror: function(data) {\n\t\t\talert(\"Couldn't delete photo from wishlist.\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a623f0ca6b5610d05d0305b4bf120510", "score": "0.5404566", "text": "function delete_files(filepath, num) {\n var url = 'https://zoomsmartsync.herokuapp.com/api/deleteObject?name=';\n var filename = path.parse(filepath).base;\n var URL = url.concat(filepath.substr(length,filepath.length))\n //var URL = URL.concat(\"/\"+filename)\n var URL = URL.replace(/\\\\/g, \"/\");\n\n req.del(URL, function(error,res,body) {\n if(error) {\n console.log(error);\n }else {\n console.log(\"Status code for Delete Object: \", res.statusCode);\n if(num!=9){\n callNotification(\"File deleted successfully\\n\");\n }\n }\n });\n}", "title": "" }, { "docid": "3f9b57af4e4d8d7ea6b497dfc38fcf8d", "score": "0.5395056", "text": "function deleteImage(image) {\n var name = image.name,\n description = image.description,\n object_type = image.object_type,\n object_id = image.object_id,\n type = image.type,\n id = image.id;\n \n \n return function (dispatch) {\n return (0, _axios2.default)({\n url: '/api/images/' + id,\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(function (response) {\n dispatch(deleteImageSuccess(response.data));\n }).catch(function (error) {\n return dispatch(deleteImageFail(error));\n });\n };\n }", "title": "" }, { "docid": "e64de2cf8ce99f21c12d8c5cd18b786e", "score": "0.5389471", "text": "function delImage(nr) { \r\n if (nr == \"Gen\") {\r\n if (Selection < 0 || Selection > Images.length - 1) {\r\n return;\r\n }\r\n nr = Selection; \r\n Selection = -1;\r\n } else {\r\n nr = parseInt(nr, 10);\r\n }\r\n \r\n Images.splice(nr, 1);\r\n generateImgListEditor(); \r\n}", "title": "" }, { "docid": "521e0306c8fcff8880e586271fd58ec9", "score": "0.5385939", "text": "function onRemovePhoto2Click(button) \r\n{\r\n\t//checks if the anwser is yes and if so then remove the image\r\n\tif(button == 1)\r\n\t\tgetDocID('imgSumbitPhoto2').src = '';\r\n}//end of onRemovePhoto2Click()", "title": "" }, { "docid": "09955f1d71e546836f84e8bab0e12d93", "score": "0.5380877", "text": "function deleteImage(id) {\n\n\n $(\"button[data-close-modal='\"+ id +\"']\").trigger(\"click\");\n\n $.post('includes/rest/deleteImage.php', {\n imageId: id\n }).done(function(data) {\n console.log(data);\n var jsonData = JSON.parse(data);\n console.log(jsonData.success);\n\n if(jsonData.success == true){\n $(\"div[data-thumb-wrap-id='\"+id+\"'\").remove();\n }\n else if(jsonData.success == false){\n console.error(data);\n }\n\n });\n\n}", "title": "" }, { "docid": "89312434d8284eb6496b332f2023a68c", "score": "0.5364334", "text": "function onRemovePhoto3Click(button) \r\n{\r\n\t//checks if the anwser is yes and if so then remove the image\r\n\tif(button == 1)\r\n\t\tgetDocID('imgSumbitPhoto3').src = '';\r\n}//end of onRemovePhoto3Click()", "title": "" }, { "docid": "5311a0e841075d7acc7205d4419eeab7", "score": "0.53641", "text": "delete({person}, res) {\n\t\tperson.remove((err, person) => {\n\t\t\tres.sendStatus(200);\n\t\t});\n\t}", "title": "" }, { "docid": "25b79bda8ced86889fd186fd9a848c61", "score": "0.53624594", "text": "function deletePhoto() {\n var data = {};\n data['imageName'] = document.getElementById('delete_file_name').getAttribute('value');\n $.ajax({\n url: '/deletephoto',\n data: data,\n dataType: 'json'\n })\n .done(function(response){\n console.log(response);\n });\n}", "title": "" }, { "docid": "90e8c8371e31a1342685186844600ee9", "score": "0.53472465", "text": "static deleteAction(id){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\treturn new kaltura.RequestBuilder('image', 'delete', kparams);\n\t}", "title": "" }, { "docid": "072c2c677fe2d88e3384c005e1a6a950", "score": "0.53403157", "text": "async deletePhoto(id) {\n const user = await this.getCurrentUser();\n const photo = await this.photoRepository.findOne({ _id: +id });\n if (photo.ownerId !== user._id) {\n throw new ForbiddenError('only the photo owner can delete it');\n }\n return this.photoRepository\n .remove({ _id: +id })\n .then((numRemoved) => !!numRemoved);\n }", "title": "" }, { "docid": "d0ab75edae89316005a0c88f284cf9dd", "score": "0.5330204", "text": "function remove(id) {\n return db(\"image\").where({ id }).del();\n}", "title": "" }, { "docid": "95ff5128b48df3806b19021ee1a9b32a", "score": "0.5316663", "text": "function remove() {\n if ($window.confirm('Are you sure you want to delete?')) {\n vm.picture.$remove($state.go('pictures.list'));\n }\n }", "title": "" }, { "docid": "841e85f4d800c46dfa85cd931db2dea5", "score": "0.53115505", "text": "function onRemovePhoto5Click(button) \r\n{\r\n\t//checks if the anwser is yes and if so then remove the image\r\n\tif(button == 1)\r\n\t\tgetDocID('imgSumbitPhoto5').src = '';\r\n}//end of onRemovePhoto5Click()", "title": "" }, { "docid": "948eeb5b43f7eba83a4c7a6846ea9056", "score": "0.5309115", "text": "function delete_click(rowIdx) {\n\n\tvar url =\"/media/delete?mediakeystring=\" + members[rowIdx].mediaId +'';\n\n\trequestUrl(url);\n}", "title": "" }, { "docid": "473385f43f45de478e0c8fe5e43d8a1e", "score": "0.52894205", "text": "function delImg(id, a) {\n\t$.ajax({\n\t\turl : \"my/delelightboximg\",\n\t\ttype : \"post\",\n\t\tdata : \"box=\" + curLightBoxid + \"&id=\" + id,\n\t\tsuccess : function(data) {\n\t\t\t//$(a).closest(\".picbox-picbox\").hide();\n\t\t\tlocation.reload(true);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "c81ca8441001afc3f7e5058ddfa538bb", "score": "0.5283024", "text": "function delConceptImage(secConId) {\n deleteImg(secConId);\n}", "title": "" }, { "docid": "5c43930373808b576579a2d29036e606", "score": "0.5265881", "text": "async function deleteCameraContent(camInstance) {\n // this could take a min, send event when complete\n\n}", "title": "" }, { "docid": "1d202d5903230aec912decd52c3e79c3", "score": "0.52098227", "text": "function delJpeg() {\r\n return del(imgDEST + '**/*.jpeg');\r\n}", "title": "" }, { "docid": "0320c4aa70df1bccc6d50ba04558fc74", "score": "0.5207897", "text": "function deletePhotos(element, id1, id2){\n\tmessageBoxDelete(function(action){\n\t\tif (action == \"Ok\") {\n\t\t\t$(\"#\" + element).hide();\n\t\t\t$.post(\"/admin/gallery/deleteMedia/\", {\n\t\t\t\tid: id1\n\t\t\t});\n\t\t\tif (id2 != 0) \n\t\t\t\t$.post(\"/admin/gallery/deleteMedia/\", {\n\t\t\t\t\tid: id2\n\t\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "b102cb4a2f3e8c47d97b043062560e08", "score": "0.5197461", "text": "function remove_photo_upload(photo_id) {\n $(photo_id).value = '';\n hide($('remove_' + photo_id));\n}", "title": "" }, { "docid": "578dc6e6857aa667aafdc2a65e066421", "score": "0.5197406", "text": "function upload_picture(uploader_phone, picture_url, stream_id, tinyPicture_url, caption)\n{\n\tvar API_URL = \"http://75.101.134.112/stream/1.0/api/upload_picture.php?uploader_phone=\" + uploader_phone + \"&picture_url=\" + picture_url + \"&stream_id=\" + stream_id + \"&tinyPicture_url\" + tinyPicture_url + \"&caption=\" + caption;\n\tconsole.log(API_URL);\n\n\t$.getJSON(API_URL, function (data) \n\t{\n\t\tconsole.log(data);\n\t});\n}", "title": "" }, { "docid": "f93d1cd0b03c28640cdd193f27440b28", "score": "0.5195543", "text": "function deletePatient(){\n\tgetPatientByX(deletePatientInfo, document.getElementById(\"patient-delete-id\").value);\n}", "title": "" }, { "docid": "ab75a439a24b12dca200e88a2854c325", "score": "0.5167342", "text": "function photoApi(action, id) { return \"/api/photo/\" + action + \"/\" + (id || \"\"); }", "title": "" }, { "docid": "1c66716d3d174d5571fa15c1cc7afab2", "score": "0.5159585", "text": "function delImage(conId, secId, imgId, channelType) {\n deletImage(conId, secId, imgId, channelType);\n}", "title": "" }, { "docid": "89208c6ca5fbce1608f9fd56b210405d", "score": "0.51525205", "text": "function get_picture_metadata(picture_id, viewer_phone)\n{\n\tvar API_URL = \"http://75.101.134.112/stream/1.0/api/get_picture_metadata.php?picture_id=\" + picture_id + \"&viewer_phone=\" +viewer_phone;\n\tconsole.log(API_URL);\n\n\t$.getJSON(API_URL, function (data) \n\t{\n\t\tconsole.log(data);\n\t});\n}", "title": "" }, { "docid": "1a0e636c83382483250258e92a0c8112", "score": "0.51441306", "text": "function _delete(key) {\n const requestOptions = {\n method: 'GET',\n headers: { ...authHeader(), ...config.siteHeader }\n };\n return fetch(`${config.apiUrl}/uploads?type=delete&key=${key}`, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "97abfd4616f64f6fabed96ffee2634a8", "score": "0.5142665", "text": "deleteLogo () {\n const { dispatch } = this.props;\n const { id } = this.props.match.params;\n dispatch(unsetClientLogo(id));\n }", "title": "" }, { "docid": "35dcf0294080c172dbba505d3f082f4d", "score": "0.5138047", "text": "deleteImage(imagetmp,imagetmpmain){\n\t\t\tconsole.log(\"desde deleteImage: \",imagetmp)\n\t\t\tconsole.log(\"desde deleteImage: \",imagetmpmain)\n\t\t\tthis.dialogSuccessActive=false;\n\t\t\tlet session=this.testSession();\n\t\t\tif(!session){\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(session.status==\"error\"){\n\t\t\t\tthis.msgeDialogAlert=session.message;\n\t\t\t\tthis.dialogErrorActive=true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//console.log(\"No ha sido posible eliminar la imagen, el usuario no ha iniciado sesión\");\n\t\t\tlet api_token=session.api_token;\n\t\t\t\t//email=session.email;\n\t\t\t\n\t\t\tlet headers = {\n\t\t\t\theaders:{\n\t\t\t\t\tAuthorization: 'Bearer '+api_token\n\t\t\t\t}\n\t\t\t};\n\t\t\t//mostramos loading...\n\t\t\tthis.loading=true;\n\t\t\taxios.post(this.url+'image/'+imagetmp.id,{dato:this.actualPage},headers).then(res => {\t\t\t\t\n\t\t\t\t//manejo de errores en api\n\t\t\t\tif(res.data.error){\n\t\t\t\t\tthis.titleDialogAlert=\"No se ha podido eliminar la imagen\";\n\t\t\t\t\tthis.msgeDialogAlert=res.data.error;\n\t\t\t\t\t//console.log(res.data.error);\n\t\t\t\t\tthis.dialogErrorActive=true;\n\t\t\t\t//error con el servidor\n\t\t\t\t}else if(res.status!=200){\n\t\t\t\t\tthis.titleDialogAlert=\"No se ha podido eliminar la imagen\";\n\t\t\t\t\tthis.msgeDialogAlert=\"No se ha podido conectar con el servidor\";\n\t\t\t\t\tthis.dialogErrorActive=true;\n\t\t\t\t//eliminada correctamente\n\t\t\t\t}else{\n\t\t\t\t\tthis.titleDialogAlert=\"Imagen eliminada correctamente\";\n\t\t\t\t\tthis.msgeDialogAlert=res.data.message;\n\t\t\t\t\tthis.dialogErrorActive=true;\t\t\t\t\t\n\n\t\t\t\t\t//ocultamos loading...\n\t\t\t\t\tthis.loading=false;\n\t\t\t\t//anulamos si existe imageMain, ya que al recargar página en collections,\n\t\t\t\t//no existiría imageMain y es necesario comprobar si la imagen a eliminar se ha\n\t\t\t\t//enviado al panel principal, para eso usamos imagetmpmain, si es así, vaciamos\n\t\t\t\t\tif(imagetmpmain && imagetmpmain.random_name==imagetmp.random_name \n\t\t\t\t\t\t|| this.imageMain && this.imageMain.src==imagetmp.random_name){\n\t\t\t\t\t\n\t\t\t\t\t\tconsole.log(\"la misma imgawen\")\n\t\t\t\t\t\tif(this.imageMain){\n\t\t\t\t\t\t\tconsole.log(\"desde deleteImage borrando: \",this.imageMain)\n\t\t\t\t\t\t\tthis.dropImage(this.imageMain);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.$emit(\"setnav\",true);\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t//llamamos al método getImages() para volver a ordenar la \n\t\t\t\t//lista de imágenes, si se llama desde la paginación se pasa\n\t\t\t\t//el número de página\t\t\t\t\t\t\t\n\t\t\t\t\tif(res.data.page)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.getImages(res.data.page)\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis.getImages();\t\n\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\tthis.imagetmp=null;\n\t\t\t\tif(this.imageMain)\n\t\t\t\t\tconsole.log(\"final de eliminar imagen: \",this.imageMain)\n\t\t\t}).catch(error=> {\t\t\t\t\n\t\t\t\tthis.titleDialogAlert=\"No se ha podido eliminar la imagen\";\n\t\t\t\tthis.msgeDialogAlert=error.response.data.error;\n\t\t\t\tthis.dialogErrorActive=true;\n\t\t\t})\n\t\t\t\n\t\t}", "title": "" }, { "docid": "ee35a68803028f6e273f10e049268950", "score": "0.51363516", "text": "deleteimage(imageid) {\n const newImage = this.state.allImages.filter(image => image._id !== imageid)\n\n this.setState({\n allImages: newImage\n })\n\n axios.delete(`${process.env.REACT_APP_API_URL}/image/delete/` + imageid)\n .then(res => console.log(res.data))\n .catch(function (error) {\n console.log(error);\n })\n Swal.fire(\n 'Image Deleted successful!',\n '',\n 'error'\n )\n\n }", "title": "" }, { "docid": "81222ab81ddab0bf35cc80cf8129fedd", "score": "0.51282644", "text": "deleteFile(url){\n const file = url.split(env.files.uploadsUrl)[1]\n if(file != 'system/default.png'){\n fs.unlinkSync(env.files.uploadsPath+file)\n }\n }", "title": "" }, { "docid": "f643c2d851d1206b2b6ae29ee2681860", "score": "0.5125977", "text": "function deletePresupuesto(request, response){\n\ttry{\n\t\tvar connection = mysql.createConnection({\n\t\t\thost: global.config.ds_ceola2017.server,\n\t\t\tuser: global.config.ds_ceola2017.user,\n\t\t\tpassword: global.config.ds_ceola2017.password,\n\t\t\tdatabase: global.config.ds_ceola2017.database\n\t\t});\n\n\t\tvar id = JSON.parse(request.body.arg).id;\n\n\t\tconnection.query('CALL sp_eliminar_presupuesto(?)', [id], function (error, results, fields) {\n\t\t\tif(error){\n\t\t\t\tresponse.status(200).json(reply.fatal(error.message));\n\t\t\t} else {\n\t\t\t\tif(results.length != 0){\n\t\t\t\t\tresponse.status(200).json(reply.ok(results));\n\t\t\t\t} else {\n\t\t\t\t\tresponse.status(200).json(reply.ok(null));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tconnection.end();\n\t} catch(e){\n\t\tresponse.status(200).json(reply.fatal(e.message));\n\t}\n}", "title": "" }, { "docid": "ad51fca832562fd141909f2739e3d570", "score": "0.51062155", "text": "async function deleteImage(req, res) { \n \n var categoryDetail = {}; \n backURL=req.header('Referer') || '/'; \n if(req.params.id){\n var id = String(\"'\"+req.params.id+\"'\"); \n entityDetail = await BlogImages.deleteRecord(id); \n if(entityDetail.length == 0){ \n req.flash('error', 'Invalid url') \n }else{\n req.flash('success', 'Record deleted succesfully.'); \n } \n }else{ \n req.flash('error', 'Invalid url.'); \n } \n return res.redirect(backURL); \n}", "title": "" }, { "docid": "4e1065c82a8a400f351d8c5c57fc0038", "score": "0.5105034", "text": "delete(arg) {\n return this.httpClient\n .url(`/api_keys/${arg.id}`)\n .delete()\n .json(payload => util.deserializeResult(payload))\n .then(f => f, util.onRejected);\n }", "title": "" }, { "docid": "6884e5d4859dd82fd45f6ea710130b28", "score": "0.51047647", "text": "function CMB_deleteImage(button){\n let $button = jQuery(button);\n let $image = $button.closest('tr').find('.custom_media_image');\n let $input = $button.closest('tr').find('.custom_media_input');\n\n $button.hide();\n $image.attr('src', '').hide();\n $input.val('');\n}", "title": "" }, { "docid": "4f5fec1a9ebc2dc33577bcec05e2aaef", "score": "0.51016325", "text": "async removeImage(e) {\n\n // Get source URL\n const src = e.target.src;\n\n // Extract filename from source URL\n const filename = src.substring(src.lastIndexOf('/') + 1);\n\n // Await PHP\n await deleteImg(filename);\n\n // Remove image from uploaded array\n this.images.splice(this.images.indexOf(filename), 1);\n\n // Refresh image previews\n this.displayUploaded();\n }", "title": "" }, { "docid": "174aea9d229998664a0d791768ddf42f", "score": "0.51014644", "text": "onImageDelete(e) {\n const deleteLoc = e.target.getAttribute('data-del-loc');\n const deleteActionDictionary = {};\n const imageId = parseInt(e.target.getAttribute('id'), 10);\n const imageIdentifier = e.target.getAttribute('data-del-image');\n const { Id: userId } = this.props.params;\n deleteActionDictionary.local = deleteFromLocal;\n deleteActionDictionary.server = deleteFromServer;\n\n this.props.dispatch(deleteActionDictionary[deleteLoc](imageId, imageIdentifier, userId));\n }", "title": "" }, { "docid": "ac2b22e71fb419af54014b93f249f15f", "score": "0.508705", "text": "function findUserByPictureId(pictureId) {\n $.ajax({\n url: `/pictures/${pictureId}`,\n type: \"GET\",\n headers: { \"Authorization\": Cookies.get('token') },\n beforeSend: function (request) { request.setRequestHeader(\"Content-Type\", \"application/json\"); },\n dataType: \"json\",\n success: function (data) {\n deletePicture(pictureId, data.user.email);\n\n\n }\n })\n\n}", "title": "" }, { "docid": "d9a9ee35b14545a7a5d29208dc97dbd3", "score": "0.5085894", "text": "function deleteImg(idProduct) {\n //* Si l'utilisateur le confirme, rediriger vers la route adéquate.\n if (confirm(\"Vraiment supprimer les photos du produit ?\")) {\n //*Solution Synchrone => voir dans productController methode delete().\n // location = `/product/delete/${idProduct}/img`;\n\n //* Solution Asynchrone\n let url = `/product/delete/${idProduct}/img`;\n fetch(url)\n .then(() => location.reload())\n .catch(error => console.error(error));\n }\n\n}", "title": "" }, { "docid": "78706acd36f120f24a926a6f1cf2e787", "score": "0.50829893", "text": "function deleteImages() {\n fetch(`${baseUrl}/delete-gallery-images`, {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"Application/json\"\n },\n body: JSON.stringify({imageIds: props.selectedImages})\n })\n .then((res) => {\n toggleModal();\n res.status === 200 \n ? window.location.reload()\n : alert(\"Something went wrong!\")\n })\n .catch( err => console.log(err))\n }", "title": "" }, { "docid": "5e7dbc3d379661b50b458c2968b54c95", "score": "0.50733423", "text": "DeleteTracking(img, callback) {\n let trackingToDelete = this._getTrackingByImage(img);\n if (trackingToDelete._id) {\n $.ajax({\n url: `${ServerBaseUrl}/trackings/`,\n type: 'DELETE',\n data: {\n id: trackingToDelete._id\n }\n }).fail(err => {\n console.log('server fail to delete', err);\n callback(false);\n });\n } else {\n this._deleteLocalTracking(img);\n callback(true);\n }\n callback(true);\n }", "title": "" }, { "docid": "707f508710948f479614cf80233dc671", "score": "0.5070452", "text": "function removeAvatar(imgUrl){\n \n firebase.storage().refFromURL(imgUrl).delete()\n .catch((error) =>{\n console.log(error);\n });\n\n}", "title": "" }, { "docid": "b8e98d4c564dc05fca0c03ccf4ff754d", "score": "0.506621", "text": "function onRemoveThumbPhotoClick(button) \r\n{\r\n\t//checks if the anwser is yes and if so then remove the image\r\n\tif(button == 1)\r\n\t\tgetDocID('imgSumbitThumb').src = '';\r\n}//end of onRemoveThumbPhotoClick()", "title": "" }, { "docid": "124dc354f8f861d0befdbe5302849a63", "score": "0.50659204", "text": "async deleteImageFromAlbum(req, res) {\n // Pegar id do album e keys da imagem\n const { albumid } = req.params\n const { imageKeys } = req.body\n console.log(imageKeys)\n // Buscar o album\n const albumToRemoveImage = await Albuns.findById(albumid).catch(() => { error = true })\n // Verificar se o album existe\n if (!albumToRemoveImage || error) {\n return res.status(404).json({ message: 'album not found' })\n }\n // Remover a imagem da sua lista de imagens\n const imageRemovalResult = await albumFunctions.removeImageOfAlbum(albumToRemoveImage, imageKeys)\n // Verificar se a imagem foi realmente encontrada\n if (!imageRemovalResult) {\n return res.status(404).json({ error: 'image not found' })\n }\n // Remover as imagens da aws\n for(const imageKey of imageKeys){\n awsFunctions.deleteFile(imageKey, bucketName)\n }\n // Salvar informação no banco de dados\n await Albuns.findByIdAndUpdate(albumid, { images: imageRemovalResult.images })\n // Mensagem de confirmação\n return res.status(200).json({ message: 'images removed' })\n }", "title": "" }, { "docid": "51d189dd02d3b12dd7d01d1316d1c239", "score": "0.5062724", "text": "delete(arg) {\n return this.httpClient\n .url(`/ip_policies/${arg.id}`)\n .delete()\n .json(payload => util.deserializeResult(payload))\n .then(f => f, util.onRejected);\n }", "title": "" }, { "docid": "f9c206e80d90d47b9780c78574fdb9b3", "score": "0.5057504", "text": "function removeImage(url, id) {\n url = url.replace(\"url(\", \"\").replace(\")\", \"\").replace(\"\\\"\", \"\").replace(\"\\\"\", \"\");\n var rs = 1;// rs tra ve = 1 la hide\n if (id == 0) {\n return false;\n }\n var img = {\n FileImageID: id,\n FileImagePath: url\n }\n console.log(img)\n var svr = new AjaxCall(srcRmImg, JSON.stringify(img));\n svr.callServicePOST(function (data) {\n console.log(data); //rs=data; sua lai check if neu image khac duong dan moi remove, con \n });\n\n return rs;\n}", "title": "" }, { "docid": "5b72faefb335fca6c510d322de2c0a6b", "score": "0.50496763", "text": "delete(arg) {\n return this.httpClient\n .url(`/ip_restrictions/${arg.id}`)\n .delete()\n .json(payload => util.deserializeResult(payload))\n .then(f => f, util.onRejected);\n }", "title": "" }, { "docid": "535fdcd831401e95a07e36185de6854b", "score": "0.50454694", "text": "function deleting(name, interviewer) {\n //the data given should be null so when we send the data it sends null\n const interview = {\n student: name,\n interviewer\n };\n // we transition to deleting page then after 1 second it transitions to empty and sends the data to update our server\n transition(DELETING, true)\n\n props.cancelInterview(props.id, interview)\n .then(()=> transition(EMPTY))\n .catch(error => transition(ERROR_DELETE, true));\n \n }", "title": "" }, { "docid": "5daed5749418d48c51c4be51a63dce8f", "score": "0.50412685", "text": "function _delImage(){\n\t\t$(document).on('click','.delimg',function(e){\n\t\t\tvar id = $(this).attr('id');\n\t\t\t//var propid = $('#propid').val();\n\t\t\tvar dt = {'imgid':id};\n\t\t\t$.ajax({\n\t\t\t\t\turl: srl+'img',\n\t\t\t\t\ttype: 'post',\n\t\t\t\t\t\n\t\t\t\t\tcontentType: 'application/json;charset=UTF-8',\n\t\t\t\t\tdata: JSON.stringify(dt),\n\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\talert('Succesfully deleted');\n\t\t\t\t\t\t_getImgbyProp(propid);\n\t\t\t\t\t},\n\t\t\t\t\terror:function (xhr, ajaxOptions, thrownError) {\n\t\t\t\t\t\tconsole.log(xhr.status);\n\t\t\t\t\t\t//alert(thrownError);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\n}", "title": "" }, { "docid": "5b5a15503c289addcc8ffbc54dbf05bb", "score": "0.50393057", "text": "async function deleteDentistInfoPhoto(req, res) {\n try {\n const { dentistInfoId, dentistInfoPhotoId } = req.params;\n const dentistInfo = await db.DentistInfo.findOne({ where: { id: dentistInfoId } });\n if (!dentistInfo) {\n throw ForbiddenError('Invalid dentistInfoId');\n }\n if (dentistInfo.get('userId') !== req.user.get('id') && req.user.type !== 'admin') {\n throw ForbiddenError('Not the dentist owner');\n }\n\n const dentistInfoPhoto = await db.DentistInfoPhotos.findOne({ where: { id: dentistInfoPhotoId } });\n if (!dentistInfoPhoto) {\n throw ForbiddenError('Invalid dentistInfoPhotoId');\n }\n await deleteObjectInS3(dentistInfoPhoto.url);\n await dentistInfoPhoto.destroy();\n return res.status(200).json({ message: 'Delete OK' });\n } catch (e) {\n if (e.errors) {\n return res.status(400).send(e);\n }\n console.log('Error in deleteDentistInfoPhoto');\n console.log(e);\n return res.status(500).json({ errors: 'Internal Server Error' });\n }\n}", "title": "" }, { "docid": "bc95bf1172e14dfae6eab8b5e4944deb", "score": "0.5036883", "text": "function removeCam(camDoc) {\n camDoc.delete().then(() => {\n console.log('Camera document successfully deleted.');\n // Reset status.json to factory settings\n var factory_settings = {isSetup:false}\n jsonfile.writeFile(status_file, factory_settings, function (err) {\n if(err) {\n console.log('Error writing status.json to factory settings.');\n }\n // Do I need to add return or will factory-reset.sh continue automatically?\n });\n });\n}", "title": "" }, { "docid": "2ce930d68dcf1ccc88941b4cc01c50e0", "score": "0.5034164", "text": "function deleteImage(event){\n killE(event);\n var delete_ = confirm(\"Are you sure you want to delete that image?\");\n if (delete_){ //delete image\n\n let delId = event.target.id; //obtains the id of the item to be deleted from the clicked img tag\n lista.removeChild(lista.children[delId]); //removes the element from the browsers view\n imgNames.splice(delId, 1); //removes the element from the array of displayed images info\n refreshIds(); //resets the IDs matching the new image list size\n \n //Assigns selectedChild\n if(lista.children.length == 0){\n selectedChild = -1; //runs selectNthChild with selectedChild on -1 so that it will select the first child\n checkDisplayAreaVisivility();\n leaveCroppingMode();\n } else{\n selectNthChild(0);\n }\n checkButtons();\n }\n // do nothing\n}", "title": "" }, { "docid": "b3b8732eda15ecb5fdf144f6948b49df", "score": "0.50339603", "text": "function deleteCom(callback, elem){\n var elem_split = elem.split('-');\n var com_id = encodeURIComponent(elem_split[2]);\n xhr = new XMLHttpRequest()\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0))\n callback(xhr.responseText);\n };\n \n xhr.open(\"POST\", \"script/edit_pics.php\", true);\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.send(\"submit=delete_com&com_id=\"+com_id);\n }", "title": "" }, { "docid": "e171730dcdf685364a2c81c6901e0885", "score": "0.5033751", "text": "function onImageRemove() {\n imageService.getInfo(confirmBtn.dataset.imgid)\n .then((res) => {\n imageService.remove(res)\n .then((res) => {\n res.error ? console.log(`Response from DELETE: ${res}`) : imageUI.removeImage(confirmBtn.dataset.imgid);\n })\n .catch(res => {\n if (res === '403')\n window.location = './login.html';\n else console.log(`error from catch ${res}`)\n });\n })\n .catch(res => message.show({text: res.message, error: res.error}));\n $('#confirmActionModal').modal('toggle');\n }", "title": "" }, { "docid": "cafd8c76feb912d8b583f712bca82777", "score": "0.5032914", "text": "deleteGenero(id_genero_literario) {\n // Configura as variasveis\n const apiUrl = 'http://localhost/UnyLeyaProjectGit/index.php/C_Generos/DeleteGenerosLiterarios'; // URL para renderizar a função para o Controller.\n \n const myHeaders = new Headers();\n myHeaders.append('Content-Type', 'application/json');\n \n // Define o identificador que será deletado.\n let data = {\n id_genero_literario: id_genero_literario\n }\n\n // Configura o método POST\n const options = {\n method: 'POST',\n body: JSON.stringify(data),\n myHeaders\n }; \n \n // Executa o redirecionamento do link para o Controler\n fetch(apiUrl, options)\n .then(res => res.json()) \n\n // Atualiza a página após deletar o ítem\n window.location.reload(true); \n }", "title": "" }, { "docid": "79d9f2632965311f90b5aaa357f6a796", "score": "0.50327307", "text": "function deleteRecord(){\n\n var deleteID = document.getElementById(\"delete_id\").value;\n var tablename = document.getElementById(\"working_layer\").innerHTML;\n\n var deleteString = \"model_id=\"+deleteID+\"&port_id=\"+httpsPortNumberAPI+ \"&tablename=\"+ tablename; // original\n //var deleteString = \"model_id=\"+deleteID;\n var serviceUrl = \"https://developer.cege.ucl.ac.uk:\"+httpsPortNumberAPI+\"/deleteModels\";\n $.ajax({\n url: serviceUrl,\n crossDomain: true,\n type: \"POST\",\n success: function(data){\n console.log(data);\n dataDeleted(data);\n },\n data: deleteString\n });\n refreshModel();\n}", "title": "" }, { "docid": "27303657ccbd445666478e1f92f9e079", "score": "0.50298446", "text": "deleteImage() {\n this.props.onDelete ? this.props.onDelete(this.props.imageIndex) : null\n }", "title": "" }, { "docid": "7ea108e60dc0b9171d9be862eaf03275", "score": "0.5027811", "text": "delete(id) {\n if (renege(this, this.delete, ...arguments)) return;\n\n if (!checkId(id, 'profile')) {\n throw new ApiError('The profile id is invalid');\n }\n\n return this.network.delete(`${this.getResourceUrl()}/${id}`);\n }", "title": "" }, { "docid": "e6ff826fcb0fc2645d7d23c4d8f2dc23", "score": "0.50266755", "text": "function objective_delete(id, idproject, zoom) {\n\n if (confirm(\"Voulez vous vraiment supprimer cet objectif ?\")) {\n\n document.getElementById('div_loading').style.visibility=\"visible\";\n document.getElementById('div_loading').innerHTML=\"<p align='center'><br><br><img src='./common/modules/projects/img/loading.gif'><br>Suppression de l'objectif...</p>\";\n\n dims_xmlhttprequest('admin.php','op=project_objective_delete&idproject='+idproject+'&zoom='+zoom+'&idobjective='+id+'');\n dims_xmlhttprequest_tofunction('admin.php','op=project_diag_gantt&idproject='+idproject+'&zoom='+zoom+'&width='+window.innerWidth+'&height='+window.innerHeight+'',refresh_now,'diag_div');\n\n }\n}", "title": "" }, { "docid": "57824f97c0361614bab45a8f2651bd44", "score": "0.50244045", "text": "deleteFileClick() {\r\n let _this = this;\r\n deleteFile(this.state.file.name, true).then(function (res) {\r\n if (res.success) {\r\n let deletedFile = null;\r\n if (_this.data['FilePath']) {\r\n deletedFile = {\r\n name: _this.data['FileName'],\r\n type: _this.data['MimeType']\r\n }\r\n }\r\n _this.setState({\r\n file: null,\r\n deletedFile: deletedFile,\r\n filePreview: _this.siteURL + '/static/images/no-image-available.png',\r\n signatureData: null\r\n });\r\n\r\n if (_this.props.getDataOnUpload)\r\n _this.props.getDataOnUpload({\r\n file: null,\r\n deletedFile: deletedFile,\r\n fileId: _this.data ? _this.data.FileId : null\r\n });\r\n _this.notifyToaster(NOTIFY_SUCCESS, { message: _this.props.picDelSuccess });\r\n }\r\n }).catch(function (err) {\r\n _this.notifyToaster(NOTIFY_ERROR);\r\n });\r\n }", "title": "" }, { "docid": "ee1dbb104ff4e7f666a512141f8e56d1", "score": "0.50227475", "text": "onChangeDeleteImage() {\n this.props.onUpdateCallback(this.props.imgType, null)\n }", "title": "" }, { "docid": "a4adae00f9c74239fe102b7f51f27a3f", "score": "0.50149536", "text": "function deleteName(pid, number){\n\t$.post(\"http://localhost/myTinyMVC/index.php/PhoneBook/deleteName\",{id:pid, num:number},\n\t\tfunction(data) {\n\t\t\t$(\"#main\").html(data);\n\t\t}\n\t)\n}", "title": "" } ]
5e177498c809432cd710979b9f66c149
Populate sidebar with attribute options
[ { "docid": "42cbdc38186df4cb92363e48cc218c3c", "score": "0.0", "text": "function showTextAttributes($s, $a){\n//\tAppend all inputs to widgetAttributes div\n\ttry{\n\n\t\t// layer\n\t\t$a.append(\"<label id='l_layer'>Layer <span id='layer_value'></span></label><input id='layer' type='range' min='1' max='\"+(slide_array[current_slide - 1].widget_count)+\"' />\");\n\t\t// width\n\t\t$a.append(\"<label id='l_width'>Width</label><input id='width' type='range' min='5' max='400' />\");\n\t\t// x-coordinate\n\t\t$a.append(\"<label id='l_x'>X</label><input readonly='readonly' id='x' type='number' />\");\n\t\t// y-coordinate\n\t\t$a.append(\"<label id='l_y'>Y</label><input readonly='readonly' id='y' type='number' />\");\n\n\t\t// font selector\n\t\t$a.append(createFontSelectorHTML());\n\t\t// text\n\t\t$a.append(\"<textarea id='text' name='textarea' rows='4' maxlength='1000' style='resize: none;' placeholder='Enter text here'></textarea>\");\n\t\t// text size\n\t\t$a.append(\"<label id='l_size'>Text Size</label><input id='size' type='range' min='8' max='72' />\");\n\t\t//color picker\n\t\t$a.append(\"<label id='l_color'>Color</label><input id='color' type='color' />\");\n\n\t\t\n\n\t\t//Delete button\n\t\t$a.append(\"<button id='b_delete' onclick='deleteWidget()'>Delete Widget</button>\");\n\n\t\ttextInit($s, $a);\n\t}\n\tcatch(e){\n\t\tlog(\"widget_attr.js\", e.lineNumber, e);\n\t}\n}", "title": "" } ]
[ { "docid": "5f3650e967ae438bcb8cccafdfa5f9a3", "score": "0.74015176", "text": "function setSidebar(){\n\ttry{\n\n\t\t$s = $(\"#selected\");\n\t\t$a = $(\"#widgetAttributes\");\n\n\t\t// remove all attributes from sidebar\n\t\tclearAttributes($a);\n\t\t\n\t\tslide_array[current_slide - 1].widget_count = widget_array.length;\n\n\t\t\n\t\tif (selected_widget === null){\n\t\t\t// display background/slide attributes\n\t\t\tshowSlideAttributes($a);\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\tif ($s.hasClass(\"widg_text\")){\n\t\t\t\t// Display text attributes\n\t\t\t\tshowTextAttributes($s, $a);\n\t\t\t}\n\t\t\telse if ($s.hasClass(\"widg_audio\")){\n\t\t\t\t// Display audio attributes\n\t\t\t\tshowAudioAttributes($s, $a);\n\t\t\t}\n\t\t\telse if ($s.hasClass(\"widg_video\")){\n\t\t\t\t// Display video attributes\n\t\t\t\tshowVideoAttributes($s, $a);\n\t\t\t}\n\t\t\telse if ($s.hasClass(\"widg_picture\")){\n\t\t\t\t// Display picture attributes\n\t\t\t\tshowPictureAttributes($s, $a);\n\t\t\t}\n\t\t\telse if ($s.hasClass(\"widg_embedded\")){\n\t\t\t\t// Display embedded attributes\n\t\t\t\tshowEmbeddedAttributes($s, $a);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// Error;\n\t\t\t}\n\t\t}\n\t}\n\tcatch(e){\n\t\tlog(\"widget_attr.js\", e.lineNumber, e);\n\t}\n}", "title": "" }, { "docid": "f296e71a91ea31c30e397c007bd965b3", "score": "0.603952", "text": "function sidebar_default() {}", "title": "" }, { "docid": "3abc225bf723eefcc33b6db5a581e9a1", "score": "0.6025674", "text": "function populateSidebar(item) {\n let businessName = item.name;\n let businessLoc1 = item.location.display_address[0];\n let businessLoc2 = item.location.display_address[1];\n let businessRating = item.rating;\n let businessUrl = item.url;\n let resultString = `<li><strong>${businessName}</strong><br/> <em>Address:</em> ${businessLoc1} ${businessLoc2}<br/> <em>Rating:</em> ${businessRating}<br/> <a href=${businessUrl} target=\"_blank\">See reviews</a></li>`;\n $('.results').append(resultString);\n}", "title": "" }, { "docid": "149fe2514e9d154b67cf9be6ea8fef4c", "score": "0.59463286", "text": "function addLeftSidebar() {\n\t\n}", "title": "" }, { "docid": "25a440c661dad6c553c42a0b59bc13e5", "score": "0.5910525", "text": "function bind_accessoris_sidebar() {\n\tif ( $(\"#accessoris\").exists()==false ) { return; }\n\t$('a.ajax-accessoris').click(function(e){\n\t\te.preventDefault();\n\t\t$('nav#the-sidebar li').removeClass('active');\n\t\t$(this).parents().filter('li').addClass('active');\n\t\tvar href = $(this).attr('href')+' #accessoris-content';\n\t\t$('#accessoris-content').load(href, function() {\n\t\t\t$('#accessoris-content').i18n();\t\n\t\t});\n\t});\n}", "title": "" }, { "docid": "b6210408477a7f99e9dfb6c0a400c5e6", "score": "0.5860236", "text": "function sidebar() {\n\n return S.list().title(`Slick's Slices`).items([\n // Create a new sub item\n S.listItem().title('Home page').icon(() => <strong>🔥</strong>)\n .child(S.editor().schemaType('storeSettings')\n // make a document id so we don't have bunch of random stuff \n .documentId('downtown')\n ),\n \n // add in the rest of our documents\n ...S.documentTypeListItems().filter(item => item.getId() !== 'storeSettings'),\n ]);\n}", "title": "" }, { "docid": "50a3510b09da7c3df514e9780035711b", "score": "0.5859026", "text": "function onOpen() {\n var ui = SpreadsheetApp.getUi();\n\n ui.createMenu('Secretary')\n .addItem('Show sidebar', 'showSidebar')\n .addToUi();\n}", "title": "" }, { "docid": "28dbe3fb98f2aba773b9f1dd86b21e9b", "score": "0.58353907", "text": "function Plugin(option) {\n return this.each(function() {\n var $this = $(this);\n var data = $this.data('pg.sidebar');\n var options = typeof option == 'object' && option;\n\n if (!data) $this.data('pg.sidebar', (data = new Sidebar(this, options)));\n if (typeof option == 'string') data[option]();\n })\n }", "title": "" }, { "docid": "731da53216761fe3aca9266595da25d7", "score": "0.58316505", "text": "hydrateSidebar () {\n const {\n getPacks,\n getProposals,\n getRoles,\n me,\n packs,\n roles,\n defaultUser } = this.props;\n\n const user = defaultUser ? defaultUser : me;\n\n // Populate proposal ID array\n const proposalIds = user.proposals.map(\n item => item.proposal_id\n );\n\n // Populate role ID array\n let roleIds = [\n ...user.proposals,\n ...user.memberOf,\n ].map(item =>\n typeof item === 'object' ?\n item.object_id :\n item);\n\n // Populate pack ID array\n let packIds = user && user.proposals.map(\n item => item.pack_id\n ).filter(item => item);\n\n // Find packs and roles not loaded in\n if (roles && roles.length) {\n roleIds = roleIds.filter(\n item => !roles.find(role => role.id === item)\n );\n }\n if (packs & packs.length) {\n packIds = packIds.filter(\n item => !packs.find(pack => pack.id === item)\n );\n }\n\n // Fetch roles, packs, and proposals\n getProposals(proposalIds);\n getPacks([...new Set(packIds)]);\n getRoles([...new Set(roleIds)]);\n }", "title": "" }, { "docid": "99e587ba7b44e5f79db7fe1f9b1ea908", "score": "0.5794596", "text": "function loadSideBarDynamically()\n{\n\t$('#tabs').children('li').each(function () {\n\t\tsidebarItem = $(this).clone().removeClass(\"waves-effect\").attr('id', $(this).attr('id') + '_sidebar');\n\t\t$('#sidebar').append(sidebarItem);\n\t});\n\n}", "title": "" }, { "docid": "7984b0d116bc896451e2eac353c2343b", "score": "0.57387334", "text": "function activateSidebarDisplayOptions() {\n\t $('.sidebar-display-buttons').click(function() {\n\t var selected = $(this);\n\t console.log(\"icon selected:\", selected.text().toUpperCase().trim());\n\t // disable all the buttons\n\t $('.sidebar-display-buttons').addClass(\"disabled\");\n\t $('.map-selection-row, .timeseries-row, .scatterplot-row').removeClass('active');\n\t // then toggle the selected disabled class\n\t selected.toggleClass(\"disabled\");\n\t // use the name of the icon to trigger sidebar\n\t if (selected.text().toUpperCase().trim() == \"MAP CONTROLS\") {\n\t $('.map-selection-row').toggleClass('active');\n\t } else if (selected.text().toUpperCase().trim() == \"TIME SERIES\") {\n\t $('.timeseries-row').toggleClass('active');\n\t } else if (selected.text().toUpperCase().trim() == \"CLIMATE NORMALS\"){\n\t $('.scatterplot-row').toggleClass('active');\n\t }\n\t });\n\t}", "title": "" }, { "docid": "269e96cfb8bc7592aec8c71c610c03c8", "score": "0.5729098", "text": "function sidebarInfo(settings) {\n\n$('.ui.left.sidebar.popout').html(`\n\n<i class=\"inverted remove icon\" style=\"right: 10px; top: 10px; position: absolute; padding: 3px;\"></i>\n\n${settings.content}\n\n`);\n\n$('.ui.left.sidebar.popout').sidebar('show');\n\n$('.inverted.remove.icon').click(function() {\n $('.ui.left.sidebar.popout').sidebar('hide');\n});\n\n\n}", "title": "" }, { "docid": "97f1d18e60faf6d7584b7d754cb7bf7a", "score": "0.57054186", "text": "function navSidebar() {\n var sidebar = $('#nav-sidebar');\n\n sidebar.find('.menu').addClass('sm sm-simple sm-vertical sm-simple-vertical menu').attr('id', 'main-menu');\n $('#main-menu').smartmenus({\n mainMenuSubOffsetX: 0,\n mainMenuSubOffsetY:-9,\n // subMenusSubOffsetX: -1,\n subMenusSubOffsetY: -9,\n subIndicatorsText:'',\n subMenusMinWidth:'16em'\n });\n }", "title": "" }, { "docid": "8d01da9a757dbfb515daa9de25064218", "score": "0.570355", "text": "function Sidebar({ selectedLocationId, observationLocations, setSelectedLocation }) {\n\n // Sidebar styling\n const sidebarStyle = {\n overflowY: \"scroll\",\n width: \"100%\",\n top: \"0\",\n height: \"100vh\",\n position: \"relative\",\n cursor: \"pointer\",\n zIndex: \"10\",\n opacity: \"0\"\n };\n return (\n <div style={{ width: \"300px\" }}>\n <div\n className=\"list-group-flush zindex-fixed border-right\"\n style={observationLocations.length == 0 ? { opacity: \"0\" } : { opacity: \"1\" }}\n id=\"sidebar\"\n >\n <div className=\"list-group-item list-group-item-action active sticky-top\">\n <b>Valitse asema:</b>\n </div>\n {observationLocations.map(l => (\n <div\n className={\n l.info.id === selectedLocationId\n ? \"list-group-item list-group-item-secondary\"\n : \"list-group-item list-group-item-action\"\n }\n key={l.info.id}\n onClick={() => setSelectedLocation(l.info.id)}\n >\n {l.info.name}\n </div>\n ))}\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "70b675e0354cef5d87dd0664c182b499", "score": "0.56803894", "text": "function onOpen() {\n DocumentApp.getUi()\n .createAddonMenu() // Add a new option in the Google Docs Add-ons Menu\n .addItem(\"WordBlock\", \"showSidebar\")\n .addToUi(); // Run the showSidebar function when someone clicks the menu\n}", "title": "" }, { "docid": "f9f319f38c5d689f3a4ce8f56ecdfb8c", "score": "0.56459004", "text": "function initSidebar() {\n addMenuButtons();\n addEventListeners(Game.canvas);\n addSidebarHotkeys();\n}", "title": "" }, { "docid": "e1e0f7def094af6538ff18bdd2fc4f33", "score": "0.56272626", "text": "function onOpen() {\n DocumentApp.getUi()\n .createAddonMenu()\n .addItem(\"Analyze\", 'showSidebar')\n .addToUi();\n}", "title": "" }, { "docid": "9698f9682c0c835b28e7757894bbd658", "score": "0.55879277", "text": "function init(options, $that) {\r\n options.initialized = true;\r\n\r\n // Add CSS\r\n $('head').append($('<style>.theiaStickySidebar:after {content: \"\"; display: table; clear: both;}</style>'));\r\n\r\n $that.each(function () {\r\n var o = {};\r\n\r\n o.sidebar = $(this);\r\n\r\n // Save options\r\n o.options = options || {};\r\n\r\n // Get container\r\n o.container = $(o.options.containerSelector);\r\n if (o.container.length == 0) {\r\n o.container = o.sidebar.parent();\r\n }\r\n\r\n // Create sticky sidebar\r\n o.sidebar.parents().css('-webkit-transform', 'none'); // Fix for WebKit bug - https://code.google.com/p/chromium/issues/detail?id=20574\r\n o.sidebar.css({\r\n 'position': 'relative',\r\n 'overflow': 'visible',\r\n // The \"box-sizing\" must be set to \"content-box\" because we set a fixed height to this element when the sticky sidebar has a fixed position.\r\n '-webkit-box-sizing': 'border-box',\r\n '-moz-box-sizing': 'border-box',\r\n 'box-sizing': 'border-box'\r\n });\r\n\r\n // Get the sticky sidebar element. If none has been found, then create one.\r\n o.stickySidebar = o.sidebar.find('.theiaStickySidebar');\r\n if (o.stickySidebar.length == 0) {\r\n // Remove <script> tags, otherwise they will be run again when added to the stickySidebar.\r\n var javaScriptMIMETypes = /(?:text|application)\\/(?:x-)?(?:javascript|ecmascript)/i;\r\n o.sidebar.find('script').filter(function (index, script) {\r\n return script.type.length === 0 || script.type.match(javaScriptMIMETypes);\r\n }).remove();\r\n\r\n o.stickySidebar = $('<div>').addClass('theiaStickySidebar').append(o.sidebar.children());\r\n o.sidebar.append(o.stickySidebar);\r\n }\r\n\r\n // Get existing top and bottom margins and paddings\r\n o.marginBottom = parseInt(o.sidebar.css('margin-bottom'));\r\n o.paddingTop = parseInt(o.sidebar.css('padding-top'));\r\n o.paddingBottom = parseInt(o.sidebar.css('padding-bottom'));\r\n\r\n // Add a temporary padding rule to check for collapsable margins.\r\n var collapsedTopHeight = o.stickySidebar.offset().top;\r\n var collapsedBottomHeight = o.stickySidebar.outerHeight();\r\n o.stickySidebar.css('padding-top', 1);\r\n o.stickySidebar.css('padding-bottom', 1);\r\n collapsedTopHeight -= o.stickySidebar.offset().top;\r\n collapsedBottomHeight = o.stickySidebar.outerHeight() - collapsedBottomHeight - collapsedTopHeight;\r\n if (collapsedTopHeight == 0) {\r\n o.stickySidebar.css('padding-top', 0);\r\n o.stickySidebarPaddingTop = 0;\r\n }\r\n else {\r\n o.stickySidebarPaddingTop = 1;\r\n }\r\n\r\n if (collapsedBottomHeight == 0) {\r\n o.stickySidebar.css('padding-bottom', 0);\r\n o.stickySidebarPaddingBottom = 0;\r\n }\r\n else {\r\n o.stickySidebarPaddingBottom = 1;\r\n }\r\n\r\n // We use this to know whether the user is scrolling up or down.\r\n o.previousScrollTop = null;\r\n\r\n // Scroll top (value) when the sidebar has fixed position.\r\n o.fixedScrollTop = 0;\r\n\r\n // Set sidebar to default values.\r\n resetSidebar();\r\n\r\n o.onScroll = function (o) {\r\n // Stop if the sidebar isn't visible.\r\n if (!o.stickySidebar.is(\":visible\")) {\r\n return;\r\n }\r\n\r\n // Stop if the window is too small.\r\n if ($('body').width() < o.options.minWidth) {\r\n resetSidebar();\r\n return;\r\n }\r\n\r\n // Stop if the sidebar width is larger than the container width (e.g. the theme is responsive and the sidebar is now below the content)\r\n if (o.options.disableOnResponsiveLayouts) {\r\n var sidebarWidth = o.sidebar.outerWidth(o.sidebar.css('float') == 'none');\r\n\r\n if (sidebarWidth + 50 > o.container.width()) {\r\n resetSidebar();\r\n return;\r\n }\r\n }\r\n\r\n var scrollTop = $(document).scrollTop();\r\n var position = 'static';\r\n\r\n // If the user has scrolled down enough for the sidebar to be clipped at the top, then we can consider changing its position.\r\n if (scrollTop >= o.sidebar.offset().top + (o.paddingTop - o.options.additionalMarginTop)) {\r\n // The top and bottom offsets, used in various calculations.\r\n var offsetTop = o.paddingTop + options.additionalMarginTop;\r\n var offsetBottom = o.paddingBottom + o.marginBottom + options.additionalMarginBottom;\r\n\r\n // All top and bottom positions are relative to the window, not to the parent elemnts.\r\n var containerTop = o.sidebar.offset().top;\r\n var containerBottom = o.sidebar.offset().top + getClearedHeight(o.container);\r\n\r\n // The top and bottom offsets relative to the window screen top (zero) and bottom (window height).\r\n var windowOffsetTop = 0 + options.additionalMarginTop;\r\n var windowOffsetBottom;\r\n\r\n var sidebarSmallerThanWindow = (o.stickySidebar.outerHeight() + offsetTop + offsetBottom) < $(window).height();\r\n if (sidebarSmallerThanWindow) {\r\n windowOffsetBottom = windowOffsetTop + o.stickySidebar.outerHeight();\r\n }\r\n else {\r\n windowOffsetBottom = $(window).height() - o.marginBottom - o.paddingBottom - options.additionalMarginBottom;\r\n }\r\n\r\n var staticLimitTop = containerTop - scrollTop + o.paddingTop;\r\n var staticLimitBottom = containerBottom - scrollTop - o.paddingBottom - o.marginBottom;\r\n\r\n var top = o.stickySidebar.offset().top - scrollTop;\r\n var scrollTopDiff = o.previousScrollTop - scrollTop;\r\n\r\n // If the sidebar position is fixed, then it won't move up or down by itself. So, we manually adjust the top coordinate.\r\n if (o.stickySidebar.css('position') == 'fixed') {\r\n if (o.options.sidebarBehavior == 'modern') {\r\n top += scrollTopDiff;\r\n }\r\n }\r\n\r\n if (o.options.sidebarBehavior == 'stick-to-top') {\r\n top = options.additionalMarginTop;\r\n }\r\n\r\n if (o.options.sidebarBehavior == 'stick-to-bottom') {\r\n top = windowOffsetBottom - o.stickySidebar.outerHeight();\r\n }\r\n\r\n if (scrollTopDiff > 0) { // If the user is scrolling up.\r\n top = Math.min(top, windowOffsetTop);\r\n }\r\n else { // If the user is scrolling down.\r\n top = Math.max(top, windowOffsetBottom - o.stickySidebar.outerHeight());\r\n }\r\n\r\n top = Math.max(top, staticLimitTop);\r\n\r\n top = Math.min(top, staticLimitBottom - o.stickySidebar.outerHeight());\r\n\r\n // If the sidebar is the same height as the container, we won't use fixed positioning.\r\n var sidebarSameHeightAsContainer = o.container.height() == o.stickySidebar.outerHeight();\r\n\r\n if (!sidebarSameHeightAsContainer && top == windowOffsetTop) {\r\n position = 'fixed';\r\n }\r\n else if (!sidebarSameHeightAsContainer && top == windowOffsetBottom - o.stickySidebar.outerHeight()) {\r\n position = 'fixed';\r\n }\r\n else if (scrollTop + top - o.sidebar.offset().top - o.paddingTop <= options.additionalMarginTop) {\r\n // Stuck to the top of the page. No special behavior.\r\n position = 'static';\r\n }\r\n else {\r\n // Stuck to the bottom of the page.\r\n position = 'absolute';\r\n }\r\n }\r\n\r\n /*\r\n * Performance notice: It's OK to set these CSS values at each resize/scroll, even if they don't change.\r\n * It's way slower to first check if the values have changed.\r\n */\r\n if (position == 'fixed') {\r\n var scrollLeft = $(document).scrollLeft();\r\n\r\n o.stickySidebar.css({\r\n 'position': 'fixed',\r\n 'width': getWidthForObject(o.stickySidebar) + 'px',\r\n 'transform': 'translateY(' + top + 'px)',\r\n 'left': (o.sidebar.offset().left + parseInt(o.sidebar.css('padding-left')) - scrollLeft) + 'px',\r\n 'top': '0px'\r\n });\r\n }\r\n else if (position == 'absolute') {\r\n var css = {};\r\n\r\n if (o.stickySidebar.css('position') != 'absolute') {\r\n css.position = 'absolute';\r\n css.transform = 'translateY(' + (scrollTop + top - o.sidebar.offset().top - o.stickySidebarPaddingTop - o.stickySidebarPaddingBottom) + 'px)';\r\n css.top = '0px';\r\n }\r\n\r\n css.width = getWidthForObject(o.stickySidebar) + 'px';\r\n css.left = '';\r\n\r\n o.stickySidebar.css(css);\r\n }\r\n else if (position == 'static') {\r\n resetSidebar();\r\n }\r\n\r\n if (position != 'static') {\r\n if (o.options.updateSidebarHeight == true) {\r\n o.sidebar.css({\r\n 'min-height': o.stickySidebar.outerHeight() + o.stickySidebar.offset().top - o.sidebar.offset().top + o.paddingBottom\r\n });\r\n }\r\n }\r\n\r\n o.previousScrollTop = scrollTop;\r\n };\r\n\r\n // Initialize the sidebar's position.\r\n o.onScroll(o);\r\n\r\n // Recalculate the sidebar's position on every scroll and resize.\r\n $(document).scroll(function (o) {\r\n return function () {\r\n o.onScroll(o);\r\n };\r\n }(o));\r\n $(window).resize(function (o) {\r\n return function () {\r\n o.stickySidebar.css({'position': 'static'});\r\n o.onScroll(o);\r\n };\r\n }(o));\r\n\r\n // Recalculate the sidebar's position every time the sidebar changes its size.\r\n if (typeof ResizeSensor !== 'undefined') {\r\n new ResizeSensor(o.stickySidebar[0], function (o) {\r\n return function () {\r\n o.onScroll(o);\r\n };\r\n }(o));\r\n }\r\n\r\n // Reset the sidebar to its default state\r\n function resetSidebar() {\r\n o.fixedScrollTop = 0;\r\n o.sidebar.css({\r\n 'min-height': '1px'\r\n });\r\n o.stickySidebar.css({\r\n 'position': 'static',\r\n 'width': '',\r\n 'transform': 'none'\r\n });\r\n }\r\n\r\n // Get the height of a div as if its floated children were cleared. Note that this function fails if the floats are more than one level deep.\r\n function getClearedHeight(e) {\r\n var height = e.height();\r\n\r\n e.children().each(function () {\r\n height = Math.max(height, $(this).height());\r\n });\r\n\r\n return height;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "e522bfb355518de208f1cf6f674d2713", "score": "0.558598", "text": "function populateSidebarPanes() {\n // Activities pane\n $(document).on(\"dataReadyActivities\", function() {\n populatePaneActivities();\n });\n\n // Amenities pane\n // @TODO: We don't have data or API endpoint here yet?\n $(document).on(\"dataReadyAmenities\", function() {\n populatePaneAmenities();\n });\n\n // Reservations in Trails pane\n $(document).on(\"dataReadyReservations\", function() {\n populatePaneTrails();\n });\n}", "title": "" }, { "docid": "4bdd7ed7e3813aafba023c0948f2f0f0", "score": "0.5576649", "text": "function Sidebar() {\n const { hash } = window.location;\n const bars = [\n { href: '#/', name: '项目管理' },\n { href: '#/monitor', name: '性能分析' },\n { href: '#/error', name: '错误分析' },\n ];\n const html = bars.map((item) => {\n const className = hash === item.href ? 'active' : '';\n return (\n <li className={className} key={item.name}>\n <a href={item.href}><span>{item.name}</span></a>\n </li>\n );\n });\n return (\n <ul>\n {html}\n </ul>\n );\n}", "title": "" }, { "docid": "42fd7dccf439a80befff0744b2e86fea", "score": "0.55681014", "text": "constructor(props) {\n super(props);\n this.state = {\n sidebar: false,\n activeOption: -1,\n };\n }", "title": "" }, { "docid": "6b77cc4a9410e07acc62d4f219c3aa8c", "score": "0.5559904", "text": "function Sidebar(props: Props) {\n // Section Visibility\n const [infoSec, setInfoSec] = useToggle(false);\n const [pathsVisible, setPathsVisible] = useToggle(true);\n const [serversVisible, setServersVisible] = useToggle(true);\n const [requestsVisible, setRequestsVisible] = useToggle(true);\n const [responsesVisible, setResponsesVisible] = useToggle(true);\n const [parametersVisible, setParametersVisible] = useToggle(true);\n const [headersVisible, setHeadersVisible] = useToggle(true);\n const [schemasVisible, setSchemasVisible] = useToggle(true);\n const [securityVisible, setSecurityVisible] = useToggle(true);\n\n // Sections\n if (props.jsonData === null) {\n return null;\n }\n const { servers, info, paths } = props.jsonData || {};\n const { requestBodies, responses, parameters, headers, schemas, securitySchemes } =\n props.jsonData.components || {};\n\n return (\n <StyledSidebar className=\"theme--sidebar\">\n {info && (\n <StyledSection>\n <SidebarHeader headerTitle=\"INFO\" sectionVisible={infoSec} toggleSection={setInfoSec}>\n <Dropdown renderButton={DropdownEllipsis}>\n <DropdownDivider>VISIBILITY</DropdownDivider>\n <DropdownItem stayOpenAfterClick>\n <input\n type=\"checkbox\"\n onClick={setServersVisible}\n defaultChecked={serversVisible}\n />\n <label htmlFor=\"servers\">Servers</label>\n </DropdownItem>\n <DropdownItem stayOpenAfterClick>\n <input type=\"checkbox\" onClick={setPathsVisible} defaultChecked={pathsVisible} />\n <label htmlFor=\"paths\">Paths</label>\n </DropdownItem>\n <DropdownItem stayOpenAfterClick>\n <input\n type=\"checkbox\"\n onClick={setRequestsVisible}\n defaultChecked={requestsVisible}\n />\n <label htmlFor=\"requests\">Requests</label>\n </DropdownItem>\n <DropdownItem stayOpenAfterClick>\n <input\n type=\"checkbox\"\n onClick={setResponsesVisible}\n defaultChecked={responsesVisible}\n />\n <label htmlFor=\"responses\">Responses</label>\n </DropdownItem>\n <DropdownItem stayOpenAfterClick>\n <input\n type=\"checkbox\"\n onClick={setParametersVisible}\n defaultChecked={parametersVisible}\n />\n <label htmlFor=\"parameters\">Parameters</label>\n </DropdownItem>\n <DropdownItem stayOpenAfterClick>\n <input\n type=\"checkbox\"\n onClick={setHeadersVisible}\n defaultChecked={headersVisible}\n />\n <label htmlFor=\"headers\">Headers</label>\n </DropdownItem>\n <DropdownItem stayOpenAfterClick>\n <input\n type=\"checkbox\"\n onClick={setSchemasVisible}\n defaultChecked={schemasVisible}\n />\n <label htmlFor=\"schemas\">Schemas</label>\n </DropdownItem>\n <DropdownItem stayOpenAfterClick>\n <input\n type=\"checkbox\"\n onClick={setSecurityVisible}\n defaultChecked={securityVisible}\n />\n <label htmlFor=\"security\">Security</label>\n </DropdownItem>\n </Dropdown>\n </SidebarHeader>\n <SidebarInfo childrenVisible={infoSec} info={info} />\n </StyledSection>\n )}\n {serversVisible && servers && <SidebarServers servers={servers} onClick={props.onClick} />}\n {pathsVisible && paths && <SidebarPaths paths={paths} onClick={props.onClick} />}\n {requestsVisible && requestBodies && (\n <SidebarRequests requests={requestBodies} onClick={props.onClick} />\n )}\n {responsesVisible && responses && (\n <SidebarResponses responses={responses} onClick={props.onClick} />\n )}\n {parametersVisible && parameters && (\n <SidebarParameters parameters={parameters} onClick={props.onClick} />\n )}\n {headersVisible && headers && <SidebarHeaders headers={headers} onClick={props.onClick} />}\n {schemasVisible && schemas && <SidebarSchemas schemas={schemas} onClick={props.onClick} />}\n {securityVisible && securitySchemes && (\n <SidebarSecurity security={securitySchemes} onClick={props.onClick} />\n )}\n </StyledSidebar>\n );\n}", "title": "" }, { "docid": "fe3b21d60404b6d300c32b15b850cbee", "score": "0.55446786", "text": "function init() {\n mergeConfig();\n\n appendSidebar();\n bindEvents();\n }", "title": "" }, { "docid": "464ec9944dddb49f3c2b0d08611fe61d", "score": "0.5524226", "text": "function makeSidebar() {\r\n var i, // iteration index\r\n sidebar, // div for whole side bar\r\n buttonContainer, // contains information, loc history, and thumbnail buttons\r\n artworkInfoLabel, // \"Artwork Information\" label\r\n buttonCSS, // some button css\r\n newButtonCSS, // some more button css (do both of these in STYL)\r\n sidePanelFontSize, // result of call to Util.getMaxFontSizeEM (can try to do this in STYL after some trial and error)\r\n titleFontSize, // font size of \"Artwork Information\" header (STYL)\r\n metaDataLabel, // \"Information\" label\r\n editLocLabel, // \"Edit Location History\" label\r\n editThumbLabel, // \"Edit Thumbnail\" label\r\n assocMediaLabel, // \"Associated Media\" label\r\n addRemoveMedia, // \"Add/Remove Media\" button\r\n assetContainer, // contains assoc media thumbnail buttons\r\n sidebarHideButton, // button to toggle side bar visibility\r\n sidebarHideIcon, // arrow icon in the side bar hide button\r\n expanded = true; // whether the side bar is expanded or contracted\r\n\r\n buttonCSS = { // TODO STYL\r\n 'margin-top': '2%',\r\n 'margin-bottom': '3%',\r\n 'width': '81%',\r\n 'position': 'relative',\r\n };\r\n\r\n newButtonCSS = { // TODO STYL\r\n 'margin-top': '1%',\r\n 'margin-bottom': '1.5%',\r\n 'width': '100%',\r\n 'height': root.height() * 0.06,\r\n 'color': 'white',\r\n 'position': 'relative'\r\n };\r\n \r\n sidePanelFontSize = TAG.Util.getMaxFontSizeEM(\"Edit Maps\", 1, root.width() * 0.11, 0.5 * root.height() * 0.07);\r\n titleFontSize = TAG.Util.getMaxFontSizeEM(\"Artwork Properties\", 1, root.width() * 0.15, root.height() * 0.07);\r\n\r\n sidebar = $(document.createElement('div')); // TODO JADE/STYL\r\n sidebar.addClass(\"sidebar\");\r\n sidebar.css({\r\n 'width': '20%',\r\n 'height': '100%',\r\n 'position': 'relative',\r\n 'left': '0%',\r\n 'float': 'left',\r\n 'background-color': 'rgba(0,0,0,0.85)',\r\n 'z-index': 100\r\n });\r\n\r\n buttonContainer = $(document.createElement('div')); // TODO JADE/STYL\r\n buttonContainer.attr('class', 'buttonContainer');\r\n buttonContainer.css({\r\n position: 'relative',\r\n 'margin-top': '4%',\r\n 'text-align':'center'\r\n });\r\n sidebar.append(buttonContainer);\r\n\r\n // change calculation of max font size to be non-dependent on div size\r\n // copy constant over\r\n artworkInfoLabel = $(document.createElement('div')); // TODO JADE/STYL\r\n artworkInfoLabel.addClass('artworkInfoLabel');\r\n artworkInfoLabel.text('Artwork Properties');\r\n artworkInfoLabel.css({\r\n 'color': 'white',\r\n 'font-size': titleFontSize,\r\n 'margin-top': '2%',\r\n 'margin-bottom': '3%',\r\n 'font-weight': 'bold',\r\n 'height': newButtonCSS.height * 0.6\r\n });\r\n buttonContainer.append(artworkInfoLabel);\r\n\r\n rightArrow = $(document.createElement('img')); // TODO J/S\r\n rightArrow.attr('src', tagPath+'images/icons/Right.png'); // TODO keep this in js, tack on tagPath in web app\r\n rightArrow.css({\r\n \"position\": \"absolute\",\r\n \"right\": \"5%\",\r\n top: \"30%\",\r\n width: \"auto\",\r\n height: \"40%\"\r\n });\r\n\r\n metadataButton = $(document.createElement('div')) // TODO J/S\r\n .css(newButtonCSS);\r\n metadataButton.append(rightArrow);\r\n\r\n metaDataLabel = $(document.createElement('label')); // TODO J/S\r\n metaDataLabel.text(\"Metadata \");\r\n metaDataLabel.css({\r\n \"width\": \"100%\",\r\n \"height\": \"100%\",\r\n \"text-align\": \"center\",\r\n \"line-height\": metadataButton.height() + \"px\",\r\n \"font-size\": sidePanelFontSize\r\n });\r\n\r\n metadataButton.append(metaDataLabel);\r\n buttonContainer.append(metadataButton);\r\n\r\n rightArrowEditLoc = $(document.createElement('img')); // TODO J/S\r\n rightArrowEditLoc.attr('src', tagPath+'images/icons/Right.png');\r\n rightArrowEditLoc.css({ \"position\": \"absolute\", \"right\": \"5%\", top: \"30%\", width: \"auto\", height: \"40%\" });\r\n\r\n editLocLabel = $(document.createElement('label')); // TODO J/S\r\n editLocLabel.text(\"Edit Maps \");\r\n editLocLabel.css({ \"width\": \"100%\", \"height\": \"100%\", \"line-height\": \"100%\", \"text-align\": \"center\" });\r\n\r\n editLocButton = $(document.createElement('div')); // TODO J/S\r\n editLocButton.css(newButtonCSS);\r\n buttonContainer.append(editLocButton);\r\n editLocButton.append(rightArrowEditLoc);\r\n editLocButton.append(editLocLabel);\r\n editLocLabel.css({ \"line-height\": editLocButton.height() + \"px\", \"font-size\": sidePanelFontSize });\r\n\r\n editThumbLabel = $(document.createElement('label')); // TODO J/S\r\n editThumbLabel.text(\"Capture Thumbnail \");\r\n editThumbLabel.css({ \"width\": \"100%\", \"height\": \"100%\", \"line-height\": \"100%\", \"text-align\": \"center\" });\r\n\r\n rightArrowEditThumb = $(document.createElement('img')); // TODO J/S\r\n rightArrowEditThumb.attr('src', tagPath+'images/icons/Right.png');\r\n rightArrowEditThumb.css({ \"position\": \"absolute\", \"right\": \"5%\", top: \"30%\", width: \"auto\", height: \"40%\" });\r\n\r\n editThumbnailButton = $(document.createElement('div')); // TODO J/S\r\n editThumbnailButton.addClass(\"editThumbnailButton\");\r\n editThumbnailButton.attr('type', 'button');\r\n editThumbnailButton.css(newButtonCSS);\r\n\r\n buttonContainer.append(editThumbnailButton); // TODO J/S\r\n editThumbnailButton.append(rightArrowEditThumb);\r\n editThumbnailButton.append(editThumbLabel);\r\n editThumbLabel.css({ \"line-height\": editLocButton.height() + \"px\", \"font-size\": sidePanelFontSize });\r\n\r\n // toggles metadata form and button\r\n metadataButton.on('click', function () {\r\n METADATA_EDITOR.toggle();\r\n });\r\n\r\n // toggles location history editing panel and button\r\n editLocButton.on('click', function () {\r\n LOCATION_HISTORY.toggle();\r\n });\r\n \r\n // toggles edit thumbnail functionality\r\n editThumbnailButton.on('click', function () {\r\n THUMBNAIL_EDITOR.toggle();\r\n });\r\n\r\n assocMediaLabel = $(document.createElement('div')); // TODO JADE/STYL\r\n assocMediaLabel.addClass('assocMediaLabel');\r\n assocMediaLabel.text('Associated Media');\r\n assocMediaLabel.css({\r\n color: 'white',\r\n 'font-size': titleFontSize,\r\n 'margin-top': '6%',\r\n 'margin-bottom': \"2%\",\r\n 'font-weight': 'bold'\r\n });\r\n buttonContainer.append(assocMediaLabel);\r\n\r\n addRemoveMedia = $(document.createElement('button')); // TODO JADE/STYL\r\n addRemoveMedia.addClass('addRemoveMedia');\r\n addRemoveMedia.text('Add/Remove').css('border-radius', '3.5px');\r\n addRemoveMedia.attr('type', 'button');\r\n addRemoveMedia.css(buttonCSS);\r\n addRemoveMedia.css({'font-size':TAG.Util.getMaxFontSizeEM(\"Add/Remove Media\", 0.5, root.width() * 0.1, 0.5 * newButtonCSS.height)});\r\n buttonContainer.append(addRemoveMedia);\r\n\r\n // open media picker on button click\r\n addRemoveMedia.on('click', createMediaPicker);\r\n addRemoveMedia.on('mousedown', function () {\r\n addRemoveMedia.css({ \"background-color\": \"white\",\"color\":\"black\" });\r\n });\r\n\r\n addRemoveMedia.on(\"mouseleave\", function () {\r\n addRemoveMedia.css({ \"background-color\": \"transparent\",\"color\":\"white\"});\r\n });\r\n /**\r\n * Create the associated media selection picker\r\n * @method createMediaPicker\r\n */\r\n function createMediaPicker() {\r\n TAG.Util.UI.createAssociationPicker(root,\r\n \"Choose the media you wish to associate with this artwork\",\r\n {comp: artwork, type: 'artwork'},\r\n \"artwork\",\r\n [{\r\n name: \"all media\",\r\n getObjs: TAG.Worktop.Database.getAssocMedia,\r\n }, {\r\n name: \"currently associated\",\r\n getObjs: TAG.Worktop.Database.getAssocMediaTo,\r\n args: [artwork.Identifier]\r\n }], {\r\n getObjs: TAG.Worktop.Database.getAssocMediaTo,\r\n args: [artwork.Identifier]\r\n }, function () { // TODO (low priority) -- shouldn't need to reload entire list here\r\n $('.assetContainer').empty();\r\n createMediaList($('.assetContainer'));\r\n });\r\n }\r\n\r\n assetContainer = $(document.createElement('div')); // TODO JADE/STYL\r\n assetContainer.attr('class', 'buttonContainer');\r\n assetContainer.css({\r\n position: 'relative',\r\n top: '0%,',\r\n 'margin-top': '2%',\r\n padding: '0px 8% 0px 4%',\r\n width:'82%',\r\n left:'5%',\r\n 'overflow-x': 'hidden',\r\n 'overflow-y': 'auto',\r\n 'text-overflow': 'ellipsis',\r\n 'word-wrap': 'break-word',\r\n height: '54%'\r\n });\r\n assetContainer.addClass('assetContainer');\r\n sidebar.append(assetContainer);\r\n\r\n createMediaList(assetContainer);\r\n\r\n // sidebar toggle button\r\n sidebarHideButtonContainer = $(document.createElement('div')); // TODO J/S\r\n sidebarHideButtonContainer.addClass('sidebarHideButtonContainer');\r\n sidebarHideButtonContainer.css({\r\n 'top': '0%',\r\n 'right': '0%',\r\n 'position': 'relative',\r\n 'width': '2%',\r\n 'height': '100%',\r\n 'float': 'left',\r\n 'z-index': 1000\r\n });\r\n\r\n sidebarHideButton = $(document.createElement('div')); // TODO J/S\r\n sidebarHideButton.css({\r\n 'top': '45%',\r\n 'right': '0%',\r\n 'position': 'relative',\r\n 'width': '100%',\r\n 'height': '10%',\r\n 'background-color': 'rgba(0,0,0,.85)',\r\n 'border-bottom-right-radius': '10px',\r\n 'border-top-right-radius': '10px'\r\n });\r\n\r\n sidebarHideIcon = $(document.createElement('img')); // TODO J/S\r\n sidebarHideIcon.css({ 'top': '30%', 'width': '40%', 'height': 'auto', 'position': 'relative', 'left': '20%' });\r\n sidebarHideIcon.attr('src', tagPath+'images/icons/Left.png'); // TODO keep this in js, use tagPath + ....\r\n sidebarHideButton.append(sidebarHideIcon);\r\n\r\n sidebarHideButtonContainer.append(sidebarHideButton);\r\n\r\n sidebarHideButtonContainer.on('click', function () {\r\n var left = expanded ? '-20%' : '0%';\r\n sidebarHideIcon.attr('src', expanded ? tagPath+'images/icons/Right.png' : tagPath+'images/icons/Left.png'); // TODO tagPath + ... in web app\r\n sidebar.animate({ 'left': left }, 600);\r\n sidebarHideButtonContainer.animate({ 'left': left }, 600);\r\n expanded = !expanded;\r\n });\r\n\r\n mainPanel.append(sidebar); // TODO JADE\r\n mainPanel.append(sidebarHideButtonContainer);\r\n }", "title": "" }, { "docid": "6ad1b5200d003f6326bd6afbda6c1d1f", "score": "0.5517188", "text": "function updateSidebar(){\r\n //linearly a bad idea? since upgrades not that many?\r\n updateUpgradeInfo(\"strafeIcon\", playerShip.strafeEnabled);\r\n updateUpgradeInfo(\"speedIcon\", playerShip.speedIncrease);\r\n updateUpgradeInfo(\"damageIcon\", playerShip.weaponDamageIncrease);\r\n updateUpgradeInfo(\"tractorIcon\", playerShip.tractorEnabled);\r\n updateUpgradeInfo(\"gunIcon\", playerShip.gunEnabled);\r\n \r\n}", "title": "" }, { "docid": "8e162ca651d14f869d9035104cc36dcf", "score": "0.551268", "text": "function buildSidebar(data) {\n $('.form-tag').html(data);\n initDateP();\n updatePjax();\n $('.save-note').click(function () {\n saveAdditionalData(this);\n afterNoteSave(this);\n });\n\n $('.pn-pn').find('input').focusout(function () {\n var el = $(this);\n el.attr('data-value', el.val());\n saveAdditionalData(el);\n });\n}", "title": "" }, { "docid": "45193f9de0aabe60dbd07ab3b1d2f6d3", "score": "0.55106574", "text": "function openSidebar() {\n let scoreContainer = document.getElementById('metric_configuration');\n scoreContainer.style.padding = '0rem 1rem 1rem 1rem';\n scoreContainer.style.width = 'auto';\n\n let width = scoreContainer.getBoundingClientRect().width;\n let pullTab = document.getElementById('configuration_tab');\n pullTab.style.marginLeft = width + 'px';\n pullTab.onclick = closeSidebar;\n document.getElementById('main_section').style.marginLeft = width + 'px';\n}", "title": "" }, { "docid": "091fa5807a0fb30149ff2402174bb8c5", "score": "0.548482", "text": "renderSidebar() {\n return null\n }", "title": "" }, { "docid": "20592456f386642609b4b325a97ac67c", "score": "0.54569757", "text": "open(side) {\n try {\n const id = getId(side);\n Navigation.mergeOptions(id, {\n sideMenu: {\n [side]: {\n visible: true\n }\n }\n });\n this.visibility[side] = true;\n } catch (error) {\n //\n }\n }", "title": "" }, { "docid": "56bafd26b96583bf5011e171a5600123", "score": "0.5452746", "text": "function loadSidebar() {\n\tvar sidebar = document.getElementById('side');\n\tvar bars = sidebar.getElementsByTagName('*');\n\n\twhile (sidebar.firstChild) {\n\t\tsidebar.removeChild(sidebar.firstChild);\n\t}\n\t\n\tif (sideVisible) {\n\t\tsidebar.style.display = 'block';\n\t\tsideBar();\n\t\tbars = sidebar.getElementsByTagName('*');\n\t\tvar b = [];\n\t\tfor(var i = 0, n; n = bars[i]; ++i) b.push(n);\n\n\t\t//clean section headers\n\t\tfor (var i = 0; i < b.length; i++) {\n\t\t\tif (b[i].className == \"bar-section\") {\n\t\t\t\tb.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\n\t\tb[slideNum * 4].className = 'bar-select';\n\t\tif (slideNum * 4 == 0) sidebar.scrollTop = 0;\n\t\telse b[slideNum * 4].scrollIntoView({behavior: \"instant\", block: \"nearest\"});\n\t} else {\n\t\tsidebar.style.display = 'none';\n\t}\n}", "title": "" }, { "docid": "980ab7b5bde403bd6c09e79d6d656c10", "score": "0.54350185", "text": "function fillSideNav(title) {\n setSideTitle(title);\n getLinks(title, \"side-list\");\n}", "title": "" }, { "docid": "366aa0df087238739f4d45d83d26d7f9", "score": "0.542053", "text": "function onOpen(e) {\n SpreadsheetApp.getUi().createAddonMenu().addItem('Start', 'showSidebar').addToUi();\n}", "title": "" }, { "docid": "5ece0142042c46ed0a95e2d7874b846e", "score": "0.5417772", "text": "set sidebarOpen(open) {\n this._sidebarOpen = open;\n this.render();\n }", "title": "" }, { "docid": "10172dfb6fee868e76f60de5fb927a29", "score": "0.5414913", "text": "function openSidebar() {\n\t\t\tsidebarIsOpen = true;\n\n\t\t\t$( '.options' ).removeClass( 'closed' ).addClass( 'open' );\n\t\t\t$( '.press-this-actions, #scanbar' ).addClass( isHidden );\n\t\t\t$( '.options-panel-back' ).removeClass( isHidden );\n\n\t\t\t$( '.options-panel' ).removeClass( offscreenHidden )\n\t\t\t\t.one( transitionEndEvent, function() {\n\t\t\t\t\t$( '.post-option:first' ).focus();\n\t\t\t\t} );\n\t\t}", "title": "" }, { "docid": "72840fde9ce00d21122a28d9b0898bdd", "score": "0.53992194", "text": "function changeColorOfSidebar(color){\r\n\tif ($sidebar.length != 0) {\r\n\t\t $sidebar.attr('data-color', color);\r\n\t }\r\n}", "title": "" }, { "docid": "1f734ffb0b8d3cfb070194dddd80b080", "score": "0.5386074", "text": "initialize(){\r\n this._setSupportFeatures();\r\n \r\n // Get sticky sidebar inner wrapper, if not found, will create one.\r\n if( this.options.innerWrapperSelector ){\r\n this.sidebarInner = this.sidebar.querySelector(this.options.innerWrapperSelector);\r\n \r\n if( null === this.sidebarInner )\r\n this.sidebarInner = false;\r\n }\r\n \r\n if( ! this.sidebarInner ){\r\n let wrapper = document.createElement('div');\r\n wrapper.setAttribute('class', 'inner-wrapper-sticky');\r\n this.sidebar.appendChild(wrapper);\r\n \r\n while( this.sidebar.firstChild != wrapper )\r\n wrapper.appendChild(this.sidebar.firstChild);\r\n \r\n this.sidebarInner = this.sidebar.querySelector('.inner-wrapper-sticky');\r\n }\r\n \r\n // Container wrapper of the sidebar.\r\n if( this.options.containerSelector ){\r\n let containers = document.querySelectorAll(this.options.containerSelector);\r\n containers = Array.prototype.slice.call(containers);\r\n \r\n containers.forEach((container, item) => {\r\n if( ! container.contains(this.sidebar) ) return;\r\n this.container = container;\r\n });\r\n \r\n if( ! containers.length )\r\n throw new Error(\"The container does not contains on the sidebar.\");\r\n }\r\n \r\n // If top/bottom spacing is not function parse value to integer.\r\n if( 'function' !== typeof this.options.topSpacing )\r\n this.options.topSpacing = parseInt(this.options.topSpacing) || 0;\r\n \r\n if( 'function' !== typeof this.options.bottomSpacing )\r\n this.options.bottomSpacing = parseInt(this.options.bottomSpacing) || 0;\r\n \r\n // Breakdown sticky sidebar if screen width below `options.minWidth`.\r\n this._widthBreakpoint();\r\n \r\n // Calculate dimensions of sidebar, container and viewport.\r\n this.calcDimensions();\r\n \r\n // Affix sidebar in proper position.\r\n this.stickyPosition();\r\n \r\n // Bind all events.\r\n this.bindEvents();\r\n \r\n // Inform other properties the sticky sidebar is initialized.\r\n this._initialized = true;\r\n }", "title": "" }, { "docid": "a5099e093055fa01bd797a3a344c7cd4", "score": "0.53827447", "text": "function onOpen(){\n\n FormApp.getUi().createAddonMenu().addItem('Open','show_sidebar').addToUi();\n}", "title": "" }, { "docid": "22694d70afce17bb549892362b0b5a36", "score": "0.5377655", "text": "function buildSidebar (sidebar, file, project, animator) {\n\n\tvar files = {\n\t\tfiles: project.files(),\n\t\tanimations: project.animations()\n\t};\n\n\tsidebar.build(files, file.open, file.switch, animator.openAnimation);\n\n}", "title": "" }, { "docid": "72f81c4ec3adb80055321a4cc0775c5a", "score": "0.5372033", "text": "function openSidebarWhenClicked() {\n\t\tbrowser.browserAction.onClicked.removeListener(openSidebarWhenClicked)\n\t\tbrowser.sidebarAction.open()\n\t\tbrowser.browserAction.onClicked.addListener(closeSidebarWhenClicked)\n\t}", "title": "" }, { "docid": "73f518332dc28bc81bb822ce2108a01b", "score": "0.5370316", "text": "_uiHandleSidebar(mode) {\n let self = this;\n\n if (mode === 'init') {\n // Add 'side-trans-enabled' class to #page-container (enables sidebar and side overlay transition on open/close)\n // Fixes IE10, IE11 and Edge bug in which animation was executed on each page load - really annoying!\n self._lPage.addClass('side-trans-enabled');\n\n // Init custom scrolling\n self._uiHandleSidebar();\n } else {\n // If .side-scroll is added to #page-container enable custom scrolling\n if (self._lPage.hasClass('side-scroll')) {\n // Init custom scrolling on Sidebar\n if (!self._lSidebarScroll) {\n self._lSidebarScroll = new SimpleBar(self._lSidebar[0]);\n\n // Enable scrolling lock\n jQuery('.simplebar-scroll-content', self._lSidebar).scrollLock('enable');\n }\n } else {\n // If custom scrolling exists on Sidebar remove it\n if (self._lSidebarScroll) {\n // Disable scrolling lock\n jQuery('.simplebar-scroll-content', self._lSidebar).scrollLock('disable');\n\n // Unmount Simplebar\n self._lSidebarScroll.unMount();\n self._lSidebarScroll = null;\n\n // Remove Simplebar leftovers\n self._lSidebar.removeAttr('data-simplebar')\n .html(jQuery('.simplebar-content', self._lSidebar).html());\n }\n }\n }\n }", "title": "" }, { "docid": "ab6c868a693fc3e7c90eeb4fae1cc330", "score": "0.53633547", "text": "toggleSidebar() {\n Ember.$('.ui.sidebar').sidebar('toggle');\n }", "title": "" }, { "docid": "0f2e26388898fdaac38f128ec12bc42a", "score": "0.5361802", "text": "function add(sidebar, position) {\n\t sidebar = _.extend({\n\t position: position,\n\t menuCollapse: menuCollapse\n\t }, luxSidebarDefaults, sidebar);\n\n\t if (sidebar.sections) {\n\t sidebars.push(sidebar);\n\t return sidebar;\n\t }\n\t }", "title": "" }, { "docid": "9ea95d743f710c9591deb07ad8955821", "score": "0.5359582", "text": "function buildSidebar(name, bio, loc, email, photo, web) {\n\n let photoDiv = document.createElement('div');\n photoDiv.setAttribute('class', 'photoDiv');\n photoDiv.setAttribute('id', 'photoDiv');\n sidebarNode.appendChild(photoDiv);\n photoDiv.innerHTML = '<img class=\"img-rounded img-responsive large-photo\" src=\"' + photo + '\">';\n\n let nameDiv = document.createElement('h3');\n nameDiv.setAttribute('class', 'nameDiv');\n sidebarNode.appendChild(nameDiv);\n nameDiv.textContent = name;\n\n let bioDiv = document.createElement('p');\n bioDiv.setAttribute('class', 'bioDiv');\n sidebarNode.appendChild(bioDiv);\n bioDiv.textContent = bio;\n\n let contactDiv = document.createElement('div');\n contactDiv.setAttribute('class', 'contactDiv');\n sidebarNode.appendChild(contactDiv);\n let contactList = document.createElement('ul');\n contactList.setAttribute('class', 'list-unstyled');\n contactDiv.appendChild(contactList);\n\n let locDiv = document.createElement('li');\n locDiv.setAttribute('class', 'locDiv');\n locDiv.innerHTML = `<span class=\"octicon octicon-location\"></span><p>${loc}</p>`;\n contactList.appendChild(locDiv);\n\n let emailDiv = document.createElement('li');\n emailDiv.setAttribute('class', 'emailDiv');\n emailDiv.innerHTML = `<span class=\"glyphicon glyphicon-envelope\"></span></span><p>${email}</p>`;\n contactList.appendChild(emailDiv);\n\n let webDiv = document.createElement('li');\n webDiv.setAttribute('class', 'webDiv');\n webDiv.innerHTML = `<span class=\"glyphicon glyphicon-link\"></span><a href=\"${web}\">https://medium.com/@jennilynhowell</a>`;\n contactList.appendChild(webDiv);\n\n }", "title": "" }, { "docid": "bced7b4df8b013839a6c8e5b96e5b2d8", "score": "0.53483456", "text": "function toggleSidebarOpen() {\n\n\n\n }", "title": "" }, { "docid": "d3cbde3ca94e3e9389658b397e7dc879", "score": "0.534719", "text": "function Sidebar(props) {\n return (\n <aside className='sidebar'>\n <div className='header'>\n <div id='title'>{props.title}</div>\n <div>{props.description}</div> \n <div>{props.info}</div>\n </div>\n <a href='https://goldinvo.com' className='link'>\n <img src={logo} alt=''></img>\n goldinvo.com\n </a>\n </aside>\n )\n}", "title": "" }, { "docid": "caf6f7e083f2c9c3ddbf349f671864f6", "score": "0.53414774", "text": "function Sidebar_admin() {\n return (\n <div>\n <div class=\"left-sidenav\">\n <div class=\"brand\">\n <a href=\"dashboard/crm-index.html\" class=\"logo\"\n ><span\n ><img\n src=\"./assets/images/logo-sm.png\"\n alt=\"logo-small\"\n class=\"logo-sm\"\n /> </span\n ><span\n ><img\n src=\"./assets/images/logo.png\"\n alt=\"logo-large\"\n class=\"logo-lg logo-light\" />\n <img\n src=\"./assets/images/logo-dark.png\"\n alt=\"logo-large\"\n class=\"logo-lg logo-dark\" /></span\n ></a>\n </div>\n <div class=\"menu-content h-100\" data-simplebar>\n <ul class=\"metismenu left-sidenav-menu\">\n <li class=\"menu-label mt-0\">Main</li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i data-feather=\"home\" class=\"align-self-center menu-icon\"></i\n ><span>Dashboard</span\n ><span class=\"menu-arrow\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"index.html\"\n ><i class=\"ti-control-record\"></i>Analytics</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"crm-index.html\"\n ><i class=\"ti-control-record\"></i>CRM</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"helpdesk-index.html\"\n ><i class=\"ti-control-record\"></i>Helpdesk</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"sales-index.html\"\n ><i class=\"ti-control-record\"></i>Sales</a\n >\n </li>\n </ul>\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i data-feather=\"grid\" class=\"align-self-center menu-icon\"></i\n ><span>Apps</span\n ><span class=\"menu-arrow\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>Email\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"apps-email-inbox.html\">Inbox</a></li>\n <li><a href=\"apps-email-read.html\">Read Email</a></li>\n </ul>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"apps-chat.html\"\n ><i class=\"ti-control-record\"></i>Chat</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"apps-contact-list.html\"\n ><i class=\"ti-control-record\"></i>Contact List</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"apps-calendar.html\"\n ><i class=\"ti-control-record\"></i>Calendar</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"apps-files.html\"\n ><i class=\"ti-control-record\"></i>File Manager</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"apps-invoice.html\"\n ><i class=\"ti-control-record\"></i>Invoice</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"apps-tasks.html\"\n ><i class=\"ti-control-record\"></i>Tasks</a\n >\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>Projects\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"apps-project-overview.html\">Overview</a></li>\n <li><a href=\"apps-project-projects.html\">Projects</a></li>\n <li><a href=\"apps-project-board.html\">Board</a></li>\n <li><a href=\"apps-project-teams.html\">Teams</a></li>\n <li><a href=\"apps-project-files.html\">Files</a></li>\n <li><a href=\"apps-new-project.html\">New Project</a></li>\n </ul>\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>Ecommerce\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"apps-ecommerce-products.html\">Products</a></li>\n <li>\n <a href=\"apps-ecommerce-product-list.html\">Product List</a>\n </li>\n <li>\n <a href=\"apps-ecommerce-product-detail.html\"\n >Product Detail</a\n >\n </li>\n <li><a href=\"apps-ecommerce-cart.html\">Cart</a></li>\n <li><a href=\"apps-ecommerce-checkout.html\">Checkout</a></li>\n </ul>\n </li>\n </ul>\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i data-feather=\"lock\" class=\"align-self-center menu-icon\"></i\n ><span>Authentication</span\n ><span class=\"menu-arrow\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"auth-login.html\"\n ><i class=\"ti-control-record\"></i>Log in</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"auth-register.html\"\n ><i class=\"ti-control-record\"></i>Register</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"auth-recover-pw.html\"\n ><i class=\"ti-control-record\"></i>Recover Password</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"auth-lock-screen.html\"\n ><i class=\"ti-control-record\"></i>Lock Screen</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"auth-404.html\"\n ><i class=\"ti-control-record\"></i>Error 404</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"auth-500.html\"\n ><i class=\"ti-control-record\"></i>Error 500</a\n >\n </li>\n </ul>\n </li>\n <hr class=\"hr-dashed hr-menu\" />\n <li class=\"menu-label my-2\">Components & Extra</li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i data-feather=\"box\" class=\"align-self-center menu-icon\"></i\n ><span>UI Kit</span\n ><span class=\"menu-arrow\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>UI Elements\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"ui-alerts.html\">Alerts</a></li>\n <li><a href=\"ui-avatar.html\">Avatar</a></li>\n <li><a href=\"ui-buttons.html\">Buttons</a></li>\n <li><a href=\"ui-badges.html\">Badges</a></li>\n <li><a href=\"ui-cards.html\">Cards</a></li>\n <li><a href=\"ui-carousels.html\">Carousels</a></li>\n <li>\n <a href=\"ui-check-radio.html\"><span>Check & Radio</span></a>\n </li>\n <li><a href=\"ui-dropdowns.html\">Dropdowns</a></li>\n <li><a href=\"ui-grids.html\">Grids</a></li>\n <li><a href=\"ui-images.html\">Images</a></li>\n <li><a href=\"ui-list.html\">List</a></li>\n <li><a href=\"ui-modals.html\">Modals</a></li>\n <li><a href=\"ui-navs.html\">Navs</a></li>\n <li><a href=\"ui-navbar.html\">Navbar</a></li>\n <li><a href=\"ui-paginations.html\">Paginations</a></li>\n <li>\n <a href=\"ui-popover-tooltips.html\">Popover & Tooltips</a>\n </li>\n <li><a href=\"ui-progress.html\">Progress</a></li>\n <li><a href=\"ui-spinners.html\">Spinners</a></li>\n <li>\n <a href=\"ui-tabs-accordions.html\">Tabs & Accordions</a>\n </li>\n <li><a href=\"ui-toasts.html\">Toasts</a></li>\n <li><a href=\"ui-typography.html\">Typography</a></li>\n <li><a href=\"ui-videos.html\">Videos</a></li>\n </ul>\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>Advanced UI\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"advanced-animation.html\">Animation</a></li>\n <li><a href=\"advanced-clipboard.html\">Clip Board</a></li>\n <li><a href=\"advanced-highlight.html\">Highlight</a></li>\n <li><a href=\"advanced-idle-timer.html\">Idle Timer</a></li>\n <li><a href=\"advanced-kanban.html\">Kanban</a></li>\n <li><a href=\"advanced-lightbox.html\">Lightbox</a></li>\n <li><a href=\"advanced-nestable.html\">Nestable List</a></li>\n <li><a href=\"advanced-rangeslider.html\">Range Slider</a></li>\n <li><a href=\"advanced-ratings.html\">Ratings</a></li>\n <li><a href=\"advanced-ribbons.html\">Ribbons</a></li>\n <li><a href=\"advanced-session.html\">Session Timeout</a></li>\n <li><a href=\"advanced-sweetalerts.html\">Sweet Alerts</a></li>\n </ul>\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>Forms\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"forms-advanced.html\">Advance Elements</a></li>\n <li><a href=\"forms-elements.html\">Basic Elements</a></li>\n <li><a href=\"forms-editors.html\">Editors</a></li>\n <li><a href=\"forms-uploads.html\">File Upload</a></li>\n <li><a href=\"forms-repeater.html\">Repeater</a></li>\n <li><a href=\"forms-validation.html\">Validation</a></li>\n <li><a href=\"forms-wizard.html\">Wizard</a></li>\n <li><a href=\"forms-x-editable.html\">X Editable</a></li>\n </ul>\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>Charts\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"charts-apex.html\">Apex</a></li>\n <li><a href=\"charts-chartjs.html\">Chartjs</a></li>\n <li><a href=\"charts-flot.html\">Flot</a></li>\n <li><a href=\"charts-morris.html\">Morris</a></li>\n </ul>\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>Tables\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"tables-basic.html\">Basic</a></li>\n <li><a href=\"tables-datatable.html\">Datatables</a></li>\n <li><a href=\"tables-editable.html\">Editable</a></li>\n <li><a href=\"tables-responsive.html\">Responsive</a></li>\n </ul>\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>Icons\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"icons-dripicons.html\">Dripicons</a></li>\n <li><a href=\"icons-feather.html\">Feather</a></li>\n <li><a href=\"icons-fontawesome.html\">Font awesome</a></li>\n <li>\n <a href=\"icons-materialdesign.html\">Material Design</a>\n </li>\n <li><a href=\"icons-themify.html\">Themify</a></li>\n <li><a href=\"icons-typicons.html\">Typicons</a></li>\n </ul>\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>Maps\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"maps-google.html\">Google Maps</a></li>\n <li><a href=\"maps-vector.html\">Vector Maps</a></li>\n </ul>\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i class=\"ti-control-record\"></i>Email Template\n <span class=\"menu-arrow left-has-menu\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li><a href=\"email-templates-alert.html\">Alert Email</a></li>\n <li>\n <a href=\"email-templates-basic.html\">Basic Action Email</a>\n </li>\n <li>\n <a href=\"email-templates-billing.html\">Billing Email</a>\n </li>\n </ul>\n </li>\n </ul>\n </li>\n <li>\n <a href=\"widgets.html\"\n ><i data-feather=\"layers\" class=\"align-self-center menu-icon\"></i\n ><span>Widgets</span\n ><span class=\"badge badge-soft-success menu-arrow\">New</span></a\n >\n </li>\n <li>\n <a href=\"javascript: void(0);\"\n ><i\n data-feather=\"file-plus\"\n class=\"align-self-center menu-icon\"\n ></i\n ><span>Pages</span\n ><span class=\"menu-arrow\"\n ><i class=\"mdi mdi-chevron-right\"></i></span\n ></a>\n <ul class=\"nav-second-level\" aria-expanded=\"false\">\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"pages-blogs.html\"\n ><i class=\"ti-control-record\"></i>Blogs</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"pages-faqs.html\"\n ><i class=\"ti-control-record\"></i>FAQs</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"pages-pricing.html\"\n ><i class=\"ti-control-record\"></i>Pricing</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"pages-profile.html\"\n ><i class=\"ti-control-record\"></i>Profile</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"pages-starter.html\"\n ><i class=\"ti-control-record\"></i>Starter Page</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"pages-timeline.html\"\n ><i class=\"ti-control-record\"></i>Timeline</a\n >\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" href=\"pages-treeview.html\"\n ><i class=\"ti-control-record\"></i>Treeview</a\n >\n </li>\n </ul>\n </li>\n </ul>\n <div class=\"update-msg text-center\">\n <a\n href=\"javascript: void(0);\"\n class=\"float-right close-btn text-white\"\n data-dismiss=\"update-msg\"\n aria-label=\"Close\"\n aria-hidden=\"true\"\n ><i class=\"mdi mdi-close\"></i\n ></a>\n <h5 class=\"mt-3\">Mannat Themes</h5>\n <p class=\"mb-3\">\n We Design and Develop Clean and High Quality Web Applications\n </p>\n <a href=\"javascript: void(0);\" class=\"btn btn-outline-warning btn-sm\"\n >Upgrade your plan</a\n >\n </div>\n </div>\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "22ec9736a7c679445399f088791c8756", "score": "0.5333648", "text": "UPDATE_SIDEBAR_WIDTH(state, width) {\r\n state.sidebarWidth = width;\r\n }", "title": "" }, { "docid": "c4130f0b1f79ddc879b398336ca7dfd9", "score": "0.53265154", "text": "function showSidebar() {\r\n var sidebar = document.getElementById('sidebar');\r\n sidebar.style.display = 'inline';\r\n // change margin of wiki page content\r\n var wikipagecontent = document.getElementById('wikipagecontent');\r\n var cookie = fixedleft_get_cookie(\"FixedLeftThemeSidebar\");\r\n cookie = cookie.split('##');\r\n style = cookie[0];\r\n width = cookie[1];\r\n wikipagecontent.style.marginLeft = (20 + (width*1)) + 'px';\r\n sidebar.style.width = width + 'px';\r\n saveSidebarState(sidebar.style.display, width);\r\n // hide the show and menu icons\r\n var altWikiNavMenu = document.getElementById('altWikiNavMenu');\r\n altWikiNavMenu.style.display = 'none';\r\n // copy the sidebar navigation menu back to sidebar\r\n var wikiNavMenu = document.getElementById('wikiNavMenu');\r\n wikiNavMenu = wikiNavMenu.parentNode.removeChild(wikiNavMenu);\r\n var sidebarWikiMenu = document.getElementById('sidebarWikiMenu');\r\n sidebarWikiMenu.appendChild(wikiNavMenu);\r\n}", "title": "" }, { "docid": "b1e0d5312140c7ac0561e7abf86f0e2e", "score": "0.53160405", "text": "function init(target, data) {\n $.each(data, function (i, item) {\n var li = $('<li></li>');\n var a = $('<a></a>');\n var icon = $('<span></span>');\n //icon.addClass('glyphicon');\n icon.addClass(item.icon);\n var text = $('<span></span>');\n text.addClass('sidebar-title').text(item.text);\n a.append(icon);\n a.append(text);\n if (item.menus&&item.menus.length>0) {\n a.addClass('accordion-toggle');\n a.attr('href', '#');\n var arrow = $('<span></span>');\n arrow.addClass('caret');\n a.append(arrow);\n li.append(a);\n var menus = $('<ul></ul>');\n menus.addClass('nav').addClass('sub-nav');\n init(menus, item.menus);\n li.append(menus);\n }\n else {\n var href = 'javascript:addTabs({id:\\'' + item.id + '\\',title: \\'' + item.text + '\\',close: true,url: \\'' + item.url + '\\'});';\n a.attr('href', href);\n //if (item.istab)\n // a.attr('href', href);\n //else {\n // a.attr('href', item.url);\n // a.attr('title', item.text);\n // a.attr('target', '_blank')\n //}\n li.append(a);\n }\n target.prepend(li);\n });\n }", "title": "" }, { "docid": "2deac49b370cba040893561c95721732", "score": "0.53117895", "text": "function Plugin(option) {\n var args = arguments\n var property = option\n\n return this.each(function () {\n var $this = $(this)\n var options = $.extend({}, $this.data(), typeof option === 'object' && option)\n var data = $this.data('bjui.sidenav')\n\n if (!data) $this.data('bjui.sidenav', (data = new Sidenav(this, options)))\n\n if (typeof property === 'string' && $.isFunction(data[property])) {\n [].shift.apply(args)\n if (!args) data[property]()\n else data[property].apply(data, args)\n }\n })\n }", "title": "" }, { "docid": "449339ba4981b698005d82a475f5e0bc", "score": "0.53028953", "text": "function vru_open() {\n document.getElementById(\"mySidebar\").style.display = \"block\";\n}", "title": "" }, { "docid": "c933fee2d660fe6a14fd34f7e041dcab", "score": "0.52909565", "text": "function Sidebar (props) {\n console.log(props);\n//HOIST TO CONFIG, .map ACROSS\n return (\n <div className='sidebar'>\n <ul className='sidebar-list'> \n <li className={`menu-item ${props.topic === 'ES6' ? 'active' : ''}`}><div id='ES6' onClick={props.changeTopic} >ES6</div></li>\n <li className={`menu-item ${props.topic === 'ReactJS' ? 'active' : ''}`}><div id='ReactJS' onClick={props.changeTopic} >ReactJS</div></li>\n <li className={`menu-item ${props.topic === 'Redux' ? 'active' : ''}`}><div id='Redux' onClick={props.changeTopic} >Redux</div></li>\n <li className={`menu-item ${props.topic === 'CSS' ? 'active' : ''}`}><div id='CSS' onClick={props.changeTopic} >CSS</div></li>\n <li className={`menu-item ${props.topic === 'EsriJSAPI' ? 'active' : ''}`}><div id='EsriJSAPI' onClick={props.changeTopic} >EsriJSAPI</div></li>\n <li className={`menu-item ${props.topic === 'Node.js' ? 'active' : ''}`}><div id='Node.js' onClick={props.changeTopic} >Node.js</div></li>\n \n </ul>\n </div>\n\n )}", "title": "" }, { "docid": "90c9e462d8bbb6aef3c346142c5511e8", "score": "0.5289631", "text": "function setOptionsFromDOM(){\n //no anchors option? Checking for them in the DOM attributes\n if(!options.anchors.length){\n options.anchors = $(options.sectionSelector + '[data-anchor]').map(function(){\n return $(this).data('anchor').toString();\n }).get();\n }\n\n //no tooltipos option? Checking for them in the DOM attributes\n if(!options.navigationTooltips.length){\n options.navigationTooltips = $(options.sectionSelector + '[data-tooltip]').map(function(){\n return $(this).data('tooltip').toString();\n }).get();\n }\n }", "title": "" }, { "docid": "7cfe70c837ef4970ef176bb6030444c1", "score": "0.52838194", "text": "function onSidebar( ){\n if(sidebaropen == 0)\n {\n $( \"#demo_menu3\" ).mouseenter();\n $( \"#demo_menu3\" ).click();\n sidebaropen = 1;\n }\n else if (sidebaropen == 1)\n {\n $( \"#demo_menu3\" ).mouseleave();\n sidebaropen = 0;\n }\n \n\n\n }", "title": "" }, { "docid": "0987f83e9a266b5c097e72267f7c1424", "score": "0.5267485", "text": "function setOptionsFromDOM(){\r\n\r\n //no anchors option? Checking for them in the DOM attributes\r\n if(!options.anchors.length){\r\n var anchors = $(options.sectionSelector+'[data-anchor]');\r\n if(anchors.length){\r\n anchors.forEach(function(item){\r\n options.anchors.push(item.getAttribute('data-anchor').toString());\r\n });\r\n }\r\n }\r\n\r\n //no tooltips option? Checking for them in the DOM attributes\r\n if(!options.navigationTooltips.length){\r\n var tooltips = $(options.sectionSelector+'[data-tooltip]');\r\n if(tooltips.length){\r\n tooltips.forEach(function(item){\r\n options.navigationTooltips.push(item.getAttribute('data-tooltip').toString());\r\n });\r\n }\r\n }\r\n }", "title": "" }, { "docid": "aa438d8ca15463a359f5f456f6a01c9e", "score": "0.52519405", "text": "_attributes()\n {\n this.$menubar.setAttribute('role', 'menubar');\n }", "title": "" }, { "docid": "b266fb0f475250ef8835b566cbab4f4d", "score": "0.5227002", "text": "function showSidebar() {\n const sidebar = HtmlService.createTemplateFromFile(\"Sidebar\").evaluate();\n sidebar.setTitle(\"Concept\");\n DocumentApp.getUi().showSidebar(sidebar);\n}", "title": "" }, { "docid": "9cf94751cf464de4df39190226c1ded4", "score": "0.5224442", "text": "function w3_open() {\n document.getElementById(\"mySidebar\").style.display = \"block\";\n}", "title": "" }, { "docid": "5c7edfd3a6eadafa3f69297f410fd395", "score": "0.52112925", "text": "function setup() {\n var tmp = get('skin')\n if (tmp && $.inArray(tmp, mySkins))\n changeSkin(tmp)\n\n // Add the change skin listener\n $('[data-skin]').on('click', function (e) {\n if ($(this).hasClass('knob'))\n return\n e.preventDefault()\n changeSkin($(this).data('skin'))\n })\n\n // Add the layout manager\n $('[data-layout]').on('click', function () {\n changeLayout($(this).data('layout'))\n })\n\n $('[data-controlsidebar]').on('click', function () {\n changeLayout($(this).data('controlsidebar'))\n var slide = !$controlSidebar.options.slide\n\n $controlSidebar.options.slide = slide\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open')\n })\n\n $('[data-sidebarskin=\"toggle\"]').on('click', function () {\n var $sidebar = $('.control-sidebar')\n if ($sidebar.hasClass('control-sidebar-dark')) {\n $sidebar.removeClass('control-sidebar-dark')\n $sidebar.addClass('control-sidebar-light')\n } else {\n $sidebar.removeClass('control-sidebar-light')\n $sidebar.addClass('control-sidebar-dark')\n }\n })\n\n $('[data-enable=\"expandOnHover\"]').on('click', function () {\n $(this).attr('disabled', true)\n $pushMenu.expandOnHover()\n if (!$('body').hasClass('sidebar-collapse'))\n $('[data-layout=\"sidebar-collapse\"]').click()\n })\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $('[data-layout=\"fixed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('layout-boxed')) {\n $('[data-layout=\"layout-boxed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $('[data-layout=\"sidebar-collapse\"]').attr('checked', 'checked')\n }\n\n }", "title": "" }, { "docid": "5c7edfd3a6eadafa3f69297f410fd395", "score": "0.52112925", "text": "function setup() {\n var tmp = get('skin')\n if (tmp && $.inArray(tmp, mySkins))\n changeSkin(tmp)\n\n // Add the change skin listener\n $('[data-skin]').on('click', function (e) {\n if ($(this).hasClass('knob'))\n return\n e.preventDefault()\n changeSkin($(this).data('skin'))\n })\n\n // Add the layout manager\n $('[data-layout]').on('click', function () {\n changeLayout($(this).data('layout'))\n })\n\n $('[data-controlsidebar]').on('click', function () {\n changeLayout($(this).data('controlsidebar'))\n var slide = !$controlSidebar.options.slide\n\n $controlSidebar.options.slide = slide\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open')\n })\n\n $('[data-sidebarskin=\"toggle\"]').on('click', function () {\n var $sidebar = $('.control-sidebar')\n if ($sidebar.hasClass('control-sidebar-dark')) {\n $sidebar.removeClass('control-sidebar-dark')\n $sidebar.addClass('control-sidebar-light')\n } else {\n $sidebar.removeClass('control-sidebar-light')\n $sidebar.addClass('control-sidebar-dark')\n }\n })\n\n $('[data-enable=\"expandOnHover\"]').on('click', function () {\n $(this).attr('disabled', true)\n $pushMenu.expandOnHover()\n if (!$('body').hasClass('sidebar-collapse'))\n $('[data-layout=\"sidebar-collapse\"]').click()\n })\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $('[data-layout=\"fixed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('layout-boxed')) {\n $('[data-layout=\"layout-boxed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $('[data-layout=\"sidebar-collapse\"]').attr('checked', 'checked')\n }\n\n }", "title": "" }, { "docid": "45daf5b9e38d630b021432a93bd90db2", "score": "0.52070916", "text": "function setup() {\n var tmp = get('skin');\n if (tmp && $.inArray(tmp, my_skins))\n change_skin(tmp);\n\n //Add the change skin listener\n $(\"[data-skin]\").on('click', function (e) {\n e.preventDefault();\n change_skin($(this).data('skin'));\n });\n\n //Add the layout manager\n $(\"[data-layout]\").on('click', function () {\n change_layout($(this).data('layout'));\n });\n\n $(\"[data-controlsidebar]\").on('click', function () {\n change_layout($(this).data('controlsidebar'));\n var slide = !AdminLTE.options.controlSidebarOptions.slide;\n AdminLTE.options.controlSidebarOptions.slide = slide;\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open');\n });\n\n $(\"[data-sidebarskin='toggle']\").on('click', function () {\n var sidebar = $(\".control-sidebar\");\n if (sidebar.hasClass(\"control-sidebar-dark\")) {\n sidebar.removeClass(\"control-sidebar-dark\")\n sidebar.addClass(\"control-sidebar-light\")\n } else {\n sidebar.removeClass(\"control-sidebar-light\")\n sidebar.addClass(\"control-sidebar-dark\")\n }\n });\n\n $(\"[data-enable='expandOnHover']\").on('click', function () {\n $(this).attr('disabled', true);\n AdminLTE.pushMenu.expandOnHover();\n if (!$('body').hasClass('sidebar-collapse'))\n $(\"[data-layout='sidebar-collapse']\").click();\n });\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $(\"[data-layout='fixed']\").attr('checked', 'checked');\n }\n if ($('body').hasClass('layout-boxed')) {\n $(\"[data-layout='layout-boxed']\").attr('checked', 'checked');\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $(\"[data-layout='sidebar-collapse']\").attr('checked', 'checked');\n }\n\n }", "title": "" }, { "docid": "5b071037673b5514bcd84c6403927ec3", "score": "0.51927626", "text": "function w3_open() {\r\n var x = document.getElementById(\"mySidebar\");\r\n x.style.width = \"300px\";\r\n x.style.paddingTop = \"10%\";\r\n x.style.display = \"block\";\r\n}", "title": "" }, { "docid": "ad268d65137d5eb6d5b867a7a8ea8120", "score": "0.51807475", "text": "function w3_open() {\n document.getElementById(\"mySidebar\").style.width = \"100%\";\n document.getElementById(\"mySidebar\").style.display = \"block\";\n}", "title": "" }, { "docid": "96a17a430154c86b1a6107116b8aa536", "score": "0.51805836", "text": "function addSidebarToggle(sidebar, scope) {\n\t if (!sidebar.toggleName) return;\n\n\t sidebar.close = function () {\n\t setState(false);\n\t };\n\n\t function toggle(e) {\n\t e.preventDefault();\n\t _.forEach(scope.sidebars, function (s) {\n\t if (s != sidebar) s.close();\n\t });\n\t setState(!sidebar.open);\n\t }\n\n\t function setState(value) {\n\t sidebar.open = value;\n\t sidebar.closed = !value;\n\t scope.navbar[sidebar.position] = sidebar.open;\n\t }\n\n\t var item = {\n\t href: sidebar.position,\n\t title: sidebar.toggleName,\n\t name: sidebar.toggleName,\n\t klass: 'sidebar-toggle',\n\t icon: 'fa fa-bars',\n\t action: toggle,\n\t right: 'vert-divider'\n\t };\n\n\t if (sidebar.position === 'left') {\n\t if (!scope.navbar.itemsLeft) scope.navbar.itemsLeft = [];\n\t scope.navbar.itemsLeft.splice(0, 0, item);\n\t } else {\n\t if (!scope.navbar.itemsRight) scope.navbar.itemsRight = [];\n\t scope.navbar.itemsRight.push(item);\n\t }\n\t}", "title": "" }, { "docid": "bbbf3864e0d7ed24fdb0e2932bf9da81", "score": "0.51775783", "text": "UPDATE_SIDEBAR_WIDTH(state, width) {\n\t\tstate.sidebarWidth = width;\n\t}", "title": "" }, { "docid": "bbbf3864e0d7ed24fdb0e2932bf9da81", "score": "0.51775783", "text": "UPDATE_SIDEBAR_WIDTH(state, width) {\n\t\tstate.sidebarWidth = width;\n\t}", "title": "" }, { "docid": "2f5b4062bc404d373fb88ace93b8e3f3", "score": "0.5174186", "text": "function openSidebar() {\n sidebar.style.width = '250px';\n}", "title": "" }, { "docid": "d5040aa04cdf7d8fc076d66863798df8", "score": "0.5171893", "text": "function showSidebar() {\n var ui = HtmlService.createTemplateFromFile('Sidebar')\n .evaluate()\n .setTitle(SIDEBAR_TITLE);\n SpreadsheetApp.getUi().showSidebar(ui);\n}", "title": "" }, { "docid": "8ab65c08a4a347b1b845d398cb661bbb", "score": "0.51639295", "text": "function showSidebar() {\n\n $('#partyTime').val('');\n $('#partyDate').val('');\n $('#partySize').val('');\n $('#partyName').val('');\n $('#partyPhone').val('');\n $('#partyEmail').val('');\n\n sidebarLeft.css('margin-left', '0');\n\n overlay.show(0, function() {\n overlay.fadeTo('500', 0.5);\n });\n }", "title": "" }, { "docid": "d896aef9f17bb12de1433cfc98def0eb", "score": "0.5161583", "text": "function options(){ \n for(let i=0; i<allSections.length; i++){ \n const oneSection = allSections[i]; \n const content = oneSection.getAttribute('data-nav'); \n const items = document.createElement('li'); \n const link = document.createElement('a'); \n link.setAttribute('href', `#${oneSection.id}`); \n link.textContent = content; \n items.appendChild(link); \n navig.appendChild(items); \n\n}}", "title": "" }, { "docid": "d35b2e6d3973d095de01cde0a9f059a1", "score": "0.51547545", "text": "function Sidebar() {\n const navElements = [\n {\n value: \"Home\",\n customSvg: AiOutlineHome,\n active: true,\n },\n {\n value: \"Browse\",\n customSvg: BsSearch,\n active: false,\n\n },\n {\n value: \"Radio\",\n active: false,\n customSvg: VscRadioTower,\n },\n ];\n\n const sidebarYourLibrary = [\n \"Made For You\",\n \"Recently Played\",\n \"Liked Songs\",\n \"Albums\",\n \"Artists\",\n \"Podcasts\",\n ];\n\n const sidebarUserPlaylists = [\n \"Acoustic Hits\",\n \"Acoustic Covers\",\n \"Discover Weekly\",\n \"Hot Hits Canada\",\n \"90's Hip-Hop Don't Stop Long Text\",\n \"90s Smash Hits\",\n \"TGIF\",\n \"mint Canada\",\n \"Hip-Hop Central\",\n \"R&B Right Now\",\n \"I Love My '90s R&B\",\n \"Are & Be\",\n \"Today's Top Hits\",\n \"Get Turnt\",\n \"iTunes\",\n ];\n\n const sidebarGroups = [\n {\n title: \"Your Library\",\n content: sidebarYourLibrary,\n },\n {\n title: \"Playlists\",\n content: sidebarUserPlaylists,\n },\n ];\n\n const NavElement = ({ value, active, customSvg: CustomSvg }) => {\n\n return (\n <li className={`border-l-4 border-transparent transition-colors duration-500`}>\n <a className=\"flex items-center mx-4 mt-4\">\n <CustomSvg size={20} />\n <span className=\"ml-3\">{value}</span>\n </a>\n </li>\n );\n };\n\n return (\n <div className=\"Sidebar w-48 flex-none flex flex-col justify-between font-semibold bg-gray-900-spotify text-gray-400\">\n <div className=\"py-6\">\n <ul>\n {navElements.map((each, idx, self) => {\n return <NavLink\n exact to={'/' + each.value.toLocaleLowerCase()}\n className={({ isActive }) => isActive ? \"text-white\" : \"\"}\n >\n <NavElement key={idx} {...each} />\n </NavLink>;\n })}\n </ul>\n </div>\n\n <div className=\"overflow-x-hidden flex-1\">\n {/* //Your Playlsist */}\n\n {sidebarGroups.map((each) => {\n return (\n <div className=\"mt-7 px-5\">\n <h2 className=\"font-light tracking-widest text-xs uppercase mb-4\">{each.title}</h2>\n <ul>\n {each.content.map((each) => {\n return <li className=\"truncate text-gray-300 text-sm mt-4\">\n <a href=\"\">{each}</a>\n </li>;\n })}\n </ul>\n </div>\n );\n })}\n\n </div>\n\n <div className=\"h-16 flex align-center justify-around items-center border-t border-gray-400 \">\n <a href=\"\" className=\"flex items-center\">\n <IoIosAddCircleOutline size={30} />\n <span className=\"ml-3\">New Playlist</span>\n </a>\n\n </div>\n\n </div>\n );\n}", "title": "" }, { "docid": "8d04318ef133abf0b60ea55a02ab2f6f", "score": "0.5151475", "text": "function defaultsideBarView(){\n\tvar sidebar = document.getElementById('template5');\n\tvar aside = getSideBar();\n\thtml = sidebar.innerHTML;\n\taside.innerHTML = html;\n}", "title": "" }, { "docid": "6d9549834ab0636207723ccfbae314cd", "score": "0.5150538", "text": "onToggleSidebar() {\n const { sidebar } = this.props;\n\n this.props.setSidebar({\n width: (sidebar.open) ? 0 : 430,\n open: !sidebar.open\n });\n\n if (!sidebar.open) {\n logEvent('Explore menu', 'Close menu', 'Click');\n }\n }", "title": "" }, { "docid": "2336d63679fd7e12a6943dc4cfe4af2a", "score": "0.5147612", "text": "toggle(side) {\n try {\n const id = getId(side);\n const visibility = !this.visibility[side];\n Navigation.mergeOptions(id, {\n sideMenu: {\n [side]: {\n visible: !this.visibility[side]\n }\n }\n });\n this.visibility[side] = visibility;\n } catch (error) {\n //\n }\n }", "title": "" }, { "docid": "b0c4e21d5e71b08d4d00909edee3d172", "score": "0.5121194", "text": "function multiLayout() {\n $('*[data-event=\"sidebar-presentation\"]').addClass('active');\n}", "title": "" }, { "docid": "df12bf638ec37bba02e4f7beeafd3c74", "score": "0.5120769", "text": "function InitSidebar()\n{\n return {\n opensidebar: true,\n showsidebar: false,\n open() {\n //if (this.opensidebar) return;\n this.opensidebar=true;\n ShowSidebar();\n // this.closeProfileMenu();\n },\n close() {\n //if (!this.opensidebar) return;\n this.opensidebar=true;\n HideSidebar();\n CloseAllSidebarMenu('none');\n // this.closeProfileMenu();\n },\n toggleSidebar() {\n if (this.opensidebar)\n {\n this.close();\n }\n else\n {\n this.open();\n }\n },\n openSidebarMenu(menuid) {\n if (!this.opensidebar)\n {\n this.open();\n return;\n }\n this.toggleSidebar();\n ShowSidebarMenu(menuid);\n },\n menuEvent(menuid)\n {\n if (!this.opensidebar) return;\n ShowSidebarMenu(menuid);\n },\n iconEvent(menuid)\n {\n if (!this.opensidebar)\n {\n this.open();\n }\n else\n {\n this.close();\n }\n },\n toggleVisibleSidebar()\n {\n this.closeProfileMenu();\n this.close();\n this.showsidebar=!this.showsidebar;\n },\n closeAll()\n {\n this.close();\n this.closeProfileMenu();\n },\n closeProfileMenu()\n {\n $(\"#profilemenu\").fadeOut('fast');\n },\n checkWidth()\n {\n if (window.innerWidth<640)\n {\n this.showsidebar=false;\n this.close();\n }\n else\n {\n this.showsidebar=true;\n\n this.open();\n\n if (window.innerWidth>1024)\n {\n this.opensidebar=true;\n //ShowSidebar();\n\n }\n else\n {\n this.opensidebar=false;\n //HideSidebar();\n }\n\n }\n\n }\n }\n}", "title": "" }, { "docid": "df12bf638ec37bba02e4f7beeafd3c74", "score": "0.5120769", "text": "function InitSidebar()\n{\n return {\n opensidebar: true,\n showsidebar: false,\n open() {\n //if (this.opensidebar) return;\n this.opensidebar=true;\n ShowSidebar();\n // this.closeProfileMenu();\n },\n close() {\n //if (!this.opensidebar) return;\n this.opensidebar=true;\n HideSidebar();\n CloseAllSidebarMenu('none');\n // this.closeProfileMenu();\n },\n toggleSidebar() {\n if (this.opensidebar)\n {\n this.close();\n }\n else\n {\n this.open();\n }\n },\n openSidebarMenu(menuid) {\n if (!this.opensidebar)\n {\n this.open();\n return;\n }\n this.toggleSidebar();\n ShowSidebarMenu(menuid);\n },\n menuEvent(menuid)\n {\n if (!this.opensidebar) return;\n ShowSidebarMenu(menuid);\n },\n iconEvent(menuid)\n {\n if (!this.opensidebar)\n {\n this.open();\n }\n else\n {\n this.close();\n }\n },\n toggleVisibleSidebar()\n {\n this.closeProfileMenu();\n this.close();\n this.showsidebar=!this.showsidebar;\n },\n closeAll()\n {\n this.close();\n this.closeProfileMenu();\n },\n closeProfileMenu()\n {\n $(\"#profilemenu\").fadeOut('fast');\n },\n checkWidth()\n {\n if (window.innerWidth<640)\n {\n this.showsidebar=false;\n this.close();\n }\n else\n {\n this.showsidebar=true;\n\n this.open();\n\n if (window.innerWidth>1024)\n {\n this.opensidebar=true;\n //ShowSidebar();\n\n }\n else\n {\n this.opensidebar=false;\n //HideSidebar();\n }\n\n }\n\n }\n }\n}", "title": "" }, { "docid": "4166dee240af2c4298994838227d8126", "score": "0.5118845", "text": "hookSidebarToMenuButton(orientation) {\n let buttonSelector = '#main-menu-button'\n , sidebar // a jquery object\n ;\n\n switch (orientation) {\n case 'top':\n sidebar =$('#top-rise-sidebar');\n break;\n\n case 'right':\n sidebar =$('#right-rise-sidebar');\n break;\n\n case 'left':\n sidebar =$('#left-rise-sidebar');\n break;\n }\n if (!!sidebar) {\n sidebar.sidebar('attach events', buttonSelector)\n console.log(`attached events for ${orientation} sidebar`)\n }\n\n }", "title": "" }, { "docid": "f776228ed54afbdf39a27a79b4967caa", "score": "0.5115462", "text": "function showSidebarPosts(clipped3RecentPosts){\n console.log('showing sidebar titles from indexjs');\n for (i=0;i<clipped3RecentPosts.length;i++){\n var openDiv = \"<div class='sidebarPostTitles'>\";\n var closeDiv = \"</div>\";\n var postTitle = \"<a href=/content/\" + clipped3RecentPosts[i].post_id \n + \">\" + clipped3RecentPosts[i].title + \"</a></div>\";\n $('#sidebar-content').append(\n openDiv + postTitle + closeDiv\n );\n }\n }", "title": "" }, { "docid": "eb3fd2367dc8d3e0fb82a658f4fe06e1", "score": "0.5114603", "text": "init() {\n // display categories in <select>\n this.printCategories();\n }", "title": "" }, { "docid": "637730e610d2fa83cade9a084e0b315d", "score": "0.51095253", "text": "render() {\n const showRightNav = this.props.siteLayout.get('showRightNav');\n return (\n showRightNav == false ? <aside className=\"control-sidebar control-sidebar-dark control-sidebar-open minimize\">\n\n <ul className=\"vertical-list\">\n <li onClick={this.maximizeRightNav}><a href=\"#\"><span className=\"ti-bell\"></span></a></li>\n <li><a href=\"#\"><span className=\"ti-pie-chart\"></span></a></li>\n <li><a href=\"#\"><span className=\"ti-alert\"></span></a></li>\n <li><a href=\"#\"><span className=\"ti-lock\"></span></a></li>\n </ul>\n\n {/* <i onClick={this.maximizeRightNav} className=\"ti-bell hidenav\"></i>\n <ul className=\"control-sidebar-menu\">\n {\n RIGHT_LIST.map((menu, index) => {\n return (<li>\n <a href=\"#\" data-toggle=\"tooltip\" data-placement=\"right\" title={menu.header}>\n\n <i className={menu.iconClassName}></i>\n\n\n </a>\n </li>\n )\n })\n\n }\n\n\n </ul> */}\n </aside> : null\n );\n }", "title": "" }, { "docid": "8385e7e0ccfa525f5730b06f893a06b3", "score": "0.5102264", "text": "@action\n setupContextMenu() {\n let menu = this.resizableColumns\n .getColumnVisibility()\n .reduce((arr, { id, name, visible }) => {\n let check = `${CHECK_HTML}`;\n if (!visible) {\n check = `<span style='opacity:0'>${check}</span>`;\n }\n name = `${check} ${name}`;\n arr.push({\n name,\n title: name,\n fn: bind(this, this.toggleColumnVisibility, id),\n });\n return arr;\n }, []);\n\n this.showBasicContext = (e) => {\n basicContext.show(menu, e);\n };\n\n const listHeader = this.el.querySelector('.list__header');\n if (listHeader) {\n listHeader.addEventListener('contextmenu', this.showBasicContext);\n }\n }", "title": "" }, { "docid": "2f748c50f5a4c1223f32a3e8a62e18ef", "score": "0.5101852", "text": "function showSuppliers() {\n \n var ui = HtmlService.createTemplateFromFile('index.html')\n .evaluate()\n .setSandboxMode(HtmlService.SandboxMode.IFRAME)\n .setTitle('Suppliers select demo');\n \n SpreadsheetApp.getUi().showSidebar(ui);\n}", "title": "" }, { "docid": "687708a550809322207e41bd547236dc", "score": "0.50969315", "text": "function pagelet_box(container,pagelet_id,title,content,sidebar_options) {\r\n\t\t\t\t\t\t\t\t// Render any options\r\n\t\t\t\t\t\t\t\tif (options) {\r\n\t\t\t\t\t\t\t\t\toptions.options.forEach(function(opt,i) {\r\n\t\t\t\t\t\t\t\t\t\tif (opt.name) {\r\n\t\t\t\t\t\t\t\t\t\t\tcontent = content.replace( new RegExp(\"%\"+opt.name+\"%\",\"g\"), options.renderOption(opt));\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar sidebar_o = { \r\n\t\t\t\t\t\t\t\t\t'title':title,\r\n\t\t\t\t\t\t\t\t\t'content':content,\r\n\t\t\t\t\t\t\t\t\t'id':pagelet_id\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\tif (sidebar_options) {\r\n\t\t\t\t\t\t\t\t\tfor (var o in sidebar_options) { sidebar_o[o] = sidebar_options[o]; }\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tvar section = createSidebarSection(sidebar_o);\r\n\t\t\t\t\t\t\t\t} catch(e) { alert(\"Exception in createSidebarSection: \" +e ); }\r\n\r\n\t\t\t\t\t\t\t\tinsertFirst( container, section );\r\n\t\t\t\t\t\t\t\t// Attach functionality to the inserted action buttons/links\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tQSA(section,'.bfb_pagelet_action',function(o) {\r\n\t\t\t\t\t\t\t\t\t\tbind(o,'click',function(e) {\r\n\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar pref,o=target(e);\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar data = o.getAttribute('data');\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar stopPropagation = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar preventDefault = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (data) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdata = data.replace(/([\\{\\,])\\s*(.*?)\\s*:/g,'$1\"$2\":');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdata = parse(data);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (data) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (typeof data.setpref!=\"undefined\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (pref in data.setpref) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar val = data.setpref[pref];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (val===\"true\") { val=true; }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (val===\"false\") { val=false; }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toptions.set(pref,val,false); \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (data.saveprefs) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tQSA(section,'input',function(input) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (input.type==\"checkbox\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toptions.set(input.name,input.checked,false);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if (input.type=='text') {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toptions.set(input.name,input.value,false);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (typeof data.setpref!=\"undefined\" || data.saveprefs) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toptions.save();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (data.message) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(data.message);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (data.close) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetTimeout(function(){removeChild( $('pagelet_'+pagelet_id) );},200);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (typeof data.stopPropagation==\"boolean\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstopPropagation = data.stopPropagation;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (typeof data.preventDefault==\"boolean\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpreventDefault = data.preventDefault;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcatch(e) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadd_exception(e);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (stopPropagation && e.stopPropagation) { e.stopPropagation(); }\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (preventDefault && e.preventDefault) { e.preventDefault(); }\r\n\t\t\t\t\t\t\t\t\t\t\t} catch(e) { add_exception(e); }\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t} catch(e) { add_exception(e); }\r\n\t\t\t\t\t\t\t\treturn section;\r\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "ce485b508fc88bc407d06d32a6280a3d", "score": "0.50896823", "text": "function makeSidebar() {\n\tfor (var i=0; i < gmarkers.length; i++){\n\t\tif (map.getBounds().contains(gmarkers[i].getPosition())) {\n\t\t\t\n\t\t\t\n\t\t\t// ADD A LINE TO THE LISTED VENUES\n\t\t\tlist += '<p><a href=\"javascript:myclick(' + i + ')\">' + gmarkers[i].title + '<\\/a></p>';\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t// PUT THE LISTED VENUES INTO THE LIST SIDE BAR\n\tdocument.getElementById(\"list\").innerHTML = list;\n\t\n\t\n}", "title": "" }, { "docid": "965d8d4ec49bc9548f6679836ac5a591", "score": "0.50875884", "text": "function ocultarSidebar(){\n\tq('.overlay').style.display = 'none';\n\tq('#sidebar').className = 'sidebar-hidden';\n}", "title": "" }, { "docid": "dfe39b033c987fb82a3f442c43afc378", "score": "0.5081964", "text": "function setup() {\n var tmp = get('skin')\n if (tmp && $.inArray(tmp, mySkins))\n changeSkin(tmp)\n\n // Add the change skin listener\n $('[data-skin]').on('click', function (e) {\n if ($(this).hasClass('knob'))\n return\n e.preventDefault()\n changeSkin($(this).data('skin'))\n })\n\n // Add the layout manager\n $('[data-layout]').on('click', function () {\n changeLayout($(this).data('layout'))\n })\n\n $('[data-controlsidebar]').on('click', function () {\n changeLayout($(this).data('controlsidebar'))\n var slide = !$controlSidebar.options.slide\n\n $controlSidebar.options.slide = slide\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open')\n })\n\n $('[data-sidebarskin=\"toggle\"]').on('click', function () {\n var $sidebar = $('.control-sidebar')\n if ($sidebar.hasClass('control-sidebar-dark')) {\n $sidebar.removeClass('control-sidebar-dark')\n $sidebar.addClass('control-sidebar-light')\n } else {\n $sidebar.removeClass('control-sidebar-light')\n $sidebar.addClass('control-sidebar-dark')\n }\n })\n\n $('[data-enable=\"expandOnHover\"]').on('click', function () {\n $(this).attr('disabled', true)\n $pushMenu.expandOnHover()\n if (!$('body').hasClass('sidebar-collapse'))\n $('[data-layout=\"sidebar-collapse\"]').click()\n })\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $('[data-layout=\"fixed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('layout-boxed')) {\n $('[data-layout=\"layout-boxed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $('[data-layout=\"sidebar-collapse\"]').attr('checked', 'checked')\n }\n\n }", "title": "" }, { "docid": "dfe39b033c987fb82a3f442c43afc378", "score": "0.5081964", "text": "function setup() {\n var tmp = get('skin')\n if (tmp && $.inArray(tmp, mySkins))\n changeSkin(tmp)\n\n // Add the change skin listener\n $('[data-skin]').on('click', function (e) {\n if ($(this).hasClass('knob'))\n return\n e.preventDefault()\n changeSkin($(this).data('skin'))\n })\n\n // Add the layout manager\n $('[data-layout]').on('click', function () {\n changeLayout($(this).data('layout'))\n })\n\n $('[data-controlsidebar]').on('click', function () {\n changeLayout($(this).data('controlsidebar'))\n var slide = !$controlSidebar.options.slide\n\n $controlSidebar.options.slide = slide\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open')\n })\n\n $('[data-sidebarskin=\"toggle\"]').on('click', function () {\n var $sidebar = $('.control-sidebar')\n if ($sidebar.hasClass('control-sidebar-dark')) {\n $sidebar.removeClass('control-sidebar-dark')\n $sidebar.addClass('control-sidebar-light')\n } else {\n $sidebar.removeClass('control-sidebar-light')\n $sidebar.addClass('control-sidebar-dark')\n }\n })\n\n $('[data-enable=\"expandOnHover\"]').on('click', function () {\n $(this).attr('disabled', true)\n $pushMenu.expandOnHover()\n if (!$('body').hasClass('sidebar-collapse'))\n $('[data-layout=\"sidebar-collapse\"]').click()\n })\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $('[data-layout=\"fixed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('layout-boxed')) {\n $('[data-layout=\"layout-boxed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $('[data-layout=\"sidebar-collapse\"]').attr('checked', 'checked')\n }\n\n }", "title": "" }, { "docid": "d49b2280495825ed056d7a90d2bc1973", "score": "0.5076111", "text": "function handleSidebar(req, res, next) {\n User.findByUsername('ManInTheBox', function (err, user) {\n if (err) return next(err);\n Post.findByAuthor(user._id, function (err, authorPosts) {\n if (err) return next(err);\n Post.findNewest(function (err, newestPosts) {\n if (err) return next(err);\n req.sidebar = {\n data: {\n user: user,\n posts: {\n author: authorPosts,\n newest: newestPosts\n }\n }\n };\n next();\n });\n });\n });\n}", "title": "" }, { "docid": "6fae8559a55c52a050db4690a91bc783", "score": "0.5071502", "text": "function populateHTML() {\n\t\tvar html = '';\n\t\thtml += '<span class=\"title\">Sort By:</span>';\n\t\thtml += '<div class=\"selected-wrapper\">';\n\t\thtml += '<div class=\"selected\">';\n\t\thtml += '<div class=\"text\"></div>';\n\t\thtml += '<i class=\"arrow-icon material-icons\">expand_more</i>';\n\t\thtml += '</div>';\n\t\thtml += '<ul>';\n\t\tsettings.menuItems.forEach(function(text) {\n\t\t\thtml += '<li class=\"menu-item\">';\n\t\t\thtml += text;\n\t\t\thtml += '</li>';\n\t\t});\n\t\thtml += '</ul>';\n\t\thtml += '</div>';\n\n\t\tsettings.container.insertAdjacentHTML('afterbegin', html);\n\t\tsettings.container.classList.add('dropdown-menu');\n\n\t\tselectedItemElem = settings.container.querySelector('.selected .text');\n\t\tmenuItemElements = settings.container.querySelectorAll('.menu-item');\n\t}", "title": "" }, { "docid": "fe63d5a443e0e4f960f4128becfc3bdb", "score": "0.50671977", "text": "function setMenuItemsContentToAttribute(){\n\tsetTimeout( function(){ \n\t\t$('#docs-menubar > .menu-button').each(function(){\n\t\t\t$(this).attr('js-tricks-label', $(this).html());\n\t\t});\n\t}, 500);\n}", "title": "" }, { "docid": "65b16438d2116a87fd5b453e5f102821", "score": "0.5066273", "text": "render() {\n return html `\n <ef-layout flex nowrap part=\"container\">\n\n <ef-layout flex container part=\"sidebar\" size=\"${ifDefined(this.sidebarWidth || undefined)}\">\n <ef-layout size=\"auto\">\n <slot name=\"sidebar-header\"></slot>\n </ef-layout>\n <ef-layout class=\"content\" scrollable basis=\"auto\">\n <slot name=\"sidebar-content\"></slot>\n </ef-layout>\n </ef-layout>\n\n <ef-layout flex container basis=\"100%\" part=\"main\">\n <ef-layout size=\"auto\">\n <slot name=\"main-header\"></slot>\n </ef-layout>\n <ef-layout class=\"content\" scrollable basis=\"auto\">\n <slot name=\"main-content\"></slot>\n </ef-layout>\n </ef-layout>\n\n </ef-layout>\n `;\n }", "title": "" }, { "docid": "331813fad0381f4cf0d0c3392dcfd3ef", "score": "0.5057071", "text": "function openSidebar() {\n document.getElementById(\"sidebar\").style.display = \"block\";\n document.getElementById(\"overlay\").style.display = \"block\";\n}", "title": "" }, { "docid": "b1bc5b82d02d45286d817d7a94508c44", "score": "0.505044", "text": "function toggleSideBar(){\n var button = $(\".be-toggle-left-sidebar\");\n\n button.on(\"click\", function(){\n if( wrapper.hasClass( config.collapsibleSidebarCollapsedClass ) ) {\n wrapper.removeClass( config.collapsibleSidebarCollapsedClass );\n $(\"li.open\", leftSidebar).removeClass(\"open\");\n $(\"li.active\", leftSidebar).parents(\".parent\").addClass(\"active open\");\n $(\".be-scroller\", leftSidebar).perfectScrollbar(\"destroy\");\n } else {\n wrapper.addClass( config.collapsibleSidebarCollapsedClass );\n $(\"li.active\", leftSidebar).parents(\".parent\").removeClass(\"open\");\n $(\"li.open\", leftSidebar).removeClass(\"open\");\n }\n });\n }", "title": "" }, { "docid": "3b4045a5542bf8d1352ee13a1e9fe51b", "score": "0.5044371", "text": "function loadStudentToOptions() {\r\n var list = $(\"#adminNames\");\r\n list.append(createOptionsString(ADMIN_NAMES));\r\n}", "title": "" }, { "docid": "79d2cb315d620afbc740111f78980f2d", "score": "0.5037066", "text": "showList() {\n let listFilter = document.getElementsByTagName('aside');\n if(listFilter[0]) {\n listFilter[0].classList.add('open')\n }\n \n }", "title": "" }, { "docid": "4ee73f7240320609d15d0964029eacbd", "score": "0.50363797", "text": "function updateSidebar() {\r\n\tif (window==window.top) {\r\n\t\t\r\n\t\t//generate our own xw_time & xw_exp_sig\r\n\t\tvar xw_time = generateTime()\r\n\t\tvar xw_exp_sig = generateSig()\r\n\r\n\t\targTimeFull = '&xw_time=' + xw_time\r\n\t\targSigFull = '&xw_exp_sig=' + xw_exp_sig\r\n\t\tproDomain = location.href.substr(0,location.href.indexOf('/', '10'))\r\n\t\tlinkBase = proDomain + location.pathname\r\n\r\n parentAdsDiv=document.getElementById('MafiaWars-Sidebar')\r\n if (parentAdsDiv !== null) {\r\n removeFamily(parentAdsDiv)\r\n }\r\n\r\n if (GM_getValue('Links_On_Right_Side_cbox')) { //right side\r\n dropMenu=document.getElementById('MafiaWars-SidebarRightParent')\r\n if (dropMenu == null) {\r\n adsDiv = document.getElementById('sidebar_ads')\r\n tempDiv = adsDiv.parentNode\r\n tempDiv.setAttribute('id', 'MafiaWars-SidebarRightParent')\r\n removeChildrenFromNode(tempDiv)\r\n dropMenu=document.getElementById('MafiaWars-SidebarRightParent')\r\n }\r\n \r\n \r\n var parentAdsDiv = document.createElement('div');\r\n parentAdsDiv.setAttribute('id','MafiaWars-Sidebar');\r\n parentAdsDiv.setAttribute('style', 'background-color: black; width: 150px;')\r\n dropMenu.appendChild(parentAdsDiv);\r\n removeChildrenFromNode(parentAdsDiv)\r\n } else { //Left side\r\n dropMenu=document.getElementById('dropmenu_container')\r\n var parentAdsDiv = document.createElement('div');\r\n parentAdsDiv.setAttribute('id','MafiaWars-Sidebar');\r\n parentAdsDiv.setAttribute('style', 'background-color: black; width: 150px;')\r\n dropMenu.appendChild(parentAdsDiv);\r\n removeChildrenFromNode(parentAdsDiv)\r\n }\r\n\r\n //Create the Direct Links\r\n\t\t//Options \r\n\t\tlinkNew = document.createElement('a')\r\n\t\tlinkNew.setAttribute('onmouseover', 'window.status=\"Show Settings Menu\";return true')\r\n\t\tlinkNew.setAttribute('onmouseout', 'window.status=\"\";return true')\r\n\t\tlinkNew.addEventListener(\"click\", createMenu, false);\r\n\t\tlinkNew.setAttribute('style','color: green');\r\n\t\tlinkNew.setAttribute('class', 'MWSB')\r\n\t\tlinkNew.appendChild(document.createTextNode('- Options -'))\r\n\t\tparentAdsDiv.appendChild(linkNew)\r\n\t\tparentAdsDiv.appendChild(document.createElement('br'))\r\n\t\t\r\n\t\tfor(k=0; k<arrMenuMainChecklist.length; k++) {\r\n\t\t\targColor = \t\t\tarrMenuMainChecklist[k][1]\t\r\n\t\t\targId = \t\t\t\tarrMenuMainChecklist[k][2]\r\n\t\t\targController = arrMenuMainChecklist[k][3]\r\n\t\t\targJob = \t\t\t\tarrMenuMainChecklist[k][4]\r\n\t\t\targTab = \t\t\t\tarrMenuMainChecklist[k][5]\r\n\t\t\targBar = \t\t\t\tarrMenuMainChecklist[k][6]\r\n\t\t\targAction = \t\tarrMenuMainChecklist[k][7]\r\n\t\t\targOther = \t\t\tarrMenuMainChecklist[k][8]\r\n\t\t\targTitle = \t\t\tarrMenuMainChecklist[k][9]\r\n\t\t\t\t\t\r\n\t\t\tswitch (argId)\r\n\t\t\t{\r\n\t\t\tcase 'healny':\r\n\t\t\t\tif (GM_getValue(argId + '_cbox')) {\r\n\t\t\t\t\tlinkNew = document.createElement('a')\r\n\t\t\t\t\tlinkNew.setAttribute('onmouseover', 'window.status=\"(Script) If NY, then heal. If Cuba, travel.\";return true')\r\n\t\t\t\t\tlinkNew.setAttribute('onmouseout', 'window.status=\"\";return true')\r\n\t\t\t\t\tlinkNew.addEventListener(\"click\", healNY, false);\r\n\t\t\t\t\tlinkColor = GM_getValue(argId + '_color', argColor)\r\n\t\t\t\t\tlinkNew.setAttribute('style','color:' + linkColor)\r\n\t\t\t\t\tlinkNew.setAttribute('class', 'MWSB')\r\n\t\t\t\t\tlinkNew.appendChild(document.createTextNode(argTitle))\r\n\t\t\t\t\tparentAdsDiv.appendChild(linkNew)\r\n\t\t\t\t\tparentAdsDiv.appendChild(document.createElement('br'))\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'bgcolor':\r\n\t\t\t\tif (GM_getValue(argId + '_cbox')) {\r\n\t\t\t\t\tbgColor = GM_getValue(argId + '_color',argColor)\r\n\t\t\t\t\taddGlobalStyle('BODY {background-color:' + bgColor + '}');\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase 'user_promote':\r\n\t\t\t\tif (GM_getValue(argId + '_cbox')) {\r\n\t\t\t\t\tlinkNew = document.createElement('a')\r\n\t\t\t\t\tlinkNew.setAttribute('onmouseover', 'window.status=\"Promote this mafia member\";return true')\r\n\t\t\t\t\tlinkNew.setAttribute('onmouseout', 'window.status=\"\";return true')\r\n\t\t\t\t\tlinkNew.addEventListener(\"click\", promoteUser, false);\r\n\t\t\t\t\tlinkColor = GM_getValue(argId + '_color', argColor)\r\n\t\t\t\t\tlinkNew.setAttribute('style','color:' + linkColor)\r\n\t\t\t\t\tlinkNew.setAttribute('class', 'MWSB')\r\n\t\t\t\t\tlinkNew.appendChild(document.createTextNode(argTitle))\r\n\t\t\t\t\tparentAdsDiv.appendChild(linkNew)\r\n\t\t\t\t\tparentAdsDiv.appendChild(document.createElement('br'))\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'user_job_assist':\r\n\t\t\t\tif (GM_getValue(argId + '_cbox')) {\r\n\t\t\t\t\tlinkNew = document.createElement('a')\r\n\t\t\t\t\tlinkNew.setAttribute('onmouseover', 'window.status=\"Assist a job for this mafia member\";return true')\r\n\t\t\t\t\tlinkNew.setAttribute('onmouseout', 'window.status=\"\";return true')\r\n\t\t\t\t\tlinkNew.addEventListener(\"click\", jobAssistUser, false);\r\n\t\t\t\t\tlinkColor = GM_getValue(argId + '_color', argColor)\r\n\t\t\t\t\tlinkNew.setAttribute('style','color:' + linkColor)\r\n\t\t\t\t\tlinkNew.setAttribute('class', 'MWSB')\r\n\t\t\t\t\tlinkNew.appendChild(document.createTextNode(argTitle))\r\n\t\t\t\t\tparentAdsDiv.appendChild(linkNew)\r\n\t\t\t\t\tparentAdsDiv.appendChild(document.createElement('br'))\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tif (GM_getValue(argId + '_cbox')) {\r\n\t\t\t\t\targIdFull = GM_getValue(argId + '_cbox')\r\n\t\t\t\t\tlinkColor = GM_getValue(argId + '_color',argColor)\r\n\t\t\t\r\n\t\t\t\t\tif (!(argController=='')) {\r\n\t\t\t\t\t\targControllerFull = 'xw_controller=' + argController //no &\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\targControllerFull = ''\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!(argJob=='')) {\r\n\t\t\t\t\t\targJobFull = '&job=' + argJob\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\targJobFull = ''\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!(argTab=='')) {\r\n\t\t\t\t\t\targTabFull = '&tab=' + argTab\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\targTabFull = ''\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!(argBar=='')) {\r\n\t\t\t\t\t\targBarFull = '&bar=' + argBar\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\targBarFull = ''\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!(argAction=='')) {\r\n\t\t\t\t\t\targActionFull = '&xw_action=' + argAction\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\targActionFull = ''\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!(argOther=='')) {\r\n\t\t\t\t\t\targOtherFull = argOther\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\targOtherFull = ''\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\t//Final link argurments order: action, city, job, tab, bar, other\r\n\t\t\t\t\tlinkNew = document.createElement('a')\r\n\t\t\t\t\tlinkPartial = 'remote/html_server.php' + '?' + argControllerFull + argSigFull + argTimeFull + argActionFull + argJobFull + argTabFull + argBarFull + argOtherFull\r\n\t\t\t\t\tlinkFull = linkBase + '?' + argControllerFull + argSigFull + argTimeFull + argActionFull + argJobFull + argTabFull + argBarFull + argOtherFull\r\n\t\t\t\t\tlinkNew.setAttribute('onmouseover', 'window.status=\"' + linkFull + '\";return true')\r\n\t\t\t\t\tlinkNew.setAttribute('onmouseout', 'window.status=\"\";return true')\r\n\t\t\t\t\tlinkNew.setAttribute('onclick','window.location=\"javascript:a10979261223_do_ajax(\\'mainDiv\\',\\'' + linkPartial + '\\')\";updateSidebar();')\r\n\t\t\t\t\tlinkNew.appendChild(document.createTextNode(argTitle))\t\t\r\n\t\t\t\t\tlinkNew.setAttribute('style','color:' + linkColor)\r\n\t\t\t\t\tlinkNew.setAttribute('class', 'MWSB')\r\n\t\t\t\t\tparentAdsDiv.appendChild(linkNew)\r\n\t\t\t\t\tparentAdsDiv.appendChild(document.createElement(\"br\"))\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "083e0f26631aee26cda74359c56b2aac", "score": "0.50283194", "text": "setSidebarIsOpen(open) {\n if (typeof open !== 'boolean' && !this.$store.getters.embed) {\n let filledPlaces = Place.getFilledPlaces(this.places).length\n let startDirections = this.$store.getters.mode === constants.modes.directions && filledPlaces === 1 && !this.$store.getters.pointerTriggeredAction\n open = this.$store.getters.leftSideBarPinned || this.$mdAndUpResolution || startDirections\n }\n this.$store.commit('pointerTriggeredAction', null)\n this.$store.commit('setLeftSideBarIsOpen', open)\n }", "title": "" }, { "docid": "2892318bbb0acf846cdd2991f7afcc84", "score": "0.5013079", "text": "function createMenu(){\n const ui = SpreadsheetApp.getUi();\n //Name of the menu \n const menu = ui.createMenu(\"AliItemExtractor\");\n \n menu.addItem(\"Show UI\",\"loadSidebar\");\n menu.addSeparator();\n menu.addItem(\"HELP\",\"helpFn\");\n menu.addToUi();\n}", "title": "" }, { "docid": "a77a69887472c9e94f03c233054ab24f", "score": "0.5012138", "text": "constructor(args) {\n this.show_first = args.show_first;\n this.els = args.elements;\n this.actions = args.clickactions;\n this.midbar = args.midbar; // If \"true\", will show in the midbar\n this.header = args.header; // If \"true\", will be a circular icon appearing in the header\n this.vars = args.vars;\n this.pid = args.parent;\n this.eid = \"ufo_dropdown_\" + this.pid.pid + \"_\" + args.id;\n this.id = args.id;\n this.idx = 1;\n this.open = false;\n if(args.smallcard!=undefined) {\n this.smallcard = args.smallcard;\n }\n else {\n this.smallcard = false;\n }\n this.create();\n this.icon;\n this.domel;\n }", "title": "" }, { "docid": "e8d40608906306bcc6a1efdfbe9f55a1", "score": "0.50096864", "text": "function generateSidemenu() {\n\tlet years = [];\n\ttimestamps.map(function(n) {\n\t\tif(years.indexOf(n[0]) < 0) years.push(n[0]);\n\t});\n\tfor(let year of years)\n\t{\n\t\tlet item = document.createElement('span');\n\t\titem.classList.add('year');\n\t\titem.innerText = year;\n\t\titem.addEventListener('click', function() {\n\t\t\twindow.location.hash = '#' + this.innerText;\n\t\t\ttableID = this.innerText;\n\t\t\tplayerID = this.innerText + 'Player';\n\t\t\tgenerateTable(tableID);\n\t\t\tgeneratePlayer(tableID);\n clearInterval(timer);\n\t\t\tclearTimestamps();\n\t\t\thideIrrelevant();\n\t\t});\n\t\tdocument.getElementById('sidebar').appendChild(item);\n\t}\n\t\n\t//if location has anchor, click on year (eg. \"?year=2020\")\n\tif(years.indexOf(window.location.hash.slice(1)) >= 0)\n\t{\n\t\t\ttableID = window.location.hash.slice(1);\n\t\t\tplayerID = window.location.hash.slice(1) + 'Player';\n\t\t\tgenerateTable(tableID);\n\t\t\tgeneratePlayer(tableID);\n clearInterval(timer);\n\t\t\tclearTimestamps();\n\t\t\thideIrrelevant();\n\t}\n}", "title": "" } ]
b68f7846baa423b5cf5e56d703d636a9
Retrieve the videos and notify thanks to Twitter
[ { "docid": "61fae582e8f6509ea0de571ebfe51f09", "score": "0.6696958", "text": "function notify () {\n callAPI(null).then((result) => {\n if (result.items.length) {\n logger.getLogger().info('POST TWITTER')\n logger.getLogger().info(result.items)\n // Tweet the new videos\n twitter.tweetNotifs(result.items)\n lastId.value = result.items[0].id\n logger.getLogger().info(`New last id : ${lastId.value}`)\n }\n }).catch((e) => {\n logger.getLogger().error(e)\n })\n}", "title": "" } ]
[ { "docid": "22db653a963b7fba79b7d16b186675a1", "score": "0.6558123", "text": "function videoS() {\n fetch(\n \"https://www.googleapis.com/youtube/v3/search?key=\" +\n API_KEY +\n \"&type=video&part=snippet&maxResult=\" +\n 10 +\n \"&q=\" +\n stringWithoutCommas\n )\n .then(function (resp) {\n return resp.json();\n })\n .then(function (data) {\n console.log(data);\n var i;\n for (i = 0; i < 5; i++) {\n let URL = data.items[i].id.videoId;\n addAnswer(\n Main,\n \"<iframe width='420' height='315' src='http://www.youtube.com/embed/\" +\n URL +\n \"' frameborder='1' allowfullscreen></iframe>\"\n );\n }\n\n addAnswer(Main, \"<a href='\" + url + \"'>For more click me</a>\");\n })\n .catch(function () {\n // catch any errors\n });\n }", "title": "" }, { "docid": "1d0acb015384c1d247234108c24f2a6d", "score": "0.653603", "text": "function getVideos() {\n\n\tif (listVideos('list')) {\n\t\tvar ids = listVideos('list');\n\t\tconsole.log('videos skipped: ' + ids);\n\n\n\t\tgapi.client.load('youtube', 'v3', function () {\n\t\t\tvar request = gapi.client.youtube.videos.list({\n\t\t\t\tpart: 'snippet',\n\t\t\t\tid: ids,\n\t\t\t\tkey: 'AIzaSyDeAikv_mXaHKvVWc6JG-hqKHZnSMiGfpo'\n\t\t\t});\n\t\t\trequest.execute(function (response) {\n\n\t\t\t\tvar template = $('#listTemplate').html();\n\t\t\t\tvar html = Mustache.to_html(template, response);\n\t\t\t\t$('.videoList').html(html);\n\n\t\t\t\t// console.log(response.result);\n\t\t\t});\n\t\t});\n\n\n\n\t} else {\n\t\t$('.endMessage').html('Thank you for Watching!');\n\t}\n\n\n\n}", "title": "" }, { "docid": "a9d632b497681d66bc3113b0ce674860", "score": "0.62600785", "text": "function requestEvents() {\n\n // https://developers.google.com/youtube/v3/docs/channels/list\n var request = gapi.client.youtube.liveBroadcasts.list({\n mine: true,\n part: 'snippet,status'\n\n });\n request.execute(function(response) {\n \n var listitems = response.result.items;\n\n \n $('#search-results-number').html();\n // For each result lets show a thumbnail.\n jQuery.each(listitems, function(index, item) {\n //$('#video-container').append('<br>' + item.snippet.title);\n var myEvents_html = 'Total Results: ' + response.result.pageInfo.totalResults +\n \n '<br><br>Title: ' + item.snippet.title +\n '<br>id : ' + item.id +\n \t\t '<br>lifeCycleStatus: ' + item.status.lifeCycleStatus +\n '<br>privacyStatus: ' + item.status.privacyStatus +\n '<br>recordingStatus: ' + item.status.recordingStatus;\n \n $('#my-ytevents').append(myEvents_html);\n }); \n });\n}", "title": "" }, { "docid": "ad8d038b6e4b2fb7803a2fc34730ec5b", "score": "0.61774135", "text": "function getChannelVidList(userName) {\n $('#cname').html(userName);\n $.get(\n \"https://www.googleapis.com/youtube/v3/channels\",{\n part : 'contentDetails', \n forUsername : userName,\n key: API_KEY},\n function(data) {\n $.each( data.items, function( i, item ) {\n pid = item.contentDetails.relatedPlaylists.uploads;\n getVids(pid);\n });\n }\n );\n}", "title": "" }, { "docid": "721fa8e443c9bee5e91fe5bb46df957f", "score": "0.6144353", "text": "function twitter(){\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n \t\t\t\tfor (var i = 0; i < tweets.length; i++) {\n \t\t\t\t\tconsole.log(`\n Date: ${tweets[i].created_at},\n Tweet: ${tweets[i].text}\n ================`);\n \t\t\t}\n }else {\n \t\t\t\tconsole.log(error);\n \t\t\t}\n});\n}", "title": "" }, { "docid": "e9b03b4c35e487295a4471c6f6990214", "score": "0.61178315", "text": "function getVideos(url, playlist, callback){\n\t\t$.getJSON(url, function(data){\n\t\t\t$.each(data.feed.entry, function(i, item){\n\t\t\t\tvar entry = {};\n\t\t\t\t\n\t\t\t\t//containing playlist\n\t\t\t\tentry.playlist = playlist;\n\t\t\t\t\n\t\t\t\t//id\n\t\t\t\tentry.id = item.media$group.yt$videoid.$t;\n\t\t\t\t\n\t\t\t\t//title\n\t\t\t\tentry.title = item.title.$t;\n\t\t\t\t\n\t\t\t\t//thumbnail\n\t\t\t\tif (item.media$group && item.media$group.media$thumbnail){\n\t\t\t\t\tentry.thumb = item.media$group.media$thumbnail[0].url;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tentry.thumb = \"images/fallback_thumb.jpg\";\n\t\t\t\t}\n\n\t\t\t\t//category of video\n\t\t\t\tif (item.category[1] && item.category[1].term){\n\t\t\t\t\tentry.category = item.category[1].term;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tentry.category = \"-\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//duration in minutes\n\t\t\t\tif (item.media$group && item.media$group.yt$duration){\n\t\t\t\t\tvar seconds = item.media$group.yt$duration.seconds;\n\t\t\t\t\tvar min = Math.floor(seconds / 60); \n\t\t\t\t\tvar remSec = (seconds % 60);\n\t\t\t\t\tif (remSec===0){ \n\t\t\t\t\t\tentry.duration = min + \":00\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tentry.duration = min + \":\" + remSec;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tentry.duration = \"-\";\n\t\t\t\t}\n\n\t\t\t\t//number of views\n\t\t\t\tif (item.yt$statistics && item.yt$statistics.viewCount){\n\t\t\t\t\tentry.views = item.yt$statistics.viewCount;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tentry.views = \"-\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//ratings and likes\n\t\t\t\tif (item.yt$rating && item.yt$rating.numLikes){\n\t\t\t\t\tentry.likes = item.yt$rating.numLikes;\n\t\t\t\t\tentry.dislikes = item.yt$rating.numDislikes;\n\t\t\t\t\tentry.average = Math.floor(entry.likes / entry.dislikes);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tentry.likes = \"-\";\n\t\t\t\t\tentry.dislikes = \"-\";\n\t\t\t\t\tentry.average = \"-\";\n\t\t\t\t}\n\n\t\t\t\tcallback(entry);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "90f50cecd43d9de18e193feeef77aa2f", "score": "0.61092246", "text": "onCreateVideoDetailsRequest() {\n const request = gapi.client.youtube.videos.list({\n id: this.id,\n part: \"snippet,contentDetails,statistics\"\n });\n request.execute(response => {\n const results = response.result;\n console.log(results);\n this.onPopulateVideoInfo(results);\n });\n }", "title": "" }, { "docid": "d01df50aa7dfbb652024c12654358ca5", "score": "0.610805", "text": "function myTweet() {\n\nvar params = {screen_name: 'eener322'};\n\tclient.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n console.log(\"Tweets have been loaded!\");\n for (var i = 0; i < tweets.length; i++){\n \tconsole.log(\"# \" + (i+1) + \" @eener322 : \" + tweets[i].text + \"\\n [\" + tweets[i].created_at + \" ]\");\n\n };\n }\n else {\n \tconsole.log(error);\n }\n});\n\n\n\n}", "title": "" }, { "docid": "09dfd06b28a6465e3d49d8d06f3a2fa1", "score": "0.60701275", "text": "function testChannel() {\n var videos = getVideos ('TefalCZSK')\n Logger.log(videos[0]);\n}", "title": "" }, { "docid": "45fe41376680f57556cbbae8d8c54ff8", "score": "0.60566145", "text": "function getTweets(){\nvar params = {screen_name: 'j_f_r4'};\nclient.get('statuses/user_timeline', params, function(error, tweets, response){\n if (!error) {\n //console.log(tweets);\n for (var i = 0; i < tweets.length; i++) {\n \t console.log( tweets[i].text + tweets[i].created_at);\n };\n } else if (error) {\n \t//console.log(error);\n }\n});\n}", "title": "" }, { "docid": "6afc2e4606c38d5a15c5720cdc9bef25", "score": "0.6053754", "text": "function getVideos(){\n}", "title": "" }, { "docid": "84f99dc7e052fb9a4bcbc1fa31f48b6e", "score": "0.60271895", "text": "function getLikedVideos() {\n $('#video-container').empty()\n var searchRequest = gapi.client.youtube.videos.list({\n \"part\": \"snippet\",\n \"myRating\": \"like\",\n\n });\n\n searchRequest.execute(function(response) {\n $('#video-container').empty()\n var srchItems = response.result.items; \n var $videoContainer = $('#video-container')\n $.each(srchItems, function(index, item) {\n var vidChannelTitle = item.snippet.channelTitle;\n var vidTitle = item.snippet.title; \n var videoId = item.id;\n var videoImg = item.snippet.thumbnails.default.url; \n\n // make API Video request in order to get duration\n var detailsRequest = gapi.client.youtube.videos.list({\n id: videoId,\n part: 'contentDetails', \n type: 'video',\n maxResults: 5\n })\n\n detailsRequest.execute(function(details) {\n console.log(details);\n var videoDuration = ISO8601toDuration(details.items[0].contentDetails.duration);\n\n // Check index of returned YT ISO8601 time format and trim\n function formatTimeUnit(input, unit){\n var index = input.indexOf(unit);\n var output = \"00\"\n if (index < 0) {\n return output; // unit isn't in the input\n }\n if (isNaN(input.charAt(index-2))) {\n return '0' + input.charAt(index - 1);\n } else {\n return input.charAt(index - 2) + input.charAt(index - 1);\n }\n }\n\n // Convert ISO8601 format to time HH:MM:SS\n function ISO8601toDuration(input){\n var H = formatTimeUnit(input, 'H');\n var M = formatTimeUnit(input, 'M');\n var S = formatTimeUnit(input, 'S');\n if (H == \"00\") {\n H = \"\";\n } else {\n H += \":\"\n }\n \n return H + M + ':' + S ;\n }\n // HTML render for Liked videos\n $videoContainer.append(`\n <tr class=\"vidTable\" value=\"#trackuri\" id=\"${videoId}\">\n <td class=\"album\" value=\"#\">\n <i class=\"fa fa-play-circle fa-3x hidden\" aria-hidden=\"true\"></i>\n <div class=album-holder><img src=\"${videoImg}\"></div>\n </td>\n <td>\n <p class=\"artist-name\">${vidChannelTitle}</p>\n <h5 class=\"song-name\">${vidTitle}</h5>\n </td>\n <td>\n <div class=\"time-holder\">${videoDuration}</div> \n <button class=\"add-button btn btn-primary yt-add-song\">Add</button>\n \n </td>\n </tr>`); \n })\n })\n //$($videoContainer).wrap('<div class=\"scrollable\"></div>')\n })\n}", "title": "" }, { "docid": "d6a9352824c933cb4e2d23ad3bdd5e29", "score": "0.60196733", "text": "function getTweets() {\n var params = {screen_name: 'deveLOVEper1234'};\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n for (var i = 0; i< tweets.length; i++){ \n log.info(`\n tweet ${i+1}:\n ${tweets[i].created_at}\n ${tweets[i].text}\n -----------------------------------------------------`); \n }\n };\n })\n}", "title": "" }, { "docid": "735bc5c19e2a1a611972dcdaa40d8d97", "score": "0.60178876", "text": "function findVideos() {\n var that = choosenArtist;\n var url3;\n var url = 'https://www.youtube.com/channel/';\n var url2 = encodeURI('https://www.youtube.com/results?search_query=' + that + '&key=AIzaSyB8EY8sdC4tvarZjkP5b6un0tu0r2At3H4');\n\n that = that.replace(/\\s+/g, '');\n url3 = encodeURI('https://www.googleapis.com/youtube/v3/search?part=snippet&q=' + that + '&key=AIzaSyB8EY8sdC4tvarZjkP5b6un0tu0r2At3H4');\n asyncRequest('GET', url3, function (x) {\n var i,\n obj = JSON.parse(x.responseText),\n mas = obj.items;\n\n for (i = 0; i < mas.length; i++) {\n var channelId = mas[i].snippet.channelId,\n user = mas[i].snippet.channelTitle,\n re = new RegExp(that + '*', 'i');\n if (re.test(user)) {\n url2 = url + channelId;\n }\n }\n window.open(url2);\n });\n}", "title": "" }, { "docid": "61540e9d312c6a1605c1b9b1e6eec9b3", "score": "0.60095453", "text": "function YTRelatedRetrieval(videoID, args) {\n url = \"http://gdata.youtube.com/feeds/api/videos/\" + videoID + \"/related\";\n retrieveFeed(url, putFeedAsMovieList, args);\n}", "title": "" }, { "docid": "a60294c317cd65d677cadb04cf2b609e", "score": "0.5996426", "text": "function getVideo(callback, req, res) {\n var service = google.youtube('v3');\n video = req.query.search;\n update_widget(req.query.id_bdd, video);\n service.videos.list({\n key: key.youtube.token,\n part: 'snippet,contentDetails,statistics,status',\n id: video,\n }, function (err, response) {\n if (err) {\n console.log('The API returned an error:widget ' + err);\n return;\n }\n var channels = response.data.items;\n if (channels.length == 0) {\n console.log('No channel found.');\n } else {\n callback(channels[0], req, res)\n }\n });\n}", "title": "" }, { "docid": "cde742fc620a7c55c4556830cc8e825d", "score": "0.5974233", "text": "function loadtweets() {\r\n var rapid = new RapidAPI(\"default-application_5bdca111e4b02e44153fe1b2\", \"f4106874-ab35-4e58-8614-91b818cb9e93\");\r\n\r\n rapid.call('Twitter', 'search', {\r\n 'consumerKey': 'J9JJhHRDwK5R4v2vMUxpYFM1c',\r\n 'query': $(\"#search\").val(),\r\n 'accessTokenKey': '1058415465205137408-LdNfvMnqE7MFwupnV7Q4lqivY87i86',\r\n 'consumerSecret': 'IvJBb9TGnIh2oyOnRx55TqNH6iuzOeJa5J9tbZqZve6jChkIdo',\r\n 'accessTokenSecret': 'dsieVnV0Dv07QEVqBQaubIPrte6LEtUcZVBRpPzNfvl00'\r\n\r\n }).on('success', function(payload) {\r\n /*YOUR CODE GOES HERE*/\r\n //console.log(payload);\r\n loadyoutube();\r\n $.each(payload.statuses, function(index, item) {\r\n\r\n if (index < 5)\r\n $(\"#twitter_container\").append('<p><i class=\"fas fa-arrow-alt-circle-right\"></i> ' + item.text + '</p>');\r\n\r\n });\r\n\r\n }).on('error', function(payload) {\r\n /*YOUR CODE GOES HERE*/\r\n console.log(payload);\r\n });\r\n\r\n\r\n}", "title": "" }, { "docid": "a9b3bf671b126f2802a5b5c5693b3561", "score": "0.5970445", "text": "function onPlayerStateChange(event) {\n if(event.data == YT.PlayerState.PLAYING){\n startClock();\n getDbpediaInfo();\n var q = currentVideo;\n var request = gapi.client.request({\n 'method': 'get',\n 'path': '/youtube/v3/commentThreads',\n 'params':{\n 'part': 'snippet, replies',\n 'videoId': q\n }\n });\n request.execute(function(response){\n var i;\n var html=\"\"; \n for(i=0; i<response.items.length && i<20 ; i++){\n html+=\" <div class='media border p-3 '>\";\n html += \"<img src=\"+JSON.stringify(response.items[i].snippet.topLevelComment.snippet.authorProfileImageUrl)+\" alt=\"+JSON.stringify(response.items[i].snippet.topLevelComment.snippet.authorProfileImageUrl)+\" class='mr-3 mt-3 rounded-circle' style='width:65px;height:65px'>\";\n html+= \"<div class='media-body'>\";\n html +=\"<h5>\"+ JSON.stringify(response.items[i].snippet.topLevelComment.snippet.authorDisplayName).slice(1,-1)+\"<small><i> Posted on \"+JSON.stringify(response.items[i].snippet.topLevelComment.snippet.publishedAt).slice(1,-15)+\"</i></small></h5>\";\n html+=\"<p>\"+ JSON.stringify(response.items[i].snippet.topLevelComment.snippet.textOriginal).slice(1,-1)+\"</p></div></div>\";\n\n //<small><i>Posted on February 19, 2016</i></small>\n // html+=\"<img width='28' heigth='28' src=\"+JSON.stringify(response.items[i].snippet.topLevelComment.snippet.authorProfileImageUrl)+\"> <b> \"+ JSON.stringify(response.items[i].snippet.topLevelComment.snippet.authorDisplayName).slice(1,-1) +\" </b> <br> \"+ JSON.stringify(response.items[i].snippet.topLevelComment.snippet.textOriginal)+\"<hr>\";\n $('#comment_container').html(html);\n }\n });\n //DESCRIZIONE E TITOLO\n var request1 = gapi.client.youtube.videos.list({\n 'method': 'get',\n 'path': '/youtube/v3/videos',\n 'id': q,\n 'part': 'snippet' });\n request1.execute(function(response){\n var title=\"\";\n var desc=\"\";\n title +=\"<b><h2>\"+response.items[0].snippet.title+\"</h2></b>\";\n desc += \"<p>\"+JSON.stringify(response.items[0].snippet.description)+\"</p>\";\n desc.replace(\"\\n\",\"<br>\");\n // title.replace('\" ', \" \");\n $('#description_container').html(desc);\n $('#title_container').html(title);\n });\n \n }\n if(event.data == YT.PlayerState.PAUSED)\n stopClock();\n }", "title": "" }, { "docid": "86a3f1dbc27edc60fd377c694c7a86a0", "score": "0.5969314", "text": "function receivedInfo(dataObj, wasCached)\r\n{\r\n\r\n // If we got a valid data object\r\n if (window.undefined !== dataObj && window.undefined === dataObj.error)\r\n {\r\n \r\n var youtubeID = dataObj.data.id;\r\n var youtubeTitle = dataObj.data.title;\r\n \r\n // Drop the title into the links in the chat\r\n $(\".video-\" + youtubeID + \"-link\").html(youtubeTitle);\r\n\r\n // Fresh request for a video we haven't seen before\r\n if (!wasCached)\r\n {\r\n youtubeVideoInfo[youtubeID] = dataObj;\r\n }\r\n // Request for a video already in our info\r\n else\r\n {\r\n console.log(\"YTLM: Data was cached for video : \" + youtubeID);\r\n }\r\n \r\n // If this video is not already in our box\r\n // and the video is embedable\r\n if (!videoArea.getVideoByYoutubeID(youtubeID) && \r\n dataObj.data.accessControl.embed == \"allowed\"\r\n )\r\n {\r\n // Create and add the embed to the video area\r\n videoArea.addVideo(youtubeID);\r\n }\r\n else if (dataObj.data.accessControl.embed == \"denied\")\r\n {\r\n // Let the user know the video could not be embeded\r\n $(\".video-\" + youtubeID + \"-link\").html($(\".video-\" + youtubeID + \"-link\").html() + \" (Embed Not Allowed)\");\r\n }\r\n }\r\n else\r\n {\r\n // Unfortunately in this case, we don't even have the\r\n // id to display a more useful message back to the user\r\n console.warn(\"YTLM: Invalid video link\");\r\n return;\r\n }\r\n}", "title": "" }, { "docid": "faa563c2ecf4f75aaec06b18353f8b8a", "score": "0.59686005", "text": "function load_video_feed(){\n\t\t$(\"#ytapiplayer\").css(\"display\", \"block\");\n\t\t\n\t\tvar params = {\n\t\t\tallowScriptAccess: \"always\",\n\t\t\tbgcolor: \"#cccccc\"\n\t\t};\n\t\tvar atts = {\n\t\t\tid: \"myytplayer\"\n\t\t};\n\t\tswfobject.embedSWF(\"http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=ytplayer\", \"ytapiplayer\", \"640\", \"390\", \"8\", null, null, params, atts);\n\t\t\n\t\tsetTimeout(testtest, 3000);\n\t\t\n\t\t/*\n\t\t * TOKBOX CODE\n\t\t */\n\t\t\n\t\tTB.addEventListener(\"exception\", exceptionHandler);\n\t\t\n\t\tif (TB.checkSystemRequirements() != TB.HAS_REQUIREMENTS) {\n\t\t\talert(\"You don't have the minimum requirements to run this application.\" +\n\t\t\t\"Please upgrade to the latest version of Flash.\");\n\t\t}\n\t\telse {\n\t\t\tsession = TB.initSession(sessionId);\n\t\t\tsession_driver = TB.initSession(sessionId_driver);\n\t\t\tsession.addEventListener('sessionConnected', sessionConnectedHandler);\n\t\t\tsession.addEventListener('sessionDisconnected', sessionDisconnectedHandler);\n\t\t\tsession.addEventListener('connectionCreated', connectionCreatedHandler);\n\t\t\tsession.addEventListener('connectionDestroyed', connectionDestroyedHandler);\n\t\t\tsession.addEventListener('streamCreated', streamCreatedHandler);\n\t\t\tsession.addEventListener('streamDestroyed', streamDestroyedHandler);\n\t\t\t\n\t\t\tsession_driver.addEventListener('sessionConnected', sessionConnectedHandler_driver);\n\t\t\tsession_driver.addEventListener('sessionDisconnected', sessionDisconnectedHandler);\n\t\t\tsession_driver.addEventListener('connectionCreated', connectionCreatedHandler);\n\t\t\tsession_driver.addEventListener('connectionDestroyed', connectionDestroyedHandler);\n\t\t\tsession_driver.addEventListener('streamCreated', streamCreatedHandler_driver);\n\t\t\tsession_driver.addEventListener('streamDestroyed', streamDestroyedHandler_driver);\n\t\t\t\n\t\t\tif(usr_type == 'artist') {\n\t\t\t\tq=setTimeout(show_button,5000);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "4be0d79dc6f071a37e1651fff702f92f", "score": "0.5903257", "text": "function videoList(auth, requestData) {\n let service = google.youtube('v3');\n let parameters = {auth: auth, part: 'snippet, contentDetails, statistics', forUsername: requestData.forUsername};\n\n // Get the playlist of recent uploads of the channel.\n service.channels.list(parameters, function(err, response) {\n if (err) {\n console.log('Do you have internet and does the channel exist? The API returned an error: ' + err);\n return;\n }\n let channelPlaylists = response.data.items[0].contentDetails.relatedPlaylists;\n let playlist = channelPlaylists.uploads;\n\n let playListParameters = {auth: auth, part: 'snippet, contentDetails', playlistId: playlist};\n service.playlistItems.list(playListParameters, function(err, response) {\n if (err) {\n console.log('The API returned an error: ' + err);\n return;\n }\n\n let tableHeader = [colors.red('INDEX'), colors.blue('DATE OF PUBLISH'), colors.green('VIDEO TITLE'), colors.yellow('VIDEO DESCRIPTION')];\n let returnData = [tableHeader];\n\n let videoList = response.data.items;\n videoList.forEach(function (video, i) {\n let videoDetails = video.snippet;\n let descriptionSummary = videoDetails.description.replace(/\\n/g, '').substring(0, 100);\n returnData.push([\"#\" + (i + 1), videoDetails.publishedAt, videoDetails.title.replace(/\\n/g, ''), descriptionSummary]);\n });\n\n if (typeof requestData.callBack !== 'undefined') {\n let tableConfig = {\n border: getBorderCharacters(`norc`),\n columns: {\n 2: { width: 50 },\n 3: { width: 50 }\n }\n };\n let resultingTable = table(returnData, tableConfig);\n requestData.callBack(resultingTable);\n }\n });\n });\n}", "title": "" }, { "docid": "b9a1d8bc87fecca8e468ab881a70595b", "score": "0.59006846", "text": "function findLive(e) {\n \tvar text = e.target.responseText;\n \ttotalIndex = text.indexOf(\"_total\");\n \tif(text.charAt(totalIndex+8) != 0) {\n \t\tlistFollowed[i].innerHTML += \" LIVE\";\n \t\tlistFollowed[i].className = \"live\";\n\t\tnumLiveChannels += 1;\n \t}\n \ti++;\n \tvar req2 = new XMLHttpRequest();\n \tif(i != listFollowed.length) {\n \t\treq2.open(\"GET\", STREAM_URL+listFollowed[i].innerHTML.toLowerCase());\n \t\treq2.onload = findLive;\n \t\treq2.send(null);\n \t}\n\telse {\n\t\tloadingSign.style.display = \"none\";\n\t\tchrome.browserAction.setBadgeText({text: \"\"+numLiveChannels});\n\t}\n}", "title": "" }, { "docid": "093c080a13f735b430d6d341d3054632", "score": "0.5896402", "text": "function showTweets() {\n //var twitKeys = TwitterK.twitterKeys;\n //Twitter Keys and access Keys. \n //var client = new Twitter(TwitterK.twitterKeys);\n\n var twitterId = 'mr_kevin_smith'\n var params = {screen_name: twitterId};\n client.get('statuses/user_timeline', params, function(error, tweets, response){\n if (!error) {\n //var tweetLength = 0;\n /* if (tweets.length < 20) {\n tweetLength = tweets.length\n } else {\n tweetLength = 20\n }*/\n //console.log(tweets[0].text);\n for (var i = 0; i < 3; i++) {\n\t console.log(tweets[i].text);\n }\n } else {\n \tconsole.log(error);\n }\n });\n}", "title": "" }, { "docid": "34bfa1b5c655d760d6a7b5638d6254de", "score": "0.5883608", "text": "async function fetchVideo() {\n\t\t\tif (fetchURL.match('movie')) {\n\t\t\t\tconst request = await axios.get(reqType('movie', movie.id));\n\t\t\t\tsetTrailerID(request.data.results[0].key);\n\t\t\t} else if (fetchURL.match('tv')) {\n\t\t\t\tconst request = await axios.get(reqType('tv', movie.id));\n\t\t\t\tsetTrailerID(request.data.results[0]?.key);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "936a829165b0f02b4f5f4f0cfc6a1cf8", "score": "0.5857066", "text": "function getVideoUrl() {\n var videoUrl = ytswf.getVideoUrl();\n updateHTML('videoUrl', videoUrl);\n }", "title": "" }, { "docid": "02c0cc8044e7c3c8e831f810b4017b87", "score": "0.5848608", "text": "function getTweetUrl_twitter(videoContainer) {\n return location.origin + $(videoContainer).closest('article').find('a[href*=\"status\"]')[0].getAttribute('href');\n }", "title": "" }, { "docid": "73be45999f653c5656929ae223b0ec10", "score": "0.5843605", "text": "function youtube(result) {\n var youtube_url = result[\"yt_vid\"];\n player = new YT.Player('youtube_vid', {\n height: '390',\n width: '640',\n videoId: youtube_url,\n events: {\n 'onStateChange': onPlayerStateChange\n }\n });\n }", "title": "" }, { "docid": "a71ae452fac375df8b926886a012c907", "score": "0.5842692", "text": "function myTweets(){\n\tconsole.log(\"My Tweets\")\n\tvar params = {screen_name: 'mycodingbootcam'};\n\tclient.get('statuses/user_timeline', params, function(error, tweets, response) {\n \t\tif (!error) {\n \t\tfor (var i=0; i<20; i++){\n \t\tconsole.log(\"Tweet Body: \" + tweets[i].text)\n \t\tconsole.log(\"Created at :\" + tweets[i].created_at + \"\\n\")\n\t\t\t};\n\t\t};\n\t});\n}", "title": "" }, { "docid": "ebe58ea95b83e46ec177e7a7ee644bef", "score": "0.58419716", "text": "function videosFetch(videos) {\n return {\n type: VIDEOS_FETCH,\n payload: videos\n };\n}", "title": "" }, { "docid": "6a9929bc2f33b33e2921b14de5c59cbb", "score": "0.58242065", "text": "function publicFeed(){\n if(navigator.getUserMedia) { // Standard\n navigator.getUserMedia(videoObj, function(stream) {\n p.video.src = stream;\n p.video.play();\n }, errBack);\n } else if(navigator.webkitGetUserMedia) { // WebKit-prefixed\n navigator.webkitGetUserMedia(videoObj, function(stream){\n p.video.src = window.webkitURL.createObjectURL(stream);\n p.video.play();\n }, errBack);\n }\n else if(navigator.mozGetUserMedia) { // Firefox-prefixed\n navigator.mozGetUserMedia(videoObj, function(stream){\n p.video.src = window.URL.createObjectURL(stream);\n p.video.play();\n }, errBack);\n }\n }", "title": "" }, { "docid": "4d208b344d850cb5a8c9fdde5953f4ef", "score": "0.581551", "text": "function fetchTwitter() {\n\tvar tweetsLength;\n\n\t//From twitter's NPM documentation, grab the most recent tweets\n\tvar params = {\n\t\tscreen_name: 'PixelGypsyBot'\n\t};\n\tclient.get('statuses/user_timeline', function (error, tweets, response) {\n\t\tif (error) throw error;\n\n\t\t//Loop through the number of tweets that were returned to get the number of tweets returned.\n\t\t//If the number of tweets exceeds 20, make it 20.\n\t\t//Then loop through the length of tweets and return the tweets date and text.\n\t\ttweetsLength = 0;\n\n\t\tfor (var i = 0; i < tweets.length; i++) {\n\t\t\ttweetsLength++;\n\t\t}\n\t\tif (tweetsLength > 20) {\n\t\t\ttweetsLength = 20;\n\t\t}\n\t\t// for (var i = 0; i < tweetsLength; i++) {\n\n\t\t// console.log(\n\t\t// \t`\\n`,\n\t\t// \t`Tweet`, (i + 1), `created on: ${tweets[i].created_at}`,\n\t\t// \t`\\n`,\n\t\t// \t`\\\"${tweets[i].text}\\\"`,\n\t\t// \t`\\n`\n\t\t// );\n\t\t// }\n\n\t\tfor (var i = 0; i < tweetsLength; i++) {\n\t\t\tvar tweetCount = (i + 1);\n\t\t\tvar tweetResults = \n`\\nTweet ${tweetCount} created on: ${tweets[i].created_at}\n\\\"${tweets[i].text}\\\"\\n`;\n\n\t\t\tconsole.log(tweetResults);\n\t\t\tappendFile(tweetResults);\n\n\t\t}\n\n\n\n\n\t});\n}", "title": "" }, { "docid": "575f6b4ba282396d777076c95322efeb", "score": "0.581424", "text": "function myTweets() {\n\tvar params = {screen_name: 'Esther28282058'};\n\n\tclient.get('statuses/user_timeline', params, function(error, tweets, response) {\n \t\tif (!error) {\n \t\tconsole.log(tweets[0].text);\n \t\tconsole.log(tweets[1].text);\n \t\t}else {\n \t\t\tconsole.log(error);\n \t\t}\n\t});\n}", "title": "" }, { "docid": "98987d31d6d522c6b8283ae9da467413", "score": "0.58142203", "text": "function myTweets() {\n\tclient.get(\"statuses/user_timeline\", params, function(error, tweets, response) {\n\n\t\tconsole.log(error);\n\n\t\tif (!error && response.statusCode == 200) {\n\n\t\tfor (var i = 0; i < tweets.length; i++) {\n\t\t\tconsole.log(tweets[i].text);\t\t\t\n\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1e67ed8f1ba087063bc335735514ff21", "score": "0.58079207", "text": "function getYouTubeVideo(q, i) {\n\n $.get(`https://www.googleapis.com/youtube/v3/search`,\n {\n part: 'snippet, id',\n q: q,\n maxResults: 1,\n type: 'video',\n key: yt_api_key\n\n }, function (data) {\n\n // If the total results are 0, appends a gif of TV static, otherwise it appends the video\n\n if (data.pageInfo.totalResults === 0) {\n\n $(\"#video-title-\" + i).text(\"Not Found\");\n $(\"<img>\").attr(\"src\", \"assets/images/static.gif\")\n .appendTo(\"#video-\" + i);\n\n }\n else {\n\n let link = $(\"<a>\").attr(\"href\", \"https://www.youtube.com/results?search_query=\" + q)\n .attr(\"target\", \"_blank\")\n .text(\"Watch More →\");\n\n $(\"#video-title-\" + i).empty();\n $(\"#video-title-\" + i).append(link);\n $(\"<iframe>\").attr(\"src\", \"https://www.youtube.com/embed/\" + data.items[0].id.videoId)\n .attr(\"frameborder\", \"0\").appendTo(\"#video-\" + i);\n\n }\n });\n\n}", "title": "" }, { "docid": "6810832867c96a6abcd1ac3cd10f744f", "score": "0.57823586", "text": "playLiveStream(data) {\n console.log('Live streaming...');\n \n // Create an instance of the Player object\n var player = new Player();\n \n // Create an instance of MediaItem with the URL provided in the data\n var video = new MediaItem('video', data.videoURL);\n \n // Set title, subtitle and description\n video.title = data.title;\n video.subtitle = data.subtitle;\n video.description = data.description;\n \n // Create an instance of the Playlist object and push the MediaItem\n player.playlist = new Playlist();\n player.playlist.push(video);\n \n \n let options = {\n 'accountCode': 'haivision',\n 'content.resource': data.videoURL,\n 'content.title': 'Eastview Live Stream',\n 'content.isLive': true,\n 'background.enabled': false,\n 'extraparam.1': '2703737825',\n };\n \n youbora.pluginInstance = new youbora.Plugin(options, new youbora.adapters.AppleTV3());\n youbora.pluginInstance.getAdapter().begin();\n \n youbora.pluginInstance.getAdapter().fireStart()\n \n // Play the video\n player.play();\n }", "title": "" }, { "docid": "5645714206ab7d806850ecc9acecb5d9", "score": "0.57530904", "text": "function getTweets() {\n var params = { screen_name: 'Elisa_Penn18', count: 20 };\n\n client.get(\"statuses/user_timeline\", params, function (error, tweets, response) {\n if (error) throw error;\n for (var i = 0; i < tweets.length; i++) {\n console.log(moment(tweets[i].created_at).format(\"dddd, MMMM DD, YYYY @ hh:mma\") + \": \" + tweets[i].text);\n };\n });\n}", "title": "" }, { "docid": "561c6dcdfe3e8e117b98b5816ff45253", "score": "0.57493854", "text": "function tweetLatest() {\n T.get('search/tweets', music, function (error, data) {\n console.log(error, data);\n\t if (!error) {\n\t\tvar tweetText = emphasizeArtist(data.statuses[0].text);\n \n\t\tT.post('statuses/update', {status: tweetText}, function (error, response) {\n\t\t\tif (response) {\n\t\t\t\tconsole.log('Success! Your bot tweeted!')\n\t\t\t}\n\t\t\tif (error) {\n\t\t\t\tconsole.log('There was an error with Twitter:', error);\n\t\t\t}\n\t\t})\n\t }\n\t // Catch errors if the search could not find a tweet under the hastag\n\t else {\n\t \tconsole.log('There was an error with your hashtag search:', error);\n\t }\n\t});\n \n \n}", "title": "" }, { "docid": "6a185aed2f4bc54b38f7aed81f650a69", "score": "0.57413834", "text": "function playTwitter(){\n\tvar divs = document.getElementById('bodyContent');\n\tif(divs == null) return false;\n\tdivs = divs.getElementsByTagName('div');\n\tvar twobjcode = '';\n\tif (window.ActiveXObject){ // IE\n\t\ttwobjcode += '<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"{width}\" height=\"{height}\" id=\"TwitterWidget\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0\" align=\"middle\">';\n\t}else{\n\t\ttwobjcode += '<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"{width}\" height=\"{height}\" id=\"TwitterWidget\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0\" align=\"middle\">';\n\t}\n\ttwobjcode += '<param name=\"movie\" value=\"http://static.twitter.com/flash/widgets/profile/TwitterWidget.swf\" /><param value=\"always\" name=\"allowScriptAccess\"><param value=\"false\" name=\"allowFullScreen\"><param value=\"high\" name=\"quality\"><param value=\"#000000\" name=\"bgcolor\"><param value=\"userID=36320432&styleURL=http://static.twitter.com/flash/widgets/profile/revo.xml\" name=\"flashvars\"><embed src=\"http://static.twitter.com/flash/widgets/profile/TwitterWidget.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"{width}\" height=\"{height}\" name=\"TwitterWidget\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" FlashVars=\"userID=36320432&styleURL=http://static.twitter.com/flash/widgets/profile/revo.xml\"/></object>';\n\tfor (var i = 0; i < divs.length; i++){\n\t\tif ((' Twitter ').indexOf(' '+divs[i].className+' ') != -1){\n\t\t\ttry{\n\t\t\t\tvar twdiv = divs[i];\n\t\t\t\tvar width = twdiv.style.width.replace('px','');\n\t\t\t\tvar height = twdiv.style.width.replace('px','');\n\t\t\t\tvar src = twdiv.getElementsByTagName('a')[0].href;\n var movie = twobjcode.replace(/\\{width\\}/g,width).replace(/\\{height\\}/g,height).replace(/\\{src\\}/g,src);\n\t\t\t\ttwdiv.innerHTML = movie;\n\t\t\t}catch(e){ window._customTWerror = e; }\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7cc8040a75fce409c33f9099f25d9d6b", "score": "0.5740352", "text": "function parseVideoUrl(data) {\n data.match(/https?:\\/\\/(player.|www.)?(vimeo\\.com|youtu(be\\.com|\\.be))\\/(video\\/|embed\\/|watch\\?v=)?([A-Za-z0-9._%-]*)(\\&\\S+)?/);\n var match = {\n embed: null,\n url: RegExp.$2,\n id: RegExp.$5\n }\n if (match.url == 'youtube.com' || match.url == 'youtu.be') {\n $.ajax({\n url: 'https://gdata.youtube.com/feeds/api/videos/' + match.id + '?v=2',\n timeout: 5000,\n success: function(){\n match.embed = 'https://youtube.com/embed/' + match.id;\n var message = '<iframe src=\"' + match.embed + '\" width=\"360\" height=\"200\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';\n submitChat(message, true);\n },\n error: function() {\n alert('That is not a valid YouTube url');\n }\n });\n }\n else if (match.url == 'vimeo.com') {\n $.ajax({\n url: 'https://vimeo.com/api/v2/video/' + match.id + '.json',\n timeout: 5000,\n dataType: 'jsonp',\n success: function(){\n match.embed = 'https://player.vimeo.com/video/' + match.id;\n var message = '<iframe src=\"' + match.embed + '\" width=\"360\" height=\"200\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';\n submitChat(message, html);\n },\n error: function() { \n alert('That is not a valid YouTube url');\n }\n });\n }\n else {\n alert('That is not a valid YouTube or Vimeo url');\n }\n }", "title": "" }, { "docid": "9e4839af90f511525e874689245bc3d4", "score": "0.5732652", "text": "function sendVideoAnalytics() {\n let videoDuration = player.getDuration();\n let timeWatched = player.getCurrentTime();\n\n\n let videoId = currentVideoId; // Video id for analytics\n\n //Searching the title from what card was video\n let fullLink = `https://www.youtube.com/watch?v=${videoId}`;\n let neededCard = document.querySelector(`a[href='${fullLink}'`).parentNode;\n let cardTitle = neededCard.querySelector('h3').textContent;\n\n let percentageOfWatch = Math.round(timeWatched/videoDuration * 100);\n\n if (percentageOfWatch >= 0 && percentageOfWatch < 25) { // Rounding the percentageOfWatch\n percentageOfWatch = 0;\n } else if (percentageOfWatch >= 25 && percentageOfWatch < 50) {\n percentageOfWatch = 25;\n } else if (percentageOfWatch >=50 && percentageOfWatch < 75) {\n percentageOfWatch = 50;\n } else if (percentageOfWatch >= 75 && percentageOfWatch < 95) {\n percentageOfWatch = 75;\n } else {\n percentageOfWatch = 100;\n }\n\n console.info(`[${cardTitle}] - [${videoId}] - [${percentageOfWatch}]`);\n}", "title": "" }, { "docid": "7d8d0715d029a8b1918a93e317c758cd", "score": "0.57291377", "text": "function twitter(){\n\t\tconsole.log(\"\\n\\nMost recent Tweets\\n\");\n\n\t\tlet parameters = {screen_name: '@JakeBeaube'};\n\t\tclient.get('statuses/user_timeline', parameters, function(error, tweets, response){\n\t\t\tif (!error) {\n\t\t\t\tlet totalTweets = tweets.length\n\t\t\t\tif (totalTweets>20){\n\t\t\t\ttotalTweets=20;\n\t\t\t\t}\n\t\t\t\tfor (i=0;i<totalTweets;++i){\n\t\t\t\t\tconsole.log(tweets[i].created_at+\": \"+tweets[i].text);\n\n\t\t\t\t}\n\t\t\t\t\tconsole.log(\"\\n\");\n\t\t\t}else{console.log(error)}\n\n\n\n \n\t});\n\t}", "title": "" }, { "docid": "77caa12b0c31dc1cae1d89073036e29e", "score": "0.57284427", "text": "function getVideolist() {\n document.getElementById(\"bgvid\").setAttribute(\"hidden\", \"\");\n tooltip(\"Loading...\", \"bottom: 50%; left: 50%; bottom: calc(50% - 16.5px); left: calc(50% - 46.5px); null\");\n\n $.ajaxSetup({async: false});\n $.getJSON(\"api/list.php?eggs&shuffle&first=\" + filename() + \".webm\", function(json) {\n video_obj = json;\n vNum = 1;\n });\n $.ajaxSetup({async: true});\n\n tooltip();\n document.getElementById(\"bgvid\").removeAttribute(\"hidden\");\n}", "title": "" }, { "docid": "b204399a7c3b6541aaf4bbae85f16a80", "score": "0.5719232", "text": "function twitCall() {\nclient.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n for ( i in tweets) {\n console.log(\"Tweet: \"+tweets[i].text+\"\\nCreated at: \"+tweets[i].created_at+\"\\n\\n\");\n }\n }\n});\n}", "title": "" }, { "docid": "8c0be7f282ca8b2d5e97df2d8832cd6b", "score": "0.5713098", "text": "sendVideo(chatId, video, extras) {\n return this.callApi('sendVideo', this.buildQuery({\n chat_id: chatId,\n video: videos,\n extra: extras\n }));\n }", "title": "" }, { "docid": "3336a4591a8484336482cd89dd522f2f", "score": "0.5711317", "text": "function videosCall (){\n\n // API Call STEP #1: You Tube Data API's \"Videos List.List\" API Call Used To Get The VideoId\n var url = 'https://www.googleapis.com/youtube/v3/videos';\n\n url += '?' + $.param({\n 'part': 'snippet,contentDetails',\n 'key': 'AIzaSyBosREDOI_AxtNcHkvK--los4AS_CbUnhM',\n 'id': 'XKu_SEDAykw' \n });\n\n $.ajax({\n type: \"GET\",\n url: url\n }).done(function(result) {\n \n // Console Log The Whole Response\n console.log(\"The whole video Api Call Result/Response >>>>>>>>>>>>>>\");\n console.log(result);\n\n\n // Console Log The Video Title AND The VideoId\n console.log(\"videoId from the video Api Call Result/Response >>>>>>>>>>>>>>\");\n console.log(result.items[0].snippet.title + \":\" + result.items[0].id); \n\n // The VideoId Retrieved From The JSON Response\n var videoId1 = result.items[0].id;\n\n // Creates An Iframe For The video\n var video1HTML = '<li><iframe width=\"640\" height=\"390\" src=\"https://www.youtube.com/embed/' + videoId1 + '\" frameborder=\"0\" allowfullscreen></iframe></li><br/>';\n\n // Takes The Iframe We Created An Renders It To The HMTL Page \n var finalHTML = video1HTML;\n\n $('#careerresourcesvideos').append(finalHTML);\n \n }); \n }", "title": "" }, { "docid": "3a33e1679c1d60ceb61090dbcc3ff8c4", "score": "0.5711247", "text": "function myTweets() {\n // var params = process.argv[3];\n var params = {vmjgr: 'nodejs'};\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n for (i = 0; i < tweets.length; i++){\n console.log(tweets[i].text); \n }\n }\n else {\n console.log(error);\n }\n })\n}", "title": "" }, { "docid": "a90925adacd8a6c0f9368cd6ad31818d", "score": "0.57015884", "text": "function onYouTubeIframeAPIReady() {\n var videoElems = document.querySelectorAll('.wl_videoElem.video-youtube');\n if (videoElems.length != 0) {\n //console.log(videoElems.length);\n //console.log('youtube video init');\n for(var i=0;i<videoElems.length;i++){\n NS.WLFUN.videoLoad(videoElems[i]);\n }\n }\n}", "title": "" }, { "docid": "8743d8b97425d93fe600574dae452a38", "score": "0.57002646", "text": "function download(dl){\r\n url='https://www.youtube.com/watch?v='+vidarr[dl];\r\n \r\n var uploader =new streamingS3(\r\n \r\n ytdl(url, { filter: (format) => format.container === 'mp4' })\r\n , {accessKeyId: s3accesskeyid, secretAccessKey: secretkey}, \r\n {\r\n Bucket: bucketname,\r\n Key: channelId+\"-\"+vidarr[dl],\r\n ContentType: 'video/mp4',\r\n },\r\n (err, res, stats) => {\r\n if (err) console.log(err);\r\n sql=\"INSERT INTO videoList (videoId,downloadLink) VALUES (\"+\"'\"+vidarr[dl]+\"','s3://videobucketforshutapp/\"+channelId+\"-11\"+vidarr[dl]+\"')\";\r\n con.query(sql, function (err, result) {\r\n //console.log(sql);\r\n if (err) throw err;\r\n count2++;\r\n // update metadata after the last video is downloaded \r\n if (count==count2){\r\n metadataupdate();\r\n }\r\n console.log('success', stats);\r\n }\r\n );\r\n }\r\n )}", "title": "" }, { "docid": "3a6d5f345bea9fc0da5f0a9866259e97", "score": "0.56952906", "text": "function retweetLatest() {\n\tT.get('search/tweets', music, function (error, data) {\n\t console.log(error, data);\n\t if (!error) {\n\t \t// Finds the ID of the latest tweet\n\t\tvar retweetId = data.statuses[0].id_str;\n \n\t\t// Retweets other user's onto our bot's stream\n\t\tT.post('statuses/retweet/' + retweetId, { }, function (error, response) {\n\t\t\tif (response) {\n\t\t\t\tconsole.log('Success! Check your bot, it should have retweeted something.')\n\t\t\t}\n\t\t\t// Prints out errors related to trying to post on Twitter\n\t\t\tif (error) {\n\t\t\t\tconsole.log('There was an error with Twitter:', error)\n\t\t\t}\n\t\t})\n\t }\n\t // Print out any errors that might occur with the hashtag search\n\t else {\n\t \tconsole.log('There was an error with your hashtag search:', error);\n\t }\n\t});\n}", "title": "" }, { "docid": "b599ec951755e1b61452e72e068ced74", "score": "0.5693077", "text": "function submitVideoData(){\n // submits video data\n self.metaService.createVideo(self.draftWallEntry.wallentry, url)\n .addCallback(function(data) {\n // fetch meta data from id\n self.metaService.fetch(data.id)\n .addCallback(function(data) {\n if(data.meta.length > 0){\n promise.emitSuccess(self.metaService.normalizeVideoData(data), url);\n } else {\n promise.emitError(message, status);\n }\n }).addErrback(function(message, status) {\n // render error\n promise.emitError(message, status);\n });\n }).addErrback(function(message, status) {\n // render error\n promise.emitError(message, status);\n });\n }", "title": "" }, { "docid": "834e0bf584bf2b6b5c0a8507243fbb25", "score": "0.56921023", "text": "function runTwitter() {\n var twitter = new Twitter(keys.twitter);\n console.log(twitter);\n \n var params = {\n\t\tscreen_name: \"@tweeterfield\",\n\t\tcount: 20\n\t};\n \n twitter.get('statuses/user_timeline', params, function(error, tweets, response){\n\t\tif (!error) {\n\t for (i=0; i < tweets.length; i++) {\n\t var returnedData = ('Number: ' + (i+1) + '\\n' + tweets[i].created_at + '\\n' + tweets[i].text + '\\n');\n\t console.log(returnedData);\n\t console.log(\"-------------------------\");\n\t }\n\t };\n\t});\n \n}//end of runTwitter function", "title": "" }, { "docid": "dd24e8750c68aeb72fc6aa168b927263", "score": "0.5685224", "text": "function get_video_data(id) {\n\t\tvar details = {\n\t\t\turl: 'http://gdata.youtube.com/feeds/api/videos/' + id + '?v=2&alt=jsonc',\n\t\t\tdataType: 'jsonp'\n\t\t};\n\n\t\treturn details;\n\t}", "title": "" }, { "docid": "07174240446432112f229553b7a443a1", "score": "0.5663509", "text": "function chooseVideo(){\n player.loadVideoById(data.id.videoId);\n window.postMessage({videoId:data.id.videoId},\"*\");\n }", "title": "" }, { "docid": "f4db6bd5ca43241fd92d3bbc47c7a958", "score": "0.56616473", "text": "function myTweets() {\n // twitter parameter to make get request\n var params = {\n screen_name: 'mz1387'\n };\n // get request. console log response properties\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n for (var i = 0; i < tweets.length; i++) {\n console.log(\"---------------------\");\n console.log(\"Location: \" + tweets[i].user.location);\n console.log(\"Created: \" + tweets[i].created_at);\n console.log(\"Message: \" + tweets[i].text);\n console.log(\"---------------------\");\n }\n }\n });\n}", "title": "" }, { "docid": "76470c62c9fbda0482b0bb6958ad369e", "score": "0.5660225", "text": "function runTwitter() {\n client.get('statuses/user_timeline', params, function (error, tweets, response) {\n if (!error) {\n // Log tweet data\n for (var i = 0; i < tweets.length; i++) {\n tweetNumber++\n console.log('------------------------------')\n console.log(tweetNumber + '. ' + tweets[i].created_at + '\\n' + tweets[i].text);\n console.log('------------------------------')\n }\n }\n });\n}", "title": "" }, { "docid": "759faaa7c554082b6bda15ed81ec3b57", "score": "0.5655988", "text": "function sendMyPlaylists() {\n var playlists = [];\n $(\"#playlists\").children(\"a\").each(function() {\n playlists.push({ title: $.trim($(this).find(\".tooltip\").text()), titleLink: getLink($(this)) });\n });\n post(\"player-navigationList\", { type: \"playlistsList\", link: \"wmp\", list: playlists, empty: !playlists.length });\n }", "title": "" }, { "docid": "6ad10191b66e47a79a2dac61f0962651", "score": "0.5651745", "text": "function getLatestVideo(callback, req, res) {\n var service = google.youtube('v3');\n\n channel = req.query.search;\n update_widget(req.query.id_bdd, channel);\n service.search.list({\n key: key.youtube.token,\n part: 'snippet',\n channelId: channel,\n maxResults : \"10\",\n order: \"date\",\n type: \"video\"\n }, function (err, response) {\n if (err) {\n console.log('The API returned an error:widget ' + err);\n return;\n }\n var videos = response.data.items;\n if (videos.length == 0) {\n console.log('No channel found.');\n } else {\n callback(videos, req, res)\n }\n });\n}", "title": "" }, { "docid": "69c0307fa6599c4843d451dda64bec47", "score": "0.5648155", "text": "function execute() {\n return gapi.client.youtube.search.list({\n \"part\": \"snippet\",\n \"channelId\": \"UC4rZq6S7sV6gljt_4vjdXIw\",\n \"maxResults\": 1,\n \"order\": \"date\"\n })\n .then(function(response) {\n // Handle the results here (response.result has the parsed body).\n console.log(\"Response\", response);\n var uploadDate = JSON.parse(response.body).items[0].snippet.publishedAt\n var lastVideo = JSON.parse(response.body).items[0].id.videoId\n var parsed = Date.parse(uploadDate)\n var now = Date.now()\n var difference = now - parsed\n var days = String(Math.round(difference / 1000 / 60 / 60 / 24) + \" Days\")\n document.getElementById(\"date\").innerHTML = days\n document.getElementById(\"video\").innerHTML = `<iframe width=\\\"560\\\" height=\\\"315\\\" src=\\\"https://www.youtube.com/embed/${lastVideo}\\\" frameborder=\\\"0\\\" allow=\\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\\" allowfullscreen></iframe>`\n },\n function(err) {\n console.error(\"Execute error\", err);\n });\n}", "title": "" }, { "docid": "5ea0e5679eb631f727c0c1922e46577d", "score": "0.5646761", "text": "function youtubeSearch(q) {\n $.get(\n \"https://www.googleapis.com/youtube/v3/search\", {\n part: \"snippet, id\",\n q: q,\n type: \"video\",\n maxResults: vidResults,\n key: \"AIzaSyAGv4U7CiZsMwdmwLWnM6G4-Lzrx-97B2o\"\n },\n function(data) {\n var output;\n $.each(data.items, function(i, item) {\n console.log(item);\n var videoId = item.id.videoId;\n\n output = '<li><iframe height=\"' + vidHeight + '\" width=\"' + vidWidth + '\" src=\\\"https://www.youtube.com/embed/' + videoId + '\\\"></li>';\n\n $(\"#youTube\").html(output);\n\n });\n }\n );\n}", "title": "" }, { "docid": "7b07bda950ed2d15be072746753cbe66", "score": "0.56459534", "text": "function videoStatus(video) {\n\t \t//console.log(video);\n\t \tlet videoId = video.videoId;\n\t \tlet iframe = video.assets.iframe;\n\t \tlet playable = false;\n\t \tlet status = client.videos.getStatus(videoId);\n\t status.then(function(videoStats){\n\t \t//console.log('status', status);\n\t\t\t//we have the video uploaded, now we need to wait for encoding to occur\n\t \t\tplayable = videoStats.encoding.playable;\n\t \t\tconsole.log('video playable?',videoStats.encoding.playable, playable);\n\t \t\tif (playable){\n\t \t\t\t//video is ready to be played\n\t\t\t\t//and we can get the mp4 url now as well\n\t \t\t\tconsole.log(\"ready to play the video\");\n\t \t\t\tplayReadyTimer = Date.now();\n\t\t\t\tlet uploadSeconds = (uploadCompleteTimer-startUploadTimer)/1000;\n\t\t\t\tlet processSeconds = (playReadyTimer - uploadCompleteTimer)/1000;\n\t\t\t\tconsole.log(\"video uploaded in: \", uploadSeconds);\n\t\t\t\tconsole.log(\"video processed in: \", processSeconds);\n\t \t\t\tconsole.log(iframe);\n\t\t //now we can get the MP4 url, and send the email and post the response\n\t\t\t\tlet videoMp4 = client.videos.get(videoId);\n\t\t\t\tvideoMp4.then(function(mp4Stats) {\n\t\t \t \t\tconsole.log(\"videomp4status\",mp4Stats);\n\t\t \t\t\tmp4 = mp4Stats.assets.mp4;\n\t\t \t\t\tconsole.log(\"mp4 url\", mp4);\n\t\t\t\t\tif(useProduction){\n\t\t\t\t\t\t//if user submitted an email - we are in prod - and can email the link to the videos.\n\t\t\t\t\t\tintercomIntegration(fields.email,player, mp4,mp4Support,uploadSeconds,processSeconds);\n\t\t\t\t\t}\n\t \t\t\t\treturn res.render('video', {iframe, player, uploadSeconds,processSeconds});\n\t\t \t \t}); \t\n\t \t\t}else{\n\t \t\t\t//not ready so check again in 2 seconds.\n\t \t\t\tconsole.log(\"not ready yet\" );\n\t \t\t\tsetTimeout(videoStatus(video),2000);\n\t \t\t}\n\n\t\t\t\n\t\t\t\n\t \t}).catch(function(error) {\n\t \t console.error(error);\n\t \t});;\t\n\t }", "title": "" }, { "docid": "b2bde6ccdc9d10ff6aa3bcc2514e8225", "score": "0.56453824", "text": "function loadVideoOfYoutube(id, callBack) {\n var url = 'https://www.googleapis.com/youtube/v3/videos?part=snippet&id='+ id + '&key=AIzaSyBStdhzhkK8ne1tqsUz4A8j9axNi0NqE_M';\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState === 4) {\n if (this.status === 200) {\n var response = JSON.parse(this.responseText).items[0];\n callBack.success(response);\n }\n else {\n response = JSON.parse(this.responseText);\n toastr[\"error\"](\"Xảy ra lỗi khi load video, vui lòng kiểm inspect log và báo cho chúng tôi\");\n console.log(response);\n }\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "title": "" }, { "docid": "dd9c2d941e0d97606ddbf212c555084f", "score": "0.5644754", "text": "function Plugin() {\n var youtubeBot = new Bot(\"Abra\", \"#4d004c\");\n var memory = new Memory(\"youtube\");\n if (memory.enabled === undefined) {\n memory.enabled = true;\n }\n if (memory.ignoreArray === undefined) {\n memory.ignoreArray = [];\n }\n\n this.afterChannelMessage = function (fullMessage, channelId, isHtml) {\n if (!isHtml) {\n return;\n }\n if (!memory.enabled) {\n return;\n }\n var srcMessage = fullMessage.substr(fullMessage.indexOf(\":\") + 2),\n channelName = client.channelName(channelId);\n if (isOffcialChannel(channelName) && client.auth(client.id(client.ownName())) === 0) {\n return;\n }\n if ((srcMessage.indexOf(\"youtube.com\") > -1 && srcMessage.indexOf(\"watch?v=\") > -1) || srcMessage.indexOf(\"youtu.be/\") > -1) {\n var x, videoId;\n for (x = 0; x < memory.ignoreArray.length; x++) {\n if (isInChannel(client.id(memory.ignoreArray[x]), channelId)) {\n youtubeBot.sendBotHtml(memory.ignoreArray[x] + \" is in \" + channelName + \". YouTube stats cancelled.\", channelId);\n return;\n }\n }\n // PC LINK\n if (srcMessage.indexOf(\"youtube.com\") > -1) {\n videoId = srcMessage.substr(srcMessage.indexOf(\"watch?v=\") + 8, 11).trim();\n }\n // MOBILE LINK\n if (srcMessage.indexOf(\"youtu.be/\") > -1) {\n videoId = srcMessage.substr(srcMessage.indexOf(\"youtu.be/\") + 9, 11).trim();\n }\n try {\n sys.webCall(\"http://crystal.moe/youtube?id=\" + videoId, function (response) {\n var x = JSON.parse(response).items[0],\n title = x.snippet.localized.title,\n uploader = x.snippet.channelTitle,\n comments = x.statistics.commentCount,\n duration = x.contentDetails.duration\n .toLowerCase().substr(2).replace(\"h\", \"h \").replace(\"m\", \"m \").replace(\"s\", \"s\"),\n views = x.statistics.viewCount,\n likes = parseInt(x.statistics.likeCount, 10),\n dislikes = parseInt(x.statistics.dislikeCount, 10),\n ratio = Math.round(likes / (likes + dislikes) * 100);\n youtubeBot.sendBotMessage(channelId, \"Title: \" + title + \", Uploader: \" + uploader + \", Comments: \" + comments + \", Duration: \" + duration + \", Views: \" + views + \", Likes: \" + ratio + \"%\");\n });\n } catch (error) {\n youtubeBot.sendBotMessage(channelId, \"YouTube video data load failed.\");\n }\n }\n return;\n };\n this.help = {\n header: \"YouTube\",\n name: \"youtube\",\n privateArray: [\n \"youtube [on/off]: Enable/Disables YouTube stats.\",\n \"youtubeclear: Clear all ignores\",\n \"youtubeignore[off] [user]: Add/Remove user to ignore.\",\n \"youtubeignores: Shows users not to send bot message if in channel.\"\n ],\n publicArray: []\n };\n this.privateCommands = function (command, commandData, channelName, channelId) {\n if (command === \"youtube\") {\n if (commandData === \"on\") {\n memory.enabled = true;\n sendBotHtml(\"YouTube stats <b>on</b>\");\n memory.save();\n return;\n }\n if (commandData === \"off\") {\n memory.enabled = false;\n sendBotHtml(\"YouTube stats <b>off</b>\");\n memory.save();\n return;\n }\n sendBotHtml(\"YouTube stats currently: <b>\" + (memory.enabled ? \"on\" : \"off\") + \"</b>\");\n return;\n }\n if (command === \"youtubeclear\") {\n sendBotHtml(\"All YouTube ignores cleared.\");\n memory.ignoreArray = [];\n memory.save();\n return;\n }\n if (command === \"youtubeignore\") {\n if (!commandData) {\n sendBotHtml(\"Enter a user to YouTube ignore.\");\n return;\n }\n if (memory.ignoreArray.add(commandData)) {\n sendBotHtml(\"<b>\" + commandData + \"</b> added to youtube ignore.\");\n } else {\n sendBotHtml(\"<b>\" + commandData + \"</b> already youtube ignored.\");\n }\n memory.save();\n return;\n }\n if (command === \"youtubeignoreoff\") {\n if (!commandData) {\n sendBotHtml(\"Enter a user to YouTube ignore off.\");\n return;\n }\n if (memory.ignoreArray.remove(commandData)) {\n sendBotHtml(\"<b>\" + commandData + \"</b> removed from youtube ignore.\");\n } else {\n sendBotHtml(\"<b>\" + commandData + \"</b> isn't currently youtube ignored.\");\n }\n memory.save();\n\t\t\treturn;\n }\n if (command === \"youtubeignores\") {\n if (memory.ignoreArray.length === 0) {\n sendBotHtml(\"No YouTube stat ignores.\");\n return;\n }\n sendBotHtml(\"YouTube users ignored: \" + memory.ignoreArray.sort().join(\", \"));\n return;\n }\n return false;\n };\n}", "title": "" }, { "docid": "97e52b3711e957b966338121a63fd038", "score": "0.5642227", "text": "async function parseYtUrl(url, message) {\n var songs = [];\n var regExp = /^.*(youtu.be\\/|list=)([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n var plid;\n\n if (match) {\n try {\n plid = await ytpl.getPlaylistID(url);\n } catch (err) {\n message.channel.send(`${err}`)\n return ;\n }\n const playlist = await ytpl(plid);\n\n playlist.items.forEach(songInfo => {\n var song = {\n title: songInfo.title,\n url: songInfo.url,\n };\n songs.push(song);\n });\n } else {\n songInfo = await ytdl.getInfo(url);\n var song = {\n title: songInfo.videoDetails.title,\n url: songInfo.videoDetails.video_url,\n };\n songs.push(song);\n }\n return songs\n}", "title": "" }, { "docid": "2995b6e2f3bd6cb2be1a751d71b43caa", "score": "0.5638441", "text": "function getTweets() {\n // var to pull in API key from keys file\n var client = new twitter(keys.twitter);\n\n var params = {screen_name: 'backrowcoders', count: 20};\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n for (var i = 0; i < tweets.length; i++) {\n console.log(\" \");\n console.log(\"@backrowcoders:\")\n console.log(tweets[i].text);\n console.log(\" \");\n console.log(tweets[i].created_at);\n console.log(\"\\n-----------------------------------------------\\n\");\n } \n });\n}", "title": "" }, { "docid": "473bdda8ef66e303e6038a4ec955f70b", "score": "0.5637958", "text": "function getTweets() {\n\n var client = new twitter({\n consumer_key: twitterKeys.consumer_key,\n consumer_secret: twitterKeys.consumer_secret,\n access_token_key: twitterKeys.access_token_key,\n access_token_secret: twitterKeys.access_token_secret\n });\n\n\n\n var params = {screen_name: 'jutahfbi', count: 20};\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (error) {\n console.log(error)\n } else if (!error) {\n for (i=0; i<tweets.length; i++) {\n var tweetData = tweets[i].created_at + \": \" + tweets[i].text;\n console.log(tweetData);\n }\n }\n });\n}", "title": "" }, { "docid": "c8d52178e56f18a8c62492724c0a14af", "score": "0.5634777", "text": "function activate_media(){\n var videoCount = 0;\n $(\"#main-container .comment_bodies a\").filter(function(){\n // image url\n var url = $(this).attr(\"href\");\n if( url.match(imgStr)) {\n $(this).replaceWith($(\"<img>\").attr(\"src\",url).addClass(\"comment_img\"));\n }\n // youtube url\n var yt_match = url.match(youtubeStr); // dessemble youtube url into fields\n if( yt_match && yt_match[7].length==11 ) {\n $(this).replaceWith(\"<div class='youtube-iframe'><a id='video\" + videoCount + \"'></a></div>\");\n \n if (iframesReady) {\n new YT.Player(\"video\"+videoCount, {\n width: '100%',\n videoId: yt_match[7]\n });\n }\n else {\n yt_queue.push( yt_match[7] );\n }\n videoCount++;\n }\n });\n}", "title": "" }, { "docid": "5279c20e0e62323e075ca75a46caabca", "score": "0.56278074", "text": "function uploaded (err, data, reponse){ //this is where I will tweet! \n\t\t\t\tvar id = data.media_id_string;\n\t\t\t\tvar tweet = {\n\t\t\t\t\tstatus: 'cross',\n\t\t\t\t\tmedia_ids: [id] //you can have more than one image ID linked with a tweet \n\t\t\t\t}\n\n\t\t\t\tT.post ('statuses/update', tweet, tweeted);\n\t\t\t\t\n\t\t}", "title": "" }, { "docid": "184865c3f2297466c55f358178f40fbd", "score": "0.5622314", "text": "function getMediaData(callback) {\n var httpRequest = new XMLHttpRequest(),\n responseData,\n parsedData,\n requestURL =\n \"https://edge.api.brightcove.com/playback/v1/accounts/\" +\n account_id +\n \"/playlists/\" +\n playlist_id +\n \"?limit=100\";\n // response handler\n getResponse = function() {\n try {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status >= 200 && httpRequest.status < 300) {\n responseData = httpRequest.responseText;\n parsedData = JSON.parse(responseData);\n videoData = parsedData.videos;\n feedname = parsedData.name;\n if (mrssOutput) {\n callback();\n } else {\n callback();\n }\n } else {\n alert(\n \"There was a problem with the request. Request returned \" +\n httpRequest.status\n );\n }\n }\n } catch (e) {\n alert(\"Caught Exception: \" + e);\n }\n };\n // set response handler\n httpRequest.onreadystatechange = getResponse;\n // open the request\n httpRequest.open(\"GET\", requestURL);\n // set headers\n httpRequest.setRequestHeader(\"Accept\", \"application/json;pk=\" + policyKey);\n // open and send request\n httpRequest.send();\n }", "title": "" }, { "docid": "2e2820993c0f65e20ab13f11f2e7da43", "score": "0.5610762", "text": "function twitterFunc() {\n\n\t//find my twitter handle and put in a variable\n\tvar params = {screen_name: \"the_millest\"};\n\t\t\n\t//access object with twitter keys and get entries from timeline\n\tgetMyTweets.get(\"statuses/user_timeline\", params, function(error, tweets, response) {\n\t\tif (!error) {\n\t\t//loop through response and pull only two pieces of info. stop at 20.\n\t\t\tfor (var t = 0; t < 20; t++) {\n\t\t\t\tconsole.log(\"\");\n\t\t\t \tconsole.log(tweets[t].created_at);\n\t\t\t \tconsole.log(tweets[t].text);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "86b636cd2c8a57dc8a0ea6cd87ffb0c0", "score": "0.5609932", "text": "function myTweets() {\n\n var params = {\n screen_name: 'KataTheKat1',\n count: 20\n };\n client.get('statuses/user_timeline', params, function (error, tweets, response) {\n if (!error) {\n for (var i = 0; i < tweets.length; i++) {\n console.log(\"---------------------\")\n console.log(tweets[i].created_at);\n console.log(tweets[i].text);\n console.log(\"---------------------\")\n };\n } else {\n console.log(error)\n };\n });\n\n}", "title": "" }, { "docid": "2582bfe9cfecd28accaa5a497f66eea4", "score": "0.5603285", "text": "function internetVideoArchive() {\n // var ivaUrl = 'https://ee.iva-api.com/Movies/1';\n var ivaUrl = 'https://ee.iva-api.com/Videos/GetVideo/1';\n var dt = new Date();\n dt.setMonth(11);\n var stamp = dt.toISOString();\n ;\n // var ivaUrl = 'https://ee.iva-api.com/ExternalIds/ImdbMovie';\n var query = {\n // Skip: 0,\n // Take: 30,\n Format: 'mp4',\n Expires: stamp,\n format: 'json',\n 'subscription-key': '66319ae0cd76409cb63e30a70eaad1c2'\n };\n $.getJSON(ivaUrl, query, function (resp) {\n // console.log('IVA', resp)\n });\n}", "title": "" }, { "docid": "8218a11f7d94c7041823aa16f60febc7", "score": "0.5601765", "text": "function getTweets(){\n\t\tcoreService.getTweets($scope.book.volumeInfo.title).then(function(response){\n\t\t\t$scope.book.tweets = response;\n\t\t});\n\t}", "title": "" }, { "docid": "51a2aabdc2da818e0c22dd67e6775e49", "score": "0.55939007", "text": "function carica_video_popolarita_relativa(){\n var reason = \"Video related by relative popularity\";\n var listOfSuggestedVideo = [];\n var currentVideo = video_info.videoId;\n var info = {}; //json associato ad un singolo video - va caricato con le informazioni id, thumbnail...\n\n let url = \"http://localhost:8000/api/poprel?old=\" + currentVideo + \"&newid=null\";\n $.get(url, function(data) {\n //successo\n let x = 0;\n while(x < data.length){\n info = {};\n info.title = unescape(data[x].current_title);\n info.image = data[x].current_image;\n info.videoId = data[x].id_vid_rec;\n info.reason = reason;\n listOfSuggestedVideo.push(info);\n x=x+1;\n }\n }).fail(function(data) {\n //errore, nessun dato per la canzone corrente\n console.log(\"Errore nella gestione dei video - recommender popolarità relativa: \" + JSON.stringify(data));\n }).then(function(){\n addYouTubeInformationsRefined(listOfSuggestedVideo);\n });\n}", "title": "" }, { "docid": "ce285ff769642c210dd8341a4fe91580", "score": "0.55928224", "text": "function obtenerVideoId(callback){\r\n const nuevaSolicitudGet = require('../utilidades/utilidadesHttp').nuevaSolicitudGet;\r\n let url = 'https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=' +\r\n clavesYoutube['channelId'] +\r\n '&eventType=live&type=video&key=' +\r\n clavesYoutube['apiKey'];\r\n nuevaSolicitudGet(url, (respuestaApiYoutube) => {\r\n try {\r\n let videoId = respuestaApiYoutube['items'][0]['id']['videoId'];\r\n conectarConYoutube(videoId); // Obtengo el videoId del streaming a traves del channelId\r\n callback(videoId);\r\n } catch (e) {\r\n console.log(Color.red('[YOUTUBE] [ERROR] ' + \"No se pudo obtener el videoId del directo\"));\r\n }\r\n });\r\n}", "title": "" }, { "docid": "2c01599ae4f44e65218cdf556de040b5", "score": "0.5586449", "text": "function getTradeLinks(status) {\n if(status) {\n var video = window.location.href.split(\"?v=\")[1], \n apiKey = \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\", \n mResults = 100,\n tlExpression = /(https?:\\/\\/[^\\s]+)/g,\n mURLs = \"\";\n let apiUrl = 'https://www.googleapis.com/youtube/v3/commentThreads?key=' + apiKey \n + '&textFormat=plainText&part=snippet&videoId=' + video \n + '&maxResults=' + mResults;\n fetch(apiUrl).then(res => res.json()) .then((outJSON) => {\n for (var i=0; i < outJSON.items.length; i++) {\n var actlObj = outJSON.items[i],\n tmpCommURL = actlObj.snippet.topLevelComment.snippet.textOriginal.match(tlExpression);\n for (comm in tmpCommURL) {\n if(tmpCommURL[comm].startsWith(\"https://steamcommunity.com/tradeoffer/new/?partner=\")) {\n mURLs+=(tmpCommURL[comm]+\"\\n\");\n }\n }\n } saveTLinksFile(\"tlinks.txt\",mURLs.substring(0, mURLs.length-1));\n }).catch(err => { console.log(err); });\n browser.storage.local.remove({ getTLinks });\n }\n}", "title": "" }, { "docid": "1814438ea7ea2bd9942a8d399d54b8e7", "score": "0.5583423", "text": "function TwitterFeed() {\n\t\t\n\t\tif ($('#twitter-feed').length > 0 ){\n\t\t\t$('#twitter-feed').tweet({\n\t\t\t\tusername: 'envato',\n\t\t\t\tjoin_text: 'auto',\n\t\t\t\tavatar_size: 0,\n\t\t\t\tcount: 3\n\t\t\t});\n\t\t\t\n\t\t\t$('#twitter-feed').find('ul').addClass('slides');\n\t\t\t$('#twitter-feed').find('ul li').addClass('slide');\n\t\t\t$('.twitter-slider').flexslider({\n\t\t\t\tanimation: \"slide\",\n\t\t\t\tdirection: \"horizontal\",\n\t\t\t\tsmoothHeight: true,\n\t\t\t\tcontrolNav: true,\n\t\t\t\tcontrolsContainer:\".twitter-nav\",\n\t\t\t\tdirectionNav: false,\n\t\t\t\tstart: function(slider){\n\t\t\t\t\t$('body').removeClass('loading');\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\n\t\n\t}", "title": "" }, { "docid": "e8b7b2d1d6278b78d6942df396d260a2", "score": "0.55819327", "text": "function loadVideos(){\n $.getJSON(URL, options, function(data){\n console.log(data);\n /* let Photo = data.items[0].snippet.thumbnails.medium.url; */\n setKey(data.items)\n setLoading(false)\n }).fail(function(data){\n console.log(data);\n setLoading(true)\n })\n }", "title": "" }, { "docid": "59f7abba09b81bca05b946c8009f6842", "score": "0.55780876", "text": "function myTweets() {\n var params = { screen_name: 'WaanLawan', count: 20 };\n\n client.get('statuses/user_timeline', params, function (error, tweets, response) {\n if (!error && response.statusCode === 200) {\n // console.log(tweets[0]);\n for (var i = 0; i < tweets.length; i++) {\n console.log(' ');\n console.log(\"Created on: \" + tweets[i].created_at);\n console.log([i + 1] + \". \" + tweets[i].text)\n console.log(' ');\n }\n }\n });\n\n}", "title": "" }, { "docid": "50ae74a1864a69a523f1ea1be2638995", "score": "0.55769825", "text": "function myTweets(){\n client.get('statuses/user_timeline', 'rishikesh_n18', function (error, twitters, response) {\n if (error) {\n return console.log(\"Error: \" + error)\n }\n else {\n console.log(\"Tweets: \\n\");\n for (var j = 0; j < 20; j++){\n var tweet = twitters[j];\n console.log(tweet.text+ \", Created at: \"+ tweet.created_at);\n //console.log(tweet.created_at);\n \n // console.log(tweet.created_at + \"\\n\");\n //console.log(response);\n };\n }\n });\n}", "title": "" }, { "docid": "bdcf9fe84ff37e9b3659e07c0fa7f458", "score": "0.5576504", "text": "function getYouTubeVideoSearchData() {\n var searchTerm = $('#InputYouTubeLink').val();\n\n var request = gapi.client.youtube.search.list({\n type: 'video',\n // videoSyndicated: 'true',\n maxResults: 11,\n q: searchTerm,\n part: 'snippet',\n });\n request.execute(function(response) {\n var str = JSON.stringify(response.result);\n $('#search-raw-data').html('<pre>' + str + '</pre>');\n\n });\n turnYouTubeDataIntoPresentableInformation();\n}", "title": "" }, { "docid": "8e780bb4177e24ae0389bebc265cbee0", "score": "0.55697834", "text": "onChannelInfo(res) {\n const request = gapi.client.youtube.channels.list({\n id: res.items[0].snippet.channelId,\n part: \"snippet,contentDetails,statistics\"\n });\n request.execute(response => {\n const results = response.result;\n console.log(results);\n this.channelThumbNail.setAttribute(\n \"src\",\n results.items[0].snippet.thumbnails.high.url\n );\n this.channelLink.href = `channel.html?id=${results.items[0].id}`;\n });\n }", "title": "" }, { "docid": "c0c4ffa7cfdae044f2b6a0cd0e98117b", "score": "0.5561333", "text": "function twitterMe() {\n\n var client = new Twitter({\n\n consumer_key: keysToTwit.twitterKeys.consumer_key,\n consumer_secret: keysToTwit.twitterKeys.consumer_secret,\n access_token_key: keysToTwit.twitterKeys.access_token_key,\n access_token_secret: keysToTwit.twitterKeys.access_token_secret\n\n });\n\n var params = {\n screen_name: 'JessiTweettt'\n };\n\n client.get('statuses/home_timeline', params, function(error, tweets, response) {\n\n if (!error) {\n\n for (var i = 0; i < tweets.length; i++) {\n\n console.log(\"Here's a tweet:\");\n console.log(\" \");\n console.log(tweets[i].text);\n console.log(\" \");\n console.log(\"Created on: \" + tweets[i].created_at);\n console.log(\"-----------------\");\n console.log(\" \");\n\n }\n }\n\n });\n}", "title": "" }, { "docid": "05c28c850b80b6ad1ffc1e20af75d6f4", "score": "0.556132", "text": "function myTweets() {\n var client = new Twitter(keys.twitterKeys);\n var params = { screen_name: 'hadi_codes', count: 20 };\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (error) {\n console.log(error);\n }\n\n //tweets is an array of objects representing all the tweets\n for (var i = 0; i < tweets.length; i++) {\n console.log(tweets[i].created_at);\n console.log(tweets[i].text);\n }\n\n });\n}", "title": "" }, { "docid": "4b837a07c9df7231fe88656e776cd256", "score": "0.5556031", "text": "function youtubeApiHandle() {\n\t\tfor (var i = 0; i < YTTemp.length; i++) {\n\t\t\tvar iframe = YTTemp[i];\n\t\t\tvar player = new YT.Player(iframe);\n\t\t\tvideoPlayers[iframe.id] = player;\n\t\t}\n\t}", "title": "" }, { "docid": "6131cbbd908fe7f7d72a3f1693cdd2e7", "score": "0.5549811", "text": "function myTweets() {\n var client = new Twitter(keys.twitterKeys);\n var params = {\n screen_name: 'MittTechnology'\n , count: 20\n };\n client.get('statuses/user_timeline', params, function (error, tweets, response) {\n if (!error) {\n for (var i = 0; i < tweets.length; i++) {\n console.log('')\n console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')\n console.log(' Tweet: ' + tweets[i].text)\n console.log('')\n console.log(\" Tweet Number: \" + (i + 1))\n console.log('')\n console.log(' Created: ' + tweets[i].created_at)\n console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')\n console.log('')\n }\n }\n });\n}", "title": "" }, { "docid": "56f8f6875ee5332950506ab1ee4ef525", "score": "0.55483854", "text": "function getVideos(addKeywords) {\n var params = {\n part: \"snippet\",\n key: \"AIzaSyBgEpIxrEBtyY88B-dPz_6NknNvA3IBlsk\",\n q: addKeywords,\n order: \"viewcount\",\n maxResults: 8,\n safeSearch: \"strict\",\n type: \"video\"\n };\n var url = 'https://www.googleapis.com/youtube/v3/search';\n $.getJSON(url, params, function (data) {\n if (data.items == 0) {\n alert(\"No videos with your keywords found.\");\n }\n showThumbnails(data.items);\n });\n}", "title": "" }, { "docid": "95d08b16fe19345463a05917eaf09506", "score": "0.5547906", "text": "function queryShowVideosSuccess(tx, results){\r\n if(navigator.connection.type == Connection.NONE)\r\n $('#band_videos_scroller').html('<div class=\"padded\"><p>' + dictionary[localStorage['language']]['you_need_internet_connection'] + '</p></div>');\r\n else{\r\n\r\n var videos = results.rows;\r\n var videos_length = videos.length;\r\n $('#band_videos_scroller').empty();\r\n\r\n if(videos_length >0)\r\n for(var i = 0; i <videos_length; i++){\r\n var video = videos.item(i);\r\n var video_name = video.name;\r\n var video_url = video.url;\r\n var video_id = video.id;\r\n\r\n $('#band_videos_scroller').append(''+\r\n '<div id=\"video_' + video_id + '\">' +\r\n '<h3 class=\"video_name\">' + video_name + '</h3>' +\r\n '<iframe width=\"'+video_url+'\" height=\"200\" src=\"http://www.youtube.com/embed/'+video_url+'?showinfo=0\" frameborder=\"0\" allowfullscreen></iframe>'+\r\n '</div>');\r\n }\r\n else\r\n $('#band_videos_scroller').html('<div class=\"padded\"><p>' + dictionary[localStorage['language']]['no_videos_available_yet'] + '</p></div>');\r\n }\r\n}", "title": "" }, { "docid": "fcc334fb6ab66b69b2c3bf68b4b7c7b6", "score": "0.5544788", "text": "function stream(){\n\tvar stream = twitter.stream('user', {screen_name: 'cherrypickerusl'});\n\n\tstream.on('tweet', function (tweet) {\n\n\t\tvar update = tweet.text;\n\n\t\tif(tweet.user.screen_name.toLowerCase() === matchData.home.username && isMatchUpdate(update) && tweet.text.indexOf('http:') === -1){ //tweet.user.screen_name.toLowerCase() === matchData.home.username && isMatchUpdate(update)\n\t\t\tupdate = update.replace(/\\S*#(?:\\[[^\\]]+\\]|\\S+)|\\S*@(?:\\[[^\\]]+\\]|\\S+)/g, twitterSearchLink);\n\t\t \tmatchUpdates.push(update);\n\t\t \teditPost(makePost());\n\t\t \tlastTweet = tweet.id;\n\t\t} else {\n\t\t\treturn;\n\t\t\t// console.log(\"non-minute tweet\");\n\t\t}\n\n\t});\n}", "title": "" }, { "docid": "519dab3e43202ef1a5d0882a536413f5", "score": "0.553666", "text": "function getVideo(url) {\n\t\t\t$.getScript(oEmbedEndpoint + '?url=' + url + '&maxwidth&maxheight&callback=' + oEmbedCallback);\n\t\t}", "title": "" }, { "docid": "2e61d0f87cb7d9349f6c3b30ef088974", "score": "0.55340916", "text": "function fecharSala()\r\n{\r\n api.isVideoAvailable().then(available => {\r\n api.dispose();\r\n });\r\n}", "title": "" }, { "docid": "6b1ca934bef1e6d86035b5ee598b1df1", "score": "0.55315673", "text": "function getVideos (tab) {\n injectMethod(tab, \"getVideos\", function(response){\n var videos = response.data;\n if(videos && videos.length){\n console.log(\"Videos found: \"+videos.length);\n }\n else{\n console.log(\"No videos found in this page! :(\");\n }\n console.log(videos);\n \n return true;\n });\n console.log(\"Browser action clicked!\");\n}", "title": "" }, { "docid": "3f174ff69161f57367179db11cf45d4c", "score": "0.5531349", "text": "getVideos() {\n this.videos = [\n 'qdUOH3GeqxY'\n ];\n }", "title": "" }, { "docid": "0ca043c9234baf3a0de0b47af7389f08", "score": "0.5531284", "text": "onGetRelatedVideos() {\n const request = gapi.client.youtube.search.list({\n part: \"snippet\",\n type: \"video\",\n relatedToVideoId: this.id,\n maxResults: 10\n });\n request.execute(response => {\n const results = response.result;\n console.log(results);\n this.onPopulateRelatedVideos(results.items);\n });\n }", "title": "" }, { "docid": "b9666e7e6769aa14f1b1d9e71fdb05a6", "score": "0.55268973", "text": "function getTwitch(channel, twitchTarget){\n $.ajax({\n\theaders: {'Client-ID': 'kkv1x3nlp7cblss6sec4ujhuvj0dw8q'},\n\turl: \"https://api.twitch.tv/kraken/streams/\" +channel+ \".json\",\n\tdataType: 'json',\n\ttype: 'GET',\n\tsuccess: function(c) {\n var twitchObject = {status:\"\", image:\"\"};\n if (c.stream == null) {\n $.ajax({\n\t\t\ttype: 'GET',\n\t\t\tdataType: 'json',\n\t\t\theaders: {'Client-ID': 'kkv1x3nlp7cblss6sec4ujhuvj0dw8q'},\n\t\t\turl: \"https://api.twitch.tv/kraken/channels/\"+ channel +\"/videos?limit=1&broadcasts=true\",\t\n\t\t\tsuccess: function(z) {\n\t\t\t\tvar video = z.videos[0];\n\t\t\t\tvar preview = video.preview.replace(\"320x240\",\"640x360\");\n\t\t\t\t var twitchHTML = $('<div class=\"twitchStream\"><div class=\"twitchAbove\"><span class=\"streamTitle\">' + video.title + '</span></div><a href=\"'+video.url+'\" target=\"_blank\"><span class=\"playButton\">&#x25b6;</span><img class=\"twitchPreview\" src=\"'+ preview +'\" alt=\"Watch Now\" /></a><div class=\"twitchBelow\"><span class=\"streamStatus\"><span class=\"red\">●</span>' + video.status + '</span><span class=\"streamViewers\">' + video.views + ' views</span></div></div>')\n twitchTarget.append(twitchHTML);\n\t\t\t}});\n } \n else {\n var twitchHTML = $('<div class=\"twitchStream\"><div class=\"twitchAbove\"><span class=\"streamTitle\">' + c.stream.channel.display_name + '</span></div><a href=\"'+c.stream.channel.url+'\" target=\"_blank\"><span class=\"playButton\">&#x25b6;</span><img class=\"twitchPreview\" src=\"'+ c.stream.preview.large +'\" alt=\"Watch Now\" /></a><div class=\"twitchBelow\"><span class=\"streamStatus\"><span class=\"red\">●</span>' + c.stream.channel.status + '</span><span class=\"streamViewers\">' + c.stream.viewers + ' viewers</span></div></div>')\n twitchTarget.append(twitchHTML);\n }\n }\n\t});\n}", "title": "" }, { "docid": "32afc79b9549f1a474627cb67b2367ac", "score": "0.5525425", "text": "function SendVideo()\n{\n var url = \"/addvideos?title=\" + title + \"&img=\" + img + \"&vid=\" +vid+ \"&plid=\" + plid\n\n HttpRequests(\"POST\", url, null)\n}", "title": "" }, { "docid": "87485efd35fa55fc57885a0c2bb9044a", "score": "0.5521463", "text": "function tweets() {\n var params = { screen_name: 'nodejs', count: 20 };\n client.get('statuses/user_timeline', params, function (error, tweets, response) {\n if (!error) {\n for (var i = 0; i < tweets.length; i++) {\n console.log(\"Date Created: \" + JSON.stringify(tweets[i].created_at))\n console.log(\"Tweet: \" + JSON.stringify(tweets[i].text) + \"\\n--------------------------\\n\");\n }\n };\n });\n}", "title": "" }, { "docid": "2fd953727cd18f2b08715f923a0360c4", "score": "0.55196065", "text": "function tweetAway(){\n\n tweet.get(\"statuses/user_timeline\", {screen_name:'', count: 3}), function(error, tweets, body){\n \tif(!error){\n \t\tconsole.log(error);\n\t}else{\n\t\tconsole.log(tweets);\n\t\tconsole.log(body);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ce58a08c08519fd49434cfdd305a6621", "score": "0.5516945", "text": "function searchVideo(querry, callback) {\n request(\"https://www.googleapis.com/youtube/v3/search?part=id&type=video&q=\" + encodeURIComponent(querry) + \"&key=\" + yt_token, (err, response, body) => {\n var json = JSON.parse(body);\n callback(json.items[0].id.videoId);\n });\n}", "title": "" }, { "docid": "6ac83d368131919d8e54f8a78d8ba952", "score": "0.55155814", "text": "get video() {\n if (this.isVideo) {\n return this.message.video;\n }\n\n return null;\n }", "title": "" }, { "docid": "0dcce91079ad16a88ba248d43489affe", "score": "0.55146825", "text": "function execute() {\n return gapi.client.youtube.search.list({\n \"part\": [\n \"id\"\n ],\n \"channelId\": \"UCvC4D8onUfXzvjTOM-dBfEA\",\n \"maxResults\": 5,\n \"type\": [\n \"video\"\n ],\n \"videoEmbeddable\": \"true\"\n })\n .then(function(response) {\n // Handle the results here (response.result has the parsed body).\n console.log(\"Response\", response);\n },\n function(err) { console.error(\"Execute error\", err); });\n }", "title": "" } ]
3fda8b90762db69042b464c9573185ab
Remove completed tasks when clicking Remove Completed button. Ask confirmation before removing completed. Saved in local storage
[ { "docid": "37dc82a85e10f2ed3ca24cdfaf6ecba0", "score": "0.8115584", "text": "function removeDone() {\n var deleteDone = confirm(\"Do you really want to remove completed the tasks?\");\n //if user clicks okay returns true. Gives and empty string for tasksDone list\n if (deleteDone == true) {\n document.getElementById(\"tasksDone\").innerHTML=\"\"\n //Saved in local storage and updating taskCount\n updateLocalStorage()\n taskCount();\n } \n}", "title": "" } ]
[ { "docid": "5c7b5f73753e4b8712f0c0196852be83", "score": "0.7719577", "text": "function removeTask(e) {\n\n const elementValue = e.target.parentNode.getElementsByTagName(\"p\")[0].innerHTML;\n \n const tasksArray = Array.from(getLocalStorageTasks());\n\n tasksArray.forEach(task => {\n if (task == elementValue) {\n const filteredArray = tasksArray.filter(item => item != elementValue);\n \n setLocalStorage(filteredArray);\n\n // we need to fetch done tasks from local storage\n // then copy the elements + add the completed one\n // set new array to localStorage complete tasks\n //setCompleteTasksLocalStorage()\n refreshTasks();\n }\n })\n}", "title": "" }, { "docid": "d62bb8129435e98c3b19c75334d49b9b", "score": "0.770317", "text": "function removeTask(e) {\n if (e.target.parentElement.classList.contains('delete-item')) {\n if (confirm('Are you sure?')) {\n e.target.parentElement.parentElement.remove();\n\n removeTaskFromLocalStorage(Number(e.target.parentElement.parentElement.id.substring(5)))\n }\n }\n}", "title": "" }, { "docid": "972028270978ca700e267c9f8c39f079", "score": "0.7627513", "text": "removeTask () {\n\t\tthis.deleter.addEventListener('click', (e) => {\n\t\t\tfetch('/items/'+e.target.parentNode.parentNode.parentNode.childNodes[0].getAttribute('data-task'), {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\t\n\t\t\t})\n\t\t\t.then(res => res.text()) \n\t\t\t.then(res => console.log(res))\n\t\t\t.catch(error => console.error(error));\n\t\t\te.target.parentNode.parentNode.parentNode.remove();\n\t\t\tupdateProgess(numberOfCompletedTasks());\n\t\t});\n\n\t\t// We need to also remove tasks from the backend\n\t}", "title": "" }, { "docid": "46212f797bb8d48e0ea62922167c954f", "score": "0.75845283", "text": "function removeTask(e) {\n if(e.target.parentElement.classList.contains\n ('delete-item')) {\n if(confirm('Are You Sure?')) {\n e.target.parentElement.parentElement.remove();\n //Remove from LS\n removeTaskFromLocalStorage\n (e.target.parentElement.parentElement);\n\n \n }\n}\n\n}", "title": "" }, { "docid": "45cd0dad98f57fbbed25491a524805d9", "score": "0.755668", "text": "function removeTask(e){\n if (e.target.parentElement.classList.contains('delete-item')){\n if(confirm('u sure, dude?')){\n e.target.parentElement.parentElement.remove(); \n\n //remove from local storage\n removeTaskFromLocalStorage(e.target.parentElement.parentElement);\n }\n }\n}", "title": "" }, { "docid": "44b0eea712ee6305862099ef2e9d11cb", "score": "0.75332946", "text": "function editCompletedTasks(e) {\r\n if (e.target.classList.contains('fas')) {\r\n if (confirm('Are you Sure ?')) {\r\n e.target.parentElement.parentElement.remove();\r\n removeComFromLS(e.target.parentElement.parentElement);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "34ee36469b74bb8d434c0cb58b282d8f", "score": "0.75328857", "text": "function removeTask(e){\r\n\r\nif(e.target.parentElement.classList.contains('delete-item')){\r\n if(confirm('Are you sure?')){\r\n e.target.parentElement.parentElement.remove();\r\n \r\n //Remove task from Local Storage - as removing from DOM wil not remove it from local storage and hence it will re-appear on reload\r\n removeTaskFromLocalStorage(e.target.parentElement.parentElement); ////since we dont have any id for each element, we will directly pass the element \r\n\r\n } \r\n} \r\n}", "title": "" }, { "docid": "3ad554f55359191595099a2d50fe548a", "score": "0.74388003", "text": "static clearDone () {\n withTasks(tasks, (task) => {\n if (task.isPreloaded && task.pDone > task.pTotal - 3) {\n this.remove(task.$id)\n }\n })\n }", "title": "" }, { "docid": "6d5d83a2dcb39ca65bfa981b886c3823", "score": "0.7437961", "text": "function removeTask(e) {\n // Clicking on the delete button causes the removal of that list item\n if (e.target.parentElement.classList.contains('delete-item')){\n e.target.parentElement.parentElement.remove();\n removeLocalStorage(e.target.parentElement.parentElement.textContent);\n // Refresh the list to mirror local storage contents as all duplicates are removed\n getTasks(e);\n }\n e.preventDefault();\n}", "title": "" }, { "docid": "5ce42c3cbf8e13ceb1411b3d08e51713", "score": "0.74147934", "text": "function removeTask(e) {\n\n if (e.target.parentElement.classList.contains('delete-item')) {\n if (confirm('Are you sure!!')) {\n e.target.parentElement.parentElement.remove();\n }\n }\n removeItemFromLocalStorage(e.target.parentElement.parentElement);\n}", "title": "" }, { "docid": "1733594070d220d6f2e5f8684c4281ee", "score": "0.74002784", "text": "function removeTask(e) {\n\tif (e.target.parentElement.classList.contains('delete-item')) {\n\t\tif (confirm('Are You Sure?')) {\n\t\t\te.target.parentElement.parentElement.remove();\n\t\t\t/*Ako parentElement ima klasu delete-item onda hocu da...*/\n\n\t\t\t//-Remove from LS-//\n\t\t\tremoveTasksFromLocalStorage(e.target.parentElement.parentElement);//Funkcija za brisanje iz LS\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6b2bc2ba0fd2d571c28d9d2ef5f59f23", "score": "0.7373593", "text": "function removeTask(e){\n //Choosing our target : class \"delet-item\"\n /* const target = e.target.closest('.delete-item')// closest() with class\n if(target){\n if(confirm('Are you sure?')){\n target.parentElement.remove()\n }\n } */\n if(e.target.parentElement.classList.contains('delete-item')){\n if(confirm('Are you sure?')){\n e.target.parentElement.parentElement.remove(); \n }\n }\n removeTaskFromLocalStorage(e.target.parentElement.parentElement)\n \n}", "title": "" }, { "docid": "ece175170ee528338cec19e2baec2ab9", "score": "0.73719656", "text": "function clearTasks(e){\n //taskList.innerHTML = '';\n while(taskList.firstChild){\n taskList.removeChild(taskList.firstChild);\n }\n let deletedTasks;\n \n deletedTasks = localStorage.getItem('tasks')\n \n localStorage.setItem('deletedTasks',deletedTasks)\n localStorage.removeItem('tasks')\n //localStorage.clear()\n e.preventDefault()\n}", "title": "" }, { "docid": "330da9a913804bf7da29a4029a6fdf99", "score": "0.728009", "text": "function deleteCompletedTasks() {\n setcompletedTodos([]);\n }", "title": "" }, { "docid": "bb2ad8b3d54152d951ded2060ce1a298", "score": "0.72686017", "text": "function removeCompletedItems() {\n fetch('clearCompleted', {\n method: 'delete',\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(function(response) {\n window.location.reload()\n })\n}", "title": "" }, { "docid": "9aeb3fd227bc1f15b8647b7e46b5b2a3", "score": "0.72558093", "text": "function onDoneButtonClick(e) {\n \n const clickedElement=this.parentElement.parentElement.parentElement;\n const clickedId=clickedElement.id;\n\n\n\n const clickedTask=incompletedItems.find(task=>task.id==clickedId);\n console.log(clickedTask);\n\n incompletedItems=incompletedItems.filter((task)=>\n {\n return task.id!==clickedId;\n })\n\n clickedTask.completed=true;\n\n completedItems.push(clickedTask);\n clickedElement.firstElementChild.lastElementChild.removeChild(clickedElement.firstElementChild.lastElementChild.firstElementChild);\n completedSection.appendChild(clickedElement);\n incompleteSection.removeChild(clickedElement);\n\n}", "title": "" }, { "docid": "d82354efa1d0c464a7fe58feabee39b8", "score": "0.72512484", "text": "function removeTask(e) {\n\n\n if (confirm('Are you sure')) {\n e.target.parentElement.parentElement.remove()\n\n\n //Remove from Ls\n removeTaskFromLocalStorage(e.target.parentElement.parentElement)\n }\n\n // tasks.forEach(function (item, index) {\n // if (e.target.closest(\"li\").innerText == item) {\n // tasks.splice(index, 1)\n\n // }\n\n // })\n //.log(e.target.parentElement.parentElement)\n}", "title": "" }, { "docid": "aa05e982583f241ad20ee64cbf45a2f5", "score": "0.71901107", "text": "function clearTasks() {\n// taskList.innerHTML = \"\" \n\n// more faster:\n\n if(confirm(\"Are You Sure To Remove all of This!!\"))\n {\n while(taskList.firstChild)\n {\n taskList.removeChild(taskList.firstChild)\n }\n // clear whole local storage when click clear tasks button:\n clearFromLocalUsingBtn();\n \n\n }\n \n \n}", "title": "" }, { "docid": "719f3de2322a54c108d2f99bc998ecc4", "score": "0.71831506", "text": "function removeHandler(e) {\n const removeId = e.target.parentElement.getAttribute(\"data-task-id\");\n\n if (confirm(\"Are you sure ?!\")) {\n const foundIndex = toDoList.findIndex((el) => {\n return el.idNum === removeId;\n });\n\n toDoList.splice(foundIndex, 1);\n\n commitToLocalStorage(toDoList);\n reRender();\n }\n}", "title": "" }, { "docid": "44dce342af39b91fa3ac25c200f77710", "score": "0.7175098", "text": "function clearTasks(e) {\n const tasks = Array.from(taskList.children);\n if (tasks.length > 0){\n if (confirm('Clear all tasks?')) {\n tasks.forEach(function (task){\n task.remove();\n });\n }\n }\n taskInput.value = '';\n filter.value = '';\n localStorage.removeItem('tasks');\n\n e.preventDefault();\n}", "title": "" }, { "docid": "56ca02718985c185a7dc5c8550cd7b49", "score": "0.7146694", "text": "function deleteTask()\n {\n var child = this.parentNode.parentNode;\n var parent = child.parentNode;\n parent.removeChild(child);\n var id= parent.id;\n var value = child.innerText;\n if (id == \"taskList\")\n {\n obj.taskListArr.splice(obj.taskListArr.indexOf(value), 1);\n }\n else \n {\n obj.taskCompletedArr.splice(obj.taskCompletedArr.indexOf(value), 1);\n } \n dataStorageUpdt();\n }", "title": "" }, { "docid": "a82f04bdf51afb7f4598a8c626aafad3", "score": "0.71428156", "text": "function removeTask(e) {\n if (e.target.classList.contains('remove-task')) {\n e.target.parentElement.remove();\n }\n\n //Remove from Storage \n removeTaskLocalStorage(e.target.parentElement.textContent);\n}", "title": "" }, { "docid": "9cd7b4abfb967cbb67cbaaa0ccd6f7a6", "score": "0.713861", "text": "function completeTask()\n {\n var butId=this.id;\n var child = this.parentNode.parentNode;\n var parent = child.parentNode;\n var ID = parent.id;\n var value = child.innerText;\n if (ID == \"taskList\")\n {\n // to move to completed\n obj.taskListArr.splice(obj.taskListArr.indexOf(value), 1);\n obj.taskCompletedArr.push(value);\n this.innerHTML=\"&#10227;\";\n }\n else \n {\n //to be sent to pending again\n obj.taskCompletedArr.splice(obj.taskCompletedArr.indexOf(value), 1);\n obj.taskListArr.push(value);\n this.innerHTML=\"&#10004\";\n }\n \n dataStorageUpdt();\n var target = (ID=='taskList')?document.getElementById('taskListCompleted'):document.getElementById('taskList');\n parent.removeChild(child);\n target.insertBefore(child, target.childNodes[0]);\n }", "title": "" }, { "docid": "a21309d818fca933aa46ad15fdb74894", "score": "0.71281666", "text": "function removeTask(e){\r\n // checking if the parent of the i we clicked (the li) has this class in the class list\r\n if(e.target.parentElement.classList.contains('delete-item')){\r\n //asking for confirmation from the user to delete\r\n if(confirm('Are you sure?')){\r\n //deleting the item\r\n e.target.parentElement.parentElement.remove()\r\n\r\n // Remove from LS\r\n removeTaskFromLocalStorage(e.target.parentElement.parentElement);\r\n }\r\n \r\n }\r\n}", "title": "" }, { "docid": "0d91419ad93945108cd999da08019975", "score": "0.7127742", "text": "function clearCompleted() {\n // gets todos from local storage\n const tasks = _store__WEBPACK_IMPORTED_MODULE_0__.default.getTasks();\n\n // create new array from filter()\n const uncompletedTasks = tasks.filter(_isCompleted__WEBPACK_IMPORTED_MODULE_1__.default);\n\n _store__WEBPACK_IMPORTED_MODULE_0__.default.setTasks(uncompletedTasks);\n}", "title": "" }, { "docid": "f5bceb1ed1e2f48123e1a0a6f3864bac", "score": "0.7115551", "text": "function removeTask() {\n var result = confirm('Permanently delete this task?');\n if (result) {\n var values = {};\n values.id = $(this).data('id');\n console.log($(this).data('id'));\n\n $.ajax({\n type: 'POST',\n url: 'task/remove',\n data: values,\n success: function () {\n updateTaskList();\n }\n });\n }\n}", "title": "" }, { "docid": "d21df5d5f6c25e98b7d3cd9f4127d8d6", "score": "0.7107307", "text": "function deleteTask() {\n const buttonDelete = document.querySelectorAll('.button-delete')\n buttonDelete.forEach(button => {\n button.onclick = function (event) {\n event.path.forEach(el => {\n if (el.classList?.contains(listItemClass)) {\n let id = +el.id\n listTask = listTask.filter(task => {\n if (task.id === id) {\n el.remove()\n return false\n }\n return true\n })\n showInfoNoTask()\n }\n })\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n })\n }", "title": "" }, { "docid": "b52ebfdbe97bc038c6a59ec22359b69e", "score": "0.7097857", "text": "function removeAll() {\n var deleteAll = confirm(\"Do you really want to remove all the tasks?\");\n //if user clicks okay returns true. Gives and empty strings for both lists\n if (deleteAll == true) {\n document.getElementById(\"tasksTodo\").innerHTML =\"\"\n document.getElementById(\"tasksDone\").innerHTML=\"\"\n //Saved in local storage and updating taskCount\n updateLocalStorage()\n taskCount();\n }\n}", "title": "" }, { "docid": "56d054693e76f6ffa6883b0218dec028", "score": "0.7087139", "text": "doTaskUndone(target) {\n let index = [...target.parentElement.children].indexOf(target);\n this.doneTaskArr.splice(index - 1, 1);\n this.undoneTaskArr.push(target.children[0].value);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n const task = new Task(target.children[0].value);\n this.taskListUnDone.appendChild(task.createUndoneTask());\n target.remove();\n }", "title": "" }, { "docid": "9f401625f4aeeb4d2a4c1318e47475e7", "score": "0.7071224", "text": "removeCompletedItems() {\n\t\tthis.store.remove({completed: true}, this._filter.bind(this));\n\t}", "title": "" }, { "docid": "5425d5efbf6d831a5fb96fab966aa02c", "score": "0.7046016", "text": "function delOne(event) {\n if (confirm(\"Are you sure you want to delete this task?\")) {\n let newtParent = event.target.parentElement;\n\n // delete selected elements\n for (let i = 0; i < arrayTask.length; i++) {\n if (newtParent.getElementsByTagName(\"SPAN\")[0].innerHTML === arrayTask[i]) {\n arrayTask.splice(i, 1);\n localStorage.setItem(\"task\", arrayTask);\n }\n }\n newtParent.remove();\n displayTasks();\n }\n}", "title": "" }, { "docid": "8f5379c3f81bbdf5cb87f34f9fd34edc", "score": "0.7016779", "text": "function deleteTask(event) {\n //confirm action from used with confirmation alert\n var doDelete = confirm (\"Do you really want to remove selected task?\")\n //if user clicks \"ok\" this returns true and task is removed from the list\n if (doDelete === true) {\n this.parentElement.parentElement.removeChild(this.parentElement);\n } \n //Both done and todo are possible to be removed from list\n this.parentElement.removeEventListener(\"click\", markDone)\n this.parentElement.removeEventListener(\"click\", markTodo)\n //saved into local storage and taskCount is updated\n updateLocalStorage();\n taskCount();\n}", "title": "" }, { "docid": "30335a0fe929580c0a226338991b72cc", "score": "0.7015522", "text": "function removeTask(e) {\r\n let li = e.target.parentElement.parentElement;\r\n let a = e.target.parentElement;\r\n if (a.classList.contains('delete-item')) {\r\n if (confirm('Are You Sure ?')) {\r\n li.remove();\r\n removeFromLS(li);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "b2557198d8019f656185ae7dbaaf8664", "score": "0.7006292", "text": "function removeTaskLocalStorage(task) {\n //Get Tasks from storage\n let tasks = getTaskFromStorage();\n\n //Remove the X from the remove button\n\n const taskDelete = task.substring(0, task.length - 1);\n // console.log(taskDelete);\n\n //Look through the all tasks & delete them\n tasks.forEach(function (taskLS, index) {\n if (taskDelete === taskLS) {\n tasks.splice(index, 1);\n }\n });\n\n //Save the new array data to Local Storage\n localStorage.setItem('tasks', JSON.stringify(tasks));\n\n}", "title": "" }, { "docid": "60b56bf086198ffc8f019dd042320a27", "score": "0.6986163", "text": "function deleteLS(delItem){\n console.log(\"delete activated\");\n let task;\n if(localStorage.getItem('task') === null)\n {\n task=[];\n }\n else\n {\n task=JSON.parse(localStorage.getItem('task'));\n\n\n }\n\n \n task.forEach(function(tasks,index){\n \n if(delItem.innerHTML === tasks){\n \n\n \n \n task.splice(index,1);\n }\n })\n localStorage.setItem('task',JSON.stringify(task));\n}", "title": "" }, { "docid": "ab7a4701733008f8703f4a8e2549b319", "score": "0.6966233", "text": "function deleteTask (e){\n for (var i = 0 ; i< loginUser.tasks.length; i ++){\n if(parseInt(loginUser.tasks[i].id) === parseInt(e.target.getAttribute('data-id'))){\n if(loginUser.tasks[i].status === false){\n taskToDo--;\n $('#countOfTask').text('').text('Task to do: '+ taskToDo);\n }\n loginUser.tasks.splice(i, 1);\n $('#task' + e.target.getAttribute('data-id')).remove();\n collectionOfUser.update(\n {\n id : loginUser.id,\n tasks : loginUser.tasks\n },\n function(user){\n loginUser = user;\n },\n error \n );\n }\n }\n }", "title": "" }, { "docid": "99b341f2a9cc4441701ee03f2a6c75e1", "score": "0.6961776", "text": "function removeAndToogleItem(e) {\r\n e.preventDefault();\r\n\r\n if (e.target.tagName === 'I' && confirm('Are you sure ?')) {\r\n data.forEach(function (obj, i) {\r\n if (obj.text.trim().toLowerCase() === e.target.parentElement.previousElementSibling.innerText.trim().toLowerCase()) {\r\n data.splice(i, 1);\r\n }\r\n });\r\n }\r\n\r\n data.forEach(function (obj, i) {\r\n\r\n if (e.target.tagName === 'LI') {\r\n if (obj.text.trim().toLowerCase() === e.target.firstElementChild.innerText.trim().toLowerCase()) {\r\n data.splice(i, 1, {\r\n text: obj.text,\r\n isDone: !obj.isDone\r\n });\r\n\r\n }\r\n }\r\n if (e.target.tagName === 'SPAN') {\r\n if (obj.text.trim().toLowerCase() === e.target.innerText.trim().toLowerCase()) {\r\n data.splice(i, 1, {\r\n text: obj.text,\r\n isDone: !obj.isDone\r\n });\r\n\r\n }\r\n }\r\n\r\n });\r\n localStorage.setItem('tasks', JSON.stringify(data));\r\n renderTaskItem();\r\n\r\n }", "title": "" }, { "docid": "b7037ff17ca81e6e0d34e0375335940c", "score": "0.6958245", "text": "function completeTask(){\n\t\t$(\".complete\").unbind(\"click\").click(function(){\n\t\t\tvar single = $(this).closest(\"li\");\n\t\t\tvar html = $(this).siblings(\"p\").html();\n\n\t\t\t//Check if html in p tag matches with string in toDoList array\n\t\t\tfor (var i=0; i < toDoList.length; i++) {\n\t\t\t\tif (html == toDoList[i]){\n\t\t\t\t\t//If match push into notToDoList array\n\t\t\t\t\tnotToDoList.push(html);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Removes string from toDoList array\n\t\t\tvar splice = toDoList.splice(single.index(), 1);\n\n\t\t\t//Moves list element to not to do list\n\t\t\tcompleteUl.append(single);\n\n\t\t\t//Removes the complete button\n\t\t\t$(this).remove();\n\n\t\t\t//Removes the remove button\n\t\t\t$(\"ul#not-to-do i#remove\").remove();\n\n\t\t\taddClear();\n\t\t\ttoDoCount();\n\t\t\tnotToDoCount();\n\t\t});\n\t}", "title": "" }, { "docid": "44a33e7021e4fbc2146907fd3d3d0f9e", "score": "0.6953138", "text": "function remove(){ //removes task from array\n var id = this.getAttribute('id');\n var todos = getTodos();\n todos.splice(id,1);\n todos.pop(task); //removes from array\n localStorage.setItem('todo', JSON.stringify(todos));\n\n show(); //how to display a removed item on screen\n\n return false;\n\n}", "title": "" }, { "docid": "d1136ddc84ff2de0bc7ce6fd3978181e", "score": "0.6949148", "text": "function clearTasks(e) {\n //taskList.innerHTML = ''\n while (taskList.firstChild) {\n taskList.removeChild(taskList.firstChild)\n }\n //clear all tasks from local storage\n clearAllTasksFromLS()\n}", "title": "" }, { "docid": "9572241d213e6d9a86cffea53faf7577", "score": "0.6933712", "text": "function removeTask(){\n\t\t$(\".remove\").unbind(\"click\").click(function(){\n\t\t\tvar single = $(this).closest(\"li\");\n\t\t\t\n\t\t\ttoDoList.splice(single.index(), 1);\n\t\t\tsingle.remove();\n\t\t\ttoDoCount();\n\t\t\tnotToDoCount();\n\t\t\taddClear();\n\t\t});\n\t}", "title": "" }, { "docid": "6e3421e2eb98e1f8b16204719b5e69a0", "score": "0.69333375", "text": "doTaskDone(target) {\n let index = [...target.parentElement.children].indexOf(target);\n this.undoneTaskArr.splice(index - 1, 1);\n this.doneTaskArr.push(target.children[0].value);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n const task = new Task(target.children[0].value);\n this.taskListDone.appendChild(task.createDoneTask());\n target.remove();\n }", "title": "" }, { "docid": "4c8a8a3f77dc225ed1bd278e679c72c1", "score": "0.6931477", "text": "function removeTask(event){\n // Get the index of the task to be removed\n let index = findIndexById(event.target.parentElement.id);\n\n // Confirm if the user wants to remove said task\n if(confirm(`Do you want to remove this task? \"${toDos[index].content}\"`)){\n // Use splice to delete the task object and reorder the array then update local storage\n toDos.splice(index, 1);\n ls.setJSON(key, JSON.stringify(toDos));\n\n // Update the list displayed to the user\n displayList();\n }\n}", "title": "" }, { "docid": "3b5c6dc6f754bdc6eae00467eefee740", "score": "0.69280195", "text": "function removeTasks(elmA, elemB, elemC) { //this could be shorter if I had added the task (box, name, br) in a div\n localStorage.removeItem(elemB.id);\n index = elemB.id;\n document.getElementById(\"submit\").disabled = false;\n elmA.remove();\n elemB.remove();\n elemC.remove();\n}", "title": "" }, { "docid": "c1db6a4bc65ac763913397280fa30092", "score": "0.69277805", "text": "function removeTask(e){\n if(e.target.parentElement.classList.contains('delete-item'))\n {\n if(confirm('Are you sure about that ?')){\n e.target.parentElement.parentElement.remove(); \n } \n }\n}", "title": "" }, { "docid": "7e17d0eac1104a0174864ffd90bc4b0b", "score": "0.69254094", "text": "function deleteTask(e) {\n let index = this.dataset.index;\n let tyList = this.parentElement.parentElement.parentElement;\n if (tyList.getAttribute(\"id\") == \"lists\") {\n tasks.splice(index, 1);\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n render(lists, tasks);\n }\n if (tyList.getAttribute(\"id\") == \"listOfChecked\") {\n tasksChecked.splice(index, 1);\n localStorage.setItem(\"tasksChecked\", JSON.stringify(tasksChecked));\n render(listOfChecked, tasksChecked);\n }\n}", "title": "" }, { "docid": "156a38f1d9b9331670f0443dabb7218d", "score": "0.6921873", "text": "function removeTaskFromLocalStorage(taskItem){\n\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n }else {\n tasks =JSON.parse(localStorage.getItem('tasks'));\n \n}\n\ntasks.forEach(function(task, index){\n if(taskItem.textContent === task){\n tasks.splice(index, 1);\n }\n })\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "title": "" }, { "docid": "f5d6b2959c238f0ce1ea4522360c188e", "score": "0.6916589", "text": "function deleteTask(id) {\r\n let Note = document.getElementById(id); \r\n //removes note from page\r\n document.getElementById(\"shoeNotesFromLS\").removeChild(Note); \r\n let indexOfTaskToRemove = tasks.findIndex(task => task.id === id);\r\n //removes from array of tasks\r\n tasks.splice(indexOfTaskToRemove, 1);\r\n //removes from array in local storage\r\n if (tasks.length != 0) {\r\n localStorage.tasks = JSON.stringify(tasks);\r\n }\r\n else {\r\n localStorage.removeItem(\"tasks\");\r\n }\r\n \r\n}", "title": "" }, { "docid": "965cbc77860251350b66df45a1631195", "score": "0.6904859", "text": "function CompleteTask() \n{ \n var listItem = this.parentNode;\n var ul = listItem.parentNode;\n var tarInd = listItem.querySelector(\"p\");\n\n ul.removeChild(listItem);\n\n taskArr.splice([tarInd.value],1);\n\n console.log(taskArr);\n}", "title": "" }, { "docid": "60ad80ab2c1b5630dba6df78a5168c78", "score": "0.6904036", "text": "function delAll() {\n let taskBox = document.getElementById(\"tasksBox\");\n\n if (taskBox.innerHTML !== \"\" && confirm(\"Are you sure you want to clear all the tasks?\")) {\n // delete all items with 'task' key prefix from localStorage\n localStorage.removeItem(\"task\");\n arrayTask = [];\n // task box\n taskBox.innerHTML = \"\";\n // filter text box\n document.tasksForm.txtFilterTasks.value = \"\";\n }\n}", "title": "" }, { "docid": "e150b0986a3026f5f372c027a0932ccf", "score": "0.6902688", "text": "function deleteList(c) {\n\tconst taskDel = document.querySelector(`.item-${c}`);\n\ttaskDel.firstElementChild.addEventListener(\"click\", () => {\n\t\tif (confirm(\"Are you sure?\")) {\n\t\t\ttaskDel.remove();\n\t\t\tconsole.log(taskDel.textContent);\n\t\t\tremoveFromStorage(taskDel.textContent);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "0516f019ce9a5042d4a9787ba4e398a1", "score": "0.6886553", "text": "function clearTask(e) {\r\n taskList.innerHTML = \"\";\r\n localStorage.clear();\r\n}", "title": "" }, { "docid": "5ceb00b74a635989230ca300cf986d60", "score": "0.68699116", "text": "function clearTasks(){\r\n\r\n // taskList.innerHTML = ('');///here we set the innerHTML of tasklist as empty so all child elements are cleared\r\n ///however the second way which is 'faster' is using the while loop to remove each one (more about this on https://jsperf.com/innerhtml-vs-removechild/47) as follows:\r\n if(confirm('Are you sure?')){\r\n while (taskList.firstChild) {\r\n taskList.removeChild(taskList.firstChild);\r\n }\r\n } \r\n ///Clear All Tasks from Local Storage\r\n clearTasksFromLocalStorage();\r\n}", "title": "" }, { "docid": "f84951570dbe35c550c72c2d7059c290", "score": "0.686289", "text": "clearCompleted() {\n // se eliminan todos los marcados como completados\n // this.todos = this.todos.filter( todo => todo.completed != true );\n this.todos = this.todos.filter( todo => !todo.completed );\n\n this.saveTodosToLS();\n }", "title": "" }, { "docid": "8e81f9f37e829149380dc7242b072e50", "score": "0.6856021", "text": "function removeTaskFromLocalStorage(taskItem){\n let tasks;\n//If there are no tasks in the local storage set it to an empty area\nif (localStorage.getItem('tasks') === null){\n tasks = [];\n} else {\n //if there are tasks, set it to whatever is there\n //since local storage only stores string we need to convert it to a JS object\n //tasks is basically where all the inputted tasks go to\n tasks = JSON.parse(localStorage.getItem('tasks'));\n}\n\ntasks.forEach(function(task, index){\n//if the textContent of the passed element (or task in our list) matches with the current task in the iteration of LS\nif (taskItem.textContent === task){\n // we can specify index, and pass it to our function\n //So here we are deleting 1 element from the index\ntasks.splice(index, 1);\n}\n});\n// we set the local storage again\n\nlocalStorage.setItem('tasks', JSON.stringify(tasks));\n}", "title": "" }, { "docid": "08b28eb19b48afe115dc10c5e6d69a82", "score": "0.68451047", "text": "function deleteTask(deleteButton) {\n var task = deleteButton.closest(\"task\");\n var tasks = document.getElementsByTagName(\"task\");\n for (i = 0; i < tasks.length; i++) {\n var currentTask = tasks[i];\n if (currentTask === task) {\n localStorage.removeItem(i);\n task.parentNode.removeChild(task);\n }\n }\n }", "title": "" }, { "docid": "4fc267aa72e6e9127144d6f9c640685b", "score": "0.6845044", "text": "function remove(task, clicked) {\n // initiate variables\n var create = document.getElementById(\"create\"), listC = document.getElementById(\"complete\"), listO = document.getElementById(\"ongoing\");\n var table, type;\n \n if (!muted && !clicked) {\n var audio = new Audio(\"audio/trash.mp3\");\n audio.play();\n }\n \n // determine which table to remove the task from\n if ((task.children[4].firstChild.checked && !clicked) || (!task.children[4].firstChild.checked && clicked)) {\n type = \"complete\";\n table = listC;\n } else {\n type = \"ongoing\";\n table = listO;\n }\n var index = task.firstChild.firstChild.selectedIndex;\n table.removeChild(task);\n \n count();\n \n // delete task from chrome storage\n chrome.storage.sync.get(type, function (tasks) {\n var keys = Object.keys(tasks);\n \n // decrease the selected index of all tasks above the deleted task\n for (var i = table.children.length - 1; i >= index; i -= 1) {\n table.children[i].firstChild.firstChild.selectedIndex -= 1;\n }\n\n // delete the last option from all selects\n for (var i = 0; i < table.children.length; i += 1) {\n table.children[i].firstChild.firstChild.removeChild(table.children[i].firstChild.firstChild.lastChild);\n }\n \n tasks[keys[0]].splice(index, 1);\n chrome.storage.sync.set(tasks);\n });\n \n // prevent incorrect deletion of alarm\n if (table == listC) {\n return 0;\n }\n \n // delete alarm\n var current, next, last;\n \n // replace each old alarm with the one above it\n for (var i = index; i < listO.children.length; i += 1) {\n for (var j = 0; j < pings.length; j += 1) {\n current = i + \" \" + pings[j], next = (i + 1) + \" \" + pings[j];\n shift(current, next);\n }\n }\n \n // delete the alarms related to the last task\n for (var i = 0; i < pings.length; i += 1) {\n last = listO.children.length + \" \" + pings[i];\n chrome.alarms.clear(last);\n }\n \n // resize table\n table.style.maxHeight = table.scrollHeight + \"px\";\n}", "title": "" }, { "docid": "75ac1410aeb75e77d7485521a72430f9", "score": "0.6842401", "text": "function removeTask(span, task){\n span.onclick = function(){\n if(task.classList.value === \"checked\"){\n var index = myTaskList.completed.indexOf(task);\n myTaskList.completed.splice(index, 1);\n updateTaskList();\n }\n if(task.classList.value === \"\"){\n var index = myTaskList.incomplete.indexOf(task);\n myTaskList.incomplete.splice(index, 1);\n updateTaskList();\n }\n }\n}", "title": "" }, { "docid": "a0f3339e944ad75ec1da1eca2bc1efd1", "score": "0.68368787", "text": "function deleteOrCheckTask(e) {\r\n const className = 'delete-icon';\r\n const classNameValid = 'valid-icon';\r\n let element = e.target;\r\n const item = element.className;\r\n let StoreTask = e.target.parentElement;\r\n const attribute = StoreTask.getAttribute(\"attribute\");\r\n //Get child node index\r\n let index = Array.prototype.indexOf.call(StoreTask.parentElement.children, StoreTask);\r\n\r\n //remove the task when is checked\r\n if (item == className && attribute) {\r\n todos.splice(index, 1);\r\n StoreTask.remove();\r\n //update the new array in the localstorage\r\n localStorage[\"todos\"] = JSON.stringify(todos);\r\n\r\n } else if (item == className) {\r\n customBox.innerHTML = '<p>Not Done Yet !</p>';\r\n modalShow();\r\n }\r\n\r\n //change the icon from checked or not\r\n if (item == classNameValid) {\r\n let icon = element.getAttribute(\"src\");\r\n StoreTask.childNodes[1].classList.toggle(\"taskDone\");\r\n\r\n if (icon == \"icons/blackcheck.svg\") {\r\n icon = \"icons/greencheck.svg\";\r\n element.setAttribute(\"src\", icon);\r\n StoreTask.setAttribute(\"attribute\", \"complete\");\r\n todos.splice(index, 1, StoreTask.outerHTML);\r\n\r\n } else if (icon == \"icons/greencheck.svg\") {\r\n icon = \"icons/blackcheck.svg\";\r\n element.setAttribute(\"src\", icon);\r\n StoreTask.removeAttribute(\"attribute\", \"complete\");\r\n todos.splice(index, 1, StoreTask.outerHTML);\r\n }\r\n localStorage[\"todos\"] = JSON.stringify(todos);\r\n }\r\n\r\n //Edit The Task\r\n let classTask = 'task';\r\n let taskValue, newTaskValue;\r\n if (item === classTask) {\r\n element.setAttribute(\"contenteditable\", \"true\")\r\n element.focus();\r\n taskValue = element.textContent;\r\n\r\n element.addEventListener('focusout', () => {\r\n newTaskValue = element.textContent;\r\n element.removeAttribute(\"contenteditable\", \"true\");\r\n if (newTaskValue.length >= 2) {\r\n todos.splice(index, 1, StoreTask.outerHTML);\r\n localStorage[\"todos\"] = JSON.stringify(todos);\r\n } else {\r\n element.textContent = taskValue;\r\n customBox.innerHTML = '<p>Minimum 2 characters</p>';\r\n modalShow();\r\n }\r\n });\r\n }\r\n filter()\r\n}", "title": "" }, { "docid": "e187c6710ca2de56aa5135c3f40bc066", "score": "0.68339276", "text": "function removeItem(e) {\n\n // getting the item to be deleted \n let todoItem = e.target.previousSibling.textContent;\n let idx = allItems.indexOf(todoItem); // looking for item's index in the tasks list\n allItems.splice(idx, 1); // removing the found index from the tasks list\n // console.log(allItems);\n localStorage.setItem(\"tasks\", JSON.stringify(allItems)); // updating the local storage \n list.innerHTML = \"\"; \n show(); \n}", "title": "" }, { "docid": "21c46221f9606ea29585e2af432099d2", "score": "0.6810812", "text": "function removeTask(Event) {\n //Set animation to fade-out\n Event.path[2].style.animationName = \"fade-out\";\n\n //Remove task from the board after 1.6s\n setTimeout(function() {\n Event.path[2].remove();\n }, 1600);\n\n //Remove task from tasks array\n for (var i = 0; i < tasks.length; i++) {\n if (tasks[i].id == Event.target.id) {\n console.log(\n \"*REMOVED* task id: \" + tasks[i].id + \" task title: \" + tasks[i].title\n );\n tasks.splice(i, 1);\n }\n }\n\n //Update the local storage with the new tasks array\n localStorage.setItem(\"task\", JSON.stringify(tasks));\n}", "title": "" }, { "docid": "b237f1abb446ac0c1f46107bb95c0090", "score": "0.68086296", "text": "function removeTask(e) {\n console.log(\"yep\");\n if (e.target.parentElement.classList.contains(\"delete-item\")) {\n console.log(\"yep del\");\n if (confirm(\"Are You Sure about that ? \")) {\n e.target.parentElement.parentElement.remove();\n }\n }\n}", "title": "" }, { "docid": "28278231d14c76364df5c98b6b67eeec", "score": "0.6801065", "text": "function removeTask2(e) {\n console.log(\"yep\");\n if (e.target.parentElement.classList.contains(\"delete-item\")) {\n console.log(\"yep del\");\n if (confirm(\"Are You Sure about that ? \")) {\n e.target.parentElement.parentElement.remove();\n }\n }\n}", "title": "" }, { "docid": "82f42d09a4ab8c2d18e9f79f3e41f92b", "score": "0.6771906", "text": "function deleteTask(button) {\n var taskID = button.id;\n communicator.deleteTask(taskID).then(() => {\n button.parentElement.parentElement.remove()\n },() => {\n alert('Unable to remove selected task')\n })\n}", "title": "" }, { "docid": "7c9deca0c7f131f778181ba945943113", "score": "0.6764653", "text": "function clearCompletedTasks() {\n \n tasks = tasks.filter(function (atask) {\n return !atask.completed;\n});\n showTasks();\n // Create a function that loops through the tasks and filters out the ones that are completed, use filter method\n // filter: checked or not checked\n // return true for any objects that have an unchecked box\n \n\n}", "title": "" }, { "docid": "17f80d6db370ee45e7d23aae24524eaf", "score": "0.6739432", "text": "function removeTaskFromLocalStorage(taskItem) {\n // console.log(taskItem.textContent);\n let tasks;\n if (localStorage.getItem(\"tasks\") === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n\n tasks.forEach((task, index) => {\n if (taskItem.textContent === task) {\n tasks.splice(index, 1);\n }\n });\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n}", "title": "" }, { "docid": "7e80d836020798ab221ae2244450ecd4", "score": "0.6730872", "text": "removeTask(e) {\n const index = e.target.parentNode.dataset.key;\n this.tasks.removeTask(index);\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\n }", "title": "" }, { "docid": "e65278c98c4774c49e91bf0a2c13a074", "score": "0.67244315", "text": "function onTaskComplete(btns) {\n btns.addEventListener('click', function (e) {\n let parent = e.toElement.parentElement;\n\n // to slide out task to the right\n parent.classList.add('task-completed');\n\n // delete task that has been slide out\n setTimeout(() => {\n // removing the parent element of the checkboxin the Li in 0.5s\n parent.remove();\n }, 400);\n\n if (taskList.childNodes.length == 1) {\n setTimeout(() => {\n container.classList.add('todo_list_empty');\n }, 800);\n }\n });\n}", "title": "" }, { "docid": "43e63e30cc3228723f6134d34c403716", "score": "0.67179024", "text": "function removeTaskFromLocalStorage(taskItem) {\n let tasks;\n if(localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n\n tasks.forEach(function(task, index) {\n if(taskItem.textContent === task) {\n tasks.splice(index, 1);\n\n }\n\n\n });\n\n localStorage.setItem('tasks', JSON.stringify(tasks));\n\n}", "title": "" }, { "docid": "ab3d743e585dd0c8ccd0edea9e78838a", "score": "0.67171085", "text": "function storeCompletedTaskList() {\n localStorage.setItem('completedTasks', JSON.stringify($tasksCompleteList.html()));\n}", "title": "" }, { "docid": "1b0e18bfe706c65ec91e01a2d0619e12", "score": "0.67154175", "text": "function removeCompleted(){\n\n var item = this.parentNode.parentNode;\n\n var parent = item.parentNode;\n\n parent.removeChild(item);\n\n}", "title": "" }, { "docid": "5d9caec933dd9be9d3985eaeb4142e0a", "score": "0.671413", "text": "function clearTasksFromStorage(){\n localStorage.clear();\n}", "title": "" }, { "docid": "3478cb7a43e03f55b0ee33b1c456e6d6", "score": "0.66980106", "text": "function delete_task(e) {\n console.log('delete task btn pressed...');\n e.target.parentElement.remove();\n\n }", "title": "" }, { "docid": "5397bd65ce4999eb687f5d4df9d5487d", "score": "0.6695344", "text": "clearTasksInStorage(){\n window.localStorage.clear();\n}", "title": "" }, { "docid": "0f7599d5fece41c3600d76b475b2f49e", "score": "0.6692818", "text": "function removeFromLS(taskItem) {\r\n //Copy Get Task Function//\r\n let tasks;//All Task Will Be Include//\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];//Checking local Storage If Tasks Exist Or Not//\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n\r\n }\r\n let li = taskItem;\r\n li.removeChild(li.lastChild);//<a>x</a>\r\n tasks.forEach((task, index) => {\r\n if (li.textContent.trim() === task) {\r\n tasks.splice(index, 1);\r\n }\r\n });\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n}", "title": "" }, { "docid": "fa537dbd5ee1dbdfc1877ba913d3c004", "score": "0.6679611", "text": "function removeCompleted(index) {\n // gets todos from local storage\n const todos = _store__WEBPACK_IMPORTED_MODULE_0__.default.getTasks();\n\n todos.splice(index, 1);\n\n _store__WEBPACK_IMPORTED_MODULE_0__.default.setTasks(todos);\n}", "title": "" }, { "docid": "cde2ed66f37b7905ab78ab4fdee915a6", "score": "0.6676992", "text": "function deleteTask(e) {\n e.preventDefault();\n if (e.target.className === 'delete-task') {\n e.target.parentElement.remove();\n deleteTaskLocalStorage(e.target.parentElement.textContent);\n\n //alert('Tweet eliminado')\n }\n\n}", "title": "" }, { "docid": "40884ed6ba46b9c1e09eb1cbbb42f30d", "score": "0.6673747", "text": "function removeTaskFromLocalStorage(taskItem){\r\n \r\n console.log(taskItem);\r\n //As we did earlier, we want to check local storage \r\n let tasks;\r\n///we want to now pull whatever there is in the local storage that can be - either added to tasks array or else tasks can be set as an empty array.\r\n//initialise a tasks varibale to create the array\r\n\r\nif(localStorage.getItem('tasks') === null){\r\ntasks = [];\r\n}else{\r\n tasks = JSON.parse(localStorage.getItem('tasks'))///this will be a string and hence we will have to parse this an object that can be used, hence we will add the \"JSON parse\" wrapper.\r\n}\r\n//We would now want to run a loop through each task and using an if statement \r\ntasks.forEach(function(task,index){\r\n if(taskItem.textContent === task){\r\n tasks.splice(index, 1)\r\n // The splice() method adds/removes items to/from an array, and returns the removed item(s). \r\n //Syntax array.splice(index, howmany, item1, ....., itemX)\r\n /*Parameter Values\r\n Parameter\tDescription\r\n index\t- Required. An integer that specifies at what position to add/remove items, Use negative values to specify the position from the end of the array\r\n howmany -\tOptional. The number of items to be removed. If set to 0, no items will be removed\r\n item1, ..., itemX\tOptional. The new item(s) to be added to the array*/\r\n //In this case Remove 1 item from the index passed if the taskItem content is equal to the task.\r\n\r\n }\r\n\r\n})\r\n//finally we set the local storage so that it loads the existing task list without the task that was removed\r\nlocalStorage.setItem('tasks', JSON.stringify(tasks));\r\n\r\n}", "title": "" }, { "docid": "e96c897725de83696a51a2833f06e975", "score": "0.6669806", "text": "function addItemToDo(text) {\n let list = document.getElementById(\"pending-tasks\"); //getting the ul tag\n let item = document.createElement(\"li\"); // creating list items\n item.innerText = text;\n\n //creating buttons - a class of buttons to a div to contain the two buttons\n let buttons = document.createElement(\"div\");\n buttons.classList.add(\"buttons\");\n\n //creating buttons\n let complete = document.createElement(\"button\");\n complete.classList.add(\"fa\");\n complete.classList.add(\"fa-check\");\n complete.classList.add(\"complete\");\n\n complete.style.cursor = \"pointer\";\n complete.style.background = \"none\";\n complete.style.color = \"#5af542\";\n complete.style.border = \" 0\";\n // function deciding which tasks go where\n\n complete.addEventListener(\"click\", (event) => {\n const item = event.target.parentNode.parentNode;\n completeItem(item);\n completeLocalTodo(item);\n });\n\n let remove = document.createElement(\"button\");\n remove.classList.add(\"fa\");\n remove.classList.add(\"fa-trash\");\n remove.classList.add(\"remove\");\n\n remove.style.cursor = \"pointer\";\n remove.style.background = \"none\";\n remove.style.color = \"#ff0000\";\n remove.style.border = \" 0\";\n\n function removeItem() {\n let item = this.parentNode.parentNode;\n let parent = item.parentNode;\n\n const id = parent.id;\n console.log(id);\n\n const removeFrom =\n id === \"completed\" ? completedLocalStorageKey : pendingLocalStorageKey;\n console.log(removeFrom);\n console.log(item.innerText);\n console.log(getLocalToDos(removeFrom));\n localStorage.setItem(\n removeFrom,\n JSON.stringify(\n getLocalToDos(removeFrom).filter((item1) => item1 !== item.innerText)\n )\n );\n parent.removeChild(item);\n }\n\n remove.addEventListener(\"click\", removeItem);\n buttons.appendChild(complete);\n buttons.appendChild(remove);\n\n item.appendChild(buttons);\n\n list.insertBefore(item, list.childNodes[0]); //'li to the ul so tasks are added to top of the list\n return item;\n }", "title": "" }, { "docid": "72232699c81e6bfd7e44c4050d05eccb", "score": "0.66681874", "text": "function completeItem() {\r\n //accesses li element\r\n const item = this.parentNode.parentNode;\r\n //accesses div element\r\n const currentList = item.parentNode;\r\n // gets which id is associated to the element\r\n const currentListId = currentList.id;\r\n // acesses the text ( what is the task itself, what is written)\r\n const text = item.innerText;\r\n //removes item\r\n item.remove();\r\n // if the task is in the todo-list\r\n if (currentListId === 'todo-list') {\r\n //deletes the task from the array 'todos'\r\n todos.splice(todos.indexOf(text), 1);\r\n // adds text (the task itself) to the array 'completed'\r\n completed.push(text);\r\n // moves task to the completed list on HTML\r\n document.getElementById('completed-list').prepend(item);\r\n } else {\r\n //deletes the task from the array 'todos'\r\n completed.splice(todos.indexOf(text), 1);\r\n // adds text (the task itself) to the array 'todos'\r\n todos.push(text);\r\n // moves task to the completed list on HTML\r\n document.getElementById('todo-list').prepend(item);\r\n }\r\n //executes funtion 'updateStorage'\r\n updateStorage();\r\n}", "title": "" }, { "docid": "4c5482d32cc54450a1c224a5390d1447", "score": "0.6660463", "text": "function clearTasks(e) {\n taskList.innerHTML = \"\";\n}", "title": "" }, { "docid": "7a461792d4afebb06a149ec8c638f47d", "score": "0.6655954", "text": "function removeFromLS(taskItem){\r\n // from store in local stroage\r\n let tasks;\r\n if(localStorage.getItem('tasks')===null){\r\n tasks=[];\r\n }\r\n else{\r\n tasks=JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n let li = taskItem;\r\n li.removeChild(li.lastChild); //<a>x</a> ei item ta remove hoa jabe karon ata local stroage a ni\r\n\r\n tasks.forEach(function(task, index){ // local stroage er upore\r\n if(li.textContent.trim()===task){\r\n tasks.splice(index, 1); // task ke remove korbe\r\n }\r\n });\r\n\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n\r\n}", "title": "" }, { "docid": "da8aa63f88bfc89046b851be8d9ed7eb", "score": "0.66529965", "text": "function clearTasksFromLocalStorage(){\n localStorage.clear();\n}", "title": "" }, { "docid": "89cb34f3e87d03d9ea38238bc675bce8", "score": "0.66493547", "text": "function clearTasksFromLocalStorage(){\r\n localStorage.clear();\r\n}", "title": "" }, { "docid": "004a6dc268cf436512a26e82f277174d", "score": "0.6646692", "text": "function showTask() {\n let xyz = localStorage.getItem(\"completed\");\n if (xyz == null) {\n listArr1 = [];\n } else {\n listArr1 = JSON.parse(xyz);\n }\n let getLocalStorage = localStorage.getItem(\"New Todo\");\n if (getLocalStorage == null) {\n listArr = [];\n } else {\n listArr = JSON.parse(getLocalStorage);\n }\n const pendingTasksNumb = document.querySelector(\".pendingTasks\");\n pendingTasksNumb.textContent = listArr.length;\n if (listArr.length > 0 || listArr1.length > 0) {\n deleteAllbtn.classList.add(\"active\");\n } else {\n deleteAllbtn.classList.remove(\"active\");\n }\n let newLiTag = \"\";\n listArr.forEach((element, index) => {\n newLiTag += `<li> ${element}<button onclick=\"deleteTask(${index})\"><i class=\"fas fa-trash\"></i></button> \n <button onclick=\"Task(${index})\"><i class=\"fas fa-check\"></i></button></li>`;\n });\n let newLi = \"\";\n listArr1.forEach((element, index) => {\n newLi += `<li>${element}<button onclick=\"deleteTask1(${index})\"><i class=\"fas fa-trash\"></i></button></li>`\n });\n completed.innerHTML = newLi;\n todoList.innerHTML = newLiTag;\n inputBox.value = \"\";\n}", "title": "" }, { "docid": "87034c301e9fdb25e9d189acdf9d5ec3", "score": "0.66429776", "text": "function showCompleted() {\n document.getElementById(\"tasksTodo\").style.display =\"none\";\n document.getElementById(\"tasksDone\").style.display=\"block\";\n //Saved in local storage\n updateLocalStorage()\n \n}", "title": "" }, { "docid": "89a31eb018973bfae28ffa050cc9cceb", "score": "0.66382533", "text": "function deleteTask(event) {\n\n let idDelete = event.target.getAttribute('data-id')\n\n let keyId = listTask.findIndex(element => {\n if (element.id == idDelete) {\n return element\n }\n })\n\n if (keyId != -1) {\n listTask.splice(keyId, 1)\n saveData()\n }\n\n openModalDel()\n}", "title": "" }, { "docid": "a06443eb527a1edf3432c04225239e75", "score": "0.663676", "text": "function deleteAllCompletedTodos() {\nlet allLis = document.getElementsByTagName(\"li\");\n for (let i = 0; i < allLis.length; i++) {\n if (allLis[i].classList.contains(\"apply-line-through\")) {\n let removedItem = { task: `${allLis[i].value}`, completed: `${todos[i].completed}` }\n let index = todos.indexOf(removedItem)\n todos.splice(index, 1)\n allLis[i].remove();\n return todos;\n }\n }\n \n}", "title": "" }, { "docid": "123d1b0b50ca0950fa2068cf522d5930", "score": "0.6632301", "text": "function clearTasksFromLocalStorage(){\n localStorage.clear();\n}", "title": "" }, { "docid": "b2512bf561606d164b874c9bdcf0784f", "score": "0.6627802", "text": "function removeItemsFromCompleted() {\r\n\tif (completedCount > 3) {\r\n\t\tcompletedList.removeChild(completedList.lastElementChild);\r\n\t}\r\n}", "title": "" }, { "docid": "f0b59dafe3c85264d2b6db6edc151dd5", "score": "0.6627774", "text": "function completeTask(e) {\n\tvar completedListEl = document.getElementById(\"completed-list\");\n\t\n\tvar taskEl = event.target;\n\tvar id = taskEl.id;\n\t\n\t// Find task and update its status\n\tfor (var i = 0; i < tasks.length; i++)\n\t{\n\t\tif (tasks[i].id === id)\n\t\t{\n\t\t\ttasks[i].status = taskStatus.completed;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t// Move task element from active list to completed list\n\ttaskEl.remove();\n\tcompletedListEl.appendChild(taskEl);\n}", "title": "" }, { "docid": "137bfdb4024bc0a98c7dfae1ba97a619", "score": "0.6625958", "text": "function clearTasksFromLocalStorage(){\r\n localStorage.clear();\r\n}", "title": "" }, { "docid": "450bea2e36c58942a3a204ed12bd09c1", "score": "0.6617823", "text": "function taskCompleted () {\n $(document).on('click', '#confirm', function() {\n var list = $('ul');\n for(var i=0; i<list[0].children.length; i++) {\n if (selectedTaskId === list[0].children[i].id) {\n $('#' + selectedTaskId + '').addClass('completed');\n }\n }\n });\n}", "title": "" }, { "docid": "4ffff8eb0cf608320f4250a409eaf27c", "score": "0.6615572", "text": "function removeTaskFromLocalStorage(taskItem){\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = []\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'))\n }\n tasks.forEach((task,index)=>{\n if(taskItem.textContent === task){\n tasks.splice(index,1)\n }\n })\n localStorage.setItem('tasks',JSON.stringify(tasks))\n}", "title": "" }, { "docid": "b1a6d518060fbdf25a86d9b4e9dec395", "score": "0.6611357", "text": "function clearTasks(e) {\n\n while (taskList.firstChild) {\n taskList.removeChild(taskList.firstChild)\n }\n\n localStorage.clear()\n\n // Array.from(e.target.parentElement.children[2].children).forEach(function (item) {\n\n // item.remove()\n // })\n //// Another Sloution //////\n //taskList.textContent = ''\n\n\n\n // e.target.parentElement.children[2].innerHTML=''\n // console.log(e.target.parentElement.children[2])\n}", "title": "" }, { "docid": "9064061ece0f0edd1e5c3910ac3dcd02", "score": "0.6609576", "text": "function clearTasksFromLocalStorage(){\n localStorage.clear();\n}", "title": "" }, { "docid": "2a16214724bcdee91e25a8780e30eb63", "score": "0.6607986", "text": "function clearTasksFromLocalStorage(){\n localStorage.clear();\n }", "title": "" }, { "docid": "74585fc2cf3ae517ddf5474cd9af75ed", "score": "0.6602397", "text": "function taskComplete() {\n if (\n document.getElementById('startButton').textContent ==\n startButtonText[localStorage.getItem('language')]\n ) {\n alert('There is no current Task!');\n }\n if (\n document.getElementById('startButton').textContent ==\n startButtonText[localStorage.getItem('language')]\n ) {\n return;\n } else if (document.getElementById('taskList').firstChild == null) {\n addTaskActivity();\n currTask.innerHTML = '';\n stop();\n } else {\n moveTask('complete');\n }\n}", "title": "" }, { "docid": "c8126f2def3d5dd4d5931ab508d3eb00", "score": "0.65999657", "text": "function clearCompletedToDoItems() {\n \n var items = document.getElementsByClassName(\"completed\")\n \n while(items.length > 0) {\n items[0].remove()\n }\n}", "title": "" }, { "docid": "3a330b14b66ae5c35c7d08c452f394c7", "score": "0.65996635", "text": "function filter_completed()\n {\n //reset/reload tasks\n document.getElementById(\"tasks\").innerHTML=\"\";\n load_done_tasks(curr_list.todos);\n update_count();\n }", "title": "" } ]
60a8be5d75d2048941ac0ba3ecdb4c2d
This function will render the display every time a button is added
[ { "docid": "247c6d24a8dfcbd3ccdb90da2fedbfc8", "score": "0.0", "text": "function displayGifInfo() {\n\t// This grabs the info in the button\n\tvar topic = $(this).attr(\"data-name\");\n\t$(\"#gifs\").empty();\n\t// This is the API url and key\n\tvar queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + topic + \"&api_key=dc6zaTOxFJmzC&limit=10\";\n\n // Performing an AJAX request with the queryURL\n $.ajax({ url: queryURL, method: \"GET\"}).done(function(response) {\n\n \t// This creates a variable to make calling the response easier\n \tvar results = response.data;\n\n \t// prints out the respose\n \tconsole.log(response);\n\n \t// prints out the queryURL\n \tconsole.log(queryURL);\n\n\n\n \t// This creates a div to hold the movie\n \tfor (var i = 0; i < results.length; i++) {\n \t\t\n \t\n \t\tvar gifDiv = $(\"<div class='gif'>\");\n\n \t\t// This gives the initial attribute to the image\n \t\tgifDiv.attr(\"data-state\", \"still\");\n\n \t\t\t// This stores the rating\n \t\tvar p = $(\"<p>\").text(\"Rating: \" + results[i].rating);\n\n \t\t// This creates and stroes the image tag\n \t\tvar gifImage = $(\"<img>\");\n\n \t\t// Sets the attribute of the image to a property pulled from the response\n \t\tgifImage.attr(\"src\", results[i].images.fixed_height_still.url);\n \t\t// This gives the give a data element with the still url\n \t\tgifImage.attr(\"data-still\", results[i].images.fixed_height_still.url);\n\n\n \t\t// This gives a data attribute for the animated image\n \t\tgifImage.attr(\"data-animate\", results[i].images.fixed_height.url);\n \t\t// This appends the rating and the gif\n \t\tgifDiv.append(gifImage);\n \t\tgifDiv.append(p);\n\n \t\tgifDiv.on(\"click\", animateFunction);\n \t\t// This takes everyting above and puts it in the html \n \t\t$(\"#gifs\").prepend(gifDiv);\n\n \t}; // closes the for loop for creating the html\n\n\n // creates the div to hold the gif\n\n }); // Closes the ajax function\n}", "title": "" } ]
[ { "docid": "3b560a004bc9adfe187d7134a557a5c9", "score": "0.7894521", "text": "display() {\n this.addAddingButton();\n this.setDeleteButtons();\n }", "title": "" }, { "docid": "f3bcc4d9c15b2b3283acd8736e884ca1", "score": "0.7529509", "text": "function renderButton() {\n\t\t$('#startButton').append(\n\t\t\t'<button>Start</button>'\n\t\t);\t\n\t\t$('#resetButton').append(\n\t\t\t'<button>Reset</button>'\n\t\t);\t\t\n\t}", "title": "" }, { "docid": "f3bcc4d9c15b2b3283acd8736e884ca1", "score": "0.7529509", "text": "function renderButton() {\n\t\t$('#startButton').append(\n\t\t\t'<button>Start</button>'\n\t\t);\t\n\t\t$('#resetButton').append(\n\t\t\t'<button>Reset</button>'\n\t\t);\t\t\n\t}", "title": "" }, { "docid": "eeafae27fbfc0f99a247f9a6410d47b1", "score": "0.7439959", "text": "function buttonDisplay(){\n $(\"#button-view\").empty();\n for (var i = 0; i < topics.length; i++) {\n var button = $(\"<button>\");\n button.addClass(\"gifbutton btn btn-lg btn-primary\");\n button.attr(\"data-name\",topics[i]);\n button.text(topics[i]);\n $(\"#button-view\").append(button);\n \n }\n }", "title": "" }, { "docid": "62e5c8de85913e4d936d08efcd4f68a6", "score": "0.70923245", "text": "function renderButtons() {\n\n // Deleting the buttons prior to adding buttons\n $(\"#buttons-view\").empty();\n\n // Looping through the array of shows\n for (var i = 0; i < topic.length; i++) {\n\n // Then dynamicaly generating buttons for each show in the array\n var showButton = $('<button>');\n // Adding a class of movie-btn to our button\n showButton.addClass('tvShows');\n showButton.addClass('btn btn-primary')\n // Adding a data-attribute\n showButton.attr('data-name', topic[i]);\n // Providing the initial button text\n showButton.text(topic[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(showButton);\n }\n }", "title": "" }, { "docid": "09f3d85321377e273f1b30a8bf69e553", "score": "0.7062434", "text": "function renderButtons() {\n $(\"#buttondiv\").empty();\n for (var i = 0; i < shows.length; i++) {\n var showbutton = $(\"<button>\");\n showbutton.html(shows[i]);\n showbutton.addClass(\"show-button btn btn-info\");\n showbutton.attr(\"data-name\", shows[i]);\n $(\"#buttondiv\").append(showbutton);\n }\n }", "title": "" }, { "docid": "f611f2737f322933d845bbd4d1bab221", "score": "0.70380497", "text": "function renderButtons() {\n // Deleting the buttons prior to adding new ones\n $(\"#buttons-view\").empty();\n\n // Looping through the our array above of searched anime\n for (var i = 0; i < animes.length; i++) {\n // create a variable to store our new button\n var newBtn = $(\"<button>\");\n // Adding a class of anime-btn to our button\n newBtn.addClass(\"anime-btn btn btn-info\");\n // Adding a data-attribute\n newBtn.attr(\"data-name\", animes[i]);\n // Providing the initial button text\n newBtn.text(animes[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(newBtn);\n\n }\n }", "title": "" }, { "docid": "39851474a73a7d24c5317941dd12bad3", "score": "0.7023973", "text": "function renderButtons() {\n while (index < topics.length) {\n $(\"#btn-div\").append(\"<button class='gif-finder-btn' data-topic='\" + topics[index] + \"'>\" + topics[index] + \"</button>\");\n index++;\n }\n }", "title": "" }, { "docid": "19ab312f086c08d0e18c472c1e2bdce8", "score": "0.6994155", "text": "function renderButtons() {\n // clear the button-area div so that the buttons aren't duplicated every time the user adds a new button\n $(\"#button-area\").empty();\n\n // make a for loop that goes through the buttons array and displays the default search buttons\n for (i = 0; i < buttons.length; i++) {\n var a = $(\"<button>\");\n // add a class to each button\n a.addClass(\"button\");\n // add a data attribute with the name of the current movie in the array\n a.attr(\"data-name\", buttons[i]);\n // add a text attribute that will be displayed on the button\n a.text(buttons[i]);\n // add the button to the button sidebar\n $(\"#button-area\").append(a);\n // $(\"#button-area\").append(\"<br>\");\n\n }\n }", "title": "" }, { "docid": "0a362d3b2728a46156c87be02c116c7b", "score": "0.69869924", "text": "function renderButtons() {\n\n // clear #buttons-view\n $(\"#button-display\").empty();\n\n // iterate through our movie array and create an HTML button for each one\n for (i = 0; i < topics.length; i++) {\n\n var $gifBtn = $(\"<button>\");\n // $movieBtn => <button></button>\n\n $gifBtn\n .addClass(\"category-button m-3 btn btn-light btn-outline-dark\")\n .text(topics[i])\n .attr(\"data-category\", topics[i]);\n // $movieBtn => <button data-name=\"Mr. Nobody\">Mr. Nobody</button>\n\n $(\"#button-display\").append($gifBtn);\n };\n }", "title": "" }, { "docid": "1dece21ad652fc8204d0817d4f71b776", "score": "0.6971967", "text": "render(display, x, y) {\n display\n .image(this.image, x + 1, y + 1)\n .createButton(infoPopup(this.name + '\\n' + this.description));\n }", "title": "" }, { "docid": "9cb9b7f8baa2a898caff243574f061b1", "score": "0.6945491", "text": "function renderButton() {\n $('#allbuttons').empty();\n\n // Looping through the array of dishes\n for (var i = 0; i < peruvianDishes.length; i++) {\n var newButton = $('<button>');\n newButton.addClass('itembutton');\n newButton.addClass('btn btn-success');\n newButton.text(peruvianDishes[i]);\n newButton.attr('data-name', peruvianDishes[i]);\n $('#allbuttons').append(newButton);\n }\n }", "title": "" }, { "docid": "b9a53e4f90f3bb06646419f53800b001", "score": "0.69188666", "text": "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n\n var a = $(\"<button>\");\n a.addClass(\"buttons\");\n a.attr(\"data-name\", topics[i]);\n a.text(topics[i]);\n $(\"#buttons-view\").append(a);\n\n }\n }", "title": "" }, { "docid": "2e4edbb2f34a265e87c1c8121b4f0a25", "score": "0.6916737", "text": "function renderButtons() {\n\n // Deleting the buttons prior to adding new buttons\n $(\"#buttons-view\").empty();\n // Looping through the array of shows\n for (var i = 0; i < shows.length; i++) {\n\n // Then dynamicaly generating buttons for each show in the array\n var a = $(\"<button>\");\n // Adding a class of show-btn to our button\n a.addClass(\"show-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", shows[i]);\n // Providing the initial button text\n a.text(shows[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n}", "title": "" }, { "docid": "060e70085453566d941d645843c5065b", "score": "0.68987507", "text": "function renderButtons() {\n\n // YOUR CODE GOES HERE\n\n}", "title": "" }, { "docid": "9b10d30f69771ed0a13b2edf5a218fb3", "score": "0.6893215", "text": "function displayButton() {\n $(\"#gifButtonsView\").empty(); // erasing anything in this div id so that it doesnt duplicate the results\n for (var i = 0; i < nerd.length; i++) {\n var gifButton = $(\"<button>\");\n gifButton.addClass(\"action\");\n gifButton.addClass(\"btn btn-primary\")\n gifButton.attr(\"data-name\", nerd[i]);\n gifButton.text(nerd[i]);\n $(\"#gifButtonsView\").append(gifButton);\n }\n }", "title": "" }, { "docid": "8d34f6b8d079815866364cbe11c7da87", "score": "0.68763095", "text": "function renderButtons(){\r\n $('#buttons-view').empty();\r\n \r\n for (var i = 0; i < topics.length; i++) {\r\n //create all buttons\r\n var a = $('<button>');\r\n a.addClass('.fast-cars');\r\n a.attr('data-name', topics[i]);\r\n a.text(topics[i]);\r\n $('#buttons-view').append(a);\r\n }\r\n }", "title": "" }, { "docid": "bec8408656cab3d311081420d98b5836", "score": "0.6874664", "text": "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n\n // Looping through the array of comics\n for (var i = 0; i < comics.length; i++) {\n\n var a = $(\"<button>\");\n\n a.addClass(\"comic\");\n // Adding a data-attribute\n a.attr(\"data-topic\", comics[i]);\n // Providing the initial button text\n a.text(comics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "ea458fee0f0bad76c843ed58d3a34e15", "score": "0.68564224", "text": "function displayButtons() {\n $('.buttons-container').empty();\n for (i = 0; i < topics.length; i++) {\n $('.buttons-container').append('<button class=\"btn btn-info added-button\" value=\"' + topics[i] + '\">' + topics[i] + '</button>');\n }\n }", "title": "" }, { "docid": "1f367e5c997e643bb88681d28a4e7c00", "score": "0.6855302", "text": "function renderButtons() {\n $(`#buttons-view`).html(topics.map(makeButton));\n}", "title": "" }, { "docid": "41c7611a8674c85af1605629ce3c0c4c", "score": "0.68537796", "text": "function renderButtons() {\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Looping through the array of movies\n for (var i = 0; i < tvShows.length; i++) {\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of tv show to our button\n a.addClass(\"tv\");\n // Adding a data-attribute\n a.attr(\"data-name\", tvShows[i]);\n\n // Providing the initial button text\n a.text(tvShows[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "11e12375f8274b9b56c5f2de49ffb4a8", "score": "0.68441504", "text": "function renderButtons() {\n // Deletes the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#button-view\").empty();\n // Loops through the array of movies\n for (i = 0; i < gifButtons.length; i++) {\n // Then dynamicaly generates buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adds a class of movie to our button\n a.addClass(\"giphyButton\");\n // Added a data-attribute\n a.attr(\"data-name\", gifButtons[i]);\n // Provided the initial button text\n a.text(gifButtons[i]);\n // Added the button to the buttons-view div\n $(\"#button-view\").append(a);\n }\n }", "title": "" }, { "docid": "d922f48f98b068768aa9dd37bca56b7e", "score": "0.6842269", "text": "function renderButtons() {\n\n // Deletes the shows prior to adding new shows\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#tvShowBtns\").empty();\n\n // Loops through the array of shows\n for (var i = 0; i < tvShows.length; i++) {\n\n // Then dynamicaly generates buttons for each show in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var btn = $(\"<button>\");\n // Adds a class of show to our buttons\n btn.addClass(\"show snip0072 blue\");\n // Added a data-attribute\n btn.attr(\"data-name\", tvShows[i]);\n // Provided the initial button text\n btn.text(tvShows[i]);\n // Added the button to the buttons-view div\n $(\"#tvShowBtns\").append(btn);\n };\n }", "title": "" }, { "docid": "17bc90c40ecc1b61a00354939a8f6385", "score": "0.6838882", "text": "function renderButtons() {\n\n\t// Deleting the topic button prior to adding new ones\n\t$(\"#buttons-view\").empty();\n\n// Looping through the array of topics\n\tfor (var i = 0; i < topics.length; i++) {\n\t//Dynamically generating buttons fo each topic in the array\n\tvar topicBtn = $(\"<button>\");\n\t// Adding a class to topic buttons\n\ttopicBtn.addClass(\"topic-btn btn btn-info\");\n\t// Adding a data-attribute\n\ttopicBtn.attr(\"data-name\", topics[i]);\n\t// Adding the button to the buttons-view div\n\ttopicBtn.text(topics[i]);\n\n\t$(\"#buttons-view\").append(topicBtn);\n\t}\n}", "title": "" }, { "docid": "c196579e18dab1ba57afaf578e28f0f4", "score": "0.68332547", "text": "function renderButtons() {\n\n\n // Delete the content inside the movies-view div prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#movies-view\").empty();\n\n // Loop through the array of movies, then generate buttons for each movie in the array\n movies.forEach((movie)=>{\n var buttonToAdd = $(\"<button>\");\n buttonToAdd.addClass(\"movie\");\n buttonToAdd.attr(\"data-name\", movie);\n buttonToAdd.text(movie);// movies[i]\n $(\"#movies-view\").append(buttonToAdd);\n });\n\n }", "title": "" }, { "docid": "7bf3e18b0547b7b826d1b42b31a8b753", "score": "0.683108", "text": "function displayButtons() {\n TOPICS.forEach(function(topic) {\n let button = $('<button>').text(topic);\n button.addClass('btn btn-secondary m-2');\n button.on('click', function() {\n getGifs(topic, 0);\n });\n $('#buttons').append(button);\n });\n }", "title": "" }, { "docid": "1a2459207b44aea7934e8412852e0e15", "score": "0.6819091", "text": "function renderButtons() {\n\n // Deleting the cars prior to adding new cars\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of cars\n for (var i = 0; i < cars.length; i++) {\n\n // Then dynamicaly generating buttons for each car in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of car to our button\n a.addClass(\"car\");\n // Adding a data-attribute\n a.attr(\"data-name\", cars[i]);\n // Providing the initial button text\n a.text(cars[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "ccce122d175381b8e75441c775ae554a", "score": "0.68143255", "text": "function displayButton() {\n if (isPlay) {\n return (\n <button className=\"play\" onClick={handleClick}><BsFillPauseFill /></button>\n )\n } else {\n return (\n <button className=\"play\" onClick={handleClick}><BsFillPlayFill /></button>\n )\n }\n }", "title": "" }, { "docid": "ccce122d175381b8e75441c775ae554a", "score": "0.68143255", "text": "function displayButton() {\n if (isPlay) {\n return (\n <button className=\"play\" onClick={handleClick}><BsFillPauseFill /></button>\n )\n } else {\n return (\n <button className=\"play\" onClick={handleClick}><BsFillPlayFill /></button>\n )\n }\n }", "title": "" }, { "docid": "33ca02c7f1bd92d47e883f1bb0a70e79", "score": "0.68043673", "text": "function renderButtons() {\n const $topicButtons = topics.map(createTopicButton);\n $(\"#button-display\")\n .empty()\n .append($favoriteButton)\n .append($topicButtons);\n}", "title": "" }, { "docid": "3f18347de10058828711bbe0b8ea2cd3", "score": "0.6799417", "text": "function renderButtons() {\n\n // Deleting the gifs prior to adding new gifs\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of gifs\n for (var i = 0; i < gifs.length; i++) {\n\n // Then dynamicaly generating buttons for each gif in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of gif-btn to our button\n a.addClass(\"gif-btn\");\n // Adding a data-attribute\n a.attr(\"data-topic\", gifs[i]);\n // Providing the initial button text\n a.text(gifs[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "9451471b4341be7c3990d4ccdf6ddc0e", "score": "0.6796495", "text": "function renderButtons() {\n\n\t\t// anytime we call on this function, we also delete everything in the dump-buttons div\n\t\t// this is necessary, otherwise we'd have repeat buttons\n\t\t$(\"#dump-buttons\").empty();\n\t\t\n\t\tfor (var i = 0; i < topic.length; i++) {\n\n\t\t\tvar movieBtn = $(\"<button>\");\n\n\t\t\tmovieBtn.addClass(\"movie\");\n\t\t\tmovieBtn.attr(\"data-name\", topic[i]);\n\t\t\tmovieBtn.text(topic[i]);\n\n\t\t\t$(\"#dump-buttons\").append(movieBtn);\n\n\t\t} // END for-loop END //\n\n\t} // END renderButtons END // ", "title": "" }, { "docid": "e609ed55a9269ba6b4a577cd9e5fa745", "score": "0.67930794", "text": "function renderButtons() {\n\n // Deletes the artist prior to adding new ones\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Loops through the array of artists\n for (var j = 0; j < artistNames.length; j++) {\n\n // Then dynamicaly generates buttons for each artist in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adds a class of artist to our button\n a.addClass(\"artist\");\n // Added a data-attribute\n a.attr(\"data-name\", artistNames[j]);\n // Provided the initial button text\n a.text(artistNames[j]);\n // Added the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "026866bbe5f5fed67672477c75590254", "score": "0.6793063", "text": "function renderButtons() {\n $(\"#button-view\").empty();\n for (var i = 0; i < topics.length; i++) {\n var button = $(\"<button>\");\n button.addClass(\"topics\");\n button.attr(\"data-name\", topics[i]);\n button.html(topics[i]);\n $(\"#button-view\").append(button);\n }\n }", "title": "" }, { "docid": "74a084b0e9538790193cc51acad2822e", "score": "0.6767072", "text": "function display() {\n $(\"#buttons-view\").empty();\n for (var j = 0; j < gifs.length; j++) {\n var a = $(\"<button>\");\n $(\"a\").addClass(\"gif-btn\");\n\n a.attr(\"class\", \"gif-btn\")\n\n a.attr(\"data-name\", gifs[j]);\n a.text(gifs[j]);\n $(\"#buttons-view\").append(a)\n }\n}", "title": "" }, { "docid": "15f8df114a14b6d5c38358e9b6bcac7f", "score": "0.6762163", "text": "function displayButtons() {\n\n // deleting reactions before adding new ones so buttons don't repeat\n $(\"#already-made-buttons\").empty();\n \n // loops through the array of reactions\n for(var i = 0; i < reactionGifs.length; i++) {\n\n // creating buttons (and style) for each reaction type in the array\n var buttonDiv = $(\"<button type='button' class='btn btn-dark'></button>\");\n\n // adding a class for buttons\n buttonDiv.addClass(\"reaction-btn\");\n\n buttonDiv.attr(\"data-name\", reactionGifs[i]);\n\n // adding text to each button with the words in the array\n buttonDiv.text(reactionGifs[i]);\n\n // adding each button to the already made buttons div from the html\n $(\"#already-made-buttons\").append(buttonDiv);\n }\n }", "title": "" }, { "docid": "4493d0718d9638f918c165cd80bafbc3", "score": "0.6760705", "text": "function displayButtons () {\r\n\t\t$(\"#gifButtons\").empty();\r\n\r\n\t\tfor (i = 0; i < actors.length; i++) {\r\n\t\t\tvar button = $(\"<button>\");\r\n\r\n\t\t\tbutton.addClass(\"actor-button\");\r\n\r\n\t\t\tbutton.attr(\"actor-name\", actors[i]);\r\n\r\n\t\t\tbutton.text(actors[i]);\r\n\r\n\t\t\t$(\"#gifButtons\").append(button);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "865007bea0dd2b7a803b421ebfd3e189", "score": "0.67530733", "text": "function renderButtons() {\n $(\"#buttons-view\").empty();\n for (var i = 0; i < shows.length; i++) {\n var a = $(\"<button type='button' class='btn btn-secondary btn-small'>\")\n a.addClass(\"show\")\n a.attr(\"data-name\", shows[i])\n a.text(shows[i])\n $(\"#buttons-view\").append(a)\n }\n}", "title": "" }, { "docid": "7d3be38f5ed5496d6b05bc165a403872", "score": "0.67497", "text": "function renderButtons() {\n\n // clears gifs to avoid having repeat gifs\n $(\"#button-container\").empty();\n // loop through the array of topics\n for (var i = 0; i < topics.length; i++) {\n // generate a button for each topic in array\n var a = $(\"<button>\");\n // adding a class of gif-button to the button\n a.addClass(\"gif-button btn btn-warning\");\n // adding a data-attr to the topics\n a.attr(\"data-name\", topics[i]);\n // update the button text\n a.text(topics[i]);\n // add the buttons to the button div\n $(\"#button-container\").append(a);\n }\n\n }", "title": "" }, { "docid": "3b707d232c47cb0f6547f3481485fb3a", "score": "0.67483276", "text": "function renderButtons(){ \n\n\t\t\t\n\t\t// Deletes the topics prior to adding new topics.\n\t\t$('#buttonsView').empty();\n\n\n\n\t\t// Loops through the array of topics\n\t\tfor (var i = 0; i < topics.length; i++){\n\n\t\t\t// Then dynamicaly generates buttons for each topic in the array\n\t\t\t\n\t\t\t\n\t\t var a = $('<button>') // Sets the variable to = the jQuery call for <button> to write th <button<button/> tags\n\t\t a.addClass('topicBtn'); // Added a class \n\t\t a.attr('data-name', topics[i]); // Added a data-attribute\n\t\t a.text(topics[i]); // Provided the initial button text\n\t\t $('#buttonsView').append(a); // Added the button to the HTML\n\t\t}\n\t}", "title": "" }, { "docid": "ad7adb47b271b8ccfdf7091a1799dc8c", "score": "0.67456526", "text": "function displayAdd(){\n setShowAdd(true);\n setShowCurrent(false);\n setShowHistory(false);\n }", "title": "" }, { "docid": "c45fe5860046200ff6fbf635b8431b62", "score": "0.67434025", "text": "function renderButtons() {\n // Deletes the Buttons Prior to Adding New Titles\n $(\"#buttons-view\").empty();\n\n // Loops Through 'topics' Array\n for (var i = 0; i < topics.length; i++) {\n // Dynamicaly Generates Buttons for Each Term in the Array; Classes from UIKit for Styling\n var button = $(\"<button class='gif-button uk-button uk-button-default uk-button-large'>\");\n\n // Adds a Class to the Button\n button.addClass(\"topics-button\");\n\n // Adds a Data-Attribute for displayGIF Function\n button.attr(\"data-name\", topics[i]);\n\n // Provides initial button text\n button.text(topics[i]);\n\n // Adds the BButton to the HTML\n $(\"#buttons-view\").append(button);\n }\n}", "title": "" }, { "docid": "3181242b6f0f4c89b11c028ca757b2dc", "score": "0.6736272", "text": "function renderButtons() {\n\n // Deleting the super heros buttons prior to adding new super hero buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Loop through the array of super heros\n for (var i = 0; i < topics.length; i++) {\n\n // Dynamically generate buttons for each super hero in the array. \n var super_btn = $(\"<button>\");\n\n // Add a class\n super_btn.addClass(\"super\");\n\n // Add a data-attribute with a value of the super hero at index i\n super_btn.attr(\"data-name\", topics[i]);\n\n // Provide the button's text with a value of the super at index i\n super_btn.text(topics[i]);\n\n // Add the button to the div I created in my HTML\n $(\"#buttons-view\").append(super_btn);\n\n // end for loop\n }\n // end RenderButtons()\n }", "title": "" }, { "docid": "6a62d91214ff614511c414d1d3819e98", "score": "0.67328405", "text": "function renderButtons() {\n // Deleting original button render to re-render\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n // Then dynamicaly generating buttons for each topic in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n\n var a = $(\"<button>\");\n // Adding a class of movie-btn to our button\n a.addClass(\n \"testClass btn btn-dark bg-info btn-outline-dark btn m-3\"\n );\n //Adding ID\n //a.attr(\"id\", \"topic-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "9b5793fac22de8dce30d616799c9446f", "score": "0.6729895", "text": "function renderButtons() {\n\n // Deletes the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#gif-buttons\").empty();\n\n // Loops through the array of sports\n for (var i = 0; i < sports.length; i++) {\n\n // Then dynamicaly generates buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<div class=button>\");\n // Adds a class of movie to our button\n a.addClass(\"btn btn-warning sport\");\n // Added a data-attribute\n a.attr(\"data-name\", sports[i]);\n // Provided the initial button text\n a.text(sports[i]);\n // Added the button to the buttons-view div\n $(\"#gif-buttons\").append(a);\n };\n }", "title": "" }, { "docid": "638f80579e2329226b7a8e38c931f628", "score": "0.6724555", "text": "function renderButtons() {\n//Delete previous render buttons so there are not 2 of the same buttons\n$('#buttons-view').empty();\n for (var i = 0; i < gifs.length; i++){\n var gifButton = $('<button>');\n gifButton.addClass('giphy');\n gifButton.attr('data-name', gifs[i]);\n gifButton.text(gifs[i]);\n $('#buttons-view').append(gifButton);\n }\n}", "title": "" }, { "docid": "02d7099eaa69ec71f3f9ff64e9339771", "score": "0.6723563", "text": "function renderButtons() {\n // Deleting the topic buttons prior to adding new topic buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#giphyButton\").empty();\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n // Then dynamicaly generating buttons for each topic in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"topic\");\n // Adding a data-attribute with a value of the topic at index i\n a.attr(\"data-name\", topics[i]);\n // Providing the button's text with a value of the movie at index i\n a.text(topics[i]);\n // Adding the button to the HTML\n $(\"#giphyButton\").append(a);\n }\n }", "title": "" }, { "docid": "08630114048e17651a78833fbce6170e", "score": "0.67182463", "text": "function renderButtons() {\n\n // Deleting\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var j = 0; j < results.length; j++) {\n\n // Then dynamicaly generating buttons\n var a = $(\"<button>\");\n // Adding a class of movie to our button\n a.addClass(\"btns\");\n // Adding a data-attribute\n a.attr(\"data-instrument\", results[j]);\n // Providing the initial button text\n a.text(results[j]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "a4381c6f1670f07362c7cf8792dbd615", "score": "0.67166835", "text": "function renderButtons() {\n\n // CLEAR ALL BUTTONS EVERY TIME USER ADDS RAPPER\n $('#rapperButtons').empty();\n\n // LOOP THROUGH ALL ELEMENTS IN ARRAY topics\n for (var i = 0; i < topics.length; i++) {\n\n // DYNAMICALLY REATE A BUTTON ELEMENT\n var button = $('<button>');\n\n // ADD A CLASS OF rapper-btn TO EACH BUTTON ELEMENT\n button.addClass('btn btn-light rapper-btn');\n\n // ADD ATTRIBUTE OF data-name AND ARRAY ELEMENT TO EACH BUTTON\n button.attr('data-name', topics[i]);\n\n\n // DISPLAY TEXT TO EACH BUTTON\n button.text(topics[i]);\n\n // ADD BUTTON TO #rapperButtons DIV\n $('#rapperButtons').append(button);\n }\n }", "title": "" }, { "docid": "7f9f9232db7f0a4950bf68993a6f793c", "score": "0.6715487", "text": "function renderButtons() {\n $(\"#buttons-view\").empty();\n\n // Looping through the array of ocean topics\n for (var i = 0; i < oceantopics.length; i++) {\n\n // Dynamically generates new buttons for each ocean topic in array. $(\"<button>\") === beginning and end tag aka: (<button></button>)\n var newButton = $(\"<button>\");\n\n // Adding a class of ocean-btn\n newButton.addClass(\"ocean-btn\");\n\n // Adding a data attribute\n newButton.attr(\"data-name\", oceantopics[i]);\n\n // Initial button text\n newButton.text(oceantopics[i]);\n\n // Adding buttons to the buttons-view div\n $(\"#buttons-view\").append(newButton);\n }\n }", "title": "" }, { "docid": "b7427bb885fda5a7b1a91626ce5890f4", "score": "0.6711622", "text": "function renderButtons() {\n $(\"#btnSection\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n\n var newButton = $(\"<button>\")\n newButton.attr(\"class\", \"btn btn-default\");\n newButton.attr(\"id\", \"input\")\n newButton.attr(\"topic\", topics[i]);\n newButton.text(topics[i]);\n $(\"#btnSection\").append(newButton);\n }\n }", "title": "" }, { "docid": "0e7bdd32e3d1831542ef5c819feb23ac", "score": "0.670459", "text": "_handleClickButton(e) {\n\t\tthis.setState({\n\t\t\tdisplaying: true\n\t\t});\n\t}", "title": "" }, { "docid": "111743522c00ef980256debcbe09cea5", "score": "0.66976005", "text": "function renderButtons() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < topicList.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n\n var a = $(\"<button>\");\n // Adding a class of topic-btn to our button\n a.addClass(\"topic-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", topicList[i]);\n // Providing the initial button text\n a.text(topicList[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "39b21e43e939efdc887b60060a780df7", "score": "0.6695932", "text": "function renderButtons(){\n\t\t//Empties the show buttons div so when appending, it doesn't chain onto pre-existing buttons\n\t\t$(\"#showButtons\").empty();\n\t\t\n\t\tfor (var i = 0; i < showsArray.length; i++) {\n\t\t\t//Using jQuery call to create buttons\n\t\t\tvar x = $(\"<button>\");\n\t\t\t//Adding class \"show\", attribute data-name \"name of the show in the array\", and then text \"name of the show in the array\" to each new button \n\t\t\tx.attr(\"data-name\", showsArray[i]).addClass(\"show\").text(showsArray[i]);\n\t\t\t//Appends each new button.\n\t\t\t$(\"#showButtons\").append(x);\n\t\t};\n\t}", "title": "" }, { "docid": "ae91c4b6d3557186a35b0257cffbbcb7", "score": "0.6691684", "text": "function renderButtons() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Looping through the array of movies\n for (var j = 0; j < shows.length; j++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie-btn to our button\n a.addClass(\"show-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", shows[j]);\n // Providing the initial button text\n a.text(shows[j]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "89a124f551900e2e4bc2ab275cfc6778", "score": "0.66832024", "text": "function renderButtonsP() {\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Looping through the array of movies\n for (var i = 0; i < movies.length; i++) {\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button class='btn btn-raised btn-info movie-btn'>\");\n // Adding a class of movie-btn to our button\n a.addClass(\"movie-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", movies[i]);\n // Providing the initial button text\n a.text(movies[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "451df5e94969803bad4a7cc950bfbc7c", "score": "0.6676563", "text": "function renderButtons() {\n\n\t\t// Deleting the players prior to adding new players\n\t\t// (this is necessary otherwise we will have repeat buttons)\n\t\t$(\"#buttons-view\").empty();\n\n\t\t// Looping through the array of players\n\t\tfor (var i = 0; i < players.length; i++) {\n\n\t\t\t// Then dynamicaly generating buttons for each player in the array\n\t\t\t// This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n\t\t\tvar a = $(\"<button>\");\n\t\t\t// Adding a class of player to our button\n\t\t\ta.addClass(\"player\");\n\t\t\t// Adding a data-attribute\n\t\t\ta.attr(\"data-name\", players[i]);\n\t\t\t// Adding a data-attribute to determine whether image is still or animated\n\t\t\ta.attr(\"data-state\", \"still\");\n\t\t\t// Providing the initial button text\n\t\t\ta.text(players[i]);\n\t\t\t// Adding the button to the HTML\n\t\t\t$(\"#buttons-view\").append(a);\n\t\t}\n\t}", "title": "" }, { "docid": "9b5f4c32dee66ff015621cdd9ca07c88", "score": "0.66680825", "text": "function renderButtons() {\n\n// as learned before, they are ALL recreated each time, or we'd have lots of duplicate buttons.\n $(\"#buttons-view\").empty();\n\n for (i=0; i<topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"topic\");\n a.attr(\"data-gif\", topics[i]);\n a.text(topics[i]);\n $(\"#buttons-view\").append(a);\n // console.log(\"going through the array\" + a); \n }\n }", "title": "" }, { "docid": "308fc0d679790b9912fa1cace11e0585", "score": "0.6667506", "text": "function renderButtons() {\n\n //empties container before writing new buttons to page\n //otherwise will get duplicate buttons\n $('.buttonContainer').empty();\n\n for (var x = 0; x < cartoons.length; x++) {\n\n var index = cartoons[x];\n var button = $('<button>') //create button\n .addClass('cartoon')\n .attr('name', index)\n .attr('data-name', index)\n .text(index);\n $('.buttonContainer').append(button); //create button & add to page\n }\n }", "title": "" }, { "docid": "1d3a32fc508b54701d137a55e8e57c12", "score": "0.66654646", "text": "render(number, label=null) {\n \n let button = this._createButton(number, label);\n this._container.appendChild(button); \n }", "title": "" }, { "docid": "586a904284e8221aacffe1bc89004ca1", "score": "0.6664385", "text": "function renderButtons()\n\t{\n\t\t// Deletes the topics prior to adding new topics (this is necessary otherwise you will have repeat buttons)\n\t\t$('#topicsView').empty();\n\n\t\t// Loops through the array of topics\n\t\tfor (var i = 0; i < topics.length; i++)\n\t\t{\n\t\t\t// Dynamically generating buttons for each topic in the array\n\t\t\tvar a = $('<button type=\"button\">') // This code $('<button>') is all jQuery needs to create the beginning and end tag. (<button></button>)\n\t\t\ta.addClass('topicButton btn btn-primary'); // Adding class \n\t\t\ta.attr('data-name', topics[i]); // Adding data-attribute\n\t\t\ta.text(topics[i]); // Adding text to a button\n\t\t\t$('#topicsView').append(a); // Adding button to html\n\t\t}\n\t}", "title": "" }, { "docid": "bdfff9656d03ddf137f042601325401e", "score": "0.66631085", "text": "function buttonsRender() {\n $(\"#buttons-view\").empty();\n\n // Loops through the array of buttons\n for (var i in topics) {\n var btn = $(\"<button>\");\n btn.addClass(\"animal\");\n btn.attr(\"data-name\", topics[i]);\n btn.text(topics[i]);\n // Added the button to the buttons-view div\n $(\"#buttons-view\").append(btn);\n }\n}", "title": "" }, { "docid": "8a732ba6e1fe130b99d880c8f734167c", "score": "0.66630024", "text": "function renderButtons() {\r\n\r\n // Deleting the buttons prior to adding new buttons\r\n $(\"#buttons-view\").empty();\r\n\r\n // Looping through the array of gifs\r\n for (var i = 0; i < gifs.length; i++) {\r\n\r\n // Create var to store added buttons\r\n var gifButton = $(\"<button>\");\r\n // Adding a class of gif-btn to our button\r\n gifButton.addClass(\"gif-btn\");\r\n // Adding a data-attribute\r\n gifButton.attr(\"data-name\", gifs[i]);\r\n // Providing the initial button text\r\n gifButton.text(gifs[i]);\r\n // Adding the button to the buttons-view div\r\n $(\"#buttons-view\").append(gifButton);\r\n }\r\n }", "title": "" }, { "docid": "83c221dade27487e8ee577f55504c689", "score": "0.66589946", "text": "function renderButtons() {\n $(\"#buttons-view\").empty();\n \n for (var i = 0; i < things.length; i++) {\n var newButton = $(\"<button>\");\n newButton.addClass(\"thing_button op_button round_button\");\n newButton.attr(\"data-name\", things[i]);\n newButton.text(things[i]);\n newButton.click(function(){searchThingButton($(this).attr('data-name'));\n });\n \n $(\"#buttons-view\").append(newButton);\n }\n }", "title": "" }, { "docid": "5cd4f5f5b989afcafbe71a9ea3bb9628", "score": "0.6658104", "text": "function renderButtons() {\n\n // Deletes the topics prior to adding new topics\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Loops through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generates buttons for each giphy in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adds a class of giphy to our button\n a.addClass(\"giphy\");\n // Added a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Provided the initial button text\n a.text(topics[i]);\n // Added the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n}", "title": "" }, { "docid": "daa74a76c447da9ae2ddaebc4842ded9", "score": "0.66539997", "text": "function renderButtons() {\n $(\".button-view\").empty();\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"auto-btn\");\n a.attr(\"dumb-name\", topics[i]);\n a.text(topics[i]);\n $(\".button-view\").append(a);\n $(\"#lookup-value\").empty();\n }\n}", "title": "" }, { "docid": "e54a8c9554d66ac665cc52280e77d02d", "score": "0.664567", "text": "function renderButtons() {\n\n // Deleting the buttons prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < movies.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie to our button\n a.addClass(\"movie\");\n // Adding a data-attribute\n a.attr(\"data-name\", movies[i]);\n // Providing the initial button text\n a.text(movies[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "3faeea7f5dc0e7e5e562e7af2965b127", "score": "0.6641877", "text": "function displayButtons() {\n\t\t//empty the tvShowButtons div before appending the entire tvShows array as buttons with the addition of the new button\n\t\t$(\"#tvShowButtons\").empty();\n\t\t//create a for loop to go through the tvShows array and add a button for each item in array to the webpage\n\t\tfor (var i = 0; i < tvShows.length; i++) {\n\t\t\t//console.log(tvShows[i]);\n\t\t\t//create a var to store a new button HTML element\n\t\t\tvar addButton = $(\"<button></button>\");\n\t\t\t//add a class of \"tv-show\" to each button\n\t\t\taddButton.addClass(\"tv-show\");\n\t\t\t//add an attribute of data-name for each item in tvShow array\n\t\t\taddButton.attr(\"data-name\", tvShows[i]);\n\t\t\t//add text to each button\n\t\t\taddButton.text(tvShows[i]);\n\t\t\t//add buttons to tvShowButtons div in HTML page\n\t\t\t$(\"#tvShowButtons\").append(addButton);\n\t\t}\n\n\t}", "title": "" }, { "docid": "a85a7ad5a0ca4115abc5e85dab8c31ac", "score": "0.663741", "text": "update() {\n this.display();\n }", "title": "" }, { "docid": "b9a105bac8b6cc587aa7699431271097", "score": "0.66352606", "text": "function drawButtons(){\n\t\n\t\tif(app.main.gameState == 1){\n\t\t\tdocument.getElementById('main').style.display = \"block\";\n\t\t}\n\t\n\t}", "title": "" }, { "docid": "7db335f0a25f086f311e0367792673b6", "score": "0.66303366", "text": "function renderButtons() {\n\n // Deletes the car prior to adding new car\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#carButtons\").empty();\n\n for(var i = 0; i < cars.length; i++) {\n\n // Then dynamicaly generates buttons for each car in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var carAdd = $(\"<button>\");\n\n // Adds a class of car to our button\n carAdd.addClass(\"car\");\n\n // Added a data-attribute\n carAdd.attr(\"data-name\", cars[i]);\n\n // Provided the initial button text\n carAdd.text(cars[i]);\n\n // Added the button to the buttons-view div\n $(\"#carButtons\").append(carAdd);\n }\n }", "title": "" }, { "docid": "4ae29576354603e6b943c175036b5f5b", "score": "0.66291183", "text": "function renderButtons() {\n $(\"#buttons-view\").empty();\n for (var i = 0; i < topics.length; i++) {\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var topicBtn = $(\"<button>\");\n // Adding a class\n topicBtn.addClass(\"topics\");\n // Added a data-attribute\n topicBtn.attr(\"data-topics\", topics[i]);\n // Provided the initial button text\n topicBtn.text(topics[i]);\n // Added the button to the HTML\n $(\"#buttons-view\").append(topicBtn);\n }\n }", "title": "" }, { "docid": "680fe69b667b2eb45dfacddd5e11d96b", "score": "0.66232294", "text": "function display(event) {\n if (event.target.id == 'btn1') {\n populateInnerHTML('1')\n // document.getElementById('first').innerHTML = '1';\n } else if (event.target.id == 'btn2') {\n populateInnerHTML('2')\n // document.getElementById('first').innerHTML = '2';\n } else if (event.target.id == 'btn3') {\n populateInnerHTML('3')\n } else if (event.target.id == 'btn4') {\n populateInnerHTML('4')\n } else if (event.target.id == 'btn5') {\n populateInnerHTML('5')\n } else if (event.target.id == 'btn6') {\n populateInnerHTML('6')\n } else if (event.target.id == 'btn7') {\n populateInnerHTML('7')\n } else if (event.target.id == 'btn8') {\n populateInnerHTML('8')\n } else if (event.target.id == 'btn9') {\n populateInnerHTML('9')\n } else if (event.target.id == 'btn0') {\n populateInnerHTML('0')\n }\n}", "title": "" }, { "docid": "ce8ca03d14da1ce5ab7333c9d574db38", "score": "0.66206676", "text": "function renderButtons() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < movies.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n var a = $(\"<button>\");\n // Adding a class of movie-btn to our button\n a.addClass(\"movie-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", movies[i]);\n // Providing the initial button text\n a.text(movies[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "a09dd615ce55c159681789e63cf23833", "score": "0.66118395", "text": "function renderButtons() {\n $(\"#buttons\").empty();\n\n // loop thru array of topics and make buttons\n for (var i=0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"topic\");\n a.attr(\"data-name\", topics[i]);\n a.text(movies[i]);\n $(\"#buttons\").append(a);\n }\n }", "title": "" }, { "docid": "a5c5151108fca7ad2ff01ccf63102c28", "score": "0.6608122", "text": "function renderBtn() {\n $(\".buttons\").empty();\n\n // Loops through topics array\n for (var i = 0; i < topics.length; i++) {\n $(\".buttons\").append($(\"<button>\").attr(\"value\", topics[i]).attr(\"data-artist\", topics[i]).addClass(\"button\").text(topics[i]));\n }\n}", "title": "" }, { "docid": "1c4aafac30f12a52520cdd62fe56277e", "score": "0.65983665", "text": "function renderButtons() {\n \n // Deleting the games prior to adding new games; prevention for repeat buttons)\n $(\"#buttons-view\").empty();\n \n // Looping through the array of games\n for (var i = 0; i < nesGames.length; i++) {\n \n // Dynamically generating buttons for each game in the array\n var newButton = $(\"<button>\");\n // Adding a class of game-btn to our button\n newButton.addClass(\"btn game-btn\");\n // Adding a data-attribute\n newButton.attr(\"data-name\", nesGames[i]);\n // Providing the initial button text\n newButton.text(nesGames[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(newButton);\n }\n }", "title": "" }, { "docid": "97fc5ce295d009a6efd529357651a894", "score": "0.65961415", "text": "function renderButtons() {\n\n // Deleting the topic buttons prior to adding new topic buttons\n $(\"#buttons-view\").empty();\n\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each topic in the array.\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"topic-button\");\n // Adding a data-attribute with a value of the topic at index i\n a.attr(\"data-name\", topics[i]);\n // Providing the button's text with a value of the topic at index i\n a.text(topics[i]);\n // Adding the button to the HTML\n $(\"#buttons-view\").append(a);\n }\n // End of renderButtons function \n }", "title": "" }, { "docid": "f40f2cd50c995e19c12120f9752340a1", "score": "0.65936255", "text": "onShowNeededHandler() {\n this.element.style('display', 'block');\n this.element.style('opacity', '1');\n this.setupContent()\n this.redraw();\n }", "title": "" }, { "docid": "959599507cff7e0c2980ebf866af6f71", "score": "0.6591312", "text": "function renderButtons() { \r\n\t$(\"#buttons-view\").empty();\r\n\tfor (var i = 0; i<topics.length; i++) {\r\n\t\tvar newButton = $(\"<button>\");\r\n\t\tnewButton.text(topics[i]);\r\n\t\tnewButton.addClass(\"newButtonClass\");\r\n\t\tnewButton.attr(\"data-person\", topics[i]);\r\n\t\t$(\"#buttons-view\").append(newButton);\r\n\t};\r\n}", "title": "" }, { "docid": "9346f9e18553e0363e0617e89837c8bc", "score": "0.65910554", "text": "function renderButtons() {\n\n\t// Delete the topics prior to adding new topics.\n\t// This is to avoid duplicate buttons.\n\t$(\".buttons-container\").empty();\n\n\t// Loop through the array of topics\n\tfor (var i = 0; i < topics.length; i++) {\n\n\t // Dynamically generate buttons for each topic in the array.\n\t var a = $(\"<button>\");\n\t // Add a class of topic to button.\n\t a.addClass(\"topic btn btn-default navbar-btn\");\n\t // Add a data-attribute needed for giph search.\n\t a.attr(\"data-name\", topics[i]);\n\t // Provide initial button text.\n\t a.text(topics[i]);\n\t // Add button to the buttons-container div.\n\t $(\".buttons-container\").append(a);\n\t}\n\t// Add listeners to dynamic buttons.\n\taddTopicClickEventListener();\n}", "title": "" }, { "docid": "1f7b0f98b61ae2b490945d28da4abcc7", "score": "0.6585068", "text": "function renderButtons() {\n $(\"#artist-view\").empty();\n for (var i = 0; i < topic.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"newArtist\");\n a.attr(\"data-name\", topic[i]);\n a.text(topic[i]);\n $(\"#artist-view\").append(a);\n }\n}", "title": "" }, { "docid": "f71ab13b58ec5c2201927e3f1fc97c29", "score": "0.6582373", "text": "display() {\n if (this.show) {\n push();\n rectMode(CENTER);\n // darken the screen\n fill(0, 100);\n rect(this.x, this.y, width, height);\n // window\n fill(255);\n stroke(this.color);\n strokeWeight(8);\n rect(this.x, this.y, this.width, this.height);\n // top border\n noStroke();\n fill(this.color);\n rect(this.x, this.y - this.height / 2 + this.height / 16, this.width, this.height / 8);\n fill(255);\n textAlign(CENTER, CENTER);\n textSize(32);\n text(\"-- \" + this.title + \" --\", this.x, this.y - this.width / 2 + this.height / 16);\n fill(0);\n // buttons\n if (this.id === 0 || this.id === 1) {\n text(\"CLOSE\", this.x, this.y + this.width / 2 - this.height / 8);\n } else if (this.id === 2) {\n text(\"READ\", this.x, this.y + this.width / 2 - this.height / 8);\n }\n\n fill(0, 200);\n textAlign(CENTER, TOP);\n textSize(16);\n text(this.des, this.x, this.y - this.width / 4 - 32);\n pop();\n }\n }", "title": "" }, { "docid": "96a26fc49a014deab4b74da4a42e3dca", "score": "0.6578411", "text": "function renderButtons() {\n $(\"#buttons-view\").empty();\n\n $(\".col-md-12\").hide();\n\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"series\");\n a.addClass(\"btn btn-info\")\n a.attr(\"data-name\", topics[i]);\n a.text(topics[i]);\n $(\"#buttons-view\").append(a);\n }\n}", "title": "" }, { "docid": "44bef3446546cabbe5b2d7f359c760cf", "score": "0.6571473", "text": "function renderButtons() {\n // Deleting the emotions prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of emotions\n for (var i = 0; i < emotions.length; i++) {\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of emotion-btn to our button\n a.addClass(\"emotion-btn\");\n // Adding a class to allow the buttons to pulse when hovered\n a.addClass(\"hvr-pulse-grow\");\n // Adding a data-attribute\n a.attr(\"data-name\", emotions[i]);\n // Providing the initial button text\n a.text(emotions[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "3f3dde50e6f26242d3cba19834b459eb", "score": "0.6570387", "text": "function displayButtons() {\n // For Loop - To cull search results\n for (var i = 0; i < topics.length; i++) {\n // Variable - Define <div> to place class=\"gifArea\" in\n contentDiv.attr(\"id\", topics[i]);\n // Variable - Define <li> to generate input button\n var showButton = $('<li>');\n // Attribute to showButton - class=\"show\"\n showButton.attr(\"class\", \"show\");\n // Attribute to showButton - data-search=\"topics[i]\"\n showButton.attr(\"data-search\", topics[i]);\n\n // Variable - Define <a> to generate input result\n var showTab = $(\"<a data-toggle='tab' aria-expanded='true'>\");\n // Attribute to showTab - href=\"#topics[i]\"\n showTab.attr(\"href\", \"#\" + topics[i]);\n // Text to showTab - displays search input on showTab\n showTab.text(topics[i]);\n // Append with showTab - id=\"myButtons\"\n showButton.append(showTab);\n }\n\n // Append with showButton - id=\"myButtons\"\n $(\"#myButtons\").append(showButton);\n\n // Append with contentDiv - id=\"myTabContent\"\n $(\"#myTabContent\").append(contentDiv);\n\n // Billiance - On generation button self-clicks, triggering displaySubjectShow()\n showButton.click();\n\n }", "title": "" }, { "docid": "2b62bb09b7ab2ed59aad973bd807f715", "score": "0.6565903", "text": "function renderButtons() {\n\n // Deleting the animals prior to adding new giphy\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#button-container\").empty();\n\n // Looping through the array of animals\n for (var i = 0; i < cool.length; i++) {\n\n // Then dynamicaly generating buttons for each item in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of animals to our button\n a.addClass(\"cool gif-button\");\n // Adding a data-attribute\n a.attr(\"data-name\", cool[i]);\n // Adding a data-attribute\n a.attr(\"id\", \"button\");\n // Providing the initial button text\n a.text(cool[i]);\n // Adding the button to the buttons-view div\n $(\"#button-container\").append(a);\n }\n }", "title": "" }, { "docid": "ef7b57e09d2a72ae6cf169cece7f5ddb", "score": "0.65627354", "text": "function renderButtons() {\n\n \n $(\"#buttonRow\").empty();\n\n for (var i = 0; i < topicsArray.length; i++) {\n\n var a = $(\"<button>\");\n \n a.addClass(\"topic\");\n \n a.attr(\"data-name\", topicsArray[i]);\n \n a.text(topicsArray[i]);\n \n $(\"#buttonRow\").append(a);\n \n $(a).attr(\"class\", \"gifButton\")\n \n $(a).attr(\"data-name\", topicsArray[i]);\n };\n}", "title": "" }, { "docid": "765ac93344520ceabc17fa0e7920ef47", "score": "0.6562689", "text": "function renderButtons() {\n $(\"#buttons-appear-here\").empty();\n console.log(\"I'm working!\");\n\n for (var i = 0; i < buttonTitles.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"emotion-btn\");\n a.attr(\"data-name\", buttonTitles[i]);\n a.text(buttonTitles[i]);\n $(\"#buttons-appear-here\").append(a);\n }\n }", "title": "" }, { "docid": "5697a16fd8e092c934ebd8b67cf74fb7", "score": "0.65565044", "text": "function renderButtons() {\n\n $('#buttons-row').empty();\n for (var i = 0; i < cars.length; i++) {\n var button = $(\"<button>\");\n button.addClass(\"btn btn-primary btn-sm\");\n // button.type(\"button\")\n button.attr(\"car-name\");\n button.text(cars[i]);\n $(\"#buttons-row\").append(button);\n }\n }", "title": "" }, { "docid": "d8a95cec3ad2ba0bb43a6448a798b2cf", "score": "0.6553528", "text": "function renderButtons() {\n\n // empties the data in the button div\n $('#artist-buttons').empty();\n\n // for loop that loops through the topics array\n for (var i = 0; i < topics.length; i++) {\n\n // variable storing the new button\n var a = $('<button>');\n\n // adding class to the new button\n a.addClass('artist');\n\n // adding attribute data name with the value of i \n a.attr('data-name', topics[i]);\n\n // adding text to the button\n a.text(topics[i]);\n\n // appending the buttons to the HTML\n $('#artist-buttons').append(a);\n }\n }", "title": "" }, { "docid": "6a4e57bf79707d56f35e76dcc14c5867", "score": "0.6551168", "text": "function renderButtons() { \n $(\"#buttons-view\").empty();\n\n // Looping through the array of artists\n for (var i = 0; i < artists.length; i++) {\n \n var a = $(\"<button>\"); \n a.addClass(\"artist-btn\"); \n a.attr(\"data-name\", artists[i]); \n a.text(artists[i]); \n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "5ff3692c60af42f47cf563ae1e06ece3", "score": "0.6549836", "text": "function renderButtons() {\n\n // Deleting the gifs prior to adding new gifs\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttonContainer\").empty();\n\n\n // Looping through the array of gifs\n for (var i = 0; i < gifs.length; i++) {\n //create a button\n var a = $(\"<button>\");\n // Adding a class of gifButton\n a.addClass(\"btn btn-lg gifButton\");\n // Adding a data-name that stores the name of the gif provided by the array\n a.attr(\"data-name\", gifs[i]);\n // modify the text of the button to be the data-name value\n a.text(gifs[i]);\n // append button to button container\n $(\"#buttonContainer\").append(a);\n }\n }", "title": "" }, { "docid": "02c785e2a71cb04a3960d94f22488990", "score": "0.6543843", "text": "function renderButtons() {\n $(\"#topics\").empty();\n $.each(topics, function (_ ,topicString) { // The function(topicString){} runs for each element in the topics array \n var button = $('<button>'); // Creates new JQuery representation of a `<button>` tag \n button.addClass('topicButton'); // Adds the class \"topicButton\" to the new `<button>` \n button.text(topicString); // Adds text to button that is the topic (example: animals) \n $('#topics').append(button); // Adds the newly created button to the screen \n\n })\n }", "title": "" }, { "docid": "3f18e0c50e1ecdc7333da8d8740e5ad0", "score": "0.6534494", "text": "function renderButtons(){ \n\n\t\t// Deletes the movies prior to adding new movies (this is necessary otherwise you will have repeat buttons)\n\t\t$('#buttonsView').empty();\n\n\t\t// Loops through the array of movies\n\t\tfor (var i = 0; i < gifs.length; i++){\n\n\t\t\t// Then dynamicaly generates buttons for each movie in the array\n\n\t\t\t// Note the jQUery syntax here... \n\t\t var a = $('<button>') // This code $('<button>') is all jQuery needs to create the beginning and end tag. (<button></button>)\n\t\t a.addClass('gif'); // Added a class \n\t\t a.addClass('btn')\n\t\t a.attr('data-name', gifs[i]); // Added a data-attribute\n\t\t a.text(gifs[i]); // Provided the initial button text\n\t\t $('#buttonsView').append(a); // Added the button to the HTML\n\t\t}\n\t}", "title": "" }, { "docid": "a98e4c2f1690dcdeee53c2038a51ebc6", "score": "0.6531172", "text": "soloRender(){\n\t\tlet rendered = `<span class=\"texta_preface\">Texta: </span> ${this.state.textValue} <button class=\"texta_toggleBtn\">${this.state.toggleButton}</button>`\n\t\tthis.el.innerHTML = rendered\n\t}", "title": "" }, { "docid": "7df6e9525c4be38345f375ce55bfc8eb", "score": "0.6528068", "text": "function renderButtons() {\n\n // Deleting the animals prior to adding new animals\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of animals\n for (var i = 0; i < animals.length; i++) {\n\n // Then dynamicaly generating buttons for each animal in the array\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of ani to our button\n a.addClass(\"ani btn btn-danger\");\n // Adding a data-attribute\n a.attr(\"data-animal\", animals[i]);\n // Providing the initial button text\n a.text(animals[i]);\n // Adding the button to the HTML\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "8d1d982adbc70450503b868a646f04a5", "score": "0.6527942", "text": "function renderButtons(){ \n\t\t// Deletes the animals prior to adding new animals (this is necessary otherwise you will have repeat buttons)\n\t\t$('#buttonsView').empty();\n\t\t// Loops through the array of animals\n\t\tfor (var i = 0; i < animalsArray.length; i++){\n\t\t\n\t\t var a = $('<button>') \n\t\t a.addClass('animal'); \n\t\t a.attr('data-name', animalsArray[i]); // Added a data-attribute\n\t\t a.text(animalsArray[i]); // Provided the initial button text\n\t\t $('#buttonsView').append(a); // Added the button to the HTML\n\t\t}\n\t}", "title": "" }, { "docid": "2129a1b760a9a9fe4eba9991bccd6632", "score": "0.6523841", "text": "function renderButtons() {\n\t$(\"#viewbuttons\").empty();\n\n\tfor (var i = 0; i < singers.length; i++) {\n\t\tvar a = $(\"<button>\");\n\t\ta.addClass(\"music\");\n\t\ta.attr(\"data-name\", singers[i]);\n\t\ta.text(singers[i]);\n\t\t$(\"#viewbuttons\").append(a);\n\t}\n}", "title": "" }, { "docid": "61858388a9db304c67b7f549ca968c04", "score": "0.6520504", "text": "static DisplayNewGameButton() {\n document.getElementById(btnQuitGameEleId).style.display = \"none\";\n document.getElementById(btnNewGameEleId).style.display = \"block\";\n }", "title": "" }, { "docid": "62e41dc65883a6d99107e8ab6f4fd7ca", "score": "0.6517699", "text": "function renderButtons() {\n $('#topic-buttons').empty();\n for (i = 0; i < topics.length; i++) {\n createButtons(topics[i]);\n }\n }", "title": "" } ]
d7b5e5b30dd7cf4616c6a109133072e0
Searching or Sorting Methods ex [1,2,3,4] => 4(3)
[ { "docid": "dec8a59baca9316bb8bf988b34d3108e", "score": "0.0", "text": "function binarySearch(arr, val){\n if(isArray(arr) && val){\n var first = 0,\n last = arr.length - 1,\n middle = Math.floor((last + first)/2);\n while(arr[middle] != val && first < last){\n if(val < arr[middle]){\n last = middle - 1;\n } else if(val > arr[middle]){\n first = middle + 1;\n }\n middle = Math.floor((last + first)/2);\n }\n return (arr[middle] != val) ? -1 : middle;\n } else return -1;\n }", "title": "" } ]
[ { "docid": "f9ebb2eab2b4b39b0996908d9bfd3811", "score": "0.6619653", "text": "function Sort() { }", "title": "" }, { "docid": "eee6b598115f5005756c7f7f1f917a55", "score": "0.65384513", "text": "sort() {}", "title": "" }, { "docid": "eea1c0b97f42282f2deb6c95c10639dc", "score": "0.6445579", "text": "function selectionsort() {\n console.log(\"selectionsort - implement me !\");\n}", "title": "" }, { "docid": "c82a13cdb7ef458c34e415f4dc2d9ed8", "score": "0.6204274", "text": "function searchIn(list, searchf){\n return _.sortBy(_.map(list, function(i){\n return assignValue(_.partial(searchSum,searchf), i);\n }),function(obj){return -obj.__search});\n }", "title": "" }, { "docid": "2576d26bd0bb4509f494a1c0385db93d", "score": "0.60078645", "text": "sortElements() {}", "title": "" }, { "docid": "99b03b3bd3278f504bba2e3805a7e3af", "score": "0.5854783", "text": "function selectionSort(arr) {\n\t// Crie uma lista vazia para\n\t// receber a nova lista organizada.\n\tlet sorted = []\n\n\t// Cada elemento que adicionarmos\n\t// a lista `sorted`, vamos retirar\n\t// da lista `arr`. Portanto, quando\n\t// `arr` estiver vazia quer dizer que\n\t// terminamos de organizar.\n\twhile (arr.length > 0) {\n\t\t// Comecamos o valor do menor\n\t\t// numero na lista como o maior\n\t\t// numero possivel no JavaScript.\n\t\tlet lowest = Infinity\n\t\t// Precisamos salvar o index do menor\n\t\t// numero encontrado na lista para\n\t\t// podermos tirar ele dela depois.\n\t\tlet lowest_index\n\t\t// Vamos iterar pela array `arr` e\n\t\t// encontrar o menor valor dentro dela.\n\t\tfor (const [index, item] of arr.entries()) {\n\t\t\tif (item < lowest) {\n\t\t\t\t// Se o item encontrado for\n\t\t\t\t// menor do que o menor item encontrado\n\t\t\t\t// ate agora substitua o valor de\n\t\t\t\t// `lowest` e `lowest_item`.\n\t\t\t\tlowest = item\n\t\t\t\tlowest_index = index\n\t\t\t}\n\t\t}\n\t\t// Depois de varrer a lista inteira\n\t\t// podemos adicionar o menor valor\n\t\t// encontrado a lista organizada,\n\t\tsorted.push(lowest)\n\t\t// E tirar o menor valor da lista\n\t\t// que foi passada.\n\t\tarr.splice(lowest_index, 1)\n\t}\n\n\treturn sorted\n\n}", "title": "" }, { "docid": "d3ee189ac6d72204dcb4ba8e0a2e15ca", "score": "0.5850758", "text": "function ordenar (){\n \n return nums.sort();\n}", "title": "" }, { "docid": "20af0626fe5bf8006c597d9880c1d678", "score": "0.5811505", "text": "indicesOfSorted(noodle, sList, els) {\n var inds = new Array(sList.length);\n var min = 0;\n var max = sList.length - 1;\n var halfLen = Math.ceil((els.length - 1) / 2);\n var i;\n var iInv;\n for (i = 0; i < halfLen;) {\n min = noodle.sList.indexOfPlus(noodle, sList, els[i], min, max);\n i++;\n iInv = els.length - i;\n max = noodle.sList.indexOfPlus(noodle, sList, els[iInv], min, max);\n\n inds[i] = min;\n inds[iInv] = max;\n }\n if (iInv - i === 2) {\n inds[halfLen] = noodle.sList.indexOfPlus(noodle, sList, els[halfLen], min, max);\n }\n return inds;\n\n\n\n\n /* var list = sList.list;\n var mid;\n var min = 0;\n var max = list.length - 1;\n var minComp;\n var maxComp;\n\n while (min <= max) {\n mid = Math.floor((min + max) / 2);\n minComp = compare(minEl, list[mid]);\n maxComp = compare(maxEl, list[mid]);\n //If minEl < list[mid]\n if (minComp > 0) {\n min = mid;\n }\n //If el > list[mid]\n if (comp > 0) {\n min = mid + 1;\n }\n //If el == list[mid]\n else {\n return mid;\n }\n }\n return -1;*/\n }", "title": "" }, { "docid": "b5ac8a1ab2959e108505552875e5af0b", "score": "0.5800103", "text": "function sort() {\n\tjokeType = $(\"#type option:selected\").val().toLowerCase();\n\tjokeFltr = $(\"#filter\").val();\n\tif(jokeId != 11) jokeId = 10;\n\t\n\tnextId();\n\t\n\treturn 1;\n}", "title": "" }, { "docid": "f76690968cd12f1342234bde584aa505", "score": "0.57593226", "text": "function quickSort() {}", "title": "" }, { "docid": "4e43b0a9c82e63741492aadc9d192113", "score": "0.5727938", "text": "function sorterFunction(a, b) {\n return a - b;\n }", "title": "" }, { "docid": "f0d829c2cc9779e472035a490b3ecfd7", "score": "0.569518", "text": "function find(nums, ordering, goal){\n let results=[0,0,0,0,0,0]\n let strs=[\"\",\"\",\"\",\"\",\"\",\"\"]\n results[0]=nums[ordering[0]]\n strs[0]=\"\"+nums[ordering[0]]\n for(let op1=0; op1<4; op1++){\n let outp=operate(results[0],nums[ordering[1]],op1, goal, 1+1, strs[0])\n // console.log(outp)\n results[1]=outp[0]\n strs[1] = outp[1]\n for(let op2=0; op2<4; op2++){\n let outp=operate(results[1],nums[ordering[2]],op2, goal, 2+1, strs[1])\n results[2]=outp[0]\n strs[2] = outp[1]\n\n for(let op3=0; op3<4; op3++){\n let outp=operate(results[2],nums[ordering[3]],op3, goal, 3+1, strs[2])\n results[3]=outp[0]\n strs[3] = outp[1]\n\n for(let op4=0; op4<4; op4++){\n let outp=operate(results[3],nums[ordering[4]],op4, goal, 4+1, strs[3])\n results[4]=outp[0]\n strs[4] = outp[1]\n\n for(let op5=0; op5<4; op5++){\n let outp=operate(results[4],nums[ordering[5]],op5, goal, 5+1, strs[4])\n results[5]=outp[0]\n strs[5] = outp[1]\n\n\n //account for using other 2 separately\n outp = operate(nums[ordering[4]], nums[ordering[5]], op4, goal, 2, \"\"+nums[ordering[4]])\n let tmpResults = outp[0]\n let tmpStr = outp[1]\n\n operate(results[3], tmpResults,op5, goal, 6, strs[3], \"(\"+tmpStr+\")\")\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "af79688cb3f5e2e8c3a4275681b3ce5d", "score": "0.568902", "text": "function sort (a, b) {\n\n}", "title": "" }, { "docid": "d2bebf6aa3ff13b94a8e2834bfc5f209", "score": "0.5661177", "text": "function sortOn(fn) {\r\n\treturn (a,b) => fn(a) - fn(b);\r\n}", "title": "" }, { "docid": "574c2f9862698cc761e34a1fed154ce1", "score": "0.5642901", "text": "function uf(){for(var a=H.vb(),b=[],c=[],d=0;d<a.length;d++){var f=a[d].Ff;f&&(f=f.call(a[d]))&&(f[2]?b.push(f):c.push(f))}c.sort(vf);b.sort(vf);return[c,b]}", "title": "" }, { "docid": "880376a89539434f84339438a5048b55", "score": "0.5633412", "text": "function runSort(){\r\n\tstop = true;\r\n\tswitch(algo){\r\n\t\tcase \"merge\":\r\n\t\t\tcallMergeSort(itemList);\r\n\t\t\tbreak;\r\n\t\tcase \"bubble\":\r\n\t\t\tbubbleSort(itemList);\r\n\t\t\tbreak;\r\n\t\tcase \"insertion\":\r\n\t\t\tinsertionSort(itemList);\r\n\t\t\tbreak;\r\n\t\tcase \"quick\":\r\n\t\t\tcallQuickSort(itemList);\r\n\t\t\tbreak;\r\n\t\tcase \"selection\":\r\n\t\t\tselectionSort(itemList);\r\n\t\t\tbreak;\r\n\t\tcase \"radix\":\r\n\t\t\tradixSort(itemList, radixBase);\r\n\t\t\tbreak;\r\n\t}\r\n}", "title": "" }, { "docid": "82f940a3f205e17d3defbbd4644c7626", "score": "0.55857587", "text": "sortData(sort, sortAscending, data){\n }", "title": "" }, { "docid": "275e3f7a6d424726de201aef6a8006bd", "score": "0.5583187", "text": "function inAscOrder(arr) {\n\n}", "title": "" }, { "docid": "b5ba2d82c2230bf87febba798173ba51", "score": "0.5511802", "text": "sortData(sort, sortAscending, data) {}", "title": "" }, { "docid": "fa9beedd8bf423a85717bdb90a515bd8", "score": "0.55067587", "text": "function search(items,query){// Fuzzy match the items for the query.\nvar scores=matchItems(items,query);// Sort the items based on their score.\nscores.sort(scoreCmp);// Create the results for the search.\nreturn createResults(scores);}", "title": "" }, { "docid": "2980c46d3209ce7cc9a305269a744c7d", "score": "0.54657406", "text": "function myTest(){\n var list = $(\"#arraySelectors\");\n var desc= false;\n list.append(list.children().get().sort(function(a, b) {\n var aProp = $(a).find(\"span\").text()\n var bProp = $(b).find(\"span\").text();\n return (aProp > bProp ? 1 : aProp < bProp ? -1 : 0) * (desc ? -1 : 1);\n }));\n}", "title": "" }, { "docid": "a8fb23431d125db1ef5cb3457a1ac71a", "score": "0.5442919", "text": "function Solution17(){\n//first argument is array of sorted values, second value used is whose position being looked up\ntestFun([40, 60], 50)\nfunction testFun(arr, num){\nvar testArray=arguments[0];\nfor(var i=0;i<testArray.length;i++){\n\tif(testArray[i]>=num){alert(\"Position of number is \" +i);return;}\n}\nalert(\"Position of number is \" +testArray.length);\n\n}\n}", "title": "" }, { "docid": "85c8083266abf5ba3183d48fe3c873bd", "score": "0.5438484", "text": "function sortit(a,b){\n return(a-b)\n }", "title": "" }, { "docid": "4df05037b87acaf8e5c2651d2772a85a", "score": "0.54153305", "text": "function insertionSort (array){\n\n}", "title": "" }, { "docid": "32faca2a6fc632c5753dd8beb172540d", "score": "0.5410244", "text": "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "title": "" }, { "docid": "32faca2a6fc632c5753dd8beb172540d", "score": "0.5410244", "text": "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "title": "" }, { "docid": "ae798637c88437d7df21d56677560ecc", "score": "0.54022086", "text": "function getSortFunctionByData(values) {\n var testToRange = function (value) {\n var reg = /(\\d-)|(\\d+-\\d+)|(\\d+\\+)/;\n var match = value.match(reg);\n if (match && match.length) {\n return true;\n }\n return false;\n };\n if (values.length > 0) {\n var testResult = values\n .map(function (val) { return testToRange(val); })\n .reduceRight(function (a, b) { return a && b; });\n if (testResult) {\n return function (a, b) {\n if (a && b) {\n var aNum = a.match(/\\d+/)[0];\n var bNum = b.match(/\\d+/)[0];\n return +aNum < +bNum\n ? 1\n : +a.split(\"-\").pop() < +b.split(\"-\").pop()\n ? 1\n : -1;\n }\n };\n }\n }\n return function (a, b) { return (a < b ? -1 : 1); };\n}", "title": "" }, { "docid": "c42ff20dda98cb3aa46c550a148625e1", "score": "0.5400473", "text": "function order(words){\n // ...\n}", "title": "" }, { "docid": "512d98ef8dd5bad12482eb75ff2c4221", "score": "0.5391737", "text": "function p06SortArrayBy2Criteria(input) {\n\n let criteria = (e1, e2) => {\n if (e1.length != e2.length) {\n return e1.length - e2.length;\n } else {\n return e1.toUpperCase() > e2.toUpperCase();// ignore upper and lowercase\n }\n }\n\n console.log(input.sort(criteria).join('\\n'));\n}", "title": "" }, { "docid": "8580d05d93dc8eefef3414cb02151f33", "score": "0.53917295", "text": "function sort_ascending( a, b )\n{\n\t\n}", "title": "" }, { "docid": "6a11c31c9f9c3eef35dfea6e8ab2b5af", "score": "0.53749263", "text": "function kungfoo(input) {\n function reverse(a, b) {\n if(a<b) return 1;\n if(a>b) return -1;\n return 0;\n }\n var output = input.sort(reverse);\n console.log(output);\n \n return output;\n}", "title": "" }, { "docid": "90b52850d113ba52a7b6f03065a535c6", "score": "0.5373888", "text": "function sort() {\n error(sort);\n }", "title": "" }, { "docid": "7e08d4df9f61d94969fb42337382b058", "score": "0.53658247", "text": "function sortData(searches){\n var sorters = document.getElementsByName(\"sorter\");\n var sorted = 0;\n for(var x=0; x<4;x++){\n if(sorters[x].checked){\n sorted=x; break;\n }\n }\n /*\n sorted : \n 0 -> id\n 1 -> Name\n 2 -> Height\n 3 -> Weight\n */\n searches.sort(function (a,b){\n switch(sorted){\n case 0:\n return a.id - b.id;\n\n case 1:\n return a.name.localeCompare(b.name);\n \n case 2:\n return a.height-b.height;\n\n case 3:\n return a.weight - b.weight;\n }\n });\n return searches;\n}", "title": "" }, { "docid": "0964f542267d35f8715de876a12d6f4f", "score": "0.5365209", "text": "function isSortedAndHow() {\n //...code here\n}", "title": "" }, { "docid": "2a038c201282ef322d488bab1d3dfbe3", "score": "0.5346128", "text": "function sortFunction(a,b){\n if(a[1] === b[1]){\n return 0;\n }else{\n return(a[1] < b[1]? 1:-1);\n }\n }", "title": "" }, { "docid": "146d767aaa094734fb41a5a2c5cbd620", "score": "0.53265655", "text": "function SortNumbers(a,b) {\n return a - b;\n}", "title": "" }, { "docid": "bd97075f107d8cc25a57d94ab8e5f524", "score": "0.5323329", "text": "indexOfNew(noodle, sList, el) {\n var list = sList.list;\n var mid;\n var min = 0;\n var max = list.length - 1;\n var comp;\n\n while (min <= max) {\n mid = Math.floor((min + max) / 2);\n comp = sList.compare(el, list[mid]);\n\n //If el < list[mid]\n if (comp < 0) {\n max = mid - 1;\n }\n //If el > list[mid]\n else if (comp > 0) {\n min = mid + 1;\n }\n //If el == list[mid]\n else {\n return mid;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "b8da8c6924229fe87151669c1247a77b", "score": "0.5322346", "text": "function sort() {\n var a = Array.prototype.slice.call(arguments);\n return a.sort();\n}", "title": "" }, { "docid": "ea3c8fa8e98e3962ef680deefefe3e7b", "score": "0.53221166", "text": "sort(value, type) {\n switch (type) {\n case \"string\":\n this.filterSearchList.sort((a, b) =>\n a[value] > b[value] ? 1 : -1\n );\n break;\n case \"integer\":\n this.filterSearchList.sort((a, b) => b[value] - a[value]);\n break;\n case \"givenList\":\n return value.sort((a, b) => (a > b ? 1 : -1));\n }\n }", "title": "" }, { "docid": "a2b1001d454e00200791238fb90d162b", "score": "0.53213733", "text": "function sort(arr){\r\n return arr\r\n}", "title": "" }, { "docid": "38ac15d4174f2f89238fb10c8eab49f1", "score": "0.5304196", "text": "function quickSort (array){\n \n}", "title": "" }, { "docid": "0e522c4d65ff0852bd40869161ed826b", "score": "0.52987903", "text": "function sortFunction(a, b) {\n var result = recursiveSort(a, b, sorters, 0);\n return result;\n }", "title": "" }, { "docid": "7447df59968360a1a8a39a61b1910467", "score": "0.5275392", "text": "indexOf(noodle, sList, el) {\n var list = sList.list;\n var mid;\n var min = 0;\n var max = list.length - 1;\n var comp;\n\n while (min <= max) {\n mid = Math.floor((min + max) / 2);\n comp = sList.compare(el, list[mid]);\n\n //If el < list[mid]\n if (comp < 0) {\n max = mid - 1;\n }\n //If el > list[mid]\n else if (comp > 0) {\n min = mid + 1;\n }\n //If el == list[mid]\n else {\n return mid;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "1ade358395ced9c3e753f42b2b1a48ca", "score": "0.526971", "text": "changeSort(sort, sortAscending){\n }", "title": "" }, { "docid": "42425cc1d1fac9e866c8bfa6fa25ac68", "score": "0.5268451", "text": "static compare(a, b) { \n let array = [];\n\n for(let i = 0; i < a.length; i++) {\n let index = b.indexOf(a[i]);\n if (index !== -1) array.push({ p: i, s: index, pos: a[i]});\n }\n\n if (array.length > 0) {\n return _.sortBy(array, function(a) { return a.pos })[0]\n }\n\n return {p: -1, s: -1, pos: -1};\n }", "title": "" }, { "docid": "a5cce7ae7a3e241960f3c1e9235fdf98", "score": "0.5266119", "text": "function slava_sort_function_j(j1, j2) {\n return eval(j1 != \"\"? j1 : 0) - eval(j2 != \"\"? j2 : 0);\n}", "title": "" }, { "docid": "478764074826e29e40d180e95918a1c9", "score": "0.525331", "text": "function selectionSort(arr, compare_Function) {\n function compare(a, b) {\n return a - b;\n } \n var min = 0,\n index = 0,\n temp = 0;\n compare_Function = compare_Function || compare;\n \n for (var i = 0; i < arr.length; i += 1) {\n index = i;\n min = arr[i];\n for (var j = i + 1; j < arr.length; j += 1) {\n if (compare_Function(min, arr[j]) > 0) {\n min = arr[j];\n index = j;\n }\n }\n temp = arr[i];\n arr[i] = min;\n arr[index] = temp;\n }\n return arr;\n }", "title": "" }, { "docid": "302a4042182516ce8335c1107c468cd8", "score": "0.52531415", "text": "function sortfn( a, b )\r\t\t{\r\t\t if( !( a instanceof ScriptInfo ) )\r\t\t return -1;\r\t\t if( !( b instanceof ScriptInfo ) )\r\t\t return 1;\r\t\t \r\t\t\tif( a.label < b.label )\r\t\t\t\treturn -1;\r\t\t\telse if( a.label > b.label )\r\t\t\t\treturn 1;\r\t\t\telse\r\t\t\t\treturn 0;\r\t\t}", "title": "" }, { "docid": "f2f8f88fdde9fd6e9fdf86326bbec268", "score": "0.5248119", "text": "function sortIngredients(ingredients) {\n const inputSearchIngredients = document.querySelector(\"#search-ingredient\");\n\n inputSearchIngredients.addEventListener(\"input\", (e) => {\n let valueInputIngredients = e.target.value;\n\n if (valueInputIngredients.length >= 3) {\n let inputsIngredients = valueInputIngredients.split(\" \");\n if (valueInputIngredients) {\n ingredients.forEach((ingredient, index) => {\n //\n\n let matched = inputsIngredients.every((input) =>\n searchMatchIngredients(ingredient, input)\n );\n\n if (matched == true) {\n ingredients.splice(index, 1);\n matchedIngredients.push(ingredient);\n sousMenu.style.display = \"block\";\n }\n });\n\n // showTag();\n // removeTag();\n console.log(matchedIngredients);\n displayIngredients(matchedIngredients);\n return matchedIngredients;\n }\n } else if (valueInputIngredients == 0) {\n matchedIngredients.forEach((removeIngredient) => {\n ingredients.push(removeIngredient);\n });\n matchedIngredients = [];\n sousMenu.style.display = \"none\";\n displayIngredients(ingredients);\n }\n });\n}", "title": "" }, { "docid": "4fb154aeaf795a9e5bf479600ffcfe69", "score": "0.5233727", "text": "function sortFunction(a, b) // array.sort returns a + b\n{\n if(a[1] === b[1]) // if the same ([1] is the score, [0] is name)\n {\n return 0; // return same\n }\n else // else\n {\n return (a[1] > b[1]) ? -1 : 1; // if a is bigger than b return it\n }\n}", "title": "" }, { "docid": "a093671a7f2a858765d89da4216360ff", "score": "0.5215289", "text": "function sortByProcedure(arr) {\n var procs = arr.map(getProcedure);\n for (var i = 1; i < arr.length; i++) {\n var procNew = procs[i];\n if (procNew < 0)\n continue;\n for (var j = i - 1; j >= 0 && procNew < procs[j]; j--) {\n var token = arr[j + 1];\n arr[j + 1] = arr[j];\n arr[j] = token;\n procs[j + 1] = procs[j];\n procs[j] = procNew;\n }\n }\n}", "title": "" }, { "docid": "a093671a7f2a858765d89da4216360ff", "score": "0.5215289", "text": "function sortByProcedure(arr) {\n var procs = arr.map(getProcedure);\n for (var i = 1; i < arr.length; i++) {\n var procNew = procs[i];\n if (procNew < 0)\n continue;\n for (var j = i - 1; j >= 0 && procNew < procs[j]; j--) {\n var token = arr[j + 1];\n arr[j + 1] = arr[j];\n arr[j] = token;\n procs[j + 1] = procs[j];\n procs[j] = procNew;\n }\n }\n}", "title": "" }, { "docid": "a093671a7f2a858765d89da4216360ff", "score": "0.5215289", "text": "function sortByProcedure(arr) {\n var procs = arr.map(getProcedure);\n for (var i = 1; i < arr.length; i++) {\n var procNew = procs[i];\n if (procNew < 0)\n continue;\n for (var j = i - 1; j >= 0 && procNew < procs[j]; j--) {\n var token = arr[j + 1];\n arr[j + 1] = arr[j];\n arr[j] = token;\n procs[j + 1] = procs[j];\n procs[j] = procNew;\n }\n }\n}", "title": "" }, { "docid": "a093671a7f2a858765d89da4216360ff", "score": "0.5215289", "text": "function sortByProcedure(arr) {\n var procs = arr.map(getProcedure);\n for (var i = 1; i < arr.length; i++) {\n var procNew = procs[i];\n if (procNew < 0)\n continue;\n for (var j = i - 1; j >= 0 && procNew < procs[j]; j--) {\n var token = arr[j + 1];\n arr[j + 1] = arr[j];\n arr[j] = token;\n procs[j + 1] = procs[j];\n procs[j] = procNew;\n }\n }\n}", "title": "" }, { "docid": "c5837bab151acdc25e7a34b12c578a3a", "score": "0.52113163", "text": "function mySorting(a,b) {\r\n\t\t\ta = a[1];\r\n\t\t\tb = b[1];\r\n\t\t\treturn a == b ? 0 : (a < b ? 1 : -1)\r\n\t\t}", "title": "" }, { "docid": "772436d8291abd083745726fda996095", "score": "0.5206639", "text": "function getIndexToIns(arr, num) {\n var newArr = [];\n for (var i = 0; i < arr.length; i++) {\n newArr.push(arr[i]);\n }\n newArr.push(num);\n console.log(newArr);\n var sorted = newArr.sort((function (a, b) {\n return a - b\n }));\n console.log(sorted);\n var numI = sorted.indexOf(num);\n return (numI);\n\n // return num;\n}", "title": "" }, { "docid": "8ca26bf1f34f507fb6a77226792f7312", "score": "0.5203988", "text": "function sortby(l, f) {\n var newlist = l.map(i=>i)\n return newlist.sort((a,b)=>f(a)>f(b))\n}", "title": "" }, { "docid": "780d8cf6e05e086be7aa8b3324565682", "score": "0.5199566", "text": "indexOfPlus(noodle, sList, el, min, max) {\n var list = sList.list;\n var mid;\n var comp;\n\n while (min <= max) {\n mid = Math.floor((min + max) / 2);\n comp = sList.compare(el, list[mid]);\n\n //If el < list[mid]\n if (comp < 0) {\n max = mid - 1;\n }\n //If el > list[mid]\n else if (comp > 0) {\n min = mid + 1;\n }\n //If el == list[mid]\n else {\n return mid;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "4ffe9dca5ec5c9f31d06f8d7d6ef4599", "score": "0.51938176", "text": "function sortCustom(array){\n\tsbit = 1;\n\tarray = shuffle(array);\n\t\n\tif(array.length > 10){\n\t\tarray = array.slice(0, 9);\n\t}\n\n\tfor(var i=0; i<array.length; i++){\n\t\tarray[i] = array[i].replaceAll(\"'\",\"''\")\n\t}\n\n\tif( array.length == 1 ){\n\t\tnameS = \"'\" + array[0] + \"'\";\n\t}else{\n\t\tnameS = \"'\" + array[0] + \"' OR Name=\";\n\t\tconsole.log(\"here?\")\n\t\tfor(var i=1; i<(array.length - 1); i++){\n\t\t\ttemp = \"'\" + array[i] + \"' OR Name=\";\n\t\t\tnameS = nameS.concat(temp);\n\t\t}\n\t\tlast = \"'\" + array[(array.length - 1)] + \"'\";\n\t\tnameS = nameS.concat(last);\n\t}\n\t\n\tparkS = parkSelect(parkArray);\n\tunion = \"\";\n\tif( parkArray.length > 1 ){\n\t\tunion = \" UNION SELECT * FROM \" \n\t\t\t\t+ parkS[1] + \" WHERE Name=\" + nameS;\n\t}\n\tvar sortQuery = \"SELECT * FROM \" + parkS[0] + \" WHERE Name=\" \n\t\t\t\t\t+ nameS + union + \" ORDER BY Park, Land, Rank DESC\";\n\n\tlastQuery = sortQuery;\n\tselectRow(sortQuery, function (placeHolder) { });\n}", "title": "" }, { "docid": "1e4abfe1866ce1cefd1fb621730c33d0", "score": "0.51924133", "text": "function sort() {\n var a = Array.from(arguments);\n return a.sort();\n}", "title": "" }, { "docid": "930eae4638d5e48575d8dd449d28d832", "score": "0.51917964", "text": "function itemCmp(a,b){// Sort first based on selector specificity.\nvar s1=_lumino_domutils__WEBPACK_IMPORTED_MODULE_1__[\"Selector\"].calculateSpecificity(a.selector);var s2=_lumino_domutils__WEBPACK_IMPORTED_MODULE_1__[\"Selector\"].calculateSpecificity(b.selector);if(s1!==s2){return s2-s1;}// If specificities are equal, sort based on rank.\nvar r1=a.rank;var r2=b.rank;if(r1!==r2){return r1<r2?-1:1;// Infinity-safe\n}// When all else fails, sort by item id.\nreturn a.id-b.id;}", "title": "" }, { "docid": "37ed76ccc04ca657f4714a8c2c9cf8e7", "score": "0.51905984", "text": "function sortUstensils(ustensils) {\n const inputSearchUstensils = document.querySelector(\"#search-ustensiles\");\n\n inputSearchUstensils.addEventListener(\"input\", (e) => {\n let valueInputUstensils = e.target.value;\n\n if (valueInputUstensils.length >= 3) {\n let inputsUstensils = valueInputUstensils.split(\" \");\n if (valueInputUstensils) {\n ustensils.forEach((ustensil, index) => {\n //\n\n let matched = inputsUstensils.every((input) =>\n searchMatchUstensils(ustensil, input)\n );\n\n if (matched == true) {\n ustensils.splice(index, 1);\n matchedUstensils.push(ustensil);\n sousMenuUstensile.style.display = \"block\";\n }\n });\n\n // showTag();\n // removeTag();\n console.log(matchedUstensils);\n displayUstensils(matchedUstensils);\n return matchedUstensils;\n }\n } else if (valueInputUstensils == 0) {\n matchedUstensils.forEach((removeUstensil) => {\n ustensils.push(removeUstensil);\n });\n matchedUstensils = [];\n sousMenuUstensile.style.display = \"none\";\n displayUstensils(ustensils);\n }\n });\n}", "title": "" }, { "docid": "08c4b0162b0b16573c233b3a53c39989", "score": "0.5190005", "text": "function sortSelect_tank3Cp(l) {\n var i, j, min, minat;\n\n for (i = 0; i < (l.length - 1); i++)\n {\n minat = i;\n min = l[i];\n for (j = i + 1; j < (l.length); j++) //select the min of the rest of array\n {\n if (min > l[j]) //ascending order for descending reverse\n {\n minat = j; //the position of the min element \n min = l[j];\n }\n }\n var temp = l[i];\n l[i] = l[minat]; //swap \n l[minat] = temp;\n }\n\n}", "title": "" }, { "docid": "4aae715ab09c0e318de84d9e69192fc9", "score": "0.51878667", "text": "changeSort(sort, sortAscending) {}", "title": "" }, { "docid": "11ef2327ee0327790cbab57ac52879be", "score": "0.51877236", "text": "function selectionSort2(basket) {\n for (let base = 0; base < basket.length; base++) {\n let lowest = base;\n for (var scout = base + 1; scout < basket.length; scout++) {\n if (basket[lowest] > basket[scout]) lowest = scout;\n }\n if (basket[lowest] !== basket[scout]) {\n temp = basket[lowest];\n basket[lowest] = basket[base];\n basket[base] = temp;\n }\n }\n return console.log(basket);\n}", "title": "" }, { "docid": "9ba5d7f524e84a050449a32341bed19a", "score": "0.5187217", "text": "function binarySearch(ar, el, compare_fn) {\n var m = 0;\n var n = ar.length - 1;\n while (m <= n) {\n var k = (n + m) >> 1;\n var cmp = compare_fn(el, ar[k]);\n if (cmp > 0) {\n m = k + 1;\n } else if(cmp < 0) {\n n = k - 1;\n } else {\n return k;\n }\n }\n return Math.min(m, ar.length - 1);\n }", "title": "" }, { "docid": "abd2cd42e4700e1509d217badffc3584", "score": "0.5180685", "text": "function sort(array) {\n // IMPLEMENT YOUR CODE HERE\n\n\n return array;\n}", "title": "" }, { "docid": "795ee74f280b91a5d48bfb128b0e7536", "score": "0.518007", "text": "function descendingOrder(n){\n //...\n}", "title": "" }, { "docid": "87a51db4d512358b89c8b52ede94dfe3", "score": "0.5157684", "text": "function sortByLength () {\n //...code here\n}", "title": "" }, { "docid": "e2a543a3c24e18a3cfc95775d1da6cd4", "score": "0.5149339", "text": "function sortResults(a, b) {\n return (a.id - b.id);\n}", "title": "" }, { "docid": "df938dff7b1217e9426d0005ddcd662f", "score": "0.5147114", "text": "function basicSearch(numbers, target) {\n\t//Input is a SORTED list of numbers\n\t//If target is in \"numbers\", return its index. Else, return -1.\n\n\tfor(let i = 0, x = numbers.length; i < x; i++) {\n\t\tif (numbers[i] === target) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "26c9fb251c2d332ad76a0fa8028ca613", "score": "0.51445246", "text": "function solution(nums){\n if (nums == null) {\n return []\n } else {\n return nums.sort(function(a,b){return a-b})\n // console.log(nums)\n }\n}", "title": "" }, { "docid": "151c08f8e74113c5a147ba3d72e4bf48", "score": "0.5132304", "text": "static sort( values ) {\r\n return this.quicksort( values, 0, values.length - 1 );\r\n }", "title": "" }, { "docid": "584a3c1c54c69b13649731eba0624d0c", "score": "0.51281303", "text": "isOrdered(){\n return Ord_stim.isOrdered(this.numbers);\n }", "title": "" }, { "docid": "578128ad623c50cffc6db6e99abac546", "score": "0.5110281", "text": "function orderAlphabetically() {}", "title": "" }, { "docid": "578128ad623c50cffc6db6e99abac546", "score": "0.5110281", "text": "function orderAlphabetically() {}", "title": "" }, { "docid": "cec1fbaa4feca22e93e82c3a787806ba", "score": "0.51088434", "text": "function sortAlphabetically() {\n // 1. Get list of Books & sort, save the sorted books array inside the library.\n myLibrary.books = myLibrary.sortAlphabetically();\n // 2. Display the result on the page. \n displayResult(myLibrary);\n }", "title": "" }, { "docid": "a7bc6f6b399edfd8fb3ab8e9b1275c11", "score": "0.51074183", "text": "function numerically(a,b) { return a < b ? -1 : a > b ? 1 : 0; } // creates a function that helps the array method 'sort' sort by number value instead of string value", "title": "" }, { "docid": "f91a398f80b2ce35f5b5924236bba095", "score": "0.51017296", "text": "function sortNumber(a,b) {return a - b; }", "title": "" }, { "docid": "3dbecccdc57b774ca1ebb197258e7ecf", "score": "0.50996435", "text": "function selectionSort01(inputArray){\n\tvar minNum = 0;\n\tvar temp = 0;\n\tvar swapElementIndex = 0;\n\tfor(var i = 0; i < inputArray.length; i++){\n\t\tminNum = inputArray[i]; // got the first min number\n\t\tfor(var currentIndex = (i+1); currentIndex < inputArray.length; currentIndex++){\n\t\t\tif(inputArray[currentIndex] < minNum){\n\t\t\t\tminNum = inputArray[currentIndex];\n\t\t\t\tswapElementIndex = currentIndex;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(minNum !== inputArray[i]){\n\t\t\t// swapping the Numbers\n\t\t\ttemp = inputArray[i];\n\t\t\tinputArray[i] = minNum;\n\t\t\tinputArray[swapElementIndex] = temp;\n\t\t}\t\t\n\t\t\n\t}\n\t\n\treturn inputArray;\t\n}", "title": "" }, { "docid": "faa2f78986e955b8765472beab915bad", "score": "0.5094972", "text": "function getBestResults(param1, param2) {\nvar bestSolutions = [];\nfor (var i = 0; i < param1.length; i++) {\nif (param1[i] === param2) {\nbestSolutions.push(i);\n}\n}\nreturn bestSolutions;\n}", "title": "" }, { "docid": "111aeea00b95ae5d915fffd7d8adcb56", "score": "0.5092188", "text": "function sortCall(a, b) {\n _loopCounter = 0;\n return sortCallbackHandler(a, b, _loopCounter, _inOutType);\n }", "title": "" }, { "docid": "0e76cb7140dc0a6acf373d4c8a9ae2e5", "score": "0.5088412", "text": "function alphabetical (arr){\n const restult11 = arr.sort ()\n console.log (restult11)\n}", "title": "" }, { "docid": "6db0bfe9db31655732d8a2a44b8ab1ff", "score": "0.5079105", "text": "function sortitlg(a,b){\n\t\t\treturn(a-b)\n\t\t}", "title": "" }, { "docid": "1beba00f8e0cfb087d3a5fbbf7604fd8", "score": "0.507597", "text": "function main() {\n test(secondIndexOf([2, 5, 2, 5, 3, 2], 2), 2);\n test(secondIndexOf([2, 5, 2, 5, 3, 2, 3], 3), 6);\n test(secondIndexOf([2, 5, 2, 5, 3, 2, 3], 5), 3);\n test(firstDuplicate([2, 2]), 2);\n test(firstDuplicate([2, 4, 3, 5, 1]), -1);\n test(firstDuplicate([2, 1, 3, 5, 3, 2]), 3);\n test(firstDuplicate([2, 5, 2, 5, 3, 2]), 2);\n test(firstDuplicate([2, 1, 3, 1, 3, 2]), 1);\n test(firstDuplicate([2, 2, 3, 3, 3, 5, 3, 1]), 2);\n test(firstDuplicate([0, 1, 3, 2, 4, 5, 7, 6]), -1);\n test(firstDuplicate([2, 5, 2, 5, 3, 2, 3, 2, 5, 4]), 2);\n}", "title": "" }, { "docid": "1369d615e33ddd59fa5a19db0aa0c2a1", "score": "0.5073487", "text": "function getIndexToIns(arr, num) {\r\n arr.sort((a,b) => a-b);\r\n console.log(arr)\r\n if(arr.length === 0 ) {\r\n return 0;\r\n } else if (arr[arr.length-1] < num) {\r\n return arr.length;\r\n } else if (arr[arr.length-1] >= num) {\r\n return arr.findIndex((item) => {\r\n return item >= num; \r\n })\r\n }\r\n \r\n}", "title": "" }, { "docid": "a63b2339d6ebc1d8e51d9b8e33180047", "score": "0.5073484", "text": "function selectionSort(items) {\n let len = items.length\n for (let i = 0 ; i < (len-1) ; i++) {\n let previous_item = i;\n\n for (let j = i + 1 ; j < len ; j++ ) {\n if (items[j] < items[previous_item]) {\n previous_item = j;\n }\n }\n\n if (previous_item !== i) {\n let tmp = items[i];\n items[i] = items[previous_item];\n items[previous_item] = tmp;\n }\n }\n\n\n}", "title": "" }, { "docid": "47d5939c79765fa97b405c8093658ec9", "score": "0.50732493", "text": "function sorthelper(from, to, temp){\n if( from < to){\n let middle = Math.floor((from+to)/2);\n sorthelper(from, middle, temp);\n sorthelper(middle+1, to, temp);\n mergehelper(from, middle, to, temp);\n }\n}", "title": "" }, { "docid": "a7d8c8ada76181d2169e521ae6a654e6", "score": "0.5073023", "text": "function sortNumber(a,b) {\n return a - b;\n }", "title": "" }, { "docid": "e48703c6d825a7fe19d845e7741f6dd9", "score": "0.5069637", "text": "function sortNumber(a,b)\n{\n return a - b;\n}", "title": "" }, { "docid": "ac054f5448dcf92978a40a9d431e1225", "score": "0.50658226", "text": "function sortByPrice() {\n // 1. Get list of Books & sort, save the sorted books array inside the library.\n myLibrary.books = myLibrary.sortByPrice();\n // 2. Display the result on the page. \n displayResult(myLibrary);\n }", "title": "" }, { "docid": "2f637ff82e17d3839a886e2fd70617bb", "score": "0.50627655", "text": "function getFruit(a, b, c, d) {\n return [a, b, c, d].sort()[1]\n}", "title": "" }, { "docid": "a8c67bfad55db59cd068d0b4719625a9", "score": "0.506002", "text": "function binarySearch(ar, el, compare_fn) {\n let m = 0;\n let n = ar.length - 1;\n while (m <= n) {\n let k = (n + m) >> 1;\n let cmp = compare_fn(el, ar[k]);\n if (cmp > 0) {\n m = k + 1;\n } else if (cmp < 0) {\n n = k - 1;\n } else {\n return k;\n }\n }\n return -m - 1;\n}", "title": "" }, { "docid": "37de416d654a8e25d3258842adf0203a", "score": "0.5054685", "text": "function main3() {\n console.log(\"***** 3. *******\")\n\n \n let test1 = helper.pageArrays(95, 3)\n console.log(test1)\n\n let test2 = helper.pageArrays(95, 65)\n console.log(test2)\n\n let test3 = helper.pageArrays(95, 92)\n console.log(test3)\n\n // what if exactly matches PAGE_BY\n let test4 = helper.pageArrays(95, 15)\n console.log(test4)\n\n let test5 = helper.pageArrays(95, 45)\n console.log(test5)\n\n}", "title": "" }, { "docid": "3fb401a058d43880c89008a65eaa995f", "score": "0.5050264", "text": "insertionsort(arr){\n var a;\n for(let i=0;i<arr.length;i++){\n for(let j=i;j>0;j--){\n if(arr[j]<arr[j-1]){\n a=arr[j];\n arr[j]=arr[j-1];\n arr[j-1]=a;\n }\n }\n }\n return arr;\n }", "title": "" }, { "docid": "fdd5f915a32cced55c97877e3243111d", "score": "0.5046948", "text": "function binarySearch (sortedList, target) {\n\n}", "title": "" }, { "docid": "1ed7ceff1b917a9573e7e54bcdffc0b0", "score": "0.50413406", "text": "function sorter($table, sortOn, direction) {\n // your code here...\n}", "title": "" }, { "docid": "51b40141614ccdda44016c94a35f6887", "score": "0.5040592", "text": "function sort(data, swapCriteria)\n{\n return data.sort(swapCriteria); \n}", "title": "" }, { "docid": "ae35ec3ae3918a3807dba8bf235c433e", "score": "0.5040108", "text": "function sortByIndex(a, b) {\n if(a.index > b.index) return 1;\n if(a.index < b.index) return -1;\n return 0;\n}", "title": "" }, { "docid": "fea3679586290d7b34c34dea518627e4", "score": "0.50327426", "text": "sortBy(field, reverse, primer) {\n const key = primer\n ? function(x) {\n return primer(x[field]);\n }\n : function(x) {\n return x[field];\n };\n\n return function(a, b) {\n a = key(a);\n b = key(b);\n return reverse * ((a > b) - (b > a));\n };\n }", "title": "" }, { "docid": "8ddb9cf124755745cf00981dce4b2397", "score": "0.50311446", "text": "function SortAlgorithm () {\n this.array = [];\n this.compare = numberCompare;\n this.reset();\n}", "title": "" } ]